egroupware_official/preferences/index.php

83 lines
2.4 KiB
PHP
Raw Normal View History

2000-08-18 05:24:22 +02:00
<?php
2001-03-08 10:56:18 +01:00
/**************************************************************************\
* phpGroupWare - preferences *
* http://www.phpgroupware.org *
* Written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
2000-08-18 05:24:22 +02:00
2001-03-08 10:56:18 +01:00
/* $Id$ */
2000-08-18 05:24:22 +02:00
2001-03-08 10:56:18 +01:00
$phpgw_info['flags']['currentapp'] = 'preferences';
include('../header.inc.php');
2001-05-11 20:43:47 +02:00
$pref_tpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$templates = Array(
'pref' => 'index.tpl'
);
$pref_tpl->set_file($templates);
2000-08-18 05:24:22 +02:00
$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');
2001-05-11 23:18:59 +02:00
2001-03-08 10:56:18 +01:00
// This func called by the includes to dump a row header
function section_start($name='',$icon='',$appname='')
2001-03-08 10:56:18 +01:00
{
global $phpgw_info, $pref_tpl;
2001-05-11 19:19:20 +02:00
2001-05-11 23:18:59 +02:00
$pref_tpl->set_var('icon_backcolor',$phpgw_info['theme']['row_off']);
// $pref_tpl->set_var('link_backcolor',$phpgw_info['theme']['row_off']);
$pref_tpl->set_var('a_name',$appname);
2001-05-11 19:19:20 +02:00
$pref_tpl->set_var('app_name',lang($name));
$pref_tpl->set_var('app_icon',$icon);
2001-03-08 10:56:18 +01:00
if ($icon)
{
$pref_tpl->parse('rows','app_row',True);
2001-03-08 10:56:18 +01:00
}
else
{
$pref_tpl->parse('rows','app_row_noicon',True);
2001-03-08 10:56:18 +01:00
}
}
2001-05-11 19:19:20 +02:00
function section_item($pref_link='',$pref_text='')
{
global $pref_tpl;
2001-05-11 19:19:20 +02:00
$pref_tpl->set_var('pref_link',$pref_link);
$pref_tpl->set_var('pref_text',$pref_text);
$pref_tpl->parse('rows','link_row',True);
2001-05-11 19:19:20 +02:00
}
2001-03-08 10:56:18 +01:00
function section_end()
{
global $pref_tpl;
$pref_tpl->parse('rows','spacer_row',True);
}
function display_section($appname,$title,$file)
{
global $phpgw;
section_start($title,$phpgw->common->image($appname,Array('navbar.gif',$appname.'.gif')),$appname);
while(list($text,$url) = each($file))
{
section_item($url,lang($text));
}
section_end();
2001-03-08 10:56:18 +01:00
}
2000-12-15 22:56:09 +01:00
2001-03-08 10:56:18 +01:00
$phpgw->common->hook();
$pref_tpl->pparse('out','list');
2001-03-08 10:56:18 +01:00
$phpgw->common->phpgw_footer();
?>