当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML::td方法代码示例

本文整理汇总了PHP中HTML::td方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::td方法的具体用法?PHP HTML::td怎么用?PHP HTML::td使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML的用法示例。


在下文中一共展示了HTML::td方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showForm

 function showForm(&$dbi, &$request, $args, $allrelations)
 {
     global $WikiTheme;
     $action = $request->getPostURL();
     $hiddenfield = HiddenInputs($request->getArgs(), '', array('action', 'page', 's'));
     $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'), '');
     $help = Button('submit:semsearch[help]', "?", false);
     $svalues = empty($allrelations) ? "" : join("','", $allrelations);
     $reldef = JavaScript("var semsearch_relations = new Array('" . $svalues . "')");
     $querybox = HTML::textarea(array('name' => 's', 'title' => _("Enter a valid query expression"), 'rows' => 4, 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_assoc' => 'false', 'autocomplete_matchsubstring' => 'true', 'autocomplete_list' => 'array:semsearch_relations'), $args['s']);
     $submit = Button('submit:semsearch[relations]', _("Search"), false, array('title' => 'Move to help page. No seperate window'));
     $instructions = _("Search in all specified pages for the expression.");
     $form = HTML::form(array('action' => $action, 'method' => 'post', 'accept-charset' => $GLOBALS['charset']), $reldef, $hiddenfield, HiddenInputs(array('attribute' => '')), $instructions, HTML::br(), HTML::table(array('border' => '0', 'width' => '100%'), HTML::tr(HTML::td(_("Pagename(s): "), $pagefilter), HTML::td(array('align' => 'right'), $help)), HTML::tr(HTML::td(array('colspan' => 2), $querybox))), HTML::br(), HTML::div(array('align' => 'center'), $submit));
     return $form;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:15,代码来源:SemanticSearchAdvanced.php

示例2: PageInfoRow

 function PageInfoRow($label, $rev, &$request)
 {
     global $WikiTheme, $WikiNameRegexp;
     $row = HTML::tr(HTML::td(array('align' => 'right'), $label));
     if ($rev) {
         $author = $rev->get('author');
         $dbi = $request->getDbh();
         $iswikipage = isWikiWord($author) && $dbi->isWikiPage($author);
         $authorlink = $iswikipage ? WikiLink($author) : $author;
         $linked_version = WikiLink($rev, 'existing', $rev->getVersion());
         $row->pushContent(HTML::td(fmt("version %s", $linked_version)), HTML::td($WikiTheme->getLastModifiedMessage($rev, false)), HTML::td(fmt("by %s", $authorlink)));
     } else {
         $row->pushContent(HTML::td(array('colspan' => '3'), _("None")));
     }
     return $row;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:16,代码来源:Diff.php

示例3: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     if (!ACCESS_LOG) {
         return;
     }
     $args = $this->getArgs($argstr, $request);
     $table = HTML::table(array('cellpadding' => 1, 'cellspacing' => 2, 'border' => 0, 'class' => 'pagelist'));
     if (!$args['noheader'] and !empty($args['caption'])) {
         $table->pushContent(HTML::caption(array('align' => 'top'), $args['caption']));
     }
     $logs = array();
     $limit = $args['limit'];
     $accesslog =& $request->_accesslog;
     if ($logiter = $accesslog->get_referer($limit, "external_only") and $logiter->count()) {
         $table->pushContent(HTML::tr(HTML::th("Target"), HTML::th("Referrer"), HTML::th("Host"), HTML::th("Date")));
         while ($logentry = $logiter->next()) {
             $table->pushContent(HTML::tr(HTML::td($logentry['request']), HTML::td($logentry['referer']), HTML::td($logentry['host']), HTML::td($logentry['time'])));
         }
         return $table;
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:21,代码来源:RecentReferrers.php

示例4: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     $args = $this->getArgs($argstr, $request);
     extract($args);
     include_once "lib/imdb.php";
     $imdb = new imdb();
     if (method_exists($imdb, $query)) {
         $SqlResult = $imdb->{$query}($title ? $title : $name);
     } else {
         $SqlResult = array();
     }
     // if ($limit) ; // TODO: fill paging vars (see PageList)
     if ($ordered) {
         $html = HTML::ol(array('class' => 'sqlresult'));
         foreach ($SqlResult as $row) {
             $html->pushContent(HTML::li(array('class' => $i++ % 2 ? 'evenrow' : 'oddrow'), $row[0]));
         }
     } else {
         $html = HTML::table(array('class' => 'sqlresult'));
         $i = 0;
         foreach ($SqlResult as $row) {
             $tr = HTML::tr(array('class' => $i++ % 2 ? 'evenrow' : 'oddrow'));
             foreach ($row as $col) {
                 $tr->pushContent(HTML::td($col));
             }
             $html->pushContent($tr);
         }
     }
     // if ($limit) ; // do paging via pagelink template
     return $html;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:31,代码来源:Imdb.php

示例5: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     global $WikiTheme;
     include_once 'lib/InlineParser.php';
     $table = array();
     $lines = preg_split('/\\s*?\\n\\s*/', $argstr);
     foreach ($lines as $line) {
         if (!$line) {
             continue;
         }
         $line = trim($line);
         // If line ends with a '|', remove it
         if ($line[strlen($line) - 1] == '|') {
             $line = substr($line, 0, -1);
         }
         if ($line[0] != '|') {
             // trigger_error(sprintf(_("Line %s does not begin with a '|'."), $line), E_USER_WARNING);
         } else {
             $table[] = $this->_parse_row($line, $basepage);
         }
     }
     $nbrows = sizeof($table);
     // If table is empty, do not generate table markup
     if ($nbrows == 0) {
         return HTML::raw('');
     }
     $nbcols = sizeof($table[0]);
     for ($i = 0; $i < $nbrows; $i++) {
         for ($j = 0; $j < $nbcols; $j++) {
             if (preg_match('/@@/', $table[$i][$j])) {
                 $table[$i][$j] = compute_tablecell($table, $i, $j, $nbrows, $nbcols);
             }
         }
     }
     $htmltable = HTML::table(array('class' => "bordered"));
     foreach ($table as $row) {
         $htmlrow = HTML::tr();
         foreach ($row as $cell) {
             if ($cell && $cell[0] == '=') {
                 $cell = trim(substr($cell, 1));
                 $htmlrow->pushContent(HTML::th(TransformInline($cell, 2.0, $basepage)));
             } else {
                 if (is_numeric($cell)) {
                     $htmlrow->pushContent(HTML::td(array('style' => "text-align:right"), $cell));
                 } else {
                     $htmlrow->pushContent(HTML::td(TransformInline($cell, 2.0, $basepage)));
                 }
             }
         }
         $htmltable->pushContent($htmlrow);
     }
     return $htmltable;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:53,代码来源:WikicreoleTable.php

示例6: run


//.........这里部分代码省略.........
             $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));
                     }
                     unset($content);
                 }
                 $row->pushContent($cell);
             }
             if (substr($line, 0, 1) == "!") {
                 $cell = HTML::th();
                 // Header
                 $thead = HTML::thead();
             } else {
                 $cell = HTML::td();
                 if (!isset($tbody)) {
                     $tbody = HTML::tbody();
                 }
             }
             $line = substr($line, 1);
             // If there is a "|" in the line, the start of line
             // (before the "|") is made of attributes.
             // The end of the line (after the "|") is the cell content
             // This is not true if the pipe is inside [], {{}} or {{{}}}
             // | [foo|bar]
             // The following cases must work:
             // | foo
             // | [foo|bar]
             // | class="xxx" | foo
             // | class="xxx" | [foo|bar]
             // | {{tmpl|arg=val}}
             // | {{image.png|alt}}
             // | {{{ xxx | yyy }}}
             $pospipe = strpos($line, "|");
             $posbracket = strpos($line, "[");
             $poscurly = strpos($line, "{");
             if ($pospipe !== false && ($posbracket === false || $posbracket > $pospipe) && ($poscurly === false || $poscurly > $pospipe)) {
                 $attrs = parse_attributes(substr($line, 0, $pospipe));
                 foreach ($attrs as $key => $value) {
                     if (in_array($key, array("id", "class", "title", "style", "colspan", "rowspan", "width", "height", "bgcolor", "align", "valign"))) {
                         $cell->setAttr($key, $value);
                     }
                 }
                 $line = substr($line, $pospipe + 1);
                 if (is_numeric(trim($line))) {
                     $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($line)));
                 } else {
                     $cell->pushContent(TransformText(trim($line), $markup, $basepage));
                 }
                 continue;
             }
         }
         if (isset($row) and isset($cell)) {
             $line = str_replace("?\\>", "?>", $line);
             $line = str_replace("\\~", "~", $line);
             if (empty($content)) {
                 $content = '';
             }
             $content .= $line . "\n";
         }
     }
     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));
                 }
             }
             $row->pushContent($cell);
         }
         $tbody->pushContent($row);
         $table->pushContent($tbody);
     }
     return $table;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:101,代码来源:MediawikiTable.php

