a little nicer admin and prefs index page

This commit is contained in:
Ralf Becker 2011-06-03 16:40:33 +00:00
parent 4477efd6dc
commit 7e036516ef
3 changed files with 99 additions and 77 deletions

View File

@ -1,30 +1,63 @@
<!-- BEGIN list -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<style>
<!--
#prefIndex {
}
#divGenTime {
clear: left;
}
.prefAppBox {
width: 225px;
min-height: 125px;
border: 2px ridge gray;
border-radius: 10px;
margin: 5px;
padding-left: 5px;
float: left;
box-shadow:8px 8px 8px #666;
}
.prefAppBox h3 {
height: 32px;
padding-left: 50px;
padding-top: 10px;
background-image: url(../phpgwapi/templates/default/images/nonav.png);
background-repeat: no-repeat;
background-position: left;
background-size: 32px;
margin: 0;
}
.prefAppBox ul {
margin: 0;
padding-left: 20px;
padding-top: 0;
}
-->
</style>
<div id="prefIndex">
{rows}
</table>
</div>
<!-- END list -->
<!-- BEGIN app_row -->
<tr height="60" class="row_off">
<td width="5%" align="center" valign="middle"><img src="{app_icon}" alt="[ {app_name} ]"> <a name="{a_name}"></a></td>
<td width="95%" valign="middle"><strong>&nbsp;&nbsp;{app_name}</strong></td>
</tr>
<div class="prefAppBox">
<h3 style="background-image: url({app_icon})">{app_name}</h3>
<ul>
<!-- END app_row -->
<!-- BEGIN app_row_noicon -->
<tr class="row_off">
<td colspan="2" width="95%" valign="middle"><strong>&nbsp;&nbsp;{app_name}</strong> <a name="{a_name}"></a></td>
</tr>
<div class="prefAppBox">
<h3>{app_name}</h3>
<ul>
<!-- END app_row_noicon -->
<!-- BEGIN link_row -->
<tr>
<td colspan="2">&nbsp;&#8226;&nbsp;<a href="{pref_link}">{pref_text}</a></td>
</tr>
<li><a href="{pref_link}">{pref_text}</a></li>
<!-- END link_row -->
<!-- BEGIN spacer_row -->
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</ul>
</div>
<!-- END spacer_row -->

View File

@ -18,10 +18,11 @@ $GLOBALS['egw_info'] = array(
),
);
include('../header.inc.php');
auth::check_password_age('preferences','index');
$GLOBALS['egw_info']['flags']['nonavbar']=false;
common::egw_header();
$pref_tpl =& CreateObject('phpgwapi.Template',EGW_APP_TPL);
$pref_tpl = new Template(EGW_APP_TPL);
$templates = Array(
'pref' => 'index.tpl'
);
@ -34,51 +35,6 @@ $pref_tpl->set_block('pref','app_row_noicon');
$pref_tpl->set_block('pref','link_row');
$pref_tpl->set_block('pref','spacer_row');
if ($GLOBALS['egw']->acl->check('run',1,'admin'))
{
// This is where we will keep track of our position.
// Developers won't have to pass around a variable then
$session_data = $GLOBALS['egw']->session->appsession('session_data','preferences');
if (! is_array($session_data))
{
$session_data = array('type' => 'user');
$GLOBALS['egw']->session->appsession('session_data','preferences',$session_data);
}
if (! $_GET['type'])
{
$type = $session_data['type'];
}
else
{
$type = $_GET['type'];
$session_data = array('type' => $type);
$GLOBALS['egw']->session->appsession('session_data','preferences',$session_data);
}
$tabs[] = array(
'label' => lang('Your preferences'),
'link' => egw::link('/preferences/index.php','type=user')
);
$tabs[] = array(
'label' => lang('Default preferences'),
'link' => egw::link('/preferences/index.php','type=default')
);
$tabs[] = array(
'label' => lang('Forced preferences'),
'link' => egw::link('/preferences/index.php','type=forced')
);
switch($type)
{
case 'user': $selected = 0; break;
case 'default': $selected = 1; break;
case 'forced': $selected = 2; break;
}
$pref_tpl->set_var('tabs',$GLOBALS['egw']->common->create_tabs($tabs,$selected));
}
// This func called by the includes to dump a row header
function section_start($appname='',$icon='')
{
@ -128,7 +84,7 @@ function display_section($appname,$file,$file2=False)
{
$file = $file2;
}
section_start($appname,$GLOBALS['egw']->common->image($appname,Array('navbar',$appname)));
section_start($appname,common::image($appname,Array('navbar',$appname)));
foreach($file as $text => $url)
{

View File

@ -1,30 +1,63 @@
<!-- BEGIN list -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<style>
<!--
#prefIndex {
}
#divGenTime {
clear: left;
}
.prefAppBox {
width: 225px;
min-height: 125px;
border: 2px ridge gray;
border-radius: 10px;
margin: 5px;
padding-left: 5px;
float: left;
box-shadow:8px 8px 8px #666;
}
.prefAppBox h3 {
height: 32px;
padding-left: 50px;
padding-top: 10px;
background-image: url(../phpgwapi/templates/default/images/nonav.png);
background-repeat: no-repeat;
background-position: left;
background-size: 32px;
margin: 0;
}
.prefAppBox ul {
margin: 0;
padding-left: 20px;
padding-top: 0;
}
-->
</style>
<div id="prefIndex">
{rows}
</table>
</div>
<!-- END list -->
<!-- BEGIN app_row -->
<tr height="60" bgcolor="{icon_backcolor}">
<td width="5%" align="center" valign="middle"><img src="{app_icon}" alt="[ {app_name} ]"> <a name="{a_name}"></a></td>
<td width="95%" valign="middle"><strong>&nbsp;&nbsp;{app_name}</strong></td>
</tr>
<div class="prefAppBox">
<h3 style="background-image: url({app_icon})">{app_name}</h3>
<ul>
<!-- END app_row -->
<!-- BEGIN app_row_noicon -->
<tr bgcolor="{icon_backcolor}">
<td colspan="2" width="95%" valign="middle"><strong>&nbsp;&nbsp;{app_name}</strong> <a name="{a_name}"></a></td>
</tr>
<div class="prefAppBox">
<h3>{app_name}</h3>
<ul>
<!-- END app_row_noicon -->
<!-- BEGIN link_row -->
<tr>
<td colspan="2">&nbsp;&#8226;&nbsp;<a href="{pref_link}">{pref_text}</a></td>
</tr>
<li><a href="{pref_link}">{pref_text}</a></li>
<!-- END link_row -->
<!-- BEGIN spacer_row -->
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</ul>
</div>
<!-- END spacer_row -->