no longer needed

This commit is contained in:
Miles Lott 2001-09-16 18:11:03 +00:00
parent 477991e9f4
commit b9d860f9c2
4 changed files with 0 additions and 454 deletions

View File

@ -1,150 +0,0 @@
<?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$ */
$phpgw_info = array();
$phpgw_info['flags'] = array(
'currentapp' => 'admin',
'enable_nextmatchs_class' => True
);
include('../header.inc.php');
$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');
$offset = $phpgw_info['user']['preferences']['common']['maxmatchs'];
$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);
$total = count($apps);
if(!$sort)
{
$sort = 'ASC';
}
if($sort == 'ASC')
{
ksort($apps);
}
else
{
krsort($apps);
}
if ($start && $offset)
{
$limit = $start + $offset;
}
elseif ($start && !$offset)
{
$limit = $start;
}
elseif(!$start && !$offset)
{
$limit = $total;
}
else
{
$start = 0;
$limit = $offset;
}
if ($limit > $total)
{
$limit = $total;
}
$i = 0;
$applications = array();
while(list($app,$data) = @each($apps))
{
if($i >= $start && $i<= $limit)
{
$applications[$app] = $data;
}
$i++;
}
$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']);
$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));
$p->set_var('lang_edit',lang('Edit'));
$p->set_var('lang_delete',lang('Delete'));
$p->set_var('lang_enabled',lang('Enabled'));
$p->set_var('new_action',$phpgw->link('/admin/newapplication.php'));
$p->set_var('lang_add',lang('add'));
@reset($applications);
while (list($key,$app) = @each($applications))
{
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
if($app['title'])
{
$name = $app['title'];
}
elseif($app['name'])
{
$name = $app['name'];
}
else
{
$name = '&nbsp;';
}
$p->set_var('tr_color',$tr_color);
$p->set_var('name',$name);
$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>');
if ($app['status'])
{
$status = lang('Yes');
}
else
{
$status = '<b>' . lang('No') . '</b>';
}
$p->set_var('status',$status);
$p->parse('rows','row',True);
}
$p->pparse('out','list');
$phpgw->common->phpgw_footer();
?>

View File

@ -1,46 +0,0 @@
<?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$ */
$phpgw_info['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'admin'
);
if (!$app_name)
{
Header("Location: " . $phpgw->link('/admin/applications.php'));
}
include('../header.inc.php');
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$p->set_file(array('body' => 'delete_common.tpl'));
if ($confirm)
{
$phpgw->db->query("delete from phpgw_applications where app_name='$app_name'",__LINE__,__FILE__);
Header("Location: " . $phpgw->link('/admin/applications.php'));
$phpgw->common->phpgw_exit();
}
$phpgw->common->phpgw_header();
echo parse_navbar();
$p->set_var('messages',lang('Are you sure you want to delete this application ?'));
$p->set_var('no','<a href="' . $phpgw->link("/admin/applications.php") . '">' . lang('No') . '</a>');
$p->set_var('yes','<a href="' . $phpgw->link("/admin/deleteapplication.php","app_name=" . urlencode($app_name) . "&confirm=True") . '">' . lang('Yes') . '</a>');
$p->pparse('out','body');
$phpgw->common->phpgw_footer();
?>

View File

@ -1,134 +0,0 @@
<?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$ */
$phpgw_info = array();
if ($submit)
{
$phpgw_info['flags'] = array(
'noheader' => True,
'nonavbar' => True
);
}
$phpgw_info['flags']['currentapp'] = 'admin';
$phpgw_info['flags']['enable_nextmatchs_class'] = True;
include('../header.inc.php');
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
function display_row($label, $value)
{
global $phpgw,$p;
$p->set_var('tr_color',$phpgw->nextmatchs->alternate_row_color());
$p->set_var('label',$label);
$p->set_var('value',$value);
$p->parse('rows','row',True);
}
$p->set_file(array('application' => 'application_form.tpl'));
$p->set_block('application','form','form');
$p->set_block('application','row','row');
if ($submit)
{
if (! $app_order)
{
$app_order = 0;
}
$totalerrors = 0;
$n_app_name = chop($n_app_name);
$n_app_title = chop($n_app_title);
if (! $n_app_name)
{
$error[$totalerrors++] = lang('You must enter an application name.');
}
if (! $n_app_title)
{
$error[$totalerrors++] = lang('You must enter an application title.');
}
if ($old_app_name != $n_app_name)
{
$phpgw->db->query("select count(*) from phpgw_applications where app_name='"
. addslashes($n_app_name) . "'",__LINE__,__FILE__);
$phpgw->db->next_record();
if ($phpgw->db->f(0) != 0)
{
$error[$totalerrors++] = lang('That application name already exists.');
}
}
if (! $totalerrors)
{
$phpgw->db->query("update phpgw_applications set app_name='" . addslashes($n_app_name) . "',"
. "app_title='" . addslashes($n_app_title) . "', app_enabled='"
. "$n_app_status',app_order='$app_order' where app_name='$old_app_name'",__LINE__,__FILE__);
Header("Location: " . $phpgw->link("/admin/applications.php"));
$phpgw->common->phpgw_exit();
}
}
$phpgw->db->query("select * from phpgw_applications where app_name='$app_name'",__LINE__,__FILE__);
$phpgw->db->next_record();
if ($totalerrors)
{
$phpgw->common->phpgw_header();
echo parse_navbar();
$p->set_var('error',"<p><center>" . $phpgw->common->error_list($error) . "</center><br>");
}
else
{
$p->set_var('error','');
$n_app_name = $phpgw->db->f('app_name');
$n_app_title = $phpgw->db->f('app_title');
$n_app_status = $phpgw->db->f('app_enabled');
$old_app_name = $phpgw->db->f('app_name');
$app_order = $phpgw->db->f('app_order');
}
$p->set_var('lang_header',lang('Edit application'));
$p->set_var('hidden_vars','<input type="hidden" name="old_app_name" value="' . $old_app_name . '">');
$p->set_var('th_bg',$phpgw_info['theme']['th_bg']);
$p->set_var('form_action',$phpgw->link('/admin/editapplication.php'));
display_row(lang('application name'),'<input name="n_app_name" value="' . $n_app_name . '">');
display_row(lang('application title'),'<input name="n_app_title" value="' . $n_app_title . '">');
$p->set_var('lang_status',lang('Status'));
$p->set_var('lang_submit_button',lang('edit'));
$selected[$n_app_status] = " selected";
$status_html = '<option value="0"' . $selected[0] . '>' . lang('Disabled') . '</option>'
. '<option value="1"' . $selected[1] . '>' . lang('Enabled') . '</option>'
. '<option value="2"' . $selected[2] . '>' . lang('Enabled - Hidden from navbar') . '</option>';
display_row(lang("Status"),'<select name="n_app_status">' . $status_html . '</select>');
display_row(lang("Select which location this app should appear on the navbar, lowest (left) to highest (right)"),'<input name="app_order" value="' . $app_order . '">');
$p->set_var('select_status',$status_html);
$p->pparse('out','form');
$phpgw->common->phpgw_footer();
?>

