• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP p_get_first_heading函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_first_heading

function get_first_heading($page)
{
    $heading = p_get_first_heading($page);
    if (!isset($heading)) {
        $heading = $page;
    }
    return $heading;
}
开发者ID:nunoflores,项目名称:driver,代码行数:8,代码来源:core.php


示例2: buildTitle

 private function buildTitle($idMainPage, $defaultTitle)
 {
     if (!is_null($idMainPage)) {
         $title = p_get_first_heading($idMainPage, true);
         if (!is_null($title) && $this->useTitle) {
             return $title;
         }
     }
     return $defaultTitle;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:10,代码来源:namespacePreparer.php


示例3: getSiteTitle

 /**
  * get the Title for the page
  **/
 public function getSiteTitle($ID)
 {
     if (useHeading('content') && $ID) {
         $heading = p_get_first_heading($ID, true);
         if ($heading) {
             return $this->xmlEntities($heading);
         }
     }
     return ucwords($this->xmlEntities(array_pop(explode(':', $ID))));
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:13,代码来源:functions.php


示例4: indexmenu_search_index

function indexmenu_search_index(&$data, $base, $file, $type, $lvl, $opts)
{
    global $conf;
    $ret = true;
    $item = array();
    if ($type == 'f' && !preg_match('#\\.txt$#', $file)) {
        // don't add
        return false;
    }
    // get page id by filename
    $id = pathID($file);
    // check hiddens
    if ($type == 'f' && isHiddenPage($id)) {
        return false;
    }
    //  bugfix for the
    //  /ns/
    //  /<ns>.txt
    //  case, need to force the 'directory' type
    if ($type == 'f' && file_exists(dirname(wikiFN($id . ":" . noNS($id))))) {
        $type = 'd';
    }
    // page target id = global id
    $target = $id;
    if ($type == 'd') {
        // this will check 3 kinds of headpage:
        // 1. /<ns>/<ns>.txt
        // 2. /<ns>/
        //    /<ns>.txt
        // 3. /<ns>/
        //    /<ns>/<start_page>
        $nsa = array($id . ":" . noNS($id), $id, $id . ":" . $conf['start']);
        $nspage = false;
        foreach ($nsa as $nsp) {
            if (@file_exists(wikiFN($nsp)) && auth_quickaclcheck($nsp) >= AUTH_READ) {
                $nspage = $nsp;
                break;
            }
        }
        //headpage exists
        if ($nspage) {
            $target = $nspage;
        } else {
            // open namespace index, if headpage does not exists
            $target = $target . ':';
        }
    }
    $data[] = array('id' => $id, 'date' => @filectime(wikiFN($target)), 'type' => $type, 'target' => $target, 'title' => $conf['useheading'] && ($title = p_get_first_heading($target)) ? $title : $id, 'level' => $lvl);
    if (substr_count($id, ":") > 2) {
        $ret = 0;
    }
    return $ret;
}
开发者ID:jacobbates,项目名称:Help-Desk-Wiki-Theme,代码行数:53,代码来源:generate_index.php


示例5: tagToName

 private function tagToName($t)
 {
     $exists = false;
     $id = $t;
     resolve_pageID($this->tagplugin->namespace, $id, $exists);
     $name = p_get_first_heading($id, false);
     if (empty($name)) {
         $name = $t;
     } else {
         $name = $name;
     }
     return $name;
 }
开发者ID:a-gundy,项目名称:ckgedit,代码行数:13,代码来源:tagapi.php


示例6: CreateDefault

 public function CreateDefault()
 {
     global $ID;
     $data = array();
     $data['FB']['url'] = wl($ID, null, true);
     $data['FB']['title'] = p_get_first_heading($ID);
     $text = "";
     $data['FB']['description'] = $text;
     $data['FB']['site_name'] = "FYKOS";
     //var_dump(p_get_metadata($ID,'relation'));
     $data['FB']['image'] = ml($this->getConf('default_image'), array('w' => 600, 'h' => 600), true, '&', true);
     $data['FB']['type'] = "website";
     $data['FB']['locale'] = 'cs_CZ';
     return $data;
 }
开发者ID:fykosak,项目名称:dokuwiki-plugin-social,代码行数:15,代码来源:meta.php


示例7: ajax_qsearch

/**
 * Searches for matching pagenames
 *
 * @author Andreas Gohr <[email protected]>
 */
function ajax_qsearch()
{
    global $lang;
    global $INPUT;
    $maxnumbersuggestions = 50;
    $query = $INPUT->post->str('q');
    if (empty($query)) {
        $query = $INPUT->get->str('q');
    }
    if (empty($query)) {
        return;
    }
    $query = urldecode($query);
    $data = ft_pageLookup($query, true, useHeading('navigation'));
    if (!count($data)) {
        return;
    }
    print '<strong>' . $lang['quickhits'] . '</strong>';
    print '<ul>';
    $counter = 0;
    foreach ($data as $id => $title) {
        if (useHeading('navigation')) {
            $name = $title;
        } else {
            $ns = getNS($id);
            if ($ns) {
                /* Displays the Header of the Namespace-Page or of namespace:start as the Name of the NS */
                $ns_name = p_get_first_heading(getNS($id));
                if (!$ns_name) {
                    $ns_name = p_get_first_heading(getNS($id) . ':start');
                }
                $name = shorten(' [' . $ns_name . ']', 30);
            } else {
                $name = $id;
            }
        }
        echo '<li>' . html_wikilink(':' . $id, $name) . '</li>';
        $counter++;
        if ($counter > $maxnumbersuggestions) {
            echo '<li>...</li>';
            break;
        }
    }
    print '</ul>';
}
开发者ID:s-blu,项目名称:dokuwiki,代码行数:50,代码来源:ajax.php


示例8: search_universal


//.........这里部分代码省略.........
    $return = true;
    // get ID and check if it is a valid one
    $item['id'] = pathID($file);
    if ($item['id'] != cleanID($item['id'])) {
        if ($opts['showmsg']) {
            msg(hsc($item['id']) . ' is not a valid file name for DokuWiki - skipped', -1);
        }
        return false;
        // skip non-valid files
    }
    $item['ns'] = getNS($item['id']);
    if ($type == 'd') {
        // decide if to recursion into this directory is wanted
        if (!$opts['depth']) {
            $return = true;
            // recurse forever
        } else {
            $depth = substr_count($file, '/');
            if ($depth >= $opts['depth']) {
                $return = false;
                // depth reached
            } else {
                $return = true;
            }
        }
        if ($return && !preg_match('/' . $opts['recmatch'] . '/', $file)) {
            $return = false;
            // doesn't match
        }
    }
    // check ACL
    if (!$opts['skipacl']) {
        if ($type == 'd') {
            $item['perm'] = auth_quickaclcheck($item['id'] . ':*');
        } else {
            $item['perm'] = auth_quickaclcheck($item['id']);
            //FIXME check namespace for media files
        }
    } else {
        $item['perm'] = AUTH_DELETE;
    }
    // are we done here maybe?
    if ($type == 'd') {
        if (!$opts['listdirs']) {
            return $return;
        }
        if (!$opts['skipacl'] && $opts['sneakyacl'] && $item['perm'] < AUTH_READ) {
            return false;
        }
        //neither list nor recurse
        if ($opts['dirmatch'] && !preg_match('/' . $opts['dirmatch'] . '/', $file)) {
            return $return;
        }
        if ($opts['nsmatch'] && !preg_match('/' . $opts['nsmatch'] . '/', $item['ns'])) {
            return $return;
        }
    } else {
        if (!$opts['listfiles']) {
            return $return;
        }
        if (!$opts['skipacl'] && $item['perm'] < AUTH_READ) {
            return $return;
        }
        if ($opts['pagesonly'] && substr($file, -4) != '.txt') {
            return $return;
        }
        if (!$conf['showhidden'] && isHiddenPage($id)) {
            return $return;
        }
        if ($opts['filematch'] && !preg_match('/' . $opts['filematch'] . '/', $file)) {
            return $return;
        }
        if ($opts['idmatch'] && !preg_match('/' . $opts['idmatch'] . '/', $item['id'])) {
            return $return;
        }
    }
    // still here? prepare the item
    $item['type'] = $type;
    $item['level'] = $lvl;
    $item['open'] = $return;
    if ($opts['meta']) {
        $item['file'] = basename($file);
        $item['size'] = filesize($base . '/' . $file);
        $item['mtime'] = filemtime($base . '/' . $file);
        $item['rev'] = $item['mtime'];
        $item['writable'] = is_writable($base . '/' . $file);
        $item['executable'] = is_executable($base . '/' . $file);
    }
    if ($type == 'f') {
        if ($opts['hash']) {
            $item['hash'] = md5(io_readFile($base . '/' . $file, false));
        }
        if ($opts['firsthead']) {
            $item['title'] = p_get_first_heading($item['id'], false);
        }
    }
    // finally add the item
    $data[] = $item;
    return $return;
}
开发者ID:Harvie,项目名称:dokuwiki,代码行数:101,代码来源:search.php


示例9: _getLinkTitle

 /**
  * Construct a title and handle images in titles
  *
  * @author Harry Fuecks <[email protected]>
  * @param string|array $title    either string title or media array
  * @param string       $default  default title if nothing else is found
  * @param bool         $isImage  will be set to true if it's a media file
  * @param null|string  $id       linked page id (used to extract title from first heading)
  * @param string       $linktype content|navigation
  * @return string      HTML of the title, might be full image tag or just escaped text
  */
 function _getLinkTitle($title, $default, &$isImage, $id = null, $linktype = 'content')
 {
     $isImage = false;
     if (is_array($title)) {
         $isImage = true;
         return $this->_imageTitle($title);
     } elseif (is_null($title) || trim($title) == '') {
         if (useHeading($linktype) && $id) {
             $heading = p_get_first_heading($id);
             if ($heading) {
                 return $this->_xmlEntities($heading);
             }
         }
         return $this->_xmlEntities($default);
     } else {
         return $this->_xmlEntities($title);
     }
 }
开发者ID:sawachan,项目名称:dokuwiki,代码行数:29,代码来源:xhtml.php


示例10: get_pages

 /**
  * Adds all pages of a specific namespace to the pages array.
  * 
  * @param pages pre-initialised pages array.
  * @param ns Namespace in which to look for pages.
  * @param depth Search depth.
  * @param use_first_header (optional) Includes the first header as page title. 
  */
 function get_pages(&$pages, $ns, $depth = 0, $use_first_header = false)
 {
     global $conf;
     // find pages
     $search_results = array();
     search($search_results, $conf['datadir'], 'search_universal', array('depth' => $depth, 'listfiles' => true, 'listdirs' => false, 'pagesonly' => true, 'skipacl' => true, 'firsthead' => true, 'meta' => true), str_replace(':', '/', $ns));
     // Start page of the namespace
     if ($ns && page_exists($ns)) {
         // Add to the search results
         $search_results[] = array('id' => $ns, 'ns' => getNS($ns), 'title' => p_get_first_heading($ns, false), 'size' => filesize(wikiFN($ns)), 'mtime' => filemtime(wikiFN($ns)), 'perm' => 16, 'type' => 'f', 'level' => 0, 'open' => 1);
     }
     // loop through the pages
     while ($item = array_shift($search_results)) {
         // Check that the user is allowed to read the page
         if (auth_quickaclcheck($item['id']) > AUTH_READ) {
             continue;
         }
         // Check that the user is allowed to read the page
         if (auth_quickaclcheck($item['ns']) > AUTH_READ) {
             continue;
         }
         // Get the create time
         $time = (int) p_get_metadata($item['id'], 'date created', false);
         if (!$time) {
             $time = $item['mtime'];
         }
         // Get specific language part
         $lang = $transplugin ? $transplugin->getLangPart($item['id']) : '';
         if ($lang) {
             $item['ns'] = preg_replace('/^' . $lang . '(:|$)/', '', $item['ns']);
         }
         if ($use_first_header) {
             $title = $item['title'];
         } else {
             // Use the last part of the id for the name
             $title = ucwords(substr(strrchr(strtr($item['id'], '_', ' '), ':'), 1));
         }
         // Add the page to the page list
         $pages[$item['id']] = array('title' => $title, 'ns' => $item['ns'], 'size' => $item['size'], 'time' => $time, 'links' => array(), 'media' => array(), 'lang' => $lang);
     }
 }
开发者ID:jdtProjects,项目名称:dokuwiki,代码行数:49,代码来源:syntax.php


示例11: idx_addPage

/**
 * Adds/updates the search for the given page
 *
 * This is the core function of the indexer which does most
 * of the work. This function needs to be called with proper
 * locking!
 *
 * @author Andreas Gohr <[email protected]>
 */
function idx_addPage($page)
{
    global $conf;
    // load known documents
    $page_idx = idx_getIndex('page', '');
    // get page id (this is the linenumber in page.idx)
    $pid = array_search("{$page}\n", $page_idx);
    if (!is_int($pid)) {
        $pid = count($page_idx);
        // page was new - write back
        if (!idx_appendIndex('page', '', "{$page}\n")) {
            trigger_error("Failed to write page index", E_USER_ERROR);
            return false;
        }
    }
    unset($page_idx);
    // free memory
    idx_saveIndexLine('title', '', $pid, p_get_first_heading($page, false));
    $pagewords = array();
    // get word usage in page
    $words = idx_getPageWords($page);
    if ($words === false) {
        return false;
    }
    if (!empty($words)) {
        foreach (array_keys($words) as $wlen) {
            $index = idx_getIndex('i', $wlen);
            foreach ($words[$wlen] as $wid => $freq) {
                if ($wid < count($index)) {
                    $index[$wid] = idx_updateIndexLine($index[$wid], $pid, $freq);
                } else {
                    // New words **should** have been added in increasing order
                    // starting with the first unassigned index.
                    // If someone can show how this isn't true, then I'll need to sort
                    // or do something special.
                    $index[$wid] = idx_updateIndexLine('', $pid, $freq);
                }
                $pagewords[] = "{$wlen}*{$wid}";
            }
            // save back word index
            if (!idx_saveIndex('i', $wlen, $index)) {
                trigger_error("Failed to write index", E_USER_ERROR);
                return false;
            }
        }
    }
    // Remove obsolete index entries
    $pageword_idx = trim(idx_getIndexLine('pageword', '', $pid));
    if ($pageword_idx !== '') {
        $oldwords = explode(':', $pageword_idx);
        $delwords = array_diff($oldwords, $pagewords);
        $upwords = array();
        foreach ($delwords as $word) {
            if ($word == '') {
                continue;
            }
            list($wlen, $wid) = explode('*', $word);
            $wid = (int) $wid;
            $upwords[$wlen][] = $wid;
        }
        foreach ($upwords as $wlen => $widx) {
            $index = idx_getIndex('i', $wlen);
            foreach ($widx as $wid) {
                $index[$wid] = idx_updateIndexLine($index[$wid], $pid, 0);
            }
            idx_saveIndex('i', $wlen, $index);
        }
    }
    // Save the reverse index
    $pageword_idx = join(':', $pagewords) . "\n";
    if (!idx_saveIndexLine('pageword', '', $pid, $pageword_idx)) {
        trigger_error("Failed to write word index", E_USER_ERROR);
        return false;
    }
    return true;
}
开发者ID:pijoter,项目名称:dokuwiki,代码行数:85,代码来源:indexer.php


示例12: tpl_pagename

 /**
  * Returns the name of the given page (current one if none given).
  *
  * If useheading is enabled this will use the first headline else
  * the given ID is printed.
  *
  * based on tpl_pagetitle in inc/template.php
  */
 function tpl_pagename($id = null)
 {
     global $conf;
     if (is_null($id)) {
         global $ID;
         $id = $ID;
     }
     $name = $id;
     if ($conf['useheading']) {
         $title = p_get_first_heading($id);
         if ($title) {
             $name = $title;
         }
     }
     return hsc($name);
 }
开发者ID:pietersartain,项目名称:dokuwiki-template-pq,代码行数:24,代码来源:tplfn_sidebar.php


示例13: search

 /**
  * List all pages in the given namespace (and below)
  */
 function search($query)
 {
     $regex = '';
     $data = ft_pageSearch($query, $regex);
     $pages = array();
     // prepare additional data
     $idx = 0;
     foreach ($data as $id => $score) {
         $file = wikiFN($id);
         if ($idx < FT_SNIPPET_NUMBER) {
             $snippet = ft_snippet($id, $regex);
             $idx++;
         } else {
             $snippet = '';
         }
         $pages[] = array('id' => $id, 'score' => intval($score), 'rev' => filemtime($file), 'mtime' => filemtime($file), 'size' => filesize($file), 'snippet' => $snippet, 'title' => useHeading('navigation') ? p_get_first_heading($id) : $id);
     }
     return $pages;
 }
开发者ID:neosunchess,项目名称:dokuwiki,代码行数:22,代码来源:RemoteAPICore.php


示例14: bootstrap3_conf

 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
 */
// must be run from within DokuWiki
if (!defined('DOKU_INC')) {
    die;
}
if (($ACT == 'show' || defined('DOKU_MEDIADETAIL')) && bootstrap3_conf('showPageIcons')) {
    global $ID;
    $page_icons = bootstrap3_conf('pageIcons');
    $social_share = in_array('social-share', $page_icons);
    $social_share_providers = bootstrap3_conf('socialShareProviders');
    $help_page = false;
    $help_title = null;
    if (in_array('help', $page_icons)) {
        $help_page = page_findnearest('help', bootstrap3_conf('useACL'));
        $help_title = hsc(p_get_first_heading($help_page));
    }
    ?>
<div class="dw-page-icons pull-right hidden-print">

  <ul class="list-inline pull-right">
    <?php 
    if (in_array('feed', $page_icons)) {
        ?>
    <li>
      <a href="<?php 
        echo DOKU_URL . 'feed.php';
        ?>
" title="<?php 
        echo $lang['btn_recent'];
        ?>
开发者ID:huksley,项目名称:dokuwiki-template-bootstrap3,代码行数:31,代码来源:tpl_page_icons.php


示例15: _search_index


//.........这里部分代码省略.........
         //Search optional namespaces
         if (!empty($opts['nss'])) {
             $nss = $opts['nss'];
             for ($a = 0; $a < count($nss); $a++) {
                 if (preg_match("/^" . $id . "(\$|:.+)/i", $nss[$a][0], $match)) {
                     //It contains an optional namespace
                     $isopen = true;
                 } elseif (preg_match("/^" . $nss[$a][0] . "(:.*)/i", $id, $match)) {
                     //It's inside an optional namespace
                     if ($nss[$a][1] == -1 || substr_count($match[1], ":") < $nss[$a][1]) {
                         $isopen = true;
                     } else {
                         $isopen = false;
                     }
                 }
             }
         }
         if ($opts['nons']) {
             return $isopen;
         } elseif ($opts['max'] > 0 && !$isopen && $lvl >= $opts['max']) {
             $isopen = false;
             //Stop recursive searching
             $return = false;
             //change type
             $type = "l";
         } elseif ($opts['js']) {
             $return = true;
         } else {
             $return = $isopen;
         }
         //Set title and headpage
         $title = $this->_getTitle($id, $headpage, $hns);
         if (!$hns && $opts['nopg']) {
             $hns = $id . ":" . $conf['start'];
         }
     } else {
         //Nopg.Dont show pages
         if ($opts['nopg']) {
             return false;
         }
         $return = true;
         //Nons.Set all pages at first level
         if ($opts['nons']) {
             $lvl = 1;
         }
         //don't add
         if (substr($file, -4) != '.txt') {
             return false;
         }
         //check hiddens and acl
         if (isHiddenPage($id) || auth_quickaclcheck($id) < AUTH_READ) {
             return false;
         }
         //Skip files in plugin conf
         if (!empty($skip_file) && preg_match($skip_file, $id)) {
             return false;
         }
         //Skip headpages to hide
         if (!$opts['nons'] && !empty($headpage) && $opts['hide_headpage']) {
             if ($id == $conf['start']) {
                 return false;
             }
             $ahp = explode(",", $headpage);
             foreach ($ahp as $hp) {
                 switch ($hp) {
                     case ":inside:":
                         if (noNS($id) == noNS(getNS($id))) {
                             return false;
                         }
                         break;
                     case ":same:":
                         if (@is_dir(dirname(wikiFN($id)) . "/" . utf8_encodeFN(noNS($id)))) {
                             return false;
                         }
                         break;
                         //it' s an inside start
                     //it' s an inside start
                     case ":start:":
                         if (noNS($id) == $conf['start']) {
                             return false;
                         }
                         break;
                     default:
                         if (noNS($id) == cleanID($hp)) {
                             return false;
                         }
                 }
             }
         }
         //Set title
         if (!$conf['useheading'] || !($title = p_get_first_heading($id, FALSE))) {
             $title = noNS($id);
         }
         $title = htmlspecialchars($title, ENT_QUOTES);
     }
     $item = array('id' => $id, 'type' => $type, 'level' => $lvl, 'open' => $isopen, 'title' => $title, 'hns' => $hns, 'file' => $file, 'return' => $return);
     $item['sort'] = $this->_setorder($item);
     $data[] = $item;
     return $return;
 }
开发者ID:lorea,项目名称:Hydra-dev,代码行数:101,代码来源:indexmenu.php


示例16: tpl_pagetitle

/**
 * Prints or returns the name of the given page (current one if none given).
 *
 * If useheading is enabled this will use the first headline else
 * the given ID is used.
 *
 * @author Andreas Gohr <[email protected]>
 *
 * @param string $id page id
 * @param bool   $ret return content instead of printing
 * @return bool|string
 */
function tpl_pagetitle($id = null, $ret = false)
{
    global $ACT, $INPUT, $conf, $lang;
    if (is_null($id)) {
        global $ID;
        $id = $ID;
    }
    $name = $id;
    if (useHeading('navigation')) {
        $first_heading = p_get_first_heading($id);
        if ($first_heading) {
            $name = $first_heading;
        }
    }
    // default page title is the page name, modify with the current action
    switch ($ACT) {
        // admin functions
        case 'admin':
            $page_title = $lang['btn_admin'];
            // try to get the plugin name
            /** @var $plugin DokuWiki_Admin_Plugin */
            if ($plugin = plugin_getRequestAdminPlugin()) {
                $plugin_title = $plugin->getMenuText($conf['lang']);
                $page_title = $plugin_title ? $plugin_title : $plugin->getPluginName();
            }
            break;
            // user functions
        // user functions
        case 'login':
        case 'profile':
        case 'register':
        case 'resendpwd':
            $page_title = $lang['btn_' . $ACT];
            break;
            // wiki functions
        // wiki functions
        case 'search':
        case 'index':
            $page_title = $lang['btn_' . $ACT];
            break;
            // page functions
        // page functions
        case 'edit':
            $page_title = "✎ " . $name;
            break;
        case 'revisions':
            $page_title = $name . ' - ' . $lang['btn_revs'];
            break;
        case 'backlink':
        case 'recent':
        case 'subscribe':
            $page_title = $name . ' - ' . $lang['btn_' . $ACT];
            break;
        default:
            // SHOW and anything else not included
            $page_title = $name;
    }
    if ($ret) {
        return hsc($page_title);
    } else {
        print hsc($page_title);
        return true;
    }
}
开发者ID:RnBConsulting,项目名称:dokuwiki,代码行数:76,代码来源:template.php


示例17: breadcrumbs

/**
 * This builds the breadcrumb trail and returns it as array
 *
 * @author Andreas Gohr <[email protected]>
 */
function breadcrumbs()
{
    // we prepare the breadcrumbs early for quick session closing
    static $crumbs = null;
    if ($crumbs != null) {
        return $crumbs;
    }
    global $ID;
    global $ACT;
    global $conf;
    //first visit?
    $crumbs = isset($_SESSION[DOKU_COOKIE]['bc']) ? $_SESSION[DOKU_COOKIE]['bc'] : array();
    //we only save on show and existing wiki documents
    $file = wikiFN($ID);
    if ($ACT != 'show' || !@file_exists($file)) {
        $_SESSION[DOKU_COOKIE]['bc'] = $crumbs;
        return $crumbs;
    }
    // page names
    $name = noNSorNS($ID);
    if (useHeading('navigation')) {
        // get page title
        $title = p_get_first_heading($ID, METADATA_RENDER_USING_SIMPLE_CACHE);
        if ($title) {
            $name = $title;
        }
    }
    //remove ID from array
    if (isset($crumbs[$ID])) {
        unset($crumbs[$ID]);
    }
    //add to array
    $crumbs[$ID] = $name;
    //reduce size
    while (count($crumbs) > $conf['breadcrumbs']) {
        array_shift($crumbs);
    }
    //save to session
    $_SESSION[DOKU_COOKIE]['bc'] = $crumbs;
    return $crumbs;
}
开发者ID:nextghost,项目名称:dokuwiki,代码行数:46,代码来源:common.php


示例18: _getLinkTitle

 /**
  * Construct a title and handle images in titles
  *
  * @author Harry Fuecks <[email protected]>
  */
 function _getLinkTitle($title, $default, &$isImage, $id = NULL)
 {
     global $conf;
     $isImage = FALSE;
     if (is_null($title)) {
         if ($conf['useheading'] && $id) {
             $heading = p_get_first_heading($id);
             if ($heading) {
                 return $this->_xmlEntities($heading);
             }
         }
         return $this->_xmlEntities($default);
     } else {
         if (is_string($title)) {
             return $this->_xmlEntities($title);
         } else {
             if (is_array($title)) {
                 $isImage = TRUE;
                 return $this->_imageTitle($title);
             }
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:sitebe-svn,代码行数:28,代码来源:xhtml.php


示例19: html_revisions

/**
 * list old revisions
 *
 * @author Andreas Gohr <[email protected]>
 * @author Ben Coburn <[email protected]>
 * @author Kate Arzamastseva <[email protected]>
 *
 * @param int $first skip the first n changelog lines
 * @param bool|string $media_id id of media, or false for current page
 */
function html_revisions($first = 0, $media_id = false)
{
    global $ID;
    global $INFO;
    global $conf;
    global $lang;
    $id = $ID;
    if ($media_id) {
        $id = $media_id;
        $changelog = new MediaChangeLog($id);
    } else {
        $changelog = new PageChangeLog($id);
    }
    /* we need to get one additional log entry to be able to
     * decide if this is the last page or is there another one.
     * see html_recent()
     */
    $revisions = $changelog->getRevisions($first, $conf['recent'] + 1);
    if (count($revisions) == 0 && $first != 0) {
        $first = 0;
        $revisions = $changelog->getRevisions($first, $conf['recent'] + 1);
    }
    $hasNext = false;
    if (count($revisions) > $conf['recent']) {
        $hasNext = true;
        array_pop($revisions);
        // remove extra log entry
    }
    if (!$media_id) {
        $date = dformat($INFO['lastmod']);
    } else {
        $date = dformat(@filemtime(mediaFN($id)));
    }
    if (!$media_id) {
        print p_locale_xhtml('revisions');
    }
    $params = array('id' => 'page__revisions', 'class' => 'changes');
    if ($media_id) {
        $params['action'] = media_managerURL(array('image' => $media_id), '&');
    }
    $form = new Doku_Form($params);
    $form->addElement(form_makeOpenTag('ul'));
    if (!$media_id) {
        $exists = $INFO['exists'];
    } else {
        $exists = file_exists(mediaFN($id));
    }
    $display_name = !$media_id && useHeading('navigation') ? hsc(p_get_first_heading($id)) : $id;
    if (!$display_name) {
        $display_name = $id;
    }
    if ($exists && $first == 0) {
        if (!$media_id && isset($INFO['meta']) && isset($INFO['meta']['last_change']) && $INFO['meta']['last_change']['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
            $form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
        } else {
            $form->addElement(form_makeOpenTag('li'));
        }
        $form->addElement(form_makeOpenTag('div', array('class' => 'li')));
        $form->addElement(form_makeTag('input', array('type' => 'checkbox', 'name' => 'rev2[]', 'value' => 'current')));
        $form->addElement(form_makeOpenTag('span', array('class' => 'date')));
        $form->addElement($date);
        $form->addElement(form_makeCloseTag('span'));
        $form->addElement('<img src="' . DOKU_BASE . 'lib/images/blank.gif" width="15" height="11" alt="" />');
        if (!$media_id) {
            $href = wl($id);
        } else {
            $href = media_managerURL(array('image' => $id, 'tab_details' => 'view'), '&');
        }
        $form->addElement(form_makeOpenTag('a', array('class' => 'wikilink1', 'href' => $href)));
        $form->addElement($display_name);
        $form->addElement(form_makeCloseTag('a'));
        if ($media_id) {
            $form->addElement(form_makeOpenTag('div'));
        }
        if (!$media_id) {
            $form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
            $form->addElement(' – ');
            $form->addElement(htmlspecialchars($INFO['sum']));
            $form->addElement(form_makeCloseTag('span'));
        }
        $changelog->setChunkSize(1024);
        $form->addElement(form_makeOpenTag('span', array('class' => 'user')));
        if ($media_id) {
            $revinfo = $changelog->getRevisionInfo(@filemtime(fullpath(mediaFN($id))));
            if ($revinfo['user']) {
                $editor = $revinfo['user'];
            } else {
                $editor = $revinfo['ip'];
            }
        } else {
//.........这里部分代码省略.........
开发者ID:evacomaroski,项目名称:dokuwiki,代码行数:101,代码来源:html.php


示例20: _getLinkTitle

 /**
  * Construct a title and handle images in titles
  *
  * @author Harry Fuecks <[email protected]>
  */
 public function _getLinkTitle($title, $default, $id = NULL)
 {
     global $conf;
     $isImage = false;
     if (is_null($title)) {
         if ($conf['useheading'] && $id) {
             $heading = p_get_first_heading($id, false);
             if ($heading) {
                 return $heading;
             }
         }
         return $default;
     } elseif (is_string($title)) {
         return $title;
     } elseif (is_array($title)) {
         return '[' . $title . ']';
     }
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:23,代码来源:metadata.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP p_get_instructions函数代码示例发布时间:2022-05-15
下一篇:
PHP p_cached_output函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap