本文整理匯總了PHP中gallery::admin_menu方法的典型用法代碼示例。如果您正苦於以下問題:PHP gallery::admin_menu方法的具體用法?PHP gallery::admin_menu怎麽用?PHP gallery::admin_menu使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gallery
的用法示例。
在下文中一共展示了gallery::admin_menu方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: admin_menu
public function admin_menu() {
$menu = Menu::factory("root");
gallery::admin_menu($menu, $this);
module::event("admin_menu", $menu, $this);
$menu->compact();
return $menu;
}
示例2: site_menu
static function site_menu($menu, $theme)
{
if ($theme->page_type != "login") {
$menu->append(Menu::factory("link")->id("home")->label(t("Home"))->url(url::site("albums/1")));
$item = $theme->item();
$can_edit = $item && access::can("edit", $item);
$can_add = $item && access::can("add", $item);
if ($can_add) {
$menu->append($add_menu = Menu::factory("submenu")->id("add_menu")->label(t("Add")));
$add_menu->append(Menu::factory("dialog")->id("add_photos_item")->label(t("Add photos"))->url(url::site("simple_uploader/app/{$item->id}")));
if ($item->is_album()) {
$add_menu->append(Menu::factory("dialog")->id("add_album_item")->label(t("Add an album"))->url(url::site("form/add/albums/{$item->id}?type=album")));
}
}
$menu->append($options_menu = Menu::factory("submenu")->id("options_menu")->label(t("Photo options")));
if ($item && ($can_edit || $can_add)) {
if ($can_edit) {
$options_menu->append(Menu::factory("dialog")->id("edit_item")->label($item->is_album() ? t("Edit album") : t("Edit photo"))->url(url::site("form/edit/{$item->type}s/{$item->id}")));
}
if ($item->is_album()) {
$options_menu->label(t("Album options"));
if ($can_edit) {
$options_menu->append(Menu::factory("dialog")->id("edit_permissions")->label(t("Edit permissions"))->url(url::site("permissions/browse/{$item->id}")));
}
}
}
if (user::active()->admin) {
$menu->append($admin_menu = Menu::factory("submenu")->id("admin_menu")->label(t("Admin")));
gallery::admin_menu($admin_menu, $theme);
module::event("admin_menu", $admin_menu, $theme);
}
module::event("site_menu", $menu, $theme);
}
}