Révision 950416da
Ajouté par Assos Assos il y a plus de 5 ans
drupal7/sites/all/modules/rules/ui/ui.controller.inc | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 | 3 |
/** |
4 |
* @file Contains the UI controller for Rules. |
|
4 |
* @file |
|
5 |
* Contains the UI controller for Rules. |
|
5 | 6 |
*/ |
6 | 7 |
|
7 | 8 |
/** |
... | ... | |
35 | 36 |
); |
36 | 37 |
$items[$base_path . '/manage/%rules_config/add/%rules_element'] = array( |
37 | 38 |
// Adding another part to the path would hit the menu path-part-limit |
38 |
// for base paths like admin/config/workflow/rules. Therefor we have to |
|
39 |
// use this fugly way for setting the title.
|
|
39 |
// for base paths like admin/config/workflow/rules. Therefore we have to
|
|
40 |
// use this ugly way for setting the title. |
|
40 | 41 |
'title callback' => 'rules_menu_add_element_title', |
41 | 42 |
// Wrap the integer in an array, so it is passed as is. |
42 | 43 |
'title arguments' => array(array($base_count + 4)), |
... | ... | |
60 | 61 |
'file path' => drupal_get_path('module', 'rules'), |
61 | 62 |
); |
62 | 63 |
$items[$base_path . '/manage/%rules_config/delete/event'] = array( |
63 |
//@todo: improve title.
|
|
64 |
// @todo Improve title.
|
|
64 | 65 |
'title' => 'Remove event', |
65 | 66 |
'page callback' => 'drupal_get_form', |
66 | 67 |
'page arguments' => array('rules_ui_remove_event', $base_count + 1, $base_count + 4, $base_path), |
... | ... | |
157 | 158 |
} |
158 | 159 |
|
159 | 160 |
/** |
160 |
* Generates the render array for a overview configuration table for arbitrary |
|
161 |
* rule configs that match the given conditions. |
|
161 |
* Generates the render array for an overview configuration table. |
|
162 |
* |
|
163 |
* Generates the render array for an overview configuration table for |
|
164 |
* arbitrary rule configs that match the given conditions. |
|
162 | 165 |
* |
163 | 166 |
* Note: The generated overview table contains multiple links for editing the |
164 | 167 |
* rule configurations. For the links to properly work use |
... | ... | |
182 | 185 |
* currently set RulesPluginUI::$basePath. If no base path has been set |
183 | 186 |
* yet, the current path is used by default. |
184 | 187 |
* |
185 |
* @return Array
|
|
188 |
* @return array
|
|
186 | 189 |
* A renderable array. |
187 | 190 |
*/ |
188 | 191 |
public function overviewTable($conditions = array(), $options = array()) { |
... | ... | |
199 | 202 |
if (!empty($options['base path'])) { |
200 | 203 |
RulesPluginUI::$basePath = $options['base path']; |
201 | 204 |
} |
202 |
else if (!isset(RulesPluginUI::$basePath)) {
|
|
205 |
elseif (!isset(RulesPluginUI::$basePath)) { |
|
203 | 206 |
// Default to the current path, only if no path has been set yet. |
204 | 207 |
RulesPluginUI::$basePath = current_path(); |
205 | 208 |
} |
... | ... | |
241 | 244 |
$table['#attributes']['class'][] = 'rules-overview-table'; |
242 | 245 |
$table['#attached']['css'][] = drupal_get_path('module', 'rules') . '/ui/rules.ui.css'; |
243 | 246 |
|
244 |
// TODO: hide configs where access() is FALSE.
|
|
247 |
// @todo Hide configs where access() is FALSE.
|
|
245 | 248 |
return $table; |
246 | 249 |
} |
247 | 250 |
|
... | ... | |
279 | 282 |
|
280 | 283 |
// Add operations depending on the options and the exportable status. |
281 | 284 |
if (!$config->hasStatus(ENTITY_FIXED)) { |
282 |
$row[] = l(t('edit'), RulesPluginUI::path($name), array('attributes' => array('class' => array('edit', 'action'))));
|
|
285 |
$row[] = l(t('edit'), RulesPluginUI::path($name), array('attributes' => array('class' => array('edit', 'action')))); |
|
283 | 286 |
if (module_exists('rules_i18n')) { |
284 |
$row[] = l(t('translate'), RulesPluginUI::path($name, 'translate'), array('attributes' => array('class' => array('translate', 'action'))));
|
|
287 |
$row[] = l(t('translate'), RulesPluginUI::path($name, 'translate'), array('attributes' => array('class' => array('translate', 'action')))); |
|
285 | 288 |
} |
286 | 289 |
} |
287 | 290 |
else { |
... | ... | |
321 | 324 |
$row[] = l(t('export'), RulesPluginUI::path($name, 'export'), array('attributes' => array('class' => array('export', 'action')))); |
322 | 325 |
return $row; |
323 | 326 |
} |
327 |
|
|
324 | 328 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules