OSDN Git Service

NP_Paint v1.18
[nucleus-jp/nucleus-plugins.git] / trunk / NP_Paint / paint / Viewer_Continue.php
diff --git a/trunk/NP_Paint/paint/Viewer_Continue.php b/trunk/NP_Paint/paint/Viewer_Continue.php
new file mode 100644 (file)
index 0000000..f3af351
--- /dev/null
@@ -0,0 +1,84 @@
+<?php\r
+// vim: tabstop=2:shiftwidth=2\r
+\r
+/**\r
+  * Viewer_Continue ($Revision: 1.32 $)\r
+  * \r
+  * by hsur ( http://blog.cles.jp/np_cles )\r
+  * $Id: Viewer_Continue.php,v 1.32 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 Viewer_Continue extends PaintPlugin {\r
+\r
+       function Viewer_Continue(){\r
+               $this->id = '$Id: Viewer_Continue.php,v 1.32 2010/06/06 11:44:19 hsur Exp $';\r
+               $this->name = 'paint continue';\r
+               $this->animeExt = Array();\r
+               $this->enable = true;\r
+               \r
+               $this->templatevars['id'] = $this->id;\r
+               $this->templatevars['name'] = $this->name;\r
+       }\r
+                       \r
+       function getPageTemplate($vars = null){\r
+               global $CONF, $manager;\r
+               $plugin = $manager->getPlugin('NP_Paint');\r
+               \r
+               list($animeFile, $appletName) = $plugin->findAppletByImg($vars['file']);\r
+               $fileInfo = $plugin->getFileInfo($animeFile);\r
+               \r
+               $vars['charset'] = _CHARSET;\r
+               $vars['mediaurl'] = $CONF['MediaURL'];\r
+               $vars['actionurl'] = $CONF['ActionURL'];\r
+               $vars['quality'] = $fileInfo['quality'];\r
+               \r
+               $vars['appletTag'] = $plugin->_getAppletSelect($appletName);\r
+               $vars['paletteTag'] = $plugin->_getPaletteSelect();\r
+               $vars['paletteExtraTag'] = $plugin->_getPaletteSelectExtra();\r
+               $vars['animation'] = ($plugin->getOption('defaultAnimation') == 'yes') ? 'checked' : '';\r
+               \r
+               if( $fileInfo ){\r
+                       foreach ($fileInfo as $key => $value){\r
+                               $animeInfo .= "&nbsp;&nbsp;* $key: $value<br />";\r
+                       }\r
+               } else {\r
+                       $animeInfo = '<em>'. _PAINT_Viewer_infoNotFond .'</em>';\r
+               }\r
+               $vars['animeInfo'] = $animeInfo;\r
+               \r
+               $tpl = $this->template->fetch('pagetemplate', strtolower(__CLASS__));           \r
+               $vars = array_merge((array)$vars, $this->templatevars);         \r
+               \r
+               return $this->template->fill($tpl, $vars, false);\r
+       }\r
+}\r