本文整理汇总了PHP中Context::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::query方法的具体用法?PHP Context::query怎么用?PHP Context::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::query方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rpc_get_default
public static function rpc_get_default(Context $ctx)
{
if (null === ($fid = $ctx->get('fid'))) {
$fid = trim(strchr($ctx->query(), '/'), '/');
}
$node = Node::load($fid, $ctx->db);
$path = os::webpath($ctx->config->getDirName(), $ctx->config->files, $node->filepath);
return new Redirect($path, Redirect::PERMANENT);
}
示例2: isPageEnabled
/**
* Проверяет, разрешено ли использовать редактор на странице.
*/
private static function isPageEnabled(Context $ctx)
{
$pages = $ctx->config->getArray('modules/tinymce/routes', array('admin/edit/', 'admin/create/'));
if ($ctx->get('tinymcepicker')) {
$pages[] = 'admin/content/files';
}
$query = $ctx->query();
foreach ($pages as $prefix) {
if (0 === strpos($query, $prefix)) {
return true;
}
}
return false;
}
示例3: isLocked
private static function isLocked(Context $ctx, $enable_admin = true)
{
$conf = $ctx->config->get('modules/maintenance');
if (!empty($conf['state']) and 'closed' === $conf['state']) {
if (!$enable_admin) {
return true;
}
if (!$ctx->canDebug()) {
$query = $ctx->query();
if ('admin' != $query and 0 !== strpos($query, 'admin/')) {
return true;
}
}
}
return false;
}
示例4: on_get_head
/**
* Вывод инфорамации о подключаемых скриптах и стилях.
* @mcms_message ru.molinos.cms.page.head
*/
public static function on_get_head(Context $ctx, array $pathinfo = null)
{
$output = '';
if (self::isAdminPage($query = $ctx->query())) {
list($scripts, $styles) = self::getAdminFiles($ctx, !$ctx->get('nocompress'));
} elseif (null !== $pathinfo and !empty($pathinfo['theme'])) {
list($scripts, $styles) = self::getThemeFiles($ctx, $pathinfo['theme'], !$ctx->get('nocompress'));
} else {
$scripts = $styles = array();
}
foreach ($styles as $fileName) {
if (file_exists($fileName) and filesize($fileName)) {
$output .= html::em('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => os::webpath($fileName)));
}
}
foreach ($scripts as $fileName) {
if (file_exists($fileName) and filesize($fileName)) {
$output .= html::em('script', array('src' => os::webpath($fileName), 'type' => 'text/javascript'));
}
}
return html::wrap('head', html::cdata($output), array('module' => 'compressor', 'weight' => 100));
}
示例5: getCGroup
private static function getCGroup(Context $ctx)
{
if (null === ($cgroup = $ctx->get('cgroup'))) {
$parts = explode('/', $ctx->query());
$cgroup = $parts[1];
}
return $cgroup;
}
示例6: getPath
/**
* Возвращает путь к указанной странице.
*/
public function getPath(Context $ctx)
{
$path = array();
$query = $ctx->query();
$tabs = explode('/', $query);
$tab = empty($tabs[1]) ? null : 'admin/' . $tabs[1];
while ($query) {
if (!empty($this->static[$query])) {
$em = $this->static[$query];
$em['name'] = $query;
array_unshift($path, $em);
}
$query = substr($query, 0, strrpos($query, '/'));
}
$output = '';
foreach ($path as $em) {
$output .= self::path($em);
}
return html::em('location', array('tab' => $tab), $output);
}