OSDN Git Service

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/tags/release...
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / libs / ADMIN.php
index f43652b..d785bb6 100755 (executable)
@@ -335,7 +335,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -902,7 +902,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -957,7 +957,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -1001,7 +1001,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -1057,7 +1057,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -1199,41 +1199,6 @@ class ADMIN {
                                $wasdraft: set to 1 when the item used to be a draft item\r
                                $publish: set to 1 when the edited item is not a draft\r
                */\r
-/*<del by shizuki>\r
-               switch ($actiontype) {\r
-                       case 'adddraft':\r
-                               $publish = 0;\r
-                               $wasdraft = 1;\r
-                               $timestamp = 0;\r
-                               break;\r
-                       case 'addfuture':\r
-                               $wasdraft = 1;\r
-                               $publish = 1;\r
-                               $timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year'));\r
-                               break;\r
-                       case 'addnow':\r
-                               $wasdraft = 1;\r
-                               $publish = 1;\r
-                               $timestamp = 0;\r
-                               break;\r
-                       case 'changedate':\r
-                               $timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year'));\r
-                               $publish = 1;\r
-                               $wasdraft = 0;\r
-                               break;\r
-                       case 'backtodrafts':\r
-                               $wasdraft = 0;\r
-                               $publish = 0;\r
-                               $timestamp = 0;\r
-                               break;                  \r
-                       case 'edit':\r
-                       default:\r
-                               $publish = 1;\r
-                               $wasdraft = 0;\r
-                               $timestamp = 0;\r
-               }\r
-</del by shizuki>*/\r
-// <add by shizuki>\r
                $blogid =  getBlogIDFromItemID($itemid);\r
                $blog   =& $manager->getBlog($blogid);\r
 \r
@@ -1246,21 +1211,10 @@ class ADMIN {
                        $timestamp =0;\r
                }\r
                $doping = ($publish && $timestamp < $blog->getCorrectTime() && postVar('dosendping')) ? 1 : 0;\r
-// </add by shizuki>\r
 \r
                // edit the item for real\r
                ITEM::update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, $timestamp);\r
 \r
