當前位置: 首頁>>代碼示例>>PHP>>正文


PHP admin_tools::CheckTitle方法代碼示例

本文整理匯總了PHP中admin_tools::CheckTitle方法的典型用法代碼示例。如果您正苦於以下問題:PHP admin_tools::CheckTitle方法的具體用法?PHP admin_tools::CheckTitle怎麽用?PHP admin_tools::CheckTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在admin_tools的用法示例。


在下文中一共展示了admin_tools::CheckTitle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CheckPostedNewPage

 /**
  * Check a title against existing titles and special pages
  *
  */
 static function CheckPostedNewPage($title, &$message)
 {
     global $langmessage, $gp_index, $config;
     $title = admin_tools::LabelToSlug($title);
     if (!admin_tools::CheckTitle($title, $message)) {
         return false;
     }
     if (admin_tools::CheckTitleCase($title)) {
         $message = $langmessage['TITLE_EXISTS'];
         return false;
     }
     return $title;
 }
開發者ID:Bomberus,項目名稱:gpEasy-CMS,代碼行數:17,代碼來源:admin_tools.php

示例2: RenameFileWorker

 static function RenameFileWorker($title)
 {
     global $langmessage, $dataDir, $gp_index;
     //use new_label or new_title
     if (isset($_POST['new_title'])) {
         $new_title = admin_tools::PostedSlug($_POST['new_title']);
     } else {
         $new_title = admin_tools::LabelToSlug($_POST['new_label']);
     }
     //title unchanged
     if ($new_title == $title) {
         return $title;
     }
     $special_file = false;
     if (common::SpecialOrAdmin($title)) {
         $special_file = true;
     }
     if (!admin_tools::CheckTitle($new_title, $message)) {
         msg($message);
         return false;
     }
     $old_gp_index = $gp_index;
     //re-index: make the new title point to the same data index
     $old_file = gpFiles::PageFile($title);
     $file_index = $gp_index[$title];
     unset($gp_index[$title]);
     $gp_index[$new_title] = $file_index;
     //rename the php file
     if (!$special_file) {
         $new_file = gpFiles::PageFile($new_title);
         //we don't have to rename files if we're using the index naming convention. See gpFiles::PageFile() for more info
         if ($new_file == $old_file) {
             //if the file being renamed doesn't use the index naming convention, then we'll still need to rename it
         } elseif (!rename($old_file, $new_file)) {
             msg($langmessage['OOPS'] . ' (N3)');
             $gp_index = $old_gp_index;
             return false;
         }
         //gallery rename
         includeFile('special/special_galleries.php');
         special_galleries::RenamedGallery($title, $new_title);
     }
     //create a 301 redirect
     if (isset($_POST['add_redirect']) && $_POST['add_redirect'] == 'add') {
         includeFile('admin/admin_missing.php');
         admin_missing::AddRedirect($title, $new_title);
     }
     gpPlugin::Action('RenameFileDone', array($file_index, $title, $new_title));
     return $new_title;
 }
開發者ID:Knuzen,項目名稱:gpEasy-CMS,代碼行數:50,代碼來源:Page_Rename.php


注:本文中的admin_tools::CheckTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。