From 051f51eb00290681038834e7e17b4769ed3a71e5 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 30 Jul 2009 22:32:35 -0600 Subject: [PATCH] Import Skeleton from CVS HEAD --- skeleton/COPYING | 280 +++++++++++++++++++++++++++++++++++ skeleton/LICENSE.ASL | 48 ++++++ skeleton/LICENSE.BSDL | 24 +++ skeleton/README | 86 +++++++++++ skeleton/config/conf.xml | 27 ++++ skeleton/config/prefs.php.dist | 21 +++ skeleton/docs/CHANGES | 5 + skeleton/docs/CREDITS | 24 +++ skeleton/docs/INSTALL | 241 ++++++++++++++++++++++++++++++ skeleton/docs/RELEASE_NOTES | 50 +++++++ skeleton/index.php | 23 +++ skeleton/lib/Block/example.php | 43 ++++++ skeleton/lib/Driver.php | 66 +++++++++ skeleton/lib/Driver/Sql.php | 196 ++++++++++++++++++++++++ skeleton/lib/Skeleton.php | 26 ++++ skeleton/lib/base.load.php | 28 ++++ skeleton/lib/base.php | 31 ++++ skeleton/lib/version.php | 1 + skeleton/list.php | 19 +++ skeleton/locale/en_US/help.xml | 13 ++ skeleton/po/README | 1 + skeleton/templates/common-header.inc | 26 ++++ skeleton/templates/menu.inc | 4 + skeleton/themes/screen.css | 1 + 24 files changed, 1284 insertions(+) create mode 100644 skeleton/COPYING create mode 100644 skeleton/LICENSE.ASL create mode 100644 skeleton/LICENSE.BSDL create mode 100644 skeleton/README create mode 100644 skeleton/config/conf.xml create mode 100644 skeleton/config/prefs.php.dist create mode 100644 skeleton/docs/CHANGES create mode 100644 skeleton/docs/CREDITS create mode 100644 skeleton/docs/INSTALL create mode 100644 skeleton/docs/RELEASE_NOTES create mode 100644 skeleton/index.php create mode 100644 skeleton/lib/Block/example.php create mode 100644 skeleton/lib/Driver.php create mode 100644 skeleton/lib/Driver/Sql.php create mode 100644 skeleton/lib/Skeleton.php create mode 100644 skeleton/lib/base.load.php create mode 100644 skeleton/lib/base.php create mode 100644 skeleton/lib/version.php create mode 100644 skeleton/list.php create mode 100644 skeleton/locale/en_US/help.xml create mode 100644 skeleton/po/README create mode 100644 skeleton/templates/common-header.inc create mode 100644 skeleton/templates/menu.inc create mode 100644 skeleton/themes/screen.css diff --git a/skeleton/COPYING b/skeleton/COPYING new file mode 100644 index 000000000..a6b67561a --- /dev/null +++ b/skeleton/COPYING @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright 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. + + GNU GENERAL PUBLIC LICENSE + 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 diff --git a/skeleton/LICENSE.ASL b/skeleton/LICENSE.ASL new file mode 100644 index 000000000..4d7e672c4 --- /dev/null +++ b/skeleton/LICENSE.ASL @@ -0,0 +1,48 @@ +Version 1.0 + +Copyright 2006-2009 The Horde Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. The end-user documentation included with the redistribution, if +any, must include the following acknowledgment: + + "This product includes software developed by the Horde Project + (http://www.horde.org/)." + +Alternately, this acknowledgment may appear in the software itself, if +and wherever such third-party acknowledgments normally appear. + +4. The names "Horde", "The Horde Project", and "Skeleton" must not be +used to endorse or promote products derived from this software without +prior written permission. For written permission, please contact +core@horde.org. + +5. Products derived from this software may not be called "Horde" or +"Skeleton", nor may "Horde" or "Skeleton" appear in their name, without +prior written permission of the Horde Project. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE HORDE PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +This software consists of voluntary contributions made by many +individuals on behalf of the Horde Project. For more information on +the Horde Project, please see . diff --git a/skeleton/LICENSE.BSDL b/skeleton/LICENSE.BSDL new file mode 100644 index 000000000..79e780580 --- /dev/null +++ b/skeleton/LICENSE.BSDL @@ -0,0 +1,24 @@ +Copyright 2006-2009 The Horde Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HORDE PROJECT +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/skeleton/README b/skeleton/README new file mode 100644 index 000000000..03eae3e9b --- /dev/null +++ b/skeleton/README @@ -0,0 +1,86 @@ +What is Skeleton? +================= + +:Contact: foo@example.com + +.. contents:: Contents +.. section-numbering:: + +Skeleton is ... + +This software is OSI Certified Open Source Software. OSI Certified is a +certification mark of the `Open Source Initiative`_. + +.. _`Open Source Initiative`: http://www.opensource.org/ + + +Obtaining Skeleton +------------------ + +Further information on Skeleton and the latest version can be obtained at + + http://www.horde.org/skeleton/ + + +Documentation +------------- + +The following documentation is available in the Skeleton distribution: + +:README_: This file +:COPYING_: Copyright and license information +:LICENSE_: Copyright and license information +:`docs/CHANGES`_: Changes by release +:`docs/CREDITS`_: Project developers +:`docs/INSTALL`_: Installation instructions and notes +:`docs/TODO`_: Development TODO list +:`docs/UPGRADING`_: Pointers on upgrading from previous Skeleton versions + + +Installation +------------ + +Instructions for installing Skeleton can be found in the file INSTALL_ in the +``docs/`` directory of the Skeleton distribution. + + +Assistance +---------- + +If you encounter problems with Skeleton, help is available! + +The Horde Frequently Asked Questions List (FAQ), available on the Web at + + http://www.horde.org/faq/ + +The Horde Project runs a number of mailing lists, for individual applications +and for issues relating to the project as a whole. Information, archives, and +subscription information can be found at + + http://www.horde.org/mail/ + +Lastly, Horde developers, contributors and users also make occasional +appearances on IRC, on the channel #horde on the freenode Network +(irc.freenode.net). + + +Licensing +--------- + +For licensing and copyright information, please see the file COPYING_/LICENSE_ +[pick one] in the Skeleton distribution. + +Thanks, + +The Skeleton team + + +.. _README: ?f=README.html +.. _COPYING: http://www.horde.org/licenses/gpl.php +.. _LICENSE: http://www.horde.org/licenses/asl.php +.. _docs/CHANGES: ?f=CHANGES.html +.. _docs/CREDITS: ?f=CREDITS.html +.. _INSTALL: +.. _docs/INSTALL: ?f=INSTALL.html +.. _docs/TODO: ?f=TODO.html +.. _docs/UPGRADING: ?f=UPGRADING.html diff --git a/skeleton/config/conf.xml b/skeleton/config/conf.xml new file mode 100644 index 000000000..e09ebc6ac --- /dev/null +++ b/skeleton/config/conf.xml @@ -0,0 +1,27 @@ + + + + + Storage System Settings + sql + + + + skeleton_foos + + + + + + + + Menu Settings + + + + + + + diff --git a/skeleton/config/prefs.php.dist b/skeleton/config/prefs.php.dist new file mode 100644 index 000000000..e32cd2bb7 --- /dev/null +++ b/skeleton/config/prefs.php.dist @@ -0,0 +1,21 @@ + _("Sample Prefs"), + 'label' => _("Sample Pref"), + 'desc' => _("Set your sample preference."), + 'members' => array('sample') +); + +$_prefs['sample'] = array( + 'value' => '', + 'locked' => false, + 'shared' => false, + 'type' => 'text', + 'desc' => _("This is your sample preference.") +); diff --git a/skeleton/docs/CHANGES b/skeleton/docs/CHANGES new file mode 100644 index 000000000..3743caedc --- /dev/null +++ b/skeleton/docs/CHANGES @@ -0,0 +1,5 @@ +------- +0.1-git +------- + +[xyz] Initial Release. diff --git a/skeleton/docs/CREDITS b/skeleton/docs/CREDITS new file mode 100644 index 000000000..e0296c823 --- /dev/null +++ b/skeleton/docs/CREDITS @@ -0,0 +1,24 @@ +=========================== + Skeleton Development Team +=========================== + + +Core Developers +=============== + + + +Drivers +======= + + + +Localization +============ + +===================== ====================================================== +===================== ====================================================== + + +Contributions +============= diff --git a/skeleton/docs/INSTALL b/skeleton/docs/INSTALL new file mode 100644 index 000000000..6dd844832 --- /dev/null +++ b/skeleton/docs/INSTALL @@ -0,0 +1,241 @@ +===================== + Installing Skeleton +===================== + +:Contact: foo@example.com + +.. contents:: Contents +.. section-numbering:: + +This document contains instructions for installing the Skeleton ... + +For information on the capabilities and features of Skeleton, see the file +README_ in the top-level directory of the Skeleton distribution. + + +Obtaining Skeleton +================== + +Skeleton can be obtained from the Horde website and FTP server, at + + http://www.horde.org/skeleton/ + + ftp://ftp.horde.org/pub/skeleton/ + +Or use the mirror closest to you: + + http://www.horde.org/mirrors.php + +Bleeding-edge development versions of Skeleton are available via Git; see the +file `horde/docs/HACKING`_ in the Horde distribution, or the website +http://www.horde.org/source/, for information on accessing the Horde Git +repository. + + +Prerequisites +============= + +To function properly, Skeleton **requires** the following: + +1. A working Horde installation. + + Skeleton runs within the `Horde Application Framework`_, a set of common + tools for Web applications written in PHP. You must install Horde before + installing Skeleton. + + .. Important:: Skeleton 1.0 requires version 4.0+ of the Horde Framework - + earlier versions of Horde will **not** work. + + .. _`Horde Application Framework`: http://www.horde.org/horde/ + + The Horde Framework can be obtained from the Horde website and FTP server, + at + + http://www.horde.org/horde/ + + ftp://ftp.horde.org/pub/horde/ + + .. Important:: Be sure to have completed all of the steps in the + `horde/docs/INSTALL`_ file for the Horde Framework before + installing Skeleton. Many of Skeleton's prerequisites are + also Horde prerequisites. Additionally, many of Skeleton's + optional features are configured via the Horde install. + +2. The following PHP capabilities: + + a. FOO support ``--with-foo`` [OPTIONAL] + + Description of Foo and what it is used for. + +3. The following PEAR packages: + (See `horde/docs/INSTALL`_ for instructions on installing PEAR packages) + + a. PEAR_Package x.x.x [OPTIONAL] + + Skeleton uses the Foo_Bar class for... + +4. The following PECL modules: + (See `horde/docs/INSTALL`_ for instructions on installing PECL modules) + + a. pecl_package x.x.x [OPTIONAL] + + pecl_package is required to... + + +The following items are not required, but are strongly **RECOMMENDED**: + +1. Yet something else. + + +Installing Skeleton +=================== + +Skeleton is written in PHP, and must be installed in a web-accessible +directory. The precise location of this directory will differ from system to +system. Conventionally, Skeleton is installed directly underneath Horde in the +web server's document tree. + +Since Skeleton is written in PHP, there is no compilation necessary; simply +expand the distribution where you want it to reside and rename the root +directory of the distribution to whatever you wish to appear in the URL. For +example, with the Apache web server's default document root of +``/usr/local/apache/htdocs``, you would type:: + + cd /usr/local/apache/htdocs/horde + tar zxvf /path/to/skeleton-h3-x.y.z.tar.gz + mv skeleton-h3-x.y.z skeleton + +and would then find Skeleton at the URL:: + + http://your-server/horde/skeleton/ + + +Configuring Skeleton +==================== + +1. Configuring Horde for Skeleton + + a. Register the application + + In ``horde/config/registry.php``, find the ``applications['skeleton']`` + stanza. The default settings here should be okay, but you can change + them if desired. If you have changed the location of Skeleton relative + to Horde, either in the URL, in the filesystem or both, you must update + the ``fileroot`` and ``webroot`` settings to their correct values. + +2. Creating the database tables + + The specific steps to create Skeleton's database tables depend on which + database you've chosen to use. + + First, look in ``scripts/sql/`` to see if a script already exists for your + database type. If so, you should be able to simply execute that script as + superuser in your database. (Note that executing the script as the "horde" + user will probably fail when granting privileges.) + + If such a script does not exist, you'll need to build your own, using the + file ``skeleton.sql`` as a starting point. If you need assistance in + creating database tables, you may wish to let us know on the Skeleton + mailing list. + + You will also need to make sure that the "horde" user in your database has + table-creation privileges, so that the tables that `PEAR DB`_ uses to + provide portable sequences can be created. + + .. _`PEAR DB`: http://pear.php.net/DB + +3. Configuring Skeleton + + To configure Skeleton, change to the ``config/`` directory of the installed + distribution, and make copies of all of the configuration ``dist`` files + without the ``dist`` suffix:: + + cd config/ + for foo in *.dist; do cp $foo `basename $foo .dist`; done + + Or on Windows:: + + copy *.dist *. + + Documentation on the format and purpose of those files can be found in each + file. You may edit these files if you wish to customize Skeleton's + appearance and behavior. With one exception (``foo.php``) the defaults will + be correct for most sites. + + You must login to Horde as a Horde Administrator to finish the + configuration of Skeleton. Use the Horde ``Administration`` menu item to + get to the administration page, and then click on the ``Configuration`` + icon to get the configuration page. Select ``Skeleton Name`` from the + selection list of applications. Fill in or change any configuration values + as needed. When done click on ``Generate Skeleton Name Configuration`` to + generate the ``conf.php`` file. If your web server doesn't have write + permissions to the Skeleton configuration directory or file, it will not be + able to write the file. In this case, go back to ``Configuration`` and + choose one of the other methods to create the configuration file + ``skeleton/config/conf.php``. + + Note for international users: Skeleton uses GNU gettext to provide local + translations of text displayed by applications; the translations are found + in the ``po/`` directory. If a translation is not yet available for your + locale (and you wish to create one), see the ``horde/po/README`` file, or + if you're having trouble using a provided translation, please see the + `horde/docs/TRANSLATIONS`_ file for instructions. + +4. More instructions, upgrading, securing, etc. + +5. Testing Skeleton + + Once you have configured Skeleton, bring up the included test page in your + Web browser to ensure that all necessary prerequisites have been met. See + the `horde/docs/INSTALL`_ document for further details on Horde test + scripts. If you installed Skeleton as described above, the URL to the test + page would be:: + + http://your-server/horde/skeleton/test.php + + The test script will also allow you to test... + + Next, use Skeleton to.... Test at least the following: + + - Foo + - Bar + + +Known Problems +============== + +... + + +Obtaining Support +================= + +If you encounter problems with Skeleton, help is available! + +The Horde Frequently Asked Questions List (FAQ), available on the Web at + + http://www.horde.org/faq/ + +The Horde Project runs a number of mailing lists, for individual applications +and for issues relating to the project as a whole. Information, archives, and +subscription information can be found at + + http://www.horde.org/mail/ + +Lastly, Horde developers, contributors and users may also be found on IRC, +on the channel #horde on the Freenode Network (irc.freenode.net). + +Please keep in mind that Skeleton is free software written by volunteers. +For information on reasonable support expectations, please read + + http://www.horde.org/support.php + +Thanks for using Skeleton! + +The Skeleton team + + +.. _README: ?f=README.html +.. _`horde/docs/HACKING`: ../../horde/docs/?f=HACKING.html +.. _`horde/docs/INSTALL`: ../../horde/docs/?f=INSTALL.html +.. _`horde/docs/TRANSLATIONS`: ../../horde/docs/?f=TRANSLATIONS.html diff --git a/skeleton/docs/RELEASE_NOTES b/skeleton/docs/RELEASE_NOTES new file mode 100644 index 000000000..e059cc468 --- /dev/null +++ b/skeleton/docs/RELEASE_NOTES @@ -0,0 +1,50 @@ +notes['fm']['focus'] = 4; + +/* Mailing list release notes. */ +$this->notes['ml']['changes'] = <<notes['fm']['changes'] = <<notes['name'] = 'Skeleton'; +$this->notes['fm']['project'] = 'skeleton'; +$this->notes['fm']['branch'] = 'Default'; diff --git a/skeleton/index.php b/skeleton/index.php new file mode 100644 index 000000000..ec042cf9d --- /dev/null +++ b/skeleton/index.php @@ -0,0 +1,23 @@ + + */ + +require_once dirname(__FILE__) . '/lib/base.load.php'; +$skeleton_configured = (is_readable(SKELETON_BASE . '/config/conf.php') && + is_readable(SKELETON_BASE . '/config/prefs.php')); + +if (!$skeleton_configured) { + require HORDE_BASE . '/lib/Test.php'; + Horde_Test::configFilesMissing('Skeleton', SKELETON_BASE, + array('conf.php', 'prefs.php')); +} + +require SKELETON_BASE . '/list.php'; diff --git a/skeleton/lib/Block/example.php b/skeleton/lib/Block/example.php new file mode 100644 index 000000000..e300b35a3 --- /dev/null +++ b/skeleton/lib/Block/example.php @@ -0,0 +1,43 @@ + array('type' => 'text', + 'name' => _("Color"), + 'default' => '#ff0000')); + } + + /** + * The title to go in this block. + * + * @return string The title text. + */ + protected function _title() + { + return _("Color"); + } + + /** + * The content to go in this block. + * + * @return string The content + */ + protected function _content() + { + $html = ''; + $html .= ''; + $html .= '
 
