first global commit

This commit is contained in:
2020-09-23 15:50:29 +02:00
commit 78adf3a099
6052 changed files with 1221183 additions and 0 deletions
@@ -0,0 +1,6 @@
<?php
//
$vars['attributes']['class']='block block-'. $vars['block']->module .' '. (isset($vars['skinr']) ? $vars['skinr'] : '');
$vars['attributes']['id'] = 'block-'. $vars['block']->module .'-'. $vars['block']->delta;
@@ -0,0 +1,93 @@
<?php
$element = $vars['element'];
// dsm($vars, $element['#field_name'].' vars');
# QUEST-CE QUE C4EST QUE CE TRUC ?
if(count($vars['items']) == 1 && $element["#field_type"] == 'text' && $vars['element']['#field_name'] != 'field_date_de_debut'){
if($vars['items'][0]['#markup'] == '' || count($vars['items'][0]['#markup']) < 5)
$vars['items'] = array();
}
if(($element["#field_type"] == 'text_long') && count($vars['items']) == 1){
if($vars['items'][0]['#markup'] == '')
$vars['items'] = array();
}
$personnes_fields = array('field_concepteur', 'field_executant', 'field_organisateur', 'field_temoin');
if(in_array($vars['element']['#field_name'], $personnes_fields)){
$vars['classes_array'][] = 'field-personne';
// dsm($vars, 'vars');
foreach ($vars['element']['#items'] as $index => $item) {
$term = $item['taxonomy_term'];
// dsm($term, 'term');
$children = array();
foreach(taxonomy_get_children($term->tid, $term->vid) as $child){
// dsm($child, 'child');
$children[] = $child->name;
}
if(count($children)){
// dsm($children, 'children');
$vars['items'][$index]["#markup"] .= ' ('.implode(', ', $children).')';
}
}
}
#images
if($element['#field_type'] == 'image' && $element['#object']->type == 'performance'){
$vars['item_classes'] = array();
$delta = 0;
foreach ($vars['items'] as $item) {
// $classes = array();
$classes[] = 'image image-'.$delta;//.' '.($delta % 2 ? 'odd' : 'even');
// if($delta == 0){
// $vars['items'][$delta]['#image_style'] = "grid_large";
// $classes[] = 'grid-large-image';
// }else if($delta < 4){
// $vars['items'][$delta]['#image_style'] = "grid_medium";
// $classes[] = 'grid-medium-image';
// }else{
// $vars['items'][$delta]['#image_style'] = "grid_small";
// $classes[] = 'grid-small-image';
// }
$vars['item_classes'][] = implode(' ', $classes);
$delta++;
}
}
#date
if($vars['element']['#field_name'] == 'field_date_de_debut' || $vars['element']['#field_name'] == 'field_date_de_fin'){
global $language;
//dsm($vars, "vars");
foreach ($vars['items'] as $i => $item) {
if($item['#markup'] != ''){
$date_parts = explode('/', $item['#markup']);
$date_str = $date_parts[0].'-'.(isset($date_parts[1]) ? $date_parts[1] : '1').'-'.(isset($date_parts[2]) ? $date_parts[2] : '1').' 00:00:00';
$date = strtotime($date_str);
//$vars['items'][$i]['#markup'] .= ' || '.$date_str . ' || '. date('d m Y', $date);
switch($language->language){
case 'fr':
$date_frmt = (isset($date_parts[1]) && isset($date_parts[2])) ? 'd m Y' : 'Y' ;
break;
case 'en':
$date_frmt = (isset($date_parts[1]) && isset($date_parts[2])) ? 'm d Y' : 'Y' ;
break;
}
$vars['items'][$i]['#markup'] = date($date_frmt, $date);
}
}
}
@@ -0,0 +1,108 @@
<?php
if (module_exists('rdf')) {
$vars['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">' . "\n";
$vars['rdf_profile'] = ' profile="' . $vars['grddl_profile'] . '"';
}
else {
$vars['doctype'] = '<!DOCTYPE html>' . "\n";
$vars['rdf_profile'] = '';
}
# Add mobile meta tags to $head ADD this to your subtheme
$heads = array();
$heads['HandheldFriendly'] = array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'HandheldFriendly',
'content' => 'true',
),
);
# Mobile Viewport Fix
# j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag
# device-width : Occupy full width of the screen in its current orientation
# initial-scale = 1.0 retains dimensions instead of zooming out if page height > device height
# maximum-scale = 1.0 retains dimensions instead of zooming in if page width < device width
$heads['viewport'] = array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'viewport',
'content' => 'width=device-width,initial-scale=1',
),
);
# Add these icons links to your sub theme
# or Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references
// $head[] = '<link rel="apple-touch-icon" sizes="72x72" href="'. base_path() . path_to_theme() .'/touch-icon-ipad.png'.'"/>' . "\n";
// $head[] = '<link rel="apple-touch-icon" sizes="114x114" href="'. base_path() . path_to_theme() .'/touch-icon-iphone4.png'.'"/>' . "\n";
$heads['icon'] = array(
'#tag' => 'link',
'#attributes' => array(
'href' => base_path() . path_to_theme() .'/perf-art.ico',
'rel' => 'shortcut icon',
// 'type' => 'image/png',
),
);
$heads['apple-touch-icon'] = array(
'#tag' => 'link',
'#attributes' => array(
'href' => base_path() . path_to_theme() .'/apple-touch-icon.png',
'rel' => 'apple-touch-icon',
),
);
foreach ($heads as $type=>$head)
drupal_add_html_head($head, $type);
// $vars['head'] = implode('', $head);
# add body classes
if(isset($vars['node'])){
# from taxonomy
foreach ($vars['node']->taxonomy as $tid => $term) {
$vars['classes_array'][] = 'term-vid-'. $term->vid .' term-tid-'. $tid;
}
# from menu
$mlid = db_result(db_query("SELECT mlid FROM {menu_links} WHERE link_path = '%s'", 'node/'. $vars['node']->nid));
// Now get the menu related information.
if (!empty($mlid) || !empty($node->menu['mlid']) || !empty($node->menu['plid'])) {
$menu_link = menu_link_load($mlid);
// krumo($menu_link);
$vars['classes_array'][] = ' mlid-'. $menu_link['mlid'] .' plid-'. $menu_link['plid'];
}
}
# theme layout settings
if(isset($vars['page']['sidebar_first']) && isset($vars['page']['sidebar_second'])){
$layout = 'two-sidebars';
}else if(isset($vars['page']['sidebar_first']) || isset($vars['page']['sidebar_second'])){
$layout = isset($vars['page']['sidebar_first']) ? 'sidebar-first' : 'sidebar-second';
}else{
$layout = 'no-sidebar';
}
$vars['classes_array'][] = $layout;
if (theme_get_setting('layout_enable_settings') == 'on') {
$method = theme_get_setting('layout_method');
$vars['method'] = $method;
$vars['classes_array'][] .= ' layout-method-'.$method;
}
@@ -0,0 +1,5 @@
<?php
//dsm($vars, '$vars');
$vars['htmlid'] = "myList-nav";
?>
@@ -0,0 +1,9 @@
<?php
// dsm($vars);
if(isset($vars['content']['links']['translation']))
unset($vars['content']['links']['translation']);
if($vars['elements']['#node']->type == 'effectuation')
unset($vars['title']);
@@ -0,0 +1,53 @@
<?php
/**
* @file template.preprocess-page.inc
*/
/**
* Override or insert variables into page templates.
*
* @param $vars
* A sequential array of variables to pass to the theme template.
* @param $hook
* The name of the theme function being called.
*/
# set variables for the logo and slogan (from Deco drupal 6.x theme)
$site_fields = array();
if ($vars['site_name']) {
$site_fields[] = check_plain($vars['site_name']);
}
// if ($vars['site_slogan']) {
// $site_fields[] = check_plain($vars['site_slogan']);
// }
$vars['site_title'] = '<h1><a href="/">'. implode(' ', $site_fields) .'</a></h1>';
if (theme_get_setting('layout_enable_settings') == 'on')
$vars['method'] = theme_get_setting('layout_method');
$vars['primary_local_tasks'] = menu_primary_local_tasks();
$vars['secondary_local_tasks'] = menu_secondary_local_tasks();
global $language;
drupal_add_js(array('perfarttimeline' => array(
'strings'=>array(
'search'=>t('search'),
'filter'=>t('filter'),
'site_name'=>t(variable_get('site_name', '')),
'site_slogan'=>t(variable_get('site_slogan', '')),
'advanced_nav'=>t("Advanced navigation"),
'classical_nav'=>t("Classical navigation"),
'loading_timeline' => t('Timeline is loading, it will start in a few seconds.'),
),
'theme_path'=> drupal_get_path('theme', 'perfarttimeline'),
'language'=>$language->language,
)), 'setting');
@@ -0,0 +1,3 @@
<?php
$vars['attributes_array']['id'] = str_replace('_', '-',$vars['region']);