You are here

function rate_machine_name_exists in Rate 7

Check if a machine readable name is already in use.

Parameters

string $machine_name Machine readable name:

Return value

bool

1 string reference to 'rate_machine_name_exists'
rate_widget_form in ./rate.admin.inc
Form for adding and editing widgets.

File

./rate.module, line 1435
Rate module

Code

function rate_machine_name_exists($machine_name) {
  $widgets = variable_get(RATE_VAR_WIDGETS, array());
  $active = array();
  foreach ($widgets as $widget_id => $widget) {
    if ($widget->name == $machine_name) {
      return TRUE;
    }
  }
  return FALSE;
}