function homebox_pages in Homebox 7.3
Same name and namespace in other branches
- 6.3 homebox.module \homebox_pages()
- 6 homebox.module \homebox_pages()
- 6.2 homebox.module \homebox_pages()
- 7.2 homebox.module \homebox_pages()
Retrieve an array of all available pages either in the database or by hook_homebox()
Return value
An array of page objects
4 calls to homebox_pages()
- homebox_features_export_options in ./
homebox.features.inc - Implements hook_features_export_options().
- homebox_menu in ./
homebox.module - Implements hook_menu().
- homebox_user_settings_page in ./
homebox.admin.inc - Provide form for user profile settings
- theme_homebox_admin_new_page in ./
homebox.admin.inc - Theme the new-page form.
1 string reference to 'homebox_pages'
- homebox_save_page in ./
homebox.module - Helper function to save an existing page
File
- ./
homebox.module, line 1359 - Homebox main file, takes care of global functions settings constants, etc.
Code
function homebox_pages() {
$pages = array();
// Fetch all available pages from database
$result = db_query("SELECT * FROM {homebox_pages} ORDER BY name");
foreach ($result as $page) {
$page->settings = unserialize($page->settings);
$pages[] = $page;
}
// Fetch all available pages from API
$result = module_invoke_all('homebox');
foreach ($result as $name => $data) {
// Build page object
$page = new stdClass();
$page->name = $name;
$page->settings = $data;
// Check the data before using it
if ($page = homebox_check_page_object($page)) {
$pages[] = $page;
}
}
return empty($pages) ? NULL : $pages;
}