Definition at line 100 of file plugins.inc.
Public Member Functions | |
| add_empty (&$contexts) | |
| filter ($contexts) | |
| panels_optional_context () | |
| select ($contexts, $context) | |
| panels_optional_context::add_empty | ( | &$ | contexts | ) |
Add the 'empty' context which is possible for optional
Definition at line 109 of file plugins.inc.
Referenced by filter(), and select().
00109 { 00110 $context = new panels_context('any'); 00111 $context->title = t('No context'); 00112 $context->identifier = t('No context'); 00113 $contexts = array_merge(array('empty' => $context), $contexts); 00114 }
| panels_optional_context::filter | ( | $ | contexts | ) |
Reimplemented from panels_required_context.
Definition at line 116 of file plugins.inc.
References add_empty().
00116 { 00117 $this->add_empty($contexts); 00118 return parent::filter($contexts); 00119 }
| panels_optional_context::panels_optional_context | ( | ) |
Definition at line 101 of file plugins.inc.
00101 { 00102 $args = func_get_args(); 00103 call_user_func_array(array($this, 'panels_required_context'), $args); 00104 }
| panels_optional_context::select | ( | $ | contexts, | |
| $ | context | |||
| ) |
Reimplemented from panels_required_context.
Definition at line 121 of file plugins.inc.
References add_empty().
00121 { 00122 $this->add_empty($contexts); 00123 if (empty($context)) { 00124 return $contexts['empty']; 00125 } 00126 00127 $result = parent::select($contexts, $context); 00128 00129 // Don't flip out if it can't find the context; this is optional, put 00130 // in an empty. 00131 if ($result == FALSE) { 00132 $result = $contexts['empty']; 00133 } 00134 return $result; 00135 }
1.5.6