本文整理汇总了PHP中ptln函数的典型用法代码示例。如果您正苦于以下问题:PHP ptln函数的具体用法?PHP ptln怎么用?PHP ptln使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ptln函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: piwik_code
/**
* Injects the necessary trackingcodes for piwik tracking (v2.x) into DOM
* like specified in the plugin manager fields
*/
function piwik_code()
{
global $conf;
if (isset($conf['plugin']['piwik2']['js_tracking_code'])
|| (isset($conf['plugin']['piwik2']['img_tracking_code']))
) {
// Config does not contain keys if they are default;
// so check whether they are set & to non-default value
// default 0, so check if it's not set or 0
if (!isset($conf['plugin']['piwik2']['track_admin_user']) || $conf['plugin']['piwik2']['track_admin_user'] == 0) {
if (isset($_SERVER['REMOTE_USER']) && auth_isadmin()) { return; }
}
// default 1, so check if it's set and 0
if (isset($conf['plugin']['piwik2']['track_user']) && $conf['plugin']['piwik2']['track_user'] == 0) {
if (isset($_SERVER['REMOTE_USER'])) { return; }
}
//changes made by Marcel Lange ([email protected])
$trackingCode = (isset($conf['plugin']['piwik2']['js_tracking_code']))? $conf['plugin']['piwik2']['js_tracking_code'] : '';
if(isset($conf['plugin']['piwik2']['use_img_tracking']) && $conf['plugin']['piwik2']['use_img_tracking'] == 1 && isset($conf['plugin']['piwik2']['img_tracking_code'])){
$trackingCode = $conf['plugin']['piwik2']['img_tracking_code'];
}
ptln($trackingCode);
} else {
// Show configuration tip for admin
if (isset($_SERVER['REMOTE_USER']) && auth_isadmin()) {
msg('Please configure the piwik2 plugin');
}
}
}
开发者ID:neutrinog,项目名称:Door43,代码行数:37,代码来源:code.php
示例2: _hookjsprocessing
/**
* Hook js code after page loading.
*/
public function _hookjsprocessing(Doku_Event &$event, $param)
{
global $ID;
global $INFO;
//this ensures that code will be written only on base page
//not on other inlined wiki pages (e.g. when using monobook template)
if ($ID != $INFO["id"]) {
return;
}
ptln("");
ptln("<script type='text/javascript'>");
ptln("window.onload = function () {");
ptln(" hljs.configure({");
ptln(" tabReplace: ' ',");
ptln(" classPrefix: 'hljs-',");
// ptln(" useBR: false");
ptln(" });");
ptln(" hljs.initHighlighting()");
// ptln(" var blocks = document.querySelectorAll('pre.hljs-wrap code');");
trim($token, '<>');
// ptln(" var i, len;");
// ptln(" for (i = 0, len = blocks.length; i < len; i++) {");
// ptln(" hljs.highlightBlock(blocks[i]);");
// ptln(" }");
ptln("};");
ptln("</script>");
}
开发者ID:posquit0,项目名称:dokuwiki-plugin-syntaxhighlightjs,代码行数:30,代码来源:sxh.php
示例3: html
/**
* Output appropriate html
*
*/
function html()
{
global $ID;
global $conf;
// Display the text about this plugin from "fblogin/lang/$lang/intro.txt"
print $this->locale_xhtml('intro');
ptln('<div id="fblofin__manager">');
// If not installed, it displays the install menu
// if installed, it displays the uninstall menu
ptln('<form action_="' . wl($ID) . '" method="post">');
if ($this->is_installed()) {
if ($this->is_used()) {
ptln('<p> ' . $this->getLang('is_used') . '</p>');
} else {
ptln('<p> ' . $this->getLang('uninstall') . ' </p>');
ptln('<p> <input type="hidden" name="action_" value="uninstall" />');
ptln(' <input type="submit" name="submit" class="button" value="' . $this->getLang('btn_uninstall') . '" /> </p>');
}
} else {
ptln('<p> ' . $this->getLang('install') . ' </p>');
ptln('<p> <input type="hidden" name="action_" value="install" />');
ptln(' <input type="submit" name="submit" class="button" value="' . $this->getLang('btn_install') . '" /> </p>');
}
ptln(' <p> <input type="hidden" name="do" value="admin" />');
ptln(' <input type="hidden" name="page" value="fblogin" /> </p>');
ptln('</form>');
ptln('</div>');
}
开发者ID:vobornik,项目名称:Dokuwiki-FBlogin-Plugin,代码行数:32,代码来源:admin.php
示例4: html
/**
* Print results of the download
*/
function html()
{
parent::html();
ptln('<div class="pm_info">');
ptln('<h2>' . $this->lang['downloading'] . '</h2>');
if ($this->manager->error) {
ptln('<div class="error">' . str_replace("\n", "<br />", $this->manager->error) . '</div>');
} else {
if (count($this->downloaded) == 1) {
ptln('<p>' . sprintf($this->lang['downloaded'], $this->downloaded[0]) . '</p>');
} else {
if (count($this->downloaded)) {
// more than one plugin in the download
ptln('<p>' . $this->lang['downloads'] . '</p>');
ptln('<ul>');
foreach ($this->downloaded as $plugin) {
ptln('<li><div class="li">' . $plugin . '</div></li>', 2);
}
ptln('</ul>');
} else {
// none found in download
ptln('<p>' . $this->lang['download_none'] . '</p>');
}
}
}
ptln('</div>');
}
开发者ID:houshuang,项目名称:folders2web,代码行数:30,代码来源:ap_download.class.php
示例5: html
public function html()
{
ptln('<h1>' . $this->getLang('menu') . '</h1>');
$log = $this->loadHelper('log404');
$log->load();
ptln('<ol class=' . $this->getPluginName() . '>');
foreach ($log->getRecords() as $id => $detail) {
ptln($this->getHtml($id, $detail));
}
ptln('</ol>');
}
开发者ID:chtiland,项目名称:dokuwiki-plugin-log404,代码行数:11,代码来源:admin.php
示例6: html
/**
* Render HTML output, e.g. helpful text and a form
*/
public function html()
{
$class = 'nopopup';
if ($this->ispopup) {
$class = 'ispopup page';
}
echo '<div id="plugin__styling" class="' . $class . '">';
ptln('<h1>' . $this->getLang('menu') . '</h1>');
$this->form();
echo '</div>';
}
开发者ID:kevinlovesing,项目名称:dokuwiki,代码行数:14,代码来源:admin.php
示例7: metaheaders_after
function metaheaders_after(&$event, $param)
{
global $ACT;
if ($ACT !== 'register') {
return;
}
if ($this->captcha == 'none' || $this->captcha == 'builtin') {
ptln("\n<style type='text/css'>\n /*<![CDATA[*/");
ptln("#plugin__captcha_wrapper{ display:none; }\n /*]]>*/\n</style>");
}
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:11,代码来源:action.php
示例8: html
function html()
{
parent::html();
ptln('<div class="pm_info">');
ptln('<h2>' . $this->lang['deleting'] . '</h2>');
if ($this->manager->error) {
ptln('<div class="error">' . str_replace("\n", "<br />", $this->manager->error) . '</div>');
} else {
ptln('<p>' . sprintf($this->lang['deleted'], $this->plugin) . '</p>');
}
ptln('</div>');
}
开发者ID:halfbyte,项目名称:rugtool,代码行数:12,代码来源:ap_delete.class.php
示例9: html
/** output appropriate html */
function html()
{
$this->handleAction();
ptln('<form action="' . wl($ID) . '" method="post">');
// output hidden values to ensure dokuwiki will return back to this plugin
ptln(' <input type="hidden" name="do" value="admin" />');
ptln(' <input type="hidden" name="page" value="' . $this->getPluginName() . '" />');
formSecurityToken();
ptln($this->formOutput);
ptln('</form><br>');
ptln($this->htmlOutput);
}
开发者ID:stackshadow,项目名称:ldapadmin,代码行数:13,代码来源:admin.php
示例10: debug
function debug(&$event, $param)
{
global $ID;
ptln('<h1>Publish plug-in debug</h1>');
ptln('<h1>Metadata</h1>');
ptln('<pre>');
ptln(print_r(p_get_metadata($ID), true));
ptln('</pre>');
ptln('<h1>pageinfo</h1>');
ptln('<pre>');
ptln(print_r(pageinfo(), true));
ptln('</pre>');
}
开发者ID:hefanbo,项目名称:dokuwiki-plugin-publish,代码行数:13,代码来源:debug.php
示例11: html
/**
* output appropriate html
*/
function html()
{
ptln('<a href="javascript:prereg_Inf.toggle();void 0"><span style="line-height: 175%">Toggle info</span></a><br />');
ptln('<div id="prereg_info" style="border: 1px solid silver; padding:4px;">' . $this->locale_xhtml('info') . '</div><br>');
ptln('<form action="' . wl($ID) . '" method="post">');
// output hidden values to ensure dokuwiki will return back to this plugin
ptln(' <input type="hidden" name="do" value="admin" />');
ptln(' <input type="hidden" name="page" value="' . $this->getPluginName() . '" />');
formSecurityToken();
ptln(' <input type="submit" name="cmd[confirm]" value="' . $this->getLang('btn_confirm') . '" /> ');
ptln(' <input type="submit" name="cmd[secure]" value="' . $this->getLang('btn_secure') . '" />');
ptln('<br /><br /><div>');
echo $this->getConfirmList();
ptln('</div>');
ptln('</form>');
$this->js();
}
开发者ID:vierbergenlars,项目名称:preregister,代码行数:20,代码来源:admin.php
示例12: html
/**
* output appropriate html
*/
function html()
{
global $ID, $auth;
$filter['grps'] = "user";
if ($auth->canDo('getUsers')) {
// is this feature available?
$users = $auth->retrieveUsers(0, 0);
}
$html = '<p>' . $this->getLang("intro_message") . '</p>
<form class="admin-form" action="' . wl($ID) . '" method="post">
<label class="block">' . $this->getLang("question_name") . ': <input name="problem_name" type="text" /></label>
<label class="block">' . $this->getLang("sender") . ':
<select name="user">
<option value="">' . $this->getLang("all_users") . '</option>';
while ($user = current($users)) {
$html .= '<option value="' . key($users) . '">' . $user["name"] . '</option>';
next($users);
}
$html .= '
</select>
</label>
<label class="block">
<input type="radio" name="type" value="test-case"> ' . $this->getLang('programming_questions') . '<br />
<input type="radio" name="type" value="output-only"> ' . $this->getLang('outputonly_questions') . '
</label>';
// output hidden values to ensure dokuwiki will return back to this plugin
$html .= '<input type="hidden" name="do" value="admin" />' . '<input type="hidden" name="page" value="' . $this->getPluginName() . '" />';
ptln($html);
formSecurityToken();
$html = '
<input type="submit" name="cmd[get]" value="' . $this->getLang('btn_get_submissions') . '" />
<input type="submit" name="cmd[delete]" value="' . $this->getLang('btn_delete_submissions') . '" />
</form><h1 class="sectionedit1"></h1>
';
$html .= $this->output;
ptln($html);
}
开发者ID:smmsadrnezh,项目名称:dokuwiki-plugin-judge,代码行数:40,代码来源:admin.php
示例13: _browseDiscussionLinks
/**
* Displays links to older newer discussions
*/
function _browseDiscussionLinks($more, $first, $num)
{
global $ID;
if ($first == 0 && !$more) {
return true;
}
$params = array('do' => 'admin', 'page' => 'discussion');
$last = $first + $num;
ptln('<div class="level1">', 8);
if ($first > 0) {
$first -= $num;
if ($first < 0) {
$first = 0;
}
$params['first'] = $first;
ptln('<p class="centeralign">', 8);
$ret = '<a href="' . wl($ID, $params) . '" class="wikilink1"><< ' . $this->getLang('newer') . '</a>';
if ($more) {
$ret .= ' | ';
} else {
ptln($ret, 10);
ptln('</p>', 8);
}
} else {
if ($more) {
ptln('<p class="centeralign">', 8);
}
}
if ($more) {
$params['first'] = $last;
$ret .= '<a href="' . wl($ID, $params) . '" class="wikilink1">' . $this->getLang('older') . ' >></a>';
ptln($ret, 10);
ptln('</p>', 8);
}
ptln('</div>', 6);
// class="level1"
return true;
}
开发者ID:NikolausL,项目名称:plugin-discussion,代码行数:41,代码来源:admin.php
示例14: printForm
/**
* show the move and/or rename a page form
*
* @author Michael Hamann <[email protected]>
* @author Gary Owen <[email protected]>
*/
function printForm() {
global $ID;
$ns = getNS($ID);
$ns_select_data = $this->build_namespace_select_content($ns);
$form = new Doku_Form(array('action' => wl($ID), 'method' => 'post', 'class' => 'move__form'));
$form->addHidden('page', $this->getPluginName());
$form->addHidden('id', $ID);
$form->addHidden('move_type', 'page');
$form->startFieldset($this->getLang('movepage'));
$form->addElement(form_makeMenuField('ns_for_page', $ns_select_data, $this->opts['ns_for_page'], $this->getLang('targetns'), '', 'block'));
$form->addElement(form_makeTextField('newns', $this->opts['newns'], $this->getLang('newtargetns'), '', 'block'));
$form->addElement(form_makeTextField('newname', $this->opts['newname'], $this->getLang('newname'), '', 'block'));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('submit')));
$form->endFieldset();
$form->printForm();
if ($this->ns_opts !== false) {
ptln('<fieldset>');
ptln('<legend>');
ptln($this->getLang('movens'));
ptln('</legend>');
ptln('<p>');
ptln(sprintf($this->getLang('ns_move_in_progress'), $this->ns_opts['num_pages'], $this->ns_opts['num_media'], ':'.hsc($this->ns_opts['ns']), ':'.hsc($this->ns_opts['newns'])));
ptln('</p>');
ptln($this->helper->getNSMoveButton('continue'));
ptln($this->helper->getNSMoveButton('abort'));
ptln('</fieldset>');
} else {
$form = new Doku_Form(array('action' => wl($ID), 'method' => 'post', 'class' => 'move__form'));
$form->addHidden('page', $this->getPluginName());
$form->addHidden('id', $ID);
$form->addHidden('move_type', 'namespace');
$form->startFieldset($this->getLang('movens'));
$form->addElement(form_makeMenuField('targetns', $ns_select_data, $this->opts['targetns'], $this->getLang('targetns'), '', 'block'));
$form->addElement(form_makeTextField('newnsname', $this->opts['newnsname'], $this->getLang('newnsname'), '', 'block'));
$form->addElement(form_makeMenuField('contenttomove', array('pages' => $this->getLang('move_pages'), 'media' => $this->getLang('move_media'), 'both' => $this->getLang('move_media_and_pages')), $this->opts['contenttomove'], $this->getLang('content_to_move'), '', 'block'));
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('submit')));
$form->endFieldset();
$form->printForm();
}
}
开发者ID:neutrinog,项目名称:Door43,代码行数:50,代码来源:admin.php
示例15: html
function html()
{
// output the standard menu stuff
parent::html();
// sanity check
if (!$this->manager->plugin) {
return;
}
ptln('<div class="pm_info">');
ptln("<h2>" . $this->manager->getLang('plugin') . " {$this->manager->plugin}</h2>");
// collect pertinent information from the log
$installed = $this->plugin_readlog($this->manager->plugin, 'installed');
$source = $this->plugin_readlog($this->manager->plugin, 'url');
$updated = $this->plugin_readlog($this->manager->plugin, 'updated');
if (strrpos($updated, "\n") !== false) {
$updated = substr($updated, strrpos($updated, "\n") + 1);
}
ptln("<dl>", 2);
ptln("<dt>" . $this->manager->getLang('source') . '</dt><dd>' . ($source ? $source : $this->manager->getLang('unknown')) . "</dd>", 4);
ptln("<dt>" . $this->manager->getLang('installed') . '</dt><dd>' . ($installed ? $installed : $this->manager->getLang('unknown')) . "</dd>", 4);
if ($updated) {
ptln("<dt>" . $this->manager->getLang('lastupdate') . '</dt><dd>' . $updated . "</dd>", 4);
}
ptln("</dl>", 2);
if (count($this->details) == 0) {
ptln("<p>" . $this->manager->getLang('noinfo') . "</p>", 2);
} else {
ptln("<dl>", 2);
if ($this->plugin_info['name']) {
ptln("<dt>" . $this->manager->getLang('name') . "</dt><dd>" . $this->out($this->plugin_info['name']) . "</dd>", 4);
}
if ($this->plugin_info['date']) {
ptln("<dt>" . $this->manager->getLang('date') . "</dt><dd>" . $this->out($this->plugin_info['date']) . "</dd>", 4);
}
if ($this->plugin_info['type']) {
ptln("<dt>" . $this->manager->getLang('type') . "</dt><dd>" . $this->out($this->plugin_info['type']) . "</dd>", 4);
}
if ($this->plugin_info['desc']) {
ptln("<dt>" . $this->manager->getLang('desc') . "</dt><dd>" . $this->out($this->plugin_info['desc']) . "</dd>", 4);
}
if ($this->plugin_info['author']) {
ptln("<dt>" . $this->manager->getLang('author') . "</dt><dd>" . $this->manager->email($this->plugin_info['email'], $this->plugin_info['author']) . "</dd>", 4);
}
if ($this->plugin_info['url']) {
ptln("<dt>" . $this->manager->getLang('www') . "</dt><dd>" . $this->manager->external_link($this->plugin_info['url'], '', 'urlextern') . "</dd>", 4);
}
ptln("</dl>", 2);
if (count($this->details) > 1) {
ptln("<h3>" . $this->manager->getLang('components') . "</h3>", 2);
ptln("<div>", 2);
foreach ($this->details as $info) {
ptln("<dl>", 4);
ptln("<dt>" . $this->manager->getLang('name') . "</dt><dd>" . $this->out($info['name'] . ' ' . $info['compname']) . "</dd>", 6);
if (!$this->plugin_info['date']) {
ptln("<dt>" . $this->manager->getLang('date') . "</dt><dd>" . $this->out($info['date']) . "</dd>", 6);
}
if (!$this->plugin_info['type']) {
ptln("<dt>" . $this->manager->getLang('type') . "</dt><dd>" . $this->out($info['type']) . "</dd>", 6);
}
if (!$this->plugin_info['desc']) {
ptln("<dt>" . $this->manager->getLang('desc') . "</dt><dd>" . $this->out($info['desc']) . "</dd>", 6);
}
if (!$this->plugin_info['author']) {
ptln("<dt>" . $this->manager->getLang('author') . "</dt><dd>" . $this->manager->email($info['email'], $info['author']) . "</dd>", 6);
}
if (!$this->plugin_info['url']) {
ptln("<dt>" . $this->manager->getLang('www') . "</dt><dd>" . $this->manager->external_link($info['url'], '', 'urlextern') . "</dd>", 6);
}
ptln("</dl>", 4);
}
ptln("</div>", 2);
}
}
ptln("</div>");
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:75,代码来源:ap_info.class.php
示例16: show_banner
/**
* Show a banner when viewing pages that are not published.
*
* @author Jon Magne Bøe <[email protected]>
*/
function show_banner(&$event, $param)
{
global $AUTH_ACL, $ID, $INFO;
$autorizationList = $AUTH_ACL;
$pageIdentification = $ID;
$allUsers = auth_nameencode('@ALL', true);
//all users
$additional = 'DAFTDRAFTS';
$autorizationList = $AUTH_ACL;
if (empty($authorizationList)) {
$authorizationList = file(DOKU_CONF . 'acl.auth.php');
}
$daftAuthorizationList = file(dirname(__FILE__) . '/daft.auth.php');
$additional = '\\t#' . $additional;
$acl_pattern_nocomment = '^' . preg_quote($pageIdentification, '/') . '\\s+.*\\s+[0-8].*$';
//pattern for searching acl.auth.php
$authorizationHits = preg_grep("/{$acl_pattern_nocomment}/", $authorizationList);
$numberOfAuthorizations = count($authorizationHits);
$daftHits = preg_grep("/{$acl_pattern_nocomment}/", $daftAuthorizationList);
$numberOfDaftauthorizations = count($daftHits);
//If both acl.auth.php and daft.auth.php contains restrictions of authorization, it's safe to assume it's not published.
if ($numberOfAuthorizations != 0 && $numberOfDaftauthorizations != 0) {
$published = false;
} else {
//Ideally the acl.auth.php and the daft.auth.php-files should be in sync, meaning we don't need to check anything else.
$published = true;
}
$htmlcode = array();
//This code runs if the page is unpublished, i.e. tagged as a draft and hidden from unregistered users.
if (!$published && isset($INFO['userinfo'])) {
$htmlcode[] = '<div class="unpublished">';
$htmlcode[] = '<span class="draft">';
$htmlcode[] = $this->getLang('unpublished');
$htmlcode[] = '<br>';
$htmlcode[] = $this->getLang('howtopublish') . ' ~~' . $this->getLang('code') . '~~';
$htmlcode[] = '</span>';
$htmlcode[] = '</div>';
ptln(implode($htmlcode));
return true;
} else {
return;
}
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:48,代码来源:action.php
示例17: _form_close
/**
* Close the html form
*
* @author Samuele Tognini <[email protected]>
*/
function _form_close($act)
{
ptln(' <input type="submit" name="btn" ' . $this->repos['status'][$n] . ' value="' . $this->getLang($act) . '" />');
ptln(' </form>');
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:10,代码来源:admin.php
示例18: _showsort
/**
* Display the indexmenu sort number.
*
* @author Samuele Tognini <[email protected]>
*/
function _showsort(&$event, $param)
{
global $ID, $ACT;
if ($ACT != 'show' || $this->_notadmin()) {
return;
}
if ($n = p_get_metadata($ID, 'indexmenu_n')) {
ptln('<div class="info">');
ptln($this->getLang('showsort') . $n);
ptln('</div>');
}
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:17,代码来源:action.php
示例19: html
/**
* output appropriate html
*/
function html()
{
global $ID;
ptln('<h1>' . $this->getLang('menu') . '</h1>');
$form = new Doku_Form(array('id' => 'vg', 'action' => wl($ID)));
$form->addHidden('cmd', $this->edit ? 'edit' : 'add');
$form->addHidden('sectok', getSecurityToken());
$form->addHidden('page', $this->getPluginName());
$form->addHidden('do', 'admin');
$form->startFieldset($this->getLang($this->edit ? 'edituser' : 'adduser'));
if ($this->edit) {
$form->addElement(form_makeField('text', 'user', $this->data['user'], $this->getLang('user'), '', '', array('disabled' => 'disabled')));
$form->addHidden('uid', $this->data['user']);
$form->addElement('<br />');
} else {
$form->addElement(form_makeField('text', 'uid', '', $this->getLang('user')));
$form->addElement('<br />');
}
$form->addElement(form_makeField('text', 'grp', $this->edit ? implode(', ', $this->data['grp']) : '', $this->getLang('grp')));
$form->addElement('<br />');
$form->addElement(form_makeButton('submit', '', $this->getLang($this->edit ? 'change' : 'add')));
$form->endFieldset();
$form->printForm();
ptln('<table class="inline" id="vg__show">');
ptln(' <tr>');
ptln(' <th class="user">' . hsc($this->getLang('users')) . '</th>');
ptln(' <th class="grp">' . hsc($this->getLang('grps')) . '</th>');
ptln(' <th> </th>');
ptln(' </tr>');
foreach ($this->users as $user => $grps) {
//$userdata=$this->_auth->getUserData($user);
ptln(' <tr>');
ptln(' <td>' . hsc($user) . (isset($userdata['name']) ? hsc(' (' . $userdata['name'] . ')') : '') . '</td>');
ptln(' <td>' . hsc(implode(', ', $grps)) . '</td>');
ptln(' <td class="act">');
ptln(' <a class="vg_edit" href="' . wl($ID, array('do' => 'admin', 'page' => $this->getPluginName(), 'cmd' => 'edit', 'uid' => $user, 'sectok' => getSecurityToken())) . '">' . hsc($this->getLang('edit')) . '</a>');
ptln(' • ');
ptln(' <a class="vg_del" href="' . wl($ID, array('do' => 'admin', 'page' => $this->getPluginName(), 'cmd' => 'del', 'uid' => $user, 'sectok' => getSecurityToken())) . '">' . hsc($this->getLang('del')) . '</a>');
ptln(' </td>');
ptln(' </tr>');
}
ptln('</table>');
$form = new Doku_Form(array('id' => 'vg', 'action' => wl($ID)));
$form->addHidden('cmd', $this->editgroup ? 'editgroup' : 'addgroup');
$form->addHidden('sectok', getSecurityToken());
$form->addHidden('page', $this->getPluginName());
$form->addHidden('do', 'admin');
if ($this->editgroup) {
$form->startFieldset($this->getLang('editgroup'));
$form->addElement(form_makeField('text', 'group', $this->data['group'], $this->getLang('grp'), '', '', array('disabled' => 'disabled')));
$form->addElement('<br />');
$form->addHidden('uid', $this->data['group']);
$form->addElement(form_makeField('text', 'users', implode(', ', $this->data['users']), $this->getLang('users')));
$form->addElement('<br />');
} else {
$form->startFieldset($this->getLang('addgroup'));
$form->addElement(form_makeField('text', 'uid', '', $this->getLang('grp')));
$form->addElement('<br />');
$form->addElement(form_makeField('text', 'users', '', $this->getLang('users')));
$form->addElement('<br />');
}
$form->addElement(form_makeButton('submit', '', $this->getLang($this->editgroup ? 'change' : 'add')));
$form->endFieldset();
$form->printForm();
ptln('<table class="inline" id="vg__show">');
ptln(' <tr>');
ptln(' <th class="grp">' . hsc($this->getLang('grps')) . '</th>');
ptln(' <th class="user">' . hsc($this->getLang('users')) . '</th>');
ptln(' <th class="act"> </th>');
ptln(' </tr>');
foreach ($this->groups as $group => $users) {
ptln(' <tr>');
ptln(' <td>' . hsc($group) . '</td>');
ptln(' <td>' . hsc(implode(', ', $users)) . '</td>');
ptln(' <td class="act">');
ptln(' <a class="vg_edit" href="' . wl($ID, array('do' => 'admin', 'page' => $this->getPluginName(), 'cmd' => 'editgroup', 'uid' => $group, 'sectok' => getSecurityToken())) . '">' . hsc($this->getLang('edit')) . '</a>');
ptln(' • ');
ptln(' <a class="vg_del" href="' . wl($ID, array('do' => 'admin', 'page' => $this->getPluginName(), 'cmd' => 'delgroup', 'uid' => $group, 'sectok' => getSecurityToken())) . '">' . hsc($this->getLang('del')) . '</a>');
ptln(' </td>');
ptln(' </tr>');
}
ptln('</table>');
$form = new Doku_Form(array('id' => 'vg', 'action' => wl($ID)));
$form->addHidden('cmd', 'search');
$form->addHidden('sectok', getSecurityToken());
$form->addHidden('page', $this->getPluginName());
$form->addHidden('do', 'admin');
$form->startFieldset($this->getLang('searchuser'));
$form->addElement(form_makeField('text', 'uid', '', $this->getLang('searchname')));
$form->addElement(form_makeButton('submit', '', $this->getLang('search')));
$form->printForm();
if (!empty($this->_auth_userlist)) {
ptln('<table class="inline" id="vg__show">');
ptln(' <tr>');
ptln(' <th class="user">' . hsc($this->getLang('users')) . '</th>');
ptln(' <th class="act"> </th>');
ptln(' </tr>');
//.........这里部分代码省略.........
开发者ID:rztuc,项目名称:virtualgroup,代码行数:101,代码来源:admin.php
示例20: html_admin
/**
* List available Administration Tasks
*
* @author Andreas Gohr <[email protected]>
* @author Håkan Sandell <[email protected]>
*/
function html_admin()
{
global $ID;
global $INFO;
global $lang;
global $conf;
global $auth;
// build menu of admin functions from the plugins that handle them
$pluginlist = plugin_list('admin');
$menu = array();
foreach ($pluginlist as $p) {
if (($obj =& plugin_load('admin', $p)) === null) {
continue;
}
// check permissions
if ($obj->forAdminOnly() && !$INFO['isadmin']) {
continue;
}
$menu[$p] = array('plugin' => $p, 'prompt' => $obj->getMenuText($conf['lang']), 'sort' => $obj->getMenuSort());
}
// data security check
// @todo: could be checked and only displayed if $conf['savedir'] is under the web root
echo '<a style="border:none; float:right;"
href="http://www.dokuwiki.org/security#web_access_security">
<img src="data/security.png" alt="Your data directory seems to be protected properly."
onerror="this.parentNode.style.display=\'none\'" /></a>';
print p_locale_xhtml('admin');
// Admin Tasks
if ($INFO['isadmin']) {
ptln('<ul class="admin_tasks">');
if ($menu['usermanager'] && $auth && $auth->canDo('getUsers')) {
ptln(' <li class="admin_usermanager"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'usermanager')) . '">' . $menu['usermanager']['prompt'] . '</a></div></li>');
}
unset($menu['usermanager']);
if ($menu['acl']) {
ptln(' <li class="admin_acl"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'acl')) . '">' . $menu['acl']['prompt'] . '</a></div></li>');
}
unset($menu['acl']);
if ($menu['plugin']) {
ptln(' <li class="admin_plugin"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'plugin')) . '">' . $menu['plugin']['prompt'] . '</a></div></li>');
}
unset($menu['plugin']);
if ($menu['config']) {
ptln(' <li class="admin_config"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'config')) . '">' . $menu['config']['prompt'] . '</a></div></li>');
}
unset($menu['config']);
}
ptln('</ul>');
// Manager Tasks
ptln('<ul class="admin_tasks">');
if ($menu['revert']) {
ptln(' <li class="admin_revert"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'revert')) . '">' . $menu['revert']['prompt'] . '</a></div></li>');
}
unset($menu['revert']);
if ($menu['popularity']) {
ptln(' <li class="admin_popularity"><div class="li">' . '<a href="' . wl($ID, array('do' => 'admin', 'page' => 'popularity')) . '">' . $menu['popularity']['prompt'] . '</a></div></li>');
}
unset($menu['popularity']);
// print DokuWiki version:
ptln('</ul>');
echo '<div id="admin__version">';
echo getVersion();
echo '</div>';
// print the rest as sorted list
if (count($menu)) {
usort($menu, 'p_sort_modes');
// output the menu
ptln('<div class="clearer"></div>');
print p_locale_xhtml('adminplugins');
ptln('<ul>');
foreach ($menu as $item) {
if (!$item['prompt']) {
continue;
}
ptln(' <li><div class="li"><a href="' . wl($ID, 'do=admin&page=' . $item['plugin']) . '">' . $item['prompt'] . '</a></div></li>');
}
ptln('</ul>');
}
}
开发者ID:nefercheprure,项目名称:dokuwiki,代码行数:85,代码来源:html.php
注:本文中的ptln函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论