View File

@ -1,124 +0,0 @@
<?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$ */
$phpgw_info = array();
$phpgw_info['flags'] = array(
'currentapp' => 'admin',
'noheader' => True,
'nonavbar' => True,
'enable_nextmatchs_class' => True
);
include('../header.inc.php');
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$p->set_file(array('application' => 'application_form.tpl'));
$p->set_block('application','form','form');
$p->set_block('application','row','row');
function display_row($label, $value)
{
global $phpgw,$p;
$p->set_var('tr_color',$phpgw->nextmatchs->alternate_row_color());
$p->set_var('label',$label);
$p->set_var('value',$value);
$p->parse('rows','row',True);
}
if ($submit)
{
$totalerrors = 0;
if (! $app_order)
{
$app_order = 0;
}
$n_app_name = chop($n_app_name);
$n_app_title = chop($n_app_title);
$phpgw->db->query("select count(*) from phpgw_applications where app_name='"
. addslashes($n_app_name) . "'",__LINE__,__FILE__);
$phpgw->db->next_record();
if ($phpgw->db->f(0) != 0)
{
$error[$totalerrors++] = lang("That application name already exsists.");
}
if (preg_match("/\D/",$app_order))
{
$error[$totalerrors++] = lang("That application order must be a number.");
}
if (! $n_app_name)
{
$error[$totalerrors++] = lang("You must enter an application name.");
}
if (! $n_app_title)
{
$error[$totalerrors++] = lang("You must enter an application title.");
}
if (! $totalerrors)
{
$phpgw->db->query("insert into phpgw_applications (app_name,app_title,app_enabled,app_order) values('"
. addslashes($n_app_name) . "','" . addslashes($n_app_title) . "','"
. "$n_app_status','$app_order')",__LINE__,__FILE__);
Header("Location: " . $phpgw->link("/admin/applications.php"));
$phpgw->common->phpgw_exit();
}
else
{
$p->set_var("error","<p><center>" . $phpgw->common->error_list($error) . "</center><br>");
}
}
else
{ // else submit
$p->set_var("error","");
}
$phpgw->common->phpgw_header();
echo parse_navbar();
$p->set_var("lang_header",lang("Add new application"));
$p->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
$p->set_var("hidden_vars","");
$p->set_var("form_action",$phpgw->link("/admin/newapplication.php"));
display_row(lang("application name"),'<input name="n_app_name" value="' . $n_app_name . '">');
display_row(lang("application title"),'<input name="n_app_title" value="' . $n_app_title . '">');
if(!isset($n_app_status)) { $n_app_status = 1; }
$selected[$n_app_status] = ' selected';
$status_html = '<option value="0"' . $selected[0] . '>' . lang('Disabled') . '</option>'
. '<option value="1"' . $selected[1] . '>' . lang('Enabled') . '</option>'
. '<option value="2"' . $selected[2] . '>' . lang('Enabled - Hidden from navbar') . '</option>';
display_row(lang('Status'),'<select name="n_app_status">' . $status_html . '</select>');
if (! $app_order)
{
$phpgw->db->query("select (max(app_order)+1) as max from phpgw_applications");
$phpgw->db->next_record();
$app_order = $phpgw->db->f("max");
}
display_row(lang("Select which location this app should appear on the navbar, lowest (left) to highest (right)"),'<input name="app_order" value="' . $app_order . '">');
$p->set_var("lang_submit_button",lang("add"));
$p->pparse("out","form");
$phpgw->common->phpgw_footer();
?>