OSDN Git Service

Merge branch 'skinnable-master' of sakamocchi@git.sourceforge.jp:/gitroot/nucleus...
[nucleus-jp/nucleus-next.git] / build / testcases / NP_ItemOptionTestCase4.php
1 <?php
2 /**
3  * +-------------------------------------------------------
4  * |            Nucleus ItemOption TestCase              
5  * +-------------------------------------------------------
6  * |
7  * +-INFO--------------------------------------------------
8  * |  Author:   Jeroen Budts (TeRanEX)
9  * |  URL:      http://budts.be/weblog/
10  * |  JabberID: teranex@jabber.org
11  * |
12  * +-TODO--------------------------------------------------
13  * | 
14  * +-HISTORY-----------------------------------------------
15  * |  
16  * |
17  * +-CVS---------------------------------------------------
18  * | $Id: NP_ItemOptionTestCase4.php 613 2004-09-20 22:13:59Z teranex $
19  * |
20  * +-------------------------------------------------------
21  */
22
23 class NP_ItemOptionTestCase4 extends NucleusPlugin {
24
25 // --------- Plug-in Info ---------------------------------
26   // name of plugin
27   function getName() {
28     return 'ItemOptionTestCase4';
29   }
30   
31   // author of plugin
32   function getAuthor() {
33     return 'TeRanEX';
34   }
35   // an URL to the plugin website
36   function getURL() {
37     return 'http://budts.be/weblog/';
38   }
39   
40   // version of the plugin
41   function getVersion() {
42     return '0.1';
43   }
44   
45   // a description to be shown on the installed plugins listing
46   function getDescription() {
47     return 'A plugin to test the itemoptions';
48   }
49
50   //supported features
51   function supportsFeature($what) {
52     switch($what) {
53       case 'SqlTablePrefix':
54         return 1;
55       default:
56         return 0;
57     }
58   }
59   
60   function getMinNucleusVersion() {
61     return 250;
62   }
63 // --------- Install and Uninstall functions --------------
64   function install() {
65     $this->createItemOption('TestCase4', 'TestCaseOption:select(numerical)', 'select', '0', '0|0|1|1|2|2|test|test;datatype=numerical');
66   }
67   
68 // --------- do...-Functions ------------------------------
69   function doTemplateVar(&$item) {
70       //currently we do nothing :-)
71           echo $this->getItemOption($item->itemid, 'TestCase4');
72   }
73   
74   function doSkinVar($skinType) {
75       global $blog;
76           $mostTest = $this->getItemOptionTop('TestCase4', 15, 'asc');
77         for($i=0; $i < count($mostTest); $i++) {
78                 echo '<br/>item: '.$mostTest[$i]['id'].': '.$mostTest[$i]['value'];
79         }
80   }
81   
82 }
83 ?>