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


PHP HTML::Raw方法代码示例

本文整理汇总了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)
 {
     if (is_array($argstr)) {
         // can do with array also.
         $args =& $argstr;
         if (!isset($args['order'])) {
             $args['order'] = 'reverse';
         }
     } else {
         $args = $this->getArgs($argstr, $request);
     }
     $user = $request->getUser();
     if (empty($args['user'])) {
         if ($user->isAuthenticated()) {
             $args['user'] = $user->UserName();
         } else {
             $args['user'] = '';
         }
     }
     if (!$args['user'] or $args['user'] == ADMIN_USER) {
         if (BLOG_DEFAULT_EMPTY_PREFIX) {
             $args['user'] = '';
             // "Blogs/day" pages
         } else {
             $args['user'] = ADMIN_USER;
             // "Admin/Blogs/day" pages
         }
     }
     $parent = empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR;
     $sp = HTML::Raw('· ');
     $prefix = $base = $parent . $this->_blogPrefix('wikiblog');
     if ($args['month']) {
         $prefix .= SUBPAGE_SEPARATOR . $args['month'];
     }
     $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix . SUBPAGE_SEPARATOR, true, 'posix'));
     $html = HTML();
     $i = 0;
     while ($page = $pages->next() and $i < $args['count']) {
         $rev = $page->getCurrentRevision(false);
         if ($rev->get('pagetype') != 'wikiblog') {
             continue;
         }
         $i++;
         $blog = $this->_blog($rev);
         //$html->pushContent(HTML::h3(WikiLink($page, 'known', $rev->get('summary'))));
         $html->pushContent($rev->getTransformedContent('wikiblog'));
     }
     if ($args['user'] == $user->UserName() or $args['user'] == '') {
         $html->pushContent(Button(array('action' => 'WikiBlog', 'mode' => 'add'), _("New entry"), $base));
     }
     if (!$i) {
         return HTML(HTML::h3(_("No Blog Entries")), $html);
     }
     if (!$args['noheader']) {
         return HTML(HTML::h3(sprintf(_("Blog Entries for %s:"), $this->_monthTitle($args['month']))), $html);
     } else {
         return $html;
     }
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:59,代码来源:BlogJournal.php

