theme.inc

Go to the documentation of this file.
00001 <?php
00002 
00003 /**
00004  * Preprocessor for theme('context_ui_editor').
00005  */
00006 function template_preprocess_context_ui_editor(&$vars) {
00007   drupal_add_css(drupal_get_path('module', 'context_ui') . '/context_ui.css');
00008   drupal_add_js(drupal_get_path('module', 'context_ui') . '/context_ui.js');
00009   drupal_add_js(drupal_get_path('module', 'context_ui') . '/jquery.pageEditor.js');
00010 
00011   $vars['contexts'] = $vars['form']['contexts'];
00012   unset($vars['form']['contexts']);
00013 
00014   $vars['buttons'] = $vars['form']['buttons'];
00015   unset($vars['form']['buttons']);
00016 }
00017 
00018 /**
00019  * Preprocessor for theme('context_ui_plugins').
00020  */
00021 function template_preprocess_context_ui_plugins(&$vars) {
00022   drupal_add_css(drupal_get_path("module", "context_ui") . "/context_ui.css");
00023   drupal_add_js(drupal_get_path("module", "context_ui") . "/context_ui.js");
00024   drupal_add_js(drupal_get_path('module', 'context_ui') . '/jquery.pageEditor.js');
00025 
00026   // Provide title & desc.
00027   $vars['title'] = check_plain($vars['form']['#title']);
00028   $vars['description'] = check_plain($vars['form']['#description']);
00029 
00030   // Build list of plugins.
00031   $plugins = array();
00032   $vars['plugins'] = array();
00033   foreach (element_children($vars['form']['plugins']) as $plugin) {
00034     $link = array(
00035       'title' => $vars['form']['plugins'][$plugin]['#plugin']->title . "<span class='remove'>" . t('Remove') . "</span>",
00036       'href' => $_GET['q'],
00037       'html' => TRUE,
00038       'fragment' => "context-plugin-form-{$plugin}",
00039     );
00040     $class = $vars['form']['plugins'][$plugin]['#context_enabled'] ? "context-plugin-{$plugin}" : "context-plugin-{$plugin} disabled";
00041     $vars['plugins'][$class] = $link;
00042   }
00043 }
00044 
00045 /**
00046  * Preprocessor for theme('context_ui_form').
00047  */
00048 function template_preprocess_context_ui_form(&$vars) {
00049   drupal_add_css(drupal_get_path("module", "context_ui") . "/context_ui.css");
00050   drupal_add_js(drupal_get_path("module", "context_ui") . "/context_ui.js");
00051   drupal_add_js(drupal_get_path('module', 'context_ui') . '/jquery.pageEditor.js');
00052   $vars['buttons'] = $vars['form']['buttons'];
00053   unset($vars['form']['buttons']);
00054 }

Generated on Wed Jun 19 02:24:09 2013 for Context by  doxygen 1.4.7