| version 1.13, 2003/12/15 13:55:36 |
version 1.14, 2003/12/31 17:47:53 |
|
|
| <!-- $Platon: phpMyEdit/doc/sgml/extensions.sgml,v 1.12 2003/11/20 11:52:30 nepto Exp $ --> |
<!-- $Platon: phpMyEdit/doc/sgml/extensions.sgml,v 1.13 2003/12/15 13:55:36 nepto Exp $ --> |
| |
|
| <chapter id="extensions"> |
<chapter id="extensions"> |
| <title id="extensions.title">Extensions</title> |
<title id="extensions.title">Extensions</title> |
| Line 20 Extensions are &name;_<something> |
|
| Line 20 Extensions are &name;_<something> |
|
| appropriate extension name. They not only extend base &name; class, but they |
appropriate extension name. They not only extend base &name; class, but they |
| also add new functionality. But they may not only add new things. It is |
also add new functionality. But they may not only add new things. It is |
| possible also to disable such features, simply to get the desirable behaviour. |
possible also to disable such features, simply to get the desirable behaviour. |
| |
|
| </para> |
</para> |
| <para> |
<para> |
| |
|
| Line 160 unselectable for final report (such as p |
|
| Line 160 unselectable for final report (such as p |
|
| <title id="extensions.htmlarea.title">&name;-htmlarea</title> |
<title id="extensions.htmlarea.title">&name;-htmlarea</title> |
| <para> |
<para> |
| |
|
| &name;-report extension provides support for htmlArea. htmlArea is a free |
&name;-htmlarea extension provides support for htmlArea. htmlArea is a free |
| WYSIWYG editor replacement for <textarea> fields. For full source code |
WYSIWYG editor replacement for <textarea> fields. For full source code |
| and documentation, visit <ulink |
and documentation, visit <ulink |
| url="http://www.interactivetools.com/">http://www.interactivetools.com/</ulink> |
url="http://www.interactivetools.com/">http://www.interactivetools.com/</ulink> |
| Line 212 new &name;_htmlarea($opts); |
|
| Line 212 new &name;_htmlarea($opts); |
|
| <listitem> |
<listitem> |
| <para> |
<para> |
| |
|
| Add <varname>'html'=>true</> parameter to the textarea field |
Add <varname>'html'=>true</> parameter to the textarea field |
| definition in your &name; calling program. |
definition in your &name; calling program. |
| |
|
| <example><title>htmlArea field enabling</title> |
<example><title>htmlArea field enabling</title> |
| <programlisting><![CDATA[ |
<programlisting><![CDATA[ |
| $opts['fdd']['body'] = array( |
$opts['fdd']['col_name'] = array( |
| 'name' => 'Content', |
'name' => 'Column', |
| 'select' => 'T', |
'select' => 'T', |
| 'options' => 'ACPVD', |
'options' => 'ACPVD', |
| 'required' => true, |
'required' => true, |
| 'textarea' => array( |
'textarea' => array( |
| 'html' => true, |
'html' => true, |
| 'rows' => 11, |
'rows' => 11, |
| 'cols' => 81) |
'cols' => 81) |
| ); |
); |
| ]]></programlisting> |
]]></programlisting> |
| </example> |
</example> |
| Line 243 This extension is contribution of Ezudin |
|
| Line 243 This extension is contribution of Ezudin |
|
| </para> |
</para> |
| </sect1> |
</sect1> |
| |
|
| |
<sect1 id="extensions.calpopup"> |
| |
<title id="extensions.calpopup.title">&name;-calpopup</title> |
| |
<para> |
| |
|
| |
&name;-calpopup extension provides support for a calendar popup helper to be |
| |
put on any text field. This extension uses the free jsCalendar code from |
| |
<ulink |
| |
url="http://dynarch.com/mishoo/calendar.epl">http://dynarch.com/mishoo/calendar.epl</ulink> |
| |
website. |
| |
|
| |
</para> |
| |
<para> |
| |
|
| |
The requirement is a properly installed jsCalendar script. All browsers |
| |
supported by jsCalendar are supported by this extension. |
| |
|
| |
</para> |
| |
<para> |
| |
|
| |
This extension enables the display of a popup calendar selection against |
| |
selected fields. In order to use it, you should: |
| |
|
| |
<orderedlist> |
| |
|
| |
<listitem> |
| |
<para> |
| |
|
| |
Load the jsCalendar scripts in the <head>...</head> section of |
| |
your &name; calling program, substituting the correct paths: |
| |
|
| |
<example><title>CalPopup javascript</title> |
| |
<programlisting><![CDATA[ |
| |
<script type="text/javascript" src="js/calendar.js"></script> |
| |
<script type="text/javascript" src="js/lang/calendar-en.js"></script> |
| |
<script type="text/javascript" src="js/calendar-setup.js"></script> |
| |
]]></programlisting> |
| |
</example> |
| |
|
| |
</para> |
| |
</listitem> |
| |
|
| |
<listitem> |
| |
<para> |
| |
|
| |
Choose your preferred jsCalendar CSS file (see jsCalendar documentation) and |
| |
add the following in the <head>...</head> section of your |
| |
&name; calling program, substituting the correct path: |
| |
|
| |
<example><title>CalPopup javascript</title> |
| |
<programlisting><![CDATA[ |
| |
<link rel="stylesheet" type="text/css" media="screen" |
| |
href="css/calendar-system.css"> |
| |
]]></programlisting> |
| |
</example> |
| |
|
| |
</para> |
| |
<note><para> |
| |
|
| |
To avoid an unwanted side effect in the CSS style produced by |
| |
<filename>phpMyEditSetup.php</filename>, add a 'width:auto' property into the |
| |
'.calendar table' entry in your selected jsCalendar style sheet. |
| |
|
| |
</para></note> |
| |
|
| |
</listitem> |
| |
<listitem> |
| |
<para> |
| |
|
| |
Call to <filename>&name;-calpopup.class.php</> instead of |
| |
<filename>&name;.class.php</>. |
| |
|
| |
<example><title>CalPopup extension enabling</title> |
| |
<programlisting> |
| |
require_once 'extensions/&name;-calpopup.class.php'; |
| |
new &name;_calpopup($opts); |
| |
</programlisting> |
| |
</example> |
| |
|
| |
</para> |
| |
</listitem> |
| |
|
| |
<listitem> |
| |
<para> |
| |
|
| |
Add <varname>calendar</varname> parameter to the field definitions where you |
| |
want a calendar popup in your &name; calling program. |
| |
|
| |
<example><title>CalPopup field enabling</title> |
| |
<programlisting><![CDATA[ |
| |
$opts['fdd']['col_name'] = array( |
| |
'name' => 'Column', |
| |
'select' => 'T', |
| |
'options' => 'ACPVD', |
| |
'required' => true, |
| |
'calendar' => true |
| |
); |
| |
]]></programlisting> |
| |
</example> |
| |
|
| |
This is will display a button next to the field which pops up a calendar when |
| |
clicked. If that field has a <varname>strftimemask</varname> parameter set, it |
| |
will use this for the date format. |
| |
|
| |
</para> |
| |
<para> |
| |
|
| |
For more advanced usage, you can set the <varname>calendar</varname> parameter |
| |
to an array of valid jsCalendar <function>Calendar.setup</function> options |
| |
(see jSCalendar document for details). Note that not all of these options make |
| |
sense to use in &name;, and some of them will actively break the function. |
| |
|
| |
<example><title>CalPopup advanced field</title> |
| |
<programlisting><![CDATA[ |
| |
$opts['fdd']['col_name'] = array( |
| |
'name' => 'Column', |
| |
'select' => 'T', |
| |
'options' => 'ACPVD', |
| |
'required' => true, |
| |
'calendar' => array( |
| |
'ifFormat' => '%Y/%m/%d', // defaults to the ['strftimemask'] |
| |
'singleClick' => true, // single or double click to close |
| |
'mondayFirst' => true, // Sunday or Monday first |
| |
'weekNumbers' => true, // Show week numbers |
| |
'showsTime' => false, // Show time as well as date |
| |
'timeFormat' => '24', // 12 or 24 hour clock |
| |
'label' => '...', // button label (used by &name;) |
| |
'date' => '2003-12-19 10:00' // Initial date/time for popup |
| |
// (see notes below) |
| |
) |
| |
); |
| |
]]></programlisting> |
| |
</example> |
| |
|
| |
</para> |
| |
</listitem> |
| |
</orderedlist> |
| |
|
| |
</para> |
| |
<para> |
| |
|
| |
The popup will normally set the initial value to the current field value or to |
| |
current date/time. <varname>date</varname> option will always override this, |
| |
even if there is a current date/time value in the field. If you want a default |
| |
value only if the field is currently empty, use the &name; |
| |
<varname>default</varname> option. |
| |
|
| |
</para> |
| |
<para> |
| |
|
| |
There are a number of <function>Calendar.setup</function> options that most |
| |
not be overriden as these are set by the class to link to fields. Especially |
| |
avoid using <varname>inputField</varname> and <varname>button</varname>. It is |
| |
best to stick with the options listed in the advanced example. |
| |
|
| |
</para> |
| |
<para> |
| |
|
| |
This extension is contribution of Adam Hammond |
| |
<email>php@pixolet.co.uk</email> from London. |
| |
|
| |
</para> |
| |
</sect1> |
| </chapter> |
</chapter> |
| |
|