function mb_default_values in More Buttons 7
Provide the button and tab values.
Parameters
string $module: Optional the MB module. Possible values: mb, mb_content, mb_comment, mb_user
string $value: Optional the needed single value for an button or the tab. Possible values: cancel, sac, sacn, tabcn
Return value
array or string
- Associative array if the parameter $value not given: key => value cancel => Cancel sac => Save and continue sacn => Save and create new' tabcn => Create new
- String if the parameter $value given.
9 calls to mb_default_values()
- mb_admin in mb/
mb.admin.inc - Provides the MB button values settings form.
- mb_admin_submit in mb/
mb.admin.inc - Save settings from the admin form.
- mb_comment_form_alter in mb_comment/
mb_comment.module - Implements hook_form_alter().
- mb_content_createnew_title in mb_content/
mb_content.module - Title callback to provide the title for the create new tab.
- mb_content_form_alter in mb_content/
mb_content.module - Implements hook_form_alter().
File
- mb/
mb.module, line 198 - The More Buttons (MB) module allows to use additional buttons with Drupal.
Code
function mb_default_values($module = 'mb', $value = NULL) {
// Don't translate the value strings here.
switch ($module) {
case 'mb':
$values = array(
'cancel' => 'Cancel',
'sac' => 'Save and continue',
'sacn' => 'Save and create new',
'tabcn' => 'Create new',
);
break;
case 'mb_content':
$values = array(
'cancel' => 'Cancel',
'sac' => 'Save and continue',
'tabcn' => 'Create new',
);
break;
case 'mb_comment':
$values = array(
'cancel' => 'Cancel',
);
break;
case 'mb_user':
$values = array(
'cancel' => 'Cancel',
'sac' => 'Save and continue',
'sacn' => 'Save and create new',
);
break;
}
if (isset($value)) {
$val = isset($values[$value]) ? $values[$value] : t('n/a');
return $val;
}
return $values;
}