本文整理汇总了PHP中ptln函数的典型用法代码示例。如果您正苦于以下问题:PHP ptln函数的具体用法?PHP ptln怎么用?PHP ptln使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ptln函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 (info@bravehartk2.de)
$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');
}
}
}
示例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>");
}
示例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>');
}
示例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>');
}
示例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>');
}
示例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>';
}
示例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>");
}
}
示例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>');
}
示例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);
}
示例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>');
}
示例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();
}
示例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);
}
示例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;
}
示例14: printForm
/**
* show the move and/or rename a page form
*
* @author Michael Hamann <michael@content-space.de>
* @author Gary Owen <gary@isection.co.uk>
*/
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();
}
}
示例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>");
}