本文整理汇总了PHP中actionOK函数的典型用法代码示例。如果您正苦于以下问题:PHP actionOK函数的具体用法?PHP actionOK怎么用?PHP actionOK使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了actionOK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* The actual output creation.
*
* @param $format string output format being rendered
* @param $renderer Doku_Renderer reference to the current renderer object
* @param $data array data created by handler()
* @return boolean rendered correctly?
*/
public function render($format, &$renderer, $data)
{
global $lang, $INFO, $ACT, $QUERY;
if ($format == 'xhtml') {
list($options, , ) = $data;
// don't print the search form if search action has been disabled
if (!actionOK('search')) {
return true;
}
$flt = $options['filter'];
$flt = "dataflt[" . $flt . "*~]";
$ns = $INFO['namespace'];
/** based on tpl_datasearchform() */
$renderer->doc .= '<div class="datasearchform__form">' . "\n";
$renderer->doc .= '<form action="' . wl() . '" accept-charset="utf-8" class="search" id="datasearchform__search" method="get" role="search"><div class="no">' . "\n";
$renderer->doc .= '<input type="hidden" name="id" value="' . $ns . ':datatable" />' . "\n";
$renderer->doc .= '<input type="text" ';
if ($ACT == 'search') {
$renderer->doc .= 'value="' . htmlspecialchars($QUERY) . '" ';
}
$renderer->doc .= 'name="' . $flt . '" class="edit datasearchform__qsearch_in" />' . "\n";
$renderer->doc .= '<input type="submit" value="' . $lang['btn_search'] . '" class="button" title="' . $lang['btn_search'] . '" />' . "\n";
$renderer->doc .= '<div class="ajax_qsearch JSpopup datasearchform__qsearch_out"></div>' . "\n";
$renderer->doc .= '</div></form>' . "\n";
$renderer->doc .= '</div>' . "\n";
return true;
}
return false;
}
示例2: handle_login_form
function handle_login_form(&$event, $param)
{
global $auth;
global $conf;
global $lang;
global $ID;
if ($conf['authtype'] == 'authplaincas') {
if ($this->getConf('logourl') != '') {
$caslogo = '<img src="' . $this->getConf('logourl') . '" alt="" style="vertical-align: middle;" /> ';
} else {
$caslogo = '';
}
//var_dump($event->data->_content);
$event->data->_content = array();
// remove the login form
$event->data->insertElement(0, '<fieldset><legend>' . $this->getConf('name') . '</legend>');
$event->data->insertElement(1, '<p style="text-align: center;">' . $caslogo . '<a href="' . $this->_selfdo('caslogin') . '">Login</a></p>');
$event->data->insertElement(2, '</fieldset>');
//instead of removing, one could implement a local login here...
// if ($this->getConf('jshidelocal')) {
// $event->data->insertElement(3,'<p id="normalLoginToggle" style="display: none; text-align: center;"><a href="#" onClick="javascript:document.getElementById(\'normalLogin\').style.display = \'block\'; document.getElementById(\'normalLoginToggle\').style.display = \'none\'; return false;">Show '.$this->getConf('localname').'</a></p><p style="text-align: center;">Only use this if you cannot use the '.$this->getConf('name').' above.</p>');
// $event->data->replaceElement(4,'<fieldset id="normalLogin" style="display: block;"><legend>'.$this->getConf('localname').'</legend><script type="text/javascript">document.getElementById(\'normalLoginToggle\').style.display = \'block\'; document.getElementById(\'normalLogin\').style.display = \'none\';</script>');
// } else {
// $event->data->replaceElement(3,'<fieldset><legend>'.$this->getConf('localname').'</legend>');
// }
$insertElement = 3;
if ($auth && $auth->canDo('modPass') && actionOK('resendpwd')) {
$event->data->insertElement($insertElement, '<p>' . $lang['pwdforget'] . ': <a href="' . wl($ID, 'do=resendpwd') . '" rel="nofollow" class="wikilink1">' . $lang['btn_resendpwd'] . '</a></p>');
}
}
}
示例3: tpl_actions
/**
* Prints the actions links
*
* @author Michael Klier <chi@chimeric.de>
*/
function tpl_actions()
{
$actions = array('admin', 'edit', 'history', 'recent', 'backlink', 'subscribe', 'subscribens', 'index', 'login', 'profile');
print '<div class="sidebar_box">' . DOKU_LF;
print ' <ul>' . DOKU_LF;
foreach ($actions as $action) {
if (!actionOK($action)) {
continue;
}
// start output buffering
if ($action == 'edit') {
// check if new page button plugin is available
if (!plugin_isdisabled('npd') && ($npd =& plugin_load('helper', 'npd'))) {
$npb = $npd->html_new_page_button(true);
if ($npb) {
print ' <li><div class="li">';
print $npb;
print '</div></li>' . DOKU_LF;
}
}
}
ob_start();
print ' <li><div class="li">';
if (tpl_actionlink($action)) {
print '</div></li>' . DOKU_LF;
ob_end_flush();
} else {
ob_end_clean();
}
}
print ' </ul>' . DOKU_LF;
print '</div>' . DOKU_LF;
}
示例4: _tpl_searchform
/**
* Print the search form
*
* If the first parameter is given a div with the ID 'qsearch_out' will
* be added which instructs the ajax pagequicksearch to kick in and place
* its output into this div. The second parameter controls the propritary
* attribute autocomplete. If set to false this attribute will be set with an
* value of "off" to instruct the browser to disable it's own built in
* autocompletion feature (MSIE and Firefox)
*
* @author Andreas Gohr <andi@splitbrain.org>
* @param bool $ajax
* @param bool $autocomplete
* @return bool
*/
function _tpl_searchform($ajax = true, $autocomplete = true)
{
global $lang;
global $ACT;
global $QUERY;
// don't print the search form if search action has been disabled
if (!actionOK('search')) {
return false;
}
print '<form action="' . wl() . '" accept-charset="utf-8" class="navbar-form navbar-right" id="dw__search" method="get" role="search">';
print '<input type="hidden" name="do" value="search" />';
print '<div class="form-group">';
print '<input type="text" ';
if ($ACT == 'search') {
print 'value="' . htmlspecialchars($QUERY) . '" ';
}
print ' autocomplete="off" ';
print 'id="qsearch__in" accesskey="f" name="id" class="form-control col-lg-3" title="[F]" placeholder="' . $lang['btn_search'] . '" /> ';
print '</div>';
if ($ajax) {
print '<div id="qsearch__out" class="ajax_qsearch"></div>';
}
print '</form>';
return true;
}
示例5: is_action_enabled
function is_action_enabled($type)
{
$ctype = $type;
if ($type == 'history') {
$ctype = 'revisions';
}
return actionOK($ctype);
}
示例6: _tpl_register
/**
* Create link/button to register page
* DW versions > 2011-02-20 can use the core function tpl_action('register')
*
* @author Anika Henke <anika@selfthinker.org>
*/
function _tpl_register($link=0,$wrapper=0) {
global $conf;
global $lang;
global $ID;
$lang_register = !empty($lang['btn_register']) ? $lang['btn_register'] : $lang['register'];
if ($_SERVER['REMOTE_USER'] || !$conf['useacl'] || !actionOK('register')) return;
if ($wrapper) echo "<$wrapper>";
if ($link)
tpl_link(wl($ID,'do=register'),$lang_register,'class="action register" rel="nofollow"');
else
echo html_btn('register',$ID,'',array('do'=>'register'),'get',0,$lang_register);
if ($wrapper) echo "</$wrapper>";
}
示例7: handle_action_act_preprocess
public function handle_action_act_preprocess(Doku_Event &$event, $param)
{
global $ID, $INFO, $REV, $RANGE, $TEXT, $PRE, $SUF;
// check if the action was given as array key
if (is_array($event->data)) {
list($act) = array_keys($event->data);
} else {
$act = $event->data;
}
if ($act == 'save' && $_REQUEST['saveandedit'] && actionOK($act)) {
if (act_permcheck($act) == 'save' && checkSecurityToken()) {
$event->data = act_save($act);
if ($event->data == 'show') {
$event->data = 'edit';
$REV = '';
// now we are working on the current revision
// Handle section edits
if ($PRE || $SUF) {
// $from and $to are 1-based indexes of the actually edited content
$from = strlen($PRE) + 1;
$to = $from + strlen($TEXT);
$RANGE = $from . '-' . $to;
}
// Ensure the current text is loaded again from the file
unset($GLOBALS['TEXT'], $GLOBALS['PRE'], $GLOBALS['SUF']);
// Reset the date of the last modification to avoid conflict messages
unset($GLOBALS['DATE']);
// Reset the change check
unset($_REQUEST['changecheck']);
// Force rendering of the metadata in order to ensure metadata is correct
p_set_metadata($ID, array(), true);
$INFO = pageinfo();
// reset pageinfo to new data (e.g. if the page exists)
} elseif ($event->data == 'conflict') {
// DokuWiki won't accept 'conflict' as action here.
// Just execute save again, the conflict will be detected again
$event->data = 'save';
}
}
}
}
示例8: act_clean
/**
* Sanitize the action command
*
* Add all allowed commands here.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function act_clean($act)
{
global $lang;
global $conf;
// check if the action was given as array key
if (is_array($act)) {
list($act) = array_keys($act);
}
//remove all bad chars
$act = strtolower($act);
$act = preg_replace('/[^1-9a-z_]+/', '', $act);
if ($act == 'export_html') {
$act = 'export_xhtml';
}
if ($act == 'export_htmlbody') {
$act = 'export_xhtmlbody';
}
// check if action is disabled
if (!actionOK($act)) {
msg('Command disabled: ' . htmlspecialchars($act), -1);
return 'show';
}
//disable all acl related commands if ACL is disabled
if (!$conf['useacl'] && in_array($act, array('login', 'logout', 'register', 'admin', 'subscribe', 'unsubscribe', 'profile', 'revert', 'resendpwd', 'subscribens', 'unsubscribens'))) {
msg('Command unavailable: ' . htmlspecialchars($act), -1);
return 'show';
}
if (!in_array($act, array('login', 'logout', 'register', 'save', 'cancel', 'edit', 'draft', 'preview', 'search', 'show', 'check', 'index', 'revisions', 'diff', 'recent', 'backlink', 'admin', 'subscribe', 'revert', 'unsubscribe', 'profile', 'resendpwd', 'recover', 'wordblock', 'draftdel', 'subscribens', 'unsubscribens')) && substr($act, 0, 7) != 'export_') {
msg('Command unknown: ' . htmlspecialchars($act), -1);
return 'show';
}
return $act;
}
示例9: html_edit
/**
* This displays the edit form (lots of logic included)
*
* @fixme this is a huge lump of code and should be modularized
* @triggers HTML_PAGE_FROMTEMPLATE
* @triggers HTML_EDITFORM_INJECTION
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_edit($text = null, $include = 'edit')
{
//FIXME: include needed?
global $ID;
global $REV;
global $DATE;
global $RANGE;
global $PRE;
global $SUF;
global $INFO;
global $SUM;
global $lang;
global $conf;
global $license;
//set summary default
if (!$SUM) {
if ($REV) {
$SUM = $lang['restored'];
} elseif (!$INFO['exists']) {
$SUM = $lang['created'];
}
}
//no text? Load it!
if (!isset($text)) {
$pr = false;
//no preview mode
if ($INFO['exists']) {
if ($RANGE) {
list($PRE, $text, $SUF) = rawWikiSlices($RANGE, $ID, $REV);
} else {
$text = rawWiki($ID, $REV);
}
$check = md5($text);
$mod = false;
} else {
//try to load a pagetemplate
$data = array($ID);
$text = trigger_event('HTML_PAGE_FROMTEMPLATE', $data, 'pageTemplate', true);
$check = md5('');
$mod = $text !== '';
}
} else {
$pr = true;
//preview mode
if (isset($_REQUEST['changecheck'])) {
$check = $_REQUEST['changecheck'];
$mod = md5($text) !== $check;
} else {
// Why? Assume default text is unmodified.
$check = md5($text);
$mod = false;
}
}
$wr = $INFO['writable'] && !$INFO['locked'];
if ($wr) {
if ($REV) {
print p_locale_xhtml('editrev');
}
print p_locale_xhtml($include);
} else {
// check pseudo action 'source'
if (!actionOK('source')) {
msg('Command disabled: source', -1);
return;
}
print p_locale_xhtml('read');
}
if (!$DATE) {
$DATE = $INFO['lastmod'];
}
?>
<div style="width:99%;">
<div class="toolbar">
<div id="draft__status"><?php
if (!empty($INFO['draft'])) {
echo $lang['draftdate'] . ' ' . strftime($conf['dformat']);
}
?>
</div>
<div id="tool__bar"><?php
if ($wr) {
?>
<a href="<?php
echo DOKU_BASE;
?>
lib/exe/mediamanager.php?ns=<?php
echo $INFO['namespace'];
?>
"
target="_blank"><?php
echo $lang['mediaselect'];
//.........这里部分代码省略.........
示例10: bootstrap_searchform
/**
* Print the search form in Bootstrap Style
*
* If the first parameter is given a div with the ID 'qsearch_out' will
* be added which instructs the ajax pagequicksearch to kick in and place
* its output into this div. The second parameter controls the propritary
* attribute autocomplete. If set to false this attribute will be set with an
* value of "off" to instruct the browser to disable it's own built in
* autocompletion feature (MSIE and Firefox)
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com>
* @param bool $ajax
* @param bool $autocomplete
* @return bool
*/
function bootstrap_searchform($ajax = true, $autocomplete = true)
{
global $lang;
global $ACT;
global $QUERY;
// don't print the search form if search action has been disabled
if (!actionOK('search')) {
return false;
}
print '<form action="' . wl() . '" accept-charset="utf-8" class="form-inline search" id="dw__search" method="get" role="search"><div class="no">';
print '<input type="hidden" name="do" value="search" />';
print '<input type="text" ';
if ($ACT == 'search') {
print 'value="' . htmlspecialchars($QUERY) . '" ';
}
if (!$autocomplete) {
print 'autocomplete="off" ';
}
print 'id="qsearch__in" type="search" placeholder="' . $lang['btn_search'] . '" accesskey="f" name="id" class="edit form-control" title="[F]" />';
print '<button type="submit" class="btn btn-default" title="' . $lang['btn_search'] . '"><i class="glyphicon glyphicon-search"></i></button>';
if ($ajax) {
print '<div id="qsearch__out" class="panel panel-default ajax_qsearch JSpopup"></div>';
}
print '</div></form>';
return true;
}
示例11: wl
if (empty($lang["btn_unsubscribe"])) {
if (actionOK("subscribe")) {
//check if action is disabled
$_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "subscribe"), false, "&");
$_vector_tabs_right["ca-watch"]["text"] = $lang["btn_subscribe"];
//language comes from DokuWiki core
}
//2009-12-25 "Lemming" and older ones. See the following for information:
//<http://www.freelists.org/post/dokuwiki/Question-about-tpl-buttonsubscribe>
} else {
if (empty($INFO["subscribed"]) && actionOK("subscribe")) {
//check if action is disabled
$_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "subscribe"), false, "&");
$_vector_tabs_right["ca-watch"]["text"] = $lang["btn_subscribe"];
//language comes from DokuWiki core
} elseif (actionOK("unsubscribe")) {
//check if action is disabled
$_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "unsubscribe"), false, "&");
$_vector_tabs_right["ca-watch"]["text"] = $lang["btn_unsubscribe"];
//language comes from DokuWiki core
}
}
}
}
/******************************************************************************
******************************** ATTENTION *********************************
DO NOT MODIFY THIS FILE, IT WILL NOT BE PRESERVED ON UPDATES!
******************************************************************************
If you want to add some own tabs, have a look at the README of this template
and "/user/tabs.php". You have been warned!
*****************************************************************************/
示例12: act_resendpwd
/**
* Send a new password
*
* This function handles both phases of the password reset:
*
* - handling the first request of password reset
* - validating the password reset auth token
*
* @author Benoit Chesneau <benoit@bchesneau.info>
* @author Chris Smith <chris@jalakai.co.uk>
* @author Andreas Gohr <andi@splitbrain.org>
*
* @return bool true on success, false on any error
*/
function act_resendpwd()
{
global $lang;
global $conf;
/* @var auth_basic $auth */
global $auth;
/* @var Input $INPUT */
global $INPUT;
if (!actionOK('resendpwd')) {
msg($lang['resendna'], -1);
return false;
}
$token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth'));
if ($token) {
// we're in token phase - get user info from token
$tfile = $conf['cachedir'] . '/' . $token[0] . '/' . $token . '.pwauth';
if (!@file_exists($tfile)) {
msg($lang['resendpwdbadauth'], -1);
$INPUT->remove('pwauth');
return false;
}
// token is only valid for 3 days
if (time() - filemtime($tfile) > 3 * 60 * 60 * 24) {
msg($lang['resendpwdbadauth'], -1);
$INPUT->remove('pwauth');
@unlink($tfile);
return false;
}
$user = io_readfile($tfile);
$userinfo = $auth->getUserData($user);
if (!$userinfo['mail']) {
msg($lang['resendpwdnouser'], -1);
return false;
}
if (!$conf['autopasswd']) {
// we let the user choose a password
$pass = $INPUT->str('pass');
// password given correctly?
if (!$pass) {
return false;
}
if ($pass != $INPUT->str('passchk')) {
msg($lang['regbadpass'], -1);
return false;
}
// change it
if (!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) {
msg('error modifying user data', -1);
return false;
}
} else {
// autogenerate the password and send by mail
$pass = auth_pwgen();
if (!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) {
msg('error modifying user data', -1);
return false;
}
if (auth_sendPassword($user, $pass)) {
msg($lang['resendpwdsuccess'], 1);
} else {
msg($lang['regmailfail'], -1);
}
}
@unlink($tfile);
return true;
} else {
// we're in request phase
if (!$INPUT->post->bool('save')) {
return false;
}
if (!$INPUT->post->str('login')) {
msg($lang['resendpwdmissing'], -1);
return false;
} else {
$user = trim($auth->cleanUser($INPUT->post->str('login')));
}
$userinfo = $auth->getUserData($user);
if (!$userinfo['mail']) {
msg($lang['resendpwdnouser'], -1);
return false;
}
// generate auth token
$token = md5(auth_cookiesalt() . $user);
//secret but user based
$tfile = $conf['cachedir'] . '/' . $token[0] . '/' . $token . '.pwauth';
$url = wl('', array('do' => 'resendpwd', 'pwauth' => $token), true, '&');
//.........这里部分代码省略.........
示例13: _notify
/**
* Sends a notify mail on new comment
*
* @param array $comment data array of the new comment
* @param array $subscribers data of the subscribers
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Esther Brunner <wikidesign@gmail.com>
*/
function _notify($comment, &$subscribers)
{
global $conf;
global $ID;
$notify_text = io_readfile($this->localfn('subscribermail'));
$confirm_text = io_readfile($this->localfn('confirmsubscribe'));
$subject_notify = '[' . $conf['title'] . '] ' . $this->getLang('mail_newcomment');
$subject_subscribe = '[' . $conf['title'] . '] ' . $this->getLang('subscribe');
$mailer = new Mailer();
if (empty($_SERVER['REMOTE_USER'])) {
$mailer->from($conf['mailfromnobody']);
}
$replace = array('PAGE' => $ID, 'TITLE' => $conf['title'], 'DATE' => dformat($comment['date']['created'], $conf['dformat']), 'NAME' => $comment['user']['name'], 'TEXT' => $comment['raw'], 'COMMENTURL' => wl($ID, '', true) . '#comment_' . $comment['cid'], 'UNSUBSCRIBE' => wl($ID, 'do=subscribe', true, '&'), 'DOKUWIKIURL' => DOKU_URL);
$confirm_replace = array('PAGE' => $ID, 'TITLE' => $conf['title'], 'DOKUWIKIURL' => DOKU_URL);
$mailer->subject($subject_notify);
$mailer->setBody($notify_text, $replace);
// send mail to notify address
if ($conf['notify']) {
$mailer->bcc($conf['notify']);
$mailer->send();
}
// notify page subscribers
if (actionOK('subscribe')) {
$data = array('id' => $ID, 'addresslist' => '', 'self' => false);
if (class_exists('Subscription')) {
/* Introduced in DokuWiki 2013-05-10 */
trigger_event('COMMON_NOTIFY_ADDRESSLIST', $data, array(new Subscription(), 'notifyaddresses'));
} else {
/* Old, deprecated default handler */
trigger_event('COMMON_NOTIFY_ADDRESSLIST', $data, 'subscription_addresslist');
}
$to = $data['addresslist'];
if (!empty($to)) {
$mailer->bcc($to);
$mailer->send();
}
}
// notify comment subscribers
if (!empty($subscribers)) {
foreach ($subscribers as $mail => $data) {
$mailer->bcc($mail);
if ($data['active']) {
$replace['UNSUBSCRIBE'] = wl($ID, 'do=discussion_unsubscribe&hash=' . $data['hash'], true, '&');
$mailer->subject($subject_notify);
$mailer->setBody($notify_text, $replace);
$mailer->send();
} elseif (!$data['active'] && !$data['confirmsent']) {
$confirm_replace['SUBSCRIBE'] = wl($ID, 'do=discussion_confirmsubscribe&hash=' . $data['hash'], true, '&');
$mailer->subject($subject_subscribe);
$mailer->setBody($confirm_text, $confirm_replace);
$mailer->send();
$subscribers[$mail]['confirmsent'] = true;
}
}
}
}
示例14: notify
/**
* Sends a notify mail on page change or registration
*
* @param string $id The changed page
* @param string $who Who to notify (admin|subscribers|register)
* @param int|string $rev Old page revision
* @param string $summary What changed
* @param boolean $minor Is this a minor edit?
* @param string[] $replace Additional string substitutions, @KEY@ to be replaced by value
* @return bool
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace = array())
{
global $conf;
/* @var Input $INPUT */
global $INPUT;
// decide if there is something to do, eg. whom to mail
if ($who == 'admin') {
if (empty($conf['notify'])) {
return false;
}
//notify enabled?
$tpl = 'mailtext';
$to = $conf['notify'];
} elseif ($who == 'subscribers') {
if (!actionOK('subscribe')) {
return false;
}
//subscribers enabled?
if ($conf['useacl'] && $INPUT->server->str('REMOTE_USER') && $minor) {
return false;
}
//skip minors
$data = array('id' => $id, 'addresslist' => '', 'self' => false, 'replacements' => $replace);
trigger_event('COMMON_NOTIFY_ADDRESSLIST', $data, array(new Subscription(), 'notifyaddresses'));
$to = $data['addresslist'];
if (empty($to)) {
return false;
}
$tpl = 'subscr_single';
} else {
return false;
//just to be safe
}
// prepare content
$subscription = new Subscription();
return $subscription->send_diff($to, $tpl, $id, $rev, $summary);
}
示例15: html_edit
/**
* This displays the edit form (lots of logic included)
*
* @fixme this is a huge lump of code and should be modularized
* @triggers HTML_PAGE_FROMTEMPLATE
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_edit($text = null, $include = 'edit')
{
//FIXME: include needed?
global $ID;
global $REV;
global $DATE;
global $RANGE;
global $PRE;
global $SUF;
global $INFO;
global $SUM;
global $lang;
global $conf;
//set summary default
if (!$SUM) {
if ($REV) {
$SUM = $lang['restored'];
} elseif (!$INFO['exists']) {
$SUM = $lang['created'];
}
}
//no text? Load it!
if (!isset($text)) {
$pr = false;
//no preview mode
if ($INFO['exists']) {
if ($RANGE) {
list($PRE, $text, $SUF) = rawWikiSlices($RANGE, $ID, $REV);
} else {
$text = rawWiki($ID, $REV);
}
} else {
//try to load a pagetemplate
$data = array($ID);
$text = trigger_event('HTML_PAGE_FROMTEMPLATE', $data, 'pageTemplate', true);
}
} else {
$pr = true;
//preview mode
}
$wr = $INFO['writable'];
if ($wr) {
if ($REV) {
print p_locale_xhtml('editrev');
}
print p_locale_xhtml($include);
$ro = false;
} else {
// check pseudo action 'source'
if (!actionOK('source')) {
msg('Command disabled: source', -1);
return;
}
print p_locale_xhtml('read');
$ro = 'readonly="readonly"';
}
if (!$DATE) {
$DATE = $INFO['lastmod'];
}
?>
<div style="width:99%;">
<div class="toolbar">
<div id="draft__status"><?php
if (!empty($INFO['draft'])) {
echo $lang['draftdate'] . ' ' . date($conf['dformat']);
}
?>
</div>
<div id="tool__bar"><?php
if (!$ro) {
?>
<a href="<?php
echo DOKU_BASE;
?>
lib/exe/mediamanager.php?ns=<?php
echo $INFO['namespace'];
?>
"
target="_blank"><?php
echo $lang['mediaselect'];
?>
</a><?php
}
?>
</div>
<?php
if ($wr) {
?>
<script type="text/javascript" charset="utf-8">
<?php
/* sets changed to true when previewed */
//.........这里部分代码省略.........