Make owner appendix optional for categories

This commit is contained in:
Jörg Lehrke 2009-12-07 16:15:39 +00:00
parent 83a61a8766
commit 459941bd84
8 changed files with 48 additions and 20 deletions

View File

@ -231,11 +231,14 @@
if ($this->appname && $cat['app_name'] == 'phpgw')
{
$appendix = '<' . lang('Global') . '>';
$appendix = ' ♦';
}
elseif ($cat['owner'] != $accountId)
{
$appendix = '<' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{
$appendix = ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
}
}
else
{

View File

@ -195,7 +195,10 @@
}
elseif ($cat['owner'] != $accountId)
{
$s .= '<' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{
$s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
}
}
elseif ($cat['access'] == 'private')
{

View File

@ -95,7 +95,10 @@ class tree_widget
}
elseif ($cat['owner'] != $accountId)
{
$s .= '<' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{
$s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
}
}
elseif ($cat['access'] == 'private') {
$s .= ' ♥';

View File

@ -343,7 +343,10 @@ class infolog_hooks
}
elseif ($cat['owner'] != $accountId)
{
$s .= '<' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{
$s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
}
}
elseif ($cat['access'] == 'private')
{

View File

@ -405,7 +405,10 @@ class categories
}
elseif ($cat['owner'] != $this->account_id)
{
$s .= '<' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{
$s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
}
}
elseif ($cat['access'] == 'private')
{

View File

@ -216,22 +216,22 @@
$GLOBALS['egw']->template->set_var('color',$gray < 128 ? 'style="color: white;"' : '');
$accountId = $GLOBALS['egw_info']['user']['account_id'];
$appendix = '';
if ($cat['app_name'] == 'phpgw')
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{
$appendix = '&lt;' . lang('Global') . '&gt;';
}
elseif ($cat['owner'] == '-1')
{
$appendix = '&lt;' . lang('Global') . '&nbsp;' . $GLOBALS['egw_info']['apps'][$cats_app]['title'] . '&gt;';
}
elseif ($cat['owner'] != $accountId)
{
$appendix = '&lt;' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '&gt;';
}
else
{
$appendix = '';
if ($cat['app_name'] == 'phpgw')
{
$appendix = ' &#9830;';
}
elseif ($cat['owner'] == '-1')
{
$appendix = ' &#9830;&nbsp;' . $GLOBALS['egw_info']['apps'][$cats_app]['title'];
}
elseif ($cat['owner'] != $accountId)
{
$appendix = ' &lt;' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '&gt;';
}
}
$level = $cat['level'];

View File

@ -316,6 +316,18 @@
'xmlrpc' => True,
'admin' => false,
),
'show_category_owner' => array(
'type' => 'select',
'label' => 'Show the category owner with the category name.',
'name' => 'show_category_owner',
'values' => array(
'1' => lang('Yes'),
'0' => lang('No'),
),
'help' => 'The owner is attached to distinguish between categories with the same name. You can turn this off and will get the names only.',
'xmlrpc' => True,
'admin' => False
),
);
// disable thumbnails, if no size configured by admin
if (!$GLOBALS['egw_info']['server']['link_list_thumbnail']) unset($GLOBALS['settings']['link_list_thumbnail']);

View File

@ -17,6 +17,7 @@ require_once 'Horde/RPC.php';
$GLOBALS['egw_info'] = array(
'flags' => array(
'currentapp' => 'login',
'login' => True,
'noheader' => True,
'nonavbar' => True,
'disable_Template_class' => True