diff --git a/home/inc/class.home_list_portlet.inc.php b/home/inc/class.home_list_portlet.inc.php index e7dc057e02..db792f3801 100644 --- a/home/inc/class.home_list_portlet.inc.php +++ b/home/inc/class.home_list_portlet.inc.php @@ -62,7 +62,19 @@ class home_list_portlet extends home_portlet // Add a new entry to the list 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']); } diff --git a/home/inc/class.home_ui.inc.php b/home/inc/class.home_ui.inc.php index 1daa07f4a1..f1dc2f3603 100644 --- a/home/inc/class.home_ui.inc.php +++ b/home/inc/class.home_ui.inc.php @@ -37,7 +37,7 @@ class home_ui // CSS for Gridster grid layout egw_framework::includeCSS('/phpgwapi/js/jquery/gridster/jquery.gridster.css'); - $template = new etemplate('home.index'); + $template = new etemplate_new('home.index'); $content = array( 'portlets' => $this->get_user_portlets($template) @@ -101,7 +101,7 @@ class home_ui * Actual portlet content is provided by each portlet. * @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( 'Just a hard-coded test', diff --git a/home/js/app.js b/home/js/app.js index 568df51196..d0c88fe0ca 100644 --- a/home/js/app.js +++ b/home/js/app.js @@ -83,8 +83,10 @@ app.home = AppJS.extend( // call parent this._super.apply(this, arguments); - this.et2 = et2.widgetContainer; this.portlet_container = this.et2.getWidgetById("portlets"); + + // Don't do twice + if(this.portlet_container._children.length > 0) return; // Add portlets var content = this.et2.getArrayMgr("content").getEntry("portlets");