/** * Implements hook_form_system_theme_settings_alter() */ function drupalexp_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL) { $theme_key = arg(3); if (file_exists(drupal_get_path('theme', $theme_key) . '/template.php')) { require_once drupal_get_path('theme', $theme_key) . '/template.php'; } $theme = drupalexp_get_theme(); $form['drupalexp_settings'] = array('#type' => 'vertical_tabs'); $form['drupal_core_settings'] = array('#type' => 'fieldset', '#title' => 'Drupal core', '#group' => 'drupalexp_settings', '#weight' => 99); $form['drupal_core_settings']['theme_settings'] = $form['theme_settings']; $form['drupal_core_settings']['logo'] = $form['logo']; $form['drupal_core_settings']['favicon'] = $form['favicon']; unset($form['theme_settings']); unset($form['logo']); unset($form['favicon']); drupalexp_layout_settings_form_alter($form); drupalexp_preset_settings_form_alter($form); drupalexp_basic_settings_form_alter($form); $form['#submit'][] = 'drupalexp_form_system_theme_settings_submit'; $form['#submit'][] = 'drupalexp_form_system_theme_settings_submit'; }
<?php $theme = drupalexp_get_theme(); print $theme->pageRender(true); ?> <!--page rendered by drupalexp drupal theme framework-->
/** * Calculate primary column width */ function drupalexp_calculate_primary($section_index, $primary_region_index) { $theme = drupalexp_get_theme(); $devices = array('colxs', 'colsm', 'colmd', 'collg'); foreach ($devices as $device) { $theme->layouts[$theme->layout]->sections[$section_index]->regions[$primary_region_index]->{$device} = 12; foreach ($theme->layouts[$theme->layout]->sections[$section_index]->regions as $region_index => $region) { if ($region_index != $primary_region_index) { if (element_children($theme->page['page'][$region->key])) { $theme->layouts[$theme->layout]->sections[$section_index]->regions[$primary_region_index]->{$device} -= $theme->layouts[$theme->layout]->sections[$section_index]->regions[$region_index]->{$device}; if ($theme->layouts[$theme->layout]->sections[$section_index]->regions[$primary_region_index]->{$device} <= 0) { $theme->layouts[$theme->layout]->sections[$section_index]->regions[$primary_region_index]->{$device} = 12; } } } } } }
/** * Implement hook_process_region */ function drupalexp_process_region(&$vars) { $theme = drupalexp_get_theme(); switch ($vars['elements']['#region']) { case 'content': $vars['messages'] = $theme->page['messages']; $vars['title_prefix'] = $theme->page['title_prefix']; $vars['title'] = $theme->page['title']; $vars['title_suffix'] = $theme->page['title_suffix']; $vars['tabs'] = $theme->page['tabs']; $vars['action_links'] = $theme->page['action_links']; $vars['feed_icons'] = $theme->page['feed_icons']; $vars['breadcrumb'] = $theme->page['breadcrumb']; break; case 'logo': $vars['logo'] = $theme->page['logo']; $vars['logo_img'] = !is_null($vars['logo']) ? '<img src="' . $vars['logo'] . '" id="logo"/>' : ''; $vars['linked_logo'] = !is_null($vars['logo']) ? l($vars['logo_img'], '<front>', array('html' => TRUE, 'attributes' => array('rel' => 'home'))) : ''; break; case 'title': $vars['title_prefix'] = $theme->page['title_prefix']; $vars['title'] = $theme->page['title']; $vars['title_suffix'] = $theme->page['title_suffix']; break; } }
/** * Implements hook_form_system_theme_settings_alter() */ function drupalexp_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL) { $theme_key = arg(3); if (file_exists(drupal_get_path('theme', $theme_key) . '/template.php')) { require_once drupal_get_path('theme', $theme_key) . '/template.php'; } $theme = drupalexp_get_theme(); $form['drupalexp_settings'] = array('#type' => 'vertical_tabs'); $form['drupal_core_settings'] = array('#type' => 'fieldset', '#title' => 'Drupal core', '#group' => 'drupalexp_settings', '#weight' => 99); $form['drupal_core_settings']['theme_settings'] = $form['theme_settings']; $form['drupal_core_settings']['logo'] = $form['logo']; $form['drupal_core_settings']['favicon'] = $form['favicon']; unset($form['theme_settings']); unset($form['logo']); unset($form['favicon']); drupalexp_layout_settings_form_alter($form); drupalexp_preset_settings_form_alter($form); drupalexp_basic_settings_form_alter($form); $form['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb settings')); $form['breadcrumb']['yourthemename_breadcrumb'] = array('#type' => 'select', '#title' => t('Display breadcrumb'), '#default_value' => theme_get_setting('yourthemename_breadcrumb'), '#options' => array('yes' => t('Yes'), 'admin' => t('Only in admin section'), 'no' => t('No'))); $form['breadcrumb']['breadcrumb_options'] = array('#type' => 'container', '#states' => array('invisible' => array(':input[name="yourthemename_breadcrumb"]' => array('value' => 'no')))); $form['breadcrumb']['breadcrumb_options']['yourthemename_breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. DonÕt forget to include spaces.'), '#default_value' => theme_get_setting('yourthemename_breadcrumb_separator'), '#size' => 5, '#maxlength' => 10); $form['breadcrumb']['breadcrumb_options']['yourthemename_breadcrumb_home'] = array('#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), '#default_value' => theme_get_setting('yourthemename_breadcrumb_home')); $form['breadcrumb']['breadcrumb_options']['yourthemename_breadcrumb_trailing'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => theme_get_setting('yourthemename_breadcrumb_trailing'), '#description' => t('Useful when the breadcrumb is placed just before the title.'), '#states' => array('disabled' => array(':input[name="yourthemename_breadcrumb_title"]' => array('checked' => TRUE)), 'unchecked' => array(':input[name="yourthemename_breadcrumb_title"]' => array('checked' => TRUE)))); $form['breadcrumb']['breadcrumb_options']['yourthemename_breadcrumb_title'] = array('#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), '#default_value' => theme_get_setting('yourthemename_breadcrumb_title'), '#description' => t('Useful when the breadcrumb is not placed just before the title.')); $form['#submit'][] = 'drupalexp_form_system_theme_settings_submit'; $form['#validate'][] = 'drupalexp_form_system_theme_settings_validate'; }