@@ -124,15 +124,15 @@ |
||
124 | 124 | */ |
125 | 125 | function theme_features_module_status($status, $module = NULL) { |
126 | 126 | switch ($status) { |
127 | - case FEATURES_MODULE_ENABLED: |
|
128 | - $text = !empty($module) ? $module : t('Enabled'); |
|
129 | - return "<span class='admin-enabled'>{$text}</span>"; |
|
130 | - case FEATURES_MODULE_DISABLED: |
|
131 | - $text = !empty($module) ? $module : t('Disabled'); |
|
132 | - return "<span class='admin-disabled'>{$text}</span>"; |
|
133 | - case FEATURES_MODULE_MISSING: |
|
134 | - $text = !empty($module) ? $module : t('Missing'); |
|
135 | - return "<span class='admin-missing'>{$text}</span>"; |
|
127 | + case FEATURES_MODULE_ENABLED: |
|
128 | + $text = !empty($module) ? $module : t('Enabled'); |
|
129 | + return "<span class='admin-enabled'>{$text}</span>"; |
|
130 | + case FEATURES_MODULE_DISABLED: |
|
131 | + $text = !empty($module) ? $module : t('Disabled'); |
|
132 | + return "<span class='admin-disabled'>{$text}</span>"; |
|
133 | + case FEATURES_MODULE_MISSING: |
|
134 | + $text = !empty($module) ? $module : t('Missing'); |
|
135 | + return "<span class='admin-missing'>{$text}</span>"; |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 |
@@ -248,11 +248,11 @@ discard block |
||
248 | 248 | */ |
249 | 249 | function features_help($path, $arg) { |
250 | 250 | switch ($path) { |
251 | - case 'admin/help#features': |
|
252 | - $output = file_get_contents(drupal_get_path('module', 'features') .'/README.txt'); |
|
253 | - return module_exists('markdown') ? filter_xss_admin(module_invoke('markdown', 'filter', 'process', 0, -1, $output)) : '<pre>'. check_plain($output) .'</pre>'; |
|
254 | - case 'admin/build/features': |
|
255 | - return '<p>'. t('A "Feature" is a certain type of Drupal module with contains a package of configuration that, when enabled, provides a new set of functionality for your Drupal site. Enable features by selecting the checkboxes below and clicking the Save configuration button. If the configuration of the feature has been changed its "State" will be either "overridden" or "needs review", otherwise it will be "default", indicating that the configuration has not been changed. Click on the state to see more details about the feature and its components.') .'</p>'; |
|
251 | + case 'admin/help#features': |
|
252 | + $output = file_get_contents(drupal_get_path('module', 'features') .'/README.txt'); |
|
253 | + return module_exists('markdown') ? filter_xss_admin(module_invoke('markdown', 'filter', 'process', 0, -1, $output)) : '<pre>'. check_plain($output) .'</pre>'; |
|
254 | + case 'admin/build/features': |
|
255 | + return '<p>'. t('A "Feature" is a certain type of Drupal module with contains a package of configuration that, when enabled, provides a new set of functionality for your Drupal site. Enable features by selecting the checkboxes below and clicking the Save configuration button. If the configuration of the feature has been changed its "State" will be either "overridden" or "needs review", otherwise it will be "default", indicating that the configuration has not been changed. Click on the state to see more details about the feature and its components.') .'</p>'; |
|
256 | 256 | } |
257 | 257 | } |
258 | 258 | |
@@ -679,16 +679,16 @@ discard block |
||
679 | 679 | features_include(); |
680 | 680 | |
681 | 681 | switch ($op) { |
682 | - case 'revert': |
|
683 | - $restore_states = array(FEATURES_OVERRIDDEN, FEATURES_REBUILDABLE, FEATURES_NEEDS_REVIEW); |
|
684 | - $restore_hook = 'features_revert'; |
|
685 | - $log_action = 'Revert'; |
|
686 | - break; |
|
687 | - case 'rebuild': |
|
688 | - $restore_states = array(FEATURES_REBUILDABLE); |
|
689 | - $restore_hook = 'features_rebuild'; |
|
690 | - $log_action = 'Rebuild'; |
|
691 | - break; |
|
682 | + case 'revert': |
|
683 | + $restore_states = array(FEATURES_OVERRIDDEN, FEATURES_REBUILDABLE, FEATURES_NEEDS_REVIEW); |
|
684 | + $restore_hook = 'features_revert'; |
|
685 | + $log_action = 'Revert'; |
|
686 | + break; |
|
687 | + case 'rebuild': |
|
688 | + $restore_states = array(FEATURES_REBUILDABLE); |
|
689 | + $restore_hook = 'features_rebuild'; |
|
690 | + $log_action = 'Rebuild'; |
|
691 | + break; |
|
692 | 692 | } |
693 | 693 | |
694 | 694 | if (empty($items)) { |
@@ -84,22 +84,22 @@ discard block |
||
84 | 84 | */ |
85 | 85 | function features_drush_help($section) { |
86 | 86 | switch ($section) { |
87 | - case 'drush:features': |
|
88 | - return dt("List all the available features for your site."); |
|
89 | - case 'drush:features-export': |
|
90 | - return dt("Export a feature from your site into a module."); |
|
91 | - case 'drush:features-update': |
|
92 | - return dt("Update a feature module on your site."); |
|
93 | - case 'drush:features-update-all': |
|
94 | - return dt("Update all feature modules on your site."); |
|
95 | - case 'drush:features-revert': |
|
96 | - return dt("Revert a feature module on your site."); |
|
97 | - case 'drush:features-revert-all': |
|
98 | - return dt("Revert all enabled feature module on your site."); |
|
99 | - case 'drush:features-revert': |
|
100 | - return dt("Revert a feature module on your site."); |
|
101 | - case 'drush:features-diff': |
|
102 | - return dt("Show a diff of a feature module."); |
|
87 | + case 'drush:features': |
|
88 | + return dt("List all the available features for your site."); |
|
89 | + case 'drush:features-export': |
|
90 | + return dt("Export a feature from your site into a module."); |
|
91 | + case 'drush:features-update': |
|
92 | + return dt("Update a feature module on your site."); |
|
93 | + case 'drush:features-update-all': |
|
94 | + return dt("Update all feature modules on your site."); |
|
95 | + case 'drush:features-revert': |
|
96 | + return dt("Revert a feature module on your site."); |
|
97 | + case 'drush:features-revert-all': |
|
98 | + return dt("Revert all enabled feature module on your site."); |
|
99 | + case 'drush:features-revert': |
|
100 | + return dt("Revert a feature module on your site."); |
|
101 | + case 'drush:features-diff': |
|
102 | + return dt("Show a diff of a feature module."); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
@@ -111,16 +111,16 @@ discard block |
||
111 | 111 | $rows = array(array(dt('Name'), dt('Feature'), dt('Status'), dt('State'))); |
112 | 112 | foreach (features_get_features(NULL, TRUE) as $k => $m) { |
113 | 113 | switch (features_get_storage($m->name)) { |
114 | - case FEATURES_DEFAULT: |
|
115 | - case FEATURES_REBUILDABLE: |
|
116 | - $storage = ''; |
|
117 | - break; |
|
118 | - case FEATURES_OVERRIDDEN: |
|
119 | - $storage = dt('Overridden'); |
|
120 | - break; |
|
121 | - case FEATURES_NEEDS_REVIEW: |
|
122 | - $storage = dt('Needs review'); |
|
123 | - break; |
|
114 | + case FEATURES_DEFAULT: |
|
115 | + case FEATURES_REBUILDABLE: |
|
116 | + $storage = ''; |
|
117 | + break; |
|
118 | + case FEATURES_OVERRIDDEN: |
|
119 | + $storage = dt('Overridden'); |
|
120 | + break; |
|
121 | + case FEATURES_NEEDS_REVIEW: |
|
122 | + $storage = dt('Needs review'); |
|
123 | + break; |
|
124 | 124 | } |
125 | 125 | $rows[] = array( |
126 | 126 | $m->info['name'], |
@@ -436,12 +436,12 @@ discard block |
||
436 | 436 | $args = array('!feature' => $feature); |
437 | 437 | |
438 | 438 | switch ($error) { |
439 | - case 'FEATURES_FEATURE_NOT_ENABLED': |
|
440 | - $message = 'The feature !feature is not enabled.'; |
|
441 | - break; |
|
442 | - default: |
|
443 | - $error = 'FEATURES_FEATURE_NOT_FOUND'; |
|
444 | - $message = 'The feature !feature could not be found.'; |
|
439 | + case 'FEATURES_FEATURE_NOT_ENABLED': |
|
440 | + $message = 'The feature !feature is not enabled.'; |
|
441 | + break; |
|
442 | + default: |
|
443 | + $error = 'FEATURES_FEATURE_NOT_FOUND'; |
|
444 | + $message = 'The feature !feature could not be found.'; |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | return drush_set_error($error, dt($message, $args)); |
@@ -217,12 +217,12 @@ discard block |
||
217 | 217 | $file = array('name' => 'features'); |
218 | 218 | if (isset($components[$component]['default_file'])) { |
219 | 219 | switch ($components[$component]['default_file']) { |
220 | - case FEATURES_DEFAULTS_INCLUDED: |
|
221 | - $file['name'] = "features.$component"; |
|
222 | - break; |
|
223 | - case FEATURES_DEFAULTS_CUSTOM: |
|
224 | - $file['name'] = $components[$component]['default_filename']; |
|
225 | - break; |
|
220 | + case FEATURES_DEFAULTS_INCLUDED: |
|
221 | + $file['name'] = "features.$component"; |
|
222 | + break; |
|
223 | + case FEATURES_DEFAULTS_CUSTOM: |
|
224 | + $file['name'] = $components[$component]['default_filename']; |
|
225 | + break; |
|
226 | 226 | } |
227 | 227 | } |
228 | 228 | |
@@ -521,15 +521,15 @@ discard block |
||
521 | 521 | */ |
522 | 522 | function features_get_signature($state = 'default', $module_name, $component, $reset = FALSE) { |
523 | 523 | switch ($state) { |
524 | - case 'cache': |
|
525 | - $codecache = variable_get('features_codecache', array()); |
|
526 | - return isset($codecache[$module_name][$component]) ? $codecache[$module_name][$component] : FALSE; |
|
527 | - case 'default': |
|
528 | - $objects = features_get_default($component, $module_name, TRUE, $reset); |
|
529 | - break; |
|
530 | - case 'normal': |
|
531 | - $objects = features_get_normal($component, $module_name, $reset); |
|
532 | - break; |
|
524 | + case 'cache': |
|
525 | + $codecache = variable_get('features_codecache', array()); |
|
526 | + return isset($codecache[$module_name][$component]) ? $codecache[$module_name][$component] : FALSE; |
|
527 | + case 'default': |
|
528 | + $objects = features_get_default($component, $module_name, TRUE, $reset); |
|
529 | + break; |
|
530 | + case 'normal': |
|
531 | + $objects = features_get_normal($component, $module_name, $reset); |
|
532 | + break; |
|
533 | 533 | } |
534 | 534 | if (!empty($objects)) { |
535 | 535 | $objects = (array) $objects; |
@@ -560,18 +560,18 @@ discard block |
||
560 | 560 | $semaphore = !empty($semaphore) ? unserialize($semaphore) : array(); |
561 | 561 | |
562 | 562 | switch ($op) { |
563 | - case 'get': |
|
564 | - return isset($semaphore[$component]) ? $semaphore[$component] : FALSE; |
|
565 | - case 'set': |
|
566 | - $semaphore[$component] = time(); |
|
563 | + case 'get': |
|
564 | + return isset($semaphore[$component]) ? $semaphore[$component] : FALSE; |
|
565 | + case 'set': |
|
566 | + $semaphore[$component] = time(); |
|
567 | + variable_set('features_semaphore', $semaphore); |
|
568 | + break; |
|
569 | + case 'del': |
|
570 | + if (isset($semaphore[$component])) { |
|
571 | + unset($semaphore[$component]); |
|
567 | 572 | variable_set('features_semaphore', $semaphore); |
568 | - break; |
|
569 | - case 'del': |
|
570 | - if (isset($semaphore[$component])) { |
|
571 | - unset($semaphore[$component]); |
|
572 | - variable_set('features_semaphore', $semaphore); |
|
573 | - } |
|
574 | - break; |
|
573 | + } |
|
574 | + break; |
|
575 | 575 | } |
576 | 576 | } |
577 | 577 |
@@ -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 |