function library_clean_action_name in Library 7
Same name and namespace in other branches
- 5.2 library.module \library_clean_action_name()
- 6.2 library.module \library_clean_action_name()
- 6 library.module \library_clean_action_name()
Provides a machine name for library actions.
Parameters
string $name: User entered name.
Return value
mixed Clean string.
7 calls to library_clean_action_name()
- library_action_info in ./
library.actions.inc - Implements hook_action_info().
- library_admin_settings_overdue in ./
library.admin.inc - Menu callback: Edit Library Overdue Settings.
- library_admin_settings_overdue_validate in ./
library.admin.inc - Validates settings set in library administration.
- library_renew_action in ./
library.actions.inc - Implementation of a Drupal action.
- library_transaction_form_submit in ./
library.pages.inc - Handles transaction form submissions.
File
- ./
library.module, line 1064
Code
function library_clean_action_name($name) {
$string = str_replace(" ", "_", strtolower($name));
$pattern = '/[^\\w]/';
return preg_replace($pattern, '', $string);
}