function mb_get_values in More Buttons 7
Get all button and tab values or an single value.
Module developer: You can use this function to get the values of the buttons or the tab.
Example to get the "Save and continue" button value:
$value = module_invoke('mb', 'get_values', 'mb', 'sac');
Use the t() function to display the value.
Parameters
string $module: The short cut name of the MB module. Optional if not used the parameter $value. Possible values: mb Note: The button and tab values, saved with the MB module administration, are use the parameter mb.
string $value: Optional an string to get an single button or tab value. Possible parameters:
- cancel
- sac
- sacn
- tabcn
Return value
array or string
- Associative array if the parameter $value not given: key => value cancel => The configured "Cancel" button value sac => The configured "Save and continue" button value sacn => The configured "Save and create new" button value tabcn => The configured "Create new" tab value
- String if the parameter $value given. The configured value.
6 calls to mb_get_values()
- mb_admin in mb/
mb.admin.inc - Provides the MB button values settings form.
- mb_comment_admin in mb_comment/
mb_comment.admin.inc - Provides the central MB Content settings form.
- mb_comment_form_alter in mb_comment/
mb_comment.module - Implements hook_form_alter().
- mb_content_form_alter in mb_content/
mb_content.module - Implements hook_form_alter().
- mb_user_admin in mb_user/
mb_user.admin.inc - Provides the MB User settings form.
File
- mb/
mb.module, line 163 - The More Buttons (MB) module allows to use additional buttons with Drupal.
Code
function mb_get_values($module = NULL, $value = NULL) {
if (!isset($module)) {
$module = 'mb';
}
$mb_values = variable_get($module . '_values', array());
if (!isset($value)) {
return $mb_values;
}
else {
$val = isset($mb_values[$value]) ? $mb_values[$value] : t('n/a');
return $val;
}
}