OSDN Git Service

NP_Paint v1.18
[nucleus-jp/nucleus-plugins.git] / trunk / NP_Paint / paint / Palette_WCS.php
diff --git a/trunk/NP_Paint/paint/Palette_WCS.php b/trunk/NP_Paint/paint/Palette_WCS.php
new file mode 100644 (file)
index 0000000..4db0603
--- /dev/null
@@ -0,0 +1,111 @@
+<?php\r
+// vim: tabstop=2:shiftwidth=2\r
+\r
+/**\r
+  * Palette_WCS.php ($Revision: 1.39 $)\r
+  * for WCS DynPalette 2003/06/22\r
+  * \r
+  * by hsur ( http://blog.cles.jp/np_cles )\r
+  * $Id: Palette_WCS.php,v 1.39 2010/06/06 11:44:19 hsur Exp $\r
+*/\r
+\r
+/*\r
+  * Copyright (C) 2005-2010 CLES. All rights reserved.\r
+  *\r
+  * This program is free software; you can redistribute it and/or\r
+  * modify it under the terms of the GNU General Public License\r
+  * as published by the Free Software Foundation; either version 2\r
+  * of the License, or (at your option) any later version.\r
+  * \r
+  * This program is distributed in the hope that it will be useful,\r
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+  * GNU General Public License for more details.\r
+  * \r
+  * You should have received a copy of the GNU General Public License\r
+  * along with this program; if not, write to the Free Software\r
+  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA\r
+  * \r
+  * In addition, as a special exception, cles( http://blog.cles.jp/np_cles ) gives\r
+  * permission to link the code of this program with those files in the PEAR\r
+  * library that are licensed under the PHP License (or with modified versions\r
+  * of those files that use the same license as those files), and distribute\r
+  * linked combinations including the two. You must obey the GNU General Public\r
+  * License in all respects for all of the code used other than those files in\r
+  * the PEAR library that are licensed under the PHP License. If you modify\r
+  * this file, you may extend this exception to your version of the file,\r
+  * but you are not obligated to do so. If you do not wish to do so, delete\r
+  * this exception statement from your version.\r
+*/\r
+\r
+\r
+class Palette_WCS extends PaintPlugin {\r
+       function getName(){\r
+               return 'WCS DynPalette ' . _PAINT_Palette;\r
+       }\r
+       \r
+       function Palette_WCS(){\r
+               $this->id = '$Id: Palette_WCS.php,v 1.39 2010/06/06 11:44:19 hsur Exp $';\r
+               $this->name = 'WCS DynPalette';\r
+               \r
+               $requiredFiles = Array('palette.js');\r
+               $this->enable = $this->isFileInstalled($requiredFiles);\r
+       }\r
+\r
+       function getCopyrightsPart(){\r
+               return <<<END\r
+<a href="http://wondercatstudio.com/archive/">WCS DynPalette</a> by <a href="http://wondercatstudio.com/">WonderCatStudio</a>\r
+( /w Palette_WCS Plugin by <a href="http://blog.cles.jp">cles</a> )\r
+<br />\r
+END;\r
+       }\r
+       \r
+       function getBeforeAppletPart(){\r
+               if (strstr($_SERVER['HTTP_USER_AGENT'], "Macintosh")) {\r
+                       return '<br /><br />';\r
+               }\r
+               return '';\r
+       }\r
+       \r
+       function getHeaderPart(){\r
+               return <<<END\r
+<script type="text/javascript" charset="shift_jis" src="{$this->appletBaseUrl}palette.js"></script>\r
+END;\r
+       }\r
+       \r
+       function getAfterAppletPart(){\r
+               if( $pidx = requestVar('pidx') ){\r
+                       return <<<END\r
+<div style="width: 100px;">\r
+<script type="text/javascript">\r
+<!--\r
+PaletteInit();\r
+d = document\r
+d.Palette.select.selectedIndex = $pidx\r
+setTimeout("setPalette()", 2000)\r
+function paintBBSCallback(value){\r
+if(value=="start"){\r
+       setPalette()\r
+}\r
+}\r
+//-->\r
+</script>\r
+END;\r
+               }\r
+               return <<<END\r
+<div style="width: 100px;">\r
+<script type="text/javascript">\r
+<!--\r
+TableLineColor = "#222222";\r
+FontColor      = "#222222";\r
+PaletteInit();\r
+//-->\r
+</script>\r
+</div>\r
+END;\r
+       }\r
+       \r
+       function getExtraOption(){\r
+               return $this->template->fetch('extraoption', strtolower(__CLASS__));\r
+       }\r
+}\r