forked from extern/egroupware
Fix some bugs:
- Always use et2 - Prevent duplicate portlets - Prevent duplicate links in link list
This commit is contained in:
parent
f60e402eb0
commit
6f9ea1e859
@ -62,7 +62,19 @@ class home_list_portlet extends home_portlet
|
|||||||
// Add a new entry to the list
|
// Add a new entry to the list
|
||||||
if($context['add'])
|
if($context['add'])
|
||||||
{
|
{
|
||||||
$context['list'][] = $context['add'];
|
$ok_to_add = true;
|
||||||
|
foreach($context['list'] as $key => $entry)
|
||||||
|
{
|
||||||
|
if($entry == $context['add'])
|
||||||
|
{
|
||||||
|
$ok_to_add = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($ok_to_add)
|
||||||
|
{
|
||||||
|
$context['list'][] = $context['add'];
|
||||||
|
}
|
||||||
unset($context['add']);
|
unset($context['add']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class home_ui
|
|||||||
// CSS for Gridster grid layout
|
// CSS for Gridster grid layout
|
||||||
egw_framework::includeCSS('/phpgwapi/js/jquery/gridster/jquery.gridster.css');
|
egw_framework::includeCSS('/phpgwapi/js/jquery/gridster/jquery.gridster.css');
|
||||||
|
|
||||||
$template = new etemplate('home.index');
|
$template = new etemplate_new('home.index');
|
||||||
|
|
||||||
$content = array(
|
$content = array(
|
||||||
'portlets' => $this->get_user_portlets($template)
|
'portlets' => $this->get_user_portlets($template)
|
||||||
@ -101,7 +101,7 @@ class home_ui
|
|||||||
* Actual portlet content is provided by each portlet.
|
* Actual portlet content is provided by each portlet.
|
||||||
* @param template etemplate so attributes can be set
|
* @param template etemplate so attributes can be set
|
||||||
*/
|
*/
|
||||||
protected function get_user_portlets(etemplate &$template)
|
protected function get_user_portlets(etemplate_new &$template)
|
||||||
{
|
{
|
||||||
$portlets = array(
|
$portlets = array(
|
||||||
'Just a hard-coded test',
|
'Just a hard-coded test',
|
||||||
|
@ -83,8 +83,10 @@ app.home = AppJS.extend(
|
|||||||
// call parent
|
// call parent
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
|
||||||
this.et2 = et2.widgetContainer;
|
|
||||||
this.portlet_container = this.et2.getWidgetById("portlets");
|
this.portlet_container = this.et2.getWidgetById("portlets");
|
||||||
|
|
||||||
|
// Don't do twice
|
||||||
|
if(this.portlet_container._children.length > 0) return;
|
||||||
|
|
||||||
// Add portlets
|
// Add portlets
|
||||||
var content = this.et2.getArrayMgr("content").getEntry("portlets");
|
var content = this.et2.getArrayMgr("content").getEntry("portlets");
|
||||||
|
Loading…
Reference in New Issue
Block a user