summaryrefslogtreecommitdiff
path: root/modules/index.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-06-11 20:33:35 +0000
committerDries Buytaert <dries@buytaert.net>2001-06-11 20:33:35 +0000
commitbe7077be33deb67e8c59af2cb21f55f4191772d9 (patch)
treec6a552e3b05ff24553fb31a54e3bf4f4d4f05689 /modules/index.module
parentc56ee67e29e89f5158801ba7bbe8f574a93215b4 (diff)
downloadbrdo-be7077be33deb67e8c59af2cb21f55f4191772d9.tar.gz
brdo-be7077be33deb67e8c59af2cb21f55f4191772d9.tar.bz2
- More updates to index.module.
Diffstat (limited to 'modules/index.module')
-rw-r--r--modules/index.module16
1 files changed, 5 insertions, 11 deletions
diff --git a/modules/index.module b/modules/index.module
index 673e00d69..fe8d564a4 100644
--- a/modules/index.module
+++ b/modules/index.module
@@ -1,8 +1,5 @@
<?php
-
-// entries => attributess
-
function index_get_array($id) {
return db_fetch_array(db_query("SELECT * FROM entry WHERE eid = '". check_input($id) ."'"));
}
@@ -10,15 +7,12 @@ function index_get_array($id) {
function index_collection_form($name, $selected = "") {
$result = db_query("SELECT * FROM entry WHERE collection = '$name'");
while ($entry = db_fetch_object($result)) {
- $options[$entry->keyword] = $entry->name;
+ $options[$entry->attributes] = $entry->name;
}
return form_select(ucfirst($name), $name, $selected, $options);
}
-function index_collection_link($name) {
-}
-
// --------------------------------
function index_help() {
@@ -34,7 +28,7 @@ function index_form($edit = array()) {
$form .= form_textfield(t("Entry name"), "name", $edit[name], 55, 64, t("The name of this entry. Example: 'Apache'."));
$form .= form_textfield(t("Collection"), "collection", $edit[collection], 55, 64, t("The collection or group this entry belgons to. Example: 'Software'."));
- $form .= form_textfield(t("Keywords"), "keyword", $edit[keyword], 55, 64, htmlentities("Format: <type>:<value>;<type>:<value>;. Example: 'software:apache;type:webserver;os:linux;'."));
+ $form .= form_textfield(t("Attributes"), "attributes", $edit[attributes], 55, 64, htmlentities("Format: <type>:<value>;<type>:<value>;. Example: 'software=apache,type=webserver,os=linux,'."));
$form .= form_submit(t("Submit"));
if ($edit[eid]) {
@@ -47,10 +41,10 @@ function index_form($edit = array()) {
function index_save($edit) {
if ($edit[eid]) {
- db_query("UPDATE entry SET name = '". check_input($edit[name]) ."', collection = '". check_input($edit[collection]) ."', keyword = '". check_input($edit[keyword]) ."' WHERE eid = '$edit[eid]'");
+ db_query("UPDATE entry SET name = '". check_input($edit[name]) ."', collection = '". check_input($edit[collection]) ."', attributes = '". check_input($edit[attributes]) ."' WHERE eid = '$edit[eid]'");
}
else {
- db_query("INSERT INTO entry (name, collection, keyword) VALUES ('". check_input($edit[name]) ."', '". check_input($edit[collection]) ."', '". check_input($edit[keyword]) ."')");
+ db_query("INSERT INTO entry (name, collection, attributes) VALUES ('". check_input($edit[name]) ."', '". check_input($edit[collection]) ."', '". check_input($edit[attributes]) ."')");
}
}
@@ -116,7 +110,7 @@ function index_entry() {
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= " <TR><TH>name</TH><TH>collection</TH><TH>meta attributes</TH><TH>oparations</TH></TR>\n";
while ($entry = db_fetch_object($result)) {
- $output .= "<TR><TD>". check_output($entry->name) ."</TD><TD>". check_output($entry->collection) ."</TD><TD>". check_output($entry->keyword) ."</TD><TD><A HREF=\"admin.php?mod=index&op=edit&id=$entry->eid\">edit entry</A></TD></TR>\n";
+ $output .= "<TR><TD>". check_output($entry->name) ."</TD><TD>". check_output($entry->collection) ."</TD><TD>". check_output($entry->attributes) ."</TD><TD><A HREF=\"admin.php?mod=index&op=edit&id=$entry->eid\">edit entry</A></TD></TR>\n";
}
$output .= "</TABLE>\n";