本文整理汇总了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;
}