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


PHP SFUtils::titleString方法代码示例

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


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

示例1: getIncomingProperties

 /**
  * Gets the set of all properties that point to this page, anywhere
  * in the wiki.
  */
 static function getIncomingProperties($title)
 {
     $store = smwfGetStore();
     // SMW 1.6+
     if (class_exists('SMWDataItem')) {
         $value = SMWDIWikiPage::newFromTitle($title);
     } else {
         $title_text = SFUtils::titleString($title);
         $value = SMWDataValueFactory::newTypeIDValue('_wpg', $title_text);
     }
     $properties = $store->getInProperties($value);
     $propertyNames = array();
     foreach ($properties as $property) {
         // SMW 1.6+
         if ($property instanceof SMWDIProperty) {
             $property_name = $property->getKey();
         } else {
             $property_name = $property->getWikiValue();
         }
         if (!empty($property_name)) {
             $propertyNames[] = $property_name;
         }
     }
     return $propertyNames;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:29,代码来源:SF_FormLinker.php

示例2: showContentForm

 protected function showContentForm()
 {
     $target_title = $this->mArticle->getTitle();
     $target_name = SFUtils::titleString($target_title);
     if ($target_title->exists()) {
         SFEditData::printEditForm($this->form_name, $target_name, $this->textbox1);
     } else {
         SFAddData::printAddForm($this->form_name, $target_name, array(), $this->textbox1);
     }
     // @todo This needs a proper form builder
 }
开发者ID:roland2025,项目名称:mediawiki-extensions-SemanticForms,代码行数:11,代码来源:SF_FormEditPage.php

示例3: getFormEditLinkForPage

 /**
  * Helper function for formEditLink() - gets the 'default form' and
  * 'alternate form' properties for a page, and creates the
  * corresponding Special:FormEdit link, if any such properties are
  * defined
  */
 static function getFormEditLinkForPage($target_page_title, $page_name, $page_namespace)
 {
     $default_forms = self::getFormsThatPagePointsTo($page_name, $page_namespace, self::DEFAULT_FORM);
     $alt_forms = self::getFormsThatPagePointsTo($page_name, $page_namespace, self::ALTERNATE_FORM);
     if (count($default_forms) == 0 && count($alt_forms) == 0) {
         return null;
     }
     $fe = SpecialPageFactory::getPage('FormEdit');
     $fe_url = $fe->getTitle()->getLocalURL();
     if (count($default_forms) > 0) {
         $form_edit_url = $fe_url . "/" . $default_forms[0] . "/" . SFUtils::titleURLString($target_page_title);
     } else {
         $form_edit_url = $fe_url;
         $form_edit_url .= strpos($form_edit_url, "?") ? "&" : "?";
         $form_edit_url .= 'target=' . urlencode(SFUtils::titleString($target_page_title));
     }
     foreach ($alt_forms as $i => $alt_form) {
         $form_edit_url .= strpos($form_edit_url, "?") ? "&" : "?";
         $form_edit_url .= "alt_form[{$i}]={$alt_form}";
     }
     // Add "redlink=1" to the query string, so that the user will
     // go to the actual page if it now exists.
     $form_edit_url .= strpos($form_edit_url, "?") ? "&" : "?";
     $form_edit_url .= "redlink=1";
     return $form_edit_url;
 }
开发者ID:paladox,项目名称:mediawiki-extensions-SemanticForms,代码行数:32,代码来源:SF_FormLinker.php

示例4: displayForm

 /**
  * The function called if we're in index.php (as opposed to one of the
  * special pages)
  */
 static function displayForm($action, $article)
 {
     global $wgOut, $sfgUseFormEditPage;
     // return "true" if the call failed (meaning, pass on handling
     // of the hook to others), and "false" otherwise
     if ($action != 'formedit') {
         return true;
     }
     // @todo: This looks like bad code. If we can't find a form, we
     // should be showing an informative error page rather than
     // making it look like an edit form page does not exist.
     $title = $article->getTitle();
     $form_names = SFFormLinker::getDefaultFormsForPage($title);
     if (count($form_names) == 0) {
         return true;
     }
     if (count($form_names) > 1) {
         $warning_text = "\t" . '<div class="warningMessage">' . wfMsg('sf_formedit_morethanoneform') . "</div>\n";
         $wgOut->addHTML($warning_text);
     }
     $form_name = $form_names[0];
     if ($sfgUseFormEditPage) {
         # Experimental new feature extending from the internal
         # EditPage class
         $editor = new SFFormEditPage($article, $form_name);
         $editor->edit();
         return false;
     }
     $page_name = SFUtils::titleString($title);
     $msg = SFFormEdit::printForm($form_name, $page_name);
     if ($msg) {
         // Some error occurred - display it.
         $msgdata = null;
         if (is_array($msg)) {
             if (count($msg) > 1) {
                 $msgdata = $msg[1];
             }
             $msg = $msg[0];
         }
         $wgOut->addHTML(Html::element('p', array('class' => 'error'), wfMsg($msg, $msgdata)));
     }
     return false;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:47,代码来源:SF_FormEditTab.php

示例5: displayForm

 /**
  * The function called if we're in index.php (as opposed to one of the
  * special pages)
  */
 static function displayForm($action, $article)
 {
     // @todo: This looks like bad code. If we can't find a form, we
     // should be showing an informative error page rather than
     // making it look like an edit form page does not exist.
     $title = $article->getTitle();
     $form_names = SFFormLinker::getDefaultFormsForPage($title);
     if (count($form_names) == 0) {
         return true;
     }
     $output = $action->getOutput();
     if (count($form_names) > 1) {
         $warning_text = "\t" . '<div class="warningbox">' . wfMessage('sf_formedit_morethanoneform')->text() . "</div>\n";
         $output->addWikiText($warning_text);
     }
     $form_name = $form_names[0];
     $page_name = SFUtils::titleString($title);
     SFFormEdit::printForm($form_name, $page_name);
     return false;
 }
开发者ID:roland2025,项目名称:mediawiki-extensions-SemanticForms,代码行数:24,代码来源:SF_FormEditAction.php

示例6: displayForm

 /**
  * The function called if we're in index.php (as opposed to one of the
  * special pages)
  */
 static function displayForm($action, $article)
 {
     $output = $action->getOutput();
     $title = $article->getTitle();
     $form_names = SFFormLinker::getDefaultFormsForPage($title);
     if (count($form_names) == 0) {
         // If no form is set, display an interface to let the
         // user choose out of all the forms defined on this wiki
         // (or none at all).
         self::displayFormChooser($output, $title);
         return true;
     }
     if (count($form_names) > 1) {
         $warning_text = "\t" . '<div class="warningbox">' . wfMessage('sf_formedit_morethanoneform')->text() . "</div>\n";
         $output->addWikiText($warning_text);
     }
     $form_name = $form_names[0];
     $page_name = SFUtils::titleString($title);
     $sfFormEdit = new SFFormEdit();
     $sfFormEdit->printForm($form_name, $page_name);
     return false;
 }
开发者ID:paladox,项目名称:mediawiki-extensions-SemanticForms,代码行数:26,代码来源:SF_FormEditAction.php

示例7: displayForm

 /**
  * The function called if we're in index.php (as opposed to one of the
  * special pages)
  */
 static function displayForm($action, $article)
 {
     // TODO: This function will be called as a hook handler and $action will
     //  be a string before MW 1.18. From 1.18 onwards this function will
     //  only be called for formedit actions, i.e. the if statement can be
     //  removed then.
     // return "true" if the call failed (meaning, pass on handling
     // of the hook to others), and "false" otherwise
     if (is_string($action) && $action !== 'formedit') {
         return true;
     }
     // @todo: This looks like bad code. If we can't find a form, we
     // should be showing an informative error page rather than
     // making it look like an edit form page does not exist.
     $title = $article->getTitle();
     $form_names = SFFormLinker::getDefaultFormsForPage($title);
     if (count($form_names) == 0) {
         return true;
     }
     // For backward-compatibility
     if (is_string($action)) {
         global $wgOut;
         $output = $wgOut;
     } else {
         $output = $action->getOutput();
     }
     if (count($form_names) > 1) {
         $warning_text = "\t" . '<div class="warningbox">' . wfMessage('sf_formedit_morethanoneform')->text() . "</div>\n";
         $output->addWikiText($warning_text);
     }
     $form_name = $form_names[0];
     $page_name = SFUtils::titleString($title);
     SFFormEdit::printForm($form_name, $page_name);
     return false;
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:39,代码来源:SF_FormEditAction.php

示例8: displayForm

 /**
  * The function called if we're in index.php (as opposed to one of the
  * special pages)
  */
 static function displayForm($action, $article)
 {
     global $sfgUseFormEditPage;
     // TODO: This function will be called as a hook handler and $action will
     //  be a string before MW 1.18. From 1.18 onwards this function will#
     //  only be called for formedit actions, i.e. the if statement can be
     //  removed then.
     // return "true" if the call failed (meaning, pass on handling
     // of the hook to others), and "false" otherwise
     if (is_string($action) && $action !== 'formedit') {
         return true;
     }
     // @todo: This looks like bad code. If we can't find a form, we
     // should be showing an informative error page rather than
     // making it look like an edit form page does not exist.
     $title = $article->getTitle();
     $form_names = SFFormLinker::getDefaultFormsForPage($title);
     if (count($form_names) == 0) {
         return true;
     }
     // For backward-compatibility
     if (is_string($action)) {
         global $wgOut;
         $output = $wgOut;
     } else {
         $output = $action->getOutput();
     }
     if (count($form_names) > 1) {
         $warning_text = "\t" . '<div class="warningbox">' . wfMsg('sf_formedit_morethanoneform') . "</div>\n";
         $output->addWikiText($warning_text);
     }
     $form_name = $form_names[0];
     if ($sfgUseFormEditPage) {
         # Experimental new feature extending from the internal
         # EditPage class
         $editor = new SFFormEditPage($article, $form_name);
         $editor->edit();
         return false;
     }
     $page_name = SFUtils::titleString($title);
     $msg = SFFormEdit::printForm($form_name, $page_name);
     if ($msg) {
         // Some error occurred - display it.
         $msgdata = null;
         if (is_array($msg)) {
             if (count($msg) > 1) {
                 $msgdata = $msg[1];
             }
             $msg = $msg[0];
         }
         $output->addHTML(Html::element('p', array('class' => 'error'), wfMsg($msg, $msgdata)));
     }
     return false;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:58,代码来源:SF_FormEditAction.php


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