OSDN Git Service

NP_DragAndDropUploader v1.1
[nucleus-jp/nucleus-plugins.git] / trunk / NP_DragAndDropUploader / draganddropuploader / index.php
1 <?php\r
2 // vim: tabstop=2:shiftwidth=2\r
3 \r
4 /**\r
5   * index.php ($Revision: 1.3 $)\r
6   * \r
7   * by hsur ( http://blog.cles.jp/np_cles )\r
8   * $Id: index.php,v 1.3 2010/05/08 20:49:28 hsur Exp $\r
9 */\r
10 \r
11 /*\r
12   * Copyright (C) 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 $strRel = '../../../';\r
41 include ($strRel.'config.php');\r
42 include ($DIR_LIBS.'PLUGINADMIN.php');\r
43 \r
44 require_once($DIR_PLUGINS . 'sharedlibs/sharedlibs.php');\r
45 require_once('cles/Feedback.php');\r
46 \r
47 if ($blogid) {\r
48         $isblogadmin = $member->isBlogAdmin($blogid);\r
49 } else\r
50         $isblogadmin = 0;\r
51 \r
52 if (!$member->isLoggedIn()) {\r
53         $oPluginAdmin = new PluginAdmin('MetaTags');\r
54         $oPluginAdmin->start();\r
55         echo "<p>ログインが必要です</p>";\r
56         $oPluginAdmin->end();\r
57         exit;\r
58 }\r
59 \r
60 if (!($member->isAdmin() || $isblogadmin)) {\r
61         $oPluginAdmin = new PluginAdmin('MetaTags');\r
62         $oPluginAdmin->start();\r
63         echo "<p>"._ERROR_DISALLOWED."</p>";\r
64         $oPluginAdmin->end();\r
65         exit;\r
66 }\r
67 \r
68 if (isset ($_GET['page'])) {\r
69         $action = getVar('page');\r
70 }\r
71 if (isset ($_POST['page'])) {\r
72         $action = getVar('page');\r
73 }\r
74 \r
75 // create the admin area page\r
76 $oPluginAdmin = new PluginAdmin('DragAndDropUploader');\r
77 $oPluginAdmin->start();\r
78 $fb =& new cles_Feedback($oPluginAdmin);\r
79 \r
80 // menu\r
81 echo "<h2>DragAndDropUploader menu</h2>\n";\r
82 echo "<ul>\n";\r
83 echo "<li><a href=\"".serverVar('PHP_SELF')."?page=report\"><span style=\"font-weight:bold; color:red\">" . $fb->getMenuStr() . "</span></a></li>\n";\r
84 echo "</ul>\n";\r
85 \r
86 //action\r
87 switch ($action) {\r
88         case 'report' :\r
89                 $extra = '';\r
90                 $fb->printForm($extra);\r
91                 break;\r
92 \r
93         default :\r
94                 break;\r
95 }\r
96 \r
97 echo "<br />";\r
98 \r
99 $oPluginAdmin->end();\r