[CS-Project-svn_notify] SF.net SVN: cs-project:[910] releases/1.2/lib
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-08-28 03:59:43
|
Revision: 910 http://cs-project.svn.sourceforge.net/cs-project/?rev=910&view=rev Author: crazedsanity Date: 2008-08-28 03:59:39 +0000 (Thu, 28 Aug 2008) Log Message: ----------- Remove svn:externals definition for the release (so they can be exported/imported). Added Paths: ----------- releases/1.2/lib/cs-arrayToPath/ releases/1.2/lib/cs-arrayToPath/LICENSE releases/1.2/lib/cs-arrayToPath/VERSION releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php releases/1.2/lib/cs-arrayToPath/cs_versionAbstract.class.php releases/1.2/lib/cs-content/ releases/1.2/lib/cs-content/LICENSE releases/1.2/lib/cs-content/README.txt releases/1.2/lib/cs-content/VERSION releases/1.2/lib/cs-content/contentSystemClass.php releases/1.2/lib/cs-content/cs_bbCodeParser.class.php releases/1.2/lib/cs-content/cs_fileSystemClass.php releases/1.2/lib/cs-content/cs_genericPageClass.php releases/1.2/lib/cs-content/cs_globalFunctions.php releases/1.2/lib/cs-content/cs_phpDB.php releases/1.2/lib/cs-content/cs_sessionClass.php releases/1.2/lib/cs-content/cs_tabsClass.php releases/1.2/lib/cs-content/cs_versionAbstract.class.php releases/1.2/lib/cs-content/db_types/ releases/1.2/lib/cs-content/db_types/cs_phpDB__mysql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__pgsql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__sqlite.class.php releases/1.2/lib/cs-content/sample_files/ releases/1.2/lib/cs-content/sample_files/public_html/ releases/1.2/lib/cs-content/sample_files/public_html/.htaccess releases/1.2/lib/cs-content/sample_files/public_html/content releases/1.2/lib/cs-content/sample_files/public_html/index.php releases/1.2/lib/cs-content/sample_files/templates/ releases/1.2/lib/cs-content/sample_files/templates/content/ releases/1.2/lib/cs-content/sample_files/templates/content/index.content.tmpl releases/1.2/lib/cs-content/sample_files/templates/footer.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/header.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/infobar.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/main.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/menu.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/ releases/1.2/lib/cs-content/sample_files/templates/system/404.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/construction.content.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/db_error.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/message_box.tmpl releases/1.2/lib/cs-content/template.inc releases/1.2/lib/cs-phpxml/ releases/1.2/lib/cs-phpxml/LICENSE releases/1.2/lib/cs-phpxml/README.txt releases/1.2/lib/cs-phpxml/VERSION releases/1.2/lib/cs-phpxml/xmlAbstract.class.php releases/1.2/lib/cs-phpxml/xmlBuilderClass.php releases/1.2/lib/cs-phpxml/xmlCreatorClass.php releases/1.2/lib/cs-phpxml/xmlParserClass.php Property Changed: ---------------- releases/1.2/lib/ Property changes on: releases/1.2/lib ___________________________________________________________________ Deleted: svn:externals - cs-content https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/0.10 cs-phpxml https://cs-phpxml.svn.sourceforge.net/svnroot/cs-phpxml/trunk cs-arrayToPath https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk Added: releases/1.2/lib/cs-arrayToPath/LICENSE =================================================================== --- releases/1.2/lib/cs-arrayToPath/LICENSE (rev 0) +++ releases/1.2/lib/cs-arrayToPath/LICENSE 2008-08-28 03:59:39 UTC (rev 910) @@ -0,0 +1,291 @@ +NOTE: a full HTML version of this license can be found at: +http://www.opensource.org/licenses/gpl-license.php + +It has been reproduced below without any HTML. +========================================================================== + +The GNU General Public License (GPL) + +Version 2, June 1991 + + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Added: releases/1.2/lib/cs-arrayToPath/VERSION =================================================================== --- releases/1.2/lib/cs-arrayToPath/VERSION (rev 0) +++ releases/1.2/lib/cs-arrayToPath/VERSION 2008-08-28 03:59:39 UTC (rev 910) @@ -0,0 +1,5 @@ +## Stores the current version of the cs-content system, and it's source. Please do NOT modify this file. + +VERSION: 0.2.2 +PROJECT: cs-arrayToPath +$HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/VERSION $ \ No newline at end of file Added: releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php =================================================================== --- releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php (rev 0) +++ releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php 2008-08-28 03:59:39 UTC (rev 910) @@ -0,0 +1,379 @@ +<?php +/* + * Created on Nov 20, 2006 + * + * SVN INFORMATION::: + * ------------------- + * Last Author::::::::: $Author: crazedsanity $ + * Current Revision:::: $Revision: 17 $ + * Repository Location: $HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/arrayToPathClass.php $ + * Last Updated:::::::: $Date: 2007-09-12 14:24:46 -0500 (Wed, 12 Sep 2007) $ + * + * + * Basically traverses an array as though it were a filesystem. In the given example, it looks + * more complex than necessary, but the "NEW WAY" is very programatic, whereas the "OLD WAY" is + * just that: OLD. Also, the new way is very extensible, and is handy when performing a LOT of + * complex operations on an array. + * Example: + * OLD WAY: + * $my_data = $array['path']['to']['your']['hidden']['data']; + * $my_vault = $array['path']['to']['your']['hidden']['vault']; + * $my_other = $array['path']['to']['your']['hidden']['other']; + * + * $array['path']['to']['my'] = array(); + * $array['path']['to']['my']['data'] = array(); + * $array['path']['to']['my']['data']['is'] = "here"; + * NEW WAY: + * $arrayToPath = new arrayToPath($array); + * $my_data = $arrayToPath('/path/to/your/hidden/data'); + * $my_vault = $arrayToPath('/path/to/your/hidden/vault'); + * $my_other = $arrayToPath('/path/to/your/hidden/other'); + * + * $arrayToPath->set_data('/path/to/my/data/is', 'here'); + */ + + +require_once(dirname(__FILE__) .'/cs_versionAbstract.class.php'); + +class arrayToPath extends cs_a2p_versionAbstract { + + private $prefix = NULL; //the first directory to use. + private $data; + private $iteration = 0; + + //====================================================================================== + /** + * The constructor. + * + * @param $array (array) The data that will be used when + * + * TODO::: there is a strange recursion issue when $prefix is non-null: prefix is presently hardwired as NULL for now... + */ + public function __construct($array, $prefix=NULL) { + if($array === 'unit_test') { + //it's a unit test. + $this->isTest = TRUE; + } + else { + $this->get_version(); + $prefix=NULL; + if(!is_array($array)) { + //I don't deal with non-arrays. Idiot. + exit('arrayToPath{}->__construct(): got an invalid datatype.'); + } + //create a reference to the data, so if it changes, the class doesn't have to be re-initialized. + $this->data = $array; + + //now set the prefix ONLY if the prefix is valid. + if(!is_null($prefix) && strlen($prefix)) { + //got a good prefix, so use it. + $this->prefix = $prefix; + } + } + }//end __construct() + //====================================================================================== + + + //====================================================================================== + /** + * Takes a path & returns the appropriate index in the session. + * + * @param $path <str> path to the appropriate section in the session. + * + * @return <NULL> FAIL: unable to find requested index. + * @return <mixed> PASS: this is the value of the index. + */ + public function get_data($path=NULL) { + $myIndexList = array(); + $path = $this->fix_path($path); + + if(is_null($path) || (strlen($path) < 1)) { + //they just want ALL THE DATA. + $retval = $this->data; + } + else { + //get the list of indices in our data that we have to traverse. + $myIndexList = $this->explode_path($path); + + //set an initial retval. + $retval = $this->get_data_segment($this->data, $myIndexList[0]); + unset($myIndexList[0]); + + if(count($myIndexList) > 0) { + foreach($myIndexList as $indexName) { + $retval = $this->get_data_segment($retval, $indexName); + if(is_null($retval)) { + //hmm... well, if it's null, it's nothing which can have a sub-index. Stop here. + break; + } + } + } + } + + return($retval); + + }//end get_data() + //====================================================================================== + + + + //====================================================================================== + /** + * Returns a given index from a piece of data, used by get_data(). + */ + private function get_data_segment($fromThis, $indexName) { + if(is_array($fromThis)) { + //it's an array. + $retval = $fromThis[$indexName]; + } + elseif(is_object($fromThis)) { + //it's an object. + $retval = $fromThis->$indexName; + } + return($retval); + }//end get_data_segment() + //====================================================================================== + + + + //====================================================================================== + /** + * Pre-pends the internal $this->prefix onto the given path. + * + * @param $path <str> path to append $this->prefix onto. + * + * @return <str> PASS: this is the path with our prefix added. + */ + private function fix_path($path) { + if(is_null($path) && is_null($this->prefix)) { + //all data is null. don't bother changing it. + $retval = NULL; + } + else { + //remove slashes at the beginning or end of the path. + $path = preg_replace('/\/$/', '', $path); + + if(preg_match('/\/$/', $this->prefix)) { + //remove the trailing slash. + $this->prefix = preg_replace('/$\//', '', $this->prefix); + } + if(preg_match('/^\//', $this->prefix)) { + $this->prefix = preg_replace('/^\//', '', $this->prefix); + } + $path = preg_replace('/\/$/', '', $path); + + //should we add our prefix? + if(preg_match('/^\//', $path)) { + $retval = $path; + } + else { + $retval = $this->prefix ."/". $path; + } + + //remove a trailing slash, if present, before returning. + $retval = preg_replace('/\/$/', '', $retval); + } + + return($retval); + + }//end fix_path() + //====================================================================================== + + + + //====================================================================================== + /** + * Sets data into the given path, with options to override our internal prefix, and to + * force-overwrite data if it's not an array. + * + * @param $path <str> path to set the data into. + * @param $data <mixed> what to set into the given path. + * + * @return 0 FAIL: old data doesn't match new data. + * @return 1 PASS: everything lines-up. + */ + public function set_data($path, $data) { + //get the list of indices in the session that we have to traverse. + $myIndexList = $this->explode_path($path); + + $retval = 0; + //Use an internal iterator to go through the little bits of the session & set the + // data where it's supposed to be. + if($path === '/' || count($myIndexList) == 0) { + //setting the data. + $this->data = $data; + $retval = 1; + } + elseif(count($myIndexList) == 1) { + //that should be simple: set the index to be $data. + $this->data[$myIndexList[0]] = $data; + $retval = 1; + } + elseif(count($myIndexList) > 1) { + $this->internal_iterator($this->data, $path, $data); + $retval = 1; + } + + return($retval); + }//end set_data() + //====================================================================================== + + + //====================================================================================== + /** + * Iterates through the session to create the values for set_data(). This method passes + * AND returns the $array argument by reference. + * + * @param &$array (array) iterate through this. + * @param $path (array) numbered array of keys, representing a path through the + * internal data to go through to set $data. + * @param $data (mixed) data to set into the path referenced in $indexList. + * + * @return <void> + */ + protected function &internal_iterator(&$array, $path, $data) { + //make sure it doesn't call itself to death. ;) + $this->iteration++; + + if($this->iteration > 1000) { + throw new exception("arrayToPath{}: too many iterations, path=($path)"); + } + + $retval = 0; + $indexList = $this->explode_path($path); + $myIndex = array_shift($indexList); + $path = $this->string_from_array($indexList); + + if(is_array($array) && !strlen($path)) { + if(isset($myIndex)) { + //set the final piece of the array. + $array[$myIndex] = $data; + } + else { + //something is broken. + throw new exception("arrayToPath{}->internal_iterator(): no index ($myIndex) to follow at the end of the path."); + } + } + elseif(is_array($array) && strlen($path)) { + if((count($indexList) == 0) || (is_array($indexList) && count($indexList) > 1)) { + if(!is_array($array[$myIndex])) { + $array[$myIndex] = array(); + } + $array = &$array[$myIndex]; + $newPath = $this->string_from_array($indexList); + + $this->internal_iterator($array, $path, $data); + } + elseif(is_array($indexList) && count($indexList) == 1) { + if(!is_array($array[$myIndex])) { + $array[$myIndex] = array(); + } + $array = &$array[$myIndex]; + $this->internal_iterator($array, $indexList[0], $data); + } + else { + //not sure what to do but throw an exception. + throw new exception("arrayToPath{}->internal_iterator(): unknown error ('not sure what to do'): ($array)"); + } + } + elseif(is_object($array)) { + //can't handle objects...? + throw new exception("arrayToPath{}->internal_iterator(): can't handle objects...?"); + } + else { + //something is... er... broken. + throw new exception("arrayToPath{}->internal_iterator(): found unknown data type in path ($array)"); + } + + //decrement the iteration, so methods using it can call it multiple times without worrying about accidentally hitting the limit. + $this->iteration--; + }//end internal_iterator() + //====================================================================================== + + + + + //====================================================================================== + /** + * Will unset the final index in the $path var. I.E. to unset $this->array['x']['y'], + * call unset_data('/x/y') + * + * @param $path (str) path to unset data; The last item in the path will be removed. + */ + public function unset_data($path) { + //explode the path. + $pathArr = $this->explode_path($path); + $removeThis = array_pop($pathArr); + $path = $this->string_from_array($pathArr); + + //retrieve the data... + $myData = $this->get_data($path); + + if(is_array($myData)) { + //now remove the bit of data as requested. + unset($myData[$removeThis]); + //update the path with our new data. + $retval = $this->set_data($path, $myData); + } + else { + //throw a terrible error. + throw new exception("unset_data(): data ($myData) wasn't an array! ($path)"); + } + + return($retval); + }//end unset_data() + //====================================================================================== + + + + //====================================================================================== + /** + * Performs all the work of exploding the path and fixing it. + * + * @param $path <string> Path to work with. + * @return <array> PASS: array contains exploded path. + */ + public function explode_path($path) { + $path = preg_replace('/\/\//', '/', $path); + $path = $this->fix_path($path); + $retval = explode('/', $path); + + //if the initial index is blank, just remove it. + if($retval[0] == '' || strlen($retval[0]) < 1) { + //it was blank! KILL IT! + $checkItOut = array_shift($retval); + } + + return($retval); + }//end explode_path() + //====================================================================================== + + + + //====================================================================================== + public function reload_data($array) { + //call the constructor on it, and pass along the CURRENT prefix, so it doesn't get reset. + $this->__construct($array, $this->prefix); + }//end reload_data() + //====================================================================================== + + + + //====================================================================================== + private function string_from_array(array $array) { + $retval = ""; + foreach($array as $index) { + if(strlen($retval)) { + $retval .= "/". $index; + } + else { + $retval = $index; + } + } + return($retval); + }//end string_from_array() + //====================================================================================== + +}//end arrayToPath{} + +?> Added: releases/1.2/lib/cs-arrayToPath/cs_versionAbstract.class.php =================================================================== --- releases/1.2/lib/cs-arrayToPath/cs_versionAbstract.class.php (rev 0) +++ releases/1.2/lib/cs-arrayToPath/cs_versionAbstract.class.php 2008-08-28 03:59:39 UTC (rev 910) @@ -0,0 +1,86 @@ +<?php +/* + * Created on Sept. 12, 2007 + * + * SVN INFORMATION::: + * ------------------- + * Last Author::::::::: $Author: crazedsanity $ + * Current Revision:::: $Revision: 153 $ + * Repository Location: $HeadURL: https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/cs_versionAbstract.class.php $ + * Last Updated:::::::: $Date: 2007-09-12 13:33:15 -0500 (Wed, 12 Sep 2007) $ + */ + +abstract class cs_a2p_versionAbstract { + + public $isTest=FALSE; + + abstract public function __construct(); + + + + //========================================================================= + /** + * Retrieve our version string from the VERSION file. + */ + final public function get_version() { + $retval = NULL; + $versionFileLocation = dirname(__FILE__) .'/VERSION'; + if(file_exists($versionFileLocation)) { + $myData = file($versionFileLocation); + + //set the logical line number that the version string is on, and + // drop by one to get the corresponding array index. + $lineOfVersion = 3; + $arrayIndex = $lineOfVersion -1; + + $myVersionString = trim($myData[$arrayIndex]); + + if(preg_match('/^VERSION: /', $myVersionString)) { + $retval = preg_replace('/^VERSION: /', '', $myVersionString); + } + else { + throw new exception(__METHOD__ .": failed to retrieve version string"); + } + } + else { + throw new exception(__METHOD__ .": failed to retrieve version information"); + } + + return($retval); + }//end get_version() + //========================================================================= + + + + //========================================================================= + final public function get_project() { + $retval = NULL; + $versionFileLocation = dirname(__FILE__) .'/VERSION'; + if(file_exists($versionFileLocation)) { + $myData = file($versionFileLocation); + + //set the logical line number that the version string is on, and + // drop by one to get the corresponding array index. + $lineOfProject = 4; + $arrayIndex = $lineOfProject -1; + + $myProject = trim($myData[$arrayIndex]); + + if(preg_match('/^PROJECT: /', $myProject)) { + $retval = preg_replace('/^PROJECT: /', '', $myProject); + } + else { + throw new exception(__METHOD__ .": failed to retrieve project string"); + } + } + else { + throw new exception(__METHOD__ .": failed to retrieve project information"); + } + + return($retval); + }//end get_project() + //========================================================================= + + +} +?> \ No newline at end of file Property changes on: releases/1.2/lib/cs-arrayToPath/cs_versionAbstract.class.php ___________________________________________________________________ Added: svn:executable + * Added: releases/1.2/lib/cs-content/LICENSE =================================================================== --- releases/1.2/lib/cs-content/LICENSE (rev 0) +++ releases/1.2/lib/cs-content/LICENSE 2008-08-28 03:59:39 UTC (rev 910) @@ -0,0 +1,291 @@ +NOTE: a full HTML version of this license can be found at: +http://www.opensource.org/licenses/gpl-license.php + +It has been reproduced below without any HTML. +========================================================================== + +The GNU General Public License (GPL) + +Version 2, June 1991 + + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Added: releases/1.2/lib/cs-content/README.txt =================================================================== --- releases/1.2/lib/cs-content/README.txt (rev 0) +++ releases/1.2/lib/cs-content/README.txt 2008-08-28 03:59:39 UTC (rev 910) @@ -0,0 +1,5 @@ +Documentation is now located at: +[https://cs-content.svn.sourceforge.net/svnroot/cs-content/documentation]. It +has been moved to avoid unnecessarily large downloads. + +$Id: README.txt 267 2008-04-29 15:27:28Z crazedsanity $ \ No newline at end of file Added: releases/1.2/lib/cs-content/VERSION =================================================================== --- releases/1.2/lib/cs-content/VERSION (rev 0) +++ releases/1.2/lib/cs-content/VERSION 2008-08-28 03:59:39 UTC (rev 910) @@ -0,0 +1,5 @@ +## Stores the current version of the cs-content system, and it's source. Please do NOT modify this file. + +VERSION: 0.10.12 +PROJECT: cs-content +$HeadURL:https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/VERSION $ \ No newline at end of file Added: releases/1.2/lib/cs-content/contentSystemClass.php =================================================================== --- releases/1.2/lib/cs-content/contentSystemClass.php (rev 0) +++ releases/1.2/lib/cs-content/contentSystemClass.php 2008-08-28 03:59:39 UTC (rev 910) @@ -0,0 +1,858 @@ +<?php +/* + * FILE INFORMATION: + * $HeadURL: https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/0.10/contentSystemClass.php $ + * $Id: contentSystemClass.php 288 2008-06-04 18:20:26Z crazedsanity $ + * $LastChangedDate: 2008-06-04 13:20:26 -0500 (Wed, 04 Jun 2008) $ + * $LastChangedRevision: 288 $ + * $LastChangedBy: crazedsanity $ + * + * HOW THE SYSTEM WORKS::: + * TEMPLATE FILES: + * Automatically loads templates based on the URL, and optionally includes scripts in the includes directory. + * + * MAIN SECTION: + * For the main section, i.e. "/content", it requires a template in a directory of that name beneath + * /templates, with a file called "index.content.tmpl"... i.e. /templatee/content/index.content.tmpl. + * SUB SECTIONS: + * For any subsection to be valid, i.e. "/content/members", it must have an associated template, i.e. + * "/templates/content/members.content.tmpl". If a subdirectory with an index.content.tmpl file exists, it will + * be used instead of the file in the sub directory (i.e. "/templates/content/members/index.content.tmpl"). + * SUB SECTION TEMPLATE INHERITANCE: + * All pages load the base set of "shared" templates, which are in the form "<section>.shared.tmpl" in + * the root of the templates directory. + * + * Shared files within each directory, in the form "<section>.shared.tmpl", will be loaded for ANY subsection. + * + * For any subsection, it inherits a previous section's templates in the following manner (any "content" + * templates are ignored for inheritance, as they're require for page load). + * /content ---> /templates/content/index.*.tmpl + * + * /content/members |--> /templates/content/index.*.tmpl + * `--> /templates/content/members.*.tmpl + * + * /content/members/test |--> /templates/content/index.*.tmpl + * |--> /templates/content/members.*.tmpl + * |--> /templates/content/members/index.*.tmpl + * `--> /templates/content/members/test.*.tmpl + * AUTOMATIC INCLUDES: + * Much in the same way templates are included, so are scripts, from the /includes directory, though the logic + * is decidedly simpler: all scripts must have the extension of ".inc", and must have either the section's name + * as the first part of the filename, or "shared". Shared scripts will be loaded for ALL subsections. + * + * INCLUDES INHERITANCE: + * The template inheritance scheme is as laid-out below. The content system will go as far into the + * includes directory as it can for the given section, regardless of if any intermediate files are missing. + * + * It is important to note that the content system will NOT regard a section as valid if there are include + * scripts but no templates. + * + * /content |--> /includes/shared.inc + * `--> /includes/content.inc + * + * /content/members |--> /includes/shared.inc + * |--> /includes/content.inc + * |--> /includes/content/shared.inc + * `--> /includes/content/members.inc + * + * /content/members/test |--> /includes/shared.inc + * |--> /includes/content.inc + * |--> /includes/content/shared.inc + * |--> /includes/content/members.inc + * |--> /includes/content/members/shared.inc + * |--> /includes/content/members/test.inc + */ + +//TODO: remove this terrible little hack. +if(!isset($GLOBALS['SITE_ROOT'])) { + //define where our scripts are located. + $GLOBALS['SITE_ROOT'] = $_SERVER['DOCUMENT_ROOT']; + $GLOBALS['SITE_ROOT'] = str_replace("/public_html", "", $GLOBALS['SITE_ROOT']); +} + +require_once(dirname(__FILE__) ."/cs_globalFunctions.php"); +require_once(dirname(__FILE__) ."/cs_fileSystemClass.php"); +require_once(dirname(__FILE__) ."/cs_sessionClass.php"); +require_once(dirname(__FILE__) ."/cs_genericPageClass.php"); +require_once(dirname(__FILE__) ."/cs_tabsClass.php"); +require_once(dirname(__FILE__) ."/cs_versionAbstract.class.php"); + +class contentSystem extends cs_versionAbstract { + + protected $baseDir = NULL; //base directory for templates & includes. + protected $section = NULL; //section string, derived from the URL. + protected $sectionArr = array(); //array of items, for figuring out where templates & includes are. + protected $fileSystemObj = NULL; //the object used to access the filesystem. + protected $ignoredList = array( //array of files & folders that are implicitely ignored. + 'file' => array('.htaccess'), + 'dir' => array('.svn','CVS' + ) + ); + protected $templateList = array(); + protected $includesList = array(); + public $templateObj = NULL; + protected $gfObj = NULL; + protected $tabs = NULL; + + protected $finalSection; + + private $isValid=FALSE; + private $reason=NULL; + + //------------------------------------------------------------------------ + /** + * The CONSTRUCTOR. Duh. + */ + public function __construct($testOnly=FALSE) { + if($testOnly === 'unit_test') { + //It's just a test, don't do anything we might regret later. + $this->isTest = TRUE; + } + else { + $this->get_version(); + $this->get_project(); + //make a cs_globalFunctions{} object. + $this->gfObj = new cs_globalFunctions(); + + //setup the section stuff... + $repArr = array($_SERVER['SCRIPT_NAME'], "/"); + $_SERVER['REQUEST_URI'] = ereg_replace('^/', "", $_SERVER['REQUEST_URI']); + + //figure out the section & subsection stuff. + $this->section = $this->clean_url($_SERVER['REQUEST_URI']); + + $this->initialize_locals(); + } + }//end __construct() + //------------------------------------------------------------------------ + + + + //------------------------------------------------------------------------ + /** + * Creates internal objects & prepares for later usage. + */ + private function initialize_locals() { + //build the templating engine: this may cause an immediate redirect, if they need to be logged-in. + //TODO: find a way to define this on a per-page basis. Possibly have templateObj->check_login() + // run during the "finish" stage... probably using GenericPage{}->check_login(). + $this->templateObj = new cs_genericPage(FALSE, "main.shared.tmpl"); + + //setup some default template vars. + $this->templateObj->add_template_var('date', date('m-d-Y')); + $this->templateObj->add_template_var('time', date('H:i:s')); + + $myUrl = '/'; + if(strlen($this->section) && $this->section !== 0) { + $myUrl = '/'. $this->section; + } + $this->templateObj->add_template_var('CURRENT_URL', $myUrl); + + //create a fileSystem object. + $this->fileSystemObj = new cs_fileSystemClass(); + + //create a tabs object, in case they want to load tabs on the page. + $this->tabs = new cs_tabs($this->templateObj); + + //check versions, make sure they're all the same. + $myVersion = $this->get_version(); + if($this->templateObj->get_version() !== $myVersion) { + throw new exception(__METHOD__ .": ". get_class($this->templateObj) ." has mismatched version (". $this->templateObj->get_version() ." does not equal ". $myVersion .")"); + } + if($this->fileSystemObj->get_version() !== $myVersion) { + throw new exception(__METHOD__ .": ". get_cl... [truncated message content] |