updated ctools, needed by panles

This commit is contained in:
Bachir Soussi Chiadmi
2016-10-25 17:47:45 +02:00
parent f6f7fd575f
commit b11abbed59
59 changed files with 779 additions and 297 deletions

View File

@@ -1542,25 +1542,42 @@ function page_manager_handler_import_submit(&$form, &$form_state) {
* Rearrange the order of variants.
*/
function page_manager_handler_rearrange($form, &$form_state) {
ctools_include('context-task-handler');
$page = $form_state['page'];
$form['handlers'] = array('#tree' => TRUE);
// Get the number of variants to be displayed in order to set the delta
// to the proper value. This fixes problems in previous versions with sorting
// large numbers of variants.
$delta = count($page->handler_info)/2 + 1;
foreach ($page->handler_info as $id => $info) {
if ($info['changed'] & PAGE_MANAGER_CHANGED_DELETED) {
continue;
}
$handler = $page->handlers[$id];
$plugin = page_manager_get_task_handler($handler->handler);
$object = ctools_context_handler_get_task_object($page->task, $page->subtask, $handler);
$display = new stdClass();
$display->context = ctools_context_load_contexts($object, TRUE);
$content = page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id);
$access = ctools_access_group_summary(!empty($handler->conf['access']) ? $handler->conf['access'] : array(), $display->context);
if ($access) {
$access = t('This panel will be selected if @conditions.', array('@conditions' => $access));
}
else {
$access = t('This panel will always be selected.');
}
$content .= '<div>' . $access . '</div>';
$form['handlers'][$id]['title'] = array(
'#markup' => page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id),
'#markup' => $content,
);
$form['handlers'][$id]['weight'] = array(
'#type' => 'weight',
'#default_value' => $info['weight'],
'#delta' => 30,
'#delta' => $delta,
);
}

View File

@@ -5,9 +5,9 @@ dependencies[] = ctools
package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
; Information added by Drupal.org packaging script on 2015-08-19
version = "7.x-1.9"
; Information added by Drupal.org packaging script on 2016-10-16
version = "7.x-1.11"
core = "7.x"
project = "ctools"
datestamp = "1440020680"
datestamp = "1476581654"

View File

@@ -1202,7 +1202,7 @@ function page_manager_page_manager_pages_to_hook_code($names = array(), $name =
foreach ($objects as $object) {
// Have to implement our own because this export func sig requires it
$code .= $export['export callback']($object, TRUE, ' ');
$code .= " \${$export['identifier']}s['" . check_plain($object->$export['key']) . "'] = \${$export['identifier']};\n\n";
$code .= " \${$export['identifier']}s['" . check_plain($object->{$export['key']}) . "'] = \${$export['identifier']};\n\n";
}
$code .= " return \${$export['identifier']}s;\n";
$code .= "}\n";

View File

@@ -3,7 +3,8 @@
/**
* @file
*
* This is the task handler plugin to handle generating 403, 404 and 301 response codes.
* This is the task handler plugin to handle generating 403, 404, 301 and 302
* response codes.
*/
// Plugin definition
@@ -108,7 +109,8 @@ function page_manager_http_response_codes() {
403 => t('403 Access denied'),
404 => t('404 Page not found'),
410 => t('410 Gone'),
301 => t('301 Redirect'),
301 => t('301 Permanent redirect'),
302 => t('302 Temporary redirect'),
);
}
@@ -256,7 +258,7 @@ function page_manager_http_response_edit_settings($form, &$form_state) {
'#type' => 'textfield',
'#title' => t('Redirect destination'),
'#default_value' => $conf['destination'],
'#dependency' => array('edit-code' => array(301)),
'#dependency' => array('edit-code' => array(301, 302)),
'#description' => t('Enter the path to redirect to. You may use keyword substitutions from contexts. You can use external urls (http://www.example.com/foo) or internal urls (node/1).'),
);
@@ -313,7 +315,7 @@ function page_manager_http_response_render($handler, $base_contexts, $args, $tes
}
$info['response code'] = $handler->conf['code'];
if ($info['response code'] == 301) {
if ($info['response code'] == 301 || $info['response code'] == 302) {
$path = ctools_context_keyword_substitute($handler->conf['destination'], array(), $contexts);
$url = parse_url($path);
if (isset($url['query'])) {

View File

@@ -698,7 +698,7 @@ function page_manager_page_form_menu($form, &$form_state) {
'#title' => t('Title'),
'#type' => 'textfield',
'#default_value' => $menu['title'],
'#description' => t('If set to normal or tab, enter the text to use for the menu item.'),
'#description' => t('If set to normal or tab, enter the text to use for the menu item. Renaming the menu item using the Drupal menu system (admin/structure/menu) will override this, even if it is renamed again here.'),
'#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab', 'action')),
);