summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordipen2012-11-03 10:48:59 (GMT)
committer dipen2012-11-03 10:48:59 (GMT)
commit36c5473bbbb7f8b40927d9026d88f29bfd3d6ffb (patch)
tree9a36bb38208b493fd619642730dc85bde2d2f367
parent5ae3ef7a7d13f69c6f8697d46a2d3085145027fd (diff)
#1824978 fix for condition when is not set
-rw-r--r--panels_ajax_tab.module4
-rw-r--r--plugins/content_types/panels_ajax_tab_tabs.inc9
2 files changed, 7 insertions, 6 deletions
diff --git a/panels_ajax_tab.module b/panels_ajax_tab.module
index a668d83..fde33a7 100644
--- a/panels_ajax_tab.module
+++ b/panels_ajax_tab.module
@@ -49,7 +49,7 @@ function panels_ajax_tab_theme($existing, $type, $theme, $path) {
'panels_ajax_tab_ajax' => array(
'variables' => array('minipanel' => NULL),
),
- 'panels_ajax_tab_container_edit_form' => array(
+ 'panels_ajax_tab_tabs_edit_form' => array(
'render element' => 'form',
),
);
@@ -161,7 +161,7 @@ function theme_panels_ajax_tab_ajax($vars) {
}
-function theme_panels_ajax_tab_container_edit_form($variables) {
+function theme_panels_ajax_tab_tabs_edit_form($variables) {
$form = $variables['form'];
$output = '';
// Render elements that are supposed to be on top.
diff --git a/plugins/content_types/panels_ajax_tab_tabs.inc b/plugins/content_types/panels_ajax_tab_tabs.inc
index c5ddedd..646eb96 100644
--- a/plugins/content_types/panels_ajax_tab_tabs.inc
+++ b/plugins/content_types/panels_ajax_tab_tabs.inc
@@ -51,14 +51,15 @@ function panels_ajax_tab_tabs_render($subtype, $conf, $panel_args, &$contexts) {
function panels_ajax_tab_tabs_edit_form($form, &$form_state) {
$conf = $form_state['conf'];
-
$panels = panels_mini_load_all();
foreach($panels as $panel_name => $panel) {
$panels[$panel_name] = (array) $panel;
- $panels[$panel_name] = array_merge($panels[$panel_name],$conf['mini_panels'][$panel_name]);
+ $panels[$panel_name] = empty($conf['mini_panels'][$panel_name]) ? $panels[$panel_name] : array_merge($panels[$panel_name],$conf['mini_panels'][$panel_name]);
+ }
+ if(!empty($conf['mini_panels'][$panel_name])) {
+ uasort($panels, function($a,$b) { return $a['weight'] - $b['weight'];});
}
- uasort($panels, function($a,$b) { return $a['weight'] - $b['weight'];});
$form['mini_panels']['#tree'] = TRUE;
foreach ($panels as $mini_panel) {
$form['mini_panels'][$mini_panel['name']] = array(
@@ -89,7 +90,7 @@ function panels_ajax_tab_tabs_edit_form($form, &$form_state) {
'#default_value' => $conf['container_id'],
'#required' => TRUE,
);
- $form['#theme'] = array('panels_ajax_tab_container_edit_form');
+ $form['#theme'] = array('panels_ajax_tab_tabs_edit_form');
return $form;
}