3 * +-------------------------------------------------------
4 * | Nucleus ItemOption TestCase
5 * +-------------------------------------------------------
7 * +-INFO--------------------------------------------------
8 * | Author: Jeroen Budts (TeRanEX)
9 * | URL: http://budts.be/weblog/
10 * | JabberID: teranex@jabber.org
12 * +-TODO--------------------------------------------------
14 * +-HISTORY-----------------------------------------------
17 * +-CVS---------------------------------------------------
18 * | $Id: NP_ItemOptionTestCase3.php 1417 2009-10-30 06:13:29Z ehui $
20 * +-------------------------------------------------------
23 class NP_ItemOptionTestCase3 extends NucleusPlugin {
25 // --------- Plug-in Info ---------------------------------
28 return 'ItemOptionTestCase3';
32 function getAuthor() {
35 // an URL to the plugin website
37 return 'http://budts.be/weblog/';
40 // version of the plugin
41 function getVersion() {
45 // a description to be shown on the installed plugins listing
46 function getDescription() {
47 return 'A plugin to test the itemoptions';
50 function getEventList() {
51 return array('PrePluginOptionsEdit', 'PostPluginOptionsUpdate');
55 function supportsFeature($what) {
57 case 'SqlTablePrefix':
64 function getMinNucleusVersion() {
67 // --------- Install and Uninstall functions --------------
69 $this->createItemOption('TestCase3', 'TestCaseOption:TextArea', 'textarea', 'This is the default value for my textareatest');
72 function event_PrePluginOptionsEdit($data){
73 echo 'event: PrePluginOptionsEdit<br/>';
74 echo '$data: '.$data.'<br/>';
75 echo 'context: '.$data['context'].'<br/>';
76 echo 'contextid: '.$data['contextid'].'<br/>';
77 for ($i = 0; $i < count($data['options']); $i++) {
78 echo 'option-name: '.$data['options'][$i]['name'].' value: '.$data['options'][$i]['value'].'<br/>';
82 function event_PostPluginOptionsUpdate($data){
83 echo 'event: PostPluginOptionsEdit';
84 echo '$data: '.$data.' | context: '.$data['context'].'<br/>';
85 echo 'itemid: '.$data['itemid'].'<br/>';
86 echo 'item title: '.$data['item']['title'].'<br/>';
89 // --------- do...-Functions ------------------------------
90 function doTemplateVar(&$item) {
91 //currently we do nothing :-)
92 echo $this->getItemOption($item->itemid, 'TestCase3');
95 function doSkinVar($skinType) {
97 $mostTest = $this->getItemOptionTop('TestCase3', 15, 'asc');
98 for($i=0; $i < count($mostTest); $i++) {
99 echo '<br/>item: '.$mostTest[$i]['id'].': '.$mostTest[$i]['value'];