context_reaction_theme_html.inc

Go to the documentation of this file.
00001 <?php
00002 /**
00003  * Expose themes as context reactions.
00004  */
00005 class context_reaction_theme_html extends context_reaction_theme {
00006   /**
00007    * Allow admins to provide additional body classes.
00008    */
00009   function options_form($context) {
00010     $values = $this->fetch_from_context($context);
00011     $form = array(
00012       'class' => array(
00013         '#title' => t('Section class'),
00014         '#description' => t('Provides this text as an additional body class (in <strong>$classes</strong> in html.tpl.php) when this section is active.'),
00015         '#type' => 'textfield',
00016         '#maxlength' => 64,
00017         '#default_value' => isset($values['class']) ? $values['class'] : '',
00018       ),
00019     );
00020     return $form;
00021   }
00022 
00023   /**
00024    * Set additional classes onto the 'body_classes'.
00025    */
00026   function execute(&$vars) {
00027     $classes = array();
00028     foreach ($this->get_contexts() as $k => $v) {
00029       if (!empty($v->reactions[$this->plugin]['class'])) {
00030         $vars['classes_array'][] = $v->reactions[$this->plugin]['class'];
00031       }
00032     }
00033   }
00034 }

Generated on Tue Jun 18 02:24:16 2013 for Context by  doxygen 1.4.7