Class TM::MyCSVAdmin by Thiemo Mättig
Version 2003-11-11

Universal administration tool and demo application for the TM::MyCSV class.

Don't hesitate to report bugs or feature requests.

Variable Summary
SELF -- Represents the $_SERVER['PHP_SELF'] value.
dir -- Relative path where the .csv and .txt files are stored.
priv -- Privileges to grand or deny access to specific functions.
table -- MyCSV object currently edited by TM::MyCSVAdmin.
types -- Contains the suggested field types for the table.

Constructor Summary
MyCSVAdmin -- Initializes the class.

Method Summary
GET -- Gets a GET or POST value.
browse -- Shows the contents of a table.
change -- Shows a form to insert or update a row.
delete -- Confirms the deletion of a row.
delete_all -- Confirms the deletion of all rows.
download -- Download binary file specified by tablename, id and field.
drop -- Confirms the deletion of a column.
drop_table -- Confirms the deletion of a table.
export -- Shows a form to export the table.
htmlQuote -- Makes a string well readable to the browser.
structure -- Shows the structure of a table.
tables -- Shows a list of all tables.

Variable Detail

SELF

Represents the $_SERVER['PHP_SELF'] value.

string $SELF

dir

Relative path where the .csv and .txt files are stored.

string $dir

priv

Privileges to grand or deny access to specific functions.

int $priv

Add the values in the following table to grand or deny access to specific functions of the administrative interface. Default is -1, everything enabled.

Privilege 1 (select rows), 16 (create/alter/drop indices) and 256 to 4096 (server administration) aren't used.

table

MyCSV object currently edited by TM::MyCSVAdmin.

MyCSV $table

types

Contains the suggested field types for the table.

string $types

Constructor Detail

MyCSVAdmin

Initializes the class.

MyCSVAdmin MyCSVAdmin ( void)

Loads the table specified by $_GET['table'] or $_POST['table']. Returns a new MyCSVAdmin object.

Method Detail

GET

Gets a GET or POST value.

string GET ( string key)

This unifies the different behaviours of $_GET, $HTTP_GET_VARS, $GLOBALS (register_globals) and so on.

Parameters:
key - Name of the request variable to be returned.

browse

Shows the contents of a table.

void browse ( void)

change

Shows a form to insert or update a row.

void change ( void)

delete

Confirms the deletion of a row.

void delete ( void)

delete_all

Confirms the deletion of all rows.

void delete_all ( void)

download

Download binary file specified by tablename, id and field.

void download ( void)

drop

Confirms the deletion of a column.

void drop ( void)

drop_table

Confirms the deletion of a table.

void drop_table ( void)

export

Shows a form to export the table.

void export ( void)

htmlQuote

Makes a string well readable to the browser.

string htmlQuote ( string text)

It strips any critical characters, truncates the string and replaces HTML entities.

Parameters:
text - Text to be HTMLed.

structure

Shows the structure of a table.

void structure ( void)

tables

Shows a list of all tables.

void tables ( void)

Use dir to specify the working directory.

Documentation generated by TM::PHPDoc