mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Now always including egw and etemplate2 javascript code if we are in the top window
This commit is contained in:
parent
60a2fd9855
commit
df06f6657c
@ -101,17 +101,12 @@ class etemplate_new extends etemplate_widget_template
|
||||
*/
|
||||
function exec($method,$content,$sel_options='',$readonlys='',$preserv='',$output_mode=0,$ignore_validation='',$changes='')
|
||||
{
|
||||
|
||||
// Overwrite "nonavbar" is the output_mode is two
|
||||
$GLOBALS['egw_info']['flags']['nonavbar'] = ($output_mode == 2);
|
||||
|
||||
if (!$this->rel_path) throw new egw_exception_assertion_failed('No (valid) template read!');
|
||||
|
||||
// load translations
|
||||
translation::add_app('etemplate');
|
||||
foreach(translation::$loaded_apps as $app => $lang)
|
||||
{
|
||||
egw_framework::validate_file('/phpgwapi/lang.php', array(
|
||||
'app' => $app,
|
||||
'lang' => $lang,
|
||||
));
|
||||
}
|
||||
// generate new etemplate request object
|
||||
self::$request = etemplate_request::read();
|
||||
self::$request->output_mode = $output_mode; // let extensions "know" they are run eg. in a popup
|
||||
@ -151,7 +146,6 @@ class etemplate_new extends etemplate_widget_template
|
||||
{
|
||||
// missing dependency, thought egw:uses jquery.jquery.tools does NOT work, maybe we should rename it to jquery-tools
|
||||
egw_framework::validate_file('jquery','jquery.tools.min');
|
||||
egw_framework::validate_file('.','etemplate2','etemplate');
|
||||
|
||||
egw_framework::includeCSS('/etemplate/js/test/test.css');
|
||||
common::egw_header();
|
||||
|
@ -113,7 +113,7 @@ var et2_inputWidget = et2_valueWidget.extend(et2_IInput, {
|
||||
change: function(_node) {
|
||||
if (this.onchange)
|
||||
{
|
||||
return this.onchange(_node);
|
||||
return et2_compileLegacyJS(this.onchange, this, _node)();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -14,9 +14,6 @@
|
||||
|
||||
/*egw:uses
|
||||
jquery.jquery;
|
||||
jscalendar.calendar-setup;
|
||||
jscalendar.calendar;
|
||||
/phpgwapi/js/jscalendar/lang/calendar-en.js;
|
||||
lib/date;
|
||||
et2_core_inputWidget;
|
||||
et2_core_valueWidget;
|
||||
@ -81,17 +78,10 @@ var et2_date = et2_inputWidget.extend({
|
||||
if (!dateformat) dateformat = "Y-m-d";
|
||||
dateformat = dateformat.replace("Y","%Y").replace("d","%d").replace("m","%m").replace("M", "%b");
|
||||
|
||||
var setup = {
|
||||
inputField: this.options.id,
|
||||
button: this.button.attr("id"),
|
||||
showsTime: false,
|
||||
onUpdate: function(_value) {_this.set_value(_value)},
|
||||
daFormat: dateformat,
|
||||
firstDay: this.egw().preference("weekdaystarts","calendar")
|
||||
};
|
||||
/*window.setTimeout(function() {
|
||||
Calendar.setup(setup);
|
||||
}, 500);*/
|
||||
this.egw().calendar(this.input_date, this.button,
|
||||
function(_value) {
|
||||
this.set_value(_value);
|
||||
}, this);
|
||||
}
|
||||
|
||||
// If date also has a time, or browser doesn't support HTML5 time type
|
||||
|
@ -94,7 +94,7 @@ abstract class egw_framework
|
||||
'/phpgwapi/js/./egw_json.js',
|
||||
// always include javascript helper functions
|
||||
'/phpgwapi/js/jsapi/jsapi.js',
|
||||
'/phpgwapi/js/jsapi/egw.js',
|
||||
// '/phpgwapi/js/jsapi/egw.js',
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,8 @@ class idots_framework extends egw_framework
|
||||
{
|
||||
parent::__construct($template); // call the constructor of the extended class
|
||||
|
||||
$GLOBALS['egw_info']['flags']['js_link_registry'] = true;
|
||||
|
||||
$this->tplsav2 = new tplsavant2();
|
||||
$this->tplsav2->set_tpl_path(EGW_SERVER_ROOT.SEP.'phpgwapi'.SEP.'templates'.SEP.'idots');
|
||||
}
|
||||
@ -87,6 +89,22 @@ class idots_framework extends egw_framework
|
||||
if (self::$header_done) return '';
|
||||
self::$header_done = true;
|
||||
|
||||
// load translations
|
||||
translation::add_app('etemplate');
|
||||
foreach(translation::$loaded_apps as $app => $lang)
|
||||
{
|
||||
egw_framework::validate_file('/phpgwapi/lang.php', array(
|
||||
'app' => $app,
|
||||
'lang' => $lang,
|
||||
));
|
||||
}
|
||||
|
||||
if ($this->isTop(false))
|
||||
{
|
||||
self::validate_file('jsapi', 'egw', 'phpgwapi');
|
||||
self::validate_file('.', 'etemplate2', 'etemplate');
|
||||
}
|
||||
|
||||
// add a content-type header to overwrite an existing default charset in apache (AddDefaultCharset directiv)
|
||||
header('Content-type: text/html; charset='.translation::charset());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user