'; + + return sprintf($html, $this->_params['color']); + } + +} diff --git a/skeleton/lib/Driver.php b/skeleton/lib/Driver.php new file mode 100644 index 000000000..667f0d1d9 --- /dev/null +++ b/skeleton/lib/Driver.php @@ -0,0 +1,66 @@ + + * @package Skeleton + */ +class Skeleton_Driver +{ + /** + * Array holding the current foo list. Each array entry is a hash + * describing a foo. The array is indexed by the IDs. + * + * @var array + */ + protected $_foos = array(); + + /** + * Attempts to return a concrete instance based on $driver. + * + * @param string $driver The type of the concrete subclass to return. + * The class name is based on the storage driver + * ($driver). The code is dynamically included. + * + * @param array $params A hash containing any additional configuration + * or connection parameters a subclass might need. + * + * @return Skeleton_Driver The newly created concrete instance. + * @throws Horde_Exception + */ + static public function factory($driver = null, $params = null) + { + if (is_null($driver)) { + $driver = $GLOBALS['conf']['storage']['driver']; + } + $driver = ucfirst(basename($driver)); + + if (is_null($params)) { + $params = Horde::getDriverConfig('storage', $driver); + } + + $class = 'Skeleton_Driver_' . $driver; + if (class_exists($class)) { + return new $class($params); + } + + throw new Horde_Exception('Could not find driver ' . $class); + } + + /** + * Lists all foos. + * + * @return array Returns a list of all foos. + */ + public function listFoos() + { + return $this->_foos; + } + +} diff --git a/skeleton/lib/Driver/Sql.php b/skeleton/lib/Driver/Sql.php new file mode 100644 index 000000000..30c772073 --- /dev/null +++ b/skeleton/lib/Driver/Sql.php @@ -0,0 +1,196 @@ + + * 'phptype' - The database type (e.g. 'pgsql', 'mysql', etc.). + * 'table' - The name of the foo table in 'database'. + * 'charset' - The database's internal charset. + * + * + * Required by some database implementations: + *
+ * 'database' - The name of the database.
+ * 'hostspec' - The hostname of the database server.
+ * 'protocol' - The communication protocol ('tcp', 'unix', etc.).
+ * 'username' - The username with which to connect to the database.
+ * 'password' - The password associated with 'username'.
+ * 'options' - Additional options to pass to the database.
+ * 'tty' - The TTY on which to connect to the database.
+ * 'port' - The port on which to connect to the database.
+ * 
+ * + * The table structure can be created by the scripts/sql/skeleton_foo.sql + * script. + * + * Copyright 2007-2009 The Horde Project (http://www.horde.org/) + * + * See the enclosed file COPYING for license information (GPL). If you + * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. + * + * @author Your Name + * @package Skeleton + */ +class Skeleton_Driver_Sql extends Skeleton_Driver +{ + /** + * Hash containing connection parameters. + * + * @var array + */ + protected $_params = array(); + + /** + * Handle for the current database connection. + * + * @var DB + */ + protected $_db; + + /** + * Handle for the current database connection, used for writing. Defaults + * to the same handle as $_db if a separate write database is not required. + * + * @var DB + */ + protected $_write_db; + + /** + * Boolean indicating whether or not we're connected to the SQL server. + * + * @var boolean + */ + protected $_connected = false; + + /** + * Constructs a new SQL storage object. + * + * @param array $params A hash containing connection parameters. + */ + public function __construct($params = array()) + { + $this->_params = $params; + } + + /** + * Retrieves the foos from the database. + */ + public function retrieve() + { + /* Make sure we have a valid database connection. */ + $this->_connect(); + + /* Build the SQL query. */ + $query = 'SELECT * FROM ' . $this->_params['table'] . ' WHERE foo = ?'; + $values = array($this->_params['bar']); + + /* Log the query at a DEBUG log level. */ + Horde::logMessage(sprintf('Skeleton_Driver_Sql::retrieve(): %s', $query), __FILE__, __LINE__, PEAR_LOG_DEBUG); + + /* Execute the query. */ + $result = $this->_db->query($query, $values); + + if (is_a($result instanceof PEAR_Error)) { + throw Horde_Exception($result); + } + + $row = $result->fetchRow(DB_FETCHMODE_ASSOC); + if ($row instanceof PEAR_Error) { + throw Horde_Exception($row); + } + + /* Store the retrieved values in the foo variable. */ + $this->_foo = array(); + while ($row && !($row instanceof PEAR_Error)) { + /* Add this new foo to the $_foo list. */ + $this->_foo[] = $row; + + /* Advance to the new row in the result set. */ + $row = $result->fetchRow(DB_FETCHMODE_ASSOC); + } + + $result->free(); + } + + /** + * Attempts to open a persistent connection to the SQL server. + * + * @throws Horde_Exception + */ + protected function _connect() + { + if ($this->_connected) { + return; + } + + Horde::assertDriverConfig($this->_params, 'storage', + array('phptype', 'charset', 'table')); + + if (!isset($this->_params['database'])) { + $this->_params['database'] = ''; + } + if (!isset($this->_params['username'])) { + $this->_params['username'] = ''; + } + if (!isset($this->_params['hostspec'])) { + $this->_params['hostspec'] = ''; + } + + /* Connect to the SQL server using the supplied parameters. */ + $this->_write_db = DB::connect($this->_params, + array('persistent' => !empty($this->_params['persistent']))); + if ($this->_write_db instanceof PEAR_Error) { + throw Horde_Exception($this->_write_db); + } + + // Set DB portability options. + switch ($this->_write_db->phptype) { + case 'mssql': + $this->_write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM); + break; + + default: + $this->_write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS); + } + + /* Check if we need to set up the read DB connection seperately. */ + if (!empty($this->_params['splitread'])) { + $params = array_merge($this->_params, $this->_params['read']); + $this->_db = DB::connect($params, + array('persistent' => !empty($params['persistent']))); + if ($this->_db instanceof PEAR_Error) { + throw Horde_Exception($this->_db); + } + + // Set DB portability options. + switch ($this->_db->phptype) { + case 'mssql': + $this->_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM); + break; + + default: + $this->_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS); + } + + } else { + /* Default to the same DB handle for the writer too. */ + $this->_db = $this->_write_db; + } + + $this->_connected = true; + } + + /** + * Disconnects from the SQL server and cleans up the connection. + */ + protected function _disconnect() + { + if ($this->_connected) { + $this->_connected = false; + $this->_db->disconnect(); + $this->_write_db->disconnect(); + } + } + +} diff --git a/skeleton/lib/Skeleton.php b/skeleton/lib/Skeleton.php new file mode 100644 index 000000000..dc76980bf --- /dev/null +++ b/skeleton/lib/Skeleton.php @@ -0,0 +1,26 @@ + + * @package Skeleton + */ +class Skeleton +{ + /** + * Build Skeleton's list of menu items. + */ + static public function getMenu($returnType = 'object') + { + $menu = new Horde_Menu(Horde_Menu::MASK_ALL); + $menu->add(Horde::applicationUrl('list.php'), _("List"), 'user.png', $GLOBALS['registry']->getImageDir('horde')); + + return ($returnType == 'object') ? $menu : $menu->render(); + } + +} diff --git a/skeleton/lib/base.load.php b/skeleton/lib/base.load.php new file mode 100644 index 000000000..f5486a01c --- /dev/null +++ b/skeleton/lib/base.load.php @@ -0,0 +1,28 @@ +pushApp('skeleton', array('check_perms' => true, 'logintasks' => true)); +} catch (Horde_Exception $e) { + Horde::authenticationFailureRedirect('skeleton', $e); +} + +$conf = &$GLOBALS['conf']; +@define('SKELETON_TEMPLATES', $registry->get('templates')); + +// Notification system. +$notification = Horde_Notification::singleton(); +$notification->attach('status'); + +// Start output compression. +Horde::compressOutput(); diff --git a/skeleton/lib/version.php b/skeleton/lib/version.php new file mode 100644 index 000000000..e1fddce7a --- /dev/null +++ b/skeleton/lib/version.php @@ -0,0 +1 @@ + diff --git a/skeleton/list.php b/skeleton/list.php new file mode 100644 index 000000000..a4a858188 --- /dev/null +++ b/skeleton/list.php @@ -0,0 +1,19 @@ + + */ + +require_once dirname(__FILE__) . '/lib/base.php'; + +$title = _("List"); + +require SKELETON_TEMPLATES . '/common-header.inc'; +require SKELETON_TEMPLATES . '/menu.inc'; +require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/skeleton/locale/en_US/help.xml b/skeleton/locale/en_US/help.xml new file mode 100644 index 000000000..04e9557ed --- /dev/null +++ b/skeleton/locale/en_US/help.xml @@ -0,0 +1,13 @@ + + + + + Skeleton Overview + + What is Skeleton? + Use this module as a blank base for Horde appliations. All of the + files in this module are to be used as examples. Please customize them + for your own application's requirements. + + + diff --git a/skeleton/po/README b/skeleton/po/README new file mode 100644 index 000000000..a985e94aa --- /dev/null +++ b/skeleton/po/README @@ -0,0 +1 @@ +see horde/po/README diff --git a/skeleton/templates/common-header.inc b/skeleton/templates/common-header.inc new file mode 100644 index 000000000..2b88a50a8 --- /dev/null +++ b/skeleton/templates/common-header.inc @@ -0,0 +1,26 @@ + + +' : '' ?> + +get('name'); +if (!empty($title)) $page_title .= ' :: ' . $title; +if (!empty($refresh_time) && ($refresh_time > 0) && !empty($refresh_url)) { + echo "\n"; +} + +Horde::includeScriptFiles(); + +?> +<?php echo htmlspecialchars($page_title) ?> + + + + +> diff --git a/skeleton/templates/menu.inc b/skeleton/templates/menu.inc new file mode 100644 index 000000000..72a144dd2 --- /dev/null +++ b/skeleton/templates/menu.inc @@ -0,0 +1,4 @@ + +notify(array('listeners' => 'status')) ?> diff --git a/skeleton/themes/screen.css b/skeleton/themes/screen.css new file mode 100644 index 000000000..9633a59d6 --- /dev/null +++ b/skeleton/themes/screen.css @@ -0,0 +1 @@ +/* Insert CSS definitions here. */ -- 2.11.0