OSDN Git Service

NP_Paint v1.18
[nucleus-jp/nucleus-plugins.git] / trunk / NP_Paint / paint / PaintPlugin.php
1 <?php\r
2 // vim: tabstop=2:shiftwidth=2\r
3 \r
4 /**\r
5   * PaintPlugin.php ($Revision: 1.20 $)\r
6   * \r
7   * by hsur ( http://blog.cles.jp/np_cles )\r
8   * $Id: PaintPlugin.php,v 1.20 2010/06/06 11:44:19 hsur Exp $\r
9 */\r
10 \r
11 /*\r
12   * Copyright (C) 2005-2010 CLES. All rights reserved.\r
13   *\r
14   * This program is free software; you can redistribute it and/or\r
15   * modify it under the terms of the GNU General Public License\r
16   * as published by the Free Software Foundation; either version 2\r
17   * of the License, or (at your option) any later version.\r
18   * \r
19   * This program is distributed in the hope that it will be useful,\r
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
22   * GNU General Public License for more details.\r
23   * \r
24   * You should have received a copy of the GNU General Public License\r
25   * along with this program; if not, write to the Free Software\r
26   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA\r
27   * \r
28   * In addition, as a special exception, cles( http://blog.cles.jp/np_cles ) gives\r
29   * permission to link the code of this program with those files in the PEAR\r
30   * library that are licensed under the PHP License (or with modified versions\r
31   * of those files that use the same license as those files), and distribute\r
32   * linked combinations including the two. You must obey the GNU General Public\r
33   * License in all respects for all of the code used other than those files in\r
34   * the PEAR library that are licensed under the PHP License. If you modify\r
35   * this file, you may extend this exception to your version of the file,\r
36   * but you are not obligated to do so. If you do not wish to do so, delete\r
37   * this exception statement from your version.\r
38 */\r
39 \r
40 class PaintPlugin {\r
41         var $appletBaseUrl = '';\r
42         var $type = 'unknown';\r
43         var $enable = false;\r
44         var $template = null;\r
45         \r
46         function _info($msg) {\r
47                 global $manager;\r
48                 \r
49                 $plugin = $manager->getPlugin('NP_Paint');\r
50                 if( $plugin )\r
51                         $plugin->_info($msg);\r
52         }\r
53 \r
54         function isFileInstalled($files){\r
55                 global $DIR_PLUGINS;\r
56                 \r
57                 // if $files is array\r
58                 if( is_array($files) ){\r
59                         foreach( $files as $file ){\r
60                                 $filePath = $DIR_PLUGINS . 'paint/applet/' . $file;\r
61                                 if( ! file_exists($filePath) ){\r
62                                         $this->_info($filePath . " is required. [{$this->name}]");\r
63                                         return false;\r
64                                 }\r
65                         }\r
66                         return true;\r
67                 }\r
68                 \r
69                 // if $files is string\r
70                 return file_exists($DIR_PLUGINS . 'paint/applet' . $files);\r
71         }\r
72                 \r
73         function getPageTemplate($vars = null){\r
74                 return '';\r
75         }\r
76         \r
77         function getHeaderPart(){\r
78                 return '';\r
79         }\r
80         \r
81         function getParamPart(){\r
82                 return '';\r
83         }\r
84         \r
85         function getCopyrightsPart(){\r
86                 return '';\r
87         }\r
88 \r
89         function getBeforeAppletPart(){\r
90                 return '';      \r
91         }\r
92         \r
93         function getAfterAppletPart(){\r
94                 return '';\r
95         }\r
96         \r
97         function getExtraOption(){\r
98                 return '';      \r
99         }\r
100 }\r