2000-08-19 15:58:49 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - administration *
|
|
|
|
* http://www.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. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2001-05-10 13:21:06 +02:00
|
|
|
$phpgw_info = array();
|
|
|
|
$phpgw_info['flags'] = array(
|
|
|
|
'currentapp' => 'admin',
|
|
|
|
'enable_nextmatchs_class' => True
|
|
|
|
);
|
|
|
|
include('../header.inc.php');
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-05-11 15:26:46 +02:00
|
|
|
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
|
|
|
|
$p->set_file(array('applications' => 'applications.tpl'));
|
|
|
|
$p->set_block('applications','list','list');
|
|
|
|
$p->set_block('applications','row','row');
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-06-28 05:37:13 +02:00
|
|
|
$offset = $phpgw_info['user']['preferences']['common']['maxmatchs'];
|
|
|
|
|
2001-07-06 20:41:52 +02:00
|
|
|
$phpgw->db->query("SELECT * FROM phpgw_applications WHERE app_enabled<3",__LINE__,__FILE__);
|
|
|
|
if($phpgw->db->num_rows())
|
|
|
|
{
|
|
|
|
while ($phpgw->db->next_record())
|
|
|
|
{
|
|
|
|
$name = $phpgw->db->f('app_name');
|
|
|
|
$title = $phpgw->db->f('app_title');
|
|
|
|
$status = $phpgw->db->f('app_enabled');
|
|
|
|
$apps[$name] = array(
|
|
|
|
'title' => $title,
|
|
|
|
'name' => $name,
|
|
|
|
'status' => $status
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@reset($apps);
|
2001-06-28 05:37:13 +02:00
|
|
|
$total = count($apps);
|
|
|
|
|
|
|
|
if(!$sort)
|
2001-05-10 13:21:06 +02:00
|
|
|
{
|
2001-06-28 05:37:13 +02:00
|
|
|
$sort = 'ASC';
|
|
|
|
}
|
|
|
|
|
|
|
|
if($sort == 'ASC')
|
|
|
|
{
|
|
|
|
ksort($apps);
|
2001-05-10 13:21:06 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-06-28 05:37:13 +02:00
|
|
|
krsort($apps);
|
2001-05-10 13:21:06 +02:00
|
|
|
}
|
2000-11-22 07:58:08 +01:00
|
|
|
|
2001-06-28 05:37:13 +02:00
|
|
|
if ($start && $offset)
|
|
|
|
{
|
|
|
|
$limit = $start + $offset;
|
|
|
|
}
|
|
|
|
elseif ($start && !$offset)
|
|
|
|
{
|
|
|
|
$limit = $start;
|
|
|
|
}
|
|
|
|
elseif(!$start && !$offset)
|
2001-05-10 13:21:06 +02:00
|
|
|
{
|
2001-06-28 05:37:13 +02:00
|
|
|
$limit = $total;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$start = 0;
|
|
|
|
$limit = $offset;
|
|
|
|
}
|
2001-06-28 05:50:48 +02:00
|
|
|
|
|
|
|
if ($limit > $total)
|
|
|
|
{
|
|
|
|
$limit = $total;
|
|
|
|
}
|
2001-07-06 20:41:52 +02:00
|
|
|
|
2001-06-28 05:37:13 +02:00
|
|
|
$i = 0;
|
2001-07-06 20:41:52 +02:00
|
|
|
$applications = array();
|
2001-06-28 05:37:13 +02:00
|
|
|
while(list($app,$data) = @each($apps))
|
|
|
|
{
|
|
|
|
if($i >= $start && $i<= $limit)
|
|
|
|
{
|
2001-07-06 20:41:52 +02:00
|
|
|
$applications[$app] = $data;
|
2001-06-28 05:37:13 +02:00
|
|
|
}
|
|
|
|
$i++;
|
2001-05-10 13:21:06 +02:00
|
|
|
}
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-05-10 13:21:06 +02:00
|
|
|
$p->set_var('lang_installed',lang('Installed applications'));
|
|
|
|
$p->set_var('bg_color',$phpgw_info['theme']['bg_color']);
|
|
|
|
$p->set_var('th_bg',$phpgw_info['theme']['th_bg']);
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-07-06 20:41:52 +02:00
|
|
|
$p->set_var('sort_title',$phpgw->nextmatchs->show_sort_order($sort,'title','title','/admin/applications.php',lang('Title')));
|
|
|
|
$p->set_var('lang_showing',$phpgw->nextmatchs->show_hits($total,$start));
|
|
|
|
$p->set_var('left',$phpgw->nextmatchs->left('/admin/applications.php',$start,$total));
|
|
|
|
$p->set_var('right',$phpgw->nextmatchs->right('/admin/applications.php',$start,$total));
|
|
|
|
|
2001-05-10 13:21:06 +02:00
|
|
|
$p->set_var('lang_edit',lang('Edit'));
|
|
|
|
$p->set_var('lang_delete',lang('Delete'));
|
|
|
|
$p->set_var('lang_enabled',lang('Enabled'));
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-07-06 20:41:52 +02:00
|
|
|
$p->set_var('new_action',$phpgw->link('/admin/newapplication.php'));
|
|
|
|
$p->set_var('lang_add',lang('add'));
|
|
|
|
|
2001-06-28 05:37:13 +02:00
|
|
|
@reset($applications);
|
|
|
|
while (list($key,$app) = @each($applications))
|
2001-05-10 13:21:06 +02:00
|
|
|
{
|
|
|
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
2001-06-28 05:37:13 +02:00
|
|
|
|
|
|
|
if($app['title'])
|
|
|
|
{
|
|
|
|
$name = $app['title'];
|
|
|
|
}
|
|
|
|
elseif($app['name'])
|
|
|
|
{
|
|
|
|
$name = $app['name'];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$name = ' ';
|
|
|
|
}
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-05-10 13:21:06 +02:00
|
|
|
$p->set_var('tr_color',$tr_color);
|
|
|
|
$p->set_var('name',$name);
|
2001-06-07 13:28:31 +02:00
|
|
|
|
2001-06-28 05:37:13 +02:00
|
|
|
$p->set_var('edit','<a href="' . $phpgw->link('/admin/editapplication.php','app_name=' . urlencode($app['name'])) . '"> ' . lang('Edit') . ' </a>');
|
|
|
|
$p->set_var('delete','<a href="' . $phpgw->link('/admin/deleteapplication.php','app_name=' . urlencode($app['name'])) . '"> ' . lang('Delete') . ' </a>');
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-06-28 05:37:13 +02:00
|
|
|
if ($app['status'])
|
2001-05-10 13:21:06 +02:00
|
|
|
{
|
|
|
|
$status = lang('Yes');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-06-28 05:37:13 +02:00
|
|
|
$status = '<b>' . lang('No') . '</b>';
|
2001-05-10 13:21:06 +02:00
|
|
|
}
|
|
|
|
$p->set_var('status',$status);
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-05-10 13:21:06 +02:00
|
|
|
$p->parse('rows','row',True);
|
|
|
|
}
|
2000-08-19 15:58:49 +02:00
|
|
|
|
2001-05-10 13:21:06 +02:00
|
|
|
$p->pparse('out','list');
|
2001-07-06 20:41:52 +02:00
|
|
|
|
2001-05-10 13:21:06 +02:00
|
|
|
$phpgw->common->phpgw_footer();
|
2001-02-09 06:04:21 +01:00
|
|
|
?>
|