You are here

function library_clean_action_name in Library 7

Same name and namespace in other branches
  1. 5.2 library.module \library_clean_action_name()
  2. 6.2 library.module \library_clean_action_name()
  3. 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.

... See full list

File

./library.module, line 1064

Code

function library_clean_action_name($name) {
  $string = str_replace(" ", "_", strtolower($name));
  $pattern = '/[^\\w]/';
  return preg_replace($pattern, '', $string);
}