From a558326b67875eba6b7a1f90de4f7a78b215400e Mon Sep 17 00:00:00 2001 From: seek3r Date: Tue, 21 Nov 2000 22:33:37 +0000 Subject: [PATCH] updated docs from gnrfan --- doc/html/{p331.html => about.html} | 82 +- doc/html/apphis.html | 138 ---- doc/html/{devaddapp.html => devabout.html} | 75 +- doc/html/devapi.html | 197 +++++ doc/html/devconfvar.html | 763 ++++++++++++++++++ doc/html/devguid.html | 299 +++++++ doc/html/devinfra.html | 295 +++++++ doc/html/devinstall.html | 436 ++++++++++ doc/html/devintro.html | 185 +++++ doc/html/devlangsup.html | 491 +++++++++++ doc/html/devtemp.html | 175 ++++ doc/html/docbook.css | 20 + doc/html/{copyright.html => dochis.html} | 53 +- doc/html/etc.html | 133 --- doc/html/{p237.html => p186.html} | 26 +- doc/html/{p274.html => p223.html} | 10 +- doc/html/p261.html | 194 +++++ doc/html/{p43.html => p39.html} | 38 +- doc/html/{p312.html => p731.html} | 44 +- ...{troubleshoot.html => trobleshooting.html} | 30 +- doc/html/{x156.html => x109.html} | 28 +- doc/html/x112.html | 342 -------- doc/html/{x161.html => x114.html} | 129 +-- doc/html/x398.html | 170 ++++ doc/html/x407.html | 227 ++++++ doc/html/x434.html | 309 +++++++ doc/html/{apidocs.html => x471.html} | 82 +- doc/html/x85.html | 236 ++++++ doc/sgml/devabout.sgml | 16 + doc/sgml/devapi.sgml | 192 +++++ doc/sgml/devconfvar.sgml | 137 ++++ doc/sgml/devguid.sgml | 63 ++ doc/sgml/devinfra.sgml | 117 +++ doc/sgml/devinst.sgml | 115 +++ doc/sgml/devintro.sgml | 29 + doc/sgml/devlangsup.sgml | 162 ++++ doc/sgml/devtemp.sgml | 19 + 37 files changed, 5180 insertions(+), 877 deletions(-) rename doc/html/{p331.html => about.html} (84%) delete mode 100644 doc/html/apphis.html rename doc/html/{devaddapp.html => devabout.html} (61%) create mode 100644 doc/html/devapi.html create mode 100644 doc/html/devconfvar.html create mode 100644 doc/html/devguid.html create mode 100644 doc/html/devinfra.html create mode 100644 doc/html/devinstall.html create mode 100644 doc/html/devintro.html create mode 100644 doc/html/devlangsup.html create mode 100644 doc/html/devtemp.html create mode 100644 doc/html/docbook.css rename doc/html/{copyright.html => dochis.html} (65%) delete mode 100644 doc/html/etc.html rename doc/html/{p237.html => p186.html} (95%) rename doc/html/{p274.html => p223.html} (98%) create mode 100644 doc/html/p261.html rename doc/html/{p43.html => p39.html} (72%) rename doc/html/{p312.html => p731.html} (68%) rename doc/html/{troubleshoot.html => trobleshooting.html} (91%) rename doc/html/{x156.html => x109.html} (76%) delete mode 100644 doc/html/x112.html rename doc/html/{x161.html => x114.html} (58%) create mode 100644 doc/html/x398.html create mode 100644 doc/html/x407.html create mode 100644 doc/html/x434.html rename doc/html/{apidocs.html => x471.html} (55%) create mode 100644 doc/html/x85.html create mode 100644 doc/sgml/devabout.sgml create mode 100644 doc/sgml/devapi.sgml create mode 100644 doc/sgml/devconfvar.sgml create mode 100644 doc/sgml/devguid.sgml create mode 100644 doc/sgml/devinfra.sgml create mode 100644 doc/sgml/devinst.sgml create mode 100644 doc/sgml/devintro.sgml create mode 100644 doc/sgml/devlangsup.sgml create mode 100644 doc/sgml/devtemp.sgml diff --git a/doc/html/p331.html b/doc/html/about.html similarity index 84% rename from doc/html/p331.html rename to doc/html/about.html index e90b6ee110..e8daee9274 100644 --- a/doc/html/p331.html +++ b/doc/html/about.html @@ -8,11 +8,14 @@ CONTENT="Modular DocBook HTML Stylesheet Version 1.52">Prev

Chapter 8. Trouble ShootingChapter 7. Trouble Shooting

I get "Unable to open mailbox" when using the email application

WarningChapter 6. Installing on Tested Systems

Testing the install

If your config is setup properly you can now login. Point your browser to the - installed location and login with the username If your config is setup properly you can now login. Point your browser to the + installed location and login with the username demo and the password is 1234 - At this point it would be a good idea to create a new user with administrative privileges and - delete the old one. -

Setup / Configure phpGroupWare

phpGroupWare is still Beta software, expect some bugs along the way. If you run into a problem not discussed here, contact us @@ -175,7 +173,7 @@ WIDTH="33%" ALIGN="left" VALIGN="top" >Prev

UpChapter 7. Installation StepsNext
Next
phpGroupWare Docs V0.05
PrevChapter 7. Installation StepsNext

Setup / Configure phpGroupWare

The config file

Copy the header.inc.php.sample file to - header.inc.php and edit the file, following the - directions in the comments. -

Create database in MySQL

An empty database will be needed for phpGroupWare. Here are the instructions for doing so with MySQL. - First create the database: -

mysqladmin create phpgroupware -p

- Then login to the mysql: -

mysql -p

- Finally grant the needed security rights: -

grant all on phpgroupware.* to phpgroupware@localhost identified by "some_password";

-

Create database in PostreSQL

An empty database will be needed for phpGroupWare. Here are the instructions for doing so with PostgreSQL. - Create the database: -

postmaster -i -D /home/[username]/[dataDir]

- You will probably need to review PostgreSQL documentation for futher details. -

The Setup Program

Then point your browser to phpgroupware/setup/ which will - create (or upgrade) the database tables. - You wil be asked to login, using the password set in - header.inc.php. Setup will attempt to determine what version - of the phpGroupWare database you have installed, and upgrade to the most recent - version. -

Note
 

The developers are concentrating on getting the beta - working, and have not spent a great deal of time building upgrade scripts from the - alpha versions of phpGroupWare. You are advised to backup your existing alpha - database before running the setup script to avoid problems! -

If you get no error messages, continue on to phpgroupware/setup/config.php - to configure phpGroupWare to your system. -

If you are using the email system you will need to create a temporary directory - where file uploads will be stored. For security reasons, you should chown - nobody.nobody and chmod 700 to that directory. Depending on your system configuration. - Default installs of Apache normally run as the user nobody. You may need your system - administrator to do this for you if you do not have root access. -

If you do not have access to root, create this file and run it. -

?php
-if (mkdir("/path/to/temp/directory",0700)) {
-echo "Directory created successfully";
-} else {
-echo "Error creating directory";
-}
-?
-      

The phpGroupWare Daemon

If you have access to cron, you may want to setup the files in the cron - directory. -

stalesessions.pl - There are 2 reasons for this file. -

  • Users always forget to logout. This way the session doesn't sit around forever, creating a possible security risk.

  • The email system requires plain text passwords which are stored in the sessions table.

- This file is not required, you can simply disable cron_apps in the admin -> applications section - to clean out the sessions table during login and logout -

stale_uploads.pl - This will delete file attachments for messages that where not - completed. If a users browser crashes, Internet connection dies, etc, their - files will sit there forever unless deleted. You could add a few lines to - logout.php that will look in the temp directory for any stale uploads and delete - them. But, once again, it becomes a performance issue. -


PrevHomeNext
Installing from CVSUpTesting the install
\ No newline at end of file diff --git a/doc/html/x161.html b/doc/html/x114.html similarity index 58% rename from doc/html/x161.html rename to doc/html/x114.html index 60572ff3fd..c8b6ab7c6c 100644 --- a/doc/html/x161.html +++ b/doc/html/x114.html @@ -9,14 +9,14 @@ REL="HOME" TITLE="phpGroupWare Docs V0.05" HREF="book1.html">
PrevChapter 7. Installation StepsChapter 6. Installing on Tested SystemsNext

Installing additional applications

Once you have the core phpGroupWare install up and running, - you may want to download and install additional applications. -

Once you have the core phpGroupWare install up and running, + you may want to download and install additional applications. +

You should consult any You should consult any README or INSTALL - files that come with the new application first, as most require you - to create additional tables in the database, and add additional - translation data to the lang table (typically a file called lang.sql) -

You install the new application within the phpGroupWare install tree by - copying the application directory into the phpGroupWare install location, - and enabling the application through the Administration page. -

