- global $member, $nucleus, $CONF, $manager;\r
-\r
- if ( self::existsSkinContents('pagehead') )\r
- {\r
- if ( isset($extrahead) && !empty($extrahead) )\r
- {\r
- self::$extrahead = $extrahead;\r
- }\r
- self::$skin->parse('pagehead');\r
- }\r
- else\r
- {\r
- $data = array(\r
- 'extrahead' => &$extrahead,\r
- 'action' => self::$action\r
- );\r
- \r
- $manager->notify('AdminPrePageHead', $data);\r
- \r
- $baseUrl = Entity::hsc($CONF['SkinsURL']);\r
- \r
- /*\r
- * TODO: obsoleted\r
- if ( !array_key_exists('AdminCSS', $CONF) )\r
- {\r
- sql_query("INSERT INTO " . sql_table('config') . " VALUES ('AdminCSS', 'original')");\r
- $CONF['AdminCSS'] = 'original';\r
- }\r
- */\r
- \r
- /* HTTP 1.1 application for no caching */\r
- header("Cache-Control: no-cache, must-revalidate");\r
- header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");\r
- \r
- $root_element = 'html';\r
- $charset = i18n::get_current_charset();\r
- $locale = preg_replace('#_#', '-', i18n::get_current_locale());\r
- $xml_version_info = self::$xml_version_info;\r
- $formal_public_identifier = self::$formal_public_identifier;\r
- $system_identifier = self::$system_identifier;\r
- $xhtml_namespace = self::$xhtml_namespace;\r
- \r
- echo "<?xml version=\"{$xml_version_info}\" encoding=\"{$charset}\" ?>\n";\r
- echo "<!DOCTYPE {$root_element} PUBLIC \"{$formal_public_identifier}\" \"{$system_identifier}\">\n";\r
- echo "<{$root_element} xmlns=\"{$xhtml_namespace}\" xml:lang=\"{$locale}\" lang=\"{$locale}\">\n";\r
- echo "<head>\n";\r
- echo '<title>' . Entity::hsc($CONF['SiteName']) . " - Admin</title>\n";\r
- /*\r
- * TODO: obsoleted\r
- echo "<link rel=\"stylesheet\" title=\"Nucleus Admin Default\" type=\"text/css\" href=\"{$baseUrl}admin/defaultadmin/styles/admin_{$CONF["AdminCSS"]}.css\" />\n";\r
- */\r
- echo "<link rel=\"stylesheet\" title=\"Nucleus Admin Default\" type=\"text/css\" href=\"{$baseUrl}admin/defaultadmin/styles/addedit.css\" />\n";\r
- echo "<script type=\"text/javascript\" src=\"{$baseUrl}javascript/edit.js\"></script>\n";\r
- echo "<script type=\"text/javascript\" src=\"{$baseUrl}javascript/admin.js\"></script>\n";\r
- echo "<script type=\"text/javascript\" src=\"{$baseUrl}javascript/compatibility.js\"></script>\n";\r
- echo "{$extrahead}\n";\r
- echo "</head>\n\n";\r
- echo "<body>\n";\r
- echo "<div id=\"adminwrapper\">\n";\r
- echo "<div class=\"header\">\n";\r
- echo '<h1>' . Entity::hsc($CONF['SiteName']) . "</h1>\n";\r
- echo "</div>\n";\r
- echo "<div id=\"container\">\n";\r
- echo "<div id=\"content\">\n";\r
- echo "<div class=\"loginname\">\n";\r
- if ( $member->isLoggedIn() )\r
- {\r
- echo _LOGGEDINAS . ' ' . $member->getDisplayName() ." - <a href='index.php?action=logout'>" . _LOGOUT. "</a><br />\n";\r
- echo "<a href='index.php?action=overview'>" . _ADMINHOME . "</a> - ";\r
- }\r
- else\r
- {\r
- echo '<a href="index.php?action=showlogin" title="Log in">' . _NOTLOGGEDIN . "</a><br />\n";\r
- }\r
- echo "<a href='".$CONF['IndexURL']."'>"._YOURSITE."</a><br />\n";\r
- echo '(';\r
- \r
- if (array_key_exists('codename', $nucleus) && $nucleus['codename'] != '' )\r
- {\r
- $codenamestring = ' "' . $nucleus['codename'].'"';\r
- }\r
- else\r
- {\r
- $codenamestring = '';\r
- }\r
- \r
- if ( $member->isLoggedIn() && $member->isAdmin() )\r
- {\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
- \r
- $newestVersion = getLatestVersion();\r
- $newestCompare = str_replace('/', '.', $newestVersion);\r
- $currentVersion = str_replace(array('/','v'), array('.',''), $nucleus['version']);\r
- \r
- if ( $newestVersion && version_compare($newestCompare, $currentVersion) > 0 )\r
- {\r
- echo "<br />\n";\r
- echo '<a style="color:red" href="http://nucleuscms.org/upgrade.php" title="' . _ADMIN_SYSTEMOVERVIEW_LATESTVERSION_TITLE . '">';\r
- echo _ADMIN_SYSTEMOVERVIEW_LATESTVERSION_TEXT . $newestVersion;\r
- echo "</a>";\r
- }\r
- }\r
- else\r
- {\r
- echo "Nucleus CMS {$nucleus['version']}{$codenamestring}";\r
- }\r
- echo ')';\r
- echo '</div>';\r
- }\r
- return;\r
- }\r
- \r
- /**\r
- * Admin::pagefoot()\r
- * Output admin page foot include quickmenu\r
- * \r
- * @param void\r
- * @return void\r
- */\r
- static private function pagefoot()\r
- {\r
- global $action, $member, $manager;\r
- \r
- if ( self::existsSkinContents('pagefoot') )\r
- {\r
- self::$skin->parse('pagefoot');\r
- exit;\r
- }\r
- else\r
- {\r
- $data = array(\r
- 'action' => self::$action\r
- );\r
- \r
- $manager->notify('AdminPrePageFoot', $data);\r
- \r
- if ( $member->isLoggedIn() && ($action != 'showlogin') )\r
- {\r
- echo '<h2>' . _LOGOUT . "</h2>\n";\r
- echo "<ul>\n";\r
- echo '<li><a href="index.php?action=overview">' . _BACKHOME . "</a></li>\n";\r
- echo '<li><a href="index.php?action=logout">' . _LOGOUT . "</a></li>\n";\r
- echo "</ul>\n";\r
- }\r
- \r
- echo "<div class=\"foot\">\n";\r
- echo '<a href="' . _ADMINPAGEFOOT_OFFICIALURL . '">Nucleus CMS</a> © 2002-' . date('Y') . ' ' . _ADMINPAGEFOOT_COPYRIGHT;\r
- echo '-';\r
- echo '<a href="' . _ADMINPAGEFOOT_DONATEURL . '">' . _ADMINPAGEFOOT_DONATE . "</a>\n";\r
- echo "</div>\n";\r
- \r
- echo "<div id=\"quickmenu\">\n";\r
- \r
- if ( ($action != 'showlogin') && ($member->isLoggedIn()) )\r
- {\r
- echo "<ul>\n";\r
- echo '<li><a href="index.php?action=overview">' . _QMENU_HOME . "</a></li>\n";\r
- echo "</ul>\n";\r
- \r
- echo '<h2>' . _QMENU_ADD . "</h2>\n";\r
- echo "<form method=\"get\" action=\"index.php\">\n";\r
- echo "<p>\n";\r
- echo "<input type=\"hidden\" name=\"action\" value=\"createitem\" />\n";\r
- \r
- $showAll = requestVar('showall');\r
- \r
- if ( ($member->isAdmin()) && ($showAll == 'yes') )\r
- {\r
- // Super-Admins have access to all blogs! (no add item support though)\r
- $query = "SELECT bnumber as value, bname as text FROM %s ORDER BY bname;";\r
- $query = sprintf($query, sql_table('blog'));\r
- }\r
- else\r
- {\r
- $query = "SELECT bnumber as value, bname as text FROM %s, %s WHERE tblog=bnumber and tmember=%d ORDER BY bname;";\r
- $query = sprintf($query, sql_table('blog'), sql_table('team'), (integer) $member->getID());\r
- }\r
- $template['name'] = 'blogid';\r
- $template['tabindex'] = 15000;\r
- $template['extra'] = _QMENU_ADD_SELECT;\r
- $template['selected'] = -1;\r
- $template['shorten'] = 10;\r
- $template['shortenel'] = '';\r
- $template['javascript'] = 'onchange="return form.submit()"';\r
- showlist($query, 'select', $template);\r
- \r
- echo "</p>\n";\r
- echo "</form>\n";\r
- \r
- echo "<h2>{$member->getDisplayName()}</h2>\n";\r
- echo "<ul>\n";\r
- echo '<li><a href="index.php?action=editmembersettings">' . _QMENU_USER_SETTINGS . "</a></li>\n";\r
- echo '<li><a href="index.php?action=browseownitems">' . _QMENU_USER_ITEMS . "</a></li>\n";\r
- echo '<li><a href="index.php?action=browseowncomments">' . _QMENU_USER_COMMENTS . "</a></li>\n";\r
- echo "</ul>\n";\r
- \r
- if ( $member->isAdmin() )\r
- {\r
- echo '<h2>' . _QMENU_MANAGE . "</h2>\n";\r
- echo "<ul>\n";\r
- echo '<li><a href="index.php?action=actionlog">' . _QMENU_MANAGE_LOG . "</a></li>\n";\r
- echo '<li><a href="index.php?action=settingsedit">' . _QMENU_MANAGE_SETTINGS . "</a></li>\n";\r
- echo '<li><a href="index.php?action=systemoverview">' . _QMENU_MANAGE_SYSTEM . "</a></li>\n";\r
- echo '<li><a href="index.php?action=usermanagement">' . _QMENU_MANAGE_MEMBERS . "</a></li>\n";\r
- echo '<li><a href="index.php?action=createnewlog">' . _QMENU_MANAGE_NEWBLOG . "</a></li>\n";\r
- echo '<li><a href="index.php?action=backupoverview">' . _QMENU_MANAGE_BACKUPS . "</a></li>\n";\r
- echo '<li><a href="index.php?action=pluginlist">' . _QMENU_MANAGE_PLUGINS . "</a></li>\n";\r
- echo "</ul>\n";\r
- \r
- echo "<h2>" . _QMENU_LAYOUT . "</h2>\n";\r
- echo "<ul>\n";\r
- echo '<li><a href="index.php?action=skinoverview">' . _QMENU_LAYOUT_SKINS . "</a></li>\n";\r
- echo '<li><a href="index.php?action=templateoverview">' . _QMENU_LAYOUT_TEMPL . "</a></li>\n";\r
- echo '<li><a href="index.php?action=skinieoverview">' . _QMENU_LAYOUT_IEXPORT . "</a></li>\n";\r
- echo "</ul>\n";\r
- }\r
- \r
- $data = array('options' => array());\r
- \r
- $manager->notify('QuickMenu', $data);\r
- \r
- if ( count($data['options']) > 0 )\r
- {\r
- echo "<h2>" . _QMENU_PLUGINS . "</h2>\n";\r
- echo "<ul>\n";\r
- foreach ( $data['options'] as $option )\r
- {\r
- echo '<li><a href="' . Entity::hsc($option['url']) . '" title="' . Entity::hsc($option['tooltip']) . '">' . Entity::hsc($option['title']) . "</a></li>\n";\r
- }\r
- echo "</ul>\n";\r
- }\r
- }\r
- else if ( ($action == 'activate') || ($action == 'activatesetpwd') )\r
- {\r
- \r
- echo '<h2>' . _QMENU_ACTIVATE . '</h2>' . _QMENU_ACTIVATE_TEXT;\r
- }\r
- else\r
- {\r
- echo '<h2>' . _QMENU_INTRO . '</h2>' . _QMENU_INTRO_TEXT;\r
- }\r
- \r
- echo "<!-- quickmenu -->\n";\r
- echo "</div>\n";\r
- \r
- echo "<!-- content -->\n";\r
- echo "</div>\n";\r
- \r
- echo "<!-- container -->\n";\r
- echo "</div>\n";\r
- \r
- echo "<!-- adminwrapper -->\n";\r
- echo "</div>\n";\r
- \r
- echo "</body>\n";\r
- echo "</html>\n";\r
- }\r