function shortcut_set_load

Loads the data for a shortcut set.

Parameters

$set_name: The name of the shortcut set to load.

Return value

object If the shortcut set exists, an object containing the following properties:

  • 'set_name': The internal name of the shortcut set.
  • 'title': The title of the shortcut set.
  • 'links': An array of links associated with this shortcut set.

If the shortcut set does not exist, the function returns FALSE.

15 calls to shortcut_set_load()
ShortcutLinksTest::testShortcutLinkAdd in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
Tests that creating a shortcut works properly.
ShortcutLinksTest::testShortcutLinkChangePath in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
Tests that changing the path of a shortcut link works.
ShortcutLinksTest::testShortcutLinkDelete in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
Tests deleting a shortcut link.
ShortcutLinksTest::testShortcutLinkRename in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
Tests that shortcut links can be renamed.
ShortcutSetsTest::testShortcutSetRename in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php
Tests renaming a shortcut set.

... See full list

File

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

Code

function shortcut_set_load($set_name) {
  $set = db_select('shortcut_set', 'ss')
    ->fields('ss')
    ->condition('set_name', $set_name)
    ->execute()
    ->fetchObject();
  if (!$set) {
    return FALSE;
  }
  $set->links = menu_load_links($set_name);
  return $set;
}