FINAL suepr merge step : added all modules to this super repos
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
//
|
||||
|
||||
$vars['attributes']['class']='block block-'. $vars['block']->module .' '. (isset($vars['skinr']) ? $vars['skinr'] : '');
|
||||
$vars['attributes']['id'] = 'block-'. $vars['block']->module .'-'. $vars['block']->delta;
|
||||
|
||||
$vars['block']->subject = t($vars['block']->subject);
|
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file template.preprocess-comment-wrapper.inc
|
||||
*/
|
||||
|
||||
global $theme;
|
||||
|
||||
$classes = array();
|
||||
|
||||
# Add support for Skinr module classes http://drupal.org/project/skinr
|
||||
if (function_exists('node_skinr_data') && !empty($vars['skinr'])) {
|
||||
$classes[] = $vars['skinr'];
|
||||
}
|
||||
|
||||
# Class for content types: "forum-comments", "blog-comments", etc.
|
||||
$vars['classes'] .= ' '. $vars['node']->type .'-comments';
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
// dsm($vars);
|
||||
|
||||
$vars['theme_hook_suggestions'][] = 'field__' . $vars['element']['#view_mode'];
|
||||
$vars['theme_hook_suggestions'][] = 'field__' . $vars['element']['#field_type'] . '__' . $vars['element']['#view_mode'];
|
||||
$vars['theme_hook_suggestions'][] = 'field__' . $vars['element']['#field_name'] . '__' . $vars['element']['#view_mode'];
|
||||
|
||||
|
||||
if($vars['element']['#field_name'] == 'field_materiau_image'){
|
||||
global $user;
|
||||
// dsm($vars);
|
||||
if(isset($user->roles[1])){
|
||||
$items = $vars['items'];
|
||||
$vars['items'] = array($items[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# this does not work because of security probleme
|
||||
# http://drupal.org/node/1923554
|
||||
# http://drupal.stackexchange.com/questions/63226/drupal-7-20-image-styles-return-a-url-with-access-denied
|
||||
// if($vars['element']['#field_type'] == 'text_with_summary'){
|
||||
// foreach ($vars['items'] as $key => $value) {
|
||||
// $text = $vars['items'][$key]['#markup'];
|
||||
// parseImagesOntext($text);
|
||||
// $vars['items'][$key]['#markup'] = $text;
|
||||
// }
|
||||
// }
|
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
// dsm($vars, 'vars');
|
||||
|
||||
$vars['link_text'] = $vars['flag']->title;
|
141
sites/all/themes/gui/materiobasetheme/preprocess/html.pre.php
Normal file
141
sites/all/themes/gui/materiobasetheme/preprocess/html.pre.php
Normal file
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
// dsm($vars, 'vars');
|
||||
|
||||
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',
|
||||
// ),
|
||||
// );
|
||||
|
||||
$heads['apple-mobile-web-app-capable'] = array(
|
||||
'#tag' => 'meta',
|
||||
'#attributes' => array(
|
||||
'name' => 'apple-mobile-web-app-capable',
|
||||
'content' => 'yes',
|
||||
),
|
||||
);
|
||||
|
||||
# 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,maximum-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() .'/materio-icon.png',
|
||||
'rel' => 'shortcut icon',
|
||||
'type' => 'image/png',
|
||||
),
|
||||
);
|
||||
|
||||
$heads['apple-touch-icon'] = array(
|
||||
'#tag' => 'link',
|
||||
'#attributes' => array(
|
||||
'href' => $GLOBALS['base_url'] . base_path() . path_to_theme() .'/materio-touch-icon.png',
|
||||
'rel' => 'apple-touch-icon-precomposed',
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($heads as $type=>$head)
|
||||
drupal_add_html_head($head, $type);
|
||||
|
||||
|
||||
$node = isset($vars['node']) ? $vars['node'] : false;
|
||||
|
||||
# add body classes
|
||||
if($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'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($vars['user']->roles as $key => $value) {
|
||||
$vars['classes_array'][] = "role-" . $key;
|
||||
}
|
||||
|
||||
/*
|
||||
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;
|
||||
*/
|
||||
|
||||
$currentpath = current_path();
|
||||
$menu_item = menu_get_item($currentpath);
|
||||
// $node = false;
|
||||
// if($menu_item['page_callback'] == 'node_page_view')
|
||||
// $node = $menu_item['page_arguments'][0];
|
||||
|
||||
global $language;
|
||||
|
||||
drupal_add_js(array('materiobasetheme' => array(
|
||||
'strings'=>array(
|
||||
'search'=>t('search'),
|
||||
// 'filter'=>t('filter'),
|
||||
'site_name'=>t(variable_get('site_name', '')),
|
||||
'site_slogan'=>t(variable_get('site_slogan', '')),
|
||||
),
|
||||
'themePath'=> drupal_get_path('theme', 'materiobasetheme'),
|
||||
// 'current_path' => $currentpath,
|
||||
// 'menu_item' => $menu_item,
|
||||
'page_callback' => $menu_item['page_callback'],
|
||||
'node_type' => isset($node->type) ? $node->type : false,
|
||||
'node_nid' => isset($node->nid) ? $node->nid : false,
|
||||
'language'=>$language->language,
|
||||
)), 'setting');
|
||||
|
||||
$head_title_array = array();
|
||||
foreach ($vars['head_title_array'] as $key => $value){
|
||||
if($value){
|
||||
$head_title_array[] = $value;
|
||||
}
|
||||
}
|
||||
$vars['head_title'] = $vars['head_array']['title'] = strip_tags(implode(' | ', $head_title_array));
|
||||
|
||||
|
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
// dsm($vars);
|
||||
$node = $vars['node'];
|
||||
|
||||
|
||||
|
||||
// $classes = array();
|
||||
$vars['classes_array'][] = 'node-'.$node->nid;
|
||||
// $vars['classes_array'][] = 'node type-'.$node->type;
|
||||
$vars['classes_array'][] = 'vm-'.$vars['view_mode'];
|
||||
// $classes[] = 'node-' . $vars['type'] . '-' . $vars['view_mode'];
|
||||
|
||||
if($vars['sticky'])
|
||||
$vars['classes_array'][] = "sticky";
|
||||
|
||||
if (!$vars['status'])
|
||||
$vars['classes_array'][] = "unpublished";
|
||||
|
||||
if (isset($vars['flags']))
|
||||
$vars['classes_array'][] = "flaged";
|
||||
|
||||
// $vars['classes_array'][] = $hook.' '.$hook.'-'.$vars['zebra'];
|
||||
|
||||
if (isset($vars['workflow']))
|
||||
$vars['classes_array'][] = "workflow-".$vars['workflow'];
|
||||
|
||||
|
||||
$vars['theme_hook_suggestions'][] = 'node__'.$vars['view_mode'];
|
||||
$vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__' . $vars['view_mode'];
|
||||
|
||||
if($vars['view_mode'] == 'bookmark')
|
||||
unset($vars['content']['links']);
|
||||
|
||||
// dsm($vars);
|
||||
|
||||
|
||||
if($vars['type'] == 'didactique'){
|
||||
// dsm($node, 'node');
|
||||
if(!empty($node->field_emvideo))
|
||||
$vars['classes_array'][] = "emvideo";
|
||||
}
|
||||
|
@@ -0,0 +1,54 @@
|
||||
<?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="/">'. $vars['site_name'] .'</a><span class="beta">beta</span></h1>'.'<span class="slogan">'.$vars['site_slogan'].'</span>';
|
||||
|
||||
|
||||
|
||||
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();
|
||||
|
||||
|
||||
$vars['title'] = false;
|
||||
$vars['breadcrumb'] = false;
|
||||
|
||||
// global $language;
|
||||
|
||||
// drupal_add_js(array('materiobasetheme' => array(
|
||||
// 'strings'=>array(
|
||||
// 'search'=>t('search'),
|
||||
// // 'filter'=>t('filter'),
|
||||
// 'site_name'=>t(variable_get('site_name', '')),
|
||||
// 'site_slogan'=>t(variable_get('site_slogan', '')),
|
||||
// ),
|
||||
// 'themePath'=> drupal_get_path('theme', 'materiobasetheme'),
|
||||
// 'language'=>$language->language,
|
||||
// )), 'setting');
|
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
// print '<pre>';
|
||||
// print_r($vars);
|
||||
// print '</pre>';
|
||||
|
||||
|
||||
$vars['print']['site_name'] = variable_get('site_name', '');
|
||||
$vars['print']['site_slogan'] = variable_get('site_slogan', '');
|
||||
|
||||
$site_title = array();
|
||||
// $site_title[] = $vars['print']['title'];
|
||||
$site_title[] = $vars['print']['site_name'];
|
||||
$site_title[] = $vars['print']['site_slogan'];
|
||||
|
||||
$vars['print']['site_title'] = implode(' | ', $site_title);
|
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$vars['attributes_array']['id'] = str_replace('_', '-',$vars['region']);
|
Reference in New Issue
Block a user