function RenameFile() { global $langmessage, $gp_index, $page; includeFile('tool/Page_Rename.php'); $new_title = gp_rename::RenameFile($this->title); if ($new_title !== false && $new_title != $this->title) { msg(sprintf($langmessage['will_redirect'], common::Link_Page($new_title))); $page->head .= '<meta http-equiv="refresh" content="15;url=' . common::GetUrl($new_title) . '">'; return true; } return false; }
function RenameFile() { global $langmessage, $gp_index; includeFile('tool/Page_Rename.php'); //prepare variables $title =& $_REQUEST['title']; if (!isset($gp_index[$title])) { message($langmessage['OOPS'] . ' (R0)'); return false; } gp_rename::RenameFile($title); }
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; }
function RenameForm() { global $page, $gp_index; includeFile('tool/Page_Rename.php'); $action = common::GetUrl($this->title); gp_rename::RenameForm($this->gp_index, $action); }
/** * Rename a page * */ public static function RenamePage($page) { global $langmessage, $gp_index; includeFile('tool/Page_Rename.php'); $new_title = gp_rename::RenameFile($page->title); if ($new_title !== false && $new_title != $page->title) { msg(sprintf($langmessage['will_redirect'], common::Link_Page($new_title))); $page->head .= '<meta http-equiv="refresh" content="15;url=' . common::GetUrl($new_title) . '">'; $page->ajaxReplace[] = array('location', common::GetUrl($new_title), 15000); return true; } return false; }
function RenameFile() { includeFile('tool/Page_Rename.php'); return gp_rename::RenamePage($this); }