From cc0c2dde8d69c9ba2f372dd7d0d8691e1789a5b2 Mon Sep 17 00:00:00 2001 From: Cameron <e107inc@gmail.com> Date: Fri, 9 Jan 2015 21:43:16 -0800 Subject: [PATCH] Added e_dashboard.php for use in adding custom charts (in new tabs). e_status and e_latest should also be included in this single class. Example coming soon. --- e107_admin/includes/infopanel.php | 44 +++++++++++++++---------------- e107_handlers/plugin_class.php | 7 ++--- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php index 57846fd17..7138fb282 100644 --- a/e107_admin/includes/infopanel.php +++ b/e107_admin/includes/infopanel.php @@ -338,31 +338,29 @@ class adminstyle_infopanel </div> */ + $tab = array(); + $tab['e-stats'] = array('caption'=>$tp->toGlyph('fa-signal').' Stats', 'text'=>$this->renderChart()); + $tab['e-online'] = array('caption'=>$tp->toGlyph('fa-user').' Online ('.$this->renderOnlineUsers('count').')', 'text'=>$this->renderOnlineUsers()); + + + + if($plugs = e107::getAddonConfig('e_dashboard',null, 'chart')) + { + foreach($plugs as $plug => $val) + { + foreach($val as $item) + { + if(!empty($item)) + { + $tab[] = $item; + } + } + } + } + + return e107::getForm()->tabs($tab); - - $dashboard = ' - <ul class="nav nav-tabs"> - <li class="active"><a href="#tab1" data-toggle="tab">'.$tp->toGlyph('fa-signal').' Stats</a></li> - <li ><a href="#tab2" data-toggle="tab">'.$tp->toGlyph('fa-user').' Online ('.$this->renderOnlineUsers('count').')</a></li> - </ul> - - <div class="tab-content" style="min-height:300px"> - - <div class="tab-pane active" id="tab1"> - <div class="separator"> - '.$this->renderChart().' - </div> - </div> - - <div class="tab-pane" id="tab2"> - <div class="separator"> - '.$this->renderOnlineUsers().' - </div> - </div> - - </div>'; - return $dashboard; } diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index d9e49e1d7..3d468f1b0 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -36,19 +36,20 @@ class e107plugin 'e_meta', 'e_emailprint', 'e_frontpage', - 'e_latest', - 'e_status', + 'e_latest', // @TODO Move inside e_dashboard as latest() + 'e_status', // @TODO Move inside e_dashboard as status() 'e_search', 'e_shortcode', 'e_module', 'e_event', 'e_comment', 'e_sql', + 'e_dashboard', // Admin Front-Page addon. // 'e_userprofile', @deprecated @see e_user 'e_header', // 'e_userinfo', @deprecated @see e_user 'e_tagwords', - 'e_url', + 'e_url', // simple mod-rewrite. 'e_mailout', 'e_sitelink',