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


PHP WikiFactory::Wiki方法代码示例

本文整理汇总了PHP中WikiFactory::Wiki方法的典型用法代码示例。如果您正苦于以下问题:PHP WikiFactory::Wiki方法的具体用法?PHP WikiFactory::Wiki怎么用?PHP WikiFactory::Wiki使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WikiFactory的用法示例。


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

示例1: plugin_includesubmenu_convert

function plugin_includesubmenu_convert()
{
    global $vars;
    $ShowPageName = FALSE;
    if (func_num_args()) {
        $aryargs = func_get_args();
        if ($aryargs[0] == 'showpagename') {
            $ShowPageName = TRUE;
        }
    }
    $SubMenuPageName = '';
    $tmppage = strip_bracket($vars['page']);
    //下階層のSubMenuページ名
    $SubMenuPageName1 = $tmppage . '/SubMenu';
    //同階層のSubMenuページ名
    $LastSlash = strrpos($tmppage, '/');
    if ($LastSlash === FALSE) {
        $SubMenuPageName2 = 'SubMenu';
    } else {
        $SubMenuPageName2 = substr($tmppage, 0, $LastSlash) . '/SubMenu';
    }
    //echo "$SubMenuPageName1 <br />";
    //echo "$SubMenuPageName2 <br />";
    //下階層にSubMenuがあるかチェック
    //あれば、それを使用
    if (is_page($SubMenuPageName1)) {
        //下階層にSubMenu有り
        $SubMenuPageName = $SubMenuPageName1;
    } else {
        if (is_page($SubMenuPageName2)) {
            //同階層にSubMenu有り
            $SubMenuPageName = $SubMenuPageName2;
        } else {
            //SubMenu無し
            return "";
        }
    }
    $wiki = WikiFactory::Wiki($SubMenuPageName);
    $body = $wiki->render();
    if ($ShowPageName) {
        $s_page = htmlsc($SubMenuPageName);
        $link = '<a href="' . $wiki->get_uri('edit') . '">$s_page</a>';
        $body = "<h1>{$link}</h1>\n{$body}";
    }
    return $body;
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:46,代码来源:includesubmenu.inc.php

示例2: protect_body

function protect_body($plugin)
{
    global $auth_api, $protect;
    $body = '';
    if ($plugin === 'login') {
        $plugin = '';
    }
    $wiki = WikiFactory::Wiki($protect);
    if ($wiki->isReadable() && empty($plugin)) {
        $body .= $wiki->render();
    } else {
        $plugin = empty($plugin) ? 'login' : $plugin;
        if (exist_plugin_convert($plugin)) {
            $body .= do_plugin_convert($plugin);
        }
    }
    if (empty($body)) {
        if (PLUGIN_PROTECT_MUST_PAGE) {
            die('The attestation setting is not done.');
        }
        die;
    }
    return $body;
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:24,代码来源:protect.inc.php

示例3: addRow

 function addRow($pagename, $rescan = FALSE)
 {
     // Generate/Regenerate regex if needed
     if ($this->_generate_regex() === FALSE) {
         return FALSE;
     }
     if (isset($this->_added[$pagename])) {
         return TRUE;
     }
     $this->_added[$pagename] = TRUE;
     //		$source = plugin_tracker_get_source($pagename, TRUE);
     $source = plugin_tracker_get_source($pagename, TRUE, $this->page_line);
     // Plus!
     $wiki = Factory::Wiki($pagename);
     $filetime = $wiki->time();
     if ($source === FALSE) {
         $source = null;
     }
     // Compat: 'move to [[page]]' (like bugtrack plugin)
     $matches = array();
     if (!$rescan && !empty($source) && preg_match('/move\\sto\\s(.+)/', $source, $matches)) {
         $to_page = strip_bracket(trim($matches[1]));
         if (WikiFactory::Wiki($to_page)->isValied()) {
             unset($source, $matches);
             // Release
             return $this->addRow($to_page, TRUE);
             // Recurse(Rescan) once
         }
     }
     // Default column
     $row = array('_page' => $pagename, '_real' => $pagename, '_update' => $filetime, '_past' => $filetime);
     // Load / Redefine cell
     $matches = array();
     if (preg_match($this->pattern, $source, $matches)) {
         array_shift($matches);
         // $matches[0] = all of the captured string
         foreach ($this->pattern_fields as $key => $fieldname) {
             $row[$fieldname] = trim($matches[$key]);
             unset($matches[$key]);
         }
         $this->rows[] = $row;
     } else {
         if (PLUGIN_TRACKER_LIST_SHOW_ERROR_PAGE) {
             $this->rows[] = $row;
             // Error
         }
     }
     return TRUE;
 }
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:49,代码来源:tracker.inc.php


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