You are here

function purge_item_name_exists in Purge 7.2

Helper function to check if a name exists in the current configuration.

2 string references to 'purge_item_name_exists'
OLDpurge_item_form in includes/purge_ui.inc
Menu callback for purge item settins. @TODO REMOVE THIS. Die old functional code, die!.
PurgePurgerBundleUI::get_form_edit_basic in includes/purge_ui.class.inc
Generate the basic information form.

File

includes/purge_ui.inc, line 877
Provides administrative interface for the Purge module.

Code

function purge_item_name_exists($item_name) {
  $error = 0;

  // Get a basic bundle.
  $bundle = new PurgeBundleAPI();
  foreach ($bundle->type as $type_name => $type) {
    if ($type_name == $item_name) {
      $error = 1;
    }
    foreach ($bundle->{$type_name} as $name => $item) {
      if ($item_name == $name) {
        $error = 1;
      }
    }
  }
  return $error;
}