quiten a warning, if apps return nothing

This commit is contained in:
Ralf Becker 2016-02-16 10:14:02 +00:00
parent 5bfe4ba48b
commit 6b33adcb7c
4 changed files with 44 additions and 39 deletions

View File

@ -710,15 +710,18 @@ foreach($files as $filename)
$widgets = $GLOBALS['egw']->hooks->process('etemplate2_register_widgets'); $widgets = $GLOBALS['egw']->hooks->process('etemplate2_register_widgets');
foreach($widgets as $app => $list) foreach($widgets as $app => $list)
{ {
foreach($list as $class) if (is_array($list))
{ {
try foreach($list as $class)
{ {
class_exists($class); // trigger autoloader try
} {
catch(Exception $e) class_exists($class); // trigger autoloader
{ }
error_log($e->getMessage()); catch(Exception $e)
{
error_log($e->getMessage());
}
} }
} }
} }

View File

@ -2268,6 +2268,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
var settings = this.nextmatch.options.settings; var settings = this.nextmatch.options.settings;
this.div.prependTo(nm_div); this.div.prependTo(nm_div);
this.div.addClass('et2_toolbar'); // get toolbar styling
// Left & Right (& row) headers // Left & Right (& row) headers
this.headers = [ this.headers = [
@ -2279,20 +2280,21 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
// The rest of the header // The rest of the header
this.header_div = this.row_div = jQuery(document.createElement("div")) this.header_div = this.row_div = jQuery(document.createElement("div"))
.addClass("nextmatch_header_row") .addClass("nextmatch_header_row")
.addClass('et2_toolbar_actionlist') // get toolbar styling
.appendTo(this.div); .appendTo(this.div);
// Search // Search
this.search_box = jQuery(document.createElement("div")) this.search_box = jQuery(document.createElement("div"))
.prependTo(egwIsMobile()?this.nextmatch.div:this.row_div); .prependTo(egwIsMobile()?this.nextmatch.div:this.row_div);
// searchbox widget // searchbox widget
this.et2_searchbox = et2_createWidget('searchbox', {id:"search",onchange:function(){ this.et2_searchbox = et2_createWidget('searchbox', {id:"search",onchange:function(){
self.nextmatch.applyFilters({search: this.get_value()}); self.nextmatch.applyFilters({search: this.get_value()});
} }
},this); },this);
// Set activeFilters to current value // Set activeFilters to current value
this.nextmatch.activeFilters.search = settings.search; this.nextmatch.activeFilters.search = settings.search;
this.et2_searchbox.set_value(settings.search); this.et2_searchbox.set_value(settings.search);
/** /**
* Mobile theme specific part for nm header * Mobile theme specific part for nm header

View File

@ -1388,7 +1388,7 @@ var et2_link_string = expose(et2_valueWidget.extend([et2_IDetachedDOM],
.appendTo(this.list) .appendTo(this.list)
.addClass("et2_link loading") .addClass("et2_link loading")
.click( function(e){ .click( function(e){
if (self.options.expose_view && typeof _link_data.type !='undefined' if (self.options.expose_view && typeof _link_data.type !='undefined'
&& _link_data.type.match(self.mime_regexp,'ig')) && _link_data.type.match(self.mime_regexp,'ig'))
{ {
self._init_blueimp_gallery(e, _link_data); self._init_blueimp_gallery(e, _link_data);
@ -1602,7 +1602,7 @@ var et2_link_list = et2_link_string.extend(
window.location = url+"?download"; window.location = url+"?download";
return false; return false;
} }
// Multiple file download for those that support it // Multiple file download for those that support it
a = $j(a) a = $j(a)
.prop('href', url) .prop('href', url)
@ -1615,7 +1615,7 @@ var et2_link_list = et2_link_string.extend(
a.remove(); a.remove();
return false; return false;
} }
self.egw().open(link_data, "", "view",'download',link_data.target ? link_data.target : link_data.app,link_data.app); self.egw().open(link_data, "", "view",'download',link_data.target ? link_data.target : link_data.app,link_data.app);
}); });
this.context.addItem("zip", this.egw().lang("Save as Zip"), this.egw().image('save_zip'), function(menu_item) { this.context.addItem("zip", this.egw().lang("Save as Zip"), this.egw().image('save_zip'), function(menu_item) {
@ -1767,7 +1767,7 @@ var et2_link_list = et2_link_string.extend(
{ {
this._format_vfs($td, dirs, _link_data); this._format_vfs($td, dirs, _link_data);
} }
//Bind the click handler if there is download_url //Bind the click handler if there is download_url
if (_link_data && (typeof _link_data.download_url != 'undefined' || _link_data.app !='egw-data')) if (_link_data && (typeof _link_data.download_url != 'undefined' || _link_data.app !='egw-data'))
{ {
$td.click( function(){ $td.click( function(){
@ -1781,7 +1781,7 @@ var et2_link_list = et2_link_string.extend(
{ {
self.egw().open(_link_data, "", "view",null,_link_data.target ? _link_data.target : _link_data.app,_link_data.app); self.egw().open(_link_data, "", "view",null,_link_data.target ? _link_data.target : _link_data.app,_link_data.app);
} }
}); });
} }
} }
@ -1841,7 +1841,7 @@ var et2_link_list = et2_link_string.extend(
self.context.getItem("zip").set_enabled($j('[id^="link_-"]',this.list).length >= 2); self.context.getItem("zip").set_enabled($j('[id^="link_-"]',this.list).length >= 2);
// Show delete item only if the widget is not readonly // Show delete item only if the widget is not readonly
self.context.getItem("delete").set_enabled(!self.options.readonly); self.context.getItem("delete").set_enabled(!self.options.readonly);
self.context.data = _link_data; self.context.data = _link_data;
self.context.showAt(e.pageX, e.pageY, true); self.context.showAt(e.pageX, e.pageY, true);
e.preventDefault(); e.preventDefault();

View File

@ -154,10 +154,10 @@ var et2_textbox = et2_inputWidget.extend([et2_IResizeable],
}); });
} }
}, },
/** /**
* Override the parent set_id method to manuipulate the input DOM node * Override the parent set_id method to manuipulate the input DOM node
* *
* @param {type} _value * @param {type} _value
* @returns {undefined} * @returns {undefined}
*/ */
@ -165,12 +165,12 @@ var et2_textbox = et2_inputWidget.extend([et2_IResizeable],
{ {
this._super.apply(this,arguments); this._super.apply(this,arguments);
// Remove the name attribute inorder to affect autocomplete="off" // Remove the name attribute inorder to affect autocomplete="off"
// for no password save. ATM seems all browsers ignore autocomplete for // for no password save. ATM seems all browsers ignore autocomplete for
// input field inside the form // input field inside the form
if (this.options.type === "passwd" if (this.options.type === "passwd"
&& this.options.autocomplete === "off") this.input.removeAttr('name'); && this.options.autocomplete === "off") this.input.removeAttr('name');
}, },
destroy: function() { destroy: function() {
var node = this.getInputNode(); var node = this.getInputNode();
if (node) $j(node).unbind("keypress"); if (node) $j(node).unbind("keypress");
@ -276,7 +276,7 @@ var et2_textbox = et2_inputWidget.extend([et2_IResizeable],
this.options.autocomplete = _value; this.options.autocomplete = _value;
this.input.attr('autocomplete', _value); this.input.attr('autocomplete', _value);
}, },
resize: function (_height) resize: function (_height)
{ {
if (_height && this.options.multiline) if (_height && this.options.multiline)
@ -409,7 +409,7 @@ et2_register_widget(et2_textbox_ro, ["textbox_ro"]);
/** /**
* et2_searchbox is a widget which provides a collapsable input search * et2_searchbox is a widget which provides a collapsable input search
* with on searching indicator and clear handler regardless of any browser limitation. * with on searching indicator and clear handler regardless of any browser limitation.
* *
* @type type * @type type
*/ */
var et2_searchbox = et2_textbox.extend( var et2_searchbox = et2_textbox.extend(
@ -428,23 +428,23 @@ var et2_searchbox = et2_textbox.extend(
this.value = ""; this.value = "";
this.div = jQuery(document.createElement('div')) this.div = jQuery(document.createElement('div'))
.addClass('et2_searchbox'); .addClass('et2_searchbox');
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.setDOMNode(this.div[0]); this.setDOMNode(this.div[0]);
this._createWidget(); this._createWidget();
}, },
_createWidget:function() _createWidget:function()
{ {
var self = this; var self = this;
// search button indicator // search button indicator
this.button = et2_createWidget('button',{class:"et2_button_with_image"},this); this.button = et2_createWidget('button',{image: 'search', background_image: true/*class:"et2_button_with_image"*/},this);
this.button.onclick= function(){ this.button.onclick = function(){
self._show_hide(true); self._show_hide(true);
self.search.input.focus() self.search.input.focus();
}; };
this.div.prepend(this.button.getDOMNode()); this.div.prepend(this.button.getDOMNode());
// input field // input field
this.search = et2_createWidget('textbox',{"blur":egw.lang("search"), this.search = et2_createWidget('textbox',{"blur":egw.lang("search"),
onkeypress:function(event) { onkeypress:function(event) {
@ -470,7 +470,7 @@ var et2_searchbox = et2_textbox.extend(
self.set_value(''); self.set_value('');
} }
}, },
blur: function(event){ blur: function(event){
self._show_hide(false); self._show_hide(false);
if (self._oldValue != self.get_value()) { if (self._oldValue != self.get_value()) {
@ -482,7 +482,7 @@ var et2_searchbox = et2_textbox.extend(
} }
}); });
this.div.append(this.search.getDOMNode()); this.div.append(this.search.getDOMNode());
// clear button implementation // clear button implementation
this.clear = jQuery(document.createElement('span')) this.clear = jQuery(document.createElement('span'))
.addClass('ui-icon clear') .addClass('ui-icon clear')
@ -503,9 +503,9 @@ var et2_searchbox = et2_textbox.extend(
}) })
.appendTo(this.div); .appendTo(this.div);
}, },
/** /**
* Show/hide search field * Show/hide search field
* @param {boolean} _stat true means show and false means hide * @param {boolean} _stat true means show and false means hide
*/ */
_show_hide: function(_stat) _show_hide: function(_stat)
@ -513,7 +513,7 @@ var et2_searchbox = et2_textbox.extend(
jQuery(this.search.getDOMNode()).toggleClass('hide',!_stat); jQuery(this.search.getDOMNode()).toggleClass('hide',!_stat);
jQuery('span.clear',this.div).toggleClass('hide',!_stat); jQuery('span.clear',this.div).toggleClass('hide',!_stat);
}, },
/** /**
* toggle search button status based on value * toggle search button status based on value
*/ */
@ -535,17 +535,17 @@ var et2_searchbox = et2_textbox.extend(
change:function() change:function()
{ {
this._searchToggleState(); this._searchToggleState();
this._super.apply(this,arguments); this._super.apply(this,arguments);
}, },
get_value:function(){ get_value:function(){
return this.search.input.val(); return this.search.input.val();
}, },
/** /**
* override doLoadingFinished in order to set initial state * override doLoadingFinished in order to set initial state
*/ */
doLoadingFinished: function() doLoadingFinished: function()
{ {