Révision e4c061ad
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/ctools/page_manager/page_manager.module | ||
---|---|---|
213 | 213 |
} |
214 | 214 |
} |
215 | 215 |
|
216 |
// Override the core node revisions display to use the configured Page |
|
217 |
// display handler. |
|
218 |
if (!variable_get('page_manager_node_view_disabled', TRUE) && isset($items['node/%node/revisions/%/view'])) { |
|
219 |
// Abstract the basic settings. |
|
220 |
$item = array( |
|
221 |
// Handle the page arguments. |
|
222 |
'load arguments' => array(3), |
|
223 |
'page arguments' => array(1, TRUE), |
|
224 |
|
|
225 |
// Replace the normal node_show call with Page Manager's node view. |
|
226 |
'page callback' => 'page_manager_node_view_page', |
|
227 |
|
|
228 |
// Provide the correct path to the Page Manager file. |
|
229 |
'file' => 'node_view.inc', |
|
230 |
'file path' => drupal_get_path('module', 'page_manager') . '/plugins/tasks', |
|
231 |
); |
|
232 |
// Re-build the menu item using the normal values from node.module. |
|
233 |
$items['node/%node/revisions/%/view'] = array( |
|
234 |
'title' => 'Revisions', |
|
235 |
'access callback' => '_node_revision_access', |
|
236 |
'access arguments' => array(1), |
|
237 |
) + $item; |
|
238 |
} |
|
239 |
|
|
216 | 240 |
return $items; |
217 | 241 |
} |
218 | 242 |
|
... | ... | |
416 | 440 |
*/ |
417 | 441 |
function page_manager_handler_get_name($task_name, $handlers, $handler) { |
418 | 442 |
$base = str_replace('-', '_', $task_name); |
419 |
// Generate a unique name. Unlike most named objects, we don't let people choose |
|
420 |
// names for task handlers because they mostly don't make sense. |
|
421 |
$base .= '_' . $handler->handler; |
|
422 |
|
|
423 |
// Once we have a base, check to see if it is used. If it is, start counting up. |
|
424 |
$name = $base; |
|
425 |
$count = 1; |
|
426 |
// If taken |
|
427 |
while (isset($handlers[$name])) { |
|
428 |
$name = $base . '_' . ++$count; |
|
443 |
// Optional machine name. |
|
444 |
if (!empty($handler->conf['name'])) { |
|
445 |
$name = $base . '__' . $handler->conf['name']; |
|
446 |
} |
|
447 |
|
|
448 |
// If no machine name was provided, generate a unique name. |
|
449 |
else { |
|
450 |
$base .= '__' . $handler->handler; |
|
451 |
|
|
452 |
// Use the ctools uuid generator to generate a unique id. |
|
453 |
$name = $base . '_' . ctools_uuid_generate(); |
|
429 | 454 |
} |
430 | 455 |
|
431 | 456 |
return $name; |
Formats disponibles : Unified diff
Weekly update of contrib modules