Révision 136a805a
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/panels/panels_mini/plugins/content_types/panels_mini.inc | ||
---|---|---|
4 | 4 |
* @file |
5 | 5 |
* Contains the content type plugin for a mini panel. While this does not |
6 | 6 |
* need to be broken out into a .inc file, it's convenient that we do so |
7 |
* that we don't load code unneccessarily. Plus it demonstrates plugins
|
|
7 |
* that we don't load code unnecessarily. Plus it demonstrates plugins |
|
8 | 8 |
* in modules other than Panels itself. |
9 | 9 |
* |
10 | 10 |
*/ |
... | ... | |
68 | 68 |
$type['required context'] = array(); |
69 | 69 |
foreach ($mini->requiredcontexts as $context) { |
70 | 70 |
$info = ctools_get_context($context['name']); |
71 |
// TODO: allow an optional setting |
|
72 |
$type['required context'][] = new ctools_context_required($context['identifier'], $info['context name']); |
|
71 |
// Check if the required context is actually required. |
|
72 |
if (!empty($context['optional'])) { |
|
73 |
$type['required context'][] = new ctools_context_optional($context['identifier'], $info['context name']); |
|
74 |
} |
|
75 |
else { |
|
76 |
$type['required context'][] = new ctools_context_required($context['identifier'], $info['context name']); |
|
77 |
} |
|
73 | 78 |
} |
74 | 79 |
} |
75 | 80 |
return $type; |
Formats disponibles : Unified diff
Weekly update of contrib modules