pieforms-commit Mailing List for Pieforms (Page 10)
Status: Alpha
Brought to you by:
oracleshinoda
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(73) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(16) |
Feb
(19) |
Mar
(12) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(14) |
Sep
(2) |
Oct
(1) |
Nov
(2) |
Dec
(45) |
2008 |
Jan
(20) |
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(2) |
May
(1) |
Jun
(5) |
Jul
(1) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
(7) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ora...@us...> - 2006-12-15 01:30:15
|
Revision: 98 http://svn.sourceforge.net/pieforms/?rev=98&view=rev Author: oracleshinoda Date: 2006-12-14 17:30:15 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Fixed support for multiple submit buttons with their own function (Alastair Pharo) Modified Paths: -------------- pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2006-12-15 01:28:52 UTC (rev 97) +++ pieforms-php5/trunk/src/pieform.php 2006-12-15 01:30:15 UTC (rev 98) @@ -582,7 +582,7 @@ $submitted = false; foreach ($this->get_elements() as $element) { // @todo Rename 'ajaxmessages' to 'submitelement' - if (!empty($element['ajaxmessages']) == true && isset($values[$element['name']])) { + if (!empty($element['ajaxmessages']) == true && isset($global[$element['name']])) { $function = "{$this->name}_submit_{$element['name']}"; if (function_exists($function)) { $function($values); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-15 01:28:52
|
Revision: 97 http://svn.sourceforge.net/pieforms/?rev=97&view=rev Author: oracleshinoda Date: 2006-12-14 17:28:52 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Temporary fix for tabindex for expiry elements Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/expiry.php Modified: pieforms-php5/trunk/src/pieform/elements/expiry.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/expiry.php 2006-12-15 01:27:49 UTC (rev 96) +++ pieforms-php5/trunk/src/pieform/elements/expiry.php 2006-12-15 01:28:52 UTC (rev 97) @@ -62,13 +62,14 @@ } // @todo probably create with an actual input element, as tabindex doesn't work here for one thing + // Same with the select. And do the events using mochikit signal instead of dom events $numberinput = '<input'; $numberinput .= $values['units'] == 'noenddate' ? ' disabled="disabled"' : ''; $numberinput .= ' type="text" size="4" name="' . $name . '_number"'; - $numberinput .= ' id="' . $name . '_number" value="' . $values['number'] . "\">\n"; + $numberinput .= ' id="' . $name . '_number" value="' . $values['number'] . '" tabindex="' . $element['tabindex'] . "\">\n"; $uselect = '<select onchange="' . $name . '_change()" '; - $uselect .= 'name="' . $name . '_units" id="' . $name . '_units"' . ">\n"; + $uselect .= 'name="' . $name . '_units" id="' . $name . '_units"' . ' tabindex="' . $element['tabindex'] . "\">\n"; foreach (pieform_render_expire_get_expiry_units() as $u) { $uselect .= "\t<option value=\"$u\"" . (($values['units'] == $u) ? ' selected="selected"' : '') . '>' . $form->i18n($u) . "</option>\n"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-15 01:27:50
|
Revision: 96 http://svn.sourceforge.net/pieforms/?rev=96&view=rev Author: oracleshinoda Date: 2006-12-14 17:27:49 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Made the calendar element deal in unix timestamps (Martyn Smith) Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/calendar.php Modified: pieforms-php5/trunk/src/pieform/elements/calendar.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/calendar.php 2006-12-15 01:26:25 UTC (rev 95) +++ pieforms-php5/trunk/src/pieform/elements/calendar.php 2006-12-15 01:27:49 UTC (rev 96) @@ -38,7 +38,7 @@ $id = $form->get_name() . '_' . $element['name']; $result = '<input type="text"' . $form->element_attributes($element) - . ' value="' . Pieform::hsc($form->get_value($element)) . '">'; + . ' value="' . ( $form->get_value($element) ? Pieform::hsc(strftime($element['caloptions']['ifFormat'],$form->get_value($element))) : '' ) . '">'; if (isset($element['imagefile'])) { $result .= '<a href="" id="'. $id . '_btn" onclick="return false;" class="pieform-calendar-toggle">' . '<img src="' . $element['imagefile'] . '" alt=""></a>'; @@ -62,9 +62,8 @@ $element['jsroot'] = isset($element['jsroot']) ? $element['jsroot'] : ''; $element['language'] = isset($element['language']) ? $element['language'] : 'en'; $element['theme'] = isset($element['theme']) ? $element['theme'] : 'calendar-win2k-2'; - $element['caloptions']['ifFormat'] = '%Y/%m/%d'; - $element['caloptions']['daFormat'] = '%Y/%m/%d'; - $element['rules']['regex'] = '#^(\d{4}/\d{2}/\d{2})?$#'; + $element['caloptions']['ifFormat'] = isset($element['caloptions']['ifFormat']) ? $element['caloptions']['ifFormat'] : '%Y/%m/%d'; + $element['caloptions']['daFormat'] = isset($element['caloptions']['daFormat']) ? $element['caloptions']['daFormat'] : '%Y/%m/%d'; return $element; } @@ -91,7 +90,36 @@ return $result; } +function pieform_get_value_calendar($element, Pieform $form) { + $name = $element['name']; -// TODO: use the get_value function to do strtotime? (possibly, also might need the javascript version for ajax forms) + $global = ($form->get_method() == 'get') ? $_GET : $_POST; + if (isset($element['value'])) { + return $element['value']; + } + + if (isset($global[$name])) { + if (trim($global[$name]) == '') { + return null; + } + + $value = strtotime($global[$name]); + + if ($value === false) { + $form->set_error($name, 'TODO'); + return null; + } + return $value; + } + + if (isset($element['defaultvalue'])) { + return $element['defaultvalue']; + } + + return null; +} + +// TODO: (possibly, also might need the javascript version for ajax forms) + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-15 01:26:28
|
Revision: 95 http://svn.sourceforge.net/pieforms/?rev=95&view=rev Author: oracleshinoda Date: 2006-12-14 17:26:25 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Namespace the message element for ajax messages properly Modified Paths: -------------- pieforms-php5/trunk/src/pieform/renderers/table.php Modified: pieforms-php5/trunk/src/pieform/renderers/table.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/table.php 2006-12-15 01:25:45 UTC (rev 94) +++ pieforms-php5/trunk/src/pieform/renderers/table.php 2006-12-15 01:26:25 UTC (rev 95) @@ -129,17 +129,17 @@ }); } function {$id}_message(message, type) { - var elem = $('{$id}_message'); - var msg = TR({'id': '{$id}_message'}, TD({'colspan': 2, 'class': type}, message)); + var elem = $('{$id}_pieform_message'); + var msg = TR({'id': '{$id}_pieform_message'}, TD({'colspan': 2, 'class': type}, message)); if (elem) { swapDOM(elem, msg); } else { - appendChildNodes($('{$submitid}_container').parentNode, msg); + appendChildNodes($('{$id}_{$submitid}_container').parentNode, msg); } } function {$id}_remove_message() { - var elem = $('{$id}_message'); + var elem = $('{$id}_pieform_message'); if (elem) { removeElement(elem); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-15 01:25:46
|
Revision: 94 http://svn.sourceforge.net/pieforms/?rev=94&view=rev Author: oracleshinoda Date: 2006-12-14 17:25:45 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Namespace the renderer IDs properly Modified Paths: -------------- pieforms-php5/trunk/src/pieform/renderers/multicolumntable.php Modified: pieforms-php5/trunk/src/pieform/renderers/multicolumntable.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/multicolumntable.php 2006-12-15 01:25:13 UTC (rev 93) +++ pieforms-php5/trunk/src/pieform/renderers/multicolumntable.php 2006-12-15 01:25:45 UTC (rev 94) @@ -45,6 +45,7 @@ // Used by the messages javascript function $form->include_plugin('renderer', 'table'); $formrenderermct->add_element($builtelement, $rawelement); + $formrenderermct->set_form($form); } function pieform_renderer_multicolumntable_messages_js($id, $submitid) { @@ -64,6 +65,7 @@ class FormRendererMultiColumnTable { private $elements = array(); + private $form; function add_element($builtelement, $rawelement) { if (!array_key_exists($rawelement['title'], $this->elements)) { @@ -76,6 +78,10 @@ $this->elements[$rawelement['title']]['builtelements'][] = $builtelement; } + function set_form(Pieform $form) { + $this->form = $form; + } + function build() { $result = "<table cellspacing=\"0\" border=\"0\"><tbody>\n"; foreach ($this->elements as $title => $data) { @@ -96,7 +102,7 @@ $rawelement = $data['rawelements'][$k]; $result .= "\t<td"; if (isset($rawelement['name'])) { - $result .= " id=\"" . $rawelement['name'] . '_container"'; + $result .= " id=\"" . $this->form->get_name() . '_' . $rawelement['name'] . '_container"'; } if ($rawelement['class']) { $result .= ' class="' . $rawelement['class'] . '"'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-15 01:25:18
|
Revision: 93 http://svn.sourceforge.net/pieforms/?rev=93&view=rev Author: oracleshinoda Date: 2006-12-14 17:25:13 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Namespace the renderer IDs properly Modified Paths: -------------- pieforms-php5/trunk/src/pieform/renderers/oneline.php Modified: pieforms-php5/trunk/src/pieform/renderers/oneline.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/oneline.php 2006-12-10 11:06:17 UTC (rev 92) +++ pieforms-php5/trunk/src/pieform/renderers/oneline.php 2006-12-15 01:25:13 UTC (rev 93) @@ -43,10 +43,11 @@ * container. */ function pieform_renderer_oneline(Pieform $form, $builtelement, $rawelement) { + $formname = $form->get_name(); // Set the class of the enclosing <div> to match that of the element $result = '<span'; if (isset($rawelement['name'])) { - $result .= ' id="' . $rawelement['name'] . '_container"'; + $result .= ' id="' . $formname . '_' . $rawelement['name'] . '_container"'; } if ($rawelement['class']) { $result .= ' class="' . $rawelement['class'] . '"'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-10 11:06:22
|
Revision: 92 http://svn.sourceforge.net/pieforms/?rev=92&view=rev Author: oracleshinoda Date: 2006-12-10 03:06:17 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Added licensing information about the jscalendar Modified Paths: -------------- pieforms-php5/trunk/README Added Paths: ----------- pieforms-php5/trunk/src/js/jscalendar/COPYING Modified: pieforms-php5/trunk/README =================================================================== --- pieforms-php5/trunk/README 2006-12-10 11:00:43 UTC (rev 91) +++ pieforms-php5/trunk/README 2006-12-10 11:06:17 UTC (rev 92) @@ -65,6 +65,10 @@ functionality, if the json extension for PHP is not installed or enabled. Services_JSON is licensed under the BSD license. +Pieforms includes the free version of the dynarch javascript calendar, which +is required for the 'calendar' element to function properly. The calendar is +licensed under the LGPL. + [1] http://mochikit.com/ [2] http://pear.php.net/pepr/pepr-proposal-show.php?id=198 Added: pieforms-php5/trunk/src/js/jscalendar/COPYING =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/COPYING (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/COPYING 2006-12-10 11:06:17 UTC (rev 92) @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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 Library or any portion +of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +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 with +this License. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser 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 Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-10 11:00:52
|
Revision: 91 http://svn.sourceforge.net/pieforms/?rev=91&view=rev Author: oracleshinoda Date: 2006-12-10 03:00:43 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Added javascript for calendar Added Paths: ----------- pieforms-php5/trunk/src/js/jscalendar/ pieforms-php5/trunk/src/js/jscalendar/calendar-blue.css pieforms-php5/trunk/src/js/jscalendar/calendar-blue2.css pieforms-php5/trunk/src/js/jscalendar/calendar-brown.css pieforms-php5/trunk/src/js/jscalendar/calendar-green.css pieforms-php5/trunk/src/js/jscalendar/calendar-setup.js pieforms-php5/trunk/src/js/jscalendar/calendar-setup_stripped.js pieforms-php5/trunk/src/js/jscalendar/calendar-system.css pieforms-php5/trunk/src/js/jscalendar/calendar-tas.css pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-1.css pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-2.css pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-cold-1.css pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-cold-2.css pieforms-php5/trunk/src/js/jscalendar/calendar.js pieforms-php5/trunk/src/js/jscalendar/calendar_stripped.js pieforms-php5/trunk/src/js/jscalendar/img.gif pieforms-php5/trunk/src/js/jscalendar/lang/ pieforms-php5/trunk/src/js/jscalendar/lang/calendar-af.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-al.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-bg.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-big5-utf8.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-big5.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-br.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-ca.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-cs-utf8.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-cs-win.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-da.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-de.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-du.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-el.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-en.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-es.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-fi.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-fr.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-he-utf8.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-hr-utf8.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-hr.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-hu.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-it.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-jp.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-ko-utf8.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-ko.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-lt-utf8.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-lt.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-lv.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-nl.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-no.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-pl-utf8.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-pl.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-pt.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-ro.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-ru.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-ru_win_.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-si.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-sk.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-sp.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-sv.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-tr.js pieforms-php5/trunk/src/js/jscalendar/lang/calendar-zh.js pieforms-php5/trunk/src/js/jscalendar/lang/cn_utf8.js pieforms-php5/trunk/src/js/jscalendar/menuarrow.gif pieforms-php5/trunk/src/js/jscalendar/menuarrow2.gif pieforms-php5/trunk/src/js/jscalendar/skins/ pieforms-php5/trunk/src/js/jscalendar/skins/aqua/ pieforms-php5/trunk/src/js/jscalendar/skins/aqua/active-bg.gif pieforms-php5/trunk/src/js/jscalendar/skins/aqua/dark-bg.gif pieforms-php5/trunk/src/js/jscalendar/skins/aqua/hover-bg.gif pieforms-php5/trunk/src/js/jscalendar/skins/aqua/menuarrow.gif pieforms-php5/trunk/src/js/jscalendar/skins/aqua/normal-bg.gif pieforms-php5/trunk/src/js/jscalendar/skins/aqua/rowhover-bg.gif pieforms-php5/trunk/src/js/jscalendar/skins/aqua/status-bg.gif pieforms-php5/trunk/src/js/jscalendar/skins/aqua/theme.css pieforms-php5/trunk/src/js/jscalendar/skins/aqua/title-bg.gif pieforms-php5/trunk/src/js/jscalendar/skins/aqua/today-bg.gif Added: pieforms-php5/trunk/src/js/jscalendar/calendar-blue.css =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-blue.css (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-blue.css 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,232 @@ +/* The main calendar widget. DIV containing a table. */ + +div.calendar { position: relative; } + +.calendar, .calendar table { + border: 1px solid #556; + font-size: 11px; + color: #000; + cursor: default; + background: #eef; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ +} + +.calendar .nav { + background: #778 url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; /* Pressing it will take you to the current date */ + text-align: center; + background: #fff; + color: #000; + padding: 2px; +} + +.calendar thead .headrow { /* Row <TR> containing navigation buttons */ + background: #778; + color: #fff; +} + +.calendar thead .daynames { /* Row <TR> containing the day names */ + background: #bdf; +} + +.calendar thead .name { /* Cells <TD> containing the day names */ + border-bottom: 1px solid #556; + padding: 2px; + text-align: center; + color: #000; +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #a66; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + background-color: #aaf; + color: #000; + border: 1px solid #04f; + padding: 1px; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + background-color: #77c; + padding: 2px 0px 0px 2px; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells <TD> containing month days dates */ + width: 2em; + color: #456; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #bdf; +} + +.calendar tbody .rowhilite td { + background: #def; +} + +.calendar tbody .rowhilite td.wn { + background: #eef; +} + +.calendar tbody td.hilite { /* Hovered cells <TD> */ + background: #def; + padding: 1px 3px 1px 1px; + border: 1px solid #bbb; +} + +.calendar tbody td.active { /* Active (pressed) cells <TD> */ + background: #cde; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { /* Cell showing today date */ + font-weight: bold; + border: 1px solid #000; + padding: 1px 3px 1px 1px; + background: #fff; + color: #000; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #a66; +} + +.calendar tbody td.today { /* Cell showing selected date */ + font-weight: bold; + color: #00f; +} + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */ + text-align: center; + background: #556; + color: #fff; +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ + background: #fff; + color: #445; + border-top: 1px solid #556; + padding: 1px; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + background: #aaf; + border: 1px solid #04f; + color: #000; + padding: 1px; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + background: #77c; + padding: 2px 0px 0px 2px; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.calendar .combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + cursor: default; + border: 1px solid #655; + background: #def; + color: #000; + font-size: 90%; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .hilite { + background: #acf; +} + +.calendar .combo .active { + border-top: 1px solid #46a; + border-bottom: 1px solid #46a; + background: #eef; + font-weight: bold; +} + +.calendar td.time { + border-top: 1px solid #000; + padding: 1px 0px; + text-align: center; + background-color: #f4f0e8; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #889; + font-weight: bold; + background-color: #fff; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #667; + color: #fff; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} Added: pieforms-php5/trunk/src/js/jscalendar/calendar-blue2.css =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-blue2.css (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-blue2.css 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,236 @@ +/* The main calendar widget. DIV containing a table. */ + +div.calendar { position: relative; } + +.calendar, .calendar table { + border: 1px solid #206A9B; + font-size: 11px; + color: #000; + cursor: default; + background: #F1F8FC; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ +} + +.calendar .nav { + background: #007ED1 url(menuarrow2.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; /* Pressing it will take you to the current date */ + text-align: center; + background: #000; + color: #fff; + padding: 2px; +} + +.calendar thead tr { /* Row <TR> containing navigation buttons */ + background: #007ED1; + color: #fff; +} + +.calendar thead .daynames { /* Row <TR> containing the day names */ + background: #C7E1F3; +} + +.calendar thead .name { /* Cells <TD> containing the day names */ + border-bottom: 1px solid #206A9B; + padding: 2px; + text-align: center; + color: #000; +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #a66; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + background-color: #34ABFA; + color: #000; + border: 1px solid #016DC5; + padding: 1px; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + background-color: #006AA9; + border: 1px solid #008AFF; + padding: 2px 0px 0px 2px; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells <TD> containing month days dates */ + width: 2em; + color: #456; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #C7E1F3; +} + +.calendar tbody .rowhilite td { + background: #def; +} + +.calendar tbody .rowhilite td.wn { + background: #F1F8FC; +} + +.calendar tbody td.hilite { /* Hovered cells <TD> */ + background: #def; + padding: 1px 3px 1px 1px; + border: 1px solid #8FC4E8; +} + +.calendar tbody td.active { /* Active (pressed) cells <TD> */ + background: #cde; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { /* Cell showing today date */ + font-weight: bold; + border: 1px solid #000; + padding: 1px 3px 1px 1px; + background: #fff; + color: #000; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #a66; +} + +.calendar tbody td.today { /* Cell showing selected date */ + font-weight: bold; + color: #D50000; +} + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */ + text-align: center; + background: #206A9B; + color: #fff; +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ + background: #000; + color: #fff; + border-top: 1px solid #206A9B; + padding: 1px; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + background: #B8DAF0; + border: 1px solid #178AEB; + color: #000; + padding: 1px; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + background: #006AA9; + padding: 2px 0px 0px 2px; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.calendar .combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + cursor: default; + border: 1px solid #655; + background: #def; + color: #000; + font-size: 90%; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .hilite { + background: #34ABFA; + border-top: 1px solid #46a; + border-bottom: 1px solid #46a; + font-weight: bold; +} + +.calendar .combo .active { + border-top: 1px solid #46a; + border-bottom: 1px solid #46a; + background: #F1F8FC; + font-weight: bold; +} + +.calendar td.time { + border-top: 1px solid #000; + padding: 1px 0px; + text-align: center; + background-color: #E3F0F9; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #889; + font-weight: bold; + background-color: #F1F8FC; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #267DB7; + color: #fff; +} + +.calendar td.time span.active { + border-color: red; + background-color: #000; + color: #A5FF00; +} Added: pieforms-php5/trunk/src/js/jscalendar/calendar-brown.css =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-brown.css (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-brown.css 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,225 @@ +/* The main calendar widget. DIV containing a table. */ + +div.calendar { position: relative; } + +.calendar, .calendar table { + border: 1px solid #655; + font-size: 11px; + color: #000; + cursor: default; + background: #ffd; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ +} + +.calendar .nav { + background: #edc url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; /* Pressing it will take you to the current date */ + text-align: center; + background: #654; + color: #fed; + padding: 2px; +} + +.calendar thead .headrow { /* Row <TR> containing navigation buttons */ + background: #edc; + color: #000; +} + +.calendar thead .name { /* Cells <TD> containing the day names */ + border-bottom: 1px solid #655; + padding: 2px; + text-align: center; + color: #000; +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #f00; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + background-color: #faa; + color: #000; + border: 1px solid #f40; + padding: 1px; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + background-color: #c77; + padding: 2px 0px 0px 2px; +} + +.calendar thead .daynames { /* Row <TR> containing the day names */ + background: #fed; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells <TD> containing month days dates */ + width: 2em; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #fed; +} + +.calendar tbody .rowhilite td { + background: #ddf; +} + +.calendar tbody .rowhilite td.wn { + background: #efe; +} + +.calendar tbody td.hilite { /* Hovered cells <TD> */ + background: #ffe; + padding: 1px 3px 1px 1px; + border: 1px solid #bbb; +} + +.calendar tbody td.active { /* Active (pressed) cells <TD> */ + background: #ddc; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { /* Cell showing today date */ + font-weight: bold; + border: 1px solid #000; + padding: 1px 3px 1px 1px; + background: #fea; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #f00; +} + +.calendar tbody td.today { font-weight: bold; } + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */ + text-align: center; + background: #988; + color: #000; +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ + border-top: 1px solid #655; + background: #dcb; + color: #840; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + background: #faa; + border: 1px solid #f40; + padding: 1px; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + background: #c77; + padding: 2px 0px 0px 2px; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.calendar .combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + cursor: default; + border: 1px solid #655; + background: #ffe; + color: #000; + font-size: 90%; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .hilite { + background: #fc8; +} + +.calendar .combo .active { + border-top: 1px solid #a64; + border-bottom: 1px solid #a64; + background: #fee; + font-weight: bold; +} + +.calendar td.time { + border-top: 1px solid #a88; + padding: 1px 0px; + text-align: center; + background-color: #fed; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #988; + font-weight: bold; + background-color: #fff; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #866; + color: #fff; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} Added: pieforms-php5/trunk/src/js/jscalendar/calendar-green.css =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-green.css (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-green.css 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,229 @@ +/* The main calendar widget. DIV containing a table. */ + +div.calendar { position: relative; } + +.calendar, .calendar table { + border: 1px solid #565; + font-size: 11px; + color: #000; + cursor: default; + background: #efe; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ + background: #676; + color: #fff; + font-size: 90%; +} + +.calendar .nav { + background: #676 url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; /* Pressing it will take you to the current date */ + text-align: center; + padding: 2px; + background: #250; + color: #efa; +} + +.calendar thead .headrow { /* Row <TR> containing navigation buttons */ +} + +.calendar thead .name { /* Cells <TD> containing the day names */ + border-bottom: 1px solid #565; + padding: 2px; + text-align: center; + color: #000; +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #a66; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + background-color: #afa; + color: #000; + border: 1px solid #084; + padding: 1px; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + background-color: #7c7; + padding: 2px 0px 0px 2px; +} + +.calendar thead .daynames { /* Row <TR> containing the day names */ + background: #dfb; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells <TD> containing month days dates */ + width: 2em; + color: #564; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #8a8; + background: #dfb; +} + +.calendar tbody .rowhilite td { + background: #dfd; +} + +.calendar tbody .rowhilite td.wn { + background: #efe; +} + +.calendar tbody td.hilite { /* Hovered cells <TD> */ + background: #efd; + padding: 1px 3px 1px 1px; + border: 1px solid #bbb; +} + +.calendar tbody td.active { /* Active (pressed) cells <TD> */ + background: #dec; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { /* Cell showing today date */ + font-weight: bold; + border: 1px solid #000; + padding: 1px 3px 1px 1px; + background: #f8fff8; + color: #000; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #a66; +} + +.calendar tbody td.today { font-weight: bold; color: #0a0; } + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */ + text-align: center; + background: #565; + color: #fff; +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ + padding: 2px; + background: #250; + color: #efa; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + background: #afa; + border: 1px solid #084; + color: #000; + padding: 1px; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + background: #7c7; + padding: 2px 0px 0px 2px; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.calendar .combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + cursor: default; + border: 1px solid #565; + background: #efd; + color: #000; + font-size: 90%; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .hilite { + background: #af8; +} + +.calendar .combo .active { + border-top: 1px solid #6a4; + border-bottom: 1px solid #6a4; + background: #efe; + font-weight: bold; +} + +.calendar td.time { + border-top: 1px solid #8a8; + padding: 1px 0px; + text-align: center; + background-color: #dfb; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #898; + font-weight: bold; + background-color: #fff; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #686; + color: #fff; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} Added: pieforms-php5/trunk/src/js/jscalendar/calendar-setup.js =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-setup.js (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-setup.js 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,200 @@ +/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ + * --------------------------------------------------------------------------- + * + * The DHTML Calendar + * + * Details and latest version at: + * http://dynarch.com/mishoo/calendar.epl + * + * This script is distributed under the GNU Lesser General Public License. + * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html + * + * This file defines helper functions for setting up the calendar. They are + * intended to help non-programmers get a working calendar on their site + * quickly. This script should not be seen as part of the calendar. It just + * shows you what one can do with the calendar, while in the same time + * providing a quick and simple method for setting it up. If you need + * exhaustive customization of the calendar creation process feel free to + * modify this code to suit your needs (this is recommended and much better + * than modifying calendar.js itself). + */ + +// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $ + +/** + * This function "patches" an input field (or other element) to use a calendar + * widget for date selection. + * + * The "params" is a single object that can have the following properties: + * + * prop. name | description + * ------------------------------------------------------------------------------------------------- + * inputField | the ID of an input field to store the date + * displayArea | the ID of a DIV or other element to show the date + * button | ID of a button or other element that will trigger the calendar + * eventName | event that will trigger the calendar, without the "on" prefix (default: "click") + * ifFormat | date format that will be stored in the input field + * daFormat | the date format that will be used to display the date in displayArea + * singleClick | (true/false) wether the calendar is in single click mode or not (default: true) + * firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc. + * align | alignment (default: "Br"); if you don't know what's this see the calendar documentation + * range | array with 2 elements. Default: [1900, 2999] -- the range of years available + * weekNumbers | (true/false) if it's true (default) the calendar will display week numbers + * flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID + * flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar) + * disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar + * onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay) + * onClose | function that gets called when the calendar is closed. [default] + * onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar. + * date | the date that the calendar will be initially displayed to + * showsTime | default: false; if true the calendar will include a time selector + * timeFormat | the time format; can be "12" or "24", default is "12" + * electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close + * step | configures the step of the years in drop-down boxes; default: 2 + * position | configures the calendar absolute position; default: null + * cache | if "true" (but default: "false") it will reuse the same calendar object, where possible + * showOthers | if "true" (but default: "false") it will show days from other months too + * + * None of them is required, they all have default values. However, if you + * pass none of "inputField", "displayArea" or "button" you'll get a warning + * saying "nothing to setup". + */ +Calendar.setup = function (params) { + function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; + + param_default("inputField", null); + param_default("displayArea", null); + param_default("button", null); + param_default("eventName", "click"); + param_default("ifFormat", "%Y/%m/%d"); + param_default("daFormat", "%Y/%m/%d"); + param_default("singleClick", true); + param_default("disableFunc", null); + param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined + param_default("dateText", null); + param_default("firstDay", null); + param_default("align", "Br"); + param_default("range", [1900, 2999]); + param_default("weekNumbers", true); + param_default("flat", null); + param_default("flatCallback", null); + param_default("onSelect", null); + param_default("onClose", null); + param_default("onUpdate", null); + param_default("date", null); + param_default("showsTime", false); + param_default("timeFormat", "24"); + param_default("electric", true); + param_default("step", 2); + param_default("position", null); + param_default("cache", false); + param_default("showOthers", false); + param_default("multiple", null); + + var tmp = ["inputField", "displayArea", "button"]; + for (var i in tmp) { + if (typeof params[tmp[i]] == "string") { + params[tmp[i]] = document.getElementById(params[tmp[i]]); + } + } + if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { + alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); + return false; + } + + function onSelect(cal) { + var p = cal.params; + var update = (cal.dateClicked || p.electric); + if (update && p.inputField) { + p.inputField.value = cal.date.print(p.ifFormat); + if (typeof p.inputField.onchange == "function") + p.inputField.onchange(); + } + if (update && p.displayArea) + p.displayArea.innerHTML = cal.date.print(p.daFormat); + if (update && typeof p.onUpdate == "function") + p.onUpdate(cal); + if (update && p.flat) { + if (typeof p.flatCallback == "function") + p.flatCallback(cal); + } + if (update && p.singleClick && cal.dateClicked) + cal.callCloseHandler(); + }; + + if (params.flat != null) { + if (typeof params.flat == "string") + params.flat = document.getElementById(params.flat); + if (!params.flat) { + alert("Calendar.setup:\n Flat specified but can't find parent."); + return false; + } + var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); + cal.showsOtherMonths = params.showOthers; + cal.showsTime = params.showsTime; + cal.time24 = (params.timeFormat == "24"); + cal.params = params; + cal.weekNumbers = params.weekNumbers; + cal.setRange(params.range[0], params.range[1]); + cal.setDateStatusHandler(params.dateStatusFunc); + cal.getDateText = params.dateText; + if (params.ifFormat) { + cal.setDateFormat(params.ifFormat); + } + if (params.inputField && typeof params.inputField.value == "string") { + cal.parseDate(params.inputField.value); + } + cal.create(params.flat); + cal.show(); + return false; + } + + var triggerEl = params.button || params.displayArea || params.inputField; + triggerEl["on" + params.eventName] = function() { + var dateEl = params.inputField || params.displayArea; + var dateFmt = params.inputField ? params.ifFormat : params.daFormat; + var mustCreate = false; + var cal = window.calendar; + if (dateEl) + params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); + if (!(cal && params.cache)) { + window.calendar = cal = new Calendar(params.firstDay, + params.date, + params.onSelect || onSelect, + params.onClose || function(cal) { cal.hide(); }); + cal.showsTime = params.showsTime; + cal.time24 = (params.timeFormat == "24"); + cal.weekNumbers = params.weekNumbers; + mustCreate = true; + } else { + if (params.date) + cal.setDate(params.date); + cal.hide(); + } + if (params.multiple) { + cal.multiple = {}; + for (var i = params.multiple.length; --i >= 0;) { + var d = params.multiple[i]; + var ds = d.print("%Y%m%d"); + cal.multiple[ds] = d; + } + } + cal.showsOtherMonths = params.showOthers; + cal.yearStep = params.step; + cal.setRange(params.range[0], params.range[1]); + cal.params = params; + cal.setDateStatusHandler(params.dateStatusFunc); + cal.getDateText = params.dateText; + cal.setDateFormat(dateFmt); + if (mustCreate) + cal.create(); + cal.refresh(); + if (!params.position) + cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); + else + cal.showAt(params.position[0], params.position[1]); + return false; + }; + + return cal; +}; Added: pieforms-php5/trunk/src/js/jscalendar/calendar-setup_stripped.js =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-setup_stripped.js (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-setup_stripped.js 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,21 @@ +/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ + * --------------------------------------------------------------------------- + * + * The DHTML Calendar + * + * Details and latest version at: + * http://dynarch.com/mishoo/calendar.epl + * + * This script is distributed under the GNU Lesser General Public License. + * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html + * + * This file defines helper functions for setting up the calendar. They are + * intended to help non-programmers get a working calendar on their site + * quickly. This script should not be seen as part of the calendar. It just + * shows you what one can do with the calendar, while in the same time + * providing a quick and simple method for setting it up. If you need + * exhaustive customization of the calendar creation process feel free to + * modify this code to suit your needs (this is recommended and much better + * than modifying calendar.js itself). + */ + Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&¶ms.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;}; \ No newline at end of file Added: pieforms-php5/trunk/src/js/jscalendar/calendar-system.css =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-system.css (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-system.css 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,251 @@ +/* The main calendar widget. DIV containing a table. */ + +.calendar { + position: relative; + display: none; + border: 1px solid; + border-color: #fff #000 #000 #fff; + font-size: 11px; + cursor: default; + background: Window; + color: WindowText; + font-family: tahoma,verdana,sans-serif; +} + +.calendar table { + border: 1px solid; + border-color: #fff #000 #000 #fff; + font-size: 11px; + cursor: default; + background: Window; + color: WindowText; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; + padding: 1px; + border: 1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; + background: ButtonFace; +} + +.calendar .nav { + background: ButtonFace url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; + padding: 1px; + border: 1px solid #000; + background: ActiveCaption; + color: CaptionText; + text-align: center; +} + +.calendar thead .headrow { /* Row <TR> containing navigation buttons */ +} + +.calendar thead .daynames { /* Row <TR> containing the day names */ +} + +.calendar thead .name { /* Cells <TD> containing the day names */ + border-bottom: 1px solid ButtonShadow; + padding: 2px; + text-align: center; + background: ButtonFace; + color: ButtonText; +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #f00; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + border: 2px solid; + padding: 0px; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + border-width: 1px; + padding: 2px 0px 0px 2px; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells <TD> containing month days dates */ + width: 2em; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid ButtonShadow; + background: ButtonFace; + color: ButtonText; +} + +.calendar tbody .rowhilite td { + background: Highlight; + color: HighlightText; +} + +.calendar tbody td.hilite { /* Hovered cells <TD> */ + padding: 1px 3px 1px 1px; + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; +} + +.calendar tbody td.active { /* Active (pressed) cells <TD> */ + padding: 2px 2px 0px 2px; + border: 1px solid; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; +} + +.calendar tbody td.selected { /* Cell showing selected date */ + font-weight: bold; + border: 1px solid; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; + padding: 2px 2px 0px 2px; + background: ButtonFace; + color: ButtonText; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #f00; +} + +.calendar tbody td.today { /* Cell showing today date */ + font-weight: bold; + color: #00f; +} + +.calendar tbody td.disabled { color: GrayText; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */ +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ + background: ButtonFace; + padding: 1px; + border: 1px solid; + border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; + color: ButtonText; + text-align: center; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; + padding: 1px; + background: #e4e0d8; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + padding: 2px 0px 0px 2px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.calendar .combo { + position: absolute; + display: none; + width: 4em; + top: 0px; + left: 0px; + cursor: default; + border: 1px solid; + border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; + background: Menu; + color: MenuText; + font-size: 90%; + padding: 1px; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .active { + padding: 0px; + border: 1px solid #000; +} + +.calendar .combo .hilite { + background: Highlight; + color: HighlightText; +} + +.calendar td.time { + border-top: 1px solid ButtonShadow; + padding: 1px 0px; + text-align: center; + background-color: ButtonFace; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #889; + font-weight: bold; + background-color: Menu; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: Highlight; + color: HighlightText; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} Added: pieforms-php5/trunk/src/js/jscalendar/calendar-tas.css =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-tas.css (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-tas.css 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,239 @@ +/* The main calendar widget. DIV containing a table. */ + +div.calendar { position: relative; } + +.calendar, .calendar table { + border: 1px solid #655; + font-size: 11px; + color: #000; + cursor: default; + background: #ffd; + font-family: tahoma,verdana,sans-serif; + filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#DDDCCC,EndColorStr=#FFFFFF); +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ + color:#363636; +} + +.calendar .nav { + background: #edc url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; /* Pressing it will take you to the current date */ + text-align: center; + background: #654; + color: #363636; + padding: 2px; + filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff,EndColorStr=#dddccc); +} + +.calendar thead .headrow { /* Row <TR> containing navigation buttons */ + /*background: #3B86A0;*/ + color: #363636; + font-weight: bold; +filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff,EndColorStr=#3b86a0); +} + +.calendar thead .name { /* Cells <TD> containing the day names */ + border-bottom: 1px solid #655; + padding: 2px; + text-align: center; + color: #363636; + filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#DDDCCC,EndColorStr=#FFFFFF); +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #f00; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + background-color: #ffcc86; + color: #000; + border: 1px solid #b59345; + padding: 1px; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + background-color: #c77; + padding: 2px 0px 0px 2px; +} + +.calendar thead .daynames { /* Row <TR> containing the day names */ + background: #fed; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells <TD> containing month days dates */ + width: 2em; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #fed; +} + +.calendar tbody .rowhilite td { + background: #ddf; + +} + +.calendar tbody .rowhilite td.wn { + background: #efe; +} + +.calendar tbody td.hilite { /* Hovered cells <TD> */ + background: #ffe; + padding: 1px 3px 1px 1px; + border: 1px solid #bbb; +} + +.calendar tbody td.active { /* Active (pressed) cells <TD> */ + background: #ddc; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { /* Cell showing today date */ + font-weight: bold; + border: 1px solid #000; + padding: 1px 3px 1px 1px; + background: #fea; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #f00; +} + +.calendar tbody td.today { font-weight: bold; } + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */ + text-align: center; + background: #988; + color: #000; + +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ + border-top: 1px solid #655; + background: #dcb; + color: #363636; + font-weight: bold; + filter: +progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#FFFFFF,EndColorStr=#DDDCCC); +} +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + background: #faa; + border: 1px solid #f40; + padding: 1px; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + background: #c77; + padding: 2px 0px 0px 2px; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + cursor: default; + border: 1px solid #655; + background: #ffe; + color: #000; + font-size: smaller; + z-index: 100; +} + +.combo .label, +.combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.combo .label-IEfix { + width: 4em; +} + +.combo .hilite { + background: #fc8; +} + +.combo .active { + border-top: 1px solid #a64; + border-bottom: 1px solid #a64; + background: #fee; + font-weight: bold; +} + +.calendar td.time { + border-top: 1px solid #a88; + padding: 1px 0px; + text-align: center; + background-color: #fed; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #988; + font-weight: bold; + background-color: #fff; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #866; + color: #fff; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} Added: pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-1.css =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-1.css (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-1.css 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,271 @@ +/* The main calendar widget. DIV containing a table. */ + +.calendar { + position: relative; + display: none; + border-top: 2px solid #fff; + border-right: 2px solid #000; + border-bottom: 2px solid #000; + border-left: 2px solid #fff; + font-size: 11px; + color: #000; + cursor: default; + background: #d4d0c8; + font-family: tahoma,verdana,sans-serif; +} + +.calendar table { + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; + font-size: 11px; + color: #000; + cursor: default; + background: #d4d0c8; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; + padding: 1px; + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; +} + +.calendar .nav { + background: transparent url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; + padding: 1px; + border: 1px solid #000; + background: #848078; + color: #fff; + text-align: center; +} + +.calendar thead .headrow { /* Row <TR> containing navigation buttons */ +} + +.calendar thead .daynames { /* Row <TR> containing the day names */ +} + +.calendar thead .name { /* Cells <TD> containing the day names */ + border-bottom: 1px solid #000; + padding: 2px; + text-align: center; + background: #f4f0e8; +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #f00; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + border-top: 2px solid #fff; + border-right: 2px solid #000; + border-bottom: 2px solid #000; + border-left: 2px solid #fff; + padding: 0px; + background-color: #e4e0d8; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + padding: 2px 0px 0px 2px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; + background-color: #c4c0b8; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells <TD> containing month days dates */ + width: 2em; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #f4f0e8; +} + +.calendar tbody .rowhilite td { + background: #e4e0d8; +} + +.calendar tbody .rowhilite td.wn { + background: #d4d0c8; +} + +.calendar tbody td.hilite { /* Hovered cells <TD> */ + padding: 1px 3px 1px 1px; + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; +} + +.calendar tbody td.active { /* Active (pressed) cells <TD> */ + padding: 2px 2px 0px 2px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +.calendar tbody td.selected { /* Cell showing selected date */ + font-weight: bold; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; + padding: 2px 2px 0px 2px; + background: #e4e0d8; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #f00; +} + +.calendar tbody td.today { /* Cell showing today date */ + font-weight: bold; + color: #00f; +} + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */ +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ + background: #f4f0e8; + padding: 1px; + border: 1px solid #000; + background: #848078; + color: #fff; + text-align: center; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; + padding: 1px; + background: #e4e0d8; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + padding: 2px 0px 0px 2px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.calendar .combo { + position: absolute; + display: none; + width: 4em; + top: 0px; + left: 0px; + cursor: default; + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; + background: #e4e0d8; + font-size: 90%; + padding: 1px; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .active { + background: #c4c0b8; + padding: 0px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +.calendar .combo .hilite { + background: #048; + color: #fea; +} + +.calendar td.time { + border-top: 1px solid #000; + padding: 1px 0px; + text-align: center; + background-color: #f4f0e8; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #889; + font-weight: bold; + background-color: #fff; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #766; + color: #fff; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} Added: pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-2.css =================================================================== --- pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-2.css (rev 0) +++ pieforms-php5/trunk/src/js/jscalendar/calendar-win2k-2.css 2006-12-10 11:00:43 UTC (rev 91) @@ -0,0 +1,271 @@ +/* The main calendar widget. DIV containing a table. */ + +.calendar { + position: relative; + display: none; + border-top: 2px solid #fff; + border-right: 2px solid #000; + border-bottom: 2px solid #000; + border-left: 2px solid #fff; + font-size: 11px; + color: #000; + cursor: default; + background: #d4c8d0; + font-family: tahoma,verdana,sans-serif; +} + +.calendar table { + border-top: 1px solid #000; + border-rig... [truncated message content] |
From: <ora...@us...> - 2006-12-10 10:59:29
|
Revision: 90 http://svn.sourceforge.net/pieforms/?rev=90&view=rev Author: oracleshinoda Date: 2006-12-10 02:59:26 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Allowed each element to specify a function that returns an array of HTML items that should be used to set the object up. Useful for calendar/wysiwyg. Also allowed the user to define a function to configure the default form of any element type. Modified Paths: -------------- pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2006-12-10 10:57:41 UTC (rev 89) +++ pieforms-php5/trunk/src/pieform.php 2006-12-10 10:59:26 UTC (rev 90) @@ -24,6 +24,8 @@ * */ +$GLOBALS['_PIEFORM_REGISTRY'] = array(); + /** * Builds, validates and processes a form. * @@ -310,6 +312,8 @@ * @param array $data The form description hash */ public function __construct($data) { + $GLOBALS['_PIEFORM_REGISTRY'][] = $this; + if (!isset($data['name']) || !preg_match('/^[a-z_][a-z0-9_]*$/', $data['name'])) { throw new PieformException('Forms must have a name, and that name must be valid (validity test: could you give a PHP function the name?)'); } @@ -489,6 +493,16 @@ // Let each element set and override attributes if necessary if ($subelement['type'] != 'markup') { + // This function can be defined by the application using Pieforms, + // and applies to all elements of this type + $function = 'pieform_configure_' . $subelement['type']; + if (function_exists($function)) { + $subelement = $function($subelement); + } + + // This function is defined by the plugin itself, to set fields on + // the element that need to be set but should not be set by the + // application $function = 'pieform_render_' . $subelement['type'] . '_set_attributes'; $this->include_plugin('element', $subelement['type']); if (function_exists($function)) { @@ -512,10 +526,12 @@ // Let each element set and override attributes if necessary if ($element['type'] != 'markup') { + $function = 'pieform_configure_' . $element['type']; + if (function_exists($function)) { + $element = $function($element); + } + $function = 'pieform_render_' . $element['type'] . '_set_attributes'; - // @todo here, all elements are loaded that will be used, so no - // need to include files for them later (like in pieform_render_element) - // Also, don't use require_once so nicer errors can be thrown $this->include_plugin('element', $element['type']); if (function_exists($function)) { $element = $function($element); @@ -1332,4 +1348,19 @@ return $rendererfunction($form, $builtelement, $element); } +function pieform_get_headdata() { + $htmlelements = array(); + foreach ($GLOBALS['_PIEFORM_REGISTRY'] as $form) { + foreach ($form->get_elements() as $element) { + $function = 'pieform_get_headdata_' . $element['type']; + if (function_exists($function)) { + $elems = $function($element); + $htmlelements = array_merge($htmlelements, $elems); + } + } + } + + return array_unique($htmlelements); +} + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-10 10:57:42
|
Revision: 89 http://svn.sourceforge.net/pieforms/?rev=89&view=rev Author: oracleshinoda Date: 2006-12-10 02:57:41 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Fixed HTML validity when using 'disabled' attribute. Added a couple of TODO items Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/date.php Modified: pieforms-php5/trunk/src/pieform/elements/date.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/date.php 2006-12-10 10:56:51 UTC (rev 88) +++ pieforms-php5/trunk/src/pieform/elements/date.php 2006-12-10 10:57:41 UTC (rev 89) @@ -42,7 +42,7 @@ // Year $value = pieform_render_select_get_value('year', $element['minyear'], $element['maxyear'], $element, $form); - $year = '<select name="' . $name . '_year" id="' . $name . '_year"' . (isset($element['optional']) && !isset($element['defaultvalue']) ? 'disabled ' : '') . ">\n"; + $year = '<select name="' . $name . '_year" id="' . $name . '_year"' . (isset($element['optional']) && !isset($element['defaultvalue']) ? ' disabled="disabled"' : '') . ">\n"; for ($i = $element['minyear']; $i <= $element['maxyear']; $i++) { $year .= "\t<option value=\"$i\"" . (($value == $i) ? ' selected="selected"' : '') . ">$i</option>\n"; } @@ -50,7 +50,7 @@ // Month $value = pieform_render_select_get_value('month', 1, 12, $element, $form); - $month = '<select name="' . $name . '_month" id="' . $name . '_month"' . (isset($element['optional']) && !isset($element['defaultvalue']) ? 'disabled ' : '') . ">\n"; + $month = '<select name="' . $name . '_month" id="' . $name . '_month"' . (isset($element['optional']) && !isset($element['defaultvalue']) ? ' disabled="disabled"' : '') . ">\n"; for ($i = 1; $i <= 12; $i++) { $month .= "\t<option value=\"$i\"" . (($value == $i) ? ' selected="selected"' : '') . '>' . date('M', strtotime("2000-$i-01")) . "</option>\n"; } @@ -58,7 +58,7 @@ // Day $value = pieform_render_select_get_value('day', 1, 31, $element, $form); - $day = '<select name="' . $name . '_day" id="' . $name . '_day"' . (isset($element['optional']) && !isset($element['defaultvalue']) ? 'disabled ' : '') . ">\n"; + $day = '<select name="' . $name . '_day" id="' . $name . '_day"' . (isset($element['optional']) && !isset($element['defaultvalue']) ? ' disabled="disabled"' : '') . ">\n"; for ($i = 1; $i <= 31; $i++) { $day .= "\t<option value=\"$i\"" . (($value == $i) ? ' selected="selected"' : '') . ">$i</option>\n"; } @@ -84,7 +84,9 @@ } </script> EOF; - + // @todo this needs cleaning up, namely: + // - get_string is a mahara-ism + // - 'optional' => true should be 'required' => false shouldn't it? $optional .= ' ' . get_string('or') . ' <input type="checkbox" ' . ( isset($element['defaultvalue']) ? '' : 'checked ') . 'name="' . $name . '_optional" id="' . $name . '_optional" onchange="' . $name . '_toggle(this)">'; $optional .= ' <label for="' . $name . '_optional">' . get_string('notspecified'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-10 10:56:55
|
Revision: 88 http://svn.sourceforge.net/pieforms/?rev=88&view=rev Author: oracleshinoda Date: 2006-12-10 02:56:51 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Fixed label for radio elements Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/radio.php Modified: pieforms-php5/trunk/src/pieform/elements/radio.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/radio.php 2006-12-10 10:54:31 UTC (rev 87) +++ pieforms-php5/trunk/src/pieform/elements/radio.php 2006-12-10 10:56:51 UTC (rev 88) @@ -52,7 +52,7 @@ . $form->element_attributes($element) . ' value="' . Pieform::hsc($value) . '"' . (($form_value == $value) ? ' checked="checked"' : '') - . "> <label for=\"$uid\">" . Pieform::hsc($text) . "</label>$separator"; + . '> <label for="' . $form->get_name() . '_' . $uid . '">' . Pieform::hsc($text) . "</label>$separator"; } $result = substr($result, 0, -strlen($separator)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-10 10:54:35
|
Revision: 87 http://svn.sourceforge.net/pieforms/?rev=87&view=rev Author: oracleshinoda Date: 2006-12-10 02:54:31 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Calendar element. Provides a date/time picker using a javascript calendar Added Paths: ----------- pieforms-php5/trunk/src/pieform/elements/calendar.php Added: pieforms-php5/trunk/src/pieform/elements/calendar.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/calendar.php (rev 0) +++ pieforms-php5/trunk/src/pieform/elements/calendar.php 2006-12-10 10:54:31 UTC (rev 87) @@ -0,0 +1,97 @@ +<?php +/** + * This program is part of Pieforms + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * @package pieform + * @subpackage element + * @author Nigel McNie <ni...@ca...> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz + * + */ + +/** + * Provides a javascript calendar for inputting a date. + * + * General documentation about the calendar is available at + * http://www.dynarch.com/demos/jscalendar/doc/html/reference.html + * + * @param array $element The element to render + * @param Pieform $form The form to render the element for + * @return string The HTML for the element + */ +function pieform_render_calendar($element, Pieform $form) { + $id = $form->get_name() . '_' . $element['name']; + $result = '<input type="text"' + . $form->element_attributes($element) + . ' value="' . Pieform::hsc($form->get_value($element)) . '">'; + if (isset($element['imagefile'])) { + $result .= '<a href="" id="'. $id . '_btn" onclick="return false;" class="pieform-calendar-toggle">' + . '<img src="' . $element['imagefile'] . '" alt=""></a>'; + } + else { + $result .= '<input type="button" id="' . $id . '_btn" onclick="return false;" class="pieform-calendar-toggle" value="...">'; + } + + $options = array_merge($element['caloptions'], array('inputField' => $id, 'button' => $id . '_btn')); + + $encodedoptions = json_encode($options); + // Some options are callbacks and need their quoting removed + foreach (array('dateStatusFunc', 'flatCallback', 'onSelect', 'onClose', 'onUpdate') as $function) { + $encodedoptions = preg_replace('/("' . $function . '"):"([a-zA-Z0-9$]+)"/', '\1:\2', $encodedoptions); + } + $result .= '<script type="text/javascript">Calendar.setup(' . $encodedoptions . ');</script>'; + return $result; +} + +function pieform_render_calendar_set_attributes($element) { + $element['jsroot'] = isset($element['jsroot']) ? $element['jsroot'] : ''; + $element['language'] = isset($element['language']) ? $element['language'] : 'en'; + $element['theme'] = isset($element['theme']) ? $element['theme'] : 'calendar-win2k-2'; + $element['caloptions']['ifFormat'] = '%Y/%m/%d'; + $element['caloptions']['daFormat'] = '%Y/%m/%d'; + $element['rules']['regex'] = '#^(\d{4}/\d{2}/\d{2})?$#'; + return $element; +} + +/** Returns code to go in <head> for all instances of calendar */ +function pieform_get_headdata_calendar($element) { + if (isset($element['themefile'])) { + $themefile = $element['themefile']; + } + else if (isset($element['theme'])) { + $themefile = $element['jsroot'] . $element['theme'] . '.css'; + } + else { + throw new PieformException('No theme chosen for calendar "' . $element['name'] . '": please set themefile or theme'); + } + $libfile = $element['jsroot'] . 'calendar_stripped.js'; + $langfile = $element['jsroot'] . 'lang/calendar-' . $element['language'] . '.js'; + $setupfile = $element['jsroot'] . 'calendar-setup_stripped.js'; + $result = array( + '<link rel="stylesheet" type="text/css" media="all" href="' . $themefile . '">', + '<script type="text/javascript" src="' . $libfile . '"></script>', + '<script type="text/javascript" src="' . $langfile . '"></script>', + '<script type="text/javascript" src="' . $setupfile . '"></script>' + ); + return $result; +} + + +// TODO: use the get_value function to do strtotime? (possibly, also might need the javascript version for ajax forms) + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-08 02:12:46
|
Revision: 86 http://svn.sourceforge.net/pieforms/?rev=86&view=rev Author: oracleshinoda Date: 2006-12-07 18:12:45 -0800 (Thu, 07 Dec 2006) Log Message: ----------- Removed wysiwyg element, it will come back as 'tinymce' element at some point Removed Paths: ------------- pieforms-php5/trunk/src/pieform/elements/wysiwyg.php Deleted: pieforms-php5/trunk/src/pieform/elements/wysiwyg.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/wysiwyg.php 2006-12-08 02:11:55 UTC (rev 85) +++ pieforms-php5/trunk/src/pieform/elements/wysiwyg.php 2006-12-08 02:12:45 UTC (rev 86) @@ -1,77 +0,0 @@ -<?php -/** - * This program is part of Pieforms - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * @package pieform - * @subpackage element - * @author Nigel McNie <ni...@ca...> - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL - * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz - * - */ - -/** - * Renders a textarea, but with extra javascript to turn it into a wysigyw - * textarea. - * - * Currently this is just a mirror of the textarea element, but it will change - * a bit later. - * - * @param array $element The element to render - * @param Pieform $form The form to render the element for - * @return string The HTML for the element - */ -function pieform_render_wysiwyg($element, Pieform $form) { - $rows = $cols = $style = ''; - if (isset($element['height'])) { - $style .= 'height:' . $element['height'] . ';'; - $rows = (intval($element['height'] > 0)) ? ceil(intval($element['height']) / 10) : 1; - } - elseif (isset($element['rows'])) { - $rows = $element['rows']; - } - else { - log_warn('No value for rows or height specified for textarea ' . $element['name']); - } - - if (isset($element['width'])) { - $style .= 'width:' . $element['width'] . ';'; - $cols = (intval($element['width'] > 0)) ? ceil(intval($element['width']) / 10) : 1; - } - elseif (isset($element['cols'])) { - $cols = $element['cols']; - } - else { - log_warn('No value for cols or width specified for textarea ' . $element['name']); - } - $element['style'] = (isset($element['style'])) ? $style . $element['style'] : $style; - return '<textarea' - . (($rows) ? ' rows="' . $rows . '"' : '') - . (($cols) ? ' cols="' . $cols . '"' : '') - . $form->element_attributes($element, array('maxlength', 'size')) - . '>' . Pieform::hsc($form->get_value($element)) . '</textarea>'; -} - -/** - * @todo document: basically, the required rule now works better, as stripping - * tags out takes away a whole bunch of hidden stuff - */ -function pieform_is_empty_wysiwyg($value, $element) { - return strip_tags($value) === ''; -} - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-08 02:11:56
|
Revision: 85 http://svn.sourceforge.net/pieforms/?rev=85&view=rev Author: oracleshinoda Date: 2006-12-07 18:11:55 -0800 (Thu, 07 Dec 2006) Log Message: ----------- Standardised how plugins are included Modified Paths: -------------- pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2006-12-08 02:09:46 UTC (rev 84) +++ pieforms-php5/trunk/src/pieform.php 2006-12-08 02:11:55 UTC (rev 85) @@ -72,7 +72,6 @@ // - Collapsible js for fieldsets // - Grippie for textareas // - javascript validation - // - handle multiple submit buttons // - handle multipage forms? // - handle a tabbed interface type of form? // @@ -203,6 +202,13 @@ private $tabindex = 1; /** + * Directories to look for elements, renderers and rules + * + * @var array + */ + private $configdirs = array(); + + /** * Whether to autofocus fields in this form, and if so, optionally which * field to focus. * @@ -332,11 +338,12 @@ 'postajaxsubmitcallback' => '', 'ajaxsuccessfunction' => '', 'ajaxfailurefunction' => '', - 'autofocus' => false, - 'language' => 'en.utf8', - 'validate' => true, - 'submit' => true, - 'elements' => array(), + 'configdirs' => array(), + 'autofocus' => false, + 'language' => 'en.utf8', + 'validate' => true, + 'submit' => true, + 'elements' => array(), 'submitfunction' => '', 'validatefunction' => '', ); @@ -348,12 +355,15 @@ if ($data['method'] != 'post') { $data['method'] = 'get'; } - $this->method = $data['method']; - $this->action = $data['action']; - $this->validate = $data['validate']; - $this->submit = $data['submit']; - $this->autofocus = $data['autofocus']; - $this->language = $data['language']; + $this->method = $data['method']; + $this->action = $data['action']; + $this->validate = $data['validate']; + $this->submit = $data['submit']; + $this->configdirs = array_map( + create_function('$a', 'return substr($a, -1) == "/" ? substr($a, 0, -1) : $a;'), + (array) $data['configdirs']); + $this->autofocus = $data['autofocus']; + $this->language = $data['language']; if ($data['submitfunction']) { $this->submitfunction = $data['submitfunction']; @@ -480,7 +490,7 @@ // Let each element set and override attributes if necessary if ($subelement['type'] != 'markup') { $function = 'pieform_render_' . $subelement['type'] . '_set_attributes'; - require_once('pieform/elements/' . $subelement['type'] . '.php'); + $this->include_plugin('element', $subelement['type']); if (function_exists($function)) { $subelement = $function($subelement); } @@ -506,7 +516,7 @@ // @todo here, all elements are loaded that will be used, so no // need to include files for them later (like in pieform_render_element) // Also, don't use require_once so nicer errors can be thrown - require_once('pieform/elements/' . $element['type'] . '.php'); + $this->include_plugin('element', $element['type']); if (function_exists($function)) { $element = $function($element); } @@ -683,7 +693,7 @@ $result .= ">\n"; // @todo masks attempts in pieform_render_element, including the error handling there - @include_once('pieform/renderers/' . $this->renderer . '.php'); + $this->include_plugin('renderer', $this->renderer); // Form header $function = 'pieform_renderer_' . $this->renderer . '_header'; @@ -705,7 +715,7 @@ } // Hidden elements - require_once('pieform/elements/hidden.php'); + $this->include_plugin('element', 'hidden'); foreach ($this->get_elements() as $element) { if ($element['type'] == 'hidden') { $result .= pieform_render_hidden($element, $this); @@ -737,9 +747,6 @@ */ public function get_value($element) { $function = 'pieform_get_value_' . $element['type']; - if (!function_exists($function)) { - @include_once('pieform/elements/' . $element['type'] . '.php'); - } // @todo for consistency, reverse parameter order - always a Form object first if (function_exists($function)) { return $function($element, $this); @@ -843,7 +850,7 @@ // Get the rule $function = 'pieform_rule_' . $rule; if (!function_exists($function)) { - @include_once('pieform/rules/' . $rule . '.php'); + $this->include_plugin('rule', $rule); if (!function_exists($function)) { throw new PieformException('No such form rule "' . $rule . '"'); } @@ -963,7 +970,7 @@ $js_messages_function = 'pieform_renderer_' . $this->renderer . '_messages_js'; if (!function_exists($js_messages_function)) { - @include_once('pieform/renderers/' . $this->renderer . '.php'); + $this->include_plugin('renderer', $this->renderer); if (!function_exists($js_messages_function)) { throw new PieformException('No renderer message function "' . $js_messages_function . '"'); } @@ -1146,6 +1153,37 @@ } /** + * Includes a plugin file, checking any configured plugin directories. + * + * @param string $type The type of plugin to include: 'element', 'renderer' or 'rule' + * @param string $name The name of the plugin to include + * @throws PieformException If the given type or plugin could not be found + */ + public function include_plugin($type, $name) { + if (!in_array($type, array('element', 'renderer', 'rule'))) { + throw new PieformException("The type \"$type\" is not allowed for an include plugin"); + } + + // Check the configured include paths if they are specified + foreach ($this->configdirs as $directory) { + $file = "$directory/{$type}s/$name.php"; + if (is_readable($file)) { + include_once($file); + return; + } + } + + // Check the default include path + $file = dirname(__FILE__) . "/pieform/{$type}s/{$name}.php"; + if (is_readable($file)) { + include_once($file); + return; + } + + throw new PieformException("Could not find $type \"$name\""); + } + + /** * Return an internationalised string based on the passed input key * * Returns english by default. @@ -1272,7 +1310,7 @@ if ($renderer = $form->get_renderer()) { $rendererfunction = 'pieform_renderer_' . $renderer; if (!function_exists($rendererfunction)) { - include('pieform/renderers/' . $renderer . '.php'); + $form->include_plugin('pieform/renderers/' . $renderer . '.php'); if (!function_exists($rendererfunction)) { throw new PieformException('No such form renderer: "' . $renderer . '"'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-08 02:09:53
|
Revision: 84 http://svn.sourceforge.net/pieforms/?rev=84&view=rev Author: oracleshinoda Date: 2006-12-07 18:09:46 -0800 (Thu, 07 Dec 2006) Log Message: ----------- Standardised how plugins are included Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/submitcancel.php pieforms-php5/trunk/src/pieform/renderers/multicolumntable.php Modified: pieforms-php5/trunk/src/pieform/elements/submitcancel.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/submitcancel.php 2006-12-07 05:43:30 UTC (rev 83) +++ pieforms-php5/trunk/src/pieform/elements/submitcancel.php 2006-12-08 02:09:46 UTC (rev 84) @@ -32,8 +32,8 @@ * @return string The HTML for the element */ function pieform_render_submitcancel($element, Pieform $form) { - require_once('submit.php'); - require_once('cancel.php'); + $form->include_plugin('element', 'submit'); + $form->include_plugin('element', 'cancel'); $submitelement = $element; $submitelement['value'] = $element['value'][0]; $cancelelement = $element; Modified: pieforms-php5/trunk/src/pieform/renderers/multicolumntable.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/multicolumntable.php 2006-12-07 05:43:30 UTC (rev 83) +++ pieforms-php5/trunk/src/pieform/renderers/multicolumntable.php 2006-12-08 02:09:46 UTC (rev 84) @@ -27,7 +27,6 @@ // @todo this renderer needs to take into account potentially being called more // than once in the same PHP script (clobbering of the $formrenderermct variable). // Also, not sure what 'static $var' does in global scope... -require_once(dirname(__FILE__) . '/table.php'); static $formrenderermct; /** @@ -43,6 +42,8 @@ */ function pieform_renderer_multicolumntable(Pieform $form, $builtelement, $rawelement) { global $formrenderermct; + // Used by the messages javascript function + $form->include_plugin('renderer', 'table'); $formrenderermct->add_element($builtelement, $rawelement); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-07 05:49:42
|
Revision: 83 http://svn.sourceforge.net/pieforms/?rev=83&view=rev Author: oracleshinoda Date: 2006-12-06 21:43:30 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Did one of the TODO items - use MochiKit's connect() to handle the form submission. Made sure that elements have their 'id' attribute have the form name put on the front, so more than one form can be used on the same page successfully. Modified Paths: -------------- pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2006-12-07 05:41:51 UTC (rev 82) +++ pieforms-php5/trunk/src/pieform.php 2006-12-07 05:43:30 UTC (rev 83) @@ -66,7 +66,6 @@ // // - more form element types (inc. types like autocomplete and date picker and wyswiyg) // - support processing of data before validation occurs (e.g. trim(), strtoupper()) - // - do onsubmit for ajax stuff by mochikit connect() // - Basic validation is possible as there's a callback function for checking, // but some helper functions could be written to make people's job validating // stuff much easier (form_validate_email, form_validate_date etc). @@ -328,7 +327,6 @@ $formdefaults = array( 'method' => 'get', 'action' => '', - 'onsubmit' => '', 'ajaxpost' => false, 'preajaxsubmitcallback' => '', 'postajaxsubmitcallback' => '', @@ -354,7 +352,6 @@ $this->action = $data['action']; $this->validate = $data['validate']; $this->submit = $data['submit']; - $this->onsubmit = $data['onsubmit']; $this->autofocus = $data['autofocus']; $this->language = $data['language']; @@ -683,9 +680,6 @@ if ($this->fileupload) { $result .= ' enctype="multipart/form-data"'; } - if ($this->ajaxpost) { - $result .= ' onsubmit="' . $this->name . '_submit(); return false;"'; - } $result .= ">\n"; // @todo masks attempts in pieform_render_element, including the error handling there @@ -871,7 +865,8 @@ private function submit_js() { // @todo nigel should disable all buttons on this form while the submit is happening $result = <<<EOF -function {$this->name}_submit() { + +connect($('{$this->name}'), 'onsubmit', function (e) { // eventually we should check input types for wysiwyg before doing this // Also should only save wysiwyg elements in the form, not all of them... if (typeof(tinyMCE) != 'undefined') { tinyMCE.triggerSave(); } @@ -961,8 +956,8 @@ $result .= <<<EOF }); {$this->name}_message('{$strprocessingform}', 'info'); - return false; -} + e.stop(); +}); EOF; @@ -1110,12 +1105,15 @@ * @param array $exclude Any attributes to explicitly exclude from adding * @return string The attributes for the element */ - public static function element_attributes($element, $exclude=array()) { + public function element_attributes($element, $exclude=array()) { static $attributes = array('accesskey', 'class', 'dir', 'id', 'lang', 'name', 'onclick', 'size', 'style', 'tabindex'); $elementattributes = array_diff($attributes, $exclude); $result = ''; foreach ($elementattributes as $attribute) { if (isset($element[$attribute]) && $element[$attribute] !== '') { + if ($attribute == 'id') { + $element[$attribute] = $this->name . '_' . $element[$attribute]; + } $result .= ' ' . $attribute . '="' . self::hsc($element[$attribute]) . '"'; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-07 05:49:04
|
Revision: 82 http://svn.sourceforge.net/pieforms/?rev=82&view=rev Author: oracleshinoda Date: 2006-12-06 21:41:51 -0800 (Wed, 06 Dec 2006) Log Message: ----------- The element_attributes method is now part of the class instead of static, so it can add it's own name to the ID for an element Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/cancel.php pieforms-php5/trunk/src/pieform/elements/checkbox.php pieforms-php5/trunk/src/pieform/elements/image.php pieforms-php5/trunk/src/pieform/elements/text.php Modified: pieforms-php5/trunk/src/pieform/elements/cancel.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/cancel.php 2006-12-07 05:39:15 UTC (rev 81) +++ pieforms-php5/trunk/src/pieform/elements/cancel.php 2006-12-07 05:41:51 UTC (rev 82) @@ -38,7 +38,7 @@ throw new PieformException('Cancel elements must have a value'); } - $attributes = Pieform::element_attributes($element); + $attributes = $form->element_attributes($element); $attributes = preg_replace('/name="(.*)"/', 'name="cancel_$1"', $attributes); $attributes = preg_replace('/id="(.*)"/', 'id="cancel_$1"', $attributes); return '<input type="submit"' Modified: pieforms-php5/trunk/src/pieform/elements/checkbox.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/checkbox.php 2006-12-07 05:39:15 UTC (rev 81) +++ pieforms-php5/trunk/src/pieform/elements/checkbox.php 2006-12-07 05:41:51 UTC (rev 82) @@ -46,7 +46,7 @@ } return '<input type="checkbox"' - . Pieform::element_attributes($element) + . $form->element_attributes($element) . ($checked ? ' checked="checked"' : '') . '>'; } Modified: pieforms-php5/trunk/src/pieform/elements/image.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/image.php 2006-12-07 05:39:15 UTC (rev 81) +++ pieforms-php5/trunk/src/pieform/elements/image.php 2006-12-07 05:41:51 UTC (rev 82) @@ -33,7 +33,7 @@ */ function pieform_render_image($element, Pieform $form) { return '<input type="image" src="' . Pieform::hsc($element['src']) . '"' - . Pieform::element_attributes($element) + . $form->element_attributes($element) . ' value="' . Pieform::hsc($form->get_value($element)) . '">'; } Modified: pieforms-php5/trunk/src/pieform/elements/text.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/text.php 2006-12-07 05:39:15 UTC (rev 81) +++ pieforms-php5/trunk/src/pieform/elements/text.php 2006-12-07 05:41:51 UTC (rev 82) @@ -33,7 +33,7 @@ */ function pieform_render_text($element, $form) { return '<input type="text"' - . Pieform::element_attributes($element) + . $form->element_attributes($element) . ' value="' . Pieform::hsc($form->get_value($element)) . '">'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-07 05:45:58
|
Revision: 81 http://svn.sourceforge.net/pieforms/?rev=81&view=rev Author: oracleshinoda Date: 2006-12-06 21:39:15 -0800 (Wed, 06 Dec 2006) Log Message: ----------- The element_attributes method is now part of the class instead of static, so it can add it's own name to the ID for an element Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/button.php pieforms-php5/trunk/src/pieform/elements/file.php pieforms-php5/trunk/src/pieform/elements/select.php pieforms-php5/trunk/src/pieform/elements/submit.php pieforms-php5/trunk/src/pieform/elements/textarea.php pieforms-php5/trunk/src/pieform/elements/wysiwyg.php Modified: pieforms-php5/trunk/src/pieform/elements/button.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/button.php 2006-12-07 05:36:09 UTC (rev 80) +++ pieforms-php5/trunk/src/pieform/elements/button.php 2006-12-07 05:39:15 UTC (rev 81) @@ -38,7 +38,7 @@ throw new PieformException('Button elements must have a value'); } return '<input type="button"' - . Pieform::element_attributes($element) + . $form->element_attributes($element) . ' value="' . Pieform::hsc($element['value']) . '">'; } Modified: pieforms-php5/trunk/src/pieform/elements/file.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/file.php 2006-12-07 05:36:09 UTC (rev 80) +++ pieforms-php5/trunk/src/pieform/elements/file.php 2006-12-07 05:39:15 UTC (rev 81) @@ -33,7 +33,7 @@ */ function pieform_render_file($element, Pieform $form) { return '<input type="file"' - . Pieform::element_attributes($element) . '>'; + . $form->element_attributes($element) . '>'; } function pieform_get_value_file($element, Pieform $form) { Modified: pieforms-php5/trunk/src/pieform/elements/select.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/select.php 2006-12-07 05:36:09 UTC (rev 80) +++ pieforms-php5/trunk/src/pieform/elements/select.php 2006-12-07 05:39:15 UTC (rev 81) @@ -44,7 +44,7 @@ } $result = '<select' - . Pieform::element_attributes($element) + . $form->element_attributes($element) . (!empty($element['multiple']) ? ' multiple="multiple"' : '') . ">\n"; if (!isset($element['options']) || !is_array($element['options']) || count($element['options']) < 1) { Modified: pieforms-php5/trunk/src/pieform/elements/submit.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/submit.php 2006-12-07 05:36:09 UTC (rev 80) +++ pieforms-php5/trunk/src/pieform/elements/submit.php 2006-12-07 05:39:15 UTC (rev 81) @@ -33,7 +33,7 @@ */ function pieform_render_submit($element, Pieform $form) { return '<input type="submit"' - . Pieform::element_attributes($element) + . $form->element_attributes($element) . ' value="' . Pieform::hsc($form->get_value($element)) . '">'; } Modified: pieforms-php5/trunk/src/pieform/elements/textarea.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/textarea.php 2006-12-07 05:36:09 UTC (rev 80) +++ pieforms-php5/trunk/src/pieform/elements/textarea.php 2006-12-07 05:39:15 UTC (rev 81) @@ -58,7 +58,7 @@ return '<textarea' . (($rows) ? ' rows="' . $rows . '"' : '') . (($cols) ? ' cols="' . $cols . '"' : '') - . Pieform::element_attributes($element, array('maxlength', 'size')) + . $form->element_attributes($element, array('maxlength', 'size')) . '>' . Pieform::hsc($form->get_value($element)) . '</textarea>'; } Modified: pieforms-php5/trunk/src/pieform/elements/wysiwyg.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/wysiwyg.php 2006-12-07 05:36:09 UTC (rev 80) +++ pieforms-php5/trunk/src/pieform/elements/wysiwyg.php 2006-12-07 05:39:15 UTC (rev 81) @@ -62,7 +62,7 @@ return '<textarea' . (($rows) ? ' rows="' . $rows . '"' : '') . (($cols) ? ' cols="' . $cols . '"' : '') - . Pieform::element_attributes($element, array('maxlength', 'size')) + . $form->element_attributes($element, array('maxlength', 'size')) . '>' . Pieform::hsc($form->get_value($element)) . '</textarea>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-07 05:45:33
|
Revision: 80 http://svn.sourceforge.net/pieforms/?rev=80&view=rev Author: oracleshinoda Date: 2006-12-06 21:36:09 -0800 (Wed, 06 Dec 2006) Log Message: ----------- The element_attributes method is now part of the class instead of static, so it can add it's own name to the ID for an element Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/password.php Modified: pieforms-php5/trunk/src/pieform/elements/password.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/password.php 2006-12-07 05:34:36 UTC (rev 79) +++ pieforms-php5/trunk/src/pieform/elements/password.php 2006-12-07 05:36:09 UTC (rev 80) @@ -33,7 +33,7 @@ */ function pieform_render_password($element, Pieform $form) { return '<input type="password"' - . Pieform::element_attributes($element) + . $form->element_attributes($element) . ' value="' . Pieform::hsc($form->get_value($element)) . '">'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-07 05:34:45
|
Revision: 79 http://svn.sourceforge.net/pieforms/?rev=79&view=rev Author: oracleshinoda Date: 2006-12-06 21:34:36 -0800 (Wed, 06 Dec 2006) Log Message: ----------- The element_attributes method is now part of the class instead of static, so it can add it's own name to the ID for an element Modified Paths: -------------- pieforms-php5/trunk/src/pieform/elements/hidden.php pieforms-php5/trunk/src/pieform/elements/radio.php Modified: pieforms-php5/trunk/src/pieform/elements/hidden.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/hidden.php 2006-12-07 05:32:18 UTC (rev 78) +++ pieforms-php5/trunk/src/pieform/elements/hidden.php 2006-12-07 05:34:36 UTC (rev 79) @@ -32,8 +32,6 @@ * @return string The HTML for the element */ function pieform_render_hidden($element, Pieform $form) { - // @todo use the exclude parameter of element_attributes for this - unset($element['tabindex']); $value = $form->get_value($element); if (is_array($value)) { $result = ''; @@ -44,7 +42,7 @@ return $result; } return '<input type="hidden"' - . Pieform::element_attributes($element) + . $form->element_attributes($element, array('accesskey', 'onclick', 'size', 'style', 'tabindex')) . ' value="' . Pieform::hsc($form->get_value($element)) . "\">\n"; } Modified: pieforms-php5/trunk/src/pieform/elements/radio.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/radio.php 2006-12-07 05:32:18 UTC (rev 78) +++ pieforms-php5/trunk/src/pieform/elements/radio.php 2006-12-07 05:34:36 UTC (rev 79) @@ -49,7 +49,7 @@ $uid = $id . substr(md5(microtime()), 0, 4); $element['id'] = $uid; $result .= '<input type="radio"' - . Pieform::element_attributes($element) + . $form->element_attributes($element) . ' value="' . Pieform::hsc($value) . '"' . (($form_value == $value) ? ' checked="checked"' : '') . "> <label for=\"$uid\">" . Pieform::hsc($text) . "</label>$separator"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-07 05:32:27
|
Revision: 78 http://svn.sourceforge.net/pieforms/?rev=78&view=rev Author: oracleshinoda Date: 2006-12-06 21:32:18 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Make each element have their ID prefixed by the form name, which is safer when more than one form is on a page Modified Paths: -------------- pieforms-php5/trunk/src/pieform/renderers/div.php pieforms-php5/trunk/src/pieform/renderers/table.php Modified: pieforms-php5/trunk/src/pieform/renderers/div.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/div.php 2006-12-06 22:02:27 UTC (rev 77) +++ pieforms-php5/trunk/src/pieform/renderers/div.php 2006-12-07 05:32:18 UTC (rev 78) @@ -35,10 +35,11 @@ * container. */ function pieform_renderer_div(Pieform $form, $builtelement, $rawelement) { + $formname = $form->get_name(); // Set the class of the enclosing <div> to match that of the element $result = '<div'; if (isset($rawelement['name'])) { - $result .= ' id="' . $rawelement['name'] . '_container"'; + $result .= ' id="' . $formname . '_' . $rawelement['name'] . '_container"'; } if ($rawelement['class']) { $result .= ' class="' . $rawelement['class'] . '"'; @@ -51,7 +52,7 @@ $result .= Pieform::hsc($rawelement['title']); } else { - $result .= '<label for="' . $rawelement['id'] . '">' . Pieform::hsc($rawelement['title']) . '</label>'; + $result .= '<label for="' . $formname . '_' . $rawelement['id'] . '">' . Pieform::hsc($rawelement['title']) . '</label>'; } } Modified: pieforms-php5/trunk/src/pieform/renderers/table.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/table.php 2006-12-06 22:02:27 UTC (rev 77) +++ pieforms-php5/trunk/src/pieform/renderers/table.php 2006-12-07 05:32:18 UTC (rev 78) @@ -35,6 +35,7 @@ * container. */ function pieform_renderer_table(Pieform $form, $builtelement, $rawelement) { + $formname = $form->get_name(); if ($rawelement['type'] == 'fieldset') { // Add table tags to the build element, to preserve HTML compliance if (0 === strpos($builtelement, "\n<fieldset>\n<legend>")) { @@ -53,7 +54,7 @@ } $result = "\t<tr"; - $result .= ' id="' . $rawelement['name'] . '_container"'; + $result .= ' id="' . $formname . '_' . $rawelement['name'] . '_container"'; // Set the class of the enclosing <tr> to match that of the element if ($rawelement['class']) { $result .= ' class="' . $rawelement['class'] . '"'; @@ -67,7 +68,7 @@ $result .= Pieform::hsc($rawelement['title']); } else { - $result .= '<label for="' . $rawelement['id'] . '">' . Pieform::hsc($rawelement['title']) . '</label>'; + $result .= '<label for="' . $formname . '_' . $rawelement['id'] . '">' . Pieform::hsc($rawelement['title']) . '</label>'; } } $result .= "</th>\n\t\t<td>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-06 22:02:33
|
Revision: 77 http://svn.sourceforge.net/pieforms/?rev=77&view=rev Author: oracleshinoda Date: 2006-12-06 14:02:27 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Added an image element, for input type='image' buttons. Added Paths: ----------- pieforms-php5/trunk/src/pieform/elements/image.php Added: pieforms-php5/trunk/src/pieform/elements/image.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/image.php (rev 0) +++ pieforms-php5/trunk/src/pieform/elements/image.php 2006-12-06 22:02:27 UTC (rev 77) @@ -0,0 +1,45 @@ +<?php +/** + * This program is part of Pieforms + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * @package pieform + * @subpackage element + * @author Nigel McNie <ni...@ca...> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz + * + */ + +/** + * Renders an <input type="image"> button + * + * @param array $element The element to render + * @param Pieform $form The form to render the element for + * @return string The HTML for the element + */ +function pieform_render_image($element, Pieform $form) { + return '<input type="image" src="' . Pieform::hsc($element['src']) . '"' + . Pieform::element_attributes($element) + . ' value="' . Pieform::hsc($form->get_value($element)) . '">'; +} + +function pieform_render_image_set_attributes($element) { + $element['ajaxmessages'] = true; + return $element; +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-06 22:01:32
|
Revision: 76 http://svn.sourceforge.net/pieforms/?rev=76&view=rev Author: oracleshinoda Date: 2006-12-06 14:01:14 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Added a 'oneline' renderer - renders each element in a span. No error reporting or contextual help though Modified Paths: -------------- pieforms-php5/trunk/src/pieform/renderers/div.php Added Paths: ----------- pieforms-php5/trunk/src/pieform/renderers/oneline.php Modified: pieforms-php5/trunk/src/pieform/renderers/div.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/div.php 2006-12-06 09:21:00 UTC (rev 75) +++ pieforms-php5/trunk/src/pieform/renderers/div.php 2006-12-06 22:01:14 UTC (rev 76) @@ -76,7 +76,7 @@ return $result; } -function pieform_renderer_table_messages_js($id, $submitid) { +function pieform_renderer_div_messages_js($id, $submitid) { $result = <<<EOF // Given a message and form element name, should set an error on the element function {$id}_set_error(message, element) { Added: pieforms-php5/trunk/src/pieform/renderers/oneline.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/oneline.php (rev 0) +++ pieforms-php5/trunk/src/pieform/renderers/oneline.php 2006-12-06 22:01:14 UTC (rev 76) @@ -0,0 +1,72 @@ +<?php +/** + * This program is part of Pieforms + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * @package pieform + * @subpackage renderer + * @author Nigel McNie <ni...@ca...> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz + * + */ + +function pieform_renderer_oneline_header() { + return '<div>'; +} + +function pieform_renderer_oneline_footer() { + return '</div>'; +} + +/** + * Renders form elements all on one line. + * + * @param Pieform $form The form the element is being rendered for + * @param string $builtelement The element, already built + * @param array $rawelement The element in raw form, for looking up + * information about it. + * @return string The element rendered inside an appropriate + * container. + */ +function pieform_renderer_oneline(Pieform $form, $builtelement, $rawelement) { + // Set the class of the enclosing <div> to match that of the element + $result = '<span'; + if (isset($rawelement['name'])) { + $result .= ' id="' . $rawelement['name'] . '_container"'; + } + if ($rawelement['class']) { + $result .= ' class="' . $rawelement['class'] . '"'; + } + $result .= '>'; + + if (isset($rawelement['title']) && $rawelement['title'] !== '' && $rawelement['type'] != 'fieldset') { + if (!empty($rawelement['nolabel'])) { + // Don't bother with a label for the element + $result .= Pieform::hsc($rawelement['title']); + } + else { + $result .= '<label for="' . $rawelement['id'] . '">' . Pieform::hsc($rawelement['title']) . '</label>'; + } + } + + $result .= $builtelement; + + $result .= "</span>"; + return $result; +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-06 09:21:07
|
Revision: 75 http://svn.sourceforge.net/pieforms/?rev=75&view=rev Author: oracleshinoda Date: 2006-12-06 01:21:00 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Honour 'required' => false correctly (Alastair Pharo) Modified Paths: -------------- pieforms-php5/trunk/src/pieform/rules/required.php Modified: pieforms-php5/trunk/src/pieform/rules/required.php =================================================================== --- pieforms-php5/trunk/src/pieform/rules/required.php 2006-12-01 01:04:30 UTC (rev 74) +++ pieforms-php5/trunk/src/pieform/rules/required.php 2006-12-06 09:21:00 UTC (rev 75) @@ -27,23 +27,26 @@ /** * Checks whether the field has been specified. * - * @param Pieform $form The form the rule is being applied to - * @param string $field The field to check - * @param array $element The element to check + * @param Pieform $form The form the rule is being applied to + * @param string $field The field to check + * @param array $element The element to check + * @param string $check Whether to check the element * @return string The error message, if the value is invalid. */ -function pieform_rule_required(Pieform $form, $value, $element) { - $function = 'form_is_empty_' . $element['type']; - if (function_exists($function)) { - if ($function($value, $element)) { +function pieform_rule_required(Pieform $form, $value, $element, $check) { + if ($check) { + $function = 'form_is_empty_' . $element['type']; + if (function_exists($function)) { + if ($function($value, $element)) { + return $form->i18n('required'); + } + return; + } + + if ($value == '') { return $form->i18n('required'); } - return; } - - if ($value == '') { - return $form->i18n('required'); - } } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-12-01 01:04:36
|
Revision: 74 http://svn.sourceforge.net/pieforms/?rev=74&view=rev Author: oracleshinoda Date: 2006-11-30 17:04:30 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Improved the email validation rule somewhat Modified Paths: -------------- pieforms-php5/trunk/src/pieform/rules/email.php Modified: pieforms-php5/trunk/src/pieform/rules/email.php =================================================================== --- pieforms-php5/trunk/src/pieform/rules/email.php 2006-11-29 02:55:14 UTC (rev 73) +++ pieforms-php5/trunk/src/pieform/rules/email.php 2006-12-01 01:04:30 UTC (rev 74) @@ -36,7 +36,7 @@ * the address. */ function pieform_rule_email(Pieform $form, $value) { - if (!preg_match('/^(.*)@(.*)\.(.*)$/', $value)) { + if (!preg_match('/^[a-z0-9\._%-]+@(?:[a-z0-9-]+\.)+[a-z]{2,4}$/', $value)) { return $form->i18n('email'); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |