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


PHP RetrieveAuthSection函数代码示例

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


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

示例1: ReadTrail

function ReadTrail($pagename, $trailname) {
  global $RASPageName, $SuffixPattern, $GroupPattern, $WikiWordPattern,
    $LinkWikiWords;
  if (preg_match('/^\\[\\[(.+?)(->|\\|)(.+?)\\]\\]$/', $trailname, $m)) 
    $trailname = ($m[2] == '|') ? $m[1] : $m[3];
  $trailtext = RetrieveAuthSection($pagename, $trailname);
  $trailname = $RASPageName;
  $t = array();
  $n = 0;
  foreach(explode("\n", htmlspecialchars(@$trailtext, ENT_NOQUOTES)) 
          as $x) {
    $x = preg_replace("/\\[\\[([^\\]]*)->([^\\]]*)\\]\\]/",'[[$2|$1]]',$x);
    if (!preg_match("/^([#*:]+) \\s* 
          (\\[\\[([^:#!|][^|:]*?)(\\|.*?)?\\]\\]($SuffixPattern)
          | (($GroupPattern([\\/.]))?$WikiWordPattern)) (.*)/x",$x,$match))
       continue;
    if (@$match[6]) {
       if (!$LinkWikiWords) continue;
       $tgt = MakePageName($trailname, $match[6]);
    } else $tgt = MakePageName($trailname,
                               preg_replace('/[#?].+/', '', $match[3]));
    $t[$n]['depth'] = $depth = strlen($match[1]);
    $t[$n]['pagename'] = $tgt;
    $t[$n]['markup'] = $match[2];
    $t[$n]['detail'] = $match[9];
    for($i=$depth;$i<10;$i++) $d[$i]=$n;
    if ($depth>1) $t[$n]['parent']=@$d[$depth-1];
    $n++;
  }
  return $t;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:31,代码来源:trails.php

示例2: ReadTrail

function ReadTrail($pagename, $trailname)
{
    global $RASPageName, $SuffixPattern, $GroupPattern, $WikiWordPattern, $LinkWikiWords;
    if (preg_match('/^\\[\\[(.+?)(-&gt;|\\|)(.+?)\\]\\]$/', $trailname, $m)) {
        $trailname = $m[2] == '|' ? $m[1] : $m[3];
    }
    $trailtext = RetrieveAuthSection($pagename, $trailname);
    $trailname = $RASPageName;
    $trailtext = Qualify($trailname, $trailtext);
    $t = array();
    $n = 0;
    foreach (explode("\n", PHSC(@$trailtext, ENT_NOQUOTES)) as $x) {
        $x = preg_replace("/\\[\\[([^\\]]*)-&gt;([^\\]]*)\\]\\]/", '[[$2|$1]]', $x);
        if (!preg_match("/^([#*:]+) \\s* \n          (\\[\\[([^:#!|][^|:]*?)(?:\".*?\")?(\\|.*?)?\\]\\]({$SuffixPattern})\n          | (({$GroupPattern}([\\/.]))?{$WikiWordPattern})) (.*)/x", $x, $match)) {
            continue;
        }
        if (@$match[6]) {
            if (!$LinkWikiWords) {
                continue;
            }
            $tgt = MakePageName($trailname, $match[6]);
        } else {
            $tgt = MakePageName($trailname, $match[3]);
        }
        $t[$n]['depth'] = $depth = strlen($match[1]);
        $t[$n]['pagename'] = $tgt;
        $t[$n]['markup'] = $match[2];
        $t[$n]['detail'] = $match[9];
        for ($i = $depth; $i < 10; $i++) {
            $d[$i] = $n;
        }
        if ($depth > 1) {
            $t[$n]['parent'] = @$d[$depth - 1];
        }
        $n++;
    }
    return $t;
}
开发者ID:LOZORD,项目名称:UPL-Website-Revamp,代码行数:38,代码来源:trails.php

示例3: FPLTemplateLoad

function FPLTemplateLoad($pagename, $matches, $opt, &$tparts){
  global $Cursor, $FPLTemplatePageFmt, $RASPageName, $PageListArgPattern;
  SDV($FPLTemplatePageFmt, array('{$FullName}',
    '{$SiteGroup}.LocalTemplates', '{$SiteGroup}.PageListTemplates'));

  $template = @$opt['template'];
  if (!$template) $template = @$opt['fmt'];
  $ttext = RetrieveAuthSection($pagename, $template, $FPLTemplatePageFmt);
  $ttext = PVSE(Qualify($RASPageName, $ttext));

  ##  save any escapes
  $ttext = MarkupEscape($ttext);
  ##  remove any anchor markups to avoid duplications
  $ttext = preg_replace('/\\[\\[#[A-Za-z][-.:\\w]*\\]\\]/', '', $ttext);

  ##  extract portions of template
  $tparts = preg_split('/\\(:(template)\\s+([-!]?)\\s*(\\w+)\\s*(.*?):\\)/i',
    $ttext, -1, PREG_SPLIT_DELIM_CAPTURE);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:19,代码来源:pagelist.php

示例4: FPLTemplate

function FPLTemplate($pagename, &$matches, $opt)
{
    global $Cursor, $FPLTemplatePageFmt, $RASPageName, $PageListArgPattern;
    SDV($FPLTemplatePageFmt, array('{$FullName}', '{$SiteGroup}.LocalTemplates', '{$SiteGroup}.PageListTemplates'));
    StopWatch("FPLTemplate begin");
    $template = @$opt['template'];
    if (!$template) {
        $template = @$opt['fmt'];
    }
    $ttext = RetrieveAuthSection($pagename, $template, $FPLTemplatePageFmt);
    $ttext = PVSE(Qualify($RASPageName, $ttext));
    ##  save any escapes
    $ttext = MarkupEscape($ttext);
    ##  remove any anchor markups to avoid duplications
    $ttext = preg_replace('/\\[\\[#[A-Za-z][-.:\\w]*\\]\\]/', '', $ttext);
    ##  extract portions of template
    $tparts = preg_split('/\\(:(template)\\s+(\\w+)\\s*(.*?):\\)/i', $ttext, -1, PREG_SPLIT_DELIM_CAPTURE);
    ##  handle (:template defaults:)
    $i = 0;
    while ($i < count($tparts)) {
        if ($tparts[$i] != 'template') {
            $i++;
            continue;
        }
        if ($tparts[$i + 1] != 'defaults' && $tparts[$i + 1] != 'default') {
            $i += 4;
            continue;
        }
        $opt = array_merge(ParseArgs($tparts[$i + 2], $PageListArgPattern), $opt);
        array_splice($tparts, $i, 3);
    }
    SDVA($opt, array('class' => 'fpltemplate', 'wrap' => 'div'));
    ##  get the list of pages
    $matches = array_values(MakePageList($pagename, $opt, 0));
    ##  extract page subset according to 'count=' parameter
    if (@$opt['count']) {
        list($r0, $r1) = CalcRange($opt['count'], count($matches));
        if ($r1 < $r0) {
            $matches = array_reverse(array_slice($matches, $r1 - 1, $r0 - $r1 + 1));
        } else {
            $matches = array_slice($matches, $r0 - 1, $r1 - $r0 + 1);
        }
    }
    $savecursor = $Cursor;
    $pagecount = 0;
    $groupcount = 0;
    $grouppagecount = 0;
    $pseudovars = array('{$$PageCount}' => &$pagecount, '{$$GroupCount}' => &$groupcount, '{$$GroupPageCount}' => &$grouppagecount);
    foreach (preg_grep('/^[\\w$]/', array_keys($opt)) as $k) {
        if (!is_array($opt[$k])) {
            $pseudovars["{\$\${$k}}"] = htmlspecialchars($opt[$k], ENT_NOQUOTES);
        }
    }
    $vk = array_keys($pseudovars);
    $vv = array_values($pseudovars);
    $lgroup = '';
    $out = '';
    foreach ($matches as $i => $pn) {
        $group = PageVar($pn, '$Group');
        if ($group != $lgroup) {
            $groupcount++;
            $grouppagecount = 0;
            $lgroup = $group;
        }
        $grouppagecount++;
        $pagecount++;
        $t = 0;
        while ($t < count($tparts)) {
            if ($tparts[$t] != 'template') {
                $item = $tparts[$t];
                $t++;
            } else {
                list($when, $control, $item) = array_slice($tparts, $t + 1, 3);
                $t += 4;
                if (!$control) {
                    if ($when == 'first' && $i != 0) {
                        continue;
                    }
                    if ($when == 'last' && $i != count($matches) - 1) {
                        continue;
                    }
                } else {
                    if ($when == 'first' || !isset($last[$t])) {
                        $Cursor['<'] = $Cursor['&lt;'] = (string) @$matches[$i - 1];
                        $Cursor['='] = $pn;
                        $Cursor['>'] = $Cursor['&gt;'] = (string) @$matches[$i + 1];
                        $curr = str_replace($vk, $vv, $control);
                        $curr = preg_replace('/\\{(=|&[lg]t;)(\\$:?\\w+)\\}/e', "PageVar(\$pn, '\$2', '\$1')", $curr);
                        if ($when == 'first' && $i > 0 && $last[$t] == $curr) {
                            continue;
                        }
                        $last[$t] = $curr;
                    }
                    if ($when == 'last') {
                        $Cursor['<'] = $Cursor['&lt;'] = $pn;
                        $Cursor['='] = (string) @$matches[$i + 1];
                        $Cursor['>'] = $Cursor['&gt;'] = (string) @$matches[$i + 2];
                        $next = str_replace($vk, $vv, $control);
                        $next = preg_replace('/\\{(=|&[lg]t;)(\\$:?\\w+)\\}/e', "PageVar(\$pn, '\$2', '\$1')", $next);
                        if ($next == $last[$t] && $i != count($matches) - 1) {
//.........这里部分代码省略.........
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:101,代码来源:pagelist.php

示例5: 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


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