context.plugins.inc

Go to the documentation of this file.
00001 <?php
00002 
00003 /**
00004  * Context registry.
00005  */
00006 function _context_context_registry() {
00007   $registry = array();
00008   $registry['conditions'] = array(
00009     'context' => array(
00010       'title' => t('Context'),
00011       'description' => t('Set this context on the basis of other active contexts. Put each context on a separate line. You can use the <code>*</code> character (asterisk) as a wildcard and the <code>~</code> character (tilde) to prevent this context from activating if the listed context is active. Other contexts which use context conditions can not be used to exclude this context from activating.'),
00012       'plugin' => 'context_condition_context',
00013     ),
00014     'node' => array(
00015       'title' => t('Node type'),
00016       'description' => t('Set this context when viewing a node page or using the add/edit form of one of these content types.'),
00017       'plugin' => 'context_condition_node',
00018     ),
00019     'sitewide' => array(
00020       'title' => t('Sitewide context'),
00021       'description' => t('Should this context always be set? If <strong>true</strong>, this context will be active across your entire site.'),
00022       'plugin' => 'context_condition_sitewide',
00023     ),
00024     'path' => array(
00025       'title' => t('Path'),
00026       'description' => t('Set this context when any of the paths above match the page path. Put each path on a separate line. You can use the <code>*</code> character (asterisk) as a wildcard and the <code>~</code> character (tilde) to exclude one or more paths. Use &lt;front&gt; for the site front page.'),
00027       'plugin' => 'context_condition_path',
00028     ),
00029     'user' => array(
00030       'title' => t('User role'),
00031       'description' => t('Set this context when the current user has one of the selected role(s).'),
00032       'plugin' => 'context_condition_user',
00033     ),
00034     'user_page' => array(
00035       'title' => t('User page'),
00036       'description' => t('Set this context when viewing a user page.'),
00037       'plugin' => 'context_condition_user_page',
00038     ),
00039   );
00040   if (module_exists('menu')) {
00041     $registry['conditions']['menu'] = array(
00042       'title' => t('Menu'),
00043       'description' => t('Set this context when any of the selected menu items belong to the current active menu trail.'),
00044       'plugin' => 'context_condition_menu',
00045     );
00046   }
00047   if (module_exists('views')) {
00048     $registry['conditions']['views'] = array(
00049       'title' => t('Views'),
00050       'description' => t('Set this context when displaying the page of one of these views.'),
00051       'plugin' => 'context_condition_views',
00052     );
00053   }
00054   if (module_exists('book')) {
00055     $registry['conditions']['book'] = array(
00056       'title' => t('Book'),
00057       'description' => t('Set this context when a node in the selected book is viewed.'),
00058       'plugin' => 'context_condition_book',
00059     );
00060     $registry['conditions']['bookroot'] = array(
00061       'title' => t('Book root'),
00062       'description' => t('Set this context when viewing a node whose root book is of the selected type.'),
00063       'plugin' => 'context_condition_bookroot',
00064     );
00065   }
00066   if (module_exists('locale')) {
00067     $registry['conditions']['language'] = array(
00068       'title' => t('Language'),
00069       'description' => t('Set this context when viewing the site in the selected language.'),
00070       'plugin' => 'context_condition_language',
00071     );
00072   }
00073   if (module_exists('taxonomy')) {
00074     $registry['conditions']['node_taxonomy'] = array(
00075       'title' => t('Taxonomy'),
00076       'description' => t('Set this context when viewing a node with the selected taxonomy terms.'),
00077       'plugin' => 'context_condition_node_taxonomy',
00078     );
00079     $registry['conditions']['taxonomy_term'] = array(
00080       'title' => t('Taxonomy term'),
00081       'description' => t('Set this context when viewing a taxonomy term page.'),
00082       'plugin' => 'context_condition_taxonomy_term',
00083     );
00084   }
00085   $registry['reactions'] = array(
00086     'block' => array(
00087       'title' => t('Blocks'),
00088       'description' => t('Control block visibility using context.'),
00089       'plugin' => 'context_reaction_block',
00090     ),
00091     'region' => array(
00092       'title' => t('Regions'),
00093       'description' => t('Control Region visiblity using context.'),
00094       'plugin' => 'context_reaction_region',
00095     ),
00096     'breadcrumb' => array(
00097       'title' => t('Breadcrumb'),
00098       'description' => t('Set the breadcrumb trail to the selected menu item.'),
00099       'plugin' => 'context_reaction_breadcrumb',
00100     ),
00101     'theme' => array(
00102       'title' => t('Theme Page'),
00103       'description' => t('Control page theme variables using context.'),
00104       'plugin' => 'context_reaction_theme',
00105     ),
00106     'theme_html' => array(
00107       'title' => t('Theme HTML'),
00108       'description' => t('Control HTML theme variables using context.'),
00109       'plugin' => 'context_reaction_theme_html',
00110     ),
00111     'debug' => array(
00112       'title' => t('Debug'),
00113       'description' => t('Debug output reaction for SimpleTest.'),
00114       'plugin' => 'context_reaction_debug',
00115     ),
00116   );
00117   if (module_exists('menu')) {
00118     $registry['reactions']['menu'] = array(
00119       'title' => t('Menu'),
00120       'description' => t('Control menu active class using context.'),
00121       'plugin' => 'context_reaction_menu',
00122     );
00123   }
00124   if (module_exists('css_injector')) {
00125     $registry['reactions']['css_injector'] = array(
00126       'title' => t('CSS Injector'),
00127       'description' => t('Inject the selected css when this context is set.'),
00128       'plugin' => 'context_reaction_css_injector',
00129     );
00130   }
00131   return $registry;
00132 }
00133 
00134 /**
00135  * Context plugins.
00136  */
00137 function _context_context_plugins() {
00138   $plugins = array();
00139 
00140   /**
00141    * Conditions.
00142    */
00143   $plugins['context_condition'] = array(
00144     'handler' => array(
00145       'path' => drupal_get_path('module', 'context') . '/plugins',
00146       'file' => 'context_condition.inc',
00147       'class' => 'context_condition',
00148     ),
00149   );
00150   $plugins['context_condition_context'] = array(
00151     'handler' => array(
00152       'path' => drupal_get_path('module', 'context') . '/plugins',
00153       'file' => 'context_condition_context.inc',
00154       'class' => 'context_condition_context',
00155       'parent' => 'context_condition_path',
00156     ),
00157   );
00158   $plugins['context_condition_node'] = array(
00159     'handler' => array(
00160       'path' => drupal_get_path('module', 'context') . '/plugins',
00161       'file' => 'context_condition_node.inc',
00162       'class' => 'context_condition_node',
00163       'parent' => 'context_condition',
00164     ),
00165   );
00166   $plugins['context_condition_sitewide'] = array(
00167     'handler' => array(
00168       'path' => drupal_get_path('module', 'context') . '/plugins',
00169       'file' => 'context_condition_sitewide.inc',
00170       'class' => 'context_condition_sitewide',
00171       'parent' => 'context_condition',
00172     ),
00173   );
00174   $plugins['context_condition_path'] = array(
00175     'handler' => array(
00176       'path' => drupal_get_path('module', 'context') . '/plugins',
00177       'file' => 'context_condition_path.inc',
00178       'class' => 'context_condition_path',
00179       'parent' => 'context_condition',
00180     ),
00181   );
00182   $plugins['context_condition_user'] = array(
00183     'handler' => array(
00184       'path' => drupal_get_path('module', 'context') . '/plugins',
00185       'file' => 'context_condition_user.inc',
00186       'class' => 'context_condition_user',
00187       'parent' => 'context_condition',
00188     ),
00189   );
00190   $plugins['context_condition_user_page'] = array(
00191     'handler' => array(
00192       'path' => drupal_get_path('module', 'context') . '/plugins',
00193       'file' => 'context_condition_user_page.inc',
00194       'class' => 'context_condition_user_page',
00195       'parent' => 'context_condition',
00196     ),
00197   );
00198   $plugins['context_condition_menu'] = array(
00199     'handler' => array(
00200       'path' => drupal_get_path('module', 'context') . '/plugins',
00201       'file' => 'context_condition_menu.inc',
00202       'class' => 'context_condition_menu',
00203       'parent' => 'context_condition',
00204     ),
00205   );
00206   if (module_exists('taxonomy')) {
00207     $plugins['context_condition_node_taxonomy'] = array(
00208       'handler' => array(
00209         'path' => drupal_get_path('module', 'context') . '/plugins',
00210         'file' => 'context_condition_node_taxonomy.inc',
00211         'class' => 'context_condition_node_taxonomy',
00212         'parent' => 'context_condition_node',
00213       ),
00214     );
00215     $plugins['context_condition_taxonomy_term'] = array(
00216       'handler' => array(
00217         'path' => drupal_get_path('module', 'context') . '/plugins',
00218         'file' => 'context_condition_taxonomy_term.inc',
00219         'class' => 'context_condition_taxonomy_term',
00220         'parent' => 'context_condition',
00221       ),
00222     );
00223   }
00224   if (module_exists('locale')) {
00225     $plugins['context_condition_language'] = array(
00226       'handler' => array(
00227         'path' => drupal_get_path('module', 'context') . '/plugins',
00228         'file' => 'context_condition_language.inc',
00229         'class' => 'context_condition_language',
00230         'parent' => 'context_condition',
00231       ),
00232     );
00233   }
00234   if (module_exists('book')) {
00235     $plugins['context_condition_book'] = array(
00236       'handler' => array(
00237         'path' => drupal_get_path('module', 'context') . '/plugins',
00238         'file' => 'context_condition_book.inc',
00239         'class' => 'context_condition_book',
00240         'parent' => 'context_condition',
00241       ),
00242     );
00243     $plugins['context_condition_bookroot'] = array(
00244       'handler' => array(
00245         'path' => drupal_get_path('module', 'context') . '/plugins',
00246         'file' => 'context_condition_bookroot.inc',
00247         'class' => 'context_condition_bookroot',
00248         'parent' => 'context_condition_node',
00249       ),
00250     );
00251   }
00252   if (module_exists('views')) {
00253     $plugins['context_condition_views'] = array(
00254       'handler' => array(
00255         'path' => drupal_get_path('module', 'context') . '/plugins',
00256         'file' => 'context_condition_views.inc',
00257         'class' => 'context_condition_views',
00258         'parent' => 'context_condition',
00259       ),
00260     );
00261   }
00262 
00263   /**
00264    * Reactions.
00265    */
00266   $plugins['context_reaction'] = array(
00267     'handler' => array(
00268       'path' => drupal_get_path('module', 'context') . '/plugins',
00269       'file' => 'context_reaction.inc',
00270       'class' => 'context_reaction',
00271     ),
00272   );
00273   $plugins['context_reaction_block'] = array(
00274     'handler' => array(
00275       'path' => drupal_get_path('module', 'context') . '/plugins',
00276       'file' => 'context_reaction_block.inc',
00277       'class' => 'context_reaction_block',
00278       'parent' => 'context_reaction',
00279     ),
00280   );
00281   $plugins['context_reaction_region'] = array(
00282     'handler' => array(
00283       'path' => drupal_get_path('module', 'context') . '/plugins',
00284       'file' => 'context_reaction_region.inc',
00285       'class' => 'context_reaction_region',
00286       'parent' => 'context_reaction',
00287     ),
00288   );
00289   $plugins['context_reaction_breadcrumb'] = array(
00290     'handler' => array(
00291       'path' => drupal_get_path('module', 'context') . '/plugins',
00292       'file' => 'context_reaction_breadcrumb.inc',
00293       'class' => 'context_reaction_breadcrumb',
00294       'parent' => 'context_reaction_menu',
00295     ),
00296   );
00297   $plugins['context_reaction_menu'] = array(
00298     'handler' => array(
00299       'path' => drupal_get_path('module', 'context') . '/plugins',
00300       'file' => 'context_reaction_menu.inc',
00301       'class' => 'context_reaction_menu',
00302       'parent' => 'context_reaction',
00303     ),
00304   );
00305   $plugins['context_reaction_theme'] = array(
00306     'handler' => array(
00307       'path' => drupal_get_path('module', 'context') . '/plugins',
00308       'file' => 'context_reaction_theme.inc',
00309       'class' => 'context_reaction_theme',
00310       'parent' => 'context_reaction',
00311     ),
00312   );
00313   $plugins['context_reaction_theme_html'] = array(
00314     'handler' => array(
00315       'path' => drupal_get_path('module', 'context') . '/plugins',
00316       'file' => 'context_reaction_theme_html.inc',
00317       'class' => 'context_reaction_theme_html',
00318       'parent' => 'context_reaction_theme',
00319     ),
00320   );
00321   $plugins['context_reaction_debug'] = array(
00322     'handler' => array(
00323       'path' => drupal_get_path('module', 'context') . '/plugins',
00324       'file' => 'context_reaction_debug.inc',
00325       'class' => 'context_reaction_debug',
00326       'parent' => 'context_reaction',
00327     ),
00328   );
00329   if (module_exists('css_injector')) {
00330     $plugins['context_reaction_css_injector'] = array(
00331       'handler' => array(
00332         'path' => drupal_get_path('module', 'context') . '/plugins',
00333         'file' => 'context_reaction_css_injector.inc',
00334         'class' => 'context_reaction_css_injector',
00335         'parent' => 'context_reaction',
00336       ),
00337     );
00338   }
00339   return $plugins;
00340 }

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