本文整理汇总了PHP中html_buildlist函数的典型用法代码示例。如果您正苦于以下问题:PHP html_buildlist函数的具体用法?PHP html_buildlist怎么用?PHP html_buildlist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_buildlist函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:NikolausL,项目名称:plugin-discussion,代码行数:30,代码来源:admin.php
示例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'));
}
开发者ID:kochichi,项目名称:dokuwiki-plugin-move,代码行数:12,代码来源:tree.php
示例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'));
}
}
开发者ID:wernerflamme,项目名称:dokuwiki,代码行数:47,代码来源:action.php
示例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'));
}
开发者ID:kochichi,项目名称:dokuwiki-plugin-move,代码行数:30,代码来源:tree.php
示例5: _indexmenu
/**
* Return the index
* @author Samuele Tognini <[email protected]>
*
* This function is a simple hack of Dokuwiki html_index($ns)
* @author Andreas Gohr <[email protected]>
*/
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;
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:59,代码来源:indexmenu.php
示例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'));
}
开发者ID:nextghost,项目名称:dokuwiki,代码行数:31,代码来源:ajax.php
示例7: media_nstree
/**
* Build a tree outline of available media namespaces
*
* @author Andreas Gohr <[email protected]>
*/
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');
}
开发者ID:yjliugit,项目名称:dokuwiki,代码行数:41,代码来源:media.php
示例8: html_TOC
/**
* Return the TOC rendered to XHTML
*
* @author Andreas Gohr <[email protected]>
*/
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;
}
开发者ID:pijoter,项目名称:dokuwiki,代码行数:23,代码来源:html.php
示例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');
}
开发者ID:particleKIT,项目名称:dokuKIT,代码行数:47,代码来源:tpl_functions.php
示例10: ajax_index
/**
* Return sub index for index view
*
* @author Andreas Gohr <[email protected]>
*/
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');
}
开发者ID:AlexanderS,项目名称:Part-DB,代码行数:20,代码来源:ajax.php
示例11: mbo_html_index
/**
* Renders the Index
*
* copy of html_index located in /inc/html.php
* updated to the new index
*
* @author Matthieu Bouthors <[email protected]>
*/
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>';
}
开发者ID:xudianyang,项目名称:wiki.phpboy.net,代码行数:30,代码来源:tpl_functions.php
示例12: render_TOC
/**
* Return the TOC rendered to XHTML
*
* @author Andreas Gohr <[email protected]>
*/
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;
}
开发者ID:canneverbe,项目名称:flyspray,代码行数:20,代码来源:xhtml.php
示例13: html_index
/**
* Display page index
*
* @author Andreas Gohr <[email protected]>
*/
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');
}
开发者ID:canneverbe,项目名称:flyspray,代码行数:25,代码来源:html.php
示例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;
}
开发者ID:Klap-in,项目名称:explorertree,代码行数:31,代码来源:helper.php
示例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;
}
开发者ID:samiaa71,项目名称:repo-plugin,代码行数:24,代码来源:syntax.php
示例16: session_write_close
session_write_close();
if (!auth_isadmin()) {
die('for admins only');
}
if (!checkSecurityToken()) {
die('CRSF Attack');
}
$ID = getID();
$dokutranslate = plugin_load('admin', 'dokutranslate');
$dokutranslate->handle();
$ajax = $_REQUEST['ajax'];
header('Content-Type: text/html; charset=utf-8');
if ($ajax == 'modform') {
$dokutranslate->_html_modform();
} 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 = $dokutranslate->_get_tree($ns, $ns);
foreach (array_keys($data) as $item) {
$data[$item]['level'] = $lvl + 1;
}
echo html_buildlist($data, 'dokutranslate', array($dokutranslate, '_html_list_acl'), array($dokutranslate, '_html_li_acl'));
}
开发者ID:nextghost,项目名称:Dokutranslate,代码行数:31,代码来源:ajax.php
示例17: html
function html()
{
global $conf;
$first = $_REQUEST['first'];
if (!is_numeric($first)) {
$first = 0;
}
$num = $conf['recent'];
ptln('<h1>' . $this->getLang('menu') . '</h1>');
$targets = $this->_getTargets();
// slice the needed chunk of linkback targets
$more = count($targets) > $first + $num ? true : false;
$targets = array_slice($targets, $first, $num);
foreach ($targets as $target) {
$linkbacks = $this->_getLinkbacks($target);
$this->_targetHead($target);
if ($linkbacks === false) {
ptln('</div>', 6);
// class="level2"
continue;
}
ptln('<form method="post" action="' . wl($target['id']) . '">', 8);
ptln('<div class="no">', 10);
ptln('<input type="hidden" name="do" value="admin" />', 10);
ptln('<input type="hidden" name="page" value="linkback" />', 10);
echo html_buildlist($linkbacks, 'admin_linkback', array($this, '_linkbackItem'), array($this, '_li_linkback'));
$this->_actionButtons($target['id']);
}
$this->_browseLinkbackLinks($more, $first, $num);
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:30,代码来源:admin.php
示例18: media_nstree
/**
* Build a tree outline of available media namespaces
*
* @author Andreas Gohr <[email protected]>
*/
function media_nstree($ns)
{
global $conf;
global $lang;
// currently selected namespace
$ns = cleanID($ns);
if (empty($ns)) {
global $ID;
$ns = dirname(str_replace(':', '/', $ID));
if ($ns == '.') {
$ns = '';
}
}
$ns = utf8_encodeFN(str_replace(':', '/', $ns));
$data = array();
search($data, $conf['mediadir'], 'search_index', array('ns' => $ns, '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'] . ']'));
echo html_buildlist($data, 'idx', 'media_nstree_item', 'media_nstree_li');
}
开发者ID:nblock,项目名称:dokuwiki,代码行数:25,代码来源:media.php
示例19: buildThankYouPage
/**
* Build thanks message, trigger indexing and rendering of new pages.
*
* @param string $thanks
* @return string html of thanks message or when redirect the first page id of created pages
*/
protected function buildThankYouPage($thanks)
{
global $ID;
$backupID = $ID;
$html = "<p>{$thanks}</p>";
// Build result tree
$pages = array_keys($this->targetpages);
usort($pages, array($this, '_sorttargetpages'));
$data = array();
$last_folder = array();
foreach ($pages as $ID) {
$lvl = substr_count($ID, ':');
for ($n = 0; $n < $lvl; ++$n) {
if (!isset($last_folder[$n]) || strpos($ID, $last_folder[$n]['id']) !== 0) {
$last_folder[$n] = array('id' => substr($ID, 0, strpos($ID, ':', ($n > 0 ? strlen($last_folder[$n - 1]['id']) : 0) + 1) + 1), 'level' => $n + 1, 'open' => 1);
$data[] = $last_folder[$n];
}
}
$data[] = array('id' => $ID, 'level' => 1 + substr_count($ID, ':'), 'type' => 'f');
}
$html .= html_buildlist($data, 'idx', array($this, 'html_list_index'), 'html_li_index');
// Add indexer bugs for every just-created page
$html .= '<div class="no">';
ob_start();
foreach ($pages as $ID) {
// indexerWebBug uses ID and INFO[exists], but the bureaucracy form
// page always exists, as does the just-saved page, so INFO[exists]
// is correct in any case
tpl_indexerWebBug();
// the iframe will trigger real rendering of the pages to make sure
// any used plugins are initialized (eg. the do plugin)
echo '<iframe src="' . wl($ID, array('do' => 'export_html')) . '" width="1" height="1" style="visibility:hidden"></iframe>';
}
$html .= ob_get_contents();
ob_end_clean();
$html .= '</div>';
$ID = $backupID;
return $html;
}
开发者ID:rusidea,项目名称:analitika,代码行数:45,代码来源:actiontemplate.php
示例20: _html_explorer
/**
* Display a tree menu to select a page or namespace
*
* @author Andreas Gohr <[email protected]>
*/
function _html_explorer()
{
global $conf;
global $ID;
global $lang;
$dir = $conf['datadir'];
$ns = $this->ns;
if (empty($ns)) {
$ns = dirname(str_replace(':', '/', $ID));
if ($ns == '.') {
$ns = '';
}
} elseif ($ns == '*') {
$ns = '';
}
$ns = utf8_encodeFN(str_replace(':', '/', $ns));
$data = $this->_get_tree($ns);
// wrap a list with the root level around the other namespaces
array_unshift($data, array('level' => 0, 'id' => '*', 'type' => 'd', 'open' => 'true', 'label' => '[' . $lang['mediaroot'] . ']'));
echo html_buildlist($data, 'acl', array($this, '_html_list_acl'), array($this, '_html_li_acl'));
}
开发者ID:rexin,项目名称:dokuwiki,代码行数:26,代码来源:admin.php
注:本文中的html_buildlist函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论