-/* <del by shizuki>\r
-               $blogid = getBlogIDFromItemID($itemid);\r
-               $blog =& $manager->getBlog($blogid);\r
-\r
-               $isFuture = 0;\r
-               if ($timestamp > $blog->getCorrectTime(time())) {\r
-                       $isFuture = 1;\r
-               }\r
-\r
-</del by shizuki>*/\r
                $this->updateFuturePosted($blogid);\r
 \r
                if ($draftid > 0) {\r
@@ -1494,23 +1448,7 @@ class ADMIN {
 \r
                $blogid = getBlogIDFromItemID($result['itemid']);\r
                $blog =& $manager->getBlog($blogid);\r
-/* <del by shizuki>\r
-               $pingUrl = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=sendping&blogid=' . intval($blogid));\r
-\r
-               if ($result['status'] == 'newcategory')\r
-                       $this->action_categoryedit(\r
-                               $result['catid'],\r
-                               $blogid,\r
-                               $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0 ? $pingUrl : ''\r
-                       );\r
-               elseif ((postVar('actiontype') == 'addnow') && $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0)\r
-                       $this->action_sendping($blogid);\r
-               else\r
-                       $this->action_itemlist($blogid);\r
-</del by shizuki>*/\r
-// <add by shizuki>\r
                $btimestamp = $blog->getCorrectTime();\r
-               $bPingInfo  = ($blog->sendPing() && numberOfEventSubscriber('SendPing') > 0);\r
                $item       = $manager->getItem(intval($result['itemid']), 1, 1);\r
                $iPingInfo  = (!$item['draft'] && postVar('dosendping') && $item['timestamp'] <= $btimestamp);\r
                if ($iPingInfo && $bPingInfo) {\r
@@ -1519,16 +1457,12 @@ class ADMIN {
                        $nextAction = 'itemlist';\r
                }\r
                if ($result['status'] == 'newcategory') {\r
-//                     $distURI = ($nextAction == 'sendping') ? $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action='\r
-//                                      . $nextAction . '&blogid=' . intval($blogid)) : \r
-//                                        '';\r
                        $distURI = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=' . $nextAction . '&blogid=' . intval($blogid));\r
                        $this->action_categoryedit($result['catid'], $blogid, $distURI);\r
                } else {\r
                        $methodName = 'action_' . $nextAction;\r
                        call_user_func(array(&$this, $methodName), $blogid);\r
                }\r
-//</add by shizuki>\r
        }\r
 \r
        /**\r
@@ -2101,7 +2035,7 @@ class ADMIN {
                        $mem->setCanLogin($canlogin);\r
                }\r
 \r
-               $autosave = postVar ('autosave'); \r
+               $autosave = postVar ('autosave');\r
                $mem->setAutosave($autosave);\r
 \r
                $mem->write();\r
@@ -3438,7 +3372,9 @@ class ADMIN {
                $blog   =& $manager->getBlog($blogid);\r
 \r
                // create new category\r
-               sql_query('INSERT INTO '.sql_table('category')." (cblog, cname, cdesc) VALUES ($blogid, _EBLOGDEFAULTCATEGORY_NAME, _EBLOGDEFAULTCATEGORY_DESC)");\r
+               $sql = 'INSERT INTO %s (cblog, cname, cdesc) VALUES (%d, "%s", "%s")';\r
+               sql_query(sprintf($sql, sql_table('category'), $blogid, _EBLOGDEFAULTCATEGORY_NAME, _EBLOGDEFAULTCATEGORY_DESC));\r
+//             sql_query('INSERT INTO '.sql_table('category')." (cblog, cname, cdesc) VALUES ($blogid, _EBLOGDEFAULTCATEGORY_NAME, _EBLOGDEFAULTCATEGORY_DESC)");\r
                $catid = mysql_insert_id();\r
 \r
                // set as default category\r
@@ -3477,13 +3413,13 @@ class ADMIN {
                <p><?php echo sprintf(_BLOGCREATED_ADDEDTXT, htmlspecialchars($bname)) ?></p>\r
 \r
                <ol>\r
-                       <li><a href="#index_php"><?php sprintf(_BLOGCREATED_SIMPLEWAY, htmlspecialchars($bshortname)) ?></code></a></li>\r
-                       <li><a href="#skins"><?php _BLOGCREATED_ADVANCEDWAY ?></a></li>\r
+                       <li><a href="#index_php"><?php echo sprintf(_BLOGCREATED_SIMPLEWAY, htmlspecialchars($bshortname)) ?></a></li>\r
+                       <li><a href="#skins"><?php echo _BLOGCREATED_ADVANCEDWAY ?></a></li>\r
                </ol>\r
 \r
-               <h3><a id="index_php"><?php sprintf(_BLOGCREATED_SIMPLEDESC1, htmlspecialchars($bshortname)) ?></a></h3>\r
+               <h3><a id="index_php"><?php echo sprintf(_BLOGCREATED_SIMPLEDESC1, htmlspecialchars($bshortname)) ?></a></h3>\r
 \r
-               <p><?php sprintf(_BLOGCREATED_SIMPLEDESC2, htmlspecialchars($bshortname)) ?></p>\r
+               <p><?php echo sprintf(_BLOGCREATED_SIMPLEDESC2, htmlspecialchars($bshortname)) ?></p>\r
 <pre><code>&lt;?php\r
 \r
 $CONF['Self'] = '<b><?php echo htmlspecialchars($bshortname)?>.php</b>';\r
@@ -4004,7 +3940,7 @@ selector();
                                $this->_templateEditRow($template, $pfdesc, $pffield, '',++$tab,0);\r
                        }\r
                }\r
-?>                     \r
+?>\r
                </tr><tr>\r
                        <th colspan="2"><?php echo _TEMPLATE_UPDATE?></th>\r
                </tr><tr>\r
@@ -4026,6 +3962,7 @@ selector();
         */\r
        function _templateEditRow(&$template, $description, $name, $help = '', $tabindex = 0, $big = 0) {\r
                static $count = 1;\r
+               if (!isset($template[$name])) $template[$name] = '';\r
        ?>\r
                </tr><tr>\r
                        <td><?php echo $description?> <?php if ($help) help('template'.$help); ?></td>\r
@@ -4912,14 +4849,14 @@ selector();
                                           <td><?php\r
 \r
                                                $this->input_yesno('DebugVars',$CONF['DebugVars'],10078);\r
-                                               \r
+\r
                                                         ?>\r
 \r
                                           </td>\r
                </tr><tr>\r
                        <td><?php echo _SETTINGS_DEFAULTLISTSIZE?> <?php help('defaultlistsize');?></td>\r
                        <td>\r
-                       <?php \r
+                       <?php\r
                                if (!array_key_exists('DefaultListSize',$CONF)) {\r
                                        sql_query("INSERT INTO ".sql_table('config')." VALUES ('DefaultListSize', '10')");\r
                                        $CONF['DefaultListSize'] = 10;\r
@@ -5106,7 +5043,7 @@ selector();
 \r
        /**\r
         *  Give an overview over the used system\r
-        */     \r
+        */\r
        function action_systemoverview() {\r
                global $member, $nucleus, $CONF;\r
 \r
@@ -5180,14 +5117,14 @@ selector();
                        echo "\t\t" . '<th colspan="2">' . _ADMIN_SYSTEMOVERVIEW_MODULES . "</th>\n";\r
                        echo "\t</tr><tr>\n";\r
                        echo "\t\t" . '<td width="50%">mod_rewrite' . "</td>\n";\r
-                       $modrewrite = (strstr($im, 'mod_rewrite') != '') ? \r
+                       $modrewrite = (strstr($im, 'mod_rewrite') != '') ?\r
                                                _ADMIN_SYSTEMOVERVIEW_ENABLE :\r
                                                _ADMIN_SYSTEMOVERVIEW_DISABLE;\r
                        echo "\t\t" . '<td>' . $modrewrite . "</td>\n";\r
                        echo "\t</tr>\n";\r
                        echo "</table>\n";\r
 \r
-                       // Information about the used Nucleus CMS \r
+                       // Information about the used Nucleus CMS\r
                        echo '<h3>' . _ADMIN_SYSTEMOVERVIEW_NUCLEUSSYSTEM . "</h3>\n";\r
                        global $nucleus;\r
                        $nv = getNucleusVersion() / 100 . '(' . $nucleus['version'] . ')';\r
@@ -5212,6 +5149,9 @@ selector();
                        echo "\t\t" . '<td width="50%">' . '$CONF[' . "'Self']</td>\n";\r
                        echo "\t\t" . '<td>' . $CONF['Self'] . "</td>\n";\r
                        echo "\t</tr><tr>\n";\r
+                       echo "\t\t" . '<td width="50%">' . '$CONF[' . "'ItemURL']</td>\n";\r
+                       echo "\t\t" . '<td>' . $CONF['ItemURL'] . "</td>\n";\r
+                       echo "\t</tr><tr>\n";\r
                        echo "\t\t" . '<td width="50%">' . '$CONF[' . "'alertOnHeadersSent']</td>\n";\r
                        $ohs = $CONF['alertOnHeadersSent'] ?\r
                                                _ADMIN_SYSTEMOVERVIEW_ENABLE :\r
@@ -5237,7 +5177,7 @@ selector();
                else {\r
                        echo _ADMIN_SYSTEMOVERVIEW_NOT_ADMIN;\r
                }\r
-               \r
+\r
                $this->pagefoot();\r
        }\r
 \r
@@ -5338,9 +5278,9 @@ selector();
 \r
                        if ($member->isLoggedIn() && $member->isAdmin()) {\r
                                $checkURL = sprintf(_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_URL, getNucleusVersion(), getNucleusPatchLevel());\r
-                               echo '<a href="' . $checkURL . '" title="' . _ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_TITLE . '">Nucleus CMS ', $nucleus['version'], $codenamestring, '</a>';\r
+                               echo '<a href="' . $checkURL . '" title="' . _ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_TITLE . '">Nucleus CMS ' . $nucleus['version'] . $codenamestring . '</a>';\r
                        } else {\r
-                               echo 'Nucleus CMS ', $nucleus['version'], $codenamestring;\r
+                               echo 'Nucleus CMS ' . $nucleus['version'] . $codenamestring;\r
                        }\r
                        echo ')';\r
                echo '</div>';\r
@@ -6184,7 +6124,7 @@ selector();
         * @todo document this\r
         */\r
        function action_pluginupdate() {\r
-               global $member, $manager;\r
+               global $member, $manager, $CONF;\r
 \r
                // check if allowed\r
                $member->isAdmin() or $this->disallow();\r
@@ -6205,7 +6145,7 @@ selector();
                        }\r
                }\r
 \r
-               redirect('?action=pluginlist');\r
+               redirect($CONF['AdminURL'] . '?action=pluginlist');\r
 //             $this->action_pluginlist();\r
        }\r
 \r
@@ -6235,14 +6175,15 @@ selector();
                        <input type="hidden" name="plugid" value="<?php echo $pid; ?>" />\r
                        <input type="submit" tabindex="10" value="<?php echo _DELETE_CONFIRM_BTN?>" />\r
                        </div></form>\r
-               <?php           $this->pagefoot();\r
+               <?php\r
+               $this->pagefoot();\r
        }\r
 \r
        /**\r
         * @todo document this\r
         */\r
        function action_plugindeleteconfirm() {\r
-               global $member, $manager;\r
+               global $member, $manager, $CONF;\r
 \r
                // check if allowed\r
                $member->isAdmin() or $this->disallow();\r
@@ -6254,7 +6195,7 @@ selector();
                        $this->error($error);\r
                }\r
 \r
-               redirect('?action=pluginlist');\r
+               redirect($CONF['AdminURL'] . '?action=pluginlist');\r
 //             $this->action_pluginlist();\r
        }\r
 \r
