# HG changeset patch
# User Dan
# Date 1239839087 14400
# Node ID 91f4da84966f461dedffca3dc91a66b58fc661cc
# Parent f808e55fb92aa9222ec612bb70866686c55404e1
New, beautiful, rethought Admin:Home. No, really, you'll like it.
diff -r f808e55fb92a -r 91f4da84966f includes/functions.php
--- a/includes/functions.php Wed Apr 15 19:37:10 2009 -0400
+++ b/includes/functions.php Wed Apr 15 19:44:47 2009 -0400
@@ -2618,6 +2618,35 @@
}
/**
+ * Converts a number to a human file size.
+ * @param int File size
+ * @return string
+ */
+
+function humanize_filesize($size)
+{
+ global $lang;
+
+ if ( $size > ( 1099511627776 * 0.9 ) )
+ {
+ return number_format($size / 1099511627776, 1) . $lang->get('etc_unit_terabytes_short');
+ }
+ if ( $size > ( 1073741824 * 0.9 ) )
+ {
+ return number_format($size / 1073741824, 1) . $lang->get('etc_unit_gigabytes_short');
+ }
+ if ( $size > ( 1048576 * 0.9 ) )
+ {
+ return number_format($size / 1048576, 1) . $lang->get('etc_unit_megabytes_short');
+ }
+ if ( $size > ( 1024 * 0.9 ) )
+ {
+ return number_format($size / 1024, 1) . $lang->get('etc_unit_kilobytes_short');
+ }
+ return "$size " . $lang->get('etc_unit_bytes');
+}
+
+/**
* Injects a string into another string at the specified position.
* @param string The haystack
* @param string The needle
diff -r f808e55fb92a -r 91f4da84966f includes/paths.php
--- a/includes/paths.php Wed Apr 15 19:37:10 2009 -0400
+++ b/includes/paths.php Wed Apr 15 19:44:47 2009 -0400
@@ -427,6 +427,14 @@
function sysmsg($n)
{
global $db, $session, $paths, $template, $plugins; // Common objects
+
+ // sometimes this gets called during die_semicritical()...
+ if ( !is_object($db) )
+ return false;
+
+ if ( !@$db->_conn )
+ return false;
+
$q = $db->sql_query('SELECT page_text, char_tag FROM '.table_prefix.'page_text WHERE page_id=\''.$db->escape(sanitize_page_id($n)).'\' AND namespace=\'System\'');
if( !$q )
{
diff -r f808e55fb92a -r 91f4da84966f includes/sessions.php
--- a/includes/sessions.php Wed Apr 15 19:37:10 2009 -0400
+++ b/includes/sessions.php Wed Apr 15 19:44:47 2009 -0400
@@ -1424,7 +1424,6 @@
$lang = new Language($language);
@setlocale(LC_ALL, $lang->lang_code);
- $this->logout();
$a = getConfig('account_activation');
switch($a)
{
diff -r f808e55fb92a -r 91f4da84966f includes/template.php
--- a/includes/template.php Wed Apr 15 19:37:10 2009 -0400
+++ b/includes/template.php Wed Apr 15 19:44:47 2009 -0400
@@ -3170,6 +3170,11 @@
else
$this->tpl_strings = $vars;
}
+
+ function get_theme_hook()
+ {
+ return '';
+ }
} // class template_nodb
diff -r f808e55fb92a -r 91f4da84966f language/english/admin.json
--- a/language/english/admin.json Wed Apr 15 19:37:10 2009 -0400
+++ b/language/english/admin.json Wed Apr 15 19:44:47 2009 -0400
@@ -214,17 +214,43 @@
inherit_key_local_user: '%this.acl_inherit_local_user% (most specific)',
},
acphome: {
- heading_main: 'Welcome to Runt, the Enano administration panel.',
- welcome_line1: 'Thank you for choosing Enano as your CMS. This screen allows you to see some information about your website, plus some details about how your site is doing statistically.',
- welcome_line2: 'Using the links on the left you can control every aspect of your website\'s look and feel, plus you can manage users, work with pages, and install plugins to make your Enano installation even better.',
+ heading_main: 'Welcome to the Administration Dashboard.',
+ welcome_line1: 'Thanks for choosing Enano as your site\'s CMS! The administration panel gives you control over nearly every aspect of your site. The links to the left allow you to navigate around the panel. Below you will find some statistics on your site and any alerts you might need to attend to.',
+
+ // Stats!
+ stat_header: 'Site statistics',
+ stat_enano_version: 'Enano CMS %version% (%releasename%) View server information and license',
+ stat_numpages: 'Number of pages:',
+ stat_edits: 'Number of edits made:',
+ stat_edits_data: '%edit_count% (average of %per_day% per day)',
+ stat_comments: 'Number of comments:',
+ stat_comments_data: '%comment_count% (average of %per_day% per day)',
+ stat_users: 'Number of users:',
+ stat_filesize: 'Total size of uploaded files:',
+ stat_cachesize: 'Total size of cache:',
+ stat_avatarsize: 'Space occupied by avatars:',
+ stat_dbsize: 'Database size:',
+ stat_dbsize_unsupported: 'Unsupported',
+ stat_installdate: 'Site started:',
+ stat_lastupdate: 'Last Enano upgrade:',
+ stat_lastupdate_never: 'Never',
+
+ heading_alerts: 'Active alerts',
msg_demo_title: 'Enano is running in demo mode.',
msg_demo_body: 'If you borked something up, or if you\'re done testing, you can reset this site. The site is reset automatically once every two hours. When a reset is performed, all custom modifications to the site are lost and replaced with default values.',
- msg_install_files: 'NOTE: It appears that the install/ directory still exists in your Enano installation root. Even though sensitive tools try to avoid hacking attempts, it is highly recommended that you remove the entire install directory from your server for security reasons.',
+ msg_install_files_title: 'Installer files found',
+ msg_install_files_body: 'Please delete the install/ directory from your Enano installation folder – it contains sensitive tools that might allow your site to be compromised.',
heading_updates: 'Check for updates',
- msg_updates_info: 'Periodically, new releases of Enano will be made available. Click the button below to check for updates to Enano. During this process, a request will be sent to the Enano CMS server (ktulu.enanocms.org) over HTTP for an XML file containing a list of the latest releases. No information about your Enano installation will be transmitted.',
+ msg_updates_info: 'The Enano team will on occasion release new versions of Enano. We always recommend that you run the latest available version because many releases contain security patches. Enano checks for updates by looking at an XML file and doesn\'t share any information about your site.',
btn_check_updates: 'Check for updates',
- msg_inactive_users_one: 'It appears that 1 user is awaiting account activation. You can activate the account by going to the User Manager.',
- msg_inactive_users_plural: 'It appears that %num_users% users are awaiting account activation. You can activate those accounts by going to the User Manager.',
+ heading_inactive_users: 'Users are awaiting activation',
+ msg_inactive_users_one: '1 user has requested manual account activation. You can activate the account by going to the User Manager.',
+ msg_inactive_users_plural: '%num_users% users have requested manual account activation. You can activate those accounts by going to the User Manager.',
+ heading_docs: 'Enano documentation',
+ msg_docs_info: 'The Enano administrator\'s handbook is maintained as a wiki. It will help you get started with Enano and learn about how we do things differently.',
+ heading_support: 'Get support',
+ msg_support_info: 'Stuck? Think you found a bug? Tell us about it! Post a message in the Enano support forums to obtain community support for Enano. You may also be interested in our other support channels.',
+
heading_top_pages: 'Most requested pages',
th_toppages_page: 'Page',
th_toppages_hits: 'Hits',
diff -r f808e55fb92a -r 91f4da84966f plugins/SpecialAdmin.php
--- a/plugins/SpecialAdmin.php Wed Apr 15 19:37:10 2009 -0400
+++ b/plugins/SpecialAdmin.php Wed Apr 15 19:44:47 2009 -0400
@@ -73,6 +73,7 @@
list($pid, $ns) = RenderMan::strToPageID($paths->get_pageid_from_url());
if ( $ns == 'Admin' || ( $pid == 'Administration' && $ns == 'Special' ) )
{
+ require(ENANO_ROOT . '/plugins/admin/Home.php');
require(ENANO_ROOT . '/plugins/admin/PageManager.php');
require(ENANO_ROOT . '/plugins/admin/PageEditor.php');
require(ENANO_ROOT . '/plugins/admin/PageGroups.php');
@@ -96,139 +97,6 @@
// function names are IMPORTANT!!! The name pattern is: page__
-function page_Admin_Home() {
- global $db, $session, $paths, $template, $plugins; // Common objects
- global $lang;
- if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
- {
- $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
- echo '