示例7: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     /* ignore fatal on loading */
     /*
     global $ErrorManager;
     $ErrorManager->pushErrorHandler(new WikiMethodCb($this,'_error_handler'));
     */
     // Require the XML_FOAF_Parser class. This is a pear library not included with phpwiki.
     // see doc/README.foaf
     if (findFile('XML/FOAF/Parser.php', 'missing_ok')) {
         require_once 'XML/FOAF/Parser.php';
     }
     //$ErrorManager->popErrorHandler();
     if (!class_exists('XML_FOAF_Parser')) {
         return $this->error(_("required pear library XML/FOAF/Parser.php not found in include_path"));
     }
     extract($this->getArgs($argstr, $request));
     // Get our FOAF File from the foaf plugin argument or $_GET['foaf']
     if (empty($foaf)) {
         $foaf = $request->getArg('foaf');
     }
     $chooser = HTML::form(array('method' => 'get', 'action' => $request->getURLtoSelf()), HTML::h4(_("FOAF File URI")), HTML::input(array('id' => 'foaf', 'name' => 'foaf', 'type' => 'text', 'size' => '80', 'value' => $foaf)), HTML::br(), HTML::input(array('id' => 'pretty', 'name' => 'pretty', 'type' => 'radio', 'checked' => 'checked'), _("Pretty HTML")), HTML::input(array('id' => 'original', 'name' => 'original', 'type' => 'radio'), _("Original URL (Redirect)")), HTML::br(), HTML::input(array('type' => 'submit', 'value' => _("Parse FOAF"))));
     if (empty($foaf)) {
         return $chooser;
     } else {
         //Error Checking
         if (substr($foaf, 0, 7) != "http://") {
             return $this->error(_("foaf must be a URI starting with http://"));
         }
         // Start of output
         if (!empty($original)) {
             $request->redirect($foaf);
         } else {
             $foaffile = url_get_contents($foaf);
             if (!$foaffile) {
                 //TODO: get errormsg
                 return HTML(HTML::p("Resource isn't available: Something went wrong, probably a 404!"));
             }
             // Create new Parser object
             $parser = new XML_FOAF_Parser();
             // Parser FOAF into $foaffile
             $parser->parseFromMem($foaffile);
             $a = $parser->toArray();
             $html = HTML(HTML::h1(@$a[0]["name"]), HTML::table(HTML::thead(), HTML::tbody(@$a[0]["title"] ? HTML::tr(HTML::td(_("Title")), HTML::td($a[0]["title"])) : null, @$a[0]["homepage"][0] ? $this->iterateHTML($a[0], "homepage", $a["dc"]) : null, @$a[0]["weblog"][0] ? $this->iterateHTML($a[0], "weblog", $a["dc"]) : null, HTML::tr(HTML::td("Full Name"), @$a[0]["name"][0] ? HTML::td(@$a[0]["name"]) : null), @$a[0]["nick"][0] ? $this->iterateHTML($a[0], "nick", $a["dc"]) : null, @$a[0]["mboxsha1sum"][0] ? $this->iterateHTML($a[0], "mboxsha1sum", $a["dc"]) : null, @$a[0]["depiction"][0] ? $this->iterateHTML($a[0], "depiction", $a["dc"]) : null, @$a[0]["seealso"][0] ? $this->iterateHTML($a[0], "seealso", $a["dc"]) : null, HTML::tr(HTML::td("Source"), HTML::td(HTML::a(array('href' => @$foaf), "RDF"))))));
             if (DEBUG) {
                 $html->pushContent(HTML::hr(), $chooser);
             }
             return $html;
         }
     }
 }
