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


PHP admin_tools::PostedSlug方法代码示例

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


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

示例1: SaveRedir

 /**
  * Save a new redirection
  *
  */
 function SaveRedir()
 {
     global $langmessage;
     if (!$this->CheckRedir()) {
         return false;
     }
     $source = admin_tools::PostedSlug($_POST['source']);
     if (isset($this->error_data['redirects'][$source])) {
         message($langmessage['OOPS'] . ' (Redirect Already Set)');
         return false;
     }
     $this->error_data['redirects'][$source] = array();
     $this->error_data['redirects'][$source]['target'] = $_POST['target'];
     $this->error_data['redirects'][$source]['code'] = $_POST['code'];
     $this->error_data['redirects'][$source]['raw_source'] = $_POST['source'];
     return $this->SaveData_Message();
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:21,代码来源:admin_missing.php

示例2: LabelToSlug

 /**
  * Convert a label to a slug
  * Does not use PostedSlug() so entity_unescape isn't called twice
  * @since 2.5b1
  *
  */
 static function LabelToSlug($string)
 {
     return admin_tools::PostedSlug($string, true);
 }
开发者ID:Bomberus,项目名称:gpEasy-CMS,代码行数:10,代码来源:admin_tools.php

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