Cleaned up the images for the new layout and made the red icon work w/ home and preferences

This commit is contained in:
jengo 2001-01-08 15:01:37 +00:00
parent 883b40c508
commit 68da4219c0
14 changed files with 116 additions and 79 deletions

View File

@ -13,78 +13,51 @@
class categories
{
function read($format = "", $app_name = "", $owner = "", $cat_id = "")
{
global $phpgw_info, $phpgw;
$db2 = $phpgw->db;
if (! isset($owner)) {
$owner = $phpgw_info["user"]["account_id"];
}
if (! isset($format)) {
$format = "array";
}
if ($format == "single") {
$db2->query("select * from categories where cat_id='$cat_id' and account_id='$owner' "
. "and app_name='" . addslashes($app_name) . "'");
$db2->next_record();
$cat_info[]["id"] = $db2->f("cat_id");
$cat_info[]["name"] = $db2->f("cat_name");
$cat_info[]["descrption"] = $db2->f("cat_descrption");
return $cat_info;
}
if (! $app_name) {
$app_name = $phpgw_info["flags"]["currentapp"];
}
if (! $account_id) {
$owner = $phpgw_info["user"]["account_id"];
}
$db2->query("select cat_id,cat_name,cat_description from categories where app_name='$app_name' "
. "and account_id='$owner'");
$i = 0;
while ($db2->next_record()) {
if ($format == "array") {
$cat_list[$i]["cat_id"] = $db2->f("cat_id");
$cat_list[$i]["cat_name"] = $db2->f("cat_name");
$cat_list[$i]["cat_description"] = $db2->f("cat_description");
$i++;
}
if ($format == "select") {
$cat_list .= '<option value="' . $db2->f("cat_id") . '">' . $db2->f("cat_name")
. '</option>';
}
}
return $cat_list;
}
function add($owner,$app_name,$cat_name,$cat_description = "")
var $account_id;
var $app_name;
var $cats;
var $db;
function categories($account_id,$app_name)
{
global $phpgw;
$db2 = $phpgw->db;
$this->account_id = $account_id;
$this->app_name = $app_name;
$this->db = $phpgw->db;
$db2->query("insert into categories (account_id,app_name,cat_name,cat_description) values ('"
. "$owner','" . addslashes($app_name) . "','" . addslashes($cat_name) . "','"
. addslashes($cat_description) . "')");
$this->db->query("select * from phpgw_categories where cat_owner='$account_id' and app_name='"
. "$app_name'",__LINE__,__FILE__);
while ($this->db->next_record()) {
$this->cats[]["id"] = $this->db->f("cat_id");
$this->cats[]["parent"] = $this->db->f("cat_parent");
$this->cats[]["name"] = $this->db->f("cat_name");
$this->cats[]["description"] = $this->db->f("cat_description");
$this->cats[]["data"] = $this->db->f("cat_data");
}
}
function delete($owner,$app_name,$cat_name)
// Return into a select box, list or other formats
function list()
{
global $phpgw;
$db2 = $phpgw->db;
}
function add($app_name,$cat_name,$cat_parent,$cat_description = "", $cat_data = "")
{
$this->db->query("insert into phpgw_categories (cat_parent,cat_owner,cat_appname,cat_name,"
. "cat_description,cat_data) values ('$cat_parent','" . $this->account_id . "','"
. "$app_name','" . addslashes($cat_name) . "','" . addslashes($cat_description)
. "','$cat_data'",__LINE__,__FILE__);
}
$db2->query("delete from categories where account_id='$account_id' and app_name='"
. addslashes($app_name) . "' and cat_name='" . addslashes($cat_name) . "'");
function delete($cat_id)
{
$this->db->query("delete from phpgw_categories where cat_id='$cat_id' and cat_owner='"
. $this->account_id . "'",__LINE__,__FILE__);
}
function edit($owner,$app_name,$cat_name,$cat_description)
{
global $phpgw;
$db2 = $phpgw->db;
$db2->query("update categories set cat_name='" . addslashes($cat_name) . "', cat_description='"
. addslashes($cat_description) . "' where account_id='$owner' and app_name='"

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -13,7 +13,7 @@
function parse_navbar($force = False)
{
global $phpgw_info, $phpgw;
global $phpgw_info, $phpgw, $PHP_SELF;
$tpl = new Template($phpgw_info["server"]["template_dir"]);
$tpl->set_unknowns("remove");
@ -44,6 +44,20 @@
$tpl->set_var("logout_link",$phpgw_info["navbar"]["logout"]["url"]);
$tpl->set_var("help_link",$phpgw_info["navbar"]["about"]["url"]);
$ir = $phpgw_info["server"]["webserver_url"] . "/phpgwapi/templates/verdilak/images";
if (ereg($phpgw_info["server"]["webserver_url"] . "/index.php",$PHP_SELF)) {
$tpl->set_var("welcome_img",$ir . "/welcome-red.gif");
} else {
$tpl->set_var("welcome_img",$ir . "/welcome-grey.gif");
}
if (ereg("preferences",$PHP_SELF)) {
$tpl->set_var("preferences_img",$ir . "/preferences-red.gif");
} else {
$tpl->set_var("preferences_img",$ir . "/preferences-grey.gif");
}
$tpl->set_var("logout_img",$ir . "/logout-grey.gif");
/* if ($phpgw_info["server"]["showpoweredbyon"] == "top") {
$tpl->set_var("powered_by",lang("Powered by phpGroupWare version x",$phpgw_info["server"]["versions"]["phpgwapi"]));
}

View File

@ -6,11 +6,11 @@
<tr background="{img_root}/bg_filler.gif">
<td align="left" valign="bottom"><img src="{img_root}/logo.gif" height="32" width="123"></td>
<td align="center" valign="bottom" width="100%"><font color="FFFFFF" size="-1">{user_info}</font></td>
<td align="right" valign="bottom" rowspan="2"><a href="{home_link}"><img src="{img_root}/home.gif" border="0"></a><a href="{preferences_link}"><img src="{img_root}/preferences.gif" border="0"></a><a href="{logout_link}"><img src="{img_root}/logout.gif" border="0"></a><a href="{help_link}"><img src="{img_root}/about.gif" border="0"></a></td>
<td align="right" valign="bottom" rowspan="2"><a href="{home_link}"><img src="{welcome_img}" border="0"></a><a href="{preferences_link}"><img src="{preferences_img}" border="0"></a><a href="{logout_link}"><img src="{logout_img}" border="0"></a><a href="{help_link}"><img src="{img_root}/help.gif" border="0"></a></td>
</tr>
<tr background="{img_root}/bg_filler.gif">
<td align="center" width="100%" valign="bottom" colspan="2"><img src="{img_root}/greybar.jpg" height="4" width="100%"></td>
<td align="center" width="100%" valign="bottom" colspan="2"><img src="{img_root}/greybar.gif" height="6" width="100%"></td>
</tr>
</table>

View File

@ -262,14 +262,16 @@
)";
$phpgw_setup->db->query($sql);
$sql = "CREATE TABLE categories (
cat_id int(9) DEFAULT '0' NOT NULL auto_increment,
account_id int(11) DEFAULT '0' NOT NULL,
app_name varchar(25) NOT NULL,
cat_name varchar(150) NOT NULL,
cat_description text NOT NULL,
PRIMARY KEY (cat_id)
)";
$sql = "CREATE TABLE phpgw_categories (
cat_id int(9) DEFAULT '0' NOT NULL auto_increment,
cat_parent int(9) DEFAULT '0' NOT NULL,
cat_owner int(11) DEFAULT '0' NOT NULL,
cat_appname varchar(50) NOT NULL,
cat_name varchar(150) NOT NULL,
cat_description varchar(255) NOT NULL,
cat_data text,
PRIMARY KEY (cat_id)
)";
$phpgw_setup->db->query($sql);
$sql = "CREATE TABLE languages (

View File

@ -766,6 +766,29 @@
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre5";
}
$test[] = "0.9.8pre5";
function upgrade0_9_8pre5(){
global $phpgw_info, $phpgw_setup;
// Since no applications are using it yet. I am gonna drop it and create a new one.
// This is becuase I never finished the classes
$phpgw_setup->db->query("drop table categories");
$sql = "CREATE TABLE phpgw_categories (
cat_id int(9) DEFAULT '0' NOT NULL auto_increment,
cat_parent int(9) DEFAULT '0' NOT NULL,
cat_owner int(11) DEFAULT '0' NOT NULL,
cat_appname varchar(50) NOT NULL,
cat_name varchar(150) NOT NULL,
cat_description varchar(255) NOT NULL,
cat_data text,
PRIMARY KEY (cat_id)
)";
$phpgw_setup->db->query($sql);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.9pre1";
}
reset ($test);
while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -236,14 +236,18 @@
)";
$phpgw_setup->db->query($sql);
$sql = "CREATE TABLE categories (
cat_id serial,
account_id int DEFAULT '0' NOT NULL,
app_name varchar(25) NOT NULL,
cat_name varchar(150) NOT NULL,
cat_description text NOT NULL
)";
$sql = "CREATE TABLE phpgw_categories (
cat_id serial,
cat_parent int,
cat_owner int,
cat_appname varchar(50) NOT NULL,
cat_name varchar(150) NOT NULL,
cat_description varchar(255) NOT NULL,
cat_data text
)";
$phpgw_setup->db->query($sql);
$sql = "CREATE TABLE languages (
lang_id varchar(2) NOT NULL,

View File

@ -792,6 +792,27 @@
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre5";
}
$test[] = "0.9.8pre5";
function upgrade0_9_8pre5(){
global $phpgw_info, $phpgw_setup;
// Since no applications are using it yet. I am gonna drop it and create a new one.
// This is becuase I never finished the classes
$phpgw_setup->db->query("drop table categories");
$sql = "CREATE TABLE phpgw_categories (
cat_id serial,
cat_parent int,
cat_owner int,
cat_appname varchar(50) NOT NULL,
cat_name varchar(150) NOT NULL,
cat_description varchar(255) NOT NULL,
cat_data text
)";
$phpgw_setup->db->query($sql);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.9pre1";
}
reset ($test);
while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {