当前位置: 首页>>代码示例>>PHP>>正文


PHP HandleDispatch函数代码示例

本文整理汇总了PHP中HandleDispatch函数的典型用法代码示例。如果您正苦于以下问题:PHP HandleDispatch函数的具体用法?PHP HandleDispatch怎么用?PHP HandleDispatch使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了HandleDispatch函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array_keys

$keys = array_keys($AuthCascade);
while ($keys) {
  $k = array_shift($keys); $t = $AuthCascade[$k];
  if (in_array($t, $keys)) 
    { unset($AuthCascade[$k]); $AuthCascade[$k] = $t; array_push($keys, $k); }
}

$LinkPattern = implode('|',array_keys($LinkFunctions));  # after InterMaps
SDV($LinkPageCreateSpaceFmt,$LinkPageCreateFmt);
$ActionTitle = FmtPageName(@$ActionTitleFmt[$action], $pagename);


if (!@$HandleActions[$action] || !function_exists($HandleActions[$action])) 
  $action='browse';
if (IsEnabled($EnableActions, 1)) HandleDispatch($pagename, $action);
Lock(0);
return;

##  HandleDispatch() is used to dispatch control to the appropriate
##  action handler with the appropriate permissions.
##  If a message is supplied, it is added to $MessagesFmt.
function HandleDispatch($pagename, $action, $msg=NULL) {
  global $MessagesFmt, $HandleActions, $HandleAuth;
  if ($msg) $MessagesFmt[] = "<div class='wikimessage'>$msg</div>";
  $fn = $HandleActions[$action];
  $auth = $HandleAuth[$action];
  if (!$auth) $auth = 'read';
  return $fn($pagename, $auth);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:29,代码来源:pmwiki.php

示例2: HandlePmForm

function HandlePmForm($pagename, $auth = 'read')
{
    global $PmFormPostPatterns, $PmFormTemplatesFmt, $MessagesFmt, $PmFormRedirectFunction;
    $post_opt = RequestArgs($_POST);
    $pat = array_keys($PmFormPostPatterns);
    $rep = array_values($PmFormPostPatterns);
    foreach ($post_opt as $k => $v) {
        $post_opt[$k] = preg_replace($pat, $rep, $v);
    }
    $target = @$post_opt['target'];
    $target_opt = PmFormConfig($pagename, $target);
    if (!$target_opt) {
        return HandleDispatch($pagename, 'browse', "\$[Unknown target] {$target}");
    }
    ##  Now, get the message template we will use
    $msgtmpl = RetrieveAuthSection($pagename, @$target_opt['fmt'], $PmFormTemplatesFmt);
    $opt = array_merge($post_opt, $target_opt);
    $template_opt = PmFormTemplateDefaults($pagename, $msgtmpl, $opt);
    $opt = array_merge($template_opt, $post_opt, $target_opt);
    $safe_opt = array_merge($template_opt, $target_opt);
    $errors = PmFormTemplateRequires($pagename, $msgtmpl, $opt);
    if (!$errors && @$safe_opt['saveto']) {
        $errors = PmFormSave($pagename, $msgtmpl, $opt, $safe_opt);
    }
    if (!$errors && @$safe_opt['mailto']) {
        $errors = PmFormMail($pagename, $msgtmpl, $opt, $safe_opt);
    }
    if ($errors) {
        foreach ((array) $errors as $errmsg) {
            $errmsg = htmlspecialchars($errmsg, ENT_NOQUOTES);
            $MessagesFmt[] = "<div class='wikimessage'>{$errmsg}</div>";
        }
        return HandleDispatch($pagename, 'browse');
    }
    # $GLOBALS['EnableRedirect'] = 0;
    if (@$opt['successpage']) {
        Redirect(MakePageName($pagename, $opt['successpage']));
    }
    #  Redirect($pagename, '{$PageUrl}?pmform=success');
    $PmFormRedirectFunction($pagename, '{$PageUrl}?pmform=success');
}
开发者ID:jefmud,项目名称:pmwiki-kit-bootstrap-compass,代码行数:41,代码来源:pmform.php

示例3: foreach

    foreach ($match as $m) {
        if (strpos($m[2], '$1') === false) {
            $m[2] .= '$1';
        }
        $LinkFunctions[$m[1]] = 'LinkIMap';
        $IMap[$m[1]] = FmtPageName($m[2], $pagename);
    }
}
$LinkPattern = implode('|', array_keys($LinkFunctions));
SDV($LinkPageCreateSpaceFmt, $LinkPageCreateFmt);
$ActionTitle = FmtPageName(@$ActionTitleFmt[$action], $pagename);
if (!@$HandleActions[$action] || !function_exists($HandleActions[$action])) {
    $action = 'browse';
}
if (IsEnabled($EnableActions, 1)) {
    HandleDispatch($pagename, $action);
}
Lock(0);
return;
##  HandleDispatch() is used to dispatch control to the appropriate
##  action handler with the appropriate permissions.
##  If a message is supplied, it is added to $MessagesFmt.
function HandleDispatch($pagename, $action, $msg = NULL)
{
    global $MessagesFmt, $HandleActions, $HandleAuth;
    if ($msg) {
        $MessagesFmt[] = "<div class='wikimessage'>{$msg}</div>";
    }
    $fn = $HandleActions[$action];
    $auth = $HandleAuth[$action];
    if (!$auth) {
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:31,代码来源:pmwiki.php

示例4: bi_HandleAdmin

function bi_HandleAdmin($src, $auth = 'blogit-admin')
{
    global $_GET, $GroupHeaderFmt;
    if (bi_Auth($auth)) {
        if (isset($_GET['s'])) {
            $args = bi_Implode($_GET, ' ', '=', array('n' => '', 'action' => '', 's' => ''));
            $GroupHeaderFmt .= '(:title $[' . $_GET['s'] . ']:)(:includesection "#' . $_GET['s'] . " {$args} \":)";
        }
    }
    HandleDispatch($src, 'browse');
}
开发者ID:jefmud,项目名称:pmwiki-kit-bootstrap-compass,代码行数:11,代码来源:blogit.php


注:本文中的HandleDispatch函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。