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


PHP Sanitizer::escapeId方法代码示例

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


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

示例1: getDiv

 public function getDiv($value)
 {
     global $wgOut, $wgPromoterAdPreview;
     if (array_key_exists('language', $this->mParams)) {
         $language = $this->mParams['language'];
     } else {
         $language = $wgOut->getContext()->getLanguage()->getCode();
     }
     $html = Xml::openElement('div', array('id' => Sanitizer::escapeId("pr-ad-list-element-{$this->mParams['ad']}"), 'class' => "pr-ad-list-element"));
     // Make the label; this consists of a text link to the ad editor, and a series of status icons
     if (array_key_exists('withlabel', $this->mParams)) {
         $adName = $this->mParams['ad'];
         $html .= Xml::openElement('div', array('class' => 'pr-ad-list-element-label'));
         $html .= Linker::link(SpecialPage::getTitleFor('PromoterAds', "edit/{$adName}"), htmlspecialchars($adName), array('class' => 'pr-ad-list-element-label-text'));
         $html .= ' (' . Linker::link(SpecialPage::getTitleFor('Randompage'), $this->msg('promoter-live-preview'), array('class' => 'pr-ad-list-element-label-text'), array('ad' => $adName, 'uselang' => $language, 'force' => '1')) . ')';
         // TODO: Output status icons
         $html .= Xml::tags('div', array('class' => 'pr-ad-list-element-label-icons'), '');
         $html .= Xml::closeElement('div');
     }
     // Add the ad preview
     if ($wgPromoterAdPreview) {
         $html .= $this->getInputHTML(null);
     }
     $html .= Xml::closeElement('div');
     return $html;
 }
开发者ID:kolzchut,项目名称:mediawiki-extensions-Promoter,代码行数:26,代码来源:HTMLPromoterAd.php

示例2: execute

 /**
  * Show the special page
  * @param string|null $par
  */
 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->addModuleStyles('mediawiki.special');
     $out->addHTML(\Html::openElement('table', array('class' => 'wikitable mw-listgrouprights-table')) . '<tr>' . \Html::element('th', null, $this->msg('listgrants-grant')->text()) . \Html::element('th', null, $this->msg('listgrants-rights')->text()) . '</tr>');
     foreach ($this->getConfig()->get('GrantPermissions') as $grant => $rights) {
         $descs = array();
         $rights = array_filter($rights);
         // remove ones with 'false'
         foreach ($rights as $permission => $granted) {
             $descs[] = $this->msg('listgrouprights-right-display', \User::getRightDescription($permission), '<span class="mw-listgrants-right-name">' . $permission . '</span>')->parse();
         }
         if (!count($descs)) {
             $grantCellHtml = '';
         } else {
             sort($descs);
             $grantCellHtml = '<ul><li>' . implode("</li>\n<li>", $descs) . '</li></ul>';
         }
         $id = \Sanitizer::escapeId($grant);
         $out->addHTML(\Html::rawElement('tr', array('id' => $id), "<td>" . $this->msg("grant-{$grant}")->escaped() . "</td>" . "<td>" . $grantCellHtml . '</td>'));
     }
     $out->addHTML(\Html::closeElement('table'));
 }
开发者ID:Gomyul,项目名称:mediawiki,代码行数:29,代码来源:SpecialListgrants.php

示例3: efGPManagerCustomToolboxAppend

