| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Rev: 254 $ | $LastChangedBy: brieb $ |
|---|
| 4 | $LastChangedDate: 2007-08-07 18:38:38 -0600 (Tue, 07 Aug 2007) $ |
|---|
| 5 | +-------------------------------------------------------------------------+ |
|---|
| 6 | | Copyright (c) 2004 - 2010, Kreotek LLC | |
|---|
| 7 | | All rights reserved. | |
|---|
| 8 | +-------------------------------------------------------------------------+ |
|---|
| 9 | | | |
|---|
| 10 | | Redistribution and use in source and binary forms, with or without | |
|---|
| 11 | | modification, are permitted provided that the following conditions are | |
|---|
| 12 | | met: | |
|---|
| 13 | | | |
|---|
| 14 | | - Redistributions of source code must retain the above copyright | |
|---|
| 15 | | notice, this list of conditions and the following disclaimer. | |
|---|
| 16 | | | |
|---|
| 17 | | - Redistributions in binary form must reproduce the above copyright | |
|---|
| 18 | | notice, this list of conditions and the following disclaimer in the | |
|---|
| 19 | | documentation and/or other materials provided with the distribution. | |
|---|
| 20 | | | |
|---|
| 21 | | - Neither the name of Kreotek LLC nor the names of its contributore may | |
|---|
| 22 | | be used to endorse or promote products derived from this software | |
|---|
| 23 | | without specific prior written permission. | |
|---|
| 24 | | | |
|---|
| 25 | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
|---|
| 26 | | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
|---|
| 27 | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | |
|---|
| 28 | | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
|---|
| 29 | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
|---|
| 30 | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
|---|
| 31 | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
|---|
| 32 | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
|---|
| 33 | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
|---|
| 34 | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
|---|
| 35 | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
|---|
| 36 | | | |
|---|
| 37 | +-------------------------------------------------------------------------+ |
|---|
| 38 | */ |
|---|
| 39 | |
|---|
| 40 | // HERE IS WEHERE YOU CAN DEFINE SETTINGS TO BE USED BY YOUR MODULE |
|---|
| 41 | // FOLLOW THE CLASS TEMPLATE BELOW FOR CONFIGURATION |
|---|
| 42 | |
|---|
| 43 | /* |
|---|
| 44 | //if we had specific update code for the module, we would create a class |
|---|
| 45 | //called [module]Update with a method called updateSettings($variables) |
|---|
| 46 | |
|---|
| 47 | class [module]Update{ |
|---|
| 48 | function updateSettings($variables){ |
|---|
| 49 | |
|---|
| 50 | the variables array is a non escaped array from the _POST |
|---|
| 51 | |
|---|
| 52 | } |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | // if you want to display fields on the configuration screen |
|---|
| 57 | // follow the class template below |
|---|
| 58 | |
|---|
| 59 | class [module]Display{ |
|---|
| 60 | |
|---|
| 61 | function getFields($therecord){ |
|---|
| 62 | // here you define any special fields you may need |
|---|
| 63 | //$therecord is tthe array of settings |
|---|
| 64 | |
|---|
| 65 | $fields = array(); |
|---|
| 66 | |
|---|
| 67 | //sample field |
|---|
| 68 | $theinput = new inputField("shipping_markup",$therecord["shipping_markup"],"shipping markup",false,"real",4,4); |
|---|
| 69 | $fields[] = $theinput; |
|---|
| 70 | |
|---|
| 71 | return $fields; |
|---|
| 72 | }//end method |
|---|
| 73 | |
|---|
| 74 | function display($theform, $therecord){ |
|---|
| 75 | //$theform is the passed form object |
|---|
| 76 | //$therecord is tthe array of settings |
|---|
| 77 | |
|---|
| 78 | //sample output |
|---|
| 79 | ?> |
|---|
| 80 | |
|---|
| 81 | <h1 class="newModule">Module: Business Management System</h1> |
|---|
| 82 | <fieldset> |
|---|
| 83 | <legend>shipping</legend> |
|---|
| 84 | <p class="notes"><br /> |
|---|
| 85 | <strong>Note:</strong> The shipping information below is used when connecting to <br /> |
|---|
| 86 | UPS to calculate shipping costs for product. Current tests show that the UPS <br /> |
|---|
| 87 | shipping calculator only works when shipping to and from the Unites States.<br /> |
|---|
| 88 | </p> |
|---|
| 89 | |
|---|
| 90 | <p> |
|---|
| 91 | <?php $theform->fields["shipping_markup"]->display();?> |
|---|
| 92 | <br /> |
|---|
| 93 | <span class="notes"><strong>Note:</strong> Enter the number to multiply the calculated shipping cost. <br /> |
|---|
| 94 | For example to mark up shipping costs by 10%, enter 1.1</span> |
|---|
| 95 | </p> |
|---|
| 96 | </fieldset> |
|---|
| 97 | |
|---|
| 98 | <?php |
|---|
| 99 | } |
|---|
| 100 | } |
|---|
| 101 | |
|---|
| 102 | */ |
|---|
| 103 | ?> |
|---|