本文整理汇总了PHP中html_buildlist函数的典型用法代码示例。如果您正苦于以下问题:PHP html_buildlist函数的具体用法?PHP html_buildlist怎么用?PHP html_buildlist使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_buildlist函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html
function html()
{
global $conf;
$first = $_REQUEST['first'];
if (!is_numeric($first)) {
$first = 0;
}
$num = $conf['recent'] ? $conf['recent'] : 20;
ptln('<h1>' . $this->getLang('menu') . '</h1>');
$threads = $this->_getThreads();
// slice the needed chunk of discussion pages
$more = count($threads) > $first + $num ? true : false;
$threads = array_slice($threads, $first, $num);
foreach ($threads as $thread) {
$comments = $this->_getComments($thread);
$this->_threadHead($thread);
if ($comments === false) {
ptln('</div>', 6);
// class="level2"
continue;
}
ptln('<form method="post" action="' . wl($thread['id']) . '">', 8);
ptln('<div class="no">', 10);
ptln('<input type="hidden" name="do" value="admin" />', 10);
ptln('<input type="hidden" name="page" value="discussion" />', 10);
echo html_buildlist($comments, 'admin_discussion', array($this, '_commentItem'), array($this, '_li_comment'));
$this->_actionButtons($thread['id']);
}
$this->_browseDiscussionLinks($more, $first, $num);
}
示例2: htmlTree
/**
* print the HTML tree structure
*
* @param int $type
*/
protected function htmlTree($type = self::TYPE_PAGES)
{
$data = $this->tree($type);
// wrap a list with the root level around the other namespaces
array_unshift($data, array('level' => 0, 'id' => '*', 'type' => 'd', 'open' => 'true', 'label' => $this->getLang('root')));
echo html_buildlist($data, 'tree_list idx', array($this, 'html_list'), array($this, 'html_li'));
}
示例3: handle_ajax_call_acl
/**
* AJAX call handler for ACL plugin
*
* @param Doku_Event $event event object by reference
* @param mixed $param empty
* @return void
*/
public function handle_ajax_call_acl(Doku_Event &$event, $param)
{
if ($event->data !== 'plugin_acl') {
return;
}
$event->stopPropagation();
$event->preventDefault();
global $ID;
global $INPUT;
if (!auth_isadmin()) {
echo 'for admins only';
return;
}
if (!checkSecurityToken()) {
echo 'CRSF Attack';
return;
}
$ID = getID();
/** @var $acl admin_plugin_acl */
$acl = plugin_load('admin', 'acl');
$acl->handle();
$ajax = $INPUT->str('ajax');
header('Content-Type: text/html; charset=utf-8');
if ($ajax == 'info') {
$acl->_html_info();
} elseif ($ajax == 'tree') {
$ns = $INPUT->str('ns');
if ($ns == '*') {
$ns = '';
}
$ns = cleanID($ns);
$lvl = count(explode(':', $ns));
$ns = utf8_encodeFN(str_replace(':', '/', $ns));
$data = $acl->_get_tree($ns, $ns);
foreach (array_keys($data) as $item) {
$data[$item]['level'] = $lvl + 1;
}
echo html_buildlist($data, 'acl', array($acl, '_html_list_acl'), array($acl, '_html_li_acl'));
}
}
示例4: handle_ajax_call
/**
* Render a subtree
*
* @param Doku_Event $event
* @param $params
*/
public function handle_ajax_call(Doku_Event $event, $params)
{
if ($event->data != 'plugin_move_tree') {
return;
}
$event->preventDefault();
$event->stopPropagation();
global $INPUT;
global $USERINFO;
if (!auth_ismanager($_SERVER['REMOTE_USER'], $USERINFO['grps'])) {
http_status(403);
exit;
}
/** @var admin_plugin_move_tree $plugin */
$plugin = plugin_load('admin', 'move_tree');
$ns = cleanID($INPUT->str('ns'));
if ($INPUT->bool('is_media')) {
$type = admin_plugin_move_tree::TYPE_MEDIA;
} else {
$type = admin_plugin_move_tree::TYPE_PAGES;
}
$data = $plugin->tree($type, $ns, $ns);
echo html_buildlist($data, 'tree_list', array($plugin, 'html_list'), array($plugin, 'html_li'));
}
示例5: _indexmenu
/**
* Return the index
* @author Samuele Tognini <samuele@netsons.org>
*
* This function is a simple hack of Dokuwiki html_index($ns)
* @author Andreas Gohr <andi@splitbrain.org>
*/
function _indexmenu($myns)
{
global $conf;
$ns = $myns[0];
$js_opts = $myns[1];
$this->sort = $myns[2];
$this->msort = $myns[3];
$this->rsort = $myns[4];
$this->nsort = $myns[5];
$opts = $myns[6];
$output = false;
$data = array();
$js_name = "indexmenu_";
$fsdir = "/" . utf8_encodeFN(str_replace(':', '/', $ns));
if ($this->sort || $this->msort || $this->rsort) {
$custsrch = $this->_search($data, $conf['datadir'], array($this, '_search_index'), $opts, $fsdir);
} else {
search($data, $conf['datadir'], array($this, '_search_index'), $opts, $fsdir);
}
if (!$data) {
return false;
}
// Id generation method
if (is_numeric($js_opts['gen_id'])) {
$js_name .= $js_opts['gen_id'];
} elseif ($js_opts['gen_id'] == 'ns') {
$js_name .= sprintf("%u", crc32($ns));
} else {
$js_name .= uniqid(rand());
}
//javascript index
if ($opts['js']) {
$ns = str_replace('/', ':', $ns);
$output_tmp = $this->_jstree($data, $ns, $js_opts, $js_name, $opts['max']);
//remove unwanted nodes from standard index
$this->_clean_data($data);
} else {
$output .= "<script type='text/javascript' charset='utf-8'>\n";
$output .= "<!--//--><![CDATA[//><!--\n";
$output .= "indexmenu_nojsqueue.push(new Array('" . $js_name . "','" . utf8_encodeFN($js_opts['jsajax']) . "'));\n";
$output .= "addInitEvent(function(){indexmenu_loadJs(DOKU_BASE+'lib/plugins/indexmenu/nojsindex.js');});\n";
$output .= "//--><!]]>\n";
$output .= "</script>\n";
}
//Nojs dokuwiki index
$output .= "\n" . '<div id="nojs_' . $js_name . '" class="indexmenu_nojs"';
$output .= ">\n";
$output .= html_buildlist($data, 'idx', array($this, "_html_list_index"), "html_li_index");
$output .= "</div>\n";
$output .= $output_tmp;
return $output;
}
示例6: die
}
if (!auth_isadmin()) {
die('for admins only');
}
if (!checkSecurityToken()) {
die('CRSF Attack');
}
$ID = getID();
$acl = plugin_load('admin', 'acl');
$acl->handle();
$ajax = $_REQUEST['ajax'];
header('Content-Type: text/html; charset=utf-8');
if ($ajax == 'info') {
$acl->_html_info();
} elseif ($ajax == 'tree') {
global $conf;
global $ID;
$dir = $conf['datadir'];
$ns = $_REQUEST['ns'];
if ($ns == '*') {
$ns = '';
}
$ns = cleanID($ns);
$lvl = count(explode(':', $ns));
$ns = utf8_encodeFN(str_replace(':', '/', $ns));
$data = $acl->_get_tree($ns, $ns);
foreach (array_keys($data) as $item) {
$data[$item]['level'] = $lvl + 1;
}
echo html_buildlist($data, 'acl', array($acl, '_html_list_acl'), array($acl, '_html_li_acl'));
}
示例7: media_nstree
/**
* Build a tree outline of available media namespaces
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function media_nstree($ns)
{
global $conf;
global $lang;
// currently selected namespace
$ns = cleanID($ns);
if (empty($ns)) {
global $ID;
$ns = (string) getNS($ID);
}
$ns_dir = utf8_encodeFN(str_replace(':', '/', $ns));
$data = array();
search($data, $conf['mediadir'], 'search_index', array('ns' => $ns_dir, 'nofiles' => true));
// wrap a list with the root level around the other namespaces
array_unshift($data, array('level' => 0, 'id' => '', 'open' => 'true', 'label' => '[' . $lang['mediaroot'] . ']'));
// insert the current ns into the hierarchy if it isn't already part of it
$ns_parts = explode(':', $ns);
$tmp_ns = '';
$pos = 0;
foreach ($ns_parts as $level => $part) {
if ($tmp_ns) {
$tmp_ns .= ':' . $part;
} else {
$tmp_ns = $part;
}
// find the namespace parts or insert them
while ($data[$pos]['id'] != $tmp_ns) {
if ($pos >= count($data) || $data[$pos]['level'] <= $level + 1 && strnatcmp(utf8_encodeFN($data[$pos]['id']), utf8_encodeFN($tmp_ns)) > 0) {
array_splice($data, $pos, 0, array(array('level' => $level + 1, 'id' => $tmp_ns, 'open' => 'true')));
break;
}
++$pos;
}
}
echo html_buildlist($data, 'idx', 'media_nstree_item', 'media_nstree_li');
}
示例8: html_TOC
/**
* Return the TOC rendered to XHTML
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_TOC($toc)
{
if (!count($toc)) {
return '';
}
global $lang;
global $conf;
$out = '<!-- TOC START -->' . DOKU_LF;
$out .= '<div class="toc">' . DOKU_LF;
$out .= '<div class="tocheader toctoggle" id="toc__header">';
$out .= $lang['toc'];
$out .= '</div>' . DOKU_LF;
$out .= $conf['toctoggled'] ? '<div id="toc__inside" style="display:none">' . DOKU_LF : '<div id="toc__inside">' . DOKU_LF;
$out .= html_buildlist($toc, 'toc', 'html_list_toc');
$out .= '</div>' . DOKU_LF . '</div>' . DOKU_LF;
$out .= '<!-- TOC END -->' . DOKU_LF;
return $out;
}
示例9: p_index_xhtml
/**
* Renders the Index
*
*/
function p_index_xhtml($ns)
{
require_once DOKU_INC . 'inc/search.php';
global $conf;
global $ID;
$dir = $conf['datadir'];
$tpl = $conf['template'];
$start = isset($conf['start']) ? $conf['start'] : 'start';
$ns = getNS($ns);
$data = array();
search($data, $conf['datadir'], 'search_index', array('ns' => $ns));
$i = 0;
$cleanindexlist = array();
if (tpl_getConf('cleanindexlist')) {
$cleanindexlist = explode(',', tpl_getConf('cleanindexlist'));
$i = 0;
foreach ($cleanindexlist as $tmpitem) {
$cleanindexlist[$i] = trim($tmpitem);
$i++;
}
}
$i = 0;
foreach ($data as $item) {
if (tpl_getConf('cleanindex')) {
if (count($cleanindexlist)) {
if (strpos($item['id'], ':')) {
list($tmpitem) = explode(':', $item['id']);
} else {
$tmpitem = $item['id'];
}
if (in_array($tmpitem, $cleanindexlist)) {
unset($data[$i]);
}
}
}
if ($item['id'] == 'sidebar' or $item['id'] == $start or preg_match('/:' . $start . '$/', $item['id']) or !empty($conf['hidepages']) and preg_match('/' . $conf['hidepages'] . '$/', $item['id']) or $item['id'] == $conf['tpl']['dokukit']['extlinks']) {
unset($data[$i]);
}
$i++;
}
# echo index with empty items removed
echo html_buildlist($data, 'idx', '_html_list_index', 'html_li_index');
}
示例10: ajax_index
/**
* Return sub index for index view
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function ajax_index()
{
global $conf;
global $INPUT;
// wanted namespace
$ns = cleanID($INPUT->post->str('idx'));
$dir = utf8_encodeFN(str_replace(':', '/', $ns));
$lvl = count(explode(':', $ns));
$data = array();
search($data, $conf['datadir'], 'search_index', array('ns' => $ns), $dir);
foreach (array_keys($data) as $item) {
$data[$item]['level'] = $lvl + 1;
}
echo html_buildlist($data, 'idx', 'html_list_index', 'html_li_index');
}
示例11: mbo_html_index
/**
* Renders the Index
*
* copy of html_index located in /inc/html.php
* updated to the new index
*
* @author Matthieu Bouthors <matthieu@bouthors.fr>
*/
function mbo_html_index($ns)
{
global $conf;
global $ID;
$dir = $conf['datadir'];
$ns = cleanID($ns);
#fixme use appropriate function
if (empty($ns)) {
$ns = dirname(str_replace(':', '/', $ID));
if ($ns == '.') {
$ns = '';
}
}
$ns = utf8_encodeFN(str_replace(':', '/', $ns));
// echo p_locale_xhtml('index');
echo '<h1>Index</h1>';
echo '<div id="index__tree">';
$data = array();
search($data, $conf['datadir'], 'search_index', array('ns' => $ns));
echo html_buildlist($data, 'idx', 'html_list_index', 'html_li_index');
echo '</div>';
}
示例12: render_TOC
/**
* Return the TOC rendered to XHTML
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function render_TOC()
{
if (count($this->toc) < 3) {
return '';
}
global $lang;
$out = '<div class="toc">' . DOKU_LF;
$out .= '<div class="tocheader toctoggle" id="toc__header">';
$out .= $lang['toc'];
$out .= '</div>' . DOKU_LF;
$out .= '<div id="toc__inside">' . DOKU_LF;
$out .= html_buildlist($this->toc, 'toc', array($this, '_tocitem'));
$out .= '</div>' . DOKU_LF . '</div>' . DOKU_LF;
return $out;
}
示例13: html_index
/**
* Display page index
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_index($ns)
{
require_once DOKU_INC . 'inc/search.php';
global $conf;
global $ID;
$dir = $conf['datadir'];
$ns = cleanID($ns);
#fixme use appropriate function
if (empty($ns)) {
$ns = dirname(str_replace(':', '/', $ID));
if ($ns == '.') {
$ns = '';
}
}
$ns = utf8_encodeFN(str_replace(':', '/', $ns));
print p_locale_xhtml('index');
$data = array();
search($data, $conf['datadir'], 'search_index', array('ns' => $ns));
print html_buildlist($data, 'idx', 'html_list_index', 'html_li_index');
}
示例14: htmlExplorer
/**
* Display a tree menu to select a page or namespace
*
*/
function htmlExplorer($name, $base = '', $current = null)
{
global $lang;
if ($base == '' || $base == '*') {
$base = ':';
}
if (!($o = $this->loadRoute($name))) {
return "<div>Invalid explorertree route!</div>";
//TODO: replace with lang...
}
$data = $this->getTree($base);
// wrap a list with the root level around the other namespaces
if ($base == ':') {
array_unshift($data, array('level' => 0, 'id' => ':', 'type' => 'd', 'open' => 'true', 'label' => '[' . $lang['mediaroot'] . ']'));
}
$list = html_buildlist($data, $class = $o['vars']['class'], array($this, '_html_list_tree'), array($this, '_html_li_tree'));
if (strncasecmp(trim($list), '<ul ', 4)) {
$list = "<ul class='{$class}' >" . $list . "</ul>";
}
if (!($id = $o['vars']['id'])) {
$id = "explorertree_{$name}";
}
if ($base == ':') {
return "<div class='{$class}_root' id='{$id}'>" . $list . "</div>" . "<script type='text/javascript'>jQuery(document).ready(function(){jQuery('#{$id}').explorerTree(" . $this->_treeOpts($name, $current === null ? $base : $current) . ")});</script>";
}
return $list;
}
示例15: _directory
/**
* Handle remote directories
*/
function _directory($url, &$renderer, $path, $refresh)
{
global $conf;
$cache = getCacheName($url . $path, '.repo');
$mtime = @filemtime($cache);
// 0 if it doesn't exist
if ($mtime != 0 && !$_REQUEST['purge'] && $mtime > time() - $refresh) {
$idx = io_readFile($cache, false);
if ($conf['allowdebug']) {
$idx .= "\n<!-- cachefile {$cache} used -->\n";
}
} else {
$items = $this->_index($url, $path);
$idx = html_buildlist($items, 'idx', 'repo_list_index', 'html_li_index');
io_saveFile($cache, $idx);
if ($conf['allowdebug']) {
$idx .= "\n<!-- no cachefile used, but created -->\n";
}
}
$renderer->doc .= $idx;
}