Skip to content

Commit

Permalink
Enhances URL creation in get_sitemapLlinks method of Admin_ContentPag…
Browse files Browse the repository at this point in the history
…e module to manage single or multi languages.
  • Loading branch information
JB Lebrun committed Feb 11, 2019
1 parent 9b51f65 commit cf4f16c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions plugin/module/Admin_ContentPage/Admin_ContentPage.php.inc
Expand Up @@ -5,7 +5,7 @@
* @details Plugin, Module Engine
* @file plugin/module/Admin_ContentPage/Admin_ContentPage.php.inc
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.1
* @version 1.1.1
* @date Creation: Jun 2005
* @date Modification: Feb 2019
* @copyright 2005 - 2019 CaMykS Team
Expand Down Expand Up @@ -1606,16 +1606,17 @@ final class Admin_ContentPage extends Module {
if ($page->active == 1 and $page->robotIndex == 1) {
$url = array();

/* Add main url */
$url['loc'] = $camyks->get_fileURL($this->get_sitePageLink($page->id, $camyks->get_confValue('site_default_language')), 'absolute');

/* Add alternative urls */
if (count($camyks->get_confValue('site_languages')) > 1) {
/* Add main url */
$url['loc'] = $camyks->get_fileURL($this->get_sitePageLink($page->id, $camyks->get_confValue('site_default_language')), 'absolute');

/* Add alternative urls */
$url['alt'] = array();
foreach($camyks->get_confValue('site_languages') as $l) {
$url['alt'][$l] = $camyks->get_fileURL($this->get_sitePageLink($page->id, $l), 'absolute');
}
}
} else
$url['loc'] = $camyks->get_fileURL($this->get_sitePageLink($page->id, ''), 'absolute');

/* Add priority depending on page level */
if ($page->homepage == 1)
Expand Down
2 changes: 1 addition & 1 deletion plugin/module/Admin_ContentPage/lib/ContentPage.php.inc
Expand Up @@ -52,7 +52,7 @@ final class ContentPage {
*/
public $type = 'page';

/**
/**
* var boolean $active
* @brief Page status.
*/
Expand Down

0 comments on commit cf4f16c

Please sign in to comment.