You are here

function shortcut_set_load in Drupal 7

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.

14 calls to shortcut_set_load()
ShortcutLinksTestCase::testShortcutLinkAdd in modules/shortcut/shortcut.test
Tests that creating a shortcut works properly.
ShortcutLinksTestCase::testShortcutLinkChangePath in modules/shortcut/shortcut.test
Tests that changing the path of a shortcut link works.
ShortcutLinksTestCase::testShortcutLinkDelete in modules/shortcut/shortcut.test
Tests deleting a shortcut link.
ShortcutLinksTestCase::testShortcutLinkRename in modules/shortcut/shortcut.test
Tests that shortcut links can be renamed.
ShortcutSetsTestCase::testShortcutSetRename in modules/shortcut/shortcut.test
Tests renaming a shortcut set.

... See full list

File

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;
}