function shortcut_set_title_exists

Check to see if a shortcut set with the given title already exists.

Parameters

$title: Human-readable name of the shortcut set to check.

Return value

TRUE if a shortcut set with that title exists; FALSE otherwise.

2 calls to shortcut_set_title_exists()
ShortcutFormController::validate in drupal/core/modules/shortcut/lib/Drupal/shortcut/ShortcutFormController.php
Overrides \Drupal\Core\Entity\EntityFormController::validate().
shortcut_set_switch_validate in drupal/core/modules/shortcut/shortcut.admin.inc
Validation handler for shortcut_set_switch().

File

drupal/core/modules/shortcut/shortcut.module, line 422
Allows users to manage customizable lists of shortcut links.

Code

function shortcut_set_title_exists($title) {
  $sets = entity_load_multiple('shortcut');
  foreach ($sets as $id => $set) {
    if ($set->label == $title) {
      return TRUE;
    }
  }
  return FALSE;
}