Index: tags/2.1/docs/coding_standards.txt
===================================================================
--- trunk/docs/coding_standards.txt	(revision 209)
+++ tags/2.1/docs/coding_standards.txt	(revision 215)
@@ -7,7 +7,7 @@
 ======================================================================
 
-We're following the PEAR coding standards, with minor modifications.
-
-This is essential reading:
+Our standards follow closely the PEAR coding standards.
+
+Essential reading:
 http://pear.php.net/manual/en/standards.php
 
@@ -24,5 +24,5 @@
                         remains "Auth_SQL"
 
-some_file.ihtml         HTML file, which may or may not have some PHP,
+some_file.inc.html      HTML file, which may or may not have some PHP,
                         but will be included by some other PHP file. Never
                         includes sensitive code as these files may be accessed
@@ -30,7 +30,7 @@
 
 script.cli.php          A command-line executable script, possibly executed
-                        with CRON, usually outputs TEXT, not HTML.
-
-dbname.mysql            Database schema file that goes with the application.
+                        with CRON. Outputs TEXT if any instead of HTML.
+
+schema.mysql            Database schema file that goes with the application.
 
 main.screen.css         CSS file with media: screen/print/all
@@ -182,6 +182,6 @@
         // Here comes the HTML...
         ?>
-        <div align="right" class="sc-tiny">
-        [&nbsp;<a href="<?php echo $app->oHREF('contact.php') ?>">Contact us</a>&nbsp;]
+        <div class="sc-tiny">
+            <a href="<?php echo $app->ohref('/contact.php') ?>">Contact us</a>
         </div>
         <?php
@@ -200,27 +200,42 @@
 http://java.sun.com/products/jdk/javadoc/writingdoccomments/index.html
 
+Here is an example of the codebase method Email::validEmail():
+
     <?php
     /**
-     * Description of function.
+     * Validates an email address based on the recommendations in RFC 3696.
+     * Is more loose than restrictive, to allow the many valid variants of
+     * email addresses while catching the most common mistakes. Checks an array too.
+     * http://www.faqs.org/rfcs/rfc822.html
+     * http://www.faqs.org/rfcs/rfc2822.html
+     * http://www.faqs.org/rfcs/rfc3696.html
+     * http://www.faqs.org/rfcs/rfc1035.html
      *
      * @access  public
-     * @param   string  $db_table   Database table.
-     * @param   string  $db_column  Database column containing set or enum datatype.
-     * @return  array               The set/enum values or false on failure.
+     * @param   mixed  $email  Address to check, string or array.
+     * @return  bool    Validity of address.
      * @author  Quinn Comendant <quinn@strangecode.com>
-     * @version 1.0
-     * @since   24 Feb 2004 19:34:04
+     * @since   30 Nov 2005 22:00:50
      */
