Révision 219d19c4
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc | ||
---|---|---|
95 | 95 |
ctools_include('context-task-handler'); |
96 | 96 |
$contexts = ctools_context_handler_get_task_contexts($task, '', array($node)); |
97 | 97 |
|
98 |
// Set the default title for the node add/edit form. If the page has a custom |
|
99 |
// title it'll override this. |
|
100 |
$types = node_type_get_types(); |
|
101 |
$context = reset($contexts); |
|
102 |
if (empty($context->data->nid)) { |
|
103 |
drupal_set_title(t('Create @name', array( |
|
104 |
'@name' => $types[$context->data->type]->name |
|
105 |
)), PASS_THROUGH); |
|
106 |
} |
|
107 |
else { |
|
108 |
drupal_set_title(t('<em>Edit @type</em> @title', array( |
|
109 |
'@type' => $types[$context->node_type]->name, |
|
110 |
'@title' => $context->data->title |
|
111 |
)), PASS_THROUGH); |
|
112 |
} |
|
113 |
|
|
98 | 114 |
$arg = array(isset($node->nid) ? $node->nid : $node->type); |
99 | 115 |
$output = ctools_context_handler_render($task, '', $contexts, $arg); |
100 | 116 |
if ($output === FALSE) { |
101 | 117 |
// Fall back! |
102 | 118 |
// We've already built the form with the context, so we can't build it again, or |
103 | 119 |
// form_clean_id will mess up our ids. But we don't really need to, either: |
104 |
$context = reset($contexts); |
|
105 | 120 |
$output = $context->form; |
106 | 121 |
} |
107 | 122 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules