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


PHP common::Link_Page方法代码示例

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


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

示例1: RenameFile

 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;
 }
开发者ID:Knuzen,项目名称:gpEasy-CMS,代码行数:12,代码来源:special.php

示例2: AdminProtect

 function AdminProtect()
 {
     global $gp_menu;
     $this->PageProtect();
     echo '<h2>';
     echo common::Link('Admin_Protect', 'Protected Pages');
     echo '</h2>';
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'savecontent':
             $this->SaveContent();
         case 'editcontent':
             $this->EditContent();
             return;
     }
     echo '<p>';
     echo '<b>' . common::Link('Admin_Protect', 'Protected Content', 'cmd=editcontent') . '</b> ';
     echo 'Edit the content users will see if they navigate to a protected page and aren\'t logged in.';
     echo '</p>';
     if (!count($this->config['pages'])) {
         echo '<p>There aren\'t any protected pages.</p>';
         return;
     }
     echo '<table class="bordered">';
     echo '<tr><th>Pages</th><th>Child Pages</th></tr>';
     foreach ($this->config['pages'] as $page_index => $bool) {
         $title = common::IndexToTitle($page_index);
         //may be deleted
         if (!$title) {
             continue;
         }
         echo '<tr>';
         echo '<td>';
         echo common::Link_Page($title);
         echo '</td>';
         echo '<td>';
         $affected = common::Descendants($page_index, $gp_menu);
         $titles = array();
         foreach ($affected as $temp_index) {
             $title = common::IndexToTitle($temp_index);
             $titles[] = common::Link_Page($title);
         }
         echo implode(', ', $titles);
         echo '</td>';
         echo '</tr>';
     }
     echo '</table>';
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:48,代码来源:AdminProtect.php

示例3: AllTitles

 /**
  * View all pages of the requested language
  *
  */
 public function AllTitles()
 {
     global $langmessage;
     echo '<h2>' . $langmessage['Pages'] . '</h2>';
     $lang_lists = array();
     foreach ($this->lists as $list_index => $list) {
         foreach ($list as $lang => $index) {
             $lang_lists[$lang][] = $index;
         }
     }
     foreach ($lang_lists as $lang => $indexes) {
         echo '<div class="ml_stats"><div>';
         echo '<table class="bordered striped">';
         echo '<thead><tr><th>' . $this->avail_langs[$lang] . '</th><th>' . $langmessage['options'] . '</th></tr>';
         echo '<tbody>';
         foreach ($indexes as $index) {
             echo '<tr><td>';
             $title = common::IndexToTitle($index);
             echo common::Link_Page($title);
             echo '</td><td>';
             echo common::Link('Admin_MultiLang', $langmessage['options'], 'cmd=TitleSettings&index=' . $index, ' name="gpabox"');
             echo '</td></tr>';
         }
         echo '</tbody>';
         echo '</table>';
         echo '</div></div>';
     }
 }
开发者ID:Typesetter,项目名称:Multi-Language,代码行数:32,代码来源:Admin.php

示例4: 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

示例5: AdminContentPanel

 function AdminContentPanel()
 {
     global $page, $config, $langmessage, $gp_menu;
     //the login form does not need the panel
     if (!common::LoggedIn()) {
         return;
     }
     echo '<div id="admincontent_panel" class="toolbar">';
     echo '<div class="right">';
     echo '<span class="admin_arrow_out"></span>';
     echo '<a class="docklink" name="gp_docklink"></a>';
     echo '</div>';
     reset($gp_menu);
     $homepath = common::IndexToTitle(key($gp_menu));
     echo common::Link_Page($homepath);
     echo ' &#187; ';
     echo common::Link('Admin_Main', $langmessage['administration']);
     if (!empty($page->title) && !empty($page->label) && $page->title != 'Admin_Main') {
         echo ' &#187; ';
         echo common::Link($page->title, $page->label);
     }
     echo '</div>';
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:23,代码来源:admin_tools.php

示例6: TitleSettings

 /**
  * Language selection popup
  *
  */
 function TitleSettings($args = array())
 {
     global $gp_titles, $langmessage, $langmessage, $ml_languages, $gp_index;
     $args += array('to_lang' => '', 'to_slug' => '');
     $page_index = $_REQUEST['index'];
     if (!isset($gp_titles[$page_index])) {
         echo $langmessage['OOPS'] . ' (Invalid Title - 3)';
         return;
     }
     $list = $this->GetList($page_index);
     echo '<div>';
     echo '<form method="post" action="' . common::GetUrl('Admin_MultiLang') . '">';
     echo '<input type="hidden" name="cmd" value="title_settings_add" />';
     echo '<input type="hidden" name="index" value="' . $page_index . '" />';
     echo '<h3>Page Settings</h3>';
     echo '<table class="bordered"><tr><th>Language</th><th>Title</th><th>Options</th></tr>';
     //not set yet
     if (!$list) {
         $in_menu = $this->InMenu($page_index);
         echo '<tr><td>';
         if ($in_menu) {
             echo $this->language;
         } else {
             $this->LanguageSelect('from_lang');
         }
         echo '</td><td>';
         $title = common::IndexToTitle($page_index);
         echo common::Link_Page($title);
         echo '</td><td>';
         echo '</td></tr>';
     }
     //current settings
     foreach ($ml_languages as $lang => $language) {
         if (!isset($list[$lang])) {
             continue;
         }
         $index = $list[$lang];
         echo '<tr><td>';
         echo $language . ' (' . $lang . ')';
         echo '</td><td>';
         $title = common::IndexToTitle($index);
         echo common::Link_Page($title);
         echo '</td><td>';
         echo common::Link('Admin_MultiLang', 'Remove', 'cmd=rmtitle&index=' . $page_index . '&rmindex=' . $index, 'name="gpabox" class="gpconfirm" title="Remove this entry?"');
         echo '</td></tr>';
     }
     //option to add another title
     echo '<tr><td>';
     $this->LanguageSelect('to_lang', $args['to_lang'], $this->lang);
     echo '</td><td>';
     $this->TitleSelect($args['to_slug'], $list);
     echo '</td><td>';
     echo '<input type="submit" value="' . $langmessage['save'] . '" class="gpabox gpbutton" /> ';
     echo '</td></tr>';
     echo '</table>';
     echo '</form>';
     $this->SmLinks();
     //add languages as json
     $data = array();
     foreach ($this->langs as $code => $label) {
         $data[] = array($label, $code);
     }
     echo "\n";
     echo '<span id="lang_data" data-json=\'' . htmlspecialchars(json_encode($data), ENT_QUOTES & ~ENT_COMPAT) . '\'></span>';
     //add titles as json
     $data = array();
     foreach ($gp_index as $slug => $index) {
         $label = common::GetLabelIndex($index);
         $data[] = array($slug, common::LabelSpecialChars($label));
     }
     echo "\n";
     echo '<span id="lang_titles" data-json=\'' . htmlspecialchars(json_encode($data), ENT_QUOTES & ~ENT_COMPAT, 'UTF-8', false) . '\'></span>';
     echo '</div>';
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:78,代码来源:Admin.php

示例7: ListSettings

 /**
  * Give users the option of removing the settings for a page
  *
  */
 function ListSettings($page_index)
 {
     global $langmessage, $ml_languages;
     $list = $this->GetList($page_index);
     echo '<div>';
     echo '<form method="post" action="' . common::GetUrl('Admin_MultiLang') . '">';
     echo '<input type="hidden" name="cmd" value="title_settings_add" />';
     echo '<input type="hidden" name="index" value="' . $page_index . '" />';
     echo '<h3>Settings</h3>';
     echo '<p>This page has been associated with the following list of pages.</p>';
     echo '<table class="bordered"><tr><th>Language</th><th>Title</th><th>Options</th></tr>';
     //current settings
     foreach ($ml_languages as $lang => $language) {
         if (!isset($list[$lang])) {
             continue;
         }
         $index = $list[$lang];
         echo '<tr><td>';
         echo $language . ' (' . $lang . ')';
         echo '</td><td>';
         $title = common::IndexToTitle($index);
         echo common::Link_Page($title);
         echo '</td><td>';
         echo common::Link('Admin_MultiLang', 'Remove', 'cmd=rmtitle&index=' . $page_index . '&rmindex=' . $index, 'name="gpabox" class="gpconfirm" title="Remove this entry?"');
         echo '</td></tr>';
     }
     //option to add another title
     echo '<tr><td>';
     $this->LanguageSelect('ml_lang', false, $this->lang);
     echo '</td><td>';
     $this->TitleSelect(false, $list);
     echo '</td><td>';
     echo '<input type="submit" value="' . $langmessage['save'] . '" class="gpabox gpbutton" /> ';
     echo '</td></tr>';
     echo '</table>';
     echo '</form>';
     $this->SmLinks();
     echo '</div>';
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:43,代码来源:Admin.php

示例8: SimilarTitles

 /**
  * Get a comma separated list of links to titles similar to the requested page
  * @return string
  *
  */
 function SimilarTitles()
 {
     $similar = $this->SimilarTitleArray($this->requested);
     $similar = array_slice($similar, 0, 7, true);
     $result = '';
     foreach ($similar as $title => $percent_similar) {
         $result .= common::Link_Page($title) . ', ';
     }
     return rtrim($result, ', ');
 }
开发者ID:barbrick,项目名称:gpEasy-CMS,代码行数:15,代码来源:special_missing.php

示例9: HiddenSaved

 /**
  * Message or redirect when file is saved
  *
  */
 public function HiddenSaved($new_index)
 {
     global $langmessage, $page;
     $this->search_page = 0;
     //take user back to first page where the new page will be displayed
     if (isset($_REQUEST['redir'])) {
         $title = common::IndexToTitle($new_index);
         $url = common::AbsoluteUrl($title, '', true, false);
         msg(sprintf($langmessage['will_redirect'], common::Link_Page($title)));
         $page->ajaxReplace[] = array('location', $url, 15000);
     } else {
         msg($langmessage['SAVED']);
     }
 }
开发者ID:jozefkrz,项目名称:gpEasy-CMS,代码行数:18,代码来源:admin_menu_new.php

示例10: RenamePage

 /**
  * 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;
 }
开发者ID:jozefkrz,项目名称:gpEasy-CMS,代码行数:17,代码来源:Page_Rename.php


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