-    function getSetEnumFieldValues()
+    function validEmail($email)
     {
-		$db =& DB::getInstance();
-        
-        $qid = $db->query("SHOW COLUMNS FROM $db_table LIKE '$db_col'",false);
-
-        $row = mysql_fetch_row($qid);
-        if (preg_match('/^enum|^set/i', $row[1]) && preg_match_all("/'([^']*)'/", $row[1], $match)) {
-            return $match[1];
+		$app =& App::getInstance();
+    
+        // If an array, check values recursively.
+        if (is_array($email)) {
+            foreach ($email as $e) {
+                if (!$this->validEmail($e)) {
+                    return false;
+                }
+            }
+            return true;
         } else {
-            return false;
+            // To be valid email address must match regex and fit within the lenth constraints.
+            if (preg_match($this->getParam('regex'), $email, $e_parts) && strlen($e_parts[2]) < 64 && strlen($e_parts[3]) < 255) {
+                return true;
+            } else {
+                $app->logMsg(sprintf('Invalid email: %s', $email), LOG_INFO, __FILE__, __LINE__);
+                return false;
+            }
         }
     }
Index: tags/2.1/docs/example_virtualhost_directive.txt
===================================================================
--- trunk/docs/example_virtualhost_directive.txt	(revision 209)
+++ tags/2.1/docs/example_virtualhost_directive.txt	(revision 215)
@@ -1,15 +1,12 @@
-<VirtualHost 216.110.45.174:80>
-    ServerName www.example.com
-    ServerAlias *.example.com example.com
-    SetEnv USER user
+<VirtualHost 123.123.123.123:80>
+    ServerName example.com
+    ServerAlias *.example.com
+    DocumentRoot /home/user/www.example.com/html
+    CustomLog /home/user/www.example.com/log/access_log combined
+    ErrorLog /home/user/www.example.com/log/error_log
     SetEnv DB_NAME carl
     SetEnv DB_USER user_asdf
     SetEnv DB_PASS pass_asdf
-    SetEnv SIGNING_KEY wekgbb
-    DocumentRoot /home/user/www.example.com/html
-    Alias /logs /home/user/www.example.com/log/webalizer
-    Alias /admin /home/user/www.example.com/admin
-    CustomLog /home/user/www.example.com/log/access_log combined
-    ErrorLog /home/user/www.example.com/log/error_log
+    SetEnv SIGNING_KEY wekgbb92e2397g3r293gh
     <Directory "/home/user/www.example.com">
         php_admin_value open_basedir "/home/user/www.example.com:/usr/local/lib/php:/tmp"
Index: tags/2.1/docs/file_layout.txt
===================================================================
--- trunk/docs/file_layout.txt	(revision 209)
+++ tags/2.1/docs/file_layout.txt	(revision 215)
@@ -1,14 +1,11 @@
-Updated: 26 Aug 2005 14:37:42
-
-======================================================================================
-Codebase can be located anywhere, as long as it is in the application's include path.
-======================================================================================
+Updated: 11 Dec 2006 16:25:10
+=====================================================================
 
 codebase/
-    bin/
-        (generic command-line scripts and applications)
+    bin/ (generic command-line scripts and applications)
+        acl.cli.php (Tool for managing the permissions of an ACL.inc.php based system)
+        extract_gettext.pl (tool for exporting all the strings called by the _("Gettext function") )
         file_importer.php
         install.sh
-        pedit_permissions.sh
         module_maker/ (scripts for generating modules)
             _config.inc.php
@@ -16,6 +13,5 @@
             list_template.cli.php
             module.cli.php
-            skel/
-                (templates for generating modules)
+            skel/ (templates for generating modules)
                 adm_form.ihtml
                 adm_list.ihtml
@@ -26,25 +22,37 @@
             sql.cli.php
             validation.cli.php
+        pedit_permissions.sh
+    css/ (generic CSS files to be included using lib/CSS.inc.php)
+        admin.inc.css (CSS for the generic Strangecode administration system)
+        codebase.inc.css (CSS for html output by codebase libraries)
+        utilities.inc.css (generic CSS tools)
     docs/
-        codebase_script_template.php
         coding_standards.txt
+        example_config.inc.php (an example of the _config.inc.php site-boot document)
+        example_script_template.php
         example_virtualhost_directive.txt
         file_layout.txt
-        software_licence.txt
-        todo.txt
+        gpl.txt
+        revision_history.txt
+        version.txt (the version number of this codebase)
     lib/
-        App.inc.php (functions dealing with sessions, href/url/IP manipulation, directories.)
-        Auth_File.inc.php (file-based authentication system.)
-        Auth_SQL.inc.php (sql-based authentication system.)
+        ACL.inc.php (provides Access Control List functionality)
+        App.inc.php (provides global application functionality: sessions, href/url/IP manipulation, directories)
+        Auth_File.inc.php (file-based authentication system)
+        Auth_SQL.inc.php (sql-based authentication system)
         AuthorizeNet.inc.php (routines for connection to authorize.net's advanced processing interface)
-        CSS.inc.php
-        DB.inc.php (database abstraction layer.)
-        DBSessionHandler.inc.php (database session handler.)
-        FormValidator.inc.php (validation routines used to test incoming user data.)
+        Cache.inc.php (provides session-based caching functionality for quick retreival of all PHP data types)
+        CSS.inc.php (manage and deliver CSS data)
+        DB.inc.php (minimal database abstraction layer)
+        DBSessionHandler.inc.php (database session handler)
+        Email.inc.php (provides email validation and sending functionality)
+        FormValidator.inc.php (validation routines used to test incoming user data)
         Google_API.inc.php (class for connecting to, querying, and dealing with data of the Google API)
-        ImageThumb.inc.php (automated image thumbnailing routines.)
+        Heirarchy.php (class for manipulation of heirarchies)
+        Image.inc.php (manage printing of images related to db records)
+        ImageThumb.inc.php (automated image thumbnailing routines)
+        Lock.inc.php (db record locking system)
         MCVE.inc.php
-        Nav.inc.php (navigation element management class))
-        NodeHeirarchy.php (class for manipulation of node heirarchies.)
+        Navigation.inc.php (navigation element management class))
         PageNumbers.inc.php (class for managing and printing various elements of page numbers and pagenation)
         PageSequence.inc.php (manage a sequence of steps and data from step form elements, like order checkout or signup)
