Commit 8d433a86 authored by theo lem's avatar theo lem
Browse files

updated panels module

parent 6a30df29
......@@ -10,6 +10,10 @@
margin-right: auto;
}
.layout-link span {
display: block;
}
/* general style for the layout-icon */
.layout-icon .caption {
width: 90px;
......
......@@ -7,9 +7,8 @@ dependencies[] = i18n_translation
package = Multilingual - Internationalization
core = 7.x
; Information added by Drupal.org packaging script on 2017-02-06
version = "7.x-3.9"
; Information added by Drupal.org packaging script on 2020-07-05
version = "7.x-3.10"
core = "7.x"
project = "panels"
datestamp = "1486394388"
datestamp = "1593990788"
......@@ -350,9 +350,51 @@ function i18n_panels_i18n_string_list($group) {
* TRUE if the display is available from code.
*/
function _18n_panels_is_exported_panels_display($display) {
if (isset($display->uuid)) {
$displays = _18n_panels_fetch_all_panel_displays();
return isset($displays['exported-' . $display->uuid]);
if (!isset($display->uuid)) {
return FALSE;
}
$uuid = $display->uuid;
// Check exported displays.
ctools_include('export');
$panels_display_temp = ctools_export_crud_load('panels_display', $uuid);
$panels_mini_temp = ctools_export_crud_load('panels_mini', $uuid);
if (
!empty($panels_display_temp)
|| !empty($panels_mini_temp)
|| (module_exists('panelizer') && ctools_export_crud_load('panelizer_defaults', $uuid))
) {
return TRUE;
}
// Check page manager embedded displays.
// @see _18n_panels_fetch_all_panel_displays()
if (module_exists('page_manager')) {
module_load_include('inc', 'page_manager', 'page_manager.admin');
$tasks = page_manager_get_tasks_by_type('page');
$pages = array('operations' => array(), 'tasks' => array());
page_manager_get_pages($tasks, $pages);
foreach ($pages['tasks'] as $task) {
$page = page_manager_cache_load($task);
foreach ($page->handler_info as $id => $info) {
$page_manager_handler = $page->handlers[$id];
if ($page_manager_handler->handler == 'panel_context') {
$is_exported = ($page_manager_handler->export_type == (EXPORT_IN_CODE | EXPORT_IN_DATABASE) || (isset($page->subtask['storage']) && $page->subtask['storage'] == t('Overridden')));
if (!empty($page_manager_handler->conf['display'])) {
$panels_display = $page_manager_handler->conf['display'];
if ($panels_display->uuid == $uuid) {
return TRUE;
}
}
elseif ($is_exported && isset($page_manager_handler->conf['did'])) {
$panels_display = panels_load_display($page_manager_handler->conf['did']);
if (isset($panels_display->uuid) && $panels_display->uuid == $uuid) {
return TRUE;
}
}
}
}
}
}
return FALSE;
}
......
......@@ -18,9 +18,8 @@ files[] = tests/PanelsNodeViewWebTestCase.test
files[] = tests/PanelsTermViewWebTestCase.test
files[] = tests/PanelsUserViewWebTestCase.test
; Information added by Drupal.org packaging script on 2017-02-06
version = "7.x-3.9"
; Information added by Drupal.org packaging script on 2020-07-05
version = "7.x-3.10"
core = "7.x"
project = "panels"
datestamp = "1486394388"
datestamp = "1593990788"
......@@ -58,6 +58,7 @@ function panels_theme() {
'image' => NULL,
'link' => NULL,
'class' => NULL,
'options' => NULL,
),
);
$theme['panels_layout_icon'] = array(
......@@ -552,8 +553,8 @@ function panels_ctools_style_base_types() {
function panels_stylizer_lipsum() {
return <<<LIPSUM
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus at
velit dolor. Donec egestas tellus sit amet urna rhoncus adipiscing. Proin
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus at
velit dolor. Donec egestas tellus sit amet urna rhoncus adipiscing. Proin
nec porttitor sem. Maecenas aliquam, purus nec tempus dignissim, nulla arcu
aliquam diam, non tincidunt massa ante vel dolor. Aliquam sapien sapien,
tincidunt id tristique at, pretium sagittis libero.
......@@ -805,6 +806,15 @@ class panels_display {
$this->add_pane($pane, $location);
}
/**
* Clone a pane.
*/
public function clone_pane($pid) {
$pane = clone $this->content[$pid];
$pane->uuid = ctools_uuid_generate();
return $pane;
}
/**
* Get the title from a display.
*
......@@ -1368,11 +1378,14 @@ function theme_panels_layout_icon($vars) {
* @todo Why does this take 4 arguments but only makes use of two?
*/
function theme_panels_layout_link($vars) {
$output = '<div class="' . implode(' ', $vars['class']) . '">';
$output .= $vars['image'];
$output .= '<div>' . $vars['title'] . '</div>';
$output .= '</div>';
return $output;
$options = !empty($vars['options']) ? $vars['options'] : array();
if (!isset($options['attributes']['class'])) {
$options['attributes']['class'] = array();
}
$options['attributes']['class'] = array_merge($options['attributes']['class'], $vars['class']);
$content = $vars['image'] . '<span>' . $vars['title'] . '</span>';
return l($content, $vars['link'], $options + array('html' => TRUE));
}
/**
......@@ -1394,18 +1407,15 @@ function panels_print_layout_link($id, $layout, $link, $options = array(), $curr
ctools_add_css('panels_admin', 'panels');
$file = $layout['path'] . '/' . $layout['icon'];
$image = l(
theme('image', array('path' => $file)),
$link,
array('html' => TRUE) + $options
);
$title = l($layout['title'], $link, $options);
$image = theme('image', array('path' => $file));
return theme(
'panels_layout_link',
array(
'title' => $title,
'title' => $layout['title'],
'image' => $image,
'link' => $link,
'class' => $class,
'options' => $options,
)
);
}
......@@ -2057,7 +2067,7 @@ function panels_get_pane_links_alter(&$links, $pane, $content_type) {
$subtype_prefix_hyphen = $exploded_subtype[0] . '-';
// Remove the prefix block- to get the name.
$name_of_block = ltrim($prefixed_name, $subtype_prefix_hyphen);
$name_of_block = preg_replace("/^$subtype_prefix_hyphen/", '', $prefixed_name, 1);
// Check for user added menus created at /admin/structure/menu/add
// menus of that type have a subtype that is prefixed with menu-menu-.
......
......@@ -6,9 +6,8 @@ core = 7.x
configure = admin/structure/panels
files[] = panels_ipe.module
; Information added by Drupal.org packaging script on 2017-02-06
version = "7.x-3.9"
; Information added by Drupal.org packaging script on 2020-07-05
version = "7.x-3.10"
core = "7.x"
project = "panels"
datestamp = "1486394388"
datestamp = "1593990788"
......@@ -90,6 +90,7 @@ function template_preprocess_panels_ipe_pane_wrapper(&$vars) {
$vars['links']['edit'] = array(
'title' => isset($content_type['edit text']) ? '<span>' . $content_type['edit text'] . '</span>' : '<span>' . t('Settings') . '</span>',
'href' => $renderer->get_url('edit-pane', $pane->pid),
'query' => drupal_get_destination(),
'html' => TRUE,
'attributes' => array(
'class' => array('ctools-use-modal', 'panels-ipe-hide-bar'),
......@@ -104,6 +105,7 @@ function template_preprocess_panels_ipe_pane_wrapper(&$vars) {
$vars['links']['style'] = array(
'title' => '<span>' . t('Style') . '</span>',
'href' => $renderer->get_url('style-type', 'pane', $pane->pid),
'query' => drupal_get_destination(),
'html' => TRUE,
'attributes' => array(
'class' => array('ctools-use-modal', 'panels-ipe-hide-bar'),
......@@ -117,6 +119,7 @@ function template_preprocess_panels_ipe_pane_wrapper(&$vars) {
$vars['links']['css'] = array(
'title' => '<span>' . t('CSS') . '</span>',
'href' => $renderer->get_url('pane-css', $pane->pid),
'query' => drupal_get_destination(),
'html' => TRUE,
'attributes' => array(
'class' => array('ctools-use-modal', 'panels-ipe-hide-bar'),
......@@ -226,13 +229,6 @@ function theme_panels_ipe_add_pane_button($vars) {
return '<div class="panels-ipe-newblock panels-ipe-on">' . $links . '</div>';
}
/**
* @deprecated
*/
function panels_ipe_get_cache_key($key = NULL) {
return array();
}
/**
* Add a button to the IPE toolbar.
*/
......
......@@ -127,7 +127,18 @@ class panels_renderer_ipe extends panels_renderer_editor {
* @param $pane
*/
function render_pane(&$pane) {
// Temporarily change $_GET['q'] so that panes think the current path is
// the original path when rendering.
$ajax_path = $_GET['q'];
if (!empty($_GET['destination'])) {
$_GET['q'] = $_GET['destination'];
}
$output = parent::render_pane($pane);
// Reset $_GET['q'] to the AJAX path.
$_GET['q'] = $ajax_path;
if (empty($output)) {
return;
}
......
......@@ -5,9 +5,8 @@ dependencies[] = panels
core = 7.x
files[] = plugins/export_ui/panels_mini_ui.class.php
; Information added by Drupal.org packaging script on 2017-02-06
version = "7.x-3.9"
; Information added by Drupal.org packaging script on 2020-07-05
version = "7.x-3.10"
core = "7.x"
project = "panels"
datestamp = "1486394388"
datestamp = "1593990788"
......@@ -143,6 +143,7 @@ function panels_mini_block_configure($delta = 0) {
* Remove the block if the required contexts are not available.
*/
function panels_mini_block_list_alter(&$blocks) {
$current_page = FALSE;
if (module_exists('page_manager')) {
$current_page = page_manager_get_current_page();
}
......
name = Panel nodes
description = Create nodes that are divided into areas with selectable content.
name = Panel nodes (deprecated)
description = Create nodes that are divided into areas with selectable content. This module is deprecated, use <a href="http://drupal.org/project/panelizer">Panelizer</a> instead.
package = "Panels"
dependencies[] = panels
configure = admin/structure/panels
core = 7.x
files[] = panels_node.module
; Information added by Drupal.org packaging script on 2017-02-06
version = "7.x-3.9"
; Information added by Drupal.org packaging script on 2020-07-05
version = "7.x-3.10"
core = "7.x"
project = "panels"
datestamp = "1486394388"
datestamp = "1593990788"
......@@ -445,7 +445,7 @@ function panels_node_panels_cache_get($nid) {
$cache->display->context = panels_node_get_context($node);
$cache->display->cache_key = 'panels_node:' . $node->nid;
$cache->content_types = panels_common_get_allowed_types('panels_node', $cache->display->context);
$cache->allwed_layouts = panels_common_get_allowed_layouts('panels_node');
$cache->allowed_layouts = panels_common_get_allowed_layouts('panels_node');
}
return $cache;
......
......@@ -615,7 +615,7 @@ class panels_renderer_editor extends panels_renderer_standard {
}
elseif (isset($content_type['category'])) {
if (is_array($content_type['category'])) {
list($category, $weight) = $content_type['category'];
$category = reset($content_type['category']);
}
else {
$category = $content_type['category'];
......@@ -1052,9 +1052,8 @@ class panels_renderer_editor extends panels_renderer_standard {
case 'pane':
$pane->style['style'] = $form_state['style'];
if (isset($pane->style['settings'])) {
unset($pane->style['settings']);
$pane->style['settings'] = NULL;
}
break;
}
panels_edit_cache_set($this->cache);
......@@ -1149,7 +1148,7 @@ class panels_renderer_editor extends panels_renderer_standard {
// Backward compatibility: Translate old-style stylizer to new style
// stylizer.
if ($style['name'] == 'stylizer' && !empty($conf['style']) && $conf['style'] != '$') {
if (isset($style['name']) && $style['name'] == 'stylizer' && !empty($conf['style']) && $conf['style'] != '$') {
$style = panels_get_style('stylizer:' . $conf['style']);
}
......@@ -1404,6 +1403,8 @@ class panels_renderer_editor extends panels_renderer_standard {
);
$output = ctools_modal_form_wrapper('panels_edit_configure_access_test_form', $form_state);
$pane->access['plugins'][$id] = $form_state['test'];
if (empty($form_state['executed'])) {
$this->commands = $output;
return;
......@@ -2063,6 +2064,9 @@ function panels_edit_configure_access_test_form_submit(&$form, &$form_state) {
$function($form, $form_state);
}
if (!isset($form_state['values']['settings'])) {
$form_state['values']['settings'] = array();
}
$form_state['test']['settings'] = $form_state['values']['settings'];
if (isset($form_state['values']['context'])) {
$form_state['test']['context'] = $form_state['values']['context'];
......
......@@ -278,5 +278,5 @@ function panels_landing_page_finish(&$form_state) {
page_manager_save_page_cache($page);
// Send us to the new page immediately.
$form_state['redirect'] = url($cache->path);
$form_state['redirect'] = $cache->path;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment