Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/page_manager/page_manager.module | ||
---|---|---|
205 | 205 |
if ($function = ctools_plugin_get_function($task, 'hook menu alter')) { |
206 | 206 |
$function($items, $task); |
207 | 207 |
} |
208 |
// let the subtasks alter the menu items too.
|
|
208 |
// Let the subtasks alter the menu items too.
|
|
209 | 209 |
foreach (page_manager_get_task_subtasks($task) as $subtask_id => $subtask) { |
210 | 210 |
if ($function = ctools_plugin_get_function($subtask, 'hook menu alter')) { |
211 | 211 |
$function($items, $subtask); |
... | ... | |
240 | 240 |
return $items; |
241 | 241 |
} |
242 | 242 |
|
243 |
/* |
|
243 |
/**
|
|
244 | 244 |
* Implements hook_theme() |
245 | 245 |
*/ |
246 | 246 |
function page_manager_theme() { |
... | ... | |
333 | 333 |
} |
334 | 334 |
} |
335 | 335 |
else { |
336 |
// ensure the task is loaded.
|
|
336 |
// Ensure the task is loaded.
|
|
337 | 337 |
page_manager_get_task($cache->task_id); |
338 | 338 |
} |
339 | 339 |
|
... | ... | |
390 | 390 |
foreach ($cache->handler_info as $id => $info) { |
391 | 391 |
$handler = &$cache->handlers[$id]; |
392 | 392 |
// If it has been marked for deletion, delete it. |
393 |
|
|
394 | 393 |
if ($info['changed'] & PAGE_MANAGER_CHANGED_DELETED) { |
395 | 394 |
page_manager_delete_task_handler($handler); |
396 | 395 |
} |
397 |
// If it has been somehow edited (or added), write the cached version |
|
396 |
// If it has been somehow edited (or added), write the cached version.
|
|
398 | 397 |
elseif ($info['changed'] & PAGE_MANAGER_CHANGED_CACHED) { |
399 | 398 |
// Make sure we get updated weight from the form for this. |
400 | 399 |
$handler->weight = $info['weight']; |
... | ... | |
427 | 426 |
* Menu callback to load a page manager cache object for menu callbacks. |
428 | 427 |
*/ |
429 | 428 |
function page_manager_cache_load($task_name) { |
430 |
// load context plugin as there may be contexts cached here.
|
|
429 |
// Load context plugin as there may be contexts cached here.
|
|
431 | 430 |
ctools_include('context'); |
432 | 431 |
return page_manager_get_page_cache($task_name); |
433 | 432 |
} |
... | ... | |
500 | 499 |
// |
501 | 500 |
// This includes fetching plugins and plugin info as well as specialized |
502 | 501 |
// fetch methods to get groups of task handlers per task. |
503 |
|
|
504 | 502 |
/** |
505 | 503 |
* Load a single task handler by name. |
506 | 504 |
* |
... | ... | |
582 | 580 |
$handlers = $subtask['default handlers']; |
583 | 581 |
} |
584 | 582 |
} |
585 |
else if (isset($task['default handlers'])) {
|
|
583 |
elseif (isset($task['default handlers'])) { |
|
586 | 584 |
$handlers = $task['default handlers']; |
587 | 585 |
} |
588 | 586 |
|
... | ... | |
604 | 602 |
* A list of handlers provided by the default task. |
605 | 603 |
* @param $name |
606 | 604 |
* Which handler to compare. |
605 |
* |
|
607 | 606 |
* @return |
608 | 607 |
* Which handler to use, if any. May be NULL. |
609 | 608 |
*/ |
... | ... | |
615 | 614 |
$handlers[$name]->export_type = EXPORT_IN_CODE; |
616 | 615 |
return $handlers[$name]; |
617 | 616 |
} |
618 |
else if (isset($result[$name]) && !isset($handlers[$name])) {
|
|
617 |
elseif (isset($result[$name]) && !isset($handlers[$name])) { |
|
619 | 618 |
return $result[$name]; |
620 | 619 |
} |
621 |
else if (isset($result[$name]) && isset($handlers[$name])) {
|
|
620 |
elseif (isset($result[$name]) && isset($handlers[$name])) { |
|
622 | 621 |
if ($result[$name]->export_type & EXPORT_IN_DATABASE) { |
623 | 622 |
$result[$name]->type = t('Overridden'); |
624 | 623 |
$result[$name]->export_type = $result[$name]->export_type | EXPORT_IN_CODE; |
... | ... | |
776 | 775 |
function page_manager_new_task_handler($plugin) { |
777 | 776 |
// Generate a unique name. Unlike most named objects, we don't let people choose |
778 | 777 |
// names for task handlers because they mostly don't make sense. |
779 |
|
|
780 | 778 |
// Create a new, empty handler object. |
781 |
$handler = new stdClass; |
|
779 |
$handler = new stdClass();
|
|
782 | 780 |
$handler->title = $plugin['title']; |
783 | 781 |
$handler->task = NULL; |
784 | 782 |
$handler->subtask = NULL; |
... | ... | |
797 | 795 |
if (is_array($plugin['default conf'])) { |
798 | 796 |
$handler->conf = $plugin['default conf']; |
799 | 797 |
} |
800 |
else if (function_exists($plugin['default conf'])) {
|
|
798 |
elseif (function_exists($plugin['default conf'])) { |
|
801 | 799 |
$handler->conf = $plugin['default conf']($handler); |
802 | 800 |
} |
803 | 801 |
} |
... | ... | |
823 | 821 |
->execute(); |
824 | 822 |
} |
825 | 823 |
|
826 |
|
|
827 | 824 |
/** |
828 | 825 |
* Shortcut function to get task plugins. |
829 | 826 |
*/ |
... | ... | |
1200 | 1197 |
$code .= " */\n"; |
1201 | 1198 |
$code .= "function " . $name . "_{$export['default hook']}() {\n"; |
1202 | 1199 |
foreach ($objects as $object) { |
1203 |
// Have to implement our own because this export func sig requires it |
|
1200 |
// Have to implement our own because this export func sig requires it.
|
|
1204 | 1201 |
$code .= $export['export callback']($object, TRUE, ' '); |
1205 | 1202 |
$code .= " \${$export['identifier']}s['" . check_plain($object->{$export['key']}) . "'] = \${$export['identifier']};\n\n"; |
1206 | 1203 |
} |
... | ... | |
1310 | 1307 |
$arguments = explode('..', $arguments); |
1311 | 1308 |
} |
1312 | 1309 |
else { |
1313 |
// implode does not return an empty array on an empty
|
|
1310 |
// Implode does not return an empty array on an empty
|
|
1314 | 1311 |
// string so do it specifically. |
1315 | 1312 |
$arguments = array(); |
1316 | 1313 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules