本文整理汇总了PHP中HTML::raw方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::raw方法的具体用法?PHP HTML::raw怎么用?PHP HTML::raw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML
的用法示例。
在下文中一共展示了HTML::raw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run($dbi, $argstr, &$request, $basepage)
{
extract($this->getArgs($argstr, $request));
$parser = new AtomParser();
assert(!empty($url));
$parser->parse_url($url);
$html = '';
$items = HTML::dl();
foreach ($parser->feed as $feed) {
$title = HTML::h3(HTML::a(array('href' => $feed["links"]["0"]["href"]), $feed["title"]));
$counter = 1;
foreach ($parser->entries as $entry) {
$item = HTML::dt(HTML::a(array('href' => $entry["links"]["0"]["href"]), $entry["title"]));
$items->pushContent($item);
if (!$titleonly) {
$description = HTML::dd(HTML::raw(html_entity_decode($entry["content"])));
} else {
$description = HTML::dd();
}
$items->pushContent($description);
if ($maxitem > 0 && $counter >= $maxitem) {
break;
}
$counter++;
}
$html = HTML::div(array('class' => 'rss'), $title);
$html->pushContent($items);
}
return $html;
}
示例2: run
function run($dbi, $argstr, &$request, $basepage)
{
/* plugin not yet has arguments - save for later (copied from UpLoad)
$args = $this->getArgs($argstr, $request);
extract($args);
*/
$form = HTML::form(array('action' => $request->getPostURL(), 'enctype' => 'multipart/form-data', 'method' => 'post'));
$contents = HTML::div(array('class' => 'wikiaction'));
$contents->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'MAX_FILE_SIZE', 'value' => MAX_UPLOAD_SIZE)));
$contents->pushContent(HTML::input(array('name' => 'userfile', 'type' => 'file', 'size' => '50')));
$contents->pushContent(HTML::raw(" "));
$contents->pushContent(HTML::input(array('value' => _("Convert"), 'type' => 'submit')));
$form->pushContent($contents);
$message = HTML();
$userfile = $request->getUploadedFile('userfile');
if ($userfile) {
$userfile_name = $userfile->getName();
$userfile_name = basename($userfile_name);
$userfile_tmpname = $userfile->getTmpName();
if (!preg_match("/(\\.html|\\.htm)\$/i", $userfile_name)) {
$message->pushContent(_("Only files with extension HTML are allowed"), HTML::br(), HTML::br());
} else {
$message->pushContent(_("Processed {$userfile_name}"), HTML::br(), HTML::br());
$message->pushContent(_("Copy the output below and paste it into your Wiki page."), HTML::br());
$message->pushContent($this->_process($userfile_tmpname));
}
} else {
$message->pushContent(HTML::br(), HTML::br());
}
$result = HTML();
$result->pushContent($form);
$result->pushContent($message);
return $result;
}
示例3: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
extract($args);
$maincat = $dbi->getPage(_("CategoryCategory"));
$bi = $maincat->getBackLinks(false);
$bl = array();
while ($b = $bi->next()) {
$name = $b->getName();
if (preg_match("/^" . _("Template") . "/", $name)) {
continue;
}
$pages = $b->getBackLinks(false);
$bl[] = array('name' => $name, 'count' => $pages->count());
}
usort($bl, 'cmp_by_count');
$html = HTML::ul();
$i = 0;
foreach ($bl as $b) {
$i++;
$name = $b['name'];
$count = $b['count'];
if ($count < $mincount) {
break;
}
if ($i > $limit) {
break;
}
$wo = preg_replace("/^(" . _("Category") . "|" . _("Topic") . ")/", "", $name);
$wo = HTML(HTML::span($wo), HTML::raw(" "), HTML::small("(" . $count . ")"));
$link = WikiLink($name, 'auto', $wo);
$html->pushContent(HTML::li($link));
}
return $html;
}
示例4: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
// works regardless of WIKIDB_NOCACHE_MARKUP
// if WIKIDB_NOCACHE_MARKUP is false it doesn't hurt
$request->setArg('nocache', $args['nocache']);
return HTML::raw('');
}
示例5: run
function run($dbi, $argstr, &$request, $basepage)
{
extract($this->getArgs($argstr, $request));
if ($format == 'date') {
$format = '%Y-%m-%d';
}
if ($format == 'time') {
$format = '%T';
}
return HTML::raw(strftime($format, time()));
}
示例6: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
if (empty($this->source)) {
return HTML::div(array('class' => "error"), "Please provide a formula to AsciiMath plugin");
}
if (phpversion() >= '5') {
include "lib/ASCIIMathPHP/ASCIIMathPHP-2.0.cfg.php";
} else {
include "lib/ASCIIMathPHP/ASCIIMathPHP.cfg.php";
}
$ascii_math = new ASCIIMathPHP($symbol_arr, $this->source);
$ascii_math->genMathML();
return HTML::raw($ascii_math->getMathML());
}
示例7: showForm
function showForm(&$dbi, &$request, $args)
{
global $WikiTheme;
$action = $request->getPostURL();
$hiddenfield = HiddenInputs($request->getArgs(), '', array('action', 'page', 's', 'semsearch', 'relation', 'attribute'));
$pagefilter = HTML::input(array('name' => 'page', 'value' => $args['page'], 'title' => _("Search only in these pages. With autocompletion."), 'class' => 'dropdown', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'false', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'), '');
$allrelations = $dbi->listRelations(false, false, true);
$svalues = empty($allrelations) ? "" : join("','", $allrelations);
$reldef = JavaScript("var semsearch_relations = new Array('" . $svalues . "')");
$relation = HTML::input(array('name' => 'relation', 'value' => $args['relation'], 'title' => _("Filter by this relation. With autocompletion."), 'class' => 'dropdown', 'style' => 'width:10em', 'acdropdown' => 'true', 'autocomplete_assoc' => 'false', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'true', 'autocomplete_list' => 'array:semsearch_relations'), '');
$queryrel = HTML::input(array('name' => 's', 'value' => $args['s'], 'title' => _("Filter by this link. These are pagenames. With autocompletion."), 'class' => 'dropdown', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'true', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'), '');
$relsubmit = Button('submit:semsearch[relations]', _("Relations"), false);
// just testing some dhtml... not yet done
$enhancements = HTML();
$nbsp = HTML::raw(' ');
$this_uri = $_SERVER['REQUEST_URI'] . '#';
$andbutton = new Button(_("AND"), $this_uri, 'wikiaction', array('onclick' => "addquery('rel', 'and')", 'title' => _("Add an AND query")));
$orbutton = new Button(_("OR"), $this_uri, 'wikiaction', array('onclick' => "addquery('rel', 'or')", 'title' => _("Add an OR query")));
if (DEBUG) {
$enhancements = HTML::span($andbutton, $nbsp, $orbutton);
}
$instructions = _("Search in pages for a relation with that value (a pagename).");
$form1 = HTML::form(array('action' => $action, 'method' => 'post', 'accept-charset' => $GLOBALS['charset']), $reldef, $hiddenfield, HiddenInputs(array('attribute' => '')), $instructions, HTML::br(), HTML::table(array('border' => 0, 'cellspacing' => 2), HTML::colgroup(array('span' => 6)), HTML::thead(HTML::tr(HTML::th('Pagefilter'), HTML::th('Relation'), HTML::th(), HTML::th('Links'), HTML::th())), HTML::tbody(HTML::tr(HTML::td($pagefilter, ": "), HTML::td($relation), HTML::td(HTML::strong(HTML::tt(' :: '))), HTML::td($queryrel), HTML::td($nbsp, $relsubmit, $nbsp, $enhancements)))));
$allattrs = $dbi->listRelations(false, true, true);
if (empty($allrelations) and empty($allattrs)) {
// be nice to the dummy.
$this->_norelations_warning = 1;
}
$svalues = empty($allattrs) ? "" : join("','", $allattrs);
$attdef = JavaScript("var semsearch_attributes = new Array('" . $svalues . "')\n" . "var semsearch_op = new Array('" . join("','", $this->_supported_operators) . "')");
// TODO: We want some more tricks: Autofill the base unit of the selected
// attribute into the s area.
$attribute = HTML::input(array('name' => 'attribute', 'value' => $args['attribute'], 'title' => _("Filter by this attribute name. With autocompletion."), 'class' => 'dropdown', 'style' => 'width:10em', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'true', 'autocomplete_assoc' => 'false', 'autocomplete_list' => 'array:semsearch_attributes'), '');
$attr_op = HTML::input(array('name' => 'attr_op', 'value' => $args['attr_op'], 'title' => _("Comparison operator. With autocompletion."), 'class' => 'dropdown', 'style' => 'width:2em', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'true', 'autocomplete_assoc' => 'false', 'autocomplete_list' => 'array:semsearch_op'), '');
$queryatt = HTML::input(array('name' => 's', 'value' => $args['s'], 'title' => _("Filter by this numeric attribute value. With autocompletion."), 'class' => 'dropdown', 'acdropdown' => 'false', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'false', 'autocomplete_assoc' => 'false', 'autocomplete_list' => 'plugin:SemanticSearch page=' . $args['page'] . ' attribute=^[S] attr_op==~'), '');
$andbutton = new Button(_("AND"), $this_uri, 'wikiaction', array('onclick' => "addquery('attr', 'and')", 'title' => _("Add an AND query")));
$orbutton = new Button(_("OR"), $this_uri, 'wikiaction', array('onclick' => "addquery('attr', 'or')", 'title' => _("Add an OR query")));
if (DEBUG) {
$enhancements = HTML::span($andbutton, $nbsp, $orbutton);
}
$attsubmit = Button('submit:semsearch[attributes]', _("Attributes"), false);
$instructions = HTML::span(_("Search in pages for an attribute with that numeric value."), "\n");
if (DEBUG) {
$instructions->pushContent(HTML(" ", new Button(_("Advanced..."), _("SemanticSearchAdvanced"))));
}
$form2 = HTML::form(array('action' => $action, 'method' => 'post', 'accept-charset' => $GLOBALS['charset']), $attdef, $hiddenfield, HiddenInputs(array('relation' => '')), $instructions, HTML::br(), HTML::table(array('border' => 0, 'cellspacing' => 2), HTML::colgroup(array('span' => 6)), HTML::thead(HTML::tr(HTML::th('Pagefilter'), HTML::th('Attribute'), HTML::th('Op'), HTML::th('Value'), HTML::th())), HTML::tbody(HTML::tr(HTML::td($pagefilter, ": "), HTML::td($attribute), HTML::td($attr_op), HTML::td($queryatt), HTML::td($nbsp, $attsubmit, $nbsp, $enhancements)))));
return HTML($form1, $form2);
}
示例8: showForm
function showForm(&$dbi, &$request, $args)
{
$action = $request->getPostURL();
$hiddenfield = HiddenInputs($request->getArgs(), '', array('action', 'page', 's', 'direction'));
$pagefilter = HTML::input(array('name' => 'page', 'value' => $args['page'], 'title' => _("Search only in these pages. With autocompletion."), 'class' => 'dropdown', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'false', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'), '');
$query = HTML::input(array('name' => 's', 'value' => $args['s'], 'title' => _("Filter by this link. These are pagenames. With autocompletion."), 'class' => 'dropdown', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'true', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'), '');
$dirsign_switch = JavaScript("\nfunction dirsign_switch() {\n var d = document.getElementById('dirsign')\n d.innerHTML = (d.innerHTML == ' => ') ? ' <= ' : ' => '\n}\n");
$dirsign = " => ";
$in = $out = array('name' => 'direction', 'type' => 'radio', 'onChange' => 'dirsign_switch()');
$out['value'] = 'out';
$out['id'] = 'dir_out';
if ($args['direction'] == 'out') {
$out['checked'] = 'checked';
}
$in['value'] = 'in';
$in['id'] = 'dir_in';
if ($args['direction'] == 'in') {
$in['checked'] = 'checked';
$dirsign = " <= ";
}
$direction = HTML(HTML::input($out), HTML::label(array('for' => 'dir_out'), _("outgoing")), HTML::input($in), HTML::label(array('for' => 'dir_in'), _("incoming")));
/*
$direction = HTML::select(array('name'=>'direction',
'onChange' => 'dirsign_switch()'));
$out = array('value' => 'out');
if ($args['direction']=='out') $out['selected'] = 'selected';
$in = array('value' => 'in');
if ($args['direction']=='in') {
$in['selected'] = 'selected';
$dirsign = " <= ";
}
$direction->pushContent(HTML::option($out, _("outgoing")));
$direction->pushContent(HTML::option($in, _("incoming")));
*/
$submit = Button('submit:search', _("LinkSearch"), false);
$instructions = _("Search in pages for links with the matching name.");
$form = HTML::form(array('action' => $action, 'method' => 'GET', 'accept-charset' => $GLOBALS['charset']), $dirsign_switch, $hiddenfield, $instructions, HTML::br(), $pagefilter, HTML::strong(HTML::tt(array('id' => 'dirsign'), $dirsign)), $query, HTML::raw(' '), $direction, HTML::raw(' '), $submit);
return $form;
}
示例9: run
function run($dbi, $argstr, &$request, $basepage)
{
if (!isset($_SERVER)) {
$_SERVER =& $GLOBALS['HTTP_SERVER_VARS'];
}
$request->setArg('nocache', 'purge');
$args = $this->getArgs($argstr, $request);
if (!$args['page']) {
return $this->error("No page specified");
}
if (!empty($args['admin']) and $request->_user->isAdmin()) {
// reset statistics
return $this->doPollAdmin($dbi, $request, $page);
}
extract($this->_args);
$page = $dbi->getPage($args['page']);
// check ip and last visit
$poll = $page->get("poll");
$ip = $_SERVER['REMOTE_ADDR'];
$disable_submit = false;
if (isset($poll['ip'][$ip]) and time() - $poll['ip'][$ip] < 20 * 60) {
//view at least the result or disable the Go button
$html = HTML(HTML::strong(_("Sorry! You must wait at least 20 minutes until you can vote again!")));
$html->pushContent($this->doPoll($page, $request, $request->getArg('answer'), true));
return $html;
}
$poll['ip'][$ip] = time();
// purge older ip's
foreach ($poll['ip'] as $ip => $time) {
if (time() - $time > 21 * 60) {
unset($poll['ip'][$ip]);
}
}
$html = HTML::form(array('action' => $request->getPostURL(), 'method' => 'post'));
if ($request->isPost()) {
// checkme: check if all answers are answered
if ($request->getArg('answer') and ($args['require_all'] and count($request->getArg('answer')) == count($question) or $args['require_least'] and count($request->getArg('answer')) >= $args['require_least'])) {
$page->set("poll", $poll);
// update statistics and present them the user
return $this->doPoll($page, $request, $request->getArg('answer'));
} else {
$html->pushContent(HTML::p(HTML::strong(_("Not enough questions answered!"))));
}
}
$init = isset($question[0]) ? 0 : 1;
for ($i = $init; $i <= count($question); $i++) {
if (!isset($question[$i])) {
break;
}
$q = $question[$i];
if (!isset($answer[$i])) {
trigger_error(fmt("Missing %s for %s", "answer" . "[{$i}]", "question" . "[{$i}]"), E_USER_ERROR);
}
$a = $answer[$i];
if (!is_array($a)) {
// a simple checkbox
$html->pushContent(HTML::p(HTML::strong($q)));
$html->pushContent(HTML::div(HTML::input(array('type' => 'checkbox', 'name' => "answer[{$i}]", 'value' => 1)), HTML::raw(" "), $a));
} else {
$row = HTML();
for ($j = 0; $j <= count($a); $j++) {
if (isset($a[$j])) {
$row->pushContent(HTML::div(HTML::input(array('type' => 'radio', 'name' => "answer[{$i}]", 'value' => $j)), HTML::raw(" "), $a[$j]));
}
}
$html->pushContent(HTML::p(HTML::strong($q)), $row);
}
}
if (!$disable_submit) {
$html->pushContent(HTML::p(HTML::input(array('type' => 'submit', 'name' => "WikiPoll", 'value' => _("OK"))), HTML::input(array('type' => 'reset', 'name' => "reset", 'value' => _("Reset")))));
} else {
$html->pushContent(HTML::p(), HTML::strong(_("Sorry! You must wait at least 20 minutes until you can vote again!")));
}
return $html;
}
示例10: run
function run($dbi, $argstr, &$request, $basepage)
{
extract($this->getArgs($argstr, $request));
$source =& $this->source;
if (empty($syntax)) {
return $this->error(_("Syntax language not specified."));
}
if (!empty($source)) {
$args = "";
if (defined('HIGHLIGHT_DATA_DIR')) {
$args .= " --data-dir " . HIGHLIGHT_DATA_DIR;
}
if ($number != 0) {
$args .= " -l";
}
if ($wrap != 0) {
$args .= " -V";
}
$html = HTML();
if (!empty($color) and !preg_match('/^[\\w-]+$/', $color)) {
$html->pushContent($this->error(fmt("invalid %s ignored", 'color')));
$color = false;
}
if (!empty($color)) {
$args .= " --style {$color} -c " . FindFile("uploads") . "/highlight-{$color}.css";
}
if (!empty($style)) {
$args .= " -F {$style}";
}
$commandLine = HIGHLIGHT_EXE . "{$args} -q -X -f -S {$syntax}";
if (check_php_version(4, 3, 0)) {
$code = $this->newFilterThroughCmd($source, $commandLine);
} else {
$code = $this->oldFilterThroughCmd($source, $commandLine);
}
if (empty($code)) {
return $this->error(fmt("Couldn't start commandline '%s'", $commandLine));
}
$pre = HTML::pre(HTML::raw($code));
$pre->setAttr('class', 'tightenable top bottom');
$html->pushContent($pre);
$css = $GLOBALS['WikiTheme']->_CSSlink('', empty($color) ? 'highlight.css' : "uploads/highlight-{$color}.css", '');
return HTML($css, $html);
} else {
return $this->error(fmt("empty source"));
}
}
示例11: run
function run($dbi, $argstr, &$request, $basepage)
{
$this->_args = $this->getArgs($argstr, $request);
extract($this->_args);
//trigger_error("1 p= $page a= $author");
if ($page && $page == 'username') {
//FIXME: use [username]!!!!!
$page = $author;
}
//trigger_error("2 p= $page a= $author");
if (!$page || !$author) {
//user not signed in or no author specified
return '';
}
//$pagelist = new PageList($info, $exclude);
///////////////////////////
$nbsp = HTML::raw(' ');
global $WikiTheme;
// date & time formatting
if (!($page == 'all')) {
$p = $dbi->getPage($page);
$t = HTML::table(array('class' => 'pagelist', 'style' => 'font-size:smaller'));
$th = HTML::thead();
$tb = HTML::tbody();
$th->pushContent(HTML::tr(HTML::td(array('align' => 'right'), _("Version")), $includeminor ? HTML::td(_("Minor")) : "", HTML::td(_("Author")), HTML::td(_("Summary")), HTML::td(_("Modified"))));
$allrevisions_iter = $p->getAllRevisions();
while ($rev = $allrevisions_iter->next()) {
$isminor = $rev->get('is_minor_edit');
$authordoesmatch = $author == $rev->get('author');
if ($authordoesmatch && (!$isminor || $includeminor && $isminor)) {
$difflink = Button(array('action' => 'diff', 'previous' => 'minor'), $rev->getversion(), $rev);
$tr = HTML::tr(HTML::td(array('align' => 'right'), $difflink, $nbsp), $includeminor ? HTML::td($nbsp, $isminor ? "minor" : "major", $nbsp) : "", HTML::td($nbsp, WikiLink($rev->get('author'), 'if_known'), $nbsp), HTML::td($nbsp, $rev->get('summary')), HTML::td(array('align' => 'right'), $WikiTheme->formatdatetime($rev->get('mtime'))));
$class = $isminor ? 'evenrow' : 'oddrow';
$tr->setAttr('class', $class);
$tb->pushContent($tr);
//$pagelist->addPage($rev->getPage());
}
}
$captext = fmt($includeminor ? "History of all major and minor edits by %s to page %s." : "History of all major edits by %s to page %s.", WikiLink($author, 'auto'), WikiLink($page, 'auto'));
$t->pushContent(HTML::caption($captext));
$t->pushContent($th, $tb);
} else {
//search all pages for all edits by this author
/////////////////////////////////////////////////////////////
$t = HTML::table(array('class' => 'pagelist', 'style' => 'font-size:smaller'));
$th = HTML::thead();
$tb = HTML::tbody();
$th->pushContent(HTML::tr(HTML::td(_("Page Name")), HTML::td(array('align' => 'right'), _("Version")), $includeminor ? HTML::td(_("Minor")) : "", HTML::td(_("Summary")), HTML::td(_("Modified"))));
/////////////////////////////////////////////////////////////
$allpages_iter = $dbi->getAllPages($includedeleted);
while ($p = $allpages_iter->next()) {
/////////////////////////////////////////////////////////////
$allrevisions_iter = $p->getAllRevisions();
while ($rev = $allrevisions_iter->next()) {
$isminor = $rev->get('is_minor_edit');
$authordoesmatch = $author == $rev->get('author');
if ($authordoesmatch && (!$isminor || $includeminor && $isminor)) {
$difflink = Button(array('action' => 'diff', 'previous' => 'minor'), $rev->getversion(), $rev);
$tr = HTML::tr(HTML::td($nbsp, $isminor ? $rev->_pagename : WikiLink($rev->_pagename, 'auto')), HTML::td(array('align' => 'right'), $difflink, $nbsp), $includeminor ? HTML::td($nbsp, $isminor ? "minor" : "major", $nbsp) : "", HTML::td($nbsp, $rev->get('summary')), HTML::td(array('align' => 'right'), $WikiTheme->formatdatetime($rev->get('mtime')), $nbsp));
$class = $isminor ? 'evenrow' : 'oddrow';
$tr->setAttr('class', $class);
$tb->pushContent($tr);
//$pagelist->addPage($rev->getPage());
}
}
/////////////////////////////////////////////////////////////
}
$captext = fmt($includeminor ? "History of all major and minor modifications for any page edited by %s." : "History of major modifications for any page edited by %s.", WikiLink($author, 'auto'));
$t->pushContent(HTML::caption($captext));
$t->pushContent($th, $tb);
}
// if (!$noheader) {
// total minor, major edits. if include minoredits was specified
// }
return $t;
// if (!$noheader) {
// $pagelink = WikiLink($page, 'auto');
//
// if ($pagelist->isEmpty())
// return HTML::p(fmt("No pages link to %s.", $pagelink));
//
// if ($pagelist->getTotal() == 1)
// $pagelist->setCaption(fmt("One page links to %s:",
// $pagelink));
// else
// $pagelist->setCaption(fmt("%s pages link to %s:",
// $pagelist->getTotal(), $pagelink));
// }
//
// return $pagelist;
}
示例12:
* is not set, any signature defined in index.php will be used. If it
* is not defined by index.php or in here then the "Thank you for
* editing..." screen will be omitted.
*/
// Comment this next line out to enable signature.
$WikiTheme->addImageAlias('signature', false);
/*
* Link icons.
*/
$WikiTheme->setLinkIcon('http');
$WikiTheme->setLinkIcon('https');
$WikiTheme->setLinkIcon('ftp');
$WikiTheme->setLinkIcon('mailto');
$WikiTheme->setLinkIcon('interwiki');
$WikiTheme->setLinkIcon('*', 'url');
$WikiTheme->setButtonSeparator(HTML::raw(" | "));
/**
* WikiWords can automatically be split by inserting spaces between
* the words. The default is to leave WordsSmashedTogetherLikeSo.
*/
$WikiTheme->setAutosplitWikiWords(false);
/*
* You may adjust the formats used for formatting dates and times
* below. (These examples give the default formats.)
* Formats are given as format strings to PHP strftime() function See
* http://www.php.net/manual/en/function.strftime.php for details.
* Do not include the server's zone (%Z), times are converted to the
* user's time zone.
*/
//$WikiTheme->setDateFormat("%B %d, %Y");
//$WikiTheme->setTimeFormat("%I:%M %p");
示例13: run
function run($dbi, $argstr, &$request, $basepage)
{
include_once "lib/BlockParser.php";
// MediawikiTablePlugin markup is new.
$markup = 2.0;
// We allow the compact Mediawiki syntax with:
// - multiple cells on the same line (separated by "||"),
// - multiple header cells on the same line (separated by "!!").
$argstr = str_replace("||", "\n| ", $argstr);
$argstr = str_replace("!!", "\n! ", $argstr);
$lines = preg_split('/\\n/', $argstr);
$table = HTML::table();
// We always generate an Id for the table.
// This is convenient for tables of class "sortable".
// If user provides an Id, the generated Id will be overwritten below.
$table->setAttr("id", GenerateId("MediawikiTable"));
if (substr($lines[0], 0, 2) == "{|") {
// Start of table
$lines[0] = substr($lines[0], 2);
}
if ($lines[0][0] != '|' and $lines[0][0] != '!') {
$line = array_shift($lines);
$attrs = parse_attributes($line);
foreach ($attrs as $key => $value) {
if (in_array($key, array("id", "class", "title", "style", "bgcolor", "frame", "rules", "border", "cellspacing", "cellpadding", "summary", "align", "width"))) {
$table->setAttr($key, $value);
}
}
}
if (count($lines) == 1) {
// empty table, we only have closing "|}" line
return HTML::raw('');
}
foreach ($lines as $line) {
if (substr($line, 0, 2) == "|}") {
// End of table
continue;
}
if (substr($line, 0, 2) == "|-") {
if (isset($row)) {
if (isset($cell)) {
if (isset($content)) {
if (is_numeric(trim($content))) {
$cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content)));
} else {
$cell->pushContent(TransformText(trim($content), $markup, $basepage));
}
unset($content);
}
$row->pushContent($cell);
unset($cell);
}
if (isset($thead)) {
$thead->pushContent($row);
$table->pushContent($thead);
unset($thead);
$tbody = HTML::tbody();
} else {
$tbody->pushContent($row);
}
}
$row = HTML::tr();
$attrs = parse_attributes(substr($line, 2));
foreach ($attrs as $key => $value) {
if (in_array($key, array("id", "class", "title", "style", "bgcolor", "align", "valign"))) {
$row->setAttr($key, $value);
}
}
continue;
}
// Table summary
if (substr($line, 0, 2) == "|=") {
$line = substr($line, 2);
$table->setAttr("summary", trim($line));
}
// Table caption
if (substr($line, 0, 2) == "|+") {
$caption = HTML::caption();
$line = substr($line, 2);
$pospipe = strpos($line, "|");
$posbracket = strpos($line, "[");
if ($pospipe !== false && ($posbracket === false || $posbracket > $pospipe)) {
$attrs = parse_attributes(substr($line, 0, $pospipe));
foreach ($attrs as $key => $value) {
if (in_array($key, array("id", "class", "title", "style", "align", "lang"))) {
$caption->setAttr($key, $value);
}
}
$line = substr($line, $pospipe + 1);
}
$caption->pushContent(trim($line));
$table->pushContent($caption);
}
if ((substr($line, 0, 1) == "|" or substr($line, 0, 1) == "!") and isset($row)) {
if (isset($cell)) {
if (isset($content)) {
if (is_numeric(trim($content))) {
$cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content)));
} else {
$cell->pushContent(TransformText(trim($content), $markup, $basepage));
//.........这里部分代码省略.........
示例14: chmodForm
function chmodForm(&$header, $post_args)
{
$header->pushContent(HTML::p(HTML::em(_("This plugin is currently under development and does not work!"))));
$header->pushContent(_("Chmod to permission:"));
$header->pushContent(HTML::input(array('name' => 'admin_chmod[perm]', 'value' => $post_args['perm'])));
$header->pushContent(' ' . _("(ugo : rwx)"));
$header->pushContent(HTML::p());
$checkbox = HTML::input(array('type' => 'checkbox', 'name' => 'admin_chmod[updatechildren]', 'value' => 1));
if (!empty($post_args['updatechildren'])) {
$checkbox->setAttr('checked', 'checked');
}
$header->pushContent($checkbox, HTML::raw(" "), _("Propagate new permissions to all subpages?"), HTML::raw(" "), HTML::em(_("(disable individual page permissions, enable inheritance)?")));
$header->pushContent(HTML::hr(), HTML::p());
return $header;
}
示例15: _lines
function _lines($lines, $class, $prefix = false, $elem = false)
{
if (!$prefix) {
$prefix = HTML::raw(' ');
}
$prefix = HTML::td(array('class' => 'prefix', 'width' => "1%"), $prefix);
foreach ($lines as $line) {
if (!trim($line)) {
$line = HTML::raw(' ');
} elseif ($elem) {
$line = new HtmlElement($elem, $line);
}
$this->_block->pushContent(HTML::tr(array('valign' => 'top'), $prefix, HTML::td(array('class' => $class), $line)));
}
}