context.plugins.inc

  1. cis7 sites/all/modules/ulmus/context/context.plugins.inc
  2. cle7 sites/all/modules/ulmus/context/context.plugins.inc
  3. ecd7 sites/all/modules/ulmus/context/context.plugins.inc
  4. elmsmedia7 sites/all/modules/ulmus/context/context.plugins.inc
  5. harmony7 sites/all/modules/ulmus/context/context.plugins.inc
  6. icor7 sites/all/modules/ulmus/context/context.plugins.inc
  7. meedjum_blog7 sites/all/modules/ulmus/context/context.plugins.inc
  8. mooc7 sites/all/modules/ulmus/context/context.plugins.inc

Functions

Namesort descending Description
_context_context_plugins Context plugins.
_context_context_registry Context registry.

File

sites/all/modules/ulmus/context/context.plugins.inc
View source
  1. <?php
  2. /**
  3. * Context registry.
  4. */
  5. function _context_context_registry() {
  6. $registry = array();
  7. $registry['conditions'] = array(
  8. 'context' => array(
  9. 'title' => t('Context (any)'),
  10. 'description' => t('Set this context on the basis of other active contexts. Put each context on a separate line. The condition will pass if <em>any</em> of the contexts are active. 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.'),
  11. 'plugin' => 'context_condition_context',
  12. ),
  13. 'context_all' => array(
  14. 'title' => t('Context (all)'),
  15. 'description' => t('Set this context on the basis of other active contexts. Put each context on a separate line. The condition will pass only if <em>all</em> of the contexts are active. 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.'),
  16. 'plugin' => 'context_condition_context_all',
  17. ),
  18. 'node' => array(
  19. 'title' => t('Node type'),
  20. 'description' => t('Set this context when viewing a node page or using the add/edit form of one of these content types.'),
  21. 'plugin' => 'context_condition_node',
  22. ),
  23. 'sitewide' => array(
  24. 'title' => t('Sitewide context'),
  25. 'description' => t('Should this context always be set? If <strong>true</strong>, this context will be active across your entire site.'),
  26. 'plugin' => 'context_condition_sitewide',
  27. ),
  28. 'path' => array(
  29. 'title' => t('Path'),
  30. '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.'),
  31. 'plugin' => 'context_condition_path',
  32. ),
  33. 'query_string' => array(
  34. 'title' => t('Query String'),
  35. 'description' => t('Set this context when any of the query strings above match the page query string. Put each query string on a separate line. You can use the "*" character as a wildcard and <code>~</code> to exclude one or more query strings.'),
  36. 'plugin' => 'context_condition_query_string',
  37. ),
  38. 'user' => array(
  39. 'title' => t('User role'),
  40. 'description' => t('Set this context when the current user has one of the selected role(s).'),
  41. 'plugin' => 'context_condition_user',
  42. ),
  43. 'user_page' => array(
  44. 'title' => t('User page'),
  45. 'description' => t('Set this context when viewing a user page.'),
  46. 'plugin' => 'context_condition_user_page',
  47. ),
  48. );
  49. if (module_exists('menu')) {
  50. $registry['conditions']['menu'] = array(
  51. 'title' => t('Menu'),
  52. 'description' => t('Set this context when any of the selected menu items belong to the current active menu trail.'),
  53. 'plugin' => 'context_condition_menu',
  54. );
  55. }
  56. if (module_exists('views')) {
  57. $registry['conditions']['views'] = array(
  58. 'title' => t('Views'),
  59. 'description' => t('Set this context when displaying the page of one of these views.'),
  60. 'plugin' => 'context_condition_views',
  61. );
  62. }
  63. if (module_exists('book')) {
  64. $registry['conditions']['book'] = array(
  65. 'title' => t('Book'),
  66. 'description' => t('Set this context when a node in the selected book is viewed.'),
  67. 'plugin' => 'context_condition_book',
  68. );
  69. $registry['conditions']['bookroot'] = array(
  70. 'title' => t('Book root'),
  71. 'description' => t('Set this context when viewing a node whose root book is of the selected type.'),
  72. 'plugin' => 'context_condition_bookroot',
  73. );
  74. }
  75. if (module_exists('locale')) {
  76. $registry['conditions']['language'] = array(
  77. 'title' => t('Language'),
  78. 'description' => t('Set this context when viewing the site in the selected language.'),
  79. 'plugin' => 'context_condition_language',
  80. );
  81. }
  82. if (module_exists('taxonomy')) {
  83. $registry['conditions']['node_taxonomy'] = array(
  84. 'title' => t('Taxonomy'),
  85. 'description' => t('Set this context when viewing a node with the selected taxonomy terms.'),
  86. 'plugin' => 'context_condition_node_taxonomy',
  87. );
  88. $registry['conditions']['taxonomy_term'] = array(
  89. 'title' => t('Taxonomy term'),
  90. 'description' => t('Set this context when viewing a taxonomy term page.'),
  91. 'plugin' => 'context_condition_taxonomy_term',
  92. );
  93. }
  94. $registry['reactions'] = array(
  95. 'block' => array(
  96. 'title' => t('Blocks'),
  97. 'description' => t('Control block visibility using context.'),
  98. 'plugin' => 'context_reaction_block',
  99. ),
  100. 'region' => array(
  101. 'title' => t('Regions'),
  102. 'description' => t('Control Region visiblity using context.'),
  103. 'plugin' => 'context_reaction_region',
  104. ),
  105. 'breadcrumb' => array(
  106. 'title' => t('Breadcrumb'),
  107. 'description' => t('Set the breadcrumb trail to the selected menu item.'),
  108. 'plugin' => 'context_reaction_breadcrumb',
  109. ),
  110. 'theme' => array(
  111. 'title' => t('Theme Page'),
  112. 'description' => t('Control page theme variables using context.'),
  113. 'plugin' => 'context_reaction_theme',
  114. ),
  115. 'theme_html' => array(
  116. 'title' => t('Theme HTML'),
  117. 'description' => t('Control HTML theme variables using context.'),
  118. 'plugin' => 'context_reaction_theme_html',
  119. ),
  120. 'debug' => array(
  121. 'title' => t('Debug'),
  122. 'description' => t('Debug output reaction for SimpleTest.'),
  123. 'plugin' => 'context_reaction_debug',
  124. ),
  125. );
  126. if (module_exists('menu')) {
  127. $registry['reactions']['menu'] = array(
  128. 'title' => t('Menu'),
  129. 'description' => t('Control menu active class using context.'),
  130. 'plugin' => 'context_reaction_menu',
  131. );
  132. }
  133. if (module_exists('css_injector')) {
  134. $registry['reactions']['css_injector'] = array(
  135. 'title' => t('CSS Injector'),
  136. 'description' => t('Inject the selected css when this context is set.'),
  137. 'plugin' => 'context_reaction_css_injector',
  138. );
  139. }
  140. return $registry;
  141. }
  142. /**
  143. * Context plugins.
  144. */
  145. function _context_context_plugins() {
  146. $plugins = array();
  147. /**
  148. * Conditions.
  149. */
  150. $plugins['context_condition'] = array(
  151. 'handler' => array(
  152. 'path' => drupal_get_path('module', 'context') . '/plugins',
  153. 'file' => 'context_condition.inc',
  154. 'class' => 'context_condition',
  155. ),
  156. );
  157. $plugins['context_condition_context'] = array(
  158. 'handler' => array(
  159. 'path' => drupal_get_path('module', 'context') . '/plugins',
  160. 'file' => 'context_condition_context.inc',
  161. 'class' => 'context_condition_context',
  162. 'parent' => 'context_condition_path',
  163. ),
  164. );
  165. $plugins['context_condition_context_all'] = array(
  166. 'handler' => array(
  167. 'path' => drupal_get_path('module', 'context') . '/plugins',
  168. 'file' => 'context_condition_context_all.inc',
  169. 'class' => 'context_condition_context_all',
  170. 'parent' => 'context_condition_path',
  171. ),
  172. );
  173. $plugins['context_condition_node'] = array(
  174. 'handler' => array(
  175. 'path' => drupal_get_path('module', 'context') . '/plugins',
  176. 'file' => 'context_condition_node.inc',
  177. 'class' => 'context_condition_node',
  178. 'parent' => 'context_condition',
  179. ),
  180. );
  181. $plugins['context_condition_sitewide'] = array(
  182. 'handler' => array(
  183. 'path' => drupal_get_path('module', 'context') . '/plugins',
  184. 'file' => 'context_condition_sitewide.inc',
  185. 'class' => 'context_condition_sitewide',
  186. 'parent' => 'context_condition',
  187. ),
  188. );
  189. $plugins['context_condition_path'] = array(
  190. 'handler' => array(
  191. 'path' => drupal_get_path('module', 'context') . '/plugins',
  192. 'file' => 'context_condition_path.inc',
  193. 'class' => 'context_condition_path',
  194. 'parent' => 'context_condition',
  195. ),
  196. );
  197. $plugins['context_condition_query_string'] = array(
  198. 'handler' => array(
  199. 'path' => drupal_get_path('module', 'context') .'/plugins',
  200. 'file' => 'context_condition_query_string.inc',
  201. 'class' => 'context_condition_query_string',
  202. 'parent' => 'context_condition_path',
  203. ),
  204. );
  205. $plugins['context_condition_user'] = array(
  206. 'handler' => array(
  207. 'path' => drupal_get_path('module', 'context') . '/plugins',
  208. 'file' => 'context_condition_user.inc',
  209. 'class' => 'context_condition_user',
  210. 'parent' => 'context_condition',
  211. ),
  212. );
  213. $plugins['context_condition_user_page'] = array(
  214. 'handler' => array(
  215. 'path' => drupal_get_path('module', 'context') . '/plugins',
  216. 'file' => 'context_condition_user_page.inc',
  217. 'class' => 'context_condition_user_page',
  218. 'parent' => 'context_condition',
  219. ),
  220. );
  221. $plugins['context_condition_menu'] = array(
  222. 'handler' => array(
  223. 'path' => drupal_get_path('module', 'context') . '/plugins',
  224. 'file' => 'context_condition_menu.inc',
  225. 'class' => 'context_condition_menu',
  226. 'parent' => 'context_condition',
  227. ),
  228. );
  229. if (module_exists('taxonomy')) {
  230. $plugins['context_condition_node_taxonomy'] = array(
  231. 'handler' => array(
  232. 'path' => drupal_get_path('module', 'context') . '/plugins',
  233. 'file' => 'context_condition_node_taxonomy.inc',
  234. 'class' => 'context_condition_node_taxonomy',
  235. 'parent' => 'context_condition_node',
  236. ),
  237. );
  238. $plugins['context_condition_taxonomy_term'] = array(
  239. 'handler' => array(
  240. 'path' => drupal_get_path('module', 'context') . '/plugins',
  241. 'file' => 'context_condition_taxonomy_term.inc',
  242. 'class' => 'context_condition_taxonomy_term',
  243. 'parent' => 'context_condition',
  244. ),
  245. );
  246. }
  247. if (module_exists('locale')) {
  248. $plugins['context_condition_language'] = array(
  249. 'handler' => array(
  250. 'path' => drupal_get_path('module', 'context') . '/plugins',
  251. 'file' => 'context_condition_language.inc',
  252. 'class' => 'context_condition_language',
  253. 'parent' => 'context_condition',
  254. ),
  255. );
  256. }
  257. if (module_exists('book')) {
  258. $plugins['context_condition_book'] = array(
  259. 'handler' => array(
  260. 'path' => drupal_get_path('module', 'context') . '/plugins',
  261. 'file' => 'context_condition_book.inc',
  262. 'class' => 'context_condition_book',
  263. 'parent' => 'context_condition',
  264. ),
  265. );
  266. $plugins['context_condition_bookroot'] = array(
  267. 'handler' => array(
  268. 'path' => drupal_get_path('module', 'context') . '/plugins',
  269. 'file' => 'context_condition_bookroot.inc',
  270. 'class' => 'context_condition_bookroot',
  271. 'parent' => 'context_condition_node',
  272. ),
  273. );
  274. }
  275. if (module_exists('views')) {
  276. $plugins['context_condition_views'] = array(
  277. 'handler' => array(
  278. 'path' => drupal_get_path('module', 'context') . '/plugins',
  279. 'file' => 'context_condition_views.inc',
  280. 'class' => 'context_condition_views',
  281. 'parent' => 'context_condition',
  282. ),
  283. );
  284. }
  285. /**
  286. * Reactions.
  287. */
  288. $plugins['context_reaction'] = array(
  289. 'handler' => array(
  290. 'path' => drupal_get_path('module', 'context') . '/plugins',
  291. 'file' => 'context_reaction.inc',
  292. 'class' => 'context_reaction',
  293. ),
  294. );
  295. $plugins['context_reaction_block'] = array(
  296. 'handler' => array(
  297. 'path' => drupal_get_path('module', 'context') . '/plugins',
  298. 'file' => 'context_reaction_block.inc',
  299. 'class' => 'context_reaction_block',
  300. 'parent' => 'context_reaction',
  301. ),
  302. );
  303. $plugins['context_reaction_region'] = array(
  304. 'handler' => array(
  305. 'path' => drupal_get_path('module', 'context') . '/plugins',
  306. 'file' => 'context_reaction_region.inc',
  307. 'class' => 'context_reaction_region',
  308. 'parent' => 'context_reaction',
  309. ),
  310. );
  311. $plugins['context_reaction_breadcrumb'] = array(
  312. 'handler' => array(
  313. 'path' => drupal_get_path('module', 'context') . '/plugins',
  314. 'file' => 'context_reaction_breadcrumb.inc',
  315. 'class' => 'context_reaction_breadcrumb',
  316. 'parent' => 'context_reaction_menu',
  317. ),
  318. );
  319. $plugins['context_reaction_menu'] = array(
  320. 'handler' => array(
  321. 'path' => drupal_get_path('module', 'context') . '/plugins',
  322. 'file' => 'context_reaction_menu.inc',
  323. 'class' => 'context_reaction_menu',
  324. 'parent' => 'context_reaction',
  325. ),
  326. );
  327. $plugins['context_reaction_theme'] = array(
  328. 'handler' => array(
  329. 'path' => drupal_get_path('module', 'context') . '/plugins',
  330. 'file' => 'context_reaction_theme.inc',
  331. 'class' => 'context_reaction_theme',
  332. 'parent' => 'context_reaction',
  333. ),
  334. );
  335. $plugins['context_reaction_theme_html'] = array(
  336. 'handler' => array(
  337. 'path' => drupal_get_path('module', 'context') . '/plugins',
  338. 'file' => 'context_reaction_theme_html.inc',
  339. 'class' => 'context_reaction_theme_html',
  340. 'parent' => 'context_reaction_theme',
  341. ),
  342. );
  343. $plugins['context_reaction_debug'] = array(
  344. 'handler' => array(
  345. 'path' => drupal_get_path('module', 'context') . '/plugins',
  346. 'file' => 'context_reaction_debug.inc',
  347. 'class' => 'context_reaction_debug',
  348. 'parent' => 'context_reaction',
  349. ),
  350. );
  351. if (module_exists('css_injector')) {
  352. $plugins['context_reaction_css_injector'] = array(
  353. 'handler' => array(
  354. 'path' => drupal_get_path('module', 'context') . '/plugins',
  355. 'file' => 'context_reaction_css_injector.inc',
  356. 'class' => 'context_reaction_css_injector',
  357. 'parent' => 'context_reaction',
  358. ),
  359. );
  360. }
  361. return $plugins;
  362. }