本文整理汇总了PHP中wl函数的典型用法代码示例。如果您正苦于以下问题:PHP wl函数的具体用法?PHP wl怎么用?PHP wl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html
function html()
{
ptln($this->locale_xhtml('admin_header'));
$cache = $this->cache;
$current_books = $this->cache['current_books'];
unset($cache['current_books']);
//ptln('<form action="'.wl($ID).'" method="post" onsubmit="return epub_admin_confirm(this);" id="epub_admin" name="epub_admin">' );
ptln('<form action="' . wl($ID) . '" method="post" id="epub_admin" name="epub_admin">');
echo "<ul>\n";
foreach ($cache as $md5 => $id) {
$id = trim($id);
if (!$id) {
$id = '<undefined>';
}
ptln('<li style="list-style-type:none; color: #333;"><input name="book_id[' . $md5 . ']" type="checkbox" value="' . $id . '"> ' . $id);
ptln(' <ul><li style="color:#333">' . $current_books[$md5]['title'] . "\n" . ' <li style="color:#333">' . $current_books[$md5]['epub']);
ptln(" <!--input type = 'hidden' name='{$md5}' value='" . $current_books[$md5]['epub'] . "'/ -->\n </ul>");
}
echo " </ul>\n";
ptln(' <input type="hidden" name="do" value="admin" />');
ptln(' <input type="hidden" name="page" value="' . $this->getPluginName() . '" />');
formSecurityToken();
ptln(' <input type="submit" name="cmd[cache]" onclick="return epub_admin_confirm(\'cache\');" id="epub_cache_btn" value="' . $this->getLang('btn_submit') . '" />');
ptln(' <input type="submit" onclick="return epub_admin_confirm(\'media\');" name="cmd[media]" id="epub_media_btn" value="' . $this->getLang('btn_del') . '" />');
ptln('</form>');
if ($this->dbg) {
echo $this->req . "<br />";
}
if ($this->results) {
ptln('<p><br />' . $this->results . '</p>');
}
}
示例2: html
public function html()
{
global $ID;
echo $this->locale_xhtml('tree');
echo '<noscript><div class="error">' . $this->getLang('noscript') . '</div></noscript>';
echo '<div id="plugin_move__tree">';
echo '<div class="tree_root tree_pages">';
echo '<h3>' . $this->getLang('move_pages') . '</h3>';
$this->htmlTree(self::TYPE_PAGES);
echo '</div>';
echo '<div class="tree_root tree_media">';
echo '<h3>' . $this->getLang('move_media') . '</h3>';
$this->htmlTree(self::TYPE_MEDIA);
echo '</div>';
/** @var helper_plugin_move_plan $plan */
$plan = plugin_load('helper', 'move_plan');
echo '<div class="controls">';
if ($plan->isCommited()) {
echo '<div class="error">' . $this->getLang('moveinprogress') . '</div>';
} else {
$form = new Doku_Form(array('action' => wl($ID), 'id' => 'plugin_move__tree_execute'));
$form->addHidden('id', $ID);
$form->addHidden('page', 'move_main');
$form->addHidden('json', '');
$form->addElement(form_makeCheckboxField('autoskip', '1', $this->getLang('autoskip'), '', '', $this->getConf('autoskip') ? array('checked' => 'checked') : array()));
$form->addElement('<br />');
$form->addElement(form_makeCheckboxField('autorewrite', '1', $this->getLang('autorewrite'), '', '', $this->getConf('autorewrite') ? array('checked' => 'checked') : array()));
$form->addElement('<br />');
$form->addElement('<br />');
$form->addElement(form_makeButton('submit', 'admin', $this->getLang('btn_start')));
$form->printForm();
}
echo '</div>';
echo '</div>';
}
示例3: slackinvite_signinform
/**
* form for slack invite
*
*
*/
function slackinvite_signinform()
{
global $ID;
$html = '';
$params = array();
$params['id'] = 'slackinvite_plugin_id';
$params['action'] = wl($ID);
$params['method'] = 'post';
$params['enctype'] = 'multipart/form-data';
$params['class'] = 'slackinvite_plugin';
// Modification of the default dw HTML upload form
$form = new Doku_Form($params);
$form->startFieldset($this->getLang('signup'));
$form->addHidden('source', hsc("slackinvite"));
//add source of call, used in action to ignore anything not from this form
$form->addElement(form_makeTextField('first_name', '', $this->getLang('first_name'), 'first__name'));
$form->addElement(form_makeTextField('last_name', '', $this->getLang('last_name'), 'last__name'));
$form->addElement(form_makeTextField('email', '', $this->getLang('email'), 'email'));
$form->addElement(form_makeButton('submit', 'slacksignup', $this->getLang('btn_signup')));
$form->endFieldset();
$html .= '<div class="dokuwiki"><p>' . NL;
//$html .= '<h3>TEAM43 Slack Sign Up</h3>';
$html .= $form->getForm();
$html .= '</p></div>' . NL;
return $html;
}
示例4: render
public function render($mode, Doku_Renderer &$renderer, $data)
{
// $data is what the function handle return'ed.
global $ID;
if ($mode == 'xhtml') {
/** @var Do ku_Renderer_xhtml $renderer */
list($state, $param) = $data;
switch ($param['class']) {
case "post":
$renderer->doc .= $this->helper->facebook->CreatePost($param['href'], $param['width']);
break;
case "send":
$href = $param['href'] == '' ? wl($ID, null, true) : wl($param['href']);
$renderer->doc .= $this->helper->facebook->CreateSend($href);
break;
case "like":
$href = $param['href'] == '' ? wl($ID, null, true) : wl($param['href']);
$renderer->doc .= $this->helper->facebook->CreateLike($href);
break;
case "share":
$href = $param['href'] == '' ? wl($ID, null, true) : wl($param['href']);
$renderer->doc .= $this->helper->facebook->CreateShare($href);
break;
case "page":
// $renderer->doc.= $this->helper->facebook->{'Create'.$param['class']}($param['href'],$param['width']);
msg('not implement');
break;
default:
msg('No match');
}
}
return false;
}
示例5: action_randompage
function action_randompage(&$event, $args)
{
global $conf;
global $ID;
$data = array();
$dir = $conf['savedir'];
$data = file($dir . '/index/page.idx');
//We loops through ten random page...
$i = 1;
while ($i <= 10 & $i != "ok") {
//echo $i;
$i++;
$id = rtrim($data[array_rand($data, 1)]);
$testACL = auth_aclcheck($id, $_SERVER['REMOTE_USER'], $USERINFO['grps']);
if ($testACL > 1 and file_exists(wikiFN($id))) {
$i = "ok";
//echo $id;
}
}
if ($testACL < 1) {
$id = $ID;
}
header("Location: " . wl($id, '', true));
//echo wl($page,'',true);
exit;
}
示例6: handle_act_render
/**
* Handler for the TPL_ACT_RENDER event
*/
function handle_act_render(&$event, $params)
{
global $ID;
// Action not 'show'? Quit
if ($event->data != 'show') {
return;
}
// Trackbacks disabled? Quit
if (!$this->getConf('enable_trackback')) {
return;
}
// Get linkback metadata
$file = metaFN($ID, '.linkbacks');
$data = array('send' => false, 'receive' => false, 'display' => false, 'sentpings' => array(), 'receivedpings' => array(), 'number' => 0);
if (@file_exists($file)) {
$data = unserialize(io_readFile($file, false));
}
// Does not accept linkbacks? Quit
if (!$data['receive']) {
return;
}
// if trackbacks are enabled, insert RDF definition of trackback into output
if ($this->getConf('enable_trackback')) {
echo '<!--<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"' . NL . 'xmlns:dc="http://purl.org/dc/elements/1.1/"' . NL . 'xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">' . NL . '<rdf:Description' . NL . 'rdf:about="' . wl($ID, '', true) . '"' . NL . 'dc:identifier="' . wl($ID, '', true) . '"' . NL . 'dc:title="' . tpl_pagetitle($ID, true) . '"' . NL . 'trackback:ping="' . DOKU_URL . 'lib/plugins/linkback/exe/trackback.php/' . $ID . '" />' . NL . '</rdf:RDF>-->';
}
}
示例7: getHtml
protected function getHtml($id, $data)
{
global $ID;
$delUrl = wl($ID, array('do' => 'admin', 'page' => $this->getPluginName(), 'delete' => $id));
$ignoreUrl = wl($ID, array('do' => 'admin', 'page' => $this->getPluginName(), 'ignore' => $id));
$title = '<strong class="title">' . $data['count'] . ' <code>' . $id . '</code></strong> ' . ' <a href="' . wl($id) . '">[Go to page]</a>' . ' <a href="' . $delUrl . '">[Delete ' . $data['count'] . ' log entries]</a>' . ' <a href="' . $ignoreUrl . '">[Add to <em>ignore list</em>]</a>' . '</span>';
$out = $title . '<ol>';
foreach ($data['hits'] as $hit) {
$line = $hit['date'];
if (!empty($hit['ip'])) {
$line .= ' <em>IP:</em> ' . $hit['ip'];
}
if (!empty($hit['referer'])) {
$line .= ' <em>Referer:</em> <a href="' . $hit['referer'] . '">' . $hit['referer'] . '</a>';
}
if (!empty($hit['user_agent'])) {
$line .= ' <em>User Agent:</em> ' . $hit['user_agent'];
}
// The line should never actually be empty, but still...
if (!empty($line)) {
$out .= "<li>{$line}</li>";
}
}
$out .= '</ol>';
return "<li>{$out}</li>";
}
示例8: siteexport_add_page_export
function siteexport_add_page_export(&$event)
{
global $ID;
if ($this->getConf('allowallusers') || auth_isadmin() || auth_ismanager()) {
$event->data['items'][] = '<li>' . tpl_link(wl($ID, array('do' => 'siteexport_addpage')), '<span>Export Page</span>', 'class="action siteexport_addpage" title="Add page"', 1) . '</li>';
}
}
示例9: handle_start
/**
* handle event
*/
function handle_start(&$event, $param)
{
global $ID;
global $ACT;
if ($ACT != 'show') {
return;
}
$redirects = confToHash($this->getsavedir() . '/shorturl.conf');
if ($redirects[$ID]) {
if (preg_match('/^https?:\\/\\//', $redirects[$ID])) {
send_redirect($redirects[$ID]);
} else {
if ($this->getConf('showmsg')) {
msg(sprintf($this->getLang('redirected'), hsc($ID)));
}
send_redirect(wl($redirects[$ID], '', true));
}
exit;
} else {
if ($_GET['generateShortURL'] != "" && auth_quickaclcheck($ID) >= AUTH_READ) {
$shorturl =& plugin_load('helper', 'shorturl');
if ($shorturl) {
$shortID = $shorturl->autoGenerateShortUrl($ID);
}
}
}
}
示例10: handle_act_preprocess
/**
* Handles input from the newform and redirects to the edit mode
*
* @author Andreas Gohr <gohr@cosmocode.de>
* @author Gina Haeussge <osd@foosel.net>
*/
function handle_act_preprocess(&$event, $param)
{
global $TEXT;
global $ID;
if ($event->data != 'btngnew') {
return true;
}
$tools =& plugin_load('helper', 'blogtng_tools');
if (!$tools->getParam('new/title')) {
msg($this->getLang('err_notitle'), -1);
$event->data = 'show';
return true;
}
$event->preventDefault();
$new = $tools->mkpostid($tools->getParam('new/format'), $tools->getParam('new/title'));
if ($ID != $new) {
send_redirect(wl($new, array('do' => 'btngnew', 'btng[post][blog]' => $tools->getParam('post/blog'), 'btng[new][format]' => $tools->getParam('new/format'), 'btng[new][title]' => $tools->getParam('new/title')), true, '&'));
return false;
//never reached
} else {
$TEXT = $this->_prepare_template($new, $tools->getParam('new/title'));
$event->data = 'preview';
return false;
}
}
示例11: render
/**
* Renders a permalink header.
*
* Code heavily copied from the header renderer from inc/parser/xhtml.php, just
* added an href parameter to the anchor tag linking to the wikilink.
*/
function render($mode, &$renderer, $data)
{
list($headline, $lvl, $page, $sect, $flags) = $data;
$hid = $renderer->_headerToLink($headline);
if ($mode == 'xhtml') {
$renderer->toc_additem($hid, $headline, $lvl);
$url = $sect ? wl($page) . '#' . $sect : wl($page);
$renderer->doc .= DOKU_LF . '<h' . $lvl;
if ($flags['taglogos']) {
$tag = $this->_get_firsttag($page);
if ($tag) {
$renderer->doc .= ' class="include_firsttag__' . $tag . '"';
}
}
$headline = $renderer->_xmlEntities($headline);
$renderer->doc .= '><a name="' . $hid . '" id="' . $hid . '" href="' . $url . '" title="' . $headline . '">';
$renderer->doc .= $headline;
$renderer->doc .= '</a></h' . $lvl . '>' . DOKU_LF;
return true;
} elseif ($mode == 'metadata') {
$renderer->toc_additem($hid, $headline, $lvl);
return true;
}
return false;
}
示例12: showTemplateSwitcher
/**
* Builds a select box with all available templates
* (unless excluded in 'excludeTemplates')
* or show only two templates for mobile switcher: standard plus mobile template
*
* @author Anika Henke <anika@selfthinker.org>
*/
public function showTemplateSwitcher()
{
global $conf;
global $ID;
global $ACT;
if ($ACT != 'show') {
return;
}
$mobileSwitch = $this->getConf('mobileSwitch');
$mobileTpl = $this->getConf('mobileTemplate');
if ($mobileSwitch && $mobileTpl) {
// templates for mobile switcher
$templates = array($mobileTpl => $this->getLang('switchMobile'), $this->origTpl => $this->getLang('switchFull'));
} else {
// all templates (minus excluded templates)
$excludeTemplates = array_map('trim', explode(",", $this->getConf('excludeTemplates')));
$templates = array_diff($this->getTemplates(), $excludeTemplates);
}
$form = new Doku_Form(array('id' => 'tpl__switcher', 'title' => $this->getLang('switchTpl'), 'action' => wl($ID)));
$form->addHidden('act', 'select');
$form->addElement(form_makeListboxField('tpl', $templates, $conf['template'], $this->getLang('template'), '', '', array('class' => 'quickselect')));
$form->addElement(form_makeButton('submit', '', $this->getLang('switch'), array('name' => 'switch')));
$out = '<div class="plugin_loadskin">';
$out .= $form->getForm();
$out .= '</div>';
return $out;
}
示例13: white_breadcrumbs
function white_breadcrumbs()
{
global $lang;
global $conf;
//check if enabled
if (!$conf['breadcrumbs']) {
return false;
}
$crumbs = breadcrumbs();
//setup crumb trace
$crumbs_sep = ' <span class="bcsep">' . $sep . '</span> ';
//render crumbs, highlight the last one
print '<h3>' . $lang['breadcrumb'] . '</h3>';
$last = count($crumbs);
$i = 0;
print '<ul>';
foreach ($crumbs as $id => $name) {
$i++;
print '<li>';
if ($i == $last) {
print '<span class="curid">';
}
tpl_link(wl($id), hsc($name), 'class="breadcrumbs" title="' . $id . '"');
if ($i == $last) {
print '</span>';
}
print '</li>';
}
print '</ul>';
return true;
}
示例14: handle_start
function handle_start(&$event, $param)
{
global $ID;
global $ACT;
global $INFO;
if ($ACT != 'show') {
return;
}
if (!$INFO['exists']) {
return;
}
# don't try to read an article that doesn't exist
$all = rtrim(rawWiki($ID));
$inner = substr($all, 2, -2);
if ($all == '[[' . $inner . ']]' and strpos($inner, '[[') === false and strpos($inner, ']]') === false) {
if (!strpos($inner, '://') === false) {
$url = $inner;
# link is URL already
} else {
msg(sprintf('From: <a href="' . wl($ID, 'do=edit') . '">' . hsc($ID) . '</a>'));
$url = html_wikilink($inner, $name = null, $search = '');
$url = substr($url, strpos($url, '"') + 1);
$url = substr($url, 0, strpos($url, '"'));
}
idx_addPage($ID);
# ensure fulltext search indexing of referrer article - to put it on the backlink page of target article
send_redirect($url);
}
}
示例15: get_data
function get_data($url, $form_properties)
{
/* IF CURL_EXEC RETURNS NOTHING and no errors are being generated, check
the selinux configuration or disable selinux completely.*/
$timeout = 5;
wl("in get data");
wl("url:" . $url);
if ($form_properties == "") {
$ch = curl_init();
wl("no form properties");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
} else {
define('POSTURL', $url);
define('POSTVARS', $form_properties);
wl("with form properties");
//sample url and form properties
//define('POSTURL', 'http://data.bls.gov/cgi-bin/surveymost');
//define('POSTVARS', 'series_id=LNS14000000&survey=ln&format=&html_tables=&delimiter=&catalog=&print_line_length=&lines_per_page=&row_stub_key=&year=&date=&net_change_start=&net_change_end=&percent_change_start=&percent_change_end=');
$ch = curl_init(POSTURL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, POSTVARS);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
}
wl("Still here");
curl_error($ch);
$data = curl_exec($ch);
wl("still in get_data");
curl_close($ch);
wl(strlen($data));
echo "<BR>Length of data returned from url: " . strlen($data) . "<BR>";
return $data;
}