@@ -152,27 +152,27 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function features_export_form_validate_field($element, &$form_state) { |
154 | 154 | switch ($element['#name']) { |
155 | - case 'module_name': |
|
156 | - if (!preg_match('!^[a-z0-9_]+$!', $element['#value'])) { |
|
157 | - form_error($element, t('The machine-readable name must contain only lowercase letters, numbers, and underscores.')); |
|
158 | - } |
|
159 | - // If user is filling out the feature name for the first time and uses |
|
160 | - // the name of an existing module throw an error. |
|
161 | - else if (empty($element['#default_value']) && features_get_info('module', $element['#value'])) { |
|
162 | - form_error($element, t('A module by the name @name already exists on your site. Please choose a different name.', array('@name' => $element['#value']))); |
|
163 | - } |
|
164 | - break; |
|
165 | - case 'project_status_url': |
|
166 | - if (!empty($element['#value']) && !valid_url($element['#value'])) { |
|
167 | - form_error($element, t('The URL %url is invalid. Please enter a fully-qualified URL, such as http://www.example.com/feed.xml.', array('%url' => $element['#value']))); |
|
168 | - } |
|
169 | - break; |
|
170 | - case 'version': |
|
171 | - preg_match('/^(?P<core>\d+\.x)-(?P<major>\d+)\.(?P<patch>\d+)-?(?P<extra>\w+)?$/', $element['#value'], $matches); |
|
172 | - if (!empty($element['#value']) && !isset($matches['core'], $matches['major'])) { |
|
173 | - form_error($element, t('Please enter a valid version with core and major version number. Example: !example', array('!example' => '6.x-1.0'))); |
|
174 | - }; |
|
175 | - break; |
|
155 | + case 'module_name': |
|
156 | + if (!preg_match('!^[a-z0-9_]+$!', $element['#value'])) { |
|
157 | + form_error($element, t('The machine-readable name must contain only lowercase letters, numbers, and underscores.')); |
|
158 | + } |
|
159 | + // If user is filling out the feature name for the first time and uses |
|
160 | + // the name of an existing module throw an error. |
|
161 | + else if (empty($element['#default_value']) && features_get_info('module', $element['#value'])) { |
|
162 | + form_error($element, t('A module by the name @name already exists on your site. Please choose a different name.', array('@name' => $element['#value']))); |
|
163 | + } |
|
164 | + break; |
|
165 | + case 'project_status_url': |
|
166 | + if (!empty($element['#value']) && !valid_url($element['#value'])) { |
|
167 | + form_error($element, t('The URL %url is invalid. Please enter a fully-qualified URL, such as http://www.example.com/feed.xml.', array('%url' => $element['#value']))); |
|
168 | + } |
|
169 | + break; |
|
170 | + case 'version': |
|
171 | + preg_match('/^(?P<core>\d+\.x)-(?P<major>\d+)\.(?P<patch>\d+)-?(?P<extra>\w+)?$/', $element['#value'], $matches); |
|
172 | + if (!empty($element['#value']) && !isset($matches['core'], $matches['major'])) { |
|
173 | + form_error($element, t('Please enter a valid version with core and major version number. Example: !example', array('!example' => '6.x-1.0'))); |
|
174 | + }; |
|
175 | + break; |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
@@ -490,12 +490,12 @@ discard block |
||
490 | 490 | foreach ($feature->info['features'] as $component => $items) { |
491 | 491 | if (user_access('administer features') && in_array($states[$feature->name][$component], array(FEATURES_OVERRIDDEN, FEATURES_NEEDS_REVIEW))) { |
492 | 492 | switch ($states[$feature->name][$component]) { |
493 | - case FEATURES_OVERRIDDEN: |
|
494 | - $revert = TRUE; |
|
495 | - break; |
|
496 | - case FEATURES_NEEDS_REVIEW: |
|
497 | - $review = TRUE; |
|
498 | - break; |
|
493 | + case FEATURES_OVERRIDDEN: |
|
494 | + $revert = TRUE; |
|
495 | + break; |
|
496 | + case FEATURES_NEEDS_REVIEW: |
|
497 | + $review = TRUE; |
|
498 | + break; |
|
499 | 499 | } |
500 | 500 | $form['revert'][$component] = array( |
501 | 501 | '#type' => 'checkbox', |
@@ -156,12 +156,12 @@ |
||
156 | 156 | |
157 | 157 | function get_panels_storage_op_for_ajax($method) { |
158 | 158 | switch ($method) { |
159 | - case 'ajax_unlock_ipe': |
|
160 | - case 'ajax_save_form': |
|
161 | - return 'update'; |
|
162 | - case 'ajax_change_layout': |
|
163 | - case 'ajax_set_layout': |
|
164 | - return 'change layout'; |
|
159 | + case 'ajax_unlock_ipe': |
|
160 | + case 'ajax_save_form': |
|
161 | + return 'update'; |
|
162 | + case 'ajax_change_layout': |
|
163 | + case 'ajax_set_layout': |
|
164 | + return 'change layout'; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | return parent::get_panels_storage_op_for_ajax($method); |
@@ -653,18 +653,18 @@ discard block |
||
653 | 653 | */ |
654 | 654 | function get_title() { |
655 | 655 | switch ($this->hide_title) { |
656 | - case PANELS_TITLE_NONE: |
|
657 | - return ''; |
|
656 | + case PANELS_TITLE_NONE: |
|
657 | + return ''; |
|
658 | 658 | |
659 | - case PANELS_TITLE_PANE: |
|
660 | - return isset($this->stored_pane_title) ? $this->stored_pane_title : ''; |
|
659 | + case PANELS_TITLE_PANE: |
|
660 | + return isset($this->stored_pane_title) ? $this->stored_pane_title : ''; |
|
661 | 661 | |
662 | - case PANELS_TITLE_FIXED: |
|
663 | - case FALSE; // For old exported panels that are not in the database. |
|
664 | - if (!empty($this->title)) { |
|
665 | - return filter_xss_admin(ctools_context_keyword_substitute($this->title, array(), $this->context)); |
|
666 | - } |
|
667 | - return NULL; |
|
662 | + case PANELS_TITLE_FIXED: |
|
663 | + case FALSE; // For old exported panels that are not in the database. |
|
664 | + if (!empty($this->title)) { |
|
665 | + return filter_xss_admin(ctools_context_keyword_substitute($this->title, array(), $this->context)); |
|
666 | + } |
|
667 | + return NULL; |
|
668 | 668 | } |
669 | 669 | } |
670 | 670 | |
@@ -1039,15 +1039,15 @@ discard block |
||
1039 | 1039 | } |
1040 | 1040 | $output .= $prefix . '$display->hide_title = '; |
1041 | 1041 | switch ($display->hide_title) { |
1042 | - case PANELS_TITLE_FIXED: |
|
1043 | - $output .= 'PANELS_TITLE_FIXED'; |
|
1044 | - break; |
|
1045 | - case PANELS_TITLE_NONE: |
|
1046 | - $output .= 'PANELS_TITLE_NONE'; |
|
1047 | - break; |
|
1048 | - case PANELS_TITLE_PANE: |
|
1049 | - $output .= 'PANELS_TITLE_PANE'; |
|
1050 | - break; |
|
1042 | + case PANELS_TITLE_FIXED: |
|
1043 | + $output .= 'PANELS_TITLE_FIXED'; |
|
1044 | + break; |
|
1045 | + case PANELS_TITLE_NONE: |
|
1046 | + $output .= 'PANELS_TITLE_NONE'; |
|
1047 | + break; |
|
1048 | + case PANELS_TITLE_PANE: |
|
1049 | + $output .= 'PANELS_TITLE_PANE'; |
|
1050 | + break; |
|
1051 | 1051 | } |
1052 | 1052 | $output .= ";\n"; |
1053 | 1053 |
@@ -182,24 +182,24 @@ |
||
182 | 182 | function list_build_row($item, &$form_state, $operations) { |
183 | 183 | // Set up sorting |
184 | 184 | switch ($form_state['values']['order']) { |
185 | - case 'disabled': |
|
186 | - $this->sorts[$item->name] = empty($item->disabled) . $item->admin_title; |
|
187 | - break; |
|
188 | - case 'title': |
|
189 | - $this->sorts[$item->name] = $item->admin_title; |
|
190 | - break; |
|
191 | - case 'name': |
|
192 | - $this->sorts[$item->name] = $item->name; |
|
193 | - break; |
|
194 | - case 'category': |
|
195 | - $this->sorts[$item->name] = ($item->category ? $item->category : t('Miscellaneous')) . $item->admin_title; |
|
196 | - break; |
|
197 | - case 'plugin': |
|
198 | - $this->sorts[$item->name] = $item->plugin; |
|
199 | - break; |
|
200 | - case 'storage': |
|
201 | - $this->sorts[$item->name] = $item->type . $item->admin_title; |
|
202 | - break; |
|
185 | + case 'disabled': |
|
186 | + $this->sorts[$item->name] = empty($item->disabled) . $item->admin_title; |
|
187 | + break; |
|
188 | + case 'title': |
|
189 | + $this->sorts[$item->name] = $item->admin_title; |
|
190 | + break; |
|
191 | + case 'name': |
|
192 | + $this->sorts[$item->name] = $item->name; |
|
193 | + break; |
|
194 | + case 'category': |
|
195 | + $this->sorts[$item->name] = ($item->category ? $item->category : t('Miscellaneous')) . $item->admin_title; |
|
196 | + break; |
|
197 | + case 'plugin': |
|
198 | + $this->sorts[$item->name] = $item->plugin; |
|
199 | + break; |
|
200 | + case 'storage': |
|
201 | + $this->sorts[$item->name] = $item->type . $item->admin_title; |
|
202 | + break; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $type = !empty($this->builders[$item->plugin]) ? $this->builders[$item->plugin]['title'] : t('Broken/missing plugin'); |
@@ -434,28 +434,28 @@ |
||
434 | 434 | function add_css($filename, $type = 'module', $media = 'all', $preprocess = TRUE) { |
435 | 435 | $path = file_create_path($filename); |
436 | 436 | switch ($this->meta_location) { |
437 | - case 'standard': |
|
438 | - if (file_check_location($filename, file_directory_path())) { |
|
439 | - // If the file is located in the files directory, use |
|
440 | - // ctools_css_add_css() because it can handle temporary CSS in the |
|
441 | - // private filesystem. |
|
442 | - ctools_include('css'); |
|
443 | - ctools_css_add_css($filename, $type, $media, $preprocess); |
|
444 | - } |
|
445 | - else { |
|
446 | - drupal_add_css($filename, $type, $media, $preprocess); |
|
447 | - } |
|
448 | - break; |
|
449 | - case 'inline': |
|
450 | - if ($path) { |
|
451 | - $url = file_create_url($filename); |
|
452 | - } |
|
453 | - else { |
|
454 | - $url = base_path() . $filename; |
|
455 | - } |
|
437 | + case 'standard': |
|
438 | + if (file_check_location($filename, file_directory_path())) { |
|
439 | + // If the file is located in the files directory, use |
|
440 | + // ctools_css_add_css() because it can handle temporary CSS in the |
|
441 | + // private filesystem. |
|
442 | + ctools_include('css'); |
|
443 | + ctools_css_add_css($filename, $type, $media, $preprocess); |
|
444 | + } |
|
445 | + else { |
|
446 | + drupal_add_css($filename, $type, $media, $preprocess); |
|
447 | + } |
|
448 | + break; |
|
449 | + case 'inline': |
|
450 | + if ($path) { |
|
451 | + $url = file_create_url($filename); |
|
452 | + } |
|
453 | + else { |
|
454 | + $url = base_path() . $filename; |
|
455 | + } |
|
456 | 456 | |
457 | - $this->prefix .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . $url . '" />'."\n"; |
|
458 | - break; |
|
457 | + $this->prefix .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . $url . '" />'."\n"; |
|
458 | + break; |
|
459 | 459 | } |
460 | 460 | } |
461 | 461 |
@@ -481,24 +481,24 @@ discard block |
||
481 | 481 | */ |
482 | 482 | function get_panels_storage_op_for_ajax($method) { |
483 | 483 | switch ($method) { |
484 | - case 'ajax_show': |
|
485 | - case 'ajax_hide': |
|
486 | - case 'ajax_select_content': |
|
487 | - case 'ajax_add_pane': |
|
488 | - case 'ajax_edit_pane': |
|
489 | - case 'ajax_panel_title': |
|
490 | - case 'ajax_cache_method': |
|
491 | - case 'ajax_cache_settings': |
|
492 | - case 'ajax_style_type': |
|
493 | - case 'ajax_style_settings': |
|
494 | - case 'ajax_pane_css': |
|
495 | - case 'ajax_lock': |
|
496 | - case 'ajax_access_settings': |
|
497 | - case 'ajax_access_add_test': |
|
498 | - case 'ajax_access_configure_test': |
|
499 | - case 'ajax_layout': |
|
500 | - case 'ajax_style': |
|
501 | - return 'update'; |
|
484 | + case 'ajax_show': |
|
485 | + case 'ajax_hide': |
|
486 | + case 'ajax_select_content': |
|
487 | + case 'ajax_add_pane': |
|
488 | + case 'ajax_edit_pane': |
|
489 | + case 'ajax_panel_title': |
|
490 | + case 'ajax_cache_method': |
|
491 | + case 'ajax_cache_settings': |
|
492 | + case 'ajax_style_type': |
|
493 | + case 'ajax_style_settings': |
|
494 | + case 'ajax_pane_css': |
|
495 | + case 'ajax_lock': |
|
496 | + case 'ajax_access_settings': |
|
497 | + case 'ajax_access_add_test': |
|
498 | + case 'ajax_access_configure_test': |
|
499 | + case 'ajax_layout': |
|
500 | + case 'ajax_style': |
|
501 | + return 'update'; |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | return parent::get_panels_storage_op($method); |
@@ -1001,26 +1001,26 @@ discard block |
||
1001 | 1001 | // This lets us choose whether we're doing the display's cache or |
1002 | 1002 | // a pane's. |
1003 | 1003 | switch ($type) { |
1004 | - case 'display': |
|
1005 | - $style = isset($this->display->panel_settings['style']) ? $this->display->panel_settings['style'] : 'default'; |
|
1006 | - $title = t('Default style for this display'); |
|
1007 | - break; |
|
1008 | - |
|
1009 | - case 'region': |
|
1010 | - $style = isset($this->display->panel_settings[$pid]['style']) ? $this->display->panel_settings[$pid]['style'] : '-1'; // -1 signifies to use the default setting. |
|
1011 | - $title = t('Panel style for region "!region"', array('!region' => $this->plugins['layout']['panels'][$pid])); |
|
1012 | - break; |
|
1013 | - |
|
1014 | - case 'pane': |
|
1015 | - ctools_include('content'); |
|
1016 | - $pane = &$this->display->content[$pid]; |
|
1017 | - $style = isset($pane->style['style']) ? $pane->style['style'] : 'default'; |
|
1018 | - $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); |
|
1019 | - $title = t('Pane style for "!pane"', array('!pane' => $subtype['title'])); |
|
1020 | - break; |
|
1004 | + case 'display': |
|
1005 | + $style = isset($this->display->panel_settings['style']) ? $this->display->panel_settings['style'] : 'default'; |
|
1006 | + $title = t('Default style for this display'); |
|
1007 | + break; |
|
1008 | + |
|
1009 | + case 'region': |
|
1010 | + $style = isset($this->display->panel_settings[$pid]['style']) ? $this->display->panel_settings[$pid]['style'] : '-1'; // -1 signifies to use the default setting. |
|
1011 | + $title = t('Panel style for region "!region"', array('!region' => $this->plugins['layout']['panels'][$pid])); |
|
1012 | + break; |
|
1013 | + |
|
1014 | + case 'pane': |
|
1015 | + ctools_include('content'); |
|
1016 | + $pane = &$this->display->content[$pid]; |
|
1017 | + $style = isset($pane->style['style']) ? $pane->style['style'] : 'default'; |
|
1018 | + $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); |
|
1019 | + $title = t('Pane style for "!pane"', array('!pane' => $subtype['title'])); |
|
1020 | + break; |
|
1021 | 1021 | |
1022 | - default: |
|
1023 | - ctools_modal_render(t('Error'), t('Invalid pane id.')); |
|
1022 | + default: |
|
1023 | + ctools_modal_render(t('Error'), t('Invalid pane id.')); |
|
1024 | 1024 | } |
1025 | 1025 | $info = $this->get_style($type, $pid); |
1026 | 1026 | $style_plugin = $info[0]; |
@@ -1057,27 +1057,27 @@ discard block |
||
1057 | 1057 | |
1058 | 1058 | // If there's no settings form, just change the style and exit. |
1059 | 1059 | switch($type) { |
1060 | - case 'display': |
|
1061 | - $this->display->panel_settings['style'] = $form_state['style']; |
|
1062 | - if (isset($this->display->panel_settings['style_settings']['default'])) { |
|
1063 | - unset($this->display->panel_settings['style_settings']['default']); |
|
1064 | - } |
|
1065 | - break; |
|
1066 | - |
|
1067 | - case 'region': |
|
1068 | - $this->display->panel_settings[$pid]['style'] = $form_state['style']; |
|
1069 | - if (isset($this->display->panel_settings['style_settings'][$pid])) { |
|
1070 | - unset($this->display->panel_settings['style_settings'][$pid]); |
|
1071 | - } |
|
1072 | - break; |
|
1073 | - |
|
1074 | - case 'pane': |
|
1075 | - $pane->style['style'] = $form_state['style']; |
|
1076 | - if (isset($pane->style['settings'])) { |
|
1077 | - unset($pane->style['settings']); |
|
1078 | - } |
|
1079 | - |
|
1080 | - break; |
|
1060 | + case 'display': |
|
1061 | + $this->display->panel_settings['style'] = $form_state['style']; |
|
1062 | + if (isset($this->display->panel_settings['style_settings']['default'])) { |
|
1063 | + unset($this->display->panel_settings['style_settings']['default']); |
|
1064 | + } |
|
1065 | + break; |
|
1066 | + |
|
1067 | + case 'region': |
|
1068 | + $this->display->panel_settings[$pid]['style'] = $form_state['style']; |
|
1069 | + if (isset($this->display->panel_settings['style_settings'][$pid])) { |
|
1070 | + unset($this->display->panel_settings['style_settings'][$pid]); |
|
1071 | + } |
|
1072 | + break; |
|
1073 | + |
|
1074 | + case 'pane': |
|
1075 | + $pane->style['style'] = $form_state['style']; |
|
1076 | + if (isset($pane->style['settings'])) { |
|
1077 | + unset($pane->style['settings']); |
|
1078 | + } |
|
1079 | + |
|
1080 | + break; |
|
1081 | 1081 | } |
1082 | 1082 | panels_edit_cache_set($this->cache); |
1083 | 1083 | |
@@ -1117,56 +1117,56 @@ discard block |
||
1117 | 1117 | $defaults = isset($style['defaults']) ? $style['defaults'] : array(); |
1118 | 1118 | // Get the &$conf variable based upon whose style we're editing. |
1119 | 1119 | switch ($type) { |
1120 | - case 'display': |
|
1121 | - $this->display->panel_settings['style'] = $this->cache->style; |
|
1122 | - $this->display->panel_settings['style_settings']['default'] = $defaults; |
|
1123 | - break; |
|
1124 | - |
|
1125 | - case 'region': |
|
1126 | - $this->display->panel_settings[$pid]['style'] = $this->cache->style; |
|
1127 | - $this->display->panel_settings['style_settings'][$pid] = $defaults; |
|
1128 | - break; |
|
1129 | - |
|
1130 | - case 'pane': |
|
1131 | - $pane = &$this->display->content[$pid]; |
|
1132 | - $pane->style['style'] = $this->cache->style; |
|
1133 | - $pane->style['settings'] = $defaults; |
|
1134 | - $conf = &$pane->style['settings']; |
|
1135 | - break; |
|
1120 | + case 'display': |
|
1121 | + $this->display->panel_settings['style'] = $this->cache->style; |
|
1122 | + $this->display->panel_settings['style_settings']['default'] = $defaults; |
|
1123 | + break; |
|
1124 | + |
|
1125 | + case 'region': |
|
1126 | + $this->display->panel_settings[$pid]['style'] = $this->cache->style; |
|
1127 | + $this->display->panel_settings['style_settings'][$pid] = $defaults; |
|
1128 | + break; |
|
1129 | + |
|
1130 | + case 'pane': |
|
1131 | + $pane = &$this->display->content[$pid]; |
|
1132 | + $pane->style['style'] = $this->cache->style; |
|
1133 | + $pane->style['settings'] = $defaults; |
|
1134 | + $conf = &$pane->style['settings']; |
|
1135 | + break; |
|
1136 | 1136 | } |
1137 | 1137 | } |
1138 | 1138 | else { |
1139 | 1139 | switch ($type) { |
1140 | - case 'display': |
|
1141 | - $style = panels_get_style((!empty($this->display->panel_settings['style'])) ? $this->display->panel_settings['style'] : 'default'); |
|
1142 | - break; |
|
1143 | - |
|
1144 | - case 'region': |
|
1145 | - $style = panels_get_style((!empty($this->display->panel_settings[$pid]['style'])) ? $this->display->panel_settings[$pid]['style'] : '-1'); |
|
1146 | - break; |
|
1147 | - |
|
1148 | - case 'pane': |
|
1149 | - $pane = &$this->display->content[$pid]; |
|
1150 | - $style = panels_get_style(!empty($pane->style['style']) ? $pane->style['style'] : 'default'); |
|
1151 | - break; |
|
1152 | - } |
|
1153 | - } |
|
1154 | - |
|
1155 | - // Set up our $conf reference. |
|
1156 | - switch ($type) { |
|
1157 | 1140 | case 'display': |
1158 | - $conf = &$this->display->panel_settings['style_settings']['default']; |
|
1141 | + $style = panels_get_style((!empty($this->display->panel_settings['style'])) ? $this->display->panel_settings['style'] : 'default'); |
|
1159 | 1142 | break; |
1160 | 1143 | |
1161 | 1144 | case 'region': |
1162 | - $conf = &$this->display->panel_settings['style_settings'][$pid]; |
|
1145 | + $style = panels_get_style((!empty($this->display->panel_settings[$pid]['style'])) ? $this->display->panel_settings[$pid]['style'] : '-1'); |
|
1163 | 1146 | break; |
1164 | 1147 | |
1165 | 1148 | case 'pane': |
1166 | - ctools_include('content'); |
|
1167 | 1149 | $pane = &$this->display->content[$pid]; |
1168 | - $conf = &$pane->style['settings']; |
|
1150 | + $style = panels_get_style(!empty($pane->style['style']) ? $pane->style['style'] : 'default'); |
|
1169 | 1151 | break; |
1152 | + } |
|
1153 | + } |
|
1154 | + |
|
1155 | + // Set up our $conf reference. |
|
1156 | + switch ($type) { |
|
1157 | + case 'display': |
|
1158 | + $conf = &$this->display->panel_settings['style_settings']['default']; |
|
1159 | + break; |
|
1160 | + |
|
1161 | + case 'region': |
|
1162 | + $conf = &$this->display->panel_settings['style_settings'][$pid]; |
|
1163 | + break; |
|
1164 | + |
|
1165 | + case 'pane': |
|
1166 | + ctools_include('content'); |
|
1167 | + $pane = &$this->display->content[$pid]; |
|
1168 | + $conf = &$pane->style['settings']; |
|
1169 | + break; |
|
1170 | 1170 | } |
1171 | 1171 | |
1172 | 1172 | // Backward compatibility: Translate old-style stylizer to new style |
@@ -1192,20 +1192,20 @@ discard block |
||
1192 | 1192 | $conf = &$info[1]; |
1193 | 1193 | |
1194 | 1194 | switch ($type) { |
1195 | - case 'display': |
|
1196 | - $title = t('Style settings for @style (display)', array('@style' => $style['title'])); |
|
1197 | - break; |
|
1195 | + case 'display': |
|
1196 | + $title = t('Style settings for @style (display)', array('@style' => $style['title'])); |
|
1197 | + break; |
|
1198 | 1198 | |
1199 | - case 'region': |
|
1200 | - $title = t('Style settings for style @style (Region "!region")', array('@style' => $style['title'], '!region' => $this->plugins['layout']['panels'][$pid])); |
|
1201 | - break; |
|
1199 | + case 'region': |
|
1200 | + $title = t('Style settings for style @style (Region "!region")', array('@style' => $style['title'], '!region' => $this->plugins['layout']['panels'][$pid])); |
|
1201 | + break; |
|
1202 | 1202 | |
1203 | - case 'pane': |
|
1204 | - ctools_include('content'); |
|
1205 | - $pane = &$this->display->content[$pid]; |
|
1206 | - $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); |
|
1207 | - $title = t('Style settings for style @style (Pane "!pane")', array('@style' => $style['title'], '!pane' => $subtype['title'])); |
|
1208 | - break; |
|
1203 | + case 'pane': |
|
1204 | + ctools_include('content'); |
|
1205 | + $pane = &$this->display->content[$pid]; |
|
1206 | + $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); |
|
1207 | + $title = t('Style settings for style @style (Pane "!pane")', array('@style' => $style['title'], '!pane' => $subtype['title'])); |
|
1208 | + break; |
|
1209 | 1209 | } |
1210 | 1210 | |
1211 | 1211 | $form_state = array( |
@@ -63,27 +63,27 @@ |
||
63 | 63 | function add_css($filename, $type = 'module', $media = 'all', $preprocess = TRUE) { |
64 | 64 | $path = file_create_path($filename); |
65 | 65 | switch ($this->meta_location) { |
66 | - case 'standard': |
|
67 | - if ($path) { |
|
68 | - // Use CTools CSS add because it can handle temporary CSS in private |
|
69 | - // filesystem. |
|
70 | - ctools_include('css'); |
|
71 | - ctools_css_add_css($filename, $type, $media, $preprocess); |
|
72 | - } |
|
73 | - else { |
|
74 | - drupal_add_css($filename, $type, $media, $preprocess); |
|
75 | - } |
|
76 | - break; |
|
77 | - case 'inline': |
|
78 | - if ($path) { |
|
79 | - $url = file_create_url($filename); |
|
80 | - } |
|
81 | - else { |
|
82 | - $url = base_path() . $filename; |
|
83 | - } |
|
66 | + case 'standard': |
|
67 | + if ($path) { |
|
68 | + // Use CTools CSS add because it can handle temporary CSS in private |
|
69 | + // filesystem. |
|
70 | + ctools_include('css'); |
|
71 | + ctools_css_add_css($filename, $type, $media, $preprocess); |
|
72 | + } |
|
73 | + else { |
|
74 | + drupal_add_css($filename, $type, $media, $preprocess); |
|
75 | + } |
|
76 | + break; |
|
77 | + case 'inline': |
|
78 | + if ($path) { |
|
79 | + $url = file_create_url($filename); |
|
80 | + } |
|
81 | + else { |
|
82 | + $url = base_path() . $filename; |
|
83 | + } |
|
84 | 84 | |
85 | - $this->prefix .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . $url . '" />'."\n"; |
|
86 | - break; |
|
85 | + $this->prefix .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . $url . '" />'."\n"; |
|
86 | + break; |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 |
@@ -95,21 +95,21 @@ |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | switch ($conf['granularity']) { |
98 | - case 'args': |
|
99 | - foreach ($args as $arg) { |
|
100 | - $id .= ':' . $arg; |
|
101 | - } |
|
102 | - break; |
|
103 | - |
|
104 | - case 'context': |
|
105 | - if (!is_array($contexts)) { |
|
106 | - $contexts = array($contexts); |
|
107 | - } |
|
108 | - foreach ($contexts as $context) { |
|
109 | - if (isset($context->argument)) { |
|
110 | - $id .= ':' . $context->argument; |
|
111 | - } |
|
98 | + case 'args': |
|
99 | + foreach ($args as $arg) { |
|
100 | + $id .= ':' . $arg; |
|
101 | + } |
|
102 | + break; |
|
103 | + |
|
104 | + case 'context': |
|
105 | + if (!is_array($contexts)) { |
|
106 | + $contexts = array($contexts); |
|
107 | + } |
|
108 | + foreach ($contexts as $context) { |
|
109 | + if (isset($context->argument)) { |
|
110 | + $id .= ':' . $context->argument; |
|
112 | 111 | } |
112 | + } |
|
113 | 113 | } |
114 | 114 | if (module_exists('locale')) { |
115 | 115 | global $language; |
@@ -451,18 +451,18 @@ discard block |
||
451 | 451 | } |
452 | 452 | |
453 | 453 | switch ($item['type']) { |
454 | - case 'column': |
|
455 | - $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['column'] . '-' . $id); |
|
456 | - $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); |
|
457 | - break; |
|
458 | - case 'row': |
|
459 | - $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['row'] . '-' . $id); |
|
460 | - $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max, TRUE); |
|
461 | - break; |
|
462 | - case 'region': |
|
463 | - $content = isset($renderer->content[$id]) ? $renderer->content[$id] : " "; |
|
464 | - $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); |
|
465 | - break; |
|
454 | + case 'column': |
|
455 | + $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['column'] . '-' . $id); |
|
456 | + $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); |
|
457 | + break; |
|
458 | + case 'row': |
|
459 | + $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['row'] . '-' . $id); |
|
460 | + $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max, TRUE); |
|
461 | + break; |
|
462 | + case 'region': |
|
463 | + $content = isset($renderer->content[$id]) ? $renderer->content[$id] : " "; |
|
464 | + $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); |
|
465 | + break; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | // If all items are fixed then we have a special splitter on the right to |
@@ -949,20 +949,20 @@ discard block |
||
949 | 949 | |
950 | 950 | |
951 | 951 | switch ($item['type']) { |
952 | - case 'column': |
|
953 | - $title = t('Configure column'); |
|
954 | - break; |
|
955 | - case 'row': |
|
956 | - if ($id == 'canvas') { |
|
957 | - $title = t('Configure canvas'); |
|
958 | - } |
|
959 | - else { |
|
960 | - $title = t('Configure row'); |
|
961 | - } |
|
962 | - break; |
|
963 | - case 'region': |
|
964 | - $title = t('Configure region'); |
|
965 | - break; |
|
952 | + case 'column': |
|
953 | + $title = t('Configure column'); |
|
954 | + break; |
|
955 | + case 'row': |
|
956 | + if ($id == 'canvas') { |
|
957 | + $title = t('Configure canvas'); |
|
958 | + } |
|
959 | + else { |
|
960 | + $title = t('Configure row'); |
|
961 | + } |
|
962 | + break; |
|
963 | + case 'region': |
|
964 | + $title = t('Configure region'); |
|
965 | + break; |
|
966 | 966 | } |
967 | 967 | |
968 | 968 | $form_state = array( |
@@ -1224,44 +1224,44 @@ discard block |
||
1224 | 1224 | $parent = &$settings['items'][$id]; |
1225 | 1225 | |
1226 | 1226 | switch ($parent['type']) { |
1227 | + case 'column': |
|
1228 | + $title = t('Add row'); |
|
1229 | + // Create the new item with defaults. |
|
1230 | + $item = array( |
|
1231 | + 'type' => 'row', |
|
1232 | + 'contains' => 'region', |
|
1233 | + 'children' => array(), |
|
1234 | + 'parent' => $id, |
|
1235 | + ); |
|
1236 | + break; |
|
1237 | + case 'row': |
|
1238 | + switch ($parent['contains']) { |
|
1239 | + case 'region': |
|
1240 | + $title = $location == 'left' ? t('Add region to left') : t('Add region to right'); |
|
1241 | + $item = array( |
|
1242 | + 'type' => 'region', |
|
1243 | + 'title' => '', |
|
1244 | + 'width' => 100, |
|
1245 | + 'width_type' => '%', |
|
1246 | + 'parent' => $id, |
|
1247 | + ); |
|
1248 | + break; |
|
1227 | 1249 | case 'column': |
1228 | - $title = t('Add row'); |
|
1229 | - // Create the new item with defaults. |
|
1230 | - $item = array( |
|
1231 | - 'type' => 'row', |
|
1232 | - 'contains' => 'region', |
|
1233 | - 'children' => array(), |
|
1234 | - 'parent' => $id, |
|
1235 | - ); |
|
1236 | - break; |
|
1237 | - case 'row': |
|
1238 | - switch ($parent['contains']) { |
|
1239 | - case 'region': |
|
1240 | - $title = $location == 'left' ? t('Add region to left') : t('Add region to right'); |
|
1241 | - $item = array( |
|
1242 | - 'type' => 'region', |
|
1243 | - 'title' => '', |
|
1244 | - 'width' => 100, |
|
1245 | - 'width_type' => '%', |
|
1246 | - 'parent' => $id, |
|
1247 | - ); |
|
1248 | - break; |
|
1249 | - case 'column': |
|
1250 | - $title = $location == 'left' ? t('Add column to left') : t('Add column to right'); |
|
1251 | - $item = array( |
|
1252 | - 'type' => 'column', |
|
1253 | - 'width' => 100, |
|
1254 | - 'width_type' => '%', |
|
1255 | - 'parent' => $id, |
|
1256 | - 'children' => array(), |
|
1257 | - ); |
|
1258 | - break; |
|
1259 | - } |
|
1250 | + $title = $location == 'left' ? t('Add column to left') : t('Add column to right'); |
|
1251 | + $item = array( |
|
1252 | + 'type' => 'column', |
|
1253 | + 'width' => 100, |
|
1254 | + 'width_type' => '%', |
|
1255 | + 'parent' => $id, |
|
1256 | + 'children' => array(), |
|
1257 | + ); |
|
1258 | + break; |
|
1259 | + } |
|
1260 | 1260 | // Create the new item with defaults. |
1261 | 1261 | break; |
1262 | - case 'region': |
|
1263 | - // Cannot add items to regions. |
|
1264 | - break; |
|
1262 | + case 'region': |
|
1263 | + // Cannot add items to regions. |
|
1264 | + break; |
|
1265 | 1265 | } |
1266 | 1266 | |
1267 | 1267 | $form_state = array( |
@@ -1323,41 +1323,41 @@ discard block |
||
1323 | 1323 | // The blocks of code in this else look very similar but are not actually |
1324 | 1324 | // duplicated because the order changes based on left or right. |
1325 | 1325 | switch ($position) { |
1326 | - case 'left': |
|
1327 | - if ($location == 'left') { |
|
1326 | + case 'left': |
|
1327 | + if ($location == 'left') { |
|
1328 | + $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], $form_state['sibling']); |
|
1329 | + $output[] = ctools_ajax_command_prepend('#panels-dnd-main .' . $parent_class . '-left', $item_output); |
|
1330 | + } |
|
1331 | + else if ($location == 'right') { |
|
1332 | + // If we are adding to the right side of the left box, there is |
|
1333 | + // a splitter that we have to remove; then we add our box normally, |
|
1334 | + // and then add a new splitter for just our guy. |
|
1335 | + $output[] = ctools_ajax_command_remove('panels-flexible-splitter-for-' . $renderer->base[$item['type']] . '-' . $form_state['key']); |
|
1336 | + $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; |
|
1337 | + $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], NULL); |
|
1338 | + $output[] = ctools_ajax_command_append('#panels-dnd-main .' . $parent_class . '-left', $item_output); |
|
1339 | + } |
|
1340 | + break; |
|
1341 | + case 'right': |
|
1342 | + if (!empty($form_state['sibling'])) { |
|
1343 | + $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; |
|
1344 | + } |
|
1345 | + $output[] = ctools_ajax_command_append('#panels-dnd-main .' . $parent_class . '-right', $item_output); |
|
1346 | + break; |
|
1347 | + case 'middle': |
|
1348 | + if ($location == 'left') { |
|
1349 | + if (!empty($form_state['sibling'])) { |
|
1328 | 1350 | $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], $form_state['sibling']); |
1329 | - $output[] = ctools_ajax_command_prepend('#panels-dnd-main .' . $parent_class . '-left', $item_output); |
|
1330 | - } |
|
1331 | - else if ($location == 'right') { |
|
1332 | - // If we are adding to the right side of the left box, there is |
|
1333 | - // a splitter that we have to remove; then we add our box normally, |
|
1334 | - // and then add a new splitter for just our guy. |
|
1335 | - $output[] = ctools_ajax_command_remove('panels-flexible-splitter-for-' . $renderer->base[$item['type']] . '-' . $form_state['key']); |
|
1336 | - $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; |
|
1337 | - $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], NULL); |
|
1338 | - $output[] = ctools_ajax_command_append('#panels-dnd-main .' . $parent_class . '-left', $item_output); |
|
1339 | 1351 | } |
1340 | - break; |
|
1341 | - case 'right': |
|
1352 | + $output[] = ctools_ajax_command_prepend('#panels-dnd-main .' . $parent_class . '-middle', $item_output); |
|
1353 | + } |
|
1354 | + else { |
|
1342 | 1355 | if (!empty($form_state['sibling'])) { |
1343 | 1356 | $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; |
1344 | 1357 | } |
1345 | - $output[] = ctools_ajax_command_append('#panels-dnd-main .' . $parent_class . '-right', $item_output); |
|
1346 | - break; |
|
1347 | - case 'middle': |
|
1348 | - if ($location == 'left') { |
|
1349 | - if (!empty($form_state['sibling'])) { |
|
1350 | - $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], $form_state['sibling']); |
|
1351 | - } |
|
1352 | - $output[] = ctools_ajax_command_prepend('#panels-dnd-main .' . $parent_class . '-middle', $item_output); |
|
1353 | - } |
|
1354 | - else { |
|
1355 | - if (!empty($form_state['sibling'])) { |
|
1356 | - $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; |
|
1357 | - } |
|
1358 | - $output[] = ctools_ajax_command_append('#panels-dnd-main .' . $parent_class . '-middle', $item_output); |
|
1359 | - } |
|
1360 | - break; |
|
1358 | + $output[] = ctools_ajax_command_append('#panels-dnd-main .' . $parent_class . '-middle', $item_output); |
|
1359 | + } |
|
1360 | + break; |
|
1361 | 1361 | |
1362 | 1362 | } |
1363 | 1363 |