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


PHP admin_tools::PostedLabel方法代码示例

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


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

示例1: RenameFile

 static function RenameFile($title)
 {
     global $langmessage, $page, $gp_index, $gp_titles;
     //change the title
     $title = gp_rename::RenameFileWorker($title);
     if ($title === false) {
         return false;
     }
     if (!isset($gp_index[$title])) {
         msg($langmessage['OOPS']);
         return false;
     }
     $id = $gp_index[$title];
     $title_info =& $gp_titles[$id];
     //change the label
     $title_info['label'] = admin_tools::PostedLabel($_POST['new_label']);
     if (isset($title_info['lang_index'])) {
         unset($title_info['lang_index']);
     }
     //change the browser title
     $auto_browser_title = strip_tags($title_info['label']);
     $custom_browser_title = false;
     if (isset($_POST['browser_title'])) {
         $browser_title = $_POST['browser_title'];
         $browser_title = htmlspecialchars($browser_title);
         if ($browser_title != $auto_browser_title) {
             $title_info['browser_title'] = trim($browser_title);
             $custom_browser_title = true;
         }
     }
     if (!$custom_browser_title) {
         unset($title_info['browser_title']);
     }
     //keywords
     if (isset($_POST['keywords'])) {
         $title_info['keywords'] = htmlspecialchars($_POST['keywords']);
         if (empty($title_info['keywords'])) {
             unset($title_info['keywords']);
         }
     }
     //description
     if (isset($_POST['description'])) {
         $title_info['description'] = htmlspecialchars($_POST['description']);
         if (empty($title_info['description'])) {
             unset($title_info['description']);
         }
     }
     //robots
     $title_info['rel'] = '';
     if (isset($_POST['nofollow'])) {
         $title_info['rel'] = 'nofollow';
     }
     if (isset($_POST['noindex'])) {
         $title_info['rel'] .= ',noindex';
     }
     $title_info['rel'] = trim($title_info['rel'], ',');
     if (empty($title_info['rel'])) {
         unset($title_info['rel']);
     }
     if (!admin_tools::SavePagesPHP()) {
         msg($langmessage['OOPS'] . ' (R1)');
         return false;
     }
     msg($langmessage['SAVED']);
     return $title;
 }
开发者ID:Knuzen,项目名称:gpEasy-CMS,代码行数:66,代码来源:Page_Rename.php

示例2: CopyPage

 /**
  * Perform a page copy
  *
  */
 function CopyPage()
 {
     global $gp_index, $gp_titles, $page, $langmessage;
     //existing page info
     $from_title = $_POST['from_title'];
     if (!isset($gp_index[$from_title])) {
         message($langmessage['OOPS_TITLE']);
         return false;
     }
     $from_index = $gp_index[$from_title];
     $info = $gp_titles[$from_index];
     //check the new title
     $title = $_POST['title'];
     $title = admin_tools::CheckPostedNewPage($title, $message);
     if ($title === false) {
         message($message);
         return false;
     }
     //get the existing content
     $from_file = gpFiles::PageFile($from_title);
     $contents = file_get_contents($from_file);
     //add to $gp_index first!
     $index = common::NewFileIndex();
     $gp_index[$title] = $index;
     $file = gpFiles::PageFile($title);
     if (!gpFiles::Save($file, $contents)) {
         message($langmessage['OOPS'] . ' (File not saved)');
         return false;
     }
     //add to gp_titles
     $new_titles = array();
     $new_titles[$index]['label'] = admin_tools::PostedLabel($_POST['title']);
     $new_titles[$index]['type'] = $info['type'];
     $gp_titles += $new_titles;
     if (!admin_tools::SavePagesPHP()) {
         message($langmessage['OOPS'] . ' (CP2)');
         return false;
     }
     message($langmessage['SAVED']);
     if (isset($_REQUEST['redir'])) {
         $url = common::AbsoluteUrl($title, '', true, false);
         $page->ajaxReplace[] = array('eval', '', 'window.setTimeout(function(){window.location="' . $url . '"},15000);');
         message(sprintf($langmessage['will_redirect'], common::Link_Page($title)));
     }
     return $index;
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:50,代码来源:admin_menu_new.php

示例3: CopyPage

 /**
  * Perform a page copy
  *
  */
 function CopyPage()
 {
     global $gp_index, $gp_titles, $page, $langmessage;
     $this->CacheSettings();
     //existing page info
     $from_title = $_POST['from_title'];
     if (!isset($gp_index[$from_title])) {
         msg($langmessage['OOPS_TITLE']);
         return false;
     }
     $from_index = $gp_index[$from_title];
     $info = $gp_titles[$from_index];
     //check the new title
     $title = $_POST['title'];
     $title = admin_tools::CheckPostedNewPage($title, $message);
     if ($title === false) {
         msg($message);
         return false;
     }
     //get the existing content
     $from_file = gpFiles::PageFile($from_title);
     $contents = file_get_contents($from_file);
     //add to $gp_index first!
     $index = common::NewFileIndex();
     $gp_index[$title] = $index;
     $file = gpFiles::PageFile($title);
     if (!gpFiles::Save($file, $contents)) {
         msg($langmessage['OOPS'] . ' (File not saved)');
         return false;
     }
     //add to gp_titles
     $new_titles = array();
     $new_titles[$index]['label'] = admin_tools::PostedLabel($_POST['title']);
     $new_titles[$index]['type'] = $info['type'];
     $gp_titles += $new_titles;
     //add to menu
     $insert = array();
     $insert[$index] = array();
     if (!$this->SaveNew($insert)) {
         $this->RestoreSettings();
         return false;
     }
     $this->HiddenSaved($index);
     return true;
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:49,代码来源:admin_menu_new.php


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