本文整理汇总了PHP中AdminPage::checkperm方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminPage::checkperm方法的具体用法?PHP AdminPage::checkperm怎么用?PHP AdminPage::checkperm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminPage
的用法示例。
在下文中一共展示了AdminPage::checkperm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submenu
public static function submenu(Context $ctx, $query, array $pathinfo)
{
AdminPage::checkperm($ctx, $pathinfo);
$router = new Router();
$router->poll($ctx);
$menu = new AdminMenu($router->getStatic());
if (false === ($submenu = $menu->getSubMenu($ctx))) {
throw new PageNotFoundException();
}
if (false === ($content = $submenu->getXML($ctx, 'content', array('type' => 'submenu')))) {
throw new PageNotFoundException();
}
$page = new AdminPage($content);
return $page->getResponse($ctx);
}
示例2: settings
public static function settings(Context $ctx, $query, array $pathinfo)
{
// Проверяем права, если неверно указан обработчик.
if ('AdminPage::serve' != $pathinfo['call']) {
if (empty($pathinfo['perms'])) {
$pathinfo['perms'] = 'debug';
}
AdminPage::checkperm($ctx, $pathinfo);
}
$name = substr(strrchr($query, '/'), 1);
$schema = self::settings_get($ctx, $name);
$form = $schema->getForm();
$data = $ctx->config->get('modules/' . $name, array());
$title = $pathinfo['title'];
if (empty($form->title)) {
$form->title = $title;
}
$form->action = '?q=modman.rpc&action=configure&module=' . urlencode($name) . '&destination=admin/system/settings';
$form->addControl(new SubmitControl(array('text' => t('Сохранить'))));
$result = html::em('content', array('name' => 'form', 'title' => $name, 'mode' => 'config'), $form->getXML(Control::data($data)));
$page = new AdminPage($result);
return $page->getResponse($ctx);
}