preprocess.inc in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 7.3
File
modules/custom/varbase_support/includes/preprocess.inc
View source
<?php
function varbase_support_preprocess_html(&$variables) {
if (arg(0) == 'node' && arg(1) == 'add' && arg(2) === NULL) {
$variables['classes_array'] = array_diff($variables['classes_array'], array(
'page-node-add',
'page-node',
));
}
}
function varbase_support_preprocess_node(&$variables) {
if ($variables['display_submitted']) {
$date = $variables['date'];
$isodate = format_date($variables['created'], 'custom', 'c');
$variables['submitted'] = t('Submitted by !username on !datetime', array(
'!username' => $variables['name'],
'!datetime' => theme('varbase_time', array(
'date' => $date,
'isodate' => $isodate,
)),
));
}
}
function varbase_support_preprocess_panels_pane(&$vars) {
if (!empty($vars['content']['#view_mode'])) {
$vars['theme_hook_suggestions'][] = 'panels_pane__' . $vars['content']['#view_mode'];
}
if (!empty($vars['content']['#bundle'])) {
$vars['theme_hook_suggestions'][] = 'panels_pane__' . $vars['content']['#bundle'];
}
if (!empty($vars['content']['#bundle']) && !empty($vars['content']['#view_mode'])) {
$vars['theme_hook_suggestions'][] = 'panels_pane__' . $vars['content']['#bundle'] . '__' . $vars['content']['#view_mode'];
}
}
function varbase_support_preprocess_fieldable_panels_pane(&$vars) {
if (!empty($vars['elements']['#view_mode'])) {
$vars['theme_hook_suggestions'][] = 'fieldable_panels_pane__' . $vars['elements']['#view_mode'];
$vars['theme_hook_suggestions'][] = 'fieldable_panels_pane__' . $vars['elements']['#element']->bundle . '__' . $vars['elements']['#view_mode'];
}
}