View source
<?php
function _og_menu_overview_page() {
global $user;
$sql = '';
if (!user_access('administer group menu')) {
$sql = db_query("\n SELECT distinct {og_uid}.nid, {og_menu_groups}.*, {menu_custom}.*\n FROM {og_uid} \n JOIN (\n {menu_custom},\n {og_menu_groups}\n ) \n ON (\n {menu_custom}.menu_name = {og_menu_groups}.mid \n AND \n {og_menu_groups}.gid = {og_uid}.nid\n )\n WHERE {og_uid}.uid = {$user->uid} \n ORDER BY {menu_custom}.title\n ;");
}
else {
$sql = db_query("\n SELECT distinct {og_uid}.nid, {og_menu_groups}.*, {menu_custom}.*\n FROM {og_uid} \n JOIN (\n {menu_custom},\n {og_menu_groups}\n ) \n ON (\n {menu_custom}.menu_name = {og_menu_groups}.mid \n AND \n {og_menu_groups}.gid = {og_uid}.nid\n )\n ORDER BY {menu_custom}.title;");
}
$message = '<p>Below is a list of group menus you have privileges to administer. If you don\'t see any menus please contact a site administrator.</p>';
$content = array();
while ($menu = db_fetch_array($sql)) {
$menu['href'] = 'admin/build/menu-customize/' . $menu['menu_name'];
$menu['localized_options'] = array();
$content[] = $menu;
}
if (count($content) > 0) {
$content = theme('admin_block_content', $content);
return $message . $content;
}
else {
return $message;
}
}