function shortcut_set_get_unique_name
shortcut_set_get_unique_name()
Returns a unique, machine-readable shortcut set name.
File
- modules/shortcut/shortcut.module, line 545
- Allows users to manage customizable lists of shortcut links.
Code
function shortcut_set_get_unique_name() { // Shortcut sets are numbered sequentially, so we keep trying until we find // one that is available. For better performance, we start with a number // equal to one more than the current number of shortcut sets, so that if // no shortcut sets have been deleted from the database, this will // automatically give us the correct one. $number = db_query("SELECT COUNT(*) FROM {shortcut_set}")->fetchField() + 1; do { $name = shortcut_set_name($number); $number++; } while ($shortcut_set = shortcut_set_load($name)); return $name; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!shortcut!shortcut.module/function/shortcut_set_get_unique_name/7.x