function shortcut_patterns_export_all_set in Patterns 7.2
Same name and namespace in other branches
- 7 patterns_components/components/shortcut.inc \shortcut_patterns_export_all_set()
Returns a set of PATTERNS_CREATE actions with the whole set of shortcuts currently stored in the system.
Parameters
string $args:
string $result:
Return value
array $actions
1 string reference to 'shortcut_patterns_export_all_set'
- shortcut_patterns in patterns_components/
components/ shortcut.inc - Implements hook_patterns().
File
- patterns_components/
components/ shortcut.inc, line 68 - Patterns component for shortcut.
Code
function shortcut_patterns_export_all_set($args = NULL, $result = NULL) {
//Loop through the elements in the set to prepare the actions
$sets = shortcut_sets();
$actions = array();
switch ($args['type']) {
case PATTERNS_CREATE:
foreach ($sets as $set_name) {
//Create action only require a name given to the new shortcut_set.
$action = array(
PATTERNS_CREATE => array(
'tag' => 'shortcut_set',
'shortcut_set_name' => $set_name->title,
),
);
array_push($actions, $action);
}
break;
case PATTERNS_MODIFY:
foreach ($sets as $set_name) {
//Modify shortcut_set need a newname which shold be assigned by someone(Administrator)
$action = array(
PATTERNS_MODIFY => array(
'tag' => 'shortcut_set',
'oldname' => $set_name->title,
),
'newname' => 'PleaseGiveNewName',
);
array_push($actions, $action);
}
break;
}
return $actions;
}