本文整理汇总了PHP中Menu::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::factory方法的具体用法?PHP Menu::factory怎么用?PHP Menu::factory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::factory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: movie_menu
static function movie_menu($menu, $theme)
{
// Display embedlinks toolbar icon, if the corresponding setting is enabled.
if (module::get_var("embedlinks", "ToolbarLinks") == true) {
$menu->append(Menu::factory("link")->id("embedlinks")->label(t("Link to this page"))->url(url::site("embedlinks/showlinks/" . $theme->item()->id))->css_class("g-dialog-link")->css_id("g-embedlinks-link"));
}
}
示例2: album_menu
static function album_menu($menu, $theme)
{
if (access::can("view_full", $theme->item)) {
$downloadLink = url::site("downloadalbum/zip/{$theme->item->id}");
$menu->append(Menu::factory("link")->id("downloadalbum")->label(t("Download Album"))->url($downloadLink)->css_id("g-download-album-link"));
}
}
示例3: context_menu
static function context_menu($menu, $theme, $item)
{
$link = ORM::factory("bitly_link")->where("item_id", "=", $item->id)->find();
if (!$link->loaded() && $theme->item->owner->id == identity::active_user()->id) {
$menu->get("options_menu")->append(Menu::factory("link")->id("bitly")->label(t("Shorten link with bit.ly"))->url(url::site("bitly/shorten/{$item->id}?csrf={$theme->csrf}"))->css_class("g-bitly-shorten ui-icon-link"));
}
}
示例4: photo_menu
static function photo_menu($menu, $theme)
{
if (module::get_var("ecard", "location") == "top") {
$item = $theme->item();
$menu->append(Menu::factory("link")->id("ecard")->label(t("Send as eCard"))->url(url::site("ecard/form_send/{$item->id}"))->css_class("g-dialog-link ui-icon-ecard")->css_id("g-send-ecard"));
}
}
示例5: admin
static function admin($menu, $theme)
{
$menu->get("settings_menu")->append(Menu::factory("link")->id("akismet")->label(t("Akismet"))->url(url::site("admin/akismet")));
if (module::get_var("akismet", "api_key")) {
$menu->get("statistics_menu")->append(Menu::factory("link")->id("akismet")->label(t("Akismet"))->url(url::site("admin/akismet/stats")));
}
}
示例6: site_menu
static function site_menu($menu, $theme)
{
$item = $theme->item();
if ($item && access::can("edit", $item) && $item->is_album()) {
$menu->get("options_menu")->append(Menu::factory("link")->id("organize")->label(t("Organize Album"))->css_id("gOrganizeLink")->url(url::site("organize/index/{$item->id}")));
}
}
示例7: tag_menu
/**
* This adds the buttons for the case of a tag. If you want to disable
* either the A4 or LTR part, do so here *and* above for albums.
*/
static function tag_menu($menu, $theme)
{
$proofsheetA4Link = url::site("proofsheet/makepdf/a4/tag/{$theme->tag()->id}");
$menu->append(Menu::factory("link")->id("proofsheetA4")->label(t("A4 Proof Sheet"))->url($proofsheetA4Link)->css_id("g-proofsheet-a4-link"));
$proofsheetLTRLink = url::site("proofsheet/makepdf/ltr/tag/{$theme->tag()->id}");
$menu->append(Menu::factory("link")->id("proofsheetLTR")->label(t("LTR Proof Sheet"))->url($proofsheetLTRLink)->css_id("g-proofsheet-ltr-link"));
}
示例8: tag_menu
static function tag_menu($menu, $theme)
{
if ($theme->children_count > 0) {
$downloadLink = url::site("downloadalbum/zip/tag/{$theme->tag()->id}");
$menu->append(Menu::factory("link")->id("downloadalbum")->label(t("Download Album"))->url($downloadLink)->css_id("g-download-album-link"));
}
}
示例9: find_menu_item_test
public function find_menu_item_test()
{
$menu = new Menu(true);
$menu->append(Menu::factory("link")->id("element_1"))->append(Menu::factory("dialog")->id("element_2"))->append(Menu::factory("submenu")->id("element_3")->append(Menu::factory("link")->id("element_3_1")));
$this->assert_equal("element_2", $menu->get("element_2")->id);
$this->assert_equal("element_3_1", $menu->get("element_3")->get("element_3_1")->id);
}
示例10: site_menu
static function site_menu($menu, $theme)
{
$item = $theme->item();
if ($item && $item->is_album() && access::can("edit", $item)) {
$menu->get("options_menu")->append(Menu::factory("link")->id("captionator")->label(t("Caption album"))->css_id("g-menu-captionator-link")->url(url::site("captionator/dialog/{$item->id}")));
}
}
示例11: 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;
}
示例12: user_menu
static function user_menu($menu, $theme)
{
$user = identity::active_user();
if ($user->guest) {
$menu->append(Menu::factory("dialog")->id("user_menu_register")->css_id("g-register-menu")->url(url::site("register"))->label(t("Register")));
}
}
示例13: site_menu
static function site_menu($menu, $theme)
{
$item = $theme->item();
if ($can_add = $item && access::can("add", $item)) {
$menu->get("add_menu")->append(Menu::factory("dialog")->id("embed_add")->label(t("Embed Video"))->url(url::site("form/add/embedded_videos/{$item->id}")));
}
}
示例14: site_menu
static function site_menu($menu, $theme)
{
if (identity::active_user()->guest && module::get_var("registration", "policy") != "admin_only") {
$menu->append(Menu::factory("dialog")->id("register_users")->label(t("Register"))->url(url::site("register")));
}
return $menu;
}
示例15: context_menu
static function context_menu($menu, $theme, $item)
{
// Add a "Buy Prints" option to the photo's thumbnail menu.
if ($item->type == "photo") {
$menu->get("options_menu")->append(Menu::factory("link")->id("fotomotorw")->label(t("Buy Prints"))->url("javascript:showFotomotoDialog(100, '" . url::abs_site("fotomotorw/resize/" . md5($item->created) . "/{$item->id}") . "');")->css_class("g-print-fotomotorw-link ui-icon-print"));
}
}