mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°2847 - Rollback fix on pages <base> URL tag (to much consequences)
Fixing the base URL tag on WebPage and derivated classes would require to migrate all extensions which use the add_linked_script / add_linked_stylesheet functions with a relative URL, which is almost all extensions. So the benefit isn't worth the workload. Note: We could have migrate extensions by replacing "../images|js|css/xxx.yyy" with utils::GetAbsoluteUrlAppRoot()."images|js|css/xxx.yyy" to make them compatible with iTop 2.8 and previous versions. But as said before, much work.
This commit is contained in:
@@ -551,8 +551,8 @@ EOF
|
||||
$oLayout->Render($oPage, $this->aCells, $bEditMode, $aExtraParams);
|
||||
if (!$bEditMode)
|
||||
{
|
||||
$oPage->add_linked_script('js/dashlet.js');
|
||||
$oPage->add_linked_script('js/dashboard.js');
|
||||
$oPage->add_linked_script('../js/dashlet.js');
|
||||
$oPage->add_linked_script('../js/dashboard.js');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,40 +103,40 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage
|
||||
// TODO: Should we keep this? Makes no sense
|
||||
//$this->add_header("Cache-control: no-cache");
|
||||
// TODO: Add only what's necessary
|
||||
$this->add_linked_stylesheet("css/jquery.treeview.css");
|
||||
$this->add_linked_stylesheet("css/jquery-ui-timepicker-addon.css");
|
||||
$this->add_linked_stylesheet("css/jquery.multiselect.css");
|
||||
$this->add_linked_stylesheet("css/magnific-popup.css");
|
||||
$this->add_linked_stylesheet("css/c3.min.css");
|
||||
$this->add_linked_stylesheet("css/font-awesome/css/all.min.css");
|
||||
$this->add_linked_stylesheet("js/ckeditor/plugins/codesnippet/lib/highlight/styles/obsidian.css");
|
||||
$this->add_linked_stylesheet("../css/jquery.treeview.css");
|
||||
$this->add_linked_stylesheet("../css/jquery-ui-timepicker-addon.css");
|
||||
$this->add_linked_stylesheet("../css/jquery.multiselect.css");
|
||||
$this->add_linked_stylesheet("../css/magnific-popup.css");
|
||||
$this->add_linked_stylesheet("../css/c3.min.css");
|
||||
$this->add_linked_stylesheet("../css/font-awesome/css/all.min.css");
|
||||
$this->add_linked_stylesheet("../js/ckeditor/plugins/codesnippet/lib/highlight/styles/obsidian.css");
|
||||
|
||||
// TODO: Add only what's necessary
|
||||
$this->add_linked_script('js/jquery.layout.min.js');
|
||||
$this->add_linked_script('js/jquery.ba-bbq.min.js');
|
||||
$this->add_linked_script("js/jquery.treeview.js");
|
||||
$this->add_linked_script("js/date.js");
|
||||
$this->add_linked_script("js/jquery-ui-timepicker-addon.js");
|
||||
$this->add_linked_script("js/jquery-ui-timepicker-addon-i18n.min.js");
|
||||
$this->add_linked_script("js/jquery.blockUI.js");
|
||||
$this->add_linked_script("js/utils.js");
|
||||
$this->add_linked_script("js/swfobject.js");
|
||||
$this->add_linked_script("js/ckeditor/ckeditor.js");
|
||||
$this->add_linked_script("js/ckeditor/adapters/jquery.js");
|
||||
$this->add_linked_script("js/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js");
|
||||
$this->add_linked_script("js/jquery.qtip-1.0.min.js");
|
||||
$this->add_linked_script('js/property_field.js');
|
||||
$this->add_linked_script('js/icon_select.js');
|
||||
$this->add_linked_script('js/raphael-min.js');
|
||||
$this->add_linked_script('js/d3.js');
|
||||
$this->add_linked_script('js/c3.js');
|
||||
$this->add_linked_script('js/jquery.multiselect.js');
|
||||
$this->add_linked_script('js/ajaxfileupload.js');
|
||||
$this->add_linked_script('js/jquery.mousewheel.js');
|
||||
$this->add_linked_script('js/jquery.magnific-popup.min.js');
|
||||
$this->add_linked_script('js/moment-with-locales.min.js');
|
||||
$this->add_linked_script('js/showdown.min.js');
|
||||
$this->add_linked_script('js/newsroom_menu.js');
|
||||
$this->add_linked_script('../js/jquery.layout.min.js');
|
||||
$this->add_linked_script('../js/jquery.ba-bbq.min.js');
|
||||
$this->add_linked_script("../js/jquery.treeview.js");
|
||||
$this->add_linked_script("../js/date.js");
|
||||
$this->add_linked_script("../js/jquery-ui-timepicker-addon.js");
|
||||
$this->add_linked_script("../js/jquery-ui-timepicker-addon-i18n.min.js");
|
||||
$this->add_linked_script("../js/jquery.blockUI.js");
|
||||
$this->add_linked_script("../js/utils.js");
|
||||
$this->add_linked_script("../js/swfobject.js");
|
||||
$this->add_linked_script("../js/ckeditor/ckeditor.js");
|
||||
$this->add_linked_script("../js/ckeditor/adapters/jquery.js");
|
||||
$this->add_linked_script("../js/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js");
|
||||
$this->add_linked_script("../js/jquery.qtip-1.0.min.js");
|
||||
$this->add_linked_script('../js/property_field.js');
|
||||
$this->add_linked_script('../js/icon_select.js');
|
||||
$this->add_linked_script('../js/raphael-min.js');
|
||||
$this->add_linked_script('../js/d3.js');
|
||||
$this->add_linked_script('../js/c3.js');
|
||||
$this->add_linked_script('../js/jquery.multiselect.js');
|
||||
$this->add_linked_script('../js/ajaxfileupload.js');
|
||||
$this->add_linked_script('../js/jquery.mousewheel.js');
|
||||
$this->add_linked_script('../js/jquery.magnific-popup.min.js');
|
||||
$this->add_linked_script('../js/moment-with-locales.min.js');
|
||||
$this->add_linked_script('../js/showdown.min.js');
|
||||
$this->add_linked_script('../js/newsroom_menu.js');
|
||||
|
||||
$this->add_dict_entry('UI:FillAllMandatoryFields');
|
||||
|
||||
@@ -1138,6 +1138,13 @@ EOF
|
||||
'aJsInlineLive' => $this->a_scripts,
|
||||
];
|
||||
|
||||
// Base tag
|
||||
// Note: We might consider to put the app_root_url parameter here, but that would need a BIG rework on iTop AND the extensions to replace all the "../images|js|css/xxx.yyy"...
|
||||
if(!empty($this->a_base['href']))
|
||||
{
|
||||
$aData['aPage']['aMetadata']['sBaseUrl'] = $this->a_base['href'];
|
||||
}
|
||||
|
||||
// Layouts
|
||||
$aData['aLayouts'] = [
|
||||
'sBanner' => $this->RenderBannerHtml(),
|
||||
@@ -1163,8 +1170,6 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Render final TWIG into global HTML
|
||||
$oKpi = new ExecutionKPI();
|
||||
$sHtml = TwigHelper::RenderTemplate($oTwigEnv, $aData, $sTemplateRelPath);
|
||||
|
||||
Reference in New Issue
Block a user