function efGPManagerCustomToolboxAppend(&$skin)
{
    global $wgOut, $wgUser;
    $tb = explode("\n", wfMsg('toolbox_append'));
    $new = array();
    foreach ($tb as &$nt) {
        if (strpos($nt, '*') === 0) {
            $nt = trim($nt, '*');
            $parts = explode('|', $nt);
            foreach ($parts as &$part) {
                $part = trim($part);
            }
            $href = wfMsgForContent($parts[0]);
            $text = wfMsgForContent($parts[1]);
            $perm = array_key_exists(2, $parts) ? $parts[2] : 'read';
            if (!$wgUser->isAllowed($perm)) {
                continue;
            }
            if (wfEmptyMsg($parts[0], $href)) {
                $href = $parts[0];
            }
            if (wfEmptyMsg($parts[1], $text)) {
                $text = $parts[1];
            }
            $id = Sanitizer::escapeId($parts[1], 'noninitial');
            $new[] = array($href, $text, $id);
        }
    }
    foreach ($new as $t) {
        echo '<li id="t-' . $t[2] . '"><a href="' . htmlspecialchars($t[0]) . '">' . $t[1] . '</a></li>';
    }
    return true;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:33,代码来源:CustomToolbox.php

示例4: efConfigureAjax

/**
 * Ajax function to create checkboxes for a new group in $wgGroupPermissions
 *
 * @param String $group new group name
 * @return either <err#> if group already exist or html fragment
 */
function efConfigureAjax($group)
{
    global $wgUser, $wgGroupPermissions;
    if (!$wgUser->isAllowed('configure-all')) {
        return '<err#>';
    }
    if (isset($wgGroupPermissions[$group])) {
        $html = '<err#>';
    } else {
        if (is_callable(array('User', 'getAllRights'))) {
            // 1.13 +
            $all = User::getAllRights();
        } else {
            $all = array();
            foreach ($wgGroupPermissions as $rights) {
                $all = array_merge($all, array_keys($rights));
            }
            $all = array_unique($all);
        }
        $row = '<div style="-moz-column-count:2"><ul>';
        foreach ($all as $right) {
            $id = Sanitizer::escapeId('wpwgGroupPermissions-' . $group . '-' . $right);
            $desc = is_callable(array('User', 'getRightDescription')) ? User::getRightDescription($right) : $right;
            $row .= '<li>' . Xml::checkLabel($desc, $id, $id) . "</li>\n";
        }
        $row .= '</ul></div>';
        $groupName = User::getGroupName($group);
        // Firefox seems to not like that :(
        $html = str_replace('&nbsp;', ' ', $row);
    }
    return $html;
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:38,代码来源:Configure.func.php

示例5: getToCLinkID

 /**
  * Get unique id for ToC Link/header
  * @param $header
  * @return string
  */
 public function getToCLinkID($header)
 {
     $link = Sanitizer::escapeId(htmlspecialchars($header));
     $link2 = $link;
     $linkCounter = 1;
     while (in_array($link2, $this->tocLinks)) {
         $link2 = $link . '_' . $linkCounter;
         $spPageLinkCounter++;
     }
     $this->tocLinks[] = $link2;
     return $link2;
 }
开发者ID:wikimedia,项目名称:mediawiki-extensions-CollaborationKit,代码行数:17,代码来源:CollaborationHubTOC.php

示例6: execute

    /**
     * Show the special page
     * @param string|null $par
     */
    public function execute($par)
    {
        $this->setHeaders();
        $this->outputHeader();
        $out = $this->getOutput();
        $out->addModuleStyles('mediawiki.special');
        $out->wrapWikiMsg("<div class=\"mw-listgrouprights-key\">\n\$1\n</div>", 'listgrouprights-key');
        $out->addHTML(Xml::openElement('table', ['class' => 'wikitable mw-listgrouprights-table']) . '<tr>' . Xml::element('th', null, $this->msg('listgrouprights-group')->text()) . Xml::element('th', null, $this->msg('listgrouprights-rights')->text()) . '</tr>');
        $config = $this->getConfig();
        $groupPermissions = $config->get('GroupPermissions');
        $revokePermissions = $config->get('RevokePermissions');
        $addGroups = $config->get('AddGroups');
        $removeGroups = $config->get('RemoveGroups');
        $groupsAddToSelf = $config->get('GroupsAddToSelf');
        $groupsRemoveFromSelf = $config->get('GroupsRemoveFromSelf');
        $allGroups = array_unique(array_merge(array_keys($groupPermissions), array_keys($revokePermissions), array_keys($addGroups), array_keys($removeGroups), array_keys($groupsAddToSelf), array_keys($groupsRemoveFromSelf)));
        asort($allGroups);
        foreach ($allGroups as $group) {
            $permissions = isset($groupPermissions[$group]) ? $groupPermissions[$group] : [];
            $groupname = $group == '*' ? 'all' : $group;
            $msg = $this->msg('group-' . $groupname);
            $groupnameLocalized = !$msg->isBlank() ? $msg->text() : $groupname;
            $msg = $this->msg('grouppage-' . $groupname)->inContentLanguage();
            $grouppageLocalized = !$msg->isBlank() ? $msg->text() : MWNamespace::getCanonicalName(NS_PROJECT) . ':' . $groupname;
            $grouppageLocalizedTitle = Title::newFromText($grouppageLocalized);
            if ($group == '*' || !$grouppageLocalizedTitle) {
                // Do not make a link for the generic * group or group with invalid group page
                $grouppage = htmlspecialchars($groupnameLocalized);
            } else {
                $grouppage = Linker::link($grouppageLocalizedTitle, htmlspecialchars($groupnameLocalized));
            }
            if ($group === 'user') {
                // Link to Special:listusers for implicit group 'user'
                $grouplink = '<br />' . Linker::linkKnown(SpecialPage::getTitleFor('Listusers'), $this->msg('listgrouprights-members')->escaped());
            } elseif (!in_array($group, $config->get('ImplicitGroups'))) {
                $grouplink = '<br />' . Linker::linkKnown(SpecialPage::getTitleFor('Listusers'), $this->msg('listgrouprights-members')->escaped(), [], ['group' => $group]);
            } else {
                // No link to Special:listusers for other implicit groups as they are unlistable
                $grouplink = '';
            }
            $revoke = isset($revokePermissions[$group]) ? $revokePermissions[$group] : [];
            $addgroups = isset($addGroups[$group]) ? $addGroups[$group] : [];
            $removegroups = isset($removeGroups[$group]) ? $removeGroups[$group] : [];
            $addgroupsSelf = isset($groupsAddToSelf[$group]) ? $groupsAddToSelf[$group] : [];
            $removegroupsSelf = isset($groupsRemoveFromSelf[$group]) ? $groupsRemoveFromSelf[$group] : [];
            $id = $group == '*' ? false : Sanitizer::escapeId($group);
            $out->addHTML(Html::rawElement('tr', ['id' => $id], "\n\t\t\t\t<td>{$grouppage}{$grouplink}</td>\n\t\t\t\t\t<td>" . $this->formatPermissions($permissions, $revoke, $addgroups, $removegroups, $addgroupsSelf, $removegroupsSelf) . '</td>
				'));
        }
        $out->addHTML(Xml::closeElement('table'));
        $this->outputNamespaceProtectionInfo();
    }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:56,代码来源:SpecialListgrouprights.php

示例7: renderTag

 /**
  * @param $input
  * @param $args
  * @param Parser $parser
  * @return string
  */
 public function renderTag($input, $args, Parser $parser)
 {
     wfProfileIn(__METHOD__);
     // there must be something between tags
     if (empty($input)) {
         wfProfileOut(__METHOD__);
         return '';
     }
     // we support only the Oasis skin for this feature
     if (!F::app()->checkSkin('oasis')) {
         wfProfileOut(__METHOD__);
         return '';
     }
     $widgetType = 'Widget' . Sanitizer::escapeId($input, 0);
     // try to load widget
     if ($this->load($widgetType) == false) {
         wfProfileOut(__METHOD__);
         return '';
     }
     // seek for style attribute (RT #19092)
     if (isset($args['style'])) {
         $style = ' style="' . htmlspecialchars($args['style']) . '"';
         unset($args['style']);
     } else {
         $style = '';
     }
     // create array for getParams method of widget framework
     $id = 'widget_' . $this->count++;
     $widget = array('type' => $widgetType, 'id' => $id, 'param' => $args, 'widgetTag' => true);
     // configure widget
     $widgetParams = $this->getParams($widget);
     // set additional params
     $widgetParams['skinname'] = $this->skinname;
     // inform widget he's rendered by WidgetTag
     $widgetParams['_widgetTag'] = true;
     // try to display it using widget function
     $output = $widgetType($id, $widgetParams);
     // Add any required javascript and CSS for the widget
     #$output .= $this->getAssets($widget);
     // wrap widget content
     $output = $this->wrap($widget, $output);
     // wrap widget HTML
     $output = "<div class=\"widgetTag\"{$style}>{$output}</div>";
     // use markers to avoid RT #20855 when widget' HTML is multiline
     $marker = $parser->uniqPrefix() . "-WIDGET-{$this->count}-";
     $this->markers[$marker] = $output;
     wfProfileOut(__METHOD__);
     return $marker;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:55,代码来源:WidgetTagRenderer.class.php

示例8: execute

    /**
     * Show the special page
     */
    public function execute($par)
    {
        global $wgImplicitGroups;
        global $wgGroupPermissions, $wgRevokePermissions, $wgAddGroups, $wgRemoveGroups;
        global $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
        $out = $this->getOutput();
        $this->setHeaders();
        $this->outputHeader();
        $out->addModuleStyles('mediawiki.special');
        $out->addHTML(Xml::openElement('table', array('class' => 'wikitable mw-listgrouprights-table')) . '<tr>' . Xml::element('th', null, wfMsg('listgrouprights-group')) . Xml::element('th', null, wfMsg('listgrouprights-rights')) . '</tr>');
        $allGroups = array_unique(array_merge(array_keys($wgGroupPermissions), array_keys($wgRevokePermissions), array_keys($wgAddGroups), array_keys($wgRemoveGroups), array_keys($wgGroupsAddToSelf), array_keys($wgGroupsRemoveFromSelf)));
        asort($allGroups);
        foreach ($allGroups as $group) {
            $permissions = isset($wgGroupPermissions[$group]) ? $wgGroupPermissions[$group] : array();
            $groupname = $group == '*' ? 'all' : $group;
            $msg = wfMessage('group-' . $groupname);
            $groupnameLocalized = !$msg->isBlank() ? $msg->text() : $groupname;
            $msg = wfMessage('grouppage-' . $groupname)->inContentLanguage();
            $grouppageLocalized = !$msg->isBlank() ? $msg->text() : MWNamespace::getCanonicalName(NS_PROJECT) . ':' . $groupname;
            if ($group == '*') {
                // Do not make a link for the generic * group
                $grouppage = htmlspecialchars($groupnameLocalized);
            } else {
                $grouppage = Linker::link(Title::newFromText($grouppageLocalized), htmlspecialchars($groupnameLocalized));
            }
            if ($group === 'user') {
                // Link to Special:listusers for implicit group 'user'
                $grouplink = '<br />' . Linker::link(SpecialPage::getTitleFor('Listusers'), wfMsgHtml('listgrouprights-members'), array(), array(), array('known', 'noclasses'));
            } elseif (!in_array($group, $wgImplicitGroups)) {
                $grouplink = '<br />' . Linker::link(SpecialPage::getTitleFor('Listusers'), wfMsgHtml('listgrouprights-members'), array(), array('group' => $group), array('known', 'noclasses'));
            } else {
                // No link to Special:listusers for other implicit groups as they are unlistable
                $grouplink = '';
            }
            $revoke = isset($wgRevokePermissions[$group]) ? $wgRevokePermissions[$group] : array();
            $addgroups = isset($wgAddGroups[$group]) ? $wgAddGroups[$group] : array();
            $removegroups = isset($wgRemoveGroups[$group]) ? $wgRemoveGroups[$group] : array();
            $addgroupsSelf = isset($wgGroupsAddToSelf[$group]) ? $wgGroupsAddToSelf[$group] : array();
            $removegroupsSelf = isset($wgGroupsRemoveFromSelf[$group]) ? $wgGroupsRemoveFromSelf[$group] : array();
            $id = $group == '*' ? false : Sanitizer::escapeId($group);
            $out->addHTML(Html::rawElement('tr', array('id' => $id), "\n\t\t\t\t<td>{$grouppage}{$grouplink}</td>\n\t\t\t\t\t<td>" . self::formatPermissions($permissions, $revoke, $addgroups, $removegroups, $addgroupsSelf, $removegroupsSelf) . '</td>
				'));
        }
        $out->addHTML(Xml::closeElement('table') . "\n<br /><hr />\n");
        $out->wrapWikiMsg("<div class=\"mw-listgrouprights-key\">\n\$1\n</div>", 'listgrouprights-key');
    }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:49,代码来源:SpecialListgrouprights.php

示例9: formatOptions

 function formatOptions($options, $value)
 {
     $html = '';
     $attribs = $this->getAttributes(array('disabled', 'tabindex'));
     $elementFunc = array('Html', $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element');
     # @todo Should this produce an unordered list perhaps?
     foreach ($options as $label => $info) {
         if (is_array($info)) {
             $html .= Html::rawElement('h1', array(), $label) . "\n";
             $html .= $this->formatOptions($info, $value);
         } else {
             $id = Sanitizer::escapeId($this->mID . "-{$info}");
             $radio = Xml::radio($this->mName, $info, $info === $value, $attribs + array('id' => $id));
             $radio .= '&#160;' . call_user_func($elementFunc, 'label', array('for' => $id), $label);
             $html .= ' ' . Html::rawElement('div', array('class' => 'mw-htmlform-flatlist-item'), $radio);
         }
     }
     return $html;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:19,代码来源:HTMLRadioField.php

示例10: efCategoryMembersOnSidebar

/**
 * Hook point to SkinBuildSidebar
 * 
 * Finds all top-level entries in the sidebar that have the format category:$1|$2.
 * Replaces the entry with a list of pages in Category:$1 and changes the label
 * to $2, or $1 if $2 not available.
 * 
 * @param $skin Skin
 * @param $bar array
 * @return bool True
 */
function efCategoryMembersOnSidebar($skin, &$bar)
{
    $newbar = array();
    $i = 0;
    foreach ($bar as $key => $data) {
        # Check if this entry needs to be handled by this extension
        $matches = array();
        preg_match('/category\\:([^|]*)\\|?([^|]*)/i', $key, $matches);
        if ($matches) {
            # Extract the new message key
            $newkey = trim($matches[2]) ? trim($matches[2]) : $matches[1];
            # Extract category members
            $cat = Category::newFromName($matches[1]);
            if (!$cat) {
                # Invalid title
                continue;
            }
            $members = $cat->getMembers();
            if ($members->count()) {
                # Create the subbar
                $subbar = array();
                foreach ($members as $title) {
                    $subbar[] = array('text' => $title->getText(), 'href' => $title->getLocalURL(), 'id' => 'catsb-' . Sanitizer::escapeId($title->getText()), 'active' => false);
                }
                $bar[$key] = $subbar;
                # Store the index of this top-level entry, because we need to
                # replace the key later with our new key
                $newbar[$i] = $newkey;
            }
        }
        $i++;
    }
    if ($newbar) {
        # Replace the keys without changing the order
        $keys = array_keys($bar);
        foreach ($newbar as $i => $newkey) {
            array_splice($keys, $i, 1, $newkey);
        }
        $bar = array_combine($keys, array_values($bar));
    }
    return true;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:53,代码来源:CategoryMembersOnSidebar.php

示例11: outputPortlet

    /**
     * Outputs a single sidebar portlet of any kind.
     */
    private function outputPortlet($box)
    {
        if (!$box['content']) {
            return;
        }
        ?>
		<div
			role="navigation"
			class="mw-portlet"
			id="<?php 
        echo Sanitizer::escapeId($box['id']);
        ?>
"
			<?php 
        echo Linker::tooltip($box['id']);
        ?>
		>
			<h3>
				<?php 
        if (isset($box['headerMessage'])) {
            $this->msg($box['headerMessage']);
        } else {
            echo htmlspecialchars($box['header']);
        }
        ?>
			</h3>

			<?php 
        if (is_array($box['content'])) {
            echo '<ul>';
            foreach ($box['content'] as $key => $item) {
                echo $this->makeListItem($key, $item);
            }
            echo '</ul>';
        } else {
            echo $box['content'];
        }
        ?>
		</div>
		<?php 
    }
开发者ID:amazingrando,项目名称:Wiki,代码行数:44,代码来源:DrinkingAndDragons.skin.php

示例12: formatOptions

 function formatOptions($options, $value)
 {
     global $wgUseMediaWikiUIEverywhere;
     $html = '';
     $attribs = $this->getAttributes(['disabled', 'tabindex']);
     $elementFunc = ['Html', $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element'];
     # @todo Should this produce an unordered list perhaps?
     foreach ($options as $label => $info) {
         if (is_array($info)) {
             $html .= Html::rawElement('h1', [], $label) . "\n";
             $html .= $this->formatOptions($info, $value);
         } else {
             $id = Sanitizer::escapeId($this->mID . "-{$info}");
             $classes = ['mw-htmlform-flatlist-item'];
             if ($wgUseMediaWikiUIEverywhere || $this->mParent instanceof VFormHTMLForm) {
                 $classes[] = 'mw-ui-radio';
             }
             $radio = Xml::radio($this->mName, $info, $info === $value, $attribs + ['id' => $id]);
             $radio .= '&#160;' . call_user_func($elementFunc, 'label', ['for' => $id], $label);
             $html .= ' ' . Html::rawElement('div', ['class' => $classes], $radio);
         }
     }
     return $html;
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:24,代码来源:HTMLRadioField.php

示例13: getSearchForm

 /**
  * Generate search form
  *
  * @param string $type
  * @return string HTML
  *
  */
 public function getSearchForm($type = 'standard')
 {
     // Use button label fallbacks
     if (!$this->mButtonLabel) {
         $this->mButtonLabel = wfMessage('search')->text();
     }
     if ($this->mID !== '') {
         $this->mID = Sanitizer::escapeId($this->mID);
         $idArray = array('id' => $this->mID);
     } else {
         $idArray = array();
     }
     $inputID = 'searchInput' . ($this->mID ?: rand());
     $htmlLabel = '';
     $classes = array();
     if (isset($this->mLabelText) && strlen(trim($this->mLabelText))) {
         $this->mLabelText = $this->mParser->recursiveTagParse($this->mLabelText);
     } else {
         // No user supplied label, so apply a default but show it only to screen-readers
         $this->mLabelText = wfMessage('search');
         $classes = array('sr-only');
     }
     $htmlLabel = Html::element('label', array('for' => $inputID, 'class' => implode(' ', $classes)), $this->mLabelText);
     $classes = array('searchForm', 'hidden-print');
     if ($this->mInline === 'yes') {
         $classes[] = 'form-inline';
     }
     if ($this->mMobile === 'no') {
         $classes[] = 'hidden-xs';
     }
     if ($type === 'mainpage') {
         $classes[] = 'mainPageSearchForm';
     }
     $htmlOut = Html::openElement('form', array('name' => 'searchForm' . $this->mID, 'class' => implode(' ', $classes), 'action' => SpecialPage::getTitleFor('Search')->getLocalURL()) + $idArray);
     if ($this->mCategory != '') {
         $htmlOut .= Xml::element('input', array('name' => 'category', 'type' => 'hidden', 'value' => $this->mCategory));
     }
     $classes = array('input-group');
     if ($type === 'mainpage' || $this->mElementSize === 'large') {
         $classes[] = 'input-group-lg';
     } elseif ($this->mElementSize === 'small') {
         $classes[] = 'input-group-sm';
     }
     if (is_array($this->mWidthClasses)) {
         $classes = array_merge($classes, $this->mWidthClasses);
     }
     $htmlOut .= Html::openElement('div', array('class' => implode(' ', $classes)));
     $htmlOut .= $htmlLabel;
     $classes = array('form-control', 'mw-searchInput');
     if ($this->mInternal === 'yes') {
         $classes[] = 'internalSearch';
     }
     $htmlOut .= Html::element('input', array('id' => $inputID, 'type' => 'text', 'name' => 'search', 'dir' => $this->mDir, 'value' => $this->mDefaultText, 'class' => implode(' ', $classes), 'placeholder' => $this->mPlaceholderText, 'required' => 'required'));
     $htmlOut .= Html::openElement('span', array('class' => 'input-group-btn'));
     $classes = array('btn', 'searchBtn');
     if ($this->mFancyButton === 'yes' || $type === 'mainpage') {
         $classes[] = 'btn-default';
     }
     $htmlOut .= Html::openElement('button', array('type' => 'submit', 'name' => 'go', 'title' => $this->mButtonLabel, 'class' => implode(' ', $classes)));
     $htmlOut .= Html::openElement('span', array('class' => 'btn-text' . ($this->mHiddenButtonLabel === 'yes' ? ' sr-only' : '')));
     $htmlOut .= $this->mButtonLabel . '&nbsp;';
     $htmlOut .= Html::closeElement('span');
     // button text
     $htmlOut .= Html::element('span', array('class' => 'fa fa-search'));
     $htmlOut .= Html::closeElement('button');
     // button
     $htmlOut .= Xml::closeElement('span');
     // input-group-btn
     $htmlOut .= Xml::closeElement('div');
     $htmlOut .= Xml::closeElement('form');
     if ($type === 'mainpage') {
         $this->mParser->getOutput()->addModuleStyles('ext.searchboxes.mainpage.styles');
     }
     // Return HTML
     return $htmlOut;
 }
开发者ID:kolzchut,项目名称:mediawiki-extensions-SearchBoxes,代码行数:83,代码来源:SearchBoxes.classes.php

示例14: guessLegacySectionNameFromWikiText

 /**
  * Same as guessSectionNameFromWikiText(), but produces legacy anchors
  * instead.  For use in redirects, since IE6 interprets Redirect: headers
  * as something other than UTF-8 (apparently?), resulting in breakage.
  *
  * @param string $text The section name
  * @return string An anchor
  */
 public function guessLegacySectionNameFromWikiText($text)
 {
     # Strip out wikitext links(they break the anchor)
     $text = $this->stripSectionName($text);
     $text = Sanitizer::normalizeSectionNameWhitespace($text);
     return '#' . Sanitizer::escapeId($text, array('noninitial', 'legacy'));
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:15,代码来源:Parser.php

示例15: renderPortal

    private function renderPortal($name, $content, $msg = null, $hook = null)
    {
        if ($msg === null) {
            $msg = $name;
        }
        ?>
<div class="portal" id='<?php 
        echo Sanitizer::escapeId("p-{$name}");
        ?>
'<?php 
        echo Linker::tooltip('p-' . $name);
        ?>
>
	<h5<?php 
        $this->html('userlangattributes');
        ?>
><?php 
        $msgObj = wfMessage($msg);
        echo htmlspecialchars($msgObj->exists() ? $msgObj->text() : $msg);
        ?>
</h5>
	<div class="body">
<?php 
        if (is_array($content)) {
            ?>
		<ul>
<?php 
            foreach ($content as $key => $val) {
                ?>
			<?php 
                echo $this->makeListItem($key, $val);
                ?>

<?php 
            }
            if ($hook !== null) {
                wfRunHooks($hook, array(&$this, true));
            }
            ?>
		</ul>
<?php 
        } else {
            ?>
		<?php 
            echo $content;
            /* Allow raw HTML block to be defined by extensions */
        }
        ?>
	</div>
</div>
<?php 
    }
开发者ID:gestos,项目名称:mediawiki,代码行数:52,代码来源:Vector.php


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