當前位置: 首頁>>代碼示例>>PHP>>正文


PHP block_manager::get_available_admin_blocks方法代碼示例

本文整理匯總了PHP中block_manager::get_available_admin_blocks方法的典型用法代碼示例。如果您正苦於以下問題:PHP block_manager::get_available_admin_blocks方法的具體用法?PHP block_manager::get_available_admin_blocks怎麽用?PHP block_manager::get_available_admin_blocks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在block_manager的用法示例。


在下文中一共展示了block_manager::get_available_admin_blocks方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_add_block_form

 static function get_add_block_form()
 {
     $form = new Forge("admin/dashboard/add_block", "", "post", array("id" => "g-add-dashboard-block-form"));
     $group = $form->group("add_block")->label(t("Add Block"));
     $group->dropdown("id")->label(t("Available Blocks"))->options(block_manager::get_available_admin_blocks());
     $group->submit("center")->value(t("Add to center"));
     $group->submit("sidebar")->value(t("Add to sidebar"));
     return $form;
 }
開發者ID:brocki,項目名稱:gallery3,代碼行數:9,代碼來源:gallery_block.php

示例2: remove_block

 public function remove_block($id)
 {
     access::verify_csrf();
     $blocks_center = block_manager::get_active("dashboard_center");
     $blocks_sidebar = block_manager::get_active("dashboard_sidebar");
     if (array_key_exists($id, $blocks_sidebar)) {
         $deleted = $blocks_sidebar[$id];
         block_manager::remove("dashboard_sidebar", $id);
     } else {
         if (array_key_exists($id, $blocks_center)) {
             $deleted = $blocks_center[$id];
             block_manager::remove("dashboard_center", $id);
         }
     }
     if (!empty($deleted)) {
         $available = block_manager::get_available_admin_blocks();
         $title = $available[join(":", $deleted)];
         message::success(t("Removed <b>%title</b> block", array("title" => $title)));
     }
     url::redirect("admin");
 }
開發者ID:viosca,項目名稱:gallery3,代碼行數:21,代碼來源:admin_dashboard.php

示例3: get_add_block_form

 static function get_add_block_form()
 {
     $available_blocks = block_manager::get_available_admin_blocks();
     $active = array();
     foreach (array_merge(block_manager::get_active("dashboard_sidebar"), block_manager::get_active("dashboard_center")) as $b) {
         unset($available_blocks[implode(":", $b)]);
     }
     if (!$available_blocks) {
         return;
     }
     $form = new Forge("admin/dashboard/add_block", "", "post", array("id" => "g-add-dashboard-block-form"));
     $group = $form->group("add_block")->label(t("Add Block"));
     $group->dropdown("id")->label(t("Available blocks"))->options($available_blocks);
     $group->submit("center")->value(t("Add to center"));
     $group->submit("sidebar")->value(t("Add to sidebar"));
     return $form;
 }
開發者ID:JasonWiki,項目名稱:docs,代碼行數:17,代碼來源:gallery_block.php


注:本文中的block_manager::get_available_admin_blocks方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。