@@ -52,15 +60,12 @@
         PEdit.inc.php (page-by-page file-based content management system)
         Prefs.inc.php (class for semi-permenent storage of values)
-        Lock.inc.php (db record locking system)
-        Version.inc.php (db record versioning system)
         ScriptTimer.inc.php (timer for scripts)
-        Cache.inc.php (class for accessing a cache in a users session, stores any variables for quick retreival)
         SortOrder.inc.php (class dealing with sorting of columns in database generated lists)
         SpellCheck.inc.php
-        TemplateGlue.inc.php (functions that generating html.)
-        Upload.inc.php (class that manages uploading of files.)
-        Utilities.inc.php (functions for general utility: setting defaults, num/string functions, etc.)
-    services/
-        (codebase scripts that are only useful when web accessible, i.e. to be used in a doc root)
+        TemplateGlue.inc.php (functions that generating html)
+        Upload.inc.php (class that manages uploading of files)
+        Utilities.inc.php (functions for general utility: setting defaults, num/string functions, etc)
+        Version.inc.php (db record versioning system)
+    services/ (codebase scripts that are only useful when web accessible, i.e. to be used in a doc root)
         admins.php
         css.php
@@ -71,26 +76,23 @@
         password.php
         phpinfo.php
-        templates
+        provides
+        templates/
         versions.php
+    tests/ (unit-based tests for all codebase libraries)
+
+===================================================================================
+Group of applications and related files, usually installed at /home/user/www.domain.com/
 
 
-======================================================================================
-Group of applications and related files, usually installed at /home/user/www.domain.com/
-======================================================================================
-
-global/
-    (global level configuration and libraries for a group of sites/apps)
+global/ (global level configuration and libraries for a group of sites/apps)
     config.inc.php (system-wide configuration)
     db_auth.inc.php (db-authentication for CLI scripts. chown'ed by user executing cron, NOT apache).
 
-docs/
-    (documents specific to a group of sites/apps)
-    tei_db.mysql (db schema)
+docs/ (documents specific to a group of sites/apps)
+    schema.mysql
 
-bin/
-    (global level command-line scripts)
+bin/ (global level command-line scripts)
 
-admin/
-    (DocumentRoot for the admin application)
+admin/ (DocumentRoot for the admin application)
     _config.inc.php
     _templates/ (templates used for the admin docroot)
@@ -107,7 +109,6 @@
     versions.php (manage db record versions)
 
-html/
-    (DocumentRoot of main site application)
-    _config.inc.php (configuration options and defaults specific to this site. included first in each script.)
+html/(DocumentRoot of main site application)
+    _config.inc.php (configuration options and defaults specific to this site. included first in each script)
     _templates/ (site specific templates. templates here override global codebase templates with same name)
     css.php (style sheets loader)
Index: tags/2.1/docs/version.txt
===================================================================
--- trunk/docs/version.txt	(revision 209)
+++ tags/2.1/docs/version.txt	(revision 215)
@@ -1,1 +1,1 @@
-2.1dev
+2.1
