OSDN Git Service

translated and updated copyright from 2004 to 2005
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / build / testcases / NP_ItemOptionTestCase3.php
1 <?php\r
2 /**\r
3  * +-------------------------------------------------------\r
4  * |            Nucleus ItemOption TestCase              \r
5  * +-------------------------------------------------------\r
6  * |\r
7  * +-INFO--------------------------------------------------\r
8  * |  Author:   Jeroen Budts (TeRanEX)\r
9  * |  URL:      http://budts.be/weblog/\r
10  * |  JabberID: teranex@jabber.org\r
11  * |\r
12  * +-TODO--------------------------------------------------\r
13  * | \r
14  * +-HISTORY-----------------------------------------------\r
15  * |  \r
16  * |\r
17  * +-CVS---------------------------------------------------\r
18  * | $Id: NP_ItemOptionTestCase3.php,v 1.1.1.1 2005-02-28 07:14:30 kimitake Exp $\r
19  * |\r
20  * +-------------------------------------------------------\r
21  */\r
22 \r
23 class NP_ItemOptionTestCase3 extends NucleusPlugin {\r
24 \r
25 // --------- Plug-in Info ---------------------------------\r
26   // name of plugin\r
27   function getName() {\r
28     return 'ItemOptionTestCase3';\r
29   }\r
30   \r
31   // author of plugin\r
32   function getAuthor() {\r
33     return 'TeRanEX';\r
34   }\r
35   // an URL to the plugin website\r
36   function getURL() {\r
37     return 'http://budts.be/weblog/';\r
38   }\r
39   \r
40   // version of the plugin\r
41   function getVersion() {\r
42     return '0.1';\r
43   }\r
44   \r
45   // a description to be shown on the installed plugins listing\r
46   function getDescription() {\r
47     return 'A plugin to test the itemoptions';\r
48   }\r
49 \r
50   function getEventList() {\r
51     return array('PrePluginOptionsEdit', 'PostPluginOptionsUpdate');\r
52   }\r
53   \r
54   //supported features\r
55   function supportsFeature($what) {\r
56     switch($what) {\r
57       case 'SqlTablePrefix':\r
58         return 1;\r
59       default:\r
60         return 0;\r
61     }\r
62   }\r
63   \r
64   function getMinNucleusVersion() {\r
65     return 250;\r
66   }\r
67 // --------- Install and Uninstall functions --------------\r
68   function install() {\r
69     $this->createItemOption('TestCase3', 'TestCaseOption:TextArea', 'textarea', 'This is the default value for my textareatest');\r
70   }\r
71   \r
72   function event_PrePluginOptionsEdit($data){\r
73           echo 'event: PrePluginOptionsEdit<br/>';\r
74           echo '$data: '.$data.'<br/>';\r
75           echo 'context: '.$data['context'].'<br/>';\r
76           echo 'contextid: '.$data['contextid'].'<br/>';\r
77           for ($i == 0; $i < count($data['options']); $i++) {\r
78                   echo 'option-name: '.$data['options'][$i]['name'].' value: '.$data['options'][$i]['value'].'<br/>';\r
79           }\r
80   }\r
81 \r
82   function event_PostPluginOptionsUpdate($data){\r
83           echo 'event: PostPluginOptionsEdit';\r
84           echo '$data: '.$data.' | context: '.$data['context'].'<br/>';\r
85           echo 'itemid: '.$data['itemid'].'<br/>';\r
86           echo 'item title: '.$data['item']['title'].'<br/>';\r
87   }\r
88 \r
89 // --------- do...-Functions ------------------------------\r
90   function doTemplateVar(&$item) {\r
91       //currently we do nothing :-)\r
92           echo $this->getItemOption($item->itemid, 'TestCase3');\r
93   }\r
94   \r
95   function doSkinVar($skinType) {\r
96       global $blog;\r
97           $mostTest = $this->getItemOptionTop('TestCase3', 15, 'asc');\r
98         for($i=0; $i < count($mostTest); $i++) {\r
99                 echo '<br/>item: '.$mostTest[$i]['id'].': '.$mostTest[$i]['value'];\r
100         }\r
101   }\r
102   \r
103 }\r
104 ?>\r