You install the new application within the phpGroupWare install tree by + copying the application directory into the phpGroupWare install location, + and enabling the application through the Administration page. +

For example, this is the process to install the - Headlines application (see For example, this is the process to install the + Headlines application (see http://sourceforge.net/phpgwapps/ for - more on this and other applications). -

  • Download the .tar.gz file for the application, or check out the source with cvs with -

    export CVSROOT=':pserver:anonymous@cvs.phpgroupware.sourceforge.net:/cvsroot/phpgwapps'
    cvs login (just hit enter if prompted for a password)
    cvs co headlines

    -

    Download the .tar.gz file for the application, or check out the source + with cvs with +
    export CVSROOT=':pserver:anonymous@cvs.phpgroupware.sourceforge.net:/cvsroot/phpgwapps'
    +cvs login   (just hit enter if prompted for a password)
    +cvs co headlines
    +		

  • headlines directory into your phpGroupWare - install directory.

  • Log into phpGroupWare as an administrative user, and go to the Administration page. -

  • Applications link. -

  • Click on add, and fill in the form.

    Application name - should be identical to the name - of the directory you moved into the phpGroupWare install, in this case use headlines -

    Application Title - is shown in the navigation bar and other places to refer to the - new application. Enter Headlines for this example. -

    Enabled - can be used to disable an application for all users temporially. You - should normal check the box to enable the application. -

  • Back in the Administration page, you need to enable the application for specific users - or user groups by editing them, and checking the new Headlines box that appears - in the middle of the account editing page.

  • Once you have added the Headlines app to your account, you should see a Headlines - entry in the Administration and Preferences pages, and there should be an icon for - the Headlines application in the navigation bar.

  • Once you enable a few of the Headlines sites through the Administration page link, you - should see headlines grabbed from the sites you selected when you click on the Headlines - icon in the navigation bar. -

-

PrevNextadd your topic seekFile functionsUpAbout this documentConfiguration Variables
Setup / Configure phpGroupWare
phpGroupWare Docs V0.05
PrevChapter 6. Installing on Tested SystemsNext

Setup / Configure phpGroupWare

Copy the header.inc.php.sample file to + header.inc.php and edit the file, following the + directions in the comments. +

Then point your browser to phpgroupware/setup/ which will + create (or upgrade) the database tables. + You wil be asked to login, using the password set in + header.inc.php. Setup will attempt to determine what version + of the phpGroupWare database you have installed, and upgrade to the most recent + version. +

Note: The developers are concentrating on getting the beta + working, and have not spent a great deal of time building upgrade scripts from the + alpha versions of phpGroupWare. You are advised to backup your existing alpha + database before running the setup script to avoid problems! +

If you get no error messages, continue on to phpgroupware/setup/config.php + to configure phpGroupWare to your system. +

If you are using the email system you will need to create a temporary directory + where file uploads will be stored. For security reasons, you should chown + nobody.nobody and chmod 700 to that directory. Depending on your system configuration. + Default installs of Apache normally run as the user nobody. You may need your system + administrator to do this for you if you do not have root access. +

If you do not have access to root, create this file and run it. +

 <?php
+	if (mkdir("/path/to/temp/directory",0700)) {
+	echo "Directory created successfully";
+	} else {
+	echo "Error creating directory";
+	}
+?>
+    			                

If you have access to cron, you may want to setup the files in the cron + directory. +

stalesessions.pl - There are 2 reasons for this file. +

  • Users always forget to logout. This way the session doesn't sit around forever, creating a possible security risk.

  • The email system requires plain text passwords which are stored in the sessions table.

+ This file is not required, you can simply disable cron_apps in the admin -> applications section + to clean out the sessions table during login and logout +

stale_uploads.pl - This will delete file attachments for messages that where not + completed. If a users browser crashes, Internet connection dies, etc, their + files will sit there forever unless deleted. You could add a few lines to + logout.php that will look in the temp directory for any stale uploads and delete + them. But, once again, it becomes a performance issue. +


PrevHomeNext
Installing from CVSUpTesting the install
\ No newline at end of file diff --git a/doc/sgml/devabout.sgml b/doc/sgml/devabout.sgml new file mode 100644 index 0000000000..c55886e7bd --- /dev/null +++ b/doc/sgml/devabout.sgml @@ -0,0 +1,16 @@ +
+ About developers docs + + + About this document + + + + History + + This document was written by Dan Kuykendall. + + 2000-09-25 documentation on lang(), codes, administration and preferences extension added by Steve Brown. + + +
\ No newline at end of file diff --git a/doc/sgml/devapi.sgml b/doc/sgml/devapi.sgml new file mode 100644 index 0000000000..617c90a32b --- /dev/null +++ b/doc/sgml/devapi.sgml @@ -0,0 +1,192 @@ + + The API + + + Introduction + + phpGroupWare attempts to provide developers with a useful API to handle common tasks. + + + To do this we have created a multi-dimensional class $phpgw->. + + + This allows for terrific code organization, and help developers easily identify + the file that the function is in. All the files that are part of this class are in the + inc/core directory + and are named to match the sub-class. + + + Example:$phpgw->send->msg() is in the + inc/phpgwapi/phpgw_send.inc.php file. + + + + Basic functions + + + + $phpgw->link + + $phpgw->link($url) + + + Add support for session management. ALL links must use this, that includes href's form actions and header location's. + If you are just doing a form action back to the same page, you can use it without any parameters. + This function is right at the core of the class because it is used so often, we wanted to save developers a few keystrokes. + Example: + +<form name=copy method=post action="<?php echo $phpgw->link();?>"> +/* If session management is done via passing url parameters */ +/* The the result would be */ +/* <form name=copy method=post action="somepage.php?sessionid=87687693276?kp3=kjh98u80"> */ + + + + + + Application Functions + + + + $phpgw->common->phpgw_header + + $phpgw->phpgw_header() + + + Print out the start of the HTML page, including the navigation bar + and includes appname/inc/header.php + + + + $phpgw->common->phpgw_footer + $phpgw->phpgw_footer() + + Prints the system footer, and includes appname/inc/footer.php + + + + $phpgw->common->appsession + $phpgw->common->appsession($data) + + Store important information session information that your + application needs. + + + $phpgw->appsession will return the value of your session data is + you leave the parameter empty [i.e. $phpgw->appsession("")], otherwise + it will store whatever data you send to it. + + + You can also store a comma delimited string and use explode() + to turn it back into an array when you receive the value back. + + + Example: + + $phpgw->common->appsession("/path/to/something"); + echo "Dir: " . $phpgw->common->appsession(); + + + + + + + + File functions + + + + $phpgw->vfs->read_file + + $phpgw->vfs->read_file($file) Returns the data from + $file. + You must send the complete path to the file. + + + Example: + +$data = $phpgw->vfs->read_file("/some/dir/to/file.txt"); + + + + + $phpgw->vfs->write_file + + $phpgw->vfs->write_file($file, $contents) + Write data to $file. + You must send the complete path to the file. + + + Example: + +$data = $phpgw->vfs->write_file("/some/dir/to/file.txt"); + + + + + + $phpgw->vfs->read_userfile + + $phpgw->vfs->read_userfile($file) + Returns the data from $file, which resides + in the users private dir. + + + Example: + +$data = $phpgw->vfs->read_userfile("file.txt"); + + + + + $phpgw->vfs->write_userfile + + $phpgw->write_userfile($file, $contents) + Writes data to $file, which resides in the + users private dir. + + + Example: + +$data = $phpgw->vfs->write_userfile("file.txt"); + + + + + $phpgw->vfs->list_userfiles + + $phpgw->vfs->list_userfiles() + Returns an array which has the list of files in the users private dir. + + + Example: + +$filelist = array(); +$filelist = $phpgw->vfs->list_userfiles(); + + + + + + + Email/NNTP Functions + + + + $phpgw->send->msg + + $phpgw->msg->send($service, $to, $subject, $body, $msgtype, $cc, $bcc) + Send a message via email or NNTP and returns any error codes. + + + Example: + +$to = "someuser@domain.com"; +$subject = "Hello buddy"; +$body = "Give me a call\n Been wondering what your up to."; +$errors = $phpgw->msg->send("email", $to, $subject, $body); + + + + + diff --git a/doc/sgml/devconfvar.sgml b/doc/sgml/devconfvar.sgml new file mode 100644 index 0000000000..543bd74cba --- /dev/null +++ b/doc/sgml/devconfvar.sgml @@ -0,0 +1,137 @@ + + Configuration Variables + + + Introduction + + phpGroupWare attempt to provide developers with as much information about the user, group, + server, and application configuration as possible. To do this we provide a multi-dimensional + array called $phpgw_info[], which includes all the information about + your environment.Due to the multi-dimensional array approach. getting these values is easy. + + + Here are some examples: + + +<?php + // To do a hello username + echo "Hello " . $phpgw_info["user"]["fullname"]; + //If username first name is John and last name is Doe, prints: 'Hello John Doe' + ?> +<?php + // To find out the location of the imap server + echo "IMAP Server is named: " . $phpgw_info["server"]["imap_server"]; + //If imap is running on localhost, prints: 'IMAP Server is named: localhost' +?> + + + + + User information + + + $phpgw_info["user"]["userid"] = The user ID + $phpgw_info["user"]["sessionid"] = The session ID + $phpgw_info["user"]["theme"] = Selected theme + $phpgw_info["user"]["private_dir"] = Users private dir. Use phpGroupWare core functions for access to the files. + $phpgw_info["user"]["firstname"] = Users first name + $phpgw_info["user"]["lastname"] = Users last name + $phpgw_info["user"]["fullname"] = Users Full Name + $phpgw_info["user"]["groups"] = Groups the user is a member of + $phpgw_info["user"]["app_perms"] = If the user has access to the current application + $phpgw_info["user"]["lastlogin"] = Last time the user logged in. + $phpgw_info["user"]["lastloginfrom"] = Where they logged in from the last time. + $phpgw_info["user"]["lastpasswd_change"] = Last time they changed their password. + $phpgw_info["user"]["passwd"] = Hashed password. + $phpgw_info["user"]["status"] = If the user is enabled. + $phpgw_info["user"]["logintime"] = Time they logged into their current session. + $phpgw_info["user"]["session_dla"] = Last time they did anything in their current session + $phpgw_info["user"]["session_ip"] = Current IP address + + + + + Group information + + $phpgw_info["group"]["group_names"] = List of groups. + + + + Server information + + + $phpgw_info["server"]["server_root"] = Main installation directory + $phpgw_info["server"]["include_root"] = Location of the 'inc' directory. + $phpgw_info["server"]["temp_dir"] = Directory that can be used for temporarily storing files + $phpgw_info["server"]["files_dir"] = Directory er and group files are stored + $phpgw_info["server"]["common_include_dir"] = Location of the core/shared include files. + $phpgw_info["server"]["template_dir"] = Active template files directory. This is defaulted by the server, and changeable by the user. + $phpgw_info["server"]["dir_separator"] = Allows compatibility with WindowsNT directory format, + $phpgw_info["server"]["encrpytkey"] = Key used for encryption functions + $phpgw_info["server"]["site_title"] = Site Title will show in the title bar of each webpage. + $phpgw_info["server"]["webserver_url"] = URL to phpGroupWare installation. + $phpgw_info["server"]["hostname"] = Name of the server phpGroupWare is installed upon. + $phpgw_info["server"]["charset"] = default charset, default:iso-8859-1 + $phpgw_info["server"]["version"] = phpGroupWare version. + + + + + Database information + + It is unlikely you will need these, because $phpgw_info_db will already be loaded as a database for you to use. + + $phpgw_info["server"]["db_host"] = Address of the database server. Usually this is set to localhost. + $phpgw_info["server"]["db_name"] = Database name. + $phpgw_info["server"]["db_user"] = User name. + $phpgw_info["server"]["db_pass"] = Password + $phpgw_info["server"]["db_type"] = Type of database. Currently MySQL and PostgreSQL are supported. + + + + + Mail information + + It is unlikely you will need these, because most email needs are services thru core phpGroupWare functions. + + $phpgw_info["server"]["mail_server"] = Address of the IMAP server. Usually this is set to localhost. + $phpgw_info["server"]["mail_server_type"] = IMAP or POP3 + $phpgw_info["server"]["imap_server_type"] = Cyrus or Uwash + $phpgw_info["server"]["imap_port"] = This is usually 143, and should only be changed if there is a good reason. + $phpgw_info["server"]["mail_suffix] = This is the domain name, used to add to email address + $phpgw_info["server"]["mail_login_type"] = This adds support for VMailMgr. Generally this should be set to 'standard'. + $phpgw_info["server"]["smtp_server"] = Address of the SMTP server. Usually this is set to localhost. + $phpgw_info["server"]["smtp_port"] = This is usually 25, and should only be changed if there is a good reason. + + + + + NNTP information + + + $phpgw_info["server"]["nntp_server"] = Address of the NNTP server. + $phpgw_info["server"]["nntp_port"] = This is usually XX, and should only be changed if there is a good reason. + $phpgw_info["server"]["nntp_sender"] = Unknown + $phpgw_info["server"]["nntp_organization"] = Unknown + $phpgw_info["server"]["nntp_admin"] = Unknown + + + + + Application information + + Each application has the following information available. + + $phpgw_info["apps"]["appname"]["title"] = The title of the application. + $phpgw_info["apps"]["appname"]["enabled"] = If the application is enabled. True or False. + $phpgw_info["server"]["app_include_dir"] = Location of the current application include files. + $phpgw_info["server"]["app_template_dir"] = Location of the current application tpl files. + $phpgw_info["server"]["app_lang_dir"] = Location of the current lang directory. + $phpgw_info["server"]["app_auth"] = If the server and current user have access to current application + $phpgw_info["server"]["app_current"] = name of the current application. + + + + + + \ No newline at end of file diff --git a/doc/sgml/devguid.sgml b/doc/sgml/devguid.sgml new file mode 100644 index 0000000000..ff0c1792f9 --- /dev/null +++ b/doc/sgml/devguid.sgml @@ -0,0 +1,63 @@ + + Guidelines + + + Requirements + + These guidelines must be followed for any application that wants + considered for inclusion into phpGroupWare deluxe. + + + + It must run on PHP3 and PHP4. + SQL statements must be compatible with both MySQL + and PostgreSQL. + It must use our default header.inc.php include. + It must use our $phpgw_link($url) for all links + (this is for session support). + It must use "post" for forms. + It must respect phpGW group rights and phpGW user permissions. + It must use our directory structure, template support and lang + (multi-language) support. + Where possible it should run on both Unix and NT platforms. + + + + For applications that do not meet these requirements, they can be + available to users via the phpGroupWare Apps project, or whatever + means the developers decide.If you need help converting your + application to templates and our lang support, we will try to + connect you with someone to help. + + + + Writing/porting your application + Include files + + Each PHP page you write will need to include the header.inc.php along + with a few variables.This is done by putting this at the top of each PHP page. + + +<?php + $phpgw_info["flags"]["currentapp"] = "appname"; + include("../header.inc.php"); + ?> + + Of course change application name to fit. + This include will provide the following things: + + The phpgwAPI - The phpGroupWare API will be loaded. + The phpGW navbar will be loaded (by default, but can be disabled until a later point. + appname/inc/functions.inc.php - This file is loaded just after the phpgwAPI + and before any HTML code is generated. This file should include all your application + specific functions..You are welcome to include any additional files you need from within + this file. + appname/inc/header.inc.php - This file is loaded just after the system header/navbar, + and allows developers to use it for whatever they need to load. + appname/inc/footer.inc.php - This file is loaded just before the system footer, + allowing developers to close connections and whatever else they need. + The phpGW footer will be loaded, which closes several connections. + + + + \ No newline at end of file diff --git a/doc/sgml/devinfra.sgml b/doc/sgml/devinfra.sgml new file mode 100644 index 0000000000..6d5a593d71 --- /dev/null +++ b/doc/sgml/devinfra.sgml @@ -0,0 +1,117 @@ + + Infrastructure + + + Overview + + phpGroupWare attempts to provide developers with a sound directory + structure to work from. The directory layout may seem complex at first, + but after some use, you will see that it is designed to accommodate a + large number of applications and functions. + + + + Directory tree + + +.-- addressbook +| `-- images +| | `-- navbar.gif +| `-- inc +| | |-- functions.inc.php +| | |-- header.inc.php +| | `-- footer.inc.php +| `-- templates +| `-- default +|-- admin +| `-- images +| | `-- navbar.gif +| `-- inc +| | |-- functions.inc.php +| | |-- header.inc.php +| | |-- footer.inc.php +| | `-- admin.inc.php +| `-- templates +| `-- default +|-- calendar +| `-- images +| | `-- navbar.gif +| `-- inc +| | |-- functions.inc.php +| | |-- header.inc.php +| | `-- footer.inc.php +| `-- templates +| `-- default +|-- cron +|-- doc +|-- email +| `-- images +| | `-- navbar.gif +| `-- inc +| | |-- functions.inc.php +| | |-- header.inc.php +| | |-- footer.inc.php +| | |-- preferences.inc.php +| | `-- admin.inc.php +| `-- templates +| `-- default +|-- filemanager +|-- files +| |-- groups +| `-- users +|-- inc +| |-- phpgwapi +| | |-- phpgw.inc.php +| | |-- phpgw_info.inc.php +| | |-- phpgw_common.inc.php +| | `-- etc... +| `-- templates +| |-- default +| | |-- addressbook +| | |-- admin +| | |-- calendar +| | |-- common +| | |-- email +| | |-- filemanager +| | |-- headlines +| | |-- preferences +| | |-- todo +| | `-- tts +| `-- icons +| |-- email +| |-- calendar +| `-- tts +|-- preferences +| `-- images +| | `-- navbar.gif +| `-- inc +| | |-- functions.inc.php +| | |-- header.inc.php +| | |-- footer.inc.php +| | `-- preferences.inc.php +| `-- templates +| `-- default +|-- themes +`-- todo + `-- images + | `-- navbar.gif + `-- inc + | |-- functions.inc.php + | |-- header.inc.php + | `-- footer.inc.php + `-- templates + `-- default + + + + + Translations + + The translations are now being done thru the database, and will be configurable + to use other mechanisms.We are completing a program called Transy, which will + provide developers/translators a nice GUI for building and updating translations. + In the mean time you will need to create a SQL script yourself and name it lang.sql. + You can copy the one in doc/lang.sql and use it as a template. + + + \ No newline at end of file diff --git a/doc/sgml/devinst.sgml b/doc/sgml/devinst.sgml new file mode 100644 index 0000000000..2ce695517f --- /dev/null +++ b/doc/sgml/devinst.sgml @@ -0,0 +1,115 @@ + + Installing your application + + + Overview + + It is fairly simple to add and delete applications to/from phpGroupWare. + + + Automatic features + + To make things easy for developers we go ahead and load the following files. + + appname/inc/functions.inc.php - This file should include + all your application specific functions. + appname/inc/header.inc.php - This file is loaded by + $phpgw->common->header just after the system header/navbar, + and allows developers to use it for whatever they need to load. + appname/inc/footer.inc.php - This file is loaded by + $phpgw->common->footer just before the system footer, + allowing developers to close connections and whatever else they need. + + + + + Adding files, directories and icons. + + You will need to create the following directories for your code + (replace 'appname' with your application name) + + `-- appname + `-- images + | `-- navbar.gif + `-- inc + | |-- functions.inc.php + | |-- header.inc.php + | |-- footer.inc.php + | |-- preferences.inc.php + | `-- admin.inc.php + `-- templates + `-- default + + + + + Making phpGroupWare aware of your application + + To make the application aware of your application, add your application details to the applications table. This can be done via the GUI administration screen, or via a SQL script. + + insert into applications (app_name, app_title, app_enabled) values ('appname', 'The App name', 1); + + + + + Hooking into Administration page + + When a user goes to the Administration page, it stats appname/inc/admin.inc.php + for each application that is enabled, in alphabetical order of application title. + If the file exists, it is include()d in the hopes it will display a selection of + links to configure that application. + + Simple Example: + +<?php + $img = "/" . $appname . "/images/navbar.gif"; + section_start("My Application",$img); + echo "<a HREF=\"" . $phpgw->link("myAdminPage.php") . "\">"; + echo lang("Change myApp settings") . "</a>"; + section_end(); +?> + + Look at headlines/inc/admin.inc.php and admin/inc/admin.inc.php for more examples. + + Things to note: + + Links are relative to the admin/index.php file, not your + application's base directory. (so use $appname in your + link() calls) + The file is brought in with include() so be careful to not pollute the name-space + too much + + The standard $phpgw and $phpgw_info variables are in-scope, as is $appname + which corresponds to the application name in the path. + + There are 2 functions to coordinate the display of each application's links, + section_start() and section_end() + + + + section_start + + section_start($title,$icon_url) + starts the section for your application. $title is passed through + lang() + for you. $icon_url should be page-relative to admin/index.php or + an absolute URL. + + + + section_end + + section_end() closes the section that was started with section_start(). + + + + Hooking into Preferences page + + The mechanism to hook into the preferences page is identical to the one used to + hook into the administration page, however it looks for + appname/inc/preferences.inc.php instead of + appname/inc/admin.inc.php. The same functions and variables are defined. + + + + \ No newline at end of file diff --git a/doc/sgml/devintro.sgml b/doc/sgml/devintro.sgml new file mode 100644 index 0000000000..8ed1a2f34f --- /dev/null +++ b/doc/sgml/devintro.sgml @@ -0,0 +1,29 @@ + + Introduction + + phpGroupWare is a web based groupware application framework (API), + for writing applications. Integrated applications such as email, + calendar, todo list, address book, and file manager are included. + + + + Overview of application writing + + We have attempted to make writing application for phpGroupWare as + painless as possible. We hope any pain and suffering is cause by making + your application work, but not dealing with phpGroupWare itself. + + + + What does the phpGroupWare API provide? + + The phpGroupWare API handles session management, user/group management, + has support for multiple databases, using the PHPLIB database abstraction + method, we support templates using the PHPLIB Templates class, a file + system interface, and even a network i/o interface. On top of these + standard functions, phpGroupWare provides several functions to give + you the information you need about the users environment, and to properly + plug into phpGroupWare. + + + \ No newline at end of file diff --git a/doc/sgml/devlangsup.sgml b/doc/sgml/devlangsup.sgml new file mode 100644 index 0000000000..f80c109c5a --- /dev/null +++ b/doc/sgml/devlangsup.sgml @@ -0,0 +1,162 @@ + + Using Language Support + + + Overview + + phpGroupWare is built using a multi-language support scheme. This means the pages can be + translated to other languages very easily. Translations of text strings are + stored in the phpGroupWare database, and can be modified by the phpGroupWare + administrator. + + + + How to use lang support + + The lang() function is your application's interface to phpGroupWare's + internationalization support. + + While developing your application, just wrap all your text output with calls to + lang(), as in the following code: + + $x = 42; + echo lang("The counter is %1",$x)."<br>"; + + This will attempt to translate "The counter is %1", and return a translated version + based on the current application and language in use. Note how the position that + $x will end up is controlled by the format string, not by + building up the string in your code. This allows your application to be translated + to languages where the actual number is not placed at the end of the string. + + When a translation is not found, the original text will be returned with a * after + the string. This makes it easy to develop your application, then go back and + add missing translations (identified by the *) later. + + Without a specific translation in the lang table, the above code will print: + +The counter is 42*<br> + +If the current user speaks Italian, they string returned may instead be: + +il contatore è 42<br> + + + + + The lang function + + lang($key, $m1="", $m2="", $m3="", $m4="", $m5="", + $m6="", $m7="", $m8="", $m9="", $m10="") + + + + $key + + is the string to translate and may contain replacement directives of the form %n. + + + + $m1 + + is the first replacement value or may be an array of replacement values (in which case $m2 and above are ignored). + + + + $m2 + + - $m10/ the 2nd through 10th replacement values if $m1 is not an array. + + + + The database is searched for rows with a lang.message_id that matches $key. + If a translation is not found, the original $key is used. The translation engine then replaces + all tokens of the form %N with the Nth parameter (either $m1[N] or $mN). + + + + Adding translation data + + An application called Transy is being developed to make this easier, until then you can create + the translation data manually. + + + + The lang table + + The translation class uses the lang table for all translations. + We are concerned with 4 of the columns to create a translation: + + + message_id + + + The key to identify the message (the $key passed + to the lang() function). This is written in English. + + + + + app_name + + + The application the translation applies to, or + common if it is common across multiple applications. + + + + + lang + + The code for the language the translation is in. + + + + content + + The translated string. + + + + + + + lang.sql + + Currently all applications, and the core phpGroupWare source tree + have a lang.sql file. This is the place to add translation + data. Just add lines of the form: + +REPLACE INTO lang (message_id, app_name, lang, content) +VALUES( 'account has been deleted','common','en','Account has been deleted'); + + translating the content to reflect the message_id string in the lang language. + If the string is specific to your application, put your application name in for app_name + otherwise use the name common. The message_id should be in lower case for a small + increase in speed. + + + + Common return codes + + If you browse through the phpGroupWare sources, you may notice + a pattern to the return codes used in the higher-level functions. + The codes used are partially documented in the doc/developers/CODES + file. + + Codes are used as a simple way to communicate common error and progress + conditions back to the user. They are mapped to a text string through the + check_code() function, which passes the strings through + lang() before returning. + + For example, calling + +echo check_code(13); + + Would print + +Your message has been sent + + translated into the current language. + + + \ No newline at end of file diff --git a/doc/sgml/devtemp.sgml b/doc/sgml/devtemp.sgml new file mode 100644 index 0000000000..53a19072de --- /dev/null +++ b/doc/sgml/devtemp.sgml @@ -0,0 +1,19 @@ + + Using Templates + + + Overview + + phpGroupWare is built using a templates based design. This means the display pages, stored in tpl files, can be translated to other languages, made to look completely different. + + + + How to use templates + + Some instructions on using templates. + + + For Further info read the PHPLIBs documentation for their template class. + + +