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


PHP LogPage::validTypes方法代码示例

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


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

示例1: getTypeSelector

 /**
  * Returns log page selector.
  * @return XmlSelect
  * @since 1.19
  */
 public function getTypeSelector()
 {
     $typesByName = array();
     // Temporary array
     // First pass to load the log names
     foreach (LogPage::validTypes() as $type) {
         $page = new LogPage($type);
         $restriction = $page->getRestriction();
         if ($this->getUser()->isAllowed($restriction)) {
             $typesByName[$type] = $page->getName()->text();
         }
     }
     // Second pass to sort by name
     asort($typesByName);
     // Always put "All public logs" on top
     $public = $typesByName[''];
     unset($typesByName['']);
     $typesByName = array('' => $public) + $typesByName;
     $select = new XmlSelect('type');
     foreach ($typesByName as $type => $name) {
         $select->addOption($name, $type);
     }
     return $select;
 }
开发者ID:OrBin,项目名称:mediawiki,代码行数:29,代码来源:LogEventsList.php

示例2: isLogType

 /**
  * Is $type a valid log type
  *
  * @param $type String: log type to check
  * @return Boolean
  */
 public static function isLogType($type)
 {
     return in_array($type, LogPage::validTypes());
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:10,代码来源:LogPage.php

示例3: getTypeMenu

 /**
  * @param $queryTypes Array
  * @return String: Formatted HTML
  */
 private function getTypeMenu($queryTypes)
 {
     global $wgLogRestrictions, $wgUser;
     $html = "<select name='type'>\n";
     $validTypes = LogPage::validTypes();
     $typesByName = array();
     // Temporary array
     // First pass to load the log names
     foreach ($validTypes as $type) {
         $text = LogPage::logName($type);
         $typesByName[$type] = $text;
     }
     // Second pass to sort by name
     asort($typesByName);
     // Note the query type
     $queryType = count($queryTypes) == 1 ? $queryTypes[0] : '';
     // Always put "All public logs" on top
     if (isset($typesByName[''])) {
         $all = $typesByName[''];
         unset($typesByName['']);
         $typesByName = array('' => $all) + $typesByName;
     }
     // Third pass generates sorted XHTML content
     foreach ($typesByName as $type => $text) {
         $selected = $type == $queryType;
         // Restricted types
         if (isset($wgLogRestrictions[$type])) {
             if ($wgUser->isAllowed($wgLogRestrictions[$type])) {
                 $html .= Xml::option($text, $type, $selected) . "\n";
             }
         } else {
             $html .= Xml::option($text, $type, $selected) . "\n";
         }
     }
     $html .= '</select>';
     return $html;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:41,代码来源:LogEventsList.php

示例4: getTypeMenu

 /**
  * @return string Formatted HTML
  * @private
  */
 function getTypeMenu()
 {
     $out = "<select name='type'>\n";
     $validTypes = LogPage::validTypes();
     $m = array();
     // Temporary array
     // First pass to load the log names
     foreach ($validTypes as $type) {
         $text = LogPage::logName($type);
         $m[$text] = $type;
     }
     // Second pass to sort by name
     ksort($m);
     // Third pass generates sorted XHTML content
     foreach ($m as $text => $type) {
         $selected = $type == $this->reader->queryType();
         $out .= Xml::option($text, $type, $selected) . "\n";
     }
     $out .= '</select>';
     return $out;
 }
开发者ID:mediawiki-extensions,项目名称:bizzwiki,代码行数:25,代码来源:SpecialLog.php

示例5: foreach

<?php

/**
 * @todo document
 * @addtogroup Maintenance
 */
/** */
require_once "commandLine.inc";
require_once "importLogs.inc";
#print $text;
#exit();
foreach (LogPage::validTypes() as $type) {
    if ($type == '') {
        continue;
    }
    $page = LogPage::logName($type);
    $log = new Article(Title::makeTitleSafe(NS_PROJECT, $page));
    $text = $log->fetchContent();
    $importer = new LogImporter($type);
    $importer->dummy = true;
    $importer->importText($text);
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:22,代码来源:importLogs.php

示例6: getTypeMenu

 /**
  * @return string Formatted HTML
  * @private
  */
 function getTypeMenu()
 {
     $out = "<select name='type'>\n";
     foreach (LogPage::validTypes() as $type) {
         $text = htmlspecialchars(LogPage::logName($type));
         $selected = $type == $this->reader->queryType() ? ' selected="selected"' : '';
         $out .= "<option value=\"{$type}\"{$selected}>{$text}</option>\n";
     }
     $out .= "</select>\n";
     return $out;
 }
开发者ID:BackupTheBerlios,项目名称:openzaurus-svn,代码行数:15,代码来源:SpecialLog.php

示例7: getTypeMenu

 /**
  * @param $queryType String
  * @return String: Formatted HTML
  */
 private function getTypeMenu($queryType)
 {
     global $wgLogRestrictions, $wgUser;
     $html = "<select name='type'>\n";
     $validTypes = LogPage::validTypes();
     $typesByName = array();
     // Temporary array
     // First pass to load the log names
     foreach ($validTypes as $type) {
         $text = LogPage::logName($type);
         $typesByName[$text] = $type;
     }
     // Second pass to sort by name
     ksort($typesByName);
     // Third pass generates sorted XHTML content
     foreach ($typesByName as $text => $type) {
         $selected = $type == $queryType;
         // Restricted types
         if (isset($wgLogRestrictions[$type])) {
             if ($wgUser->isAllowed($wgLogRestrictions[$type])) {
                 $html .= Xml::option($text, $type, $selected) . "\n";
             }
         } else {
             $html .= Xml::option($text, $type, $selected) . "\n";
         }
     }
     $html .= '</select>';
     return $html;
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:33,代码来源:LogEventsList.php


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