1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 20:21:51 +02:00

Issue #1698 - Admin Sitelinks relative URL issue. - display mode fix.

This commit is contained in:
Cameron 2016-06-10 08:33:39 -07:00
parent 2aebba0574
commit 34a551c909
2 changed files with 11 additions and 11 deletions

View File

@ -692,15 +692,9 @@ class links_admin_form_ui extends e_admin_form_ui
{
$linkUrl = $this->getController()->getListModel()->get('link_url');
/*
*/
//
$url = $this->link_url($linkUrl,$mode);
$url = $this->link_url($linkUrl,'link_id');
@ -746,23 +740,25 @@ class links_admin_form_ui extends e_admin_form_ui
function link_url($curVal,$mode)
{
if($mode == 'read')
if($mode == 'read' || $mode == 'link_id') // read = display mode, link_id = actual absolute URL
{
$owner = $this->getController()->getListModel()->get('link_owner');
$sef = $this->getController()->getListModel()->get('link_sefurl');
if($curVal[0] !== '{' && substr($curVal,0,4) != 'http')
if($curVal[0] !== '{' && substr($curVal,0,4) != 'http' && $mode == 'link_id')
{
$curVal = '{e_BASE}'.$curVal;
}
if(!empty($owner) && !empty($sef))
{
$curVal = e107::url($owner,$sef, null);
$opt = ($mode == 'read') ? array('mode'=>'raw') : array();
$curVal = e107::url($owner,$sef, null, $opt);
}
else
{
$curVal = e107::getParser()->replaceConstants($curVal,'abs');
$opt = ($mode == 'read') ? 'rel' : 'abs';
$curVal = e107::getParser()->replaceConstants($curVal,$opt);
}
e107::getDebug()->log($curVal);

View File

@ -2942,6 +2942,10 @@ class e107
{
$sefUrl = SITEURL.$rawUrl;
}
elseif($options['mode'] == 'raw')
{
$sefUrl = $rawUrl;
}
else
{
$sefUrl = e_HTTP.$rawUrl;