You are here

function homebox_pages in Homebox 6

Same name and namespace in other branches
  1. 6.3 homebox.module \homebox_pages()
  2. 6.2 homebox.module \homebox_pages()
  3. 7.3 homebox.module \homebox_pages()
  4. 7.2 homebox.module \homebox_pages()

Retrieve an array of pages matching specified conditions.

Parameters

$membersonly: Set this to TRUE to exclude the 'anonymous' role.

$permission: A string containing a permission. If set, only roles containing that permission are returned.

Return value

An associative array with the role id as the key and the role name as value.

6 calls to homebox_pages()
homebox_admin_page_submit in ./homebox.admin.inc
homebox_menu in ./homebox.module
Implementation of hook_menu().
homebox_perm in ./homebox.module
Implementation of hook_perm().
homebox_uninstall in ./homebox.install
Implementation of hook_uninstall().
homebox_update_6005 in ./homebox.install
Update the permissions table, to fix invalid permission names having non-English characters.

... See full list

File

./homebox.module, line 814
Home box main file, takes care of global functions settings constants, etc.

Code

function homebox_pages() {
  $result = db_query('SELECT * FROM {homebox_pages} ORDER BY name');
  while ($page = db_fetch_object($result)) {
    $filter = '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s';
    $page->safe_name = preg_replace($filter, '-', drupal_strtolower($page->name));
    $pages[] = $page;
  }
  return empty($pages) ? NULL : $pages;
}