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


PHP ContentHandler::getContentModels方法代码示例

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


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

示例1: provideHandlers

 public static function provideHandlers()
 {
     $models = ContentHandler::getContentModels();
     $handlers = [];
     foreach ($models as $model) {
         $handlers[] = [ContentHandler::getForModelID($model)];
     }
     return $handlers;
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:9,代码来源:ContentHandlerSanityTest.php

示例2: getOptionsForTitle

 private function getOptionsForTitle(Title $title = null)
 {
     $models = ContentHandler::getContentModels();
     $options = array();
     foreach ($models as $model) {
         $handler = ContentHandler::getForModelID($model);
         if (!$handler->supportsDirectEditing()) {
             continue;
         }
         if ($title) {
             if ($title->getContentModel() === $model) {
                 continue;
             }
             if (!$handler->canBeUsedOn($title)) {
                 continue;
             }
         }
         $options[ContentHandler::getLocalizedName($model)] = $model;
     }
     return $options;
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:21,代码来源:SpecialChangeContentModel.php

示例3: getAllowedParams

 public function getAllowedParams()
 {
     return array('title' => array(ApiBase::PARAM_DFLT => 'API'), 'text' => null, 'summary' => null, 'page' => null, 'pageid' => array(ApiBase::PARAM_TYPE => 'integer'), 'redirects' => false, 'oldid' => array(ApiBase::PARAM_TYPE => 'integer'), 'prop' => array(ApiBase::PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections|revid|displaytitle|iwlinks|properties', ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_TYPE => array('text', 'langlinks', 'languageshtml', 'categories', 'categorieshtml', 'links', 'templates', 'images', 'externallinks', 'sections', 'revid', 'displaytitle', 'headitems', 'headhtml', 'iwlinks', 'wikitext', 'properties')), 'pst' => false, 'onlypst' => false, 'uselang' => null, 'section' => null, 'disablepp' => false, 'generatexml' => false, 'contentformat' => array(ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats()), 'contentmodel' => array(ApiBase::PARAM_TYPE => ContentHandler::getContentModels()));
 }
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:4,代码来源:ApiParse.php

示例4: getAllowedParams

 public function getAllowedParams()
 {
     return array('title' => array(ApiBase::PARAM_TYPE => 'string'), 'pageid' => array(ApiBase::PARAM_TYPE => 'integer'), 'section' => null, 'sectiontitle' => array(ApiBase::PARAM_TYPE => 'string'), 'text' => array(ApiBase::PARAM_TYPE => 'text'), 'summary' => null, 'tags' => array(ApiBase::PARAM_TYPE => ChangeTags::listExplicitlyDefinedTags(), ApiBase::PARAM_ISMULTI => true), 'minor' => false, 'notminor' => false, 'bot' => false, 'basetimestamp' => array(ApiBase::PARAM_TYPE => 'timestamp'), 'starttimestamp' => array(ApiBase::PARAM_TYPE => 'timestamp'), 'recreate' => false, 'createonly' => false, 'nocreate' => false, 'watch' => array(ApiBase::PARAM_DFLT => false, ApiBase::PARAM_DEPRECATED => true), 'unwatch' => array(ApiBase::PARAM_DFLT => false, ApiBase::PARAM_DEPRECATED => true), 'watchlist' => array(ApiBase::PARAM_DFLT => 'preferences', ApiBase::PARAM_TYPE => array('watch', 'unwatch', 'preferences', 'nochange')), 'md5' => null, 'prependtext' => array(ApiBase::PARAM_TYPE => 'text'), 'appendtext' => array(ApiBase::PARAM_TYPE => 'text'), 'undo' => array(ApiBase::PARAM_TYPE => 'integer'), 'undoafter' => array(ApiBase::PARAM_TYPE => 'integer'), 'redirect' => array(ApiBase::PARAM_TYPE => 'boolean', ApiBase::PARAM_DFLT => false), 'contentformat' => array(ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats()), 'contentmodel' => array(ApiBase::PARAM_TYPE => ContentHandler::getContentModels()), 'token' => array(ApiBase::PARAM_HELP_MSG_APPEND => array('apihelp-edit-param-token')));
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:4,代码来源:ApiEditPage.php

示例5: getAllowedParams

 public function getAllowedParams()
 {
     return array('title' => null, 'text' => array(ApiBase::PARAM_TYPE => 'text'), 'summary' => null, 'page' => null, 'pageid' => array(ApiBase::PARAM_TYPE => 'integer'), 'redirects' => false, 'oldid' => array(ApiBase::PARAM_TYPE => 'integer'), 'prop' => array(ApiBase::PARAM_DFLT => 'text|langlinks|categories|links|templates|' . 'images|externallinks|sections|revid|displaytitle|iwlinks|properties', ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_TYPE => array('text', 'langlinks', 'categories', 'categorieshtml', 'links', 'templates', 'images', 'externallinks', 'sections', 'revid', 'displaytitle', 'headitems', 'headhtml', 'modules', 'jsconfigvars', 'encodedjsconfigvars', 'indicators', 'iwlinks', 'wikitext', 'properties', 'limitreportdata', 'limitreporthtml', 'parsetree'), ApiBase::PARAM_HELP_MSG_PER_VALUE => array('parsetree' => array('apihelp-parse-paramvalue-prop-parsetree', CONTENT_MODEL_WIKITEXT))), 'pst' => false, 'onlypst' => false, 'effectivelanglinks' => false, 'section' => null, 'sectiontitle' => array(ApiBase::PARAM_TYPE => 'string'), 'disablepp' => array(ApiBase::PARAM_DFLT => false, ApiBase::PARAM_DEPRECATED => true), 'disablelimitreport' => false, 'disableeditsection' => false, 'disabletidy' => false, 'generatexml' => array(ApiBase::PARAM_DFLT => false, ApiBase::PARAM_HELP_MSG => array('apihelp-parse-param-generatexml', CONTENT_MODEL_WIKITEXT), ApiBase::PARAM_DEPRECATED => true), 'preview' => false, 'sectionpreview' => false, 'disabletoc' => false, 'contentformat' => array(ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats()), 'contentmodel' => array(ApiBase::PARAM_TYPE => ContentHandler::getContentModels()));
 }
开发者ID:huatuoorg,项目名称:mediawiki,代码行数:4,代码来源:ApiParse.php

示例6: getAllowedParams

 public function getAllowedParams()
 {
     return array('title' => array(ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true), 'section' => array(ApiBase::PARAM_TYPE => 'string'), 'sectiontitle' => array(ApiBase::PARAM_TYPE => 'string'), 'text' => array(ApiBase::PARAM_TYPE => 'text', ApiBase::PARAM_REQUIRED => true), 'contentmodel' => array(ApiBase::PARAM_TYPE => ContentHandler::getContentModels(), ApiBase::PARAM_REQUIRED => true), 'contentformat' => array(ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(), ApiBase::PARAM_REQUIRED => true), 'baserevid' => array(ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_REQUIRED => true));
 }
开发者ID:natebrunette,项目名称:sphericalcow,代码行数:4,代码来源:ApiStashEdit.php

示例7: getAllowedParams

 public function getAllowedParams()
 {
     return array('title' => array(ApiBase::PARAM_TYPE => 'string'), 'pageid' => array(ApiBase::PARAM_TYPE => 'integer'), 'section' => null, 'sectiontitle' => array(ApiBase::PARAM_TYPE => 'string'), 'text' => null, 'token' => array(ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true), 'summary' => null, 'minor' => false, 'notminor' => false, 'bot' => false, 'basetimestamp' => null, 'starttimestamp' => null, 'recreate' => false, 'createonly' => false, 'nocreate' => false, 'watch' => array(ApiBase::PARAM_DFLT => false, ApiBase::PARAM_DEPRECATED => true), 'unwatch' => array(ApiBase::PARAM_DFLT => false, ApiBase::PARAM_DEPRECATED => true), 'watchlist' => array(ApiBase::PARAM_DFLT => 'preferences', ApiBase::PARAM_TYPE => array('watch', 'unwatch', 'preferences', 'nochange')), 'md5' => null, 'prependtext' => null, 'appendtext' => null, 'undo' => array(ApiBase::PARAM_TYPE => 'integer'), 'undoafter' => array(ApiBase::PARAM_TYPE => 'integer'), 'redirect' => array(ApiBase::PARAM_TYPE => 'boolean', ApiBase::PARAM_DFLT => false), 'contentformat' => array(ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats()), 'contentmodel' => array(ApiBase::PARAM_TYPE => ContentHandler::getContentModels()));
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:4,代码来源:ApiEditPage.php

示例8: getSearchIndexFields

 /**
  * Get fields for search index
  * @since 1.28
  * @return SearchIndexField[] Index field definitions for all content handlers
  */
 public function getSearchIndexFields()
 {
     $models = ContentHandler::getContentModels();
     $fields = [];
     foreach ($models as $model) {
         $handler = ContentHandler::getForModelID($model);
         $handlerFields = $handler->getFieldsForSearchIndex($this);
         foreach ($handlerFields as $fieldName => $fieldData) {
             if (empty($fields[$fieldName])) {
                 $fields[$fieldName] = $fieldData;
             } else {
                 // TODO: do we allow some clashes with the same type or reject all of them?
                 $mergeDef = $fields[$fieldName]->merge($fieldData);
                 if (!$mergeDef) {
                     throw new InvalidArgumentException("Duplicate field {$fieldName} for model {$model}");
                 }
                 $fields[$fieldName] = $mergeDef;
             }
         }
     }
     // Hook to allow extensions to produce search mapping fields
     Hooks::run('SearchIndexFields', [&$fields, $this]);
     return $fields;
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:29,代码来源:SearchEngine.php

示例9: getAllowedParams

 public function getAllowedParams()
 {
     return ['title' => [ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true], 'section' => [ApiBase::PARAM_TYPE => 'string'], 'sectiontitle' => [ApiBase::PARAM_TYPE => 'string'], 'text' => [ApiBase::PARAM_TYPE => 'text', ApiBase::PARAM_DFLT => null], 'stashedtexthash' => [ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_DFLT => null], 'summary' => [ApiBase::PARAM_TYPE => 'string'], 'contentmodel' => [ApiBase::PARAM_TYPE => ContentHandler::getContentModels(), ApiBase::PARAM_REQUIRED => true], 'contentformat' => [ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(), ApiBase::PARAM_REQUIRED => true], 'baserevid' => [ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_REQUIRED => true]];
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:4,代码来源:ApiStashEdit.php


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