]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4185, #2111 adds control panel widget
authorcash <cash.costello@gmail.com>
Fri, 9 Dec 2011 01:09:36 +0000 (20:09 -0500)
committercash <cash.costello@gmail.com>
Fri, 9 Dec 2011 01:09:36 +0000 (20:09 -0500)
actions/admin/site/flush_cache.php [new file with mode: 0644]
engine/lib/admin.php
languages/en.php
views/default/widgets/control_panel/content.php [new file with mode: 0644]

diff --git a/actions/admin/site/flush_cache.php b/actions/admin/site/flush_cache.php
new file mode 100644 (file)
index 0000000..b81f5fc
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * Flush all the caches
+ */
+
+elgg_invalidate_simplecache();
+elgg_filepath_cache_reset();
+
+system_message(elgg_echo('admin:cache:flushed'));
+forward(REFERER);
\ No newline at end of file
index 3baf2ff617ff43c73fe5c5124a3287b24483aa3a..a191d740bb005f9217a1c3c18aa0a98a31f1c21d 100644 (file)
@@ -225,6 +225,7 @@ function admin_init() {
 
        elgg_register_action('admin/site/update_basic', '', 'admin');
        elgg_register_action('admin/site/update_advanced', '', 'admin');
+       elgg_register_action('admin/site/flush_cache', '', 'admin');
 
        elgg_register_action('admin/menu/save', '', 'admin');
 
@@ -301,7 +302,7 @@ function admin_init() {
        }
                        
        // widgets
-       $widgets = array('online_users', 'new_users', 'content_stats', 'admin_welcome');
+       $widgets = array('online_users', 'new_users', 'content_stats', 'admin_welcome', 'control_panel');
        foreach ($widgets as $widget) {
                elgg_register_widget_type(
                                $widget,
@@ -616,7 +617,7 @@ function elgg_add_admin_widgets($event, $type, $user) {
 
        // In the form column => array of handlers in order, top to bottom
        $adminWidgets = array(
-               1 => array('admin_welcome'),
+               1 => array('control_panel', 'admin_welcome'),
                2 => array('online_users', 'new_users', 'content_stats'),
        );
        
index 036ca88834ced5f23ee6552da23d872d8ed37c4b..a2e6e152e9478b80bceefa3eff7f2f64da913de3 100644 (file)
@@ -610,6 +610,12 @@ $english = array(
        // argh, this is ugly
        'admin:widget:admin_welcome:outro' => '<br />Be sure to check out the resources available through the footer links and thank you for using Elgg!',
 
+       'admin:widget:control_panel' => 'Control panel',
+       'admin:widget:control_panel:help' => "Provides easy access to common controls",
+
+       'admin:cache:flush' => 'Flush the caches',
+       'admin:cache:flushed' => "The site's caches have been flushed",
+
        'admin:footer:faq' => 'Administration FAQ',
        'admin:footer:manual' => 'Administration Manual',
        'admin:footer:community_forums' => 'Elgg Community Forums',
diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php
new file mode 100644 (file)
index 0000000..d2db54b
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Admin control panel widget
+ */
+
+elgg_register_menu_item('admin_control_panel', array(
+       'name' => 'flush',
+       'text' => elgg_echo('admin:cache:flush'),
+       'href' => 'action/admin/site/flush_cache',
+       'is_action' => true,
+       'link_class' => 'elgg-button elgg-button-action',
+));
+
+elgg_register_menu_item('admin_control_panel', array(
+       'name' => 'upgrade',
+       'text' => elgg_echo('upgrade'),
+       'href' => 'upgrade.php',
+       'link_class' => 'elgg-button elgg-button-action',
+));
+
+echo elgg_view_menu('admin_control_panel', array(
+       'class' => 'elgg-menu-hz',
+       'item_class' => 'mrm',
+));