示例2: box

 function box($args = false, $request = false, $basepage = false)
 {
     if (!$request) {
         $request =& $GLOBALS['request'];
     }
     $stats = $this->getStats($request->_dbi, $request, 'summary');
     return $this->makeBox(_("Who is online"), HTML(HTML::Raw('&middot; '), WikiLink(_("WhoIsOnline"), 'auto', fmt("%d online users", $stats['NUM_USERS']))));
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:8,代码来源:WhoIsOnline.php

示例3: findTemplate

 function findTemplate($name)
 {
     // hack for navbar.tmpl to hide the buttonseparator
     if ($name == "navbar") {
         $this->setButtonSeparator(HTML::Raw("<br />\n&nbsp;&middot;&nbsp;"));
     }
     if ($name == "actionbar" || $name == "signin") {
         $this->setButtonSeparator(" ");
     }
     return parent::findTemplate($name);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:themeinfo.php

示例4: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     $args = $this->getArgs($argstr, $request);
     if (empty($this->source)) {
         return '';
     }
     include_once "lib/ASCIIMathPHP/ASCIIMathPHP.cfg.php";
     $ascii_math = new ASCIIMathPHP($symbol_arr, $this->source);
     $ascii_math->genMathML();
     return HTML::Raw($ascii_math->getMathML());
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:AsciiMath.php

示例5: showNotify

 function showNotify(&$request, $messages, $page, $pagelist, $verified)
 {
     $isNecessary = !$this->contains($pagelist, $page);
     $form = HTML::form(array('action' => $request->getPostURL(), 'method' => 'post'), HiddenInputs(array('verify' => 1)), HiddenInputs($request->getArgs(), false, array('verify')), $messages, HTML::p(_("Your current watchlist: "), $this->showWatchList($pagelist)));
     if ($isNecessary) {
         $form->pushContent(HTML::p(_("New watchlist: "), $this->showWatchList($this->addpagelist($page, $pagelist))), HTML::p(sprintf(_("Do you %s want to add this page \"%s\" to your WatchList?"), $verified ? _("really") : "", $page)), HTML::p(Button('submit:add', _("Yes")), HTML::Raw('&nbsp;'), Button('submit:cancel', _("Cancel"))));
     } else {
         $form->pushContent(HTML::p(fmt("The page %s is already watched!", $page)), HTML::p(Button('submit:edit', _("Edit")), HTML::Raw('&nbsp;'), Button('submit:cancel', _("Cancel"))));
     }
     $fieldset = HTML::fieldset(HTML::legend("Watch Page"), $form);
     return $fieldset;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:12,代码来源:WatchPage.php

示例6: markup

 function markup($match)
 {
     return HTML::Raw($match);
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:4,代码来源:InlineParser.php

示例7: RatingWidgetHtml

 /**
  * HTML widget display
  *
  * This needs to be put in the <body> section of the page.
  *
  * @param pagename    Name of the page to rate
  * @param version     Version of the page to rate (may be "" for current)
  * @param imgPrefix   Prefix of the names of the images that display the rating
  *                    You can have two widgets for the same page displayed at
  *                    once iff the imgPrefix-s are different.
  * @param dimension   Id of the dimension to rate
  * @param small       Makes a smaller ratings widget if non-false
  *
  * Limitations: Currently this can only print the current users ratings.
  *              And only the widget, but no value (for buddies) also.
  */
 function RatingWidgetHtml($pagename, $version, $imgPrefix, $dimension, $small = false)
 {
     global $WikiTheme, $request;
     $imgId = MangleXmlIdentifier($pagename) . $imgPrefix;
     $actionImgName = $imgId . 'RateItAction';
     $dbi =& $GLOBALS['request']->_dbi;
     $version = $dbi->_backend->get_latest_version($pagename);
     //$rdbi =& $this->_rdbi;
     $rdbi = RatingsDb::getTheRatingsDb();
     // check if the imgPrefix icons exist.
     if (!$WikiTheme->_findData("images/RateIt" . $imgPrefix . "Nk0.png", true)) {
         $imgPrefix = '';
     }
     // Protect against 's, though not \r or \n
     $reImgPrefix = $this->_javascript_quote_string($imgPrefix);
     $reActionImgName = $this->_javascript_quote_string($actionImgName);
     $rePagename = $this->_javascript_quote_string($pagename);
     //$dimension = $args['pagename'] . "rat";
     $html = HTML::span(array("id" => $imgId));
     for ($i = 0; $i < 2; $i++) {
         $nk[$i] = $WikiTheme->_findData("images/RateIt" . $imgPrefix . "Nk" . $i . ".png");
         $none[$i] = $WikiTheme->_findData("images/RateIt" . $imgPrefix . "Rk" . $i . ".png");
     }
     $user = $request->getUser();
     $userid = $user->getId();
     //if (!isset($args['rating']))
     $rating = $rdbi->getRating($userid, $pagename, $dimension);
     if (!$rating) {
         $pred = $rdbi->getPrediction($userid, $pagename, $dimension);
     }
     for ($i = 1; $i <= 10; $i++) {
         $a1 = HTML::a(array('href' => 'javascript:click(\'' . $reActionImgName . '\',\'' . $rePagename . '\',\'' . $version . '\',\'' . $reImgPrefix . '\',\'' . $dimension . '\',' . $i / 2 . ')'));
         $img_attr = array();
         $img_attr['src'] = $nk[$i % 2];
         //if (!$rating and !$pred)
         //  $img_attr['src'] = $none[$i%2];
         $img_attr['name'] = $imgPrefix . $i;
         $img_attr['alt'] = $img_attr['name'];
         $img_attr['border'] = 0;
         $a1->pushContent(HTML::img($img_attr));
         $a1->addToolTip(_("Rate the topic of this page"));
         $html->pushContent($a1);
         //This adds a space between the rating smilies:
         // if (($i%2) == 0) $html->pushContent(' ');
     }
     $html->pushContent(HTML::Raw('&nbsp;'));
     $a0 = HTML::a(array('href' => 'javascript:click(\'' . $reActionImgName . '\',\'' . $rePagename . '\',\'' . $version . '\',\'' . $reImgPrefix . '\',\'' . $dimension . '\',\'X\')'));
     $msg = _("Cancel rating");
     $a0->pushContent(HTML::img(array('src' => $WikiTheme->getImageUrl("RateIt" . $imgPrefix . "Cancel"), 'name' => $imgPrefix . 'Cancel', 'alt' => $msg)));
     $a0->addToolTip($msg);
     $html->pushContent($a0);
     /*} elseif ($pred) {
           $msg = _("No opinion");
           $html->pushContent(HTML::img(array('src' => $WikiTheme->getImageUrl("RateItCancelN"),
                                              'name'=> $imgPrefix.'Cancel',
                                              'alt' => $msg)));
           //$a0->addToolTip($msg);
           //$html->pushContent($a0);
       }*/
     $img_attr = array();
     $img_attr['src'] = $WikiTheme->_findData("images/RateItAction.png");
     $img_attr['name'] = $actionImgName;
     $img_attr['alt'] = $img_attr['name'];
     //$img_attr['class'] = 'k' . $i;
     $img_attr['border'] = 0;
     $html->pushContent(HTML::img($img_attr));
     // Display the current rating if there is one
     if ($rating) {
         $html->pushContent(JavaScript('displayRating(\'' . $reImgPrefix . '\',' . $rating . ',0)'));
     } elseif ($pred) {
         $html->pushContent(JavaScript('displayRating(\'' . $reImgPrefix . '\',' . $pred . ',1)'));
     } else {
         $html->pushContent(JavaScript('displayRating(\'' . $reImgPrefix . '\',0,0)'));
     }
     return $html;
 }
开发者ID:neymanna,项目名称:fusionforge,代码行数:92,代码来源:RateIt.php

示例8: PossiblyGlueIconToText

/**
 * Glue icon in front of or after text.
 * Pref: 'noLinkIcons'      - ignore icon if set
 * WikiTheme: 'LinkIcons'   - 'yes'   at front
 *                          - 'no'    display no icon
 *                          - 'front' display at left
 *                          - 'after' display at right
 *
 * @param string $protocol_or_url Protocol or URL.  Used to determine the
 * proper icon.
 * @param string $text The text.
 * @return XmlContent.
 */
function PossiblyGlueIconToText($proto_or_url, $text)
{
    global $request, $WikiTheme;
    if ($request->getPref('noLinkIcons')) {
        return $text;
    }
    $icon = IconForLink($proto_or_url);
    if (!$icon) {
        return $text;
    }
    if ($where = $WikiTheme->getLinkIconAttr()) {
        if ($where == 'no') {
            return $text;
        }
        if ($where != 'after') {
            $where = 'front';
        }
    } else {
        $where = 'front';
    }
    if ($where == 'after') {
        // span the icon only to the last word (tie them together),
        // to let the previous words wrap on line breaks.
        if (!is_object($text)) {
            preg_match('/^(\\s*\\S*)(\\s*)$/', $text, $m);
            list(, $prefix, $last_word) = $m;
        } else {
            $last_word = $text;
            $prefix = false;
        }
        $text = HTML::span(array('style' => 'white-space: nowrap'), $last_word, HTML::Raw('&nbsp;'), $icon);
        if ($prefix) {
            $text = HTML($prefix, $text);
        }
        return $text;
    }
    // span the icon only to the first word (tie them together),
    // to let the next words wrap on line breaks
    if (!is_object($text)) {
        preg_match('/^\\s*(\\S*)(.*?)\\s*$/', $text, $m);
        list(, $first_word, $tail) = $m;
    } else {
        $first_word = $text;
        $tail = false;
    }
    $text = HTML::span(array('style' => 'white-space: nowrap'), $icon, $first_word);
    if ($tail) {
        $text = HTML($text, $tail);
    }
    return $text;
}
开发者ID:hugcoday,项目名称:wiki,代码行数:64,代码来源:stdlib.php

示例9: _work

 function _work($pagename, $args, $dbi, &$request)
 {
     if (empty($args['s'])) {
         if ($request->isPost()) {
             if ($pagename != _("AppendText")) {
                 return HTML($request->redirect(WikiURL($pagename, false, 'absurl'), false));
             }
         }
         return '';
     }
     $page = $dbi->getPage($pagename);
     $message = HTML();
     if (!$page->exists()) {
         // We might want to create it?
         $message->pushContent(sprintf(_("Page could not be updated. %s doesn't exist!\n"), $pagename));
         return $message;
     }
     $current = $page->getCurrentRevision();
     $oldtext = $current->getPackedContent();
     $text = $args['s'];
     // If a "before" or "after" is specified but not found, we simply append text to the end.
     if (!empty($args['before'])) {
         $before = preg_quote($args['before'], "/");
         // Insert before
         $newtext = preg_match("/\n{$before}/", $oldtext) ? preg_replace("/(\n{$before})/", "\n" . preg_quote($text, "/") . "\\1", $oldtext) : $this->_fallback($text, $oldtext, $args['before'], $message);
     } elseif (!empty($args['after'])) {
         // Insert after
         $after = preg_quote($args['after'], "/");
         $newtext = preg_match("/\n{$after}/", $oldtext) ? preg_replace("/(\n{$after})/", "\\1\n" . preg_quote($text, "/"), $oldtext) : $this->_fallback($text, $oldtext, $args['after'], $message);
     } else {
         // Append at the end
         $newtext = $oldtext . "\n" . $text;
     }
     require_once "lib/loadsave.php";
     $meta = $current->_data;
     $meta['summary'] = sprintf(_("AppendText to %s"), $pagename);
     if ($page->save($newtext, $current->getVersion() + 1, $meta)) {
         $message->pushContent(_("Page successfully updated."), HTML::br());
     }
     // AppendText has been called from the same page that got modified
     // so we directly show the page.
     if ($request->getArg($pagename) == $pagename) {
         // TODO: Just invalidate the cache, if AppendText didn't
         // change anything before.
         //
         return $request->redirect(WikiURL($pagename, false, 'absurl'), false);
         // The user asked to be redirected to the modified page
     } elseif ($args['redirect']) {
         return $request->redirect(WikiURL($pagename, false, 'absurl'), false);
     } else {
         $link = HTML::em(WikiLink($pagename));
         $message->pushContent(HTML::Raw(sprintf(_("Go to %s."), $link->asXml())));
     }
     return $message;
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:55,代码来源:AppendText.php

示例10: RelatedExternalLinksBox

 function RelatedExternalLinksBox($title = false, $body = '', $limit = 20)
 {
     global $request;
     $this->title = $title ? $title : _("External Links");
     $this->body = HTML($body);
     $page = $request->getPage($request->getArg('pagename'));
     $cache =& $page->_wikidb->_cache;
     $counter = 0;
     $sp = HTML::Raw('&middot; ');
     foreach ($cache->getWikiPageLinks() as $link) {
         if ($link) {
             $this->body->pushContent($sp, WikiLink($link), HTML::br());
             $counter++;
             if ($limit and $counter > $limit) {
                 continue;
             }
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:19,代码来源:Theme.php

示例11: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     extract($this->getArgs($argstr, $request));
     if (empty($action)) {
         return $this->error(fmt("A required argument '%s' is missing.", "action"));
     }
     $form = HTML::form(array('action' => $request->getPostURL(), 'method' => strtolower($method), 'class' => 'wikiaction', 'accept-charset' => $GLOBALS['charset']), HiddenInputs(array('action' => $action, 'group_id' => GROUP_ID)));
     $nbsp = HTML::Raw('&nbsp;');
     $already_submit = 0;
     foreach ($this->inputbox as $inputbox) {
         foreach ($inputbox as $inputtype => $input) {
             if ($inputtype == 'radiobutton') {
                 $inputtype = 'radio';
             }
             // convert from older versions
             $input['type'] = $inputtype;
             $text = '';
             if ($inputtype != 'submit') {
                 if (empty($input['name'])) {
                     return $this->error(fmt("A required argument '%s' is missing.", $inputtype . "[][name]"));
                 }
                 if (!isset($input['text'])) {
                     $input['text'] = gettext($input['name']);
                 }
                 $text = $input['text'];
                 unset($input['text']);
             }
             switch ($inputtype) {
                 case 'checkbox':
                 case 'radio':
                     if (empty($input['value'])) {
                         $input['value'] = 1;
                     }
                     if (is_array($input['value'])) {
                         $div = HTML::div(array('class' => $class));
                         $values = $input['value'];
                         $name = $input['name'];
                         $input['name'] = $inputtype == 'checkbox' ? $name . "[]" : $name;
                         foreach ($values as $val) {
                             $input['value'] = $val;
                             if ($request->getArg($name)) {
                                 if ($request->getArg($name) == $val) {
                                     $input['checked'] = 'checked';
                                 } else {
                                     unset($input['checked']);
                                 }
                             }
                             $div->pushContent(HTML::input($input), $nbsp, $val, $nbsp, "\n");
                             if (!$nobr) {
                                 $div->pushContent(HTML::br());
                             }
                         }
                         $form->pushContent($div);
                     } else {
                         if (empty($input['checked'])) {
                             if ($request->getArg($input['name'])) {
                                 $input['checked'] = 'checked';
                             }
                         } else {
                             $input['checked'] = 'checked';
                         }
                         if ($nobr) {
                             $form->pushContent(HTML::input($input), $nbsp, $text, $nbsp);
                         } else {
                             $form->pushContent(HTML::div(array('class' => $class), HTML::input($input), $text));
                         }
                     }
                     break;
                 case 'editbox':
                     $input['type'] = 'text';
                     if (empty($input['value']) and $s = $request->getArg($input['name'])) {
                         $input['value'] = $s;
                     }
                     if ($nobr) {
                         $form->pushContent(HTML::input($input), $nbsp, $text, $nbsp);
                     } else {
                         $form->pushContent(HTML::div(array('class' => $class), HTML::input($input), $text));
                     }
                     break;
                 case 'combobox':
                     // TODO: moACDROPDOWN
                     $values = $input['value'];
                     unset($input['value']);
                     $input['type'] = 'text';
                     if (is_string($values)) {
                         $values = explode(",", $values);
                     }
                     if (empty($values)) {
                         if ($input['method']) {
                             $input['value'] = xmlrequest($input['method']);
                         } elseif ($s = $request->getArg($input['name'])) {
                             $input['value'] = $s;
                         }
                     } elseif (is_array($values)) {
                         $name = $input['name'];
                         unset($input['name']);
                         foreach ($values as $val) {
                             $input = array('value' => $val);
                             if ($request->getArg($name)) {
                                 if ($request->getArg($name) == $val) {
//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:tuleap,代码行数:101,代码来源:WikiFormRich.php

示例12:

 * be omitted.
 */
$WikiTheme->addImageAlias('signature', WIKI_NAME . "Signature.png");
// Uncomment this next line to disable the signature.
$WikiTheme->addImageAlias('signature', false);
/*
 * Link icons.
 */
//$WikiTheme->setLinkIcon('http');
$WikiTheme->setLinkIcon('https');
$WikiTheme->setLinkIcon('ftp');
$WikiTheme->setLinkIcon('mailto');
//$WikiTheme->setLinkIcon('interwiki');
//$WikiTheme->setLinkIcon('wikiuser');
//$WikiTheme->setLinkIcon('*', 'url');
$WikiTheme->setButtonSeparator(HTML::Raw("<li>"));
/**
 * WikiWords can automatically be split by inserting spaces between
 * the words. The default is to leave WordsSmashedTogetherLikeSo.
 */
$WikiTheme->setAutosplitWikiWords(false);
/**
 * Layout improvement with dangling links for mostly closed wiki's:
 * If false, only users with edit permissions will be presented the 
 * special wikiunknown class with "?" and Tooltip.
 * If true (default), any user will see the ?, but will be presented 
 * the PrintLoginForm on a click.
 */
$WikiTheme->setAnonEditUnknownLinks(false);
/*
 * You may adjust the formats used for formatting dates and times
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:themeinfo.php

示例13: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     $args = $this->getArgs($argstr, $request);
     $user =& $request->_user;
     if (isa($request, 'MockRequest')) {
         return '';
     }
     if (!$request->isActionPage($request->getArg('pagename')) and (!isset($user->_prefs->_method) or !in_array($user->_prefs->_method, array('ADODB', 'SQL'))) or in_array($request->getArg('action'), array('zip', 'ziphtml', 'dumphtml')) or isa($user, '_ForbiddenUser')) {
         $no_args = $this->getDefaultArguments();
         // ?
         //            foreach ($no_args as $key => $value) {
         //                $no_args[$value] = false;
         //            }
         $no_args['errmsg'] = HTML(HTML::h2(_("Error: The user HomePage must be a valid WikiWord. Sorry, UserPreferences cannot be saved."), HTML::hr()));
         $no_args['isForm'] = false;
         return Template('userprefs', $no_args);
     }
     $userid = $user->UserName();
     if ($user->isAuthenticated() and !empty($userid)) {
         $pref =& $request->_prefs;
         $args['isForm'] = true;
         //trigger_error("DEBUG: reading prefs from getPreferences".print_r($pref));
         if ($request->isPost()) {
             $errmsg = '';
             $delete = $request->getArg('delete');
             if ($delete and $request->getArg('verify')) {
                 // deleting prefs, verified
                 $default_prefs = $pref->defaultPreferences();
                 $default_prefs['userid'] = $user->UserName();
                 $user->setPreferences($default_prefs);
                 $request->_setUser($user);
                 $request->setArg("verify", false);
                 $request->setArg("delete", false);
                 $alert = new Alert(_("Message"), _("Your UserPreferences have been successfully deleted."));
                 $alert->show();
                 return;
             } elseif ($delete and !$request->getArg('verify')) {
                 return HTML::form(array('action' => $request->getPostURL(), 'method' => 'post'), HiddenInputs(array('verify' => 1)), HiddenInputs($request->getArgs()), HTML::p(_("Do you really want to delete all your UserPreferences?")), HTML::p(Button('submit:delete', _("Yes"), 'delete'), HTML::Raw('&nbsp;'), Button('cancel', _("Cancel"))));
             } elseif ($rp = $request->getArg('pref')) {
                 // replace only changed prefs in $pref with those from request
                 if (!empty($rp['passwd']) and $rp['passwd2'] != $rp['passwd']) {
                     $errmsg = _("Wrong password. Try again.");
                 } else {
                     //trigger_error("DEBUG: reading prefs from request".print_r($rp));
                     //trigger_error("DEBUG: writing prefs with setPreferences".print_r($pref));
                     if (empty($rp['passwd'])) {
                         unset($rp['passwd']);
                     }
                     // fix to set system pulldown's. empty values don't get posted
                     if (empty($rp['theme'])) {
                         $rp['theme'] = '';
                     }
                     if (empty($rp['lang'])) {
                         $rp['lang'] = '';
                     }
                     $num = $user->setPreferences($rp);
                     if (!empty($rp['passwd'])) {
                         $passchanged = false;
                         if ($user->mayChangePass()) {
                             if (method_exists($user, 'storePass')) {
                                 $passchanged = $user->storePass($rp['passwd']);
                             }
                             if (!$passchanged and method_exists($user, 'changePass')) {
                                 $passchanged = $user->changePass($rp['passwd']);
                             }
                             if ($passchanged) {
                                 $errmsg = _("Password updated.");
                             } else {
                                 $errmsg = _("Password was not changed.");
                             }
                         } else {
                             $errmsg = _("Password cannot be changed.");
                         }
                     }
                     if (!$num) {
                         $errmsg .= " " . _("No changes.");
                     } else {
                         $request->_setUser($user);
                         $pref = $user->_prefs;
                         $errmsg .= sprintf(_("%d UserPreferences fields successfully updated."), $num);
                     }
                 }
                 $args['errmsg'] = HTML(HTML::h2($errmsg), HTML::hr());
             }
         }
         $args['available_themes'] = listAvailableThemes();
         $args['available_languages'] = listAvailableLanguages();
         return Template('userprefs', $args);
     } else {
         // wrong or unauthenticated user
         return $request->_notAuthorized(WIKIAUTH_BOGO);
         //return $user->PrintLoginForm ($request, $args, false, false);
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:94,代码来源:UserPreferences.php

示例14: load

 function load()
 {
     $this->addMoreHeaders(JavaScript("var ta;\nvar skin = '" . $this->_name . "';\n"));
     $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikibits.js"))));
     if (isBrowserIE()) {
         $ver = browserVersion();
         if ($ver > 5.1 and $ver < 5.9) {
             $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IE55Fixes.css'), 'all'));
         } elseif ($ver > 5.5 and $ver < 7.0) {
             $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IE60Fixes.css'), 'all'));
         } elseif ($ver >= 7.0) {
             $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IE70Fixes.css'), 'all'));
         } else {
             $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IE50Fixes.css'), 'all'));
         }
         unset($ver);
         $this->addMoreHeaders("\n");
         $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("IEFixes.js"))));
         $this->addMoreHeaders("\n");
         $this->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />'));
     }
     $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
     // CSS file defines fonts, colors and background images for this
     // style.  The companion '*-heavy.css' file isn't defined, it's just
     // expected to be in the same directory that the base style is in.
     // This should result in phpwiki-printer.css being used when
     // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
     $this->setDefaultCSS('PhpWiki', array('' => 'monobook.css', 'print' => 'commonPrint.css'));
     // This allows one to manually select "Printer" style (when browsing page)
     // to see what the printer style looks like.
     $this->addAlternateCSS(_("Printer"), 'commonPrint.css', 'print, screen');
     $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
     $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
     /**
      * The logo image appears on every page and links to the HomePage.
      */
     $this->addImageAlias('logo', 'MonoBook-Logo.png');
     //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
     /**
      * The Signature image is shown after saving an edited page. If this
      * is set to false then the "Thank you for editing..." screen will
      * be omitted.
      */
     $this->addImageAlias('signature', "Signature.png");
     // Uncomment this next line to disable the signature.
     $this->addImageAlias('signature', false);
     /*
      * Link icons.
      */
     /*
     $this->setLinkIcon('http');
     $this->setLinkIcon('https');
     $this->setLinkIcon('ftp');
     $this->setLinkIcon('mailto');
     //$this->setLinkIcon('interwiki');
     */
     $this->setLinkIcon('wikiuser');
     //$this->setLinkIcon('*', 'url');
     // front or after
     //$this->setLinkIconAttr('after');
     //$this->setButtonSeparator("\n | ");
     /**
      * WikiWords can automatically be split by inserting spaces between
      * the words. The default is to leave WordsSmashedTogetherLikeSo.
      */
     //$this->setAutosplitWikiWords(false);
     /**
      * Layout improvement with dangling links for mostly closed wiki's:
      * If false, only users with edit permissions will be presented the
      * special wikiunknown class with "?" and Tooltip.
      * If true (default), any user will see the ?, but will be presented
      * the PrintLoginForm on a click.
      */
     $this->setAnonEditUnknownLinks(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.
      */
     $this->setDateFormat("%B %d, %Y");
     $this->setTimeFormat("%H:%M");
     /*
      * To suppress times in the "Last edited on" messages, give a
      * give a second argument of false:
      */
     //$this->setDateFormat("%B %d, %Y", false);
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:90,代码来源:themeinfo.php

示例15: run

 function run($dbi, $argstr, &$request, $basepage)
 {
     if (is_array($argstr)) {
         // can do with array also.
         $args =& $argstr;
         if (!isset($args['order'])) {
             $args['order'] = 'reverse';
         }
     } else {
         $args = $this->getArgs($argstr, $request);
     }
     if (empty($args['user'])) {
         $user = $request->getUser();
         if ($user->isAuthenticated()) {
             $args['user'] = $user->UserName();
         } else {
             $args['user'] = '';
         }
     }
     if (!$args['user'] or $args['user'] == ADMIN_USER) {
         if (BLOG_EMPTY_DEFAULT_PREFIX) {
             $args['user'] = '';
         } else {
             $args['user'] = ADMIN_USER;
         }
         // "Admin/Blogs/day" pages
     }
     $parent = empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR;
     //$info = explode(',', $args['info']);
     //$pagelist = new PageList($args['info'], $args['exclude'], $args);
     //if (!is_array('pagename'), explode(',', $info))
     //    unset($pagelist->_columns['pagename']);
     $sp = HTML::Raw('&middot; ');
     if (!empty($args['month'])) {
         $prefix = $parent . $this->_blogPrefix('wikiblog') . SUBPAGE_SEPARATOR . $args['month'];
         $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix, true, 'posix'));
         $html = HTML::ul();
         while ($page = $pages->next()) {
             $rev = $page->getCurrentRevision(false);
             if ($rev->get('pagetype') != 'wikiblog') {
                 continue;
             }
             $blog = $this->_blog($rev);
             $html->pushContent(HTML::li(WikiLink($page, 'known', $rev->get('summary'))));
         }
         if (!$args['noheader']) {
             return HTML(HTML::h3(sprintf(_("Blog Entries for %s:"), $this->_monthTitle($args['month']))), $html);
         } else {
             return $html;
         }
     }
     $blogs = $this->findBlogs($dbi, $args['user'], 'wikiblog');
     if ($blogs) {
         if (!$basepage) {
             $basepage = _("BlogArchives");
         }
         $html = HTML::ul();
         usort($blogs, array("WikiPlugin_WikiBlog", "cmp"));
         if ($args['order'] == 'reverse') {
             $blogs = array_reverse($blogs);
         }
         // collapse pagenames by month
         $months = array();
         foreach ($blogs as $rev) {
             $blog = $this->_blog($rev);
             $mon = $blog['month'];
             if (empty($months[$mon])) {
                 $months[$mon] = array('title' => $this->_monthTitle($mon), 'num' => 1, 'month' => $mon, 'link' => WikiURL($basepage, $this->_nonDefaultArgs(array('month' => $mon))));
             } else {
                 $months[$mon]['num']++;
             }
         }
         foreach ($months as $m) {
             $html->pushContent(HTML::li(HTML::a(array('href' => $m['link'], 'class' => 'named-wiki'), $m['title'] . " (" . $m['num'] . ")")));
         }
         if (!$args['noheader']) {
             return HTML(HTML::h3(_("Blog Archives:")), $html);
         } else {
             return $html;
         }
     } else {
         return '';
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:84,代码来源:BlogArchives.php


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