Beispiel #1
0
 /**
  * Rename a page
  *
  */
 public static function RenamePage()
 {
     global $langmessage, $gp_index, $page;
     $new_title = self::RenameFile($page->title);
     if ($new_title !== false && $new_title != $page->title) {
         msg(sprintf($langmessage['will_redirect'], \gp\tool::Link_Page($new_title)));
         $page->head .= '<meta http-equiv="refresh" content="15;url=' . \gp\tool::GetUrl($new_title) . '">';
         $page->ajaxReplace[] = array('location', \gp\tool::GetUrl($new_title), 15000);
         return true;
     }
     return false;
 }
Beispiel #2
0
 /**
  * Message or redirect when file is saved
  *
  */
 public function HiddenSaved($new_index)
 {
     global $langmessage;
     $this->search_page = 0;
     //take user back to first page where the new page will be displayed
     if (isset($_REQUEST['redir'])) {
         $title = \gp\tool::IndexToTitle($new_index);
         $url = \gp\tool::AbsoluteUrl($title, '', true, false);
         msg(sprintf($langmessage['will_redirect'], \gp\tool::Link_Page($title)));
         $this->page->ajaxReplace[] = array('location', $url, 15000);
     } else {
         msg($langmessage['SAVED']);
     }
 }
Beispiel #3
0
 /**
  * Get a comma separated list of links to titles similar to the requested page
  * @return string
  *
  */
 public function SimilarTitles()
 {
     $similar = $this->SimilarTitleArray($this->requested);
     $similar = array_slice($similar, 0, 7, true);
     $result = '';
     foreach ($similar as $title => $percent_similar) {
         $result .= \gp\tool::Link_Page($title) . ', ';
     }
     return rtrim($result, ', ');
 }