开发者ID:neymanna,项目名称:fusionforge,代码行数:51,代码来源:FoafViewer.php

示例8: _generateTableBody

 function _generateTableBody(&$info, &$dbi, &$request, &$table)
 {
     $plugin_dir = 'lib/plugin';
     if (defined('PHPWIKI_DIR')) {
         $plugin_dir = PHPWIKI_DIR . "/{$plugin_dir}";
     }
     $pd = new fileSet($plugin_dir, '*.php');
     $plugins = $pd->getFiles();
     unset($pd);
     sort($plugins);
     // table body
     $tbody = HTML::tbody();
     $row_no = 0;
     $w = new WikiPluginLoader();
     foreach ($plugins as $pluginName) {
         // instantiate a plugin
         $pluginName = str_replace(".php", "", $pluginName);
         $temppluginclass = "<? plugin {$pluginName} ?>";
         // hackish
         $p = $w->getPlugin($pluginName, false);
         // second arg?
         // trap php files which aren't WikiPlugin~s
         if (!strtolower(substr(get_parent_class($p), 0, 10)) == 'wikiplugin') {
             // Security: Hide names of extraneous files within
             // plugin dir from non-admins.
             if ($request->_user->isAdmin()) {
                 trigger_error(sprintf(_("%s does not appear to be a WikiPlugin."), $pluginName . ".php"));
             }
             continue;
             // skip this non WikiPlugin file
         }
         $desc = $p->getDescription();
         $ver = $p->getVersion();
         $arguments = $p->getArgumentsDescription();
         unset($p);
         //done querying plugin object, release from memory
         // This section was largely improved by Pierrick Meignen:
         // make a link if an actionpage exists
         $pluginNamelink = $pluginName;
         $pluginDocPageName = $pluginName . "Plugin";
         $pluginDocPageNamelink = false;
         $localizedPluginName = '';
         $localizedPluginDocPageName = '';
         if ($GLOBALS['LANG'] != "en") {
             if (_($pluginName) != $pluginName) {
                 $localizedPluginName = _($pluginName);
             }
             if ($localizedPluginName && $dbi->isWikiPage($localizedPluginName)) {
                 $pluginDocPageNamelink = WikiLink($localizedPluginName, 'if_known');
             }
             if (_($pluginDocPageName) != $pluginDocPageName) {
                 $localizedPluginDocPageName = _($pluginDocPageName);
             }
             if ($localizedPluginDocPageName && $dbi->isWikiPage($localizedPluginDocPageName)) {
                 $pluginDocPageNamelink = WikiLink($localizedPluginDocPageName, 'if_known');
             }
         } else {
             $pluginNamelink = WikiLink($pluginName, 'if_known');
             if ($dbi->isWikiPage($pluginDocPageName)) {
                 $pluginDocPageNamelink = WikiLink($pluginDocPageName, 'if_known');
             }
         }
         // highlight alternate rows
         $row_no++;
         $group = (int) ($row_no / 1);
         //_group_rows
         $class = $group % 2 ? 'evenrow' : 'oddrow';
         // generate table row
         $tr = HTML::tr(array('class' => $class));
         if ($pluginDocPageNamelink) {
             // plugin has a description page 'PluginName' . 'Plugin'
             $tr->pushContent(HTML::td($pluginNamelink, HTML::br(), $pluginDocPageNamelink));
             $pluginDocPageNamelink = false;
         } else {
             // plugin just has an actionpage
             $tr->pushContent(HTML::td($pluginNamelink));
         }
         $tr->pushContent(HTML::td($ver), HTML::td($desc));
         if ($info == 'args') {
             // add Arguments column
             $style = array('style' => 'font-family:monospace;font-size:smaller');
             $tr->pushContent(HTML::td($style, $arguments));
         }
         $tbody->pushContent($tr);
     }
     $table->pushContent($tbody);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:87,代码来源:PluginManager.php

示例9: _lines

 function _lines($lines, $class, $prefix = false, $elem = false)
 {
     if (!$prefix) {
         $prefix = HTML::raw('&nbsp;');
     }
     $prefix = HTML::td(array('class' => 'prefix', 'width' => "1%"), $prefix);
     foreach ($lines as $line) {
         if (!trim($line)) {
             $line = HTML::raw('&nbsp;');
         } elseif ($elem) {
             $line = new HtmlElement($elem, $line);
         }
         $this->_block->pushContent(HTML::tr(array('valign' => 'top'), $prefix, HTML::td(array('class' => $class), $line)));
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:15,代码来源:Diff.php

示例10: _showhash

 function _showhash($heading, $hash, $prefix = '')
 {
     $rows = array();
     if ($heading) {
         $rows[] = HTML::tr(array('bgcolor' => '#ffcccc', 'style' => 'color:#000000'), HTML::td(array('colspan' => 2, 'style' => 'color:#000000'), $heading));
     }
     if (!is_array($hash)) {
         return array();
     }
     ksort($hash);
     foreach ($hash as $key => $val) {
         if ($this->chunk_split and is_string($val)) {
             $val = chunk_split($val);
         }
         $rows[] = HTML::tr(HTML::td(array('align' => 'right', 'bgcolor' => '#cccccc', 'style' => 'color:#000000'), HTML(HTML::raw('&nbsp;'), $key, HTML::raw('&nbsp;'))), HTML::td(array('bgcolor' => '#ffffff', 'style' => 'color:#000000'), $this->_showvalue($key, $val, $prefix)));
     }
     return $rows;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:18,代码来源:_BackendInfo.php

示例11: doPoll

 function doPoll($page, $request, $answers, $readonly = false)
 {
     $question = $this->_args['question'];
     $answer = $this->_args['answer'];
     $html = HTML::table(array('cellspacing' => 2));
     $init = isset($question[0]) ? 0 : 1;
     for ($i = $init; $i <= count($question); $i++) {
         if (!isset($question[$i])) {
             break;
         }
         $poll = $page->get('poll');
         @$poll['data']['all'][$i]++;
         $q = $question[$i];
         if (!isset($answer[$i])) {
             trigger_error(fmt("Missing %s for %s", "answer" . "[{$i}]", "question" . "[{$i}]"), E_USER_ERROR);
         }
         if (!$readonly) {
             $page->set('poll', $poll);
         }
         $a = $answer[$i];
         $result = isset($answers[$i]) ? $answers[$i] : -1;
         if (!is_array($a)) {
             $checkbox = HTML::input(array('type' => 'checkbox', 'name' => "answer[{$i}]", 'value' => $a));
             if ($result >= 0) {
                 $checkbox->setAttr('checked', "checked");
             }
             if (!$readonly) {
                 list($percent, $count, $all) = $this->storeResult($page, $i, $result ? 1 : 0);
             } else {
                 list($percent, $count, $all) = $this->getResult($page, $i, 1);
             }
             $print = sprintf(_("  %d%% (%d/%d)"), $percent, $count, $all);
             $html->pushContent(HTML::tr(HTML::th(array('colspan' => 4, 'align' => 'left'), $q)));
             $html->pushContent(HTML::tr(HTML::td($checkbox), HTML::td($a), HTML::td($this->bar($percent)), HTML::td($print)));
         } else {
             $html->pushContent(HTML::tr(HTML::th(array('colspan' => 4, 'align' => 'left'), $q)));
             $row = HTML();
             if (!$readonly) {
                 $this->storeResult($page, $i, $answers[$i]);
             }
             for ($j = 0; $j <= count($a); $j++) {
                 if (isset($a[$j])) {
                     list($percent, $count, $all) = $this->getResult($page, $i, $j);
                     $print = sprintf(_("  %d%% (%d/%d)"), $percent, $count, $all);
                     $radio = HTML::input(array('type' => 'radio', 'name' => "answer[{$i}]", 'value' => $j));
                     if ($result == $j) {
                         $radio->setAttr('checked', "checked");
                     }
                     $row->pushContent(HTML::tr(HTML::td($radio), HTML::td($a[$j]), HTML::td($this->bar($percent)), HTML::td($print)));
                 }
             }
             $html->pushContent($row);
         }
     }
     if (!$readonly) {
         return HTML(HTML::h3(_("The result of this poll so far:")), $html, HTML::p(_("Thanks for participating!")));
     } else {
         return HTML(HTML::h3(_("The result of this poll so far:")), $html);
     }
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:60,代码来源:WikiPoll.php

示例12: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     global $WikiTheme;
     $args = $this->getArgs($argstr, $request);
     extract($args);
     if ($since) {
         $since = strtotime($since);
     }
     if ($month) {
         $since = strtotime($month);
         $since = mktime(0, 0, 0, date("m", $since), 1, date("Y", $since));
         $until = mktime(23, 59, 59, date("m", $since) + 1, 0, date("Y", $since));
     } else {
         $until = 0;
     }
     $iter = $dbi->getAllPages(false, '-mtime');
     $pages = array();
     while ($page = $iter->next()) {
         $pagename = $page->getName();
         if (!$page->exists()) {
             continue;
         }
         $rev = $page->getRevision(1, false);
         $date = $rev->get('mtime');
         //$author = $rev->get('author_id');
         $author = $page->getOwner();
         if (defined('DEBUG') && DEBUG && $debug) {
             echo "<i>{$pagename}, ", strftime("%Y-%m-%d %h:%m:%s", $date), ", {$author}</i><br />\n";
         }
         if ($userid and !preg_match("/" . $userid . "/", $author)) {
             continue;
         }
         if ($since and $date < $since) {
             continue;
         }
         if ($until and $date > $until) {
             continue;
         }
         if (!$comments and preg_match("/\\/Comment/", $pagename)) {
             continue;
         }
         $monthnum = strftime("%Y%m", $date);
         if (!isset($pages[$monthnum])) {
             $pages[$monthnum] = array('author' => array(), 'month' => strftime("%B, %Y", $date));
         }
         if (!isset($pages[$monthnum]['author'][$author])) {
             $pages[$monthnum]['author'][$author] = array('count' => 0, 'pages' => array());
         }
         $pages[$monthnum]['author'][$author]['count']++;
         $pages[$monthnum]['author'][$author]['pages'][] = $pagename;
     }
     $iter->free();
     $html = HTML::table(HTML::col(array('span' => 2, 'align' => 'left')));
     $nbsp = HTML::raw('&nbsp;');
     krsort($pages);
     foreach ($pages as $monthname => $parr) {
         $html->pushContent(HTML::tr(HTML::td(array('colspan' => 2), HTML::strong($parr['month']))));
         uasort($parr['author'], 'cmp_by_count');
         foreach ($parr['author'] as $user => $authorarr) {
             $count = $authorarr['count'];
             $id = preg_replace("/ /", "_", 'pages-' . $monthname . '-' . $user);
             $html->pushContent(HTML::tr(HTML::td($nbsp, $nbsp, HTML::img(array('id' => "{$id}-img", 'src' => $WikiTheme->_findData("images/folderArrowClosed.png"), 'onclick' => "showHideFolder('{$id}')", 'alt' => _("Click to hide/show"), 'title' => _("Click to hide/show"))), $nbsp, $user), HTML::td($count)));
             if ($links) {
                 $pagelist = HTML();
                 foreach ($authorarr['pages'] as $p) {
                     $pagelist->pushContent(WikiLink($p), ', ');
                 }
             } else {
                 $pagelist = join(', ', $authorarr['pages']);
             }
             $html->pushContent(HTML::tr(array('id' => $id . '-body', 'style' => 'display:none; background-color: #eee;'), HTML::td(array('colspan' => 2, 'style' => 'font-size:smaller'), $pagelist)));
         }
     }
     return $html;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:75,代码来源:NewPagesPerUser.php

示例13: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     // When 'phpweather/phpweather.php' is not installed then
     // PHPWEATHER_BASE_DIR will be undefined.
     if (!defined('PHPWEATHER_BASE_DIR')) {
         return $this->error(_("You have to define PHPWEATHER_BASE_DIR before use. (config/config.ini)"));
     }
     //early return
     require_once PHPWEATHER_BASE_DIR . '/output/pw_images.php';
     require_once PHPWEATHER_BASE_DIR . '/pw_utilities.php';
     extract($this->getArgs($argstr, $request));
     $html = HTML();
     $w = new phpweather();
     // Our weather object
     if (!empty($icao)) {
         /* We assign the ICAO to the weather object: */
         $w->set_icao($icao);
         if (!$w->get_country_code()) {
             /* The country code couldn't be resolved, so we
              * shouldn't use the ICAO: */
             trigger_error(sprintf(_("The ICAO '%s' wasn't recognized."), $icao), E_USER_NOTICE);
             $icao = '';
         }
     }
     if (!empty($icao)) {
         /* We check and correct the language if necessary: */
         //if (!in_array($language, array_keys($w->get_languages('text')))) {
         if (!in_array($language, array_keys(get_languages('text')))) {
             trigger_error(sprintf(_("%s does not know about the language '%s', using 'en' instead."), $this->getName(), $language), E_USER_NOTICE);
             $language = 'en';
         }
         $class = "pw_text_{$language}";
         require_once PHPWEATHER_BASE_DIR . "/output/{$class}.php";
         $t = new $class($w);
         $t->set_pref_units($units);
         $i = new pw_images($w);
         $i_temp = HTML::img(array('src' => $i->get_temp_image()));
         $i_wind = HTML::img(array('src' => $i->get_winddir_image()));
         $i_sky = HTML::img(array('src' => $i->get_sky_image()));
         $m = $t->print_pretty();
         $m_td = HTML::td(HTML::p(new RawXml($m)));
         $i_tr = HTML::tr();
         $i_tr->pushContent(HTML::td($i_temp));
         $i_tr->pushContent(HTML::td($i_wind));
         $i_table = HTML::table($i_tr);
         $i_table->pushContent(HTML::tr(HTML::td(array('colspan' => '2'), $i_sky)));
         $tr = HTML::tr();
         $tr->pushContent($m_td);
         $tr->pushContent(HTML::td($i_table));
         $html->pushContent(HTML::table($tr));
     }
     /* We make a menu if asked to, or if $icao is empty: */
     if ($menu || empty($icao)) {
         $form_arg = array('action' => $request->getURLtoSelf(), 'method' => 'get');
         /* The country box is always part of the menu: */
         $p1 = HTML::p(new RawXml(get_countries_select($w, $cc)));
         /* We want to save the language: */
         $p1->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'language', 'value' => $language)));
         /* And also the ICAO: */
         $p1->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'icao', 'value' => $icao)));
         $caption = empty($cc) ? _("Submit country") : _("Change country");
         $p1->pushContent(HTML::input(array('type' => 'submit', 'value' => $caption)));
         $html->pushContent(HTML::form($form_arg, $p1));
         if (!empty($cc)) {
             /* We have selected a country, now display a list with
              * the available stations in that country: */
             $p2 = HTML::p();
             /* We need the country code after the form is submitted: */
             $p2->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'cc', 'value' => $cc)));
             $p2->pushContent(new RawXml(get_stations_select($w, $cc, $icao)));
             $p2->pushContent(new RawXml(get_languages_select($language)));
             $p2->pushContent(HTML::input(array('type' => 'submit', 'value' => _("Submit location"))));
             $html->pushContent(HTML::form($form_arg, $p2));
         }
     }
     return $html;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:77,代码来源:PhpWeather.php

