Home progress:

- Fix link did not reload properly
- Place new widgets where context menu was opened
- Add mainscreen message
This commit is contained in:
Nathan Gray 2014-11-10 18:44:11 +00:00
parent 0497818385
commit 80d0716b6c
4 changed files with 30 additions and 3 deletions

View File

@ -47,6 +47,8 @@ class home_link_portlet extends home_portlet
if($context['entry'] && is_array($context['entry']));
{
$this->title = $context['entry']['title'] = egw_link::title($context['entry']['app'], $context['entry']['id']);
$need_reload |= (boolean)$context['entry']['id'];
}
$this->context = $context;
}

View File

@ -107,4 +107,9 @@ abstract class home_portlet
{
return false;
}
public function __toString()
{
return get_called_class() . ' Context:' . array2string($this->context);
}
}

View File

@ -44,7 +44,6 @@ class home_ui
'portlets' => $this->get_user_portlets($template)
);
$template->setElementAttribute('home.index','actions',$this->get_actions());
//$template->setElementAttribute('portlets[1]','settings',$settings[1]);
$GLOBALS['egw_info']['flags']['app_header'] = lang('home');
$GLOBALS['egw_info']['flags']['currentapp'] = 'home';
@ -59,6 +58,20 @@ class home_ui
if(!$id) continue;
$portlet = $this->get_portlet($id, $p_data, $content, $attrs, true);
}
// Main screen message
translation::add_app('mainscreen');
$greeting = translation::translate('mainscreen_message',false,'');
if($greeting == 'mainscreen_message'|| empty($greeting))
{
translation::add_app('mainscreen','en'); // trying the en one
$greeting = translation::translate('mainscreen_message',false,'');
}
if(!($greeting == 'mainscreen_message'|| empty($greeting)))
{
$content['mainscreen_message'] = $greeting;
}
}
/**
@ -367,7 +380,7 @@ class home_ui
else
{
// Get portlet settings, and merge new with old
$context = $values+(array)$portlets[$portlet_id]; //array('class'=>$attributes['class']);
$context = $values+(array)$portlets[$portlet_id];
// Handle add IDs
$classname =& $context['class'];

View File

@ -156,7 +156,14 @@ app.classes.home = AppJS.extend(
add: function(action, source) {
// Put it in the last row, first column, since the mouse position is unknown
var max_row = Math.max.apply(null,$j('div',this.portlet_container.div).map(function() {return $j(this).attr('data-row');}));
var attrs = {id: this._create_id(), row: max_row + 1, col: 1};
var attrs = {id: this._create_id(), row: 1, col: 1};
if(action.menu_context)
{
var $portlet_container = $j(this.portlet_container.getDOMNode());
attrs.row = Math.round((action.menu_context.posy - $portlet_container.offset().top )/ this.GRID)+1;
attrs.col = Math.max(1,Math.round((action.menu_context.posx - $portlet_container.offset().left) / this.GRID)+1);
}
var portlet = et2_createWidget('portlet',attrs, this.portlet_container);
// Override content ID so etemplate loads