本文整理匯總了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;
}
示例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");
}
示例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;
}