示例14: _date

 function _date($dbi, $time)
 {
     $args =& $this->args;
     $date_string = strftime($args['date_format'], $time);
     $page_for_date = $args['prefix'] . SUBPAGE_SEPARATOR . $date_string;
     $t = localtime($time, 1);
     $td = HTML::td(array('align' => 'center'));
     if ($dbi->isWikiPage($page_for_date)) {
         // Extract the page contents for this date
         $p = $dbi->getPage($page_for_date);
         $r = $p->getCurrentRevision();
         $c = $r->getContent();
         include_once 'lib/BlockParser.php';
         $content = TransformText(implode("\n", $c), $r->get('markup'));
         $link = HTML::a(array('class' => 'cal-hide', 'href' => WikiURL($page_for_date, array('action' => 'edit')), 'title' => sprintf(_("Edit %s"), $page_for_date)), $date_string);
         $this->_links[] = $page_for_date;
         $a = array(HTML::dt($link), HTML::dd($content));
     } else {
         $a = array();
     }
     return $a;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:22,代码来源:CalendarList.php

示例15: _upgrade_db_init

function _upgrade_db_init(&$dbh)
{
    global $request, $DBParams, $DBAuthParams;
    if (!in_array($DBParams['dbtype'], array('SQL', 'ADODB', 'PDO'))) {
        return;
    }
    if (DBADMIN_USER) {
        // if need to connect as the root user, for CREATE and ALTER privileges
        $AdminParams = $DBParams;
        if ($DBParams['dbtype'] == 'SQL') {
            $dsn = DB::parseDSN($AdminParams['dsn']);
        } else {
            // ADODB or PDO
            $dsn = parseDSN($AdminParams['dsn']);
        }
        $AdminParams['dsn'] = sprintf("%s://%s:%s@%s/%s", $dsn['phptype'], DBADMIN_USER, DBADMIN_PASSWD, $dsn['hostspec'], $dsn['database']);
        if (DEBUG & _DEBUG_SQL and $DBParams['dbtype'] == 'PDO') {
            echo "<br>\nDBParams['dsn']: '", $DBParams['dsn'], "'";
            echo "<br>\ndsn: '", print_r($dsn), "'";
            echo "<br>\nAdminParams['dsn']: '", $AdminParams['dsn'], "'";
        }
        $dbh = WikiDB::open($AdminParams);
    } elseif ($dbadmin = $request->getArg('dbadmin')) {
        if (empty($dbadmin['user']) or isset($dbadmin['cancel'])) {
            $dbh =& $request->_dbi;
        } else {
            $AdminParams = $DBParams;
            if ($DBParams['dbtype'] == 'SQL') {
                $dsn = DB::parseDSN($AdminParams['dsn']);
            } else {
                $dsn = parseDSN($AdminParams['dsn']);
            }
            $AdminParams['dsn'] = sprintf("%s://%s:%s@%s/%s", $dsn['phptype'], $dbadmin['user'], $dbadmin['passwd'], $dsn['hostspec'], $dsn['database']);
            $dbh = WikiDB::open($AdminParams);
        }
    } else {
        // Check if the privileges are enough. Need CREATE and ALTER perms.
        // And on windows: SELECT FROM mysql, possibly: UPDATE mysql.
        $form = HTML::form(array("method" => "post", "action" => $request->getPostURL(), "accept-charset" => $GLOBALS['charset']), HTML::p(_("Upgrade requires database privileges to CREATE and ALTER the phpwiki database."), HTML::br(), _("And on windows at least the privilege to SELECT FROM mysql, and possibly UPDATE mysql")), HiddenInputs(array('action' => 'upgrade')), HTML::table(array("cellspacing" => 4), HTML::tr(HTML::td(array('align' => 'right'), _("DB admin user:")), HTML::td(HTML::input(array('name' => "dbadmin[user]", 'size' => 12, 'maxlength' => 256, 'value' => 'root')))), HTML::tr(HTML::td(array('align' => 'right'), _("DB admin password:")), HTML::td(HTML::input(array('name' => "dbadmin[passwd]", 'type' => 'password', 'size' => 12, 'maxlength' => 256)))), HTML::tr(HTML::td(array('align' => 'center', 'colspan' => 2), Button("submit:", _("Submit"), 'wikiaction'), HTML::raw('&nbsp;'), Button("submit:dbadmin[cancel]", _("Cancel"), 'button')))));
        $form->printXml();
        echo "</div><!-- content -->\n";
        echo asXML(Template("bottom"));
        echo "</body></html>\n";
        $request->finish();
        exit;
    }
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:47,代码来源:upgrade.php


注:本文中的HTML::td方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。