OSDN Git Service

This commit was generated by cvs2svn to compensate for changes in r4,
[nucleus-jp/nucleus-jp-ancient.git] / euc / build / testcases / NP_ItemOptionTestCase3.php
diff --git a/euc/build/testcases/NP_ItemOptionTestCase3.php b/euc/build/testcases/NP_ItemOptionTestCase3.php
new file mode 100755 (executable)
index 0000000..31aa834
--- /dev/null
@@ -0,0 +1,104 @@
+<?php\r
+/**\r
+ * +-------------------------------------------------------\r
+ * |            Nucleus ItemOption TestCase              \r
+ * +-------------------------------------------------------\r
+ * |\r
+ * +-INFO--------------------------------------------------\r
+ * |  Author:   Jeroen Budts (TeRanEX)\r
+ * |  URL:      http://budts.be/weblog/\r
+ * |  JabberID: teranex@jabber.org\r
+ * |\r
+ * +-TODO--------------------------------------------------\r
+ * | \r
+ * +-HISTORY-----------------------------------------------\r
+ * |  \r
+ * |\r
+ * +-CVS---------------------------------------------------\r
+ * | $Id: NP_ItemOptionTestCase3.php,v 1.1.1.1 2005-02-28 07:13:50 kimitake Exp $\r
+ * |\r
+ * +-------------------------------------------------------\r
+ */\r
+\r
+class NP_ItemOptionTestCase3 extends NucleusPlugin {\r
+\r
+// --------- Plug-in Info ---------------------------------\r
+  // name of plugin\r
+  function getName() {\r
+    return 'ItemOptionTestCase3';\r
+  }\r
+  \r
+  // author of plugin\r
+  function getAuthor() {\r
+    return 'TeRanEX';\r
+  }\r
+  // an URL to the plugin website\r
+  function getURL() {\r
+    return 'http://budts.be/weblog/';\r
+  }\r
+  \r
+  // version of the plugin\r
+  function getVersion() {\r
+    return '0.1';\r
+  }\r
+  \r
+  // a description to be shown on the installed plugins listing\r
+  function getDescription() {\r
+    return 'A plugin to test the itemoptions';\r
+  }\r
+\r
+  function getEventList() {\r
+    return array('PrePluginOptionsEdit', 'PostPluginOptionsUpdate');\r
+  }\r
+  \r
+  //supported features\r
+  function supportsFeature($what) {\r
+    switch($what) {\r
+      case 'SqlTablePrefix':\r
+        return 1;\r
+      default:\r
+        return 0;\r
+    }\r
+  }\r
+  \r
+  function getMinNucleusVersion() {\r
+    return 250;\r
+  }\r
+// --------- Install and Uninstall functions --------------\r
+  function install() {\r
+    $this->createItemOption('TestCase3', 'TestCaseOption:TextArea', 'textarea', 'This is the default value for my textareatest');\r
+  }\r
+  \r
+  function event_PrePluginOptionsEdit($data){\r
+         echo 'event: PrePluginOptionsEdit<br/>';\r
+         echo '$data: '.$data.'<br/>';\r
+         echo 'context: '.$data['context'].'<br/>';\r
+         echo 'contextid: '.$data['contextid'].'<br/>';\r
+         for ($i == 0; $i < count($data['options']); $i++) {\r
+                 echo 'option-name: '.$data['options'][$i]['name'].' value: '.$data['options'][$i]['value'].'<br/>';\r
+         }\r
+  }\r
+\r
+  function event_PostPluginOptionsUpdate($data){\r
+         echo 'event: PostPluginOptionsEdit';\r
+         echo '$data: '.$data.' | context: '.$data['context'].'<br/>';\r
+         echo 'itemid: '.$data['itemid'].'<br/>';\r
+         echo 'item title: '.$data['item']['title'].'<br/>';\r
+  }\r
+\r
+// --------- do...-Functions ------------------------------\r
+  function doTemplateVar(&$item) {\r
+      //currently we do nothing :-)\r
+         echo $this->getItemOption($item->itemid, 'TestCase3');\r
+  }\r
+  \r
+  function doSkinVar($skinType) {\r
+      global $blog;\r
+         $mostTest = $this->getItemOptionTop('TestCase3', 15, 'asc');\r
+       for($i=0; $i < count($mostTest); $i++) {\r
+               echo '<br/>item: '.$mostTest[$i]['id'].': '.$mostTest[$i]['value'];\r
+       }\r
+  }\r
+  \r
+}\r
+?>\r