2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
2010-07-08 10:11:44 +02:00
|
|
|
/**
|
|
|
|
* EGroupware preferences
|
|
|
|
*
|
|
|
|
* @package preferences
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Joseph Engo <jengo@phpgroupware.org>
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @version $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
$GLOBALS['egw_info'] = array(
|
|
|
|
'flags' => array(
|
2010-09-22 11:48:27 +02:00
|
|
|
'noheader' => true,
|
|
|
|
'novavbar' => true,
|
2010-07-08 10:11:44 +02:00
|
|
|
'currentapp' => 'preferences',
|
|
|
|
'disable_Template_class' => True,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
include('../header.inc.php');
|
2011-06-03 18:40:33 +02:00
|
|
|
|
2010-09-22 11:48:27 +02:00
|
|
|
auth::check_password_age('preferences','index');
|
|
|
|
$GLOBALS['egw_info']['flags']['nonavbar']=false;
|
|
|
|
common::egw_header();
|
2011-06-03 18:40:33 +02:00
|
|
|
$pref_tpl = new Template(EGW_APP_TPL);
|
2010-07-08 10:11:44 +02:00
|
|
|
$templates = Array(
|
|
|
|
'pref' => 'index.tpl'
|
|
|
|
);
|
|
|
|
|
|
|
|
$pref_tpl->set_file($templates);
|
|
|
|
|
|
|
|
$pref_tpl->set_block('pref','list');
|
|
|
|
$pref_tpl->set_block('pref','app_row');
|
|
|
|
$pref_tpl->set_block('pref','app_row_noicon');
|
|
|
|
$pref_tpl->set_block('pref','link_row');
|
|
|
|
$pref_tpl->set_block('pref','spacer_row');
|
|
|
|
|
|
|
|
// This func called by the includes to dump a row header
|
|
|
|
function section_start($appname='',$icon='')
|
|
|
|
{
|
|
|
|
global $pref_tpl;
|
|
|
|
|
|
|
|
$pref_tpl->set_var('a_name',$appname);
|
|
|
|
$pref_tpl->set_var('app_name',$GLOBALS['egw_info']['apps'][$appname]['title']);
|
|
|
|
$pref_tpl->set_var('app_icon',$icon);
|
|
|
|
if ($icon)
|
2001-09-04 01:01:42 +02:00
|
|
|
{
|
2010-07-08 10:11:44 +02:00
|
|
|
$pref_tpl->parse('rows','app_row',True);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$pref_tpl->parse('rows','app_row_noicon',True);
|
|
|
|
}
|
|
|
|
}
|
2001-09-04 01:01:42 +02:00
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
function section_item($pref_link='',$pref_text='')
|
|
|
|
{
|
|
|
|
global $pref_tpl;
|
2001-09-04 01:01:42 +02:00
|
|
|
|
2013-05-10 18:39:42 +02:00
|
|
|
$pref_link = str_replace('preferences.uisettings.index', 'preferences.preferences_settings.index', $pref_link);
|
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
$pref_tpl->set_var('pref_link',$pref_link);
|
2001-09-04 01:01:42 +02:00
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
if (strtolower($pref_text) == 'grant access' && $GLOBALS['egw_info']['server']['deny_user_grants_access'])
|
2001-03-08 10:56:18 +01:00
|
|
|
{
|
2010-07-08 10:11:44 +02:00
|
|
|
return False;
|
2001-03-08 10:56:18 +01:00
|
|
|
}
|
2010-07-08 10:11:44 +02:00
|
|
|
else
|
2001-05-11 19:19:20 +02:00
|
|
|
{
|
2010-07-08 10:11:44 +02:00
|
|
|
$pref_tpl->set_var('pref_text',$pref_text);
|
|
|
|
}
|
2003-08-28 16:31:11 +02:00
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
$pref_tpl->parse('rows','link_row',True);
|
|
|
|
}
|
2001-09-09 20:48:20 +02:00
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
function section_end()
|
|
|
|
{
|
|
|
|
global $pref_tpl;
|
2001-09-09 20:48:20 +02:00
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
$pref_tpl->parse('rows','spacer_row',True);
|
|
|
|
}
|
2001-05-11 19:19:20 +02:00
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
function display_section($appname,$file,$file2=False)
|
|
|
|
{
|
|
|
|
if ($file2)
|
2001-03-08 10:56:18 +01:00
|
|
|
{
|
2010-07-08 10:11:44 +02:00
|
|
|
$file = $file2;
|
2001-05-24 03:13:09 +02:00
|
|
|
}
|
2011-06-03 18:40:33 +02:00
|
|
|
section_start($appname,common::image($appname,Array('navbar',$appname)));
|
2001-05-24 03:13:09 +02:00
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
foreach($file as $text => $url)
|
2001-05-24 03:13:09 +02:00
|
|
|
{
|
2010-07-08 10:11:44 +02:00
|
|
|
if (is_array($url))
|
2001-05-24 03:13:09 +02:00
|
|
|
{
|
2010-07-08 10:11:44 +02:00
|
|
|
$text = $url['text'];
|
|
|
|
$url = $url['link'];
|
2001-05-24 03:13:09 +02:00
|
|
|
}
|
2010-07-08 10:11:44 +02:00
|
|
|
section_item($url,lang($text));
|
2001-03-08 10:56:18 +01:00
|
|
|
}
|
2010-07-08 10:11:44 +02:00
|
|
|
section_end();
|
|
|
|
}
|
2000-12-15 22:56:09 +01:00
|
|
|
|
2010-07-08 10:11:44 +02:00
|
|
|
$GLOBALS['egw']->hooks->process('preferences',array('preferences'));
|
|
|
|
$pref_tpl->pfp('out','list');
|
|
|
|
common::egw_footer();
|