@@ -6336,7 +6277,7 @@ selector();
         * @todo document this\r
         */\r
        function action_pluginup() {\r
-               global $member, $manager;\r
+               global $member, $manager, $CONF;\r
 \r
                // check if allowed\r
                $member->isAdmin() or $this->disallow();\r
@@ -6360,14 +6301,14 @@ selector();
 \r
                //$this->action_pluginlist();\r
                // To avoid showing ticket in the URL, redirect to pluginlist, instead.\r
-               redirect('?action=pluginlist');\r
+               redirect($CONF['AdminURL'] . '?action=pluginlist');\r
        }\r
 \r
        /**\r
         * @todo document this\r
         */\r
        function action_plugindown() {\r
-               global $member, $manager;\r
+               global $member, $manager, $CONF;\r
 \r
                // check if allowed\r
                $member->isAdmin() or $this->disallow();\r
@@ -6393,7 +6334,7 @@ selector();
 \r
                //$this->action_pluginlist();\r
                // To avoid showing ticket in the URL, redirect to pluginlist, instead.\r
-               redirect('?action=pluginlist');\r
+               redirect($CONF['AdminURL'] . '?action=pluginlist');\r
        }\r
 \r
        /**\r
@@ -6542,7 +6483,7 @@ selector();
                                echo '<tr><th colspan="2">Options for ', htmlspecialchars($aOption['pfile']),'</th></tr>';\r
                        }\r
 \r
-                       $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);\r
+                       $meta = NucleusPlugin::getOptionMeta($aOption['typeinfo']);\r
                        if (@$meta['access'] != 'hidden') {\r
                                echo '<tr>';\r
                                listplug_plugOptionRow($aOption);\r