mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
SEF Urls can be enabled/disable on a per plugin basis.
This commit is contained in:
@@ -211,18 +211,24 @@ class eurl_admin_ui extends e_admin_controller_ui
|
|||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$cfg = e107::getConfig();
|
$cfg = e107::getConfig();
|
||||||
$pref = e107::getPref();
|
|
||||||
|
|
||||||
|
|
||||||
if(!empty($_POST['saveSimpleSef']))
|
if(!empty($_POST['saveSimpleSef']))
|
||||||
{
|
{
|
||||||
if(is_string($this->getConfig()->get('e_url_alias')))
|
/*if(is_string($this->getConfig()->get('e_url_alias')))
|
||||||
{
|
{
|
||||||
$cfg->setPostedData('e_url_alias', array(e_LAN => $_POST['e_url_alias']), false);
|
$cfg->setPostedData('e_url_alias', array(e_LAN => $_POST['e_url_alias']), false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cfg->setPref('e_url_alias/'.e_LAN, $_POST['e_url_alias']);
|
$cfg->setPref('e_url_alias/'.e_LAN, $_POST['e_url_alias']);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
foreach($_POST['urlstatus'] as $k=>$v)
|
||||||
|
{
|
||||||
|
$val = (!empty($v)) ? $tp->filter($k,'w') : 0;
|
||||||
|
$cfg->setPref('e_url_list/'.$k, $val);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cfg->save(true, true, true);
|
$cfg->save(true, true, true);
|
||||||
@@ -230,10 +236,11 @@ class eurl_admin_ui extends e_admin_controller_ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pref = e107::getPref('e_url_alias');
|
$pref = e107::getPref('e_url_alias');
|
||||||
|
$sefActive = e107::getPref('e_url_list');
|
||||||
|
|
||||||
if(empty($eUrl))
|
if(empty($eUrl))
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = "<div class='e-container'>";
|
$text = "<div class='e-container'>";
|
||||||
@@ -243,9 +250,12 @@ class eurl_admin_ui extends e_admin_controller_ui
|
|||||||
|
|
||||||
$home = "<small>".SITEURL.'</small>';
|
$home = "<small>".SITEURL.'</small>';
|
||||||
|
|
||||||
|
|
||||||
|
// e107::getDebug()->log($sefActive);
|
||||||
|
|
||||||
foreach($eUrl as $plug=>$val)
|
foreach($eUrl as $plug=>$val)
|
||||||
{
|
{
|
||||||
$active = !empty($pref['e_url_list'][$plug]) ? 1 : 0;
|
$active = !empty($sefActive[$plug]) ? true : false;
|
||||||
$text .= "<table class='table table-striped table-bordered' style='margin-bottom:40px'>
|
$text .= "<table class='table table-striped table-bordered' style='margin-bottom:40px'>
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col style='min-width:200px' />
|
<col style='min-width:200px' />
|
||||||
@@ -253,7 +263,8 @@ class eurl_admin_ui extends e_admin_controller_ui
|
|||||||
<col style='width:45%' />
|
<col style='width:45%' />
|
||||||
</colgroup>";
|
</colgroup>";
|
||||||
|
|
||||||
$text .= "<tr class='active'><td ><h4>".$plug."</h4></td><td colspan='2'>".$frm->radio_switch($plug,$plug,$active)."</td></tr>";
|
$name = 'urlstatus['.$plug.']';
|
||||||
|
$text .= "<tr class='active'><td ><h4>".$plug."</h4></td><td colspan='2'>".$frm->radio_switch($name,$active)."</td></tr>";
|
||||||
$text .= "<tr><th>Key</th><th>Regular Expression</th>
|
$text .= "<tr><th>Key</th><th>Regular Expression</th>
|
||||||
|
|
||||||
|
|
||||||
@@ -283,7 +294,7 @@ class eurl_admin_ui extends e_admin_controller_ui
|
|||||||
$text .= "</table>";
|
$text .= "</table>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// $text .= "<div class='buttons-bar center'>".$frm->button('saveSimpleSef',LAN_SAVE." (".e_LANGUAGE.")",'submit')."</div>";
|
$text .= "<div class='buttons-bar center'>".$frm->button('saveSimpleSef',LAN_SAVE, 'submit')."</div>";
|
||||||
$text .= $frm->close();
|
$text .= $frm->close();
|
||||||
$text .= "</div>";
|
$text .= "</div>";
|
||||||
return $text;
|
return $text;
|
||||||
|
@@ -2909,6 +2909,7 @@ class e107
|
|||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
$pref = self::getPref('e_url_alias');
|
$pref = self::getPref('e_url_alias');
|
||||||
|
$sefActive = self::getPref('e_url_list');
|
||||||
|
|
||||||
if(is_string($options)) // backwards compat.
|
if(is_string($options)) // backwards compat.
|
||||||
{
|
{
|
||||||
@@ -2952,6 +2953,13 @@ class e107
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($sefActive[$plugin])) // SEF disabled.
|
||||||
|
{
|
||||||
|
self::getDebug()->log('SEF URL for <b>'.$plugin.'</b> disabled.');
|
||||||
|
$active = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(deftrue('e_MOD_REWRITE') && ($active == true) && empty($options['legacy'])) // Search-Engine-Friendly URLs active.
|
if(deftrue('e_MOD_REWRITE') && ($active == true) && empty($options['legacy'])) // Search-Engine-Friendly URLs active.
|
||||||
{
|
{
|
||||||
|
@@ -98,7 +98,7 @@
|
|||||||
{
|
{
|
||||||
if(empty($pref['e_url_list'][$plug])) // disabled.
|
if(empty($pref['e_url_list'][$plug])) // disabled.
|
||||||
{
|
{
|
||||||
e107::getDebug()->log('e_URL for <b>'.$plug.'</b> disabled.');
|
e107::getDebug()->log('e_URL for <b>'.$plug.'</b> is disabled.');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user