Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit.

  • Loading branch information...
commit 4ed827c5eb133bf7973b62b0f325acecb888fdba 0 parents
@mrtopher authored
Showing with 2,252 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +164 −0 themes/third_party/dashee/css/cp.css
  3. BIN  themes/third_party/dashee/images/ajax-loader.gif
  4. BIN  themes/third_party/dashee/images/icon-collapse.png
  5. BIN  themes/third_party/dashee/images/icon-move.png
  6. BIN  themes/third_party/dashee/images/icon-remove.png
  7. BIN  themes/third_party/dashee/images/icon-settings.png
  8. +325 −0 themes/third_party/dashee/js/dashee.js
  9. +163 −0 third_party/dashee/ext.dashee.php
  10. +51 −0 third_party/dashee/language/english/lang.dashee.php
  11. +445 −0 third_party/dashee/mcp.dashee.php
  12. +47 −0 third_party/dashee/mod.dashee.php
  13. +317 −0 third_party/dashee/models/dashee_model.php
  14. +87 −0 third_party/dashee/upd.dashee.php
  15. +15 −0 third_party/dashee/views/index.php
  16. +19 −0 third_party/dashee/views/widgets_listing.php
  17. +70 −0 third_party/dashee/widgets/wgt.blank.php
  18. +91 −0 third_party/dashee/widgets/wgt.create_links.php
  19. +90 −0 third_party/dashee/widgets/wgt.feed_reader.php
  20. +102 −0 third_party/dashee/widgets/wgt.modify_links.php
  21. +72 −0 third_party/dashee/widgets/wgt.new_members.php
  22. +74 −0 third_party/dashee/widgets/wgt.recent_entries.php
  23. +70 −0 third_party/dashee/widgets/wgt.view_links.php
  24. +49 −0 third_party/dashee/widgets/wgt.welcome.php
1  .gitignore
@@ -0,0 +1 @@
+.DS_Store
164 themes/third_party/dashee/css/cp.css
@@ -0,0 +1,164 @@
+/* EE Override */
+#mainContent .pageContents { padding:0; background-color:#FFF; }
+.heading h2.edit { display:none; }
+#breadCrumb ol { display: none; }
+.contents { margin:0; }
+
+
+/* Module CSS */
+#dashContainer .column {
+ float: left;
+ width: 31%;
+ margin-left:3.3%;
+ /* Min-height: */
+ min-height: 400px;
+ height: auto !important;
+ height: 400px;
+ }
+#column1.column { margin-left:0; }
+#dashContainer .widget {
+ margin-bottom:15px;
+ padding: 2px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+}
+#dashContainer .widget .widget-head {
+ overflow: hidden;
+ width: 100%;
+ height: 35px;
+ line-height: 35px;
+ background:#9DAEB9;
+ border-top-left-radius:10px;
+ border-top-right-radius:10px;
+}
+#dashContainer .widget .widget-head h3 {
+ padding: 0 10px;
+ float: left;
+ color:#FFF;
+ text-shadow:0 1px 0 #666666;
+ font-size:1.6em;
+}
+#dashContainer .widget .widget-content {
+ background: #ECF1F4;
+ color: #5F6C74;
+ border-radius:0 0 10px 10px;
+ line-height: 1.2em;
+ overflow: hidden;
+ /* Min-height: */
+ min-height: 175px;
+ height: auto !important;
+ height: px;
+}
+#dashContainer .widget .widget-content p {
+ padding: 0.8em 5px;
+}
+#dashContainer .widget .widget-content form p {
+ padding: 3px 5px;
+}
+#dashContainer .widget .widget-content pre {
+ padding: 0.5em 5px;
+ color: #EEE;
+ font-size: 12px;
+}
+#dashContainer .widget .widget-content ul {
+ padding: 5px 5px 5px 30px;
+ list-style: disc;
+}
+#dashContainer .widget .widget-content ul li {padding: 3px 0;}
+#dashContainer .widget .widget-content ul.images {
+ padding: 7px 0 0 0;
+ list-style: none;
+ height: 1%;
+}
+#dashContainer .widget .widget-content ul.images li {
+ display: inline;
+ float: left;
+}
+#dashContainer .widget .widget-content ul.images img {
+ display: inline;
+ float: left;
+ margin: 0 0 7px 7px;
+}
+#dashContainer .widget form input[type=text] { width:96%; }
+
+#dashContainer .widget .widget-content table { width:100%; border-collapse:collapse; border-top: 1px solid #D0D7DF; border-right: 1px solid #D0D7DF; }
+#dashContainer .widget .widget-content thead { text-align:left; background:#2D3A42; color:#FFF; }
+#dashContainer .widget .widget-content th, #dashContainer .widget .widget-content td { padding:5px; border-bottom: 1px solid #D0D7DF; border-left: 1px solid #D0D7DF; }
+
+.widget-head a.remove {
+ float: right;
+ display: none;
+ background: url(../images/icon-remove.png) no-repeat;
+ width: 12px;
+ height: 12px;
+ margin: 12px 8px 8px 0;
+ text-indent: -9999em;
+ outline: none;
+}
+
+.widget-head a.edit {
+ float: right;
+ display: none;
+ background: url(../images/icon-settings.png) no-repeat;
+ width: 12px;
+ height: 12px;
+ text-indent: -9999em;
+ margin: 12px 8px 8px 4px;
+ outline: none;
+}
+
+.widget-head a.collapse {
+ float: right;
+ display: none;
+ background: url(../images/icon-collapse.png) no-repeat;
+ width: 12px;
+ height: 12px;
+ text-indent: -9999em;
+ margin: 14px 6px 8px 4px;
+ outline: none;
+}
+
+.widget-placeholder { border: 2px dashed #999;}
+
+
+/* Widget Specific Styling */
+#dashContainer .welcome .widget-head {
+ background:#FFFF66;
+}
+#dashContainer .welcome .widget-head h3 {
+ color:#666;
+ text-shadow:none;
+}
+#dashContainer .welcome .widget-content {
+ background: #FFFFCC;
+}
+
+#dashContainer .eedefault .widget-content ul, #dashContainer .eedefault .widget-content ul li { padding:0; }
+#dashContainer .eedefault .widget-content ul li.item a {
+ background: url("../../../cp_themes/default/images/contentmenu_icons.gif") no-repeat scroll 17px -120px #ECF1F4;
+ }
+#dashContainer .eedefault .widget-content ul li.group a {
+ background: url("../../../cp_themes/default/images/contentmenu_icons.gif") no-repeat scroll 17px -80px #ECF1F4;
+ }
+#dashContainer .eedefault .widget-content ul li.site a {
+ background: url("../../../cp_themes/default/images/contentmenu_icons.gif") no-repeat scroll 17px 6px #ECF1F4;
+ }
+#dashContainer .eedefault .widget-content ul li.resource a {
+ background: url("../../../cp_themes/default/images/contentmenu_icons.gif") no-repeat scroll 17px -38px #ECF1F4;
+ }
+#dashContainer .eedefault .widget-content ul li a {
+ background-color: #ECF1F4;
+ border-bottom: 1px solid #D0D7DF;
+ border-top: 1px solid #FFFFFF;
+ display: block;
+ font-size: 13px;
+ font-weight: bold;
+ padding: 5px 0 4px 40px;
+ color:#5F6C74;
+ }
+#dashContainer .eedefault .widget-content ul li a:hover {
+ background-color: #fff;
+ color: #e11842;
+ text-shadow: none;
+ text-decoration: none;
+ }
BIN  themes/third_party/dashee/images/ajax-loader.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  themes/third_party/dashee/images/icon-collapse.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  themes/third_party/dashee/images/icon-move.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  themes/third_party/dashee/images/icon-remove.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  themes/third_party/dashee/images/icon-settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
325 themes/third_party/dashee/js/dashee.js
@@ -0,0 +1,325 @@
+/*
+ * Script from NETTUTS.com [by James Padolsey] modified by Chris Monnat
+ * @requires jQuery($), jQuery UI & sortable/draggable UI modules
+ */
+
+var dashEE = {
+
+ jQuery : $,
+
+ settings : {
+ columns : '.column',
+ widgetSelector: '.widget',
+ handleSelector: '.widget-head',
+ contentSelector: '.widget-content',
+ widgetDefault : {
+ movable: true,
+ removable: true,
+ collapsible: true,
+ editable: false
+ },
+ widgetIndividual : {
+ dynamic : {
+ movable: false,
+ removable: true,
+ collapsible: true,
+ editable: true
+ }
+ }
+ },
+
+ init : function () {
+ this.addWidgetControls();
+ this.makeSortable();
+ },
+
+ getWidgetSettings : function (id) {
+ var $ = this.jQuery,
+ settings = this.settings;
+ return (id&&settings.widgetIndividual[id]) ? $.extend({},settings.widgetDefault,settings.widgetIndividual[id]) : settings.widgetDefault;
+ },
+
+ addWidgetControls : function () {
+ var dashEE = this,
+ $ = this.jQuery,
+ settings = this.settings;
+
+ $(settings.widgetSelector, $(settings.columns)).each(function () {
+ var thisWidgetSettings = dashEE.getWidgetSettings($(this).attr('dashee'));
+ if (thisWidgetSettings.removable) {
+ $('<a href="#" title="close" class="remove">CLOSE</a>').mousedown(function (e) {
+ e.stopPropagation();
+ }).click(function () {
+ var thisLink = $(this);
+ var thisWidget = thisLink.parents('li.widget');
+ var id = thisWidget.attr('id');
+ var col = thisWidget.parents('ul.column').attr('id').substr(-1);
+
+ $('#dashConfirm').dialog({
+ resizable: false,
+ height:140,
+ modal: true,
+ buttons: {
+ 'No': function() {
+ $(this).dialog("close");
+ },
+ 'Yes': function() {
+ $.ajax({
+ type: 'GET',
+ url: './index.php?D=cp&C=addons_modules&M=show_module_cp&module=dashee&method=remove_widget&col='+col+'&wgt='+id,
+ dataTyle: 'html',
+ success: function(html) {
+ thisLink.parents(settings.widgetSelector).animate({
+ opacity: 0
+ },function () {
+ $(this).wrap('<div/>').parent().slideUp(function () {
+ $(this).remove();
+ });
+ });
+ $.ee_notice("Widget has been removed.", {type: 'success'});
+ setTimeout("$('#dashConfirm').dialog('close');", 750);
+ },
+ error: function(html) {
+ $.ee_notice("ERROR: The widget you selected could not be removed.", {type: 'error', open: true});
+ }
+ });
+ }
+ },
+ title: 'Remove Widget'
+ });
+ return false;
+ }).appendTo($(settings.handleSelector, this));
+ }
+
+ if (thisWidgetSettings.editable) {
+ $('<a href="#" title="settings" class="edit">EDIT</a>').mousedown(function (e) {
+ e.stopPropagation();
+ }).click(function () {
+ var thisLink = $(this);
+ var thisWidget = thisLink.parents('li.widget');
+ var thisID = '#'+thisWidget.attr('id');
+ var wgt = thisWidget.attr('id');
+ var col = thisWidget.parents('ul.column').attr('id').substr(-1);
+
+ $(thisID+' .widget-content').html('<p><center><img src="../themes/third_party/dashee/images/ajax-loader.gif" /></center></p>');
+
+ $.ajax({
+ type: 'GET',
+ url: './index.php?D=cp&C=addons_modules&M=show_module_cp&module=dashee&method=widget_settings&col='+col+'&wgt='+wgt,
+ dataTyle: 'html',
+ success: function(html) {
+ $(thisID+' .widget-content').html(html);
+
+ $('form.dashForm').submit(function(event) {
+ event.preventDefault();
+ $(thisID+' .widget-content').html('<p><center><img src="../themes/third_party/dashee/images/ajax-loader.gif" /></center></p>');
+
+ $.ajax({
+ type: 'POST',
+ url: './index.php?D=cp&C=addons_modules&M=show_module_cp&module=dashee&method=update_settings',
+ data: $(this).serialize()+'&col='+col+'&wgt='+wgt,
+ dataTyle: 'json',
+ success: function(html) {
+ var response = $.parseJSON(html);
+ $(thisID+' .widget-head h3').html(response.title);
+ $(thisID+' .widget-content').html(response.content);
+ },
+ error: function(html) {
+ $(thisID+' .content').html('<p>There was a problem.</p>');
+ }
+ });
+
+ });
+ },
+ error: function(html) {
+ $(thisID+' .content').html('<p>There was a problem.</p>');
+ }
+ });
+ }).appendTo($(settings.handleSelector,this));
+ }
+
+ if (thisWidgetSettings.collapsible) {
+ $('<a href="#" title="collapse" class="collapse">COLLAPSE</a>').mousedown(function (e) {
+ e.stopPropagation();
+
+ if($(this).parents(settings.widgetSelector).find(settings.contentSelector).is(':visible')) {
+ $(this).css({backgroundPosition: '0 -15px'})
+ .parents(settings.widgetSelector)
+ .find(settings.contentSelector).hide();
+ }
+ else {
+ $(this).css({backgroundPosition: ''})
+ .parents(settings.widgetSelector)
+ .find(settings.contentSelector).show();
+ }
+ }).appendTo($(settings.handleSelector,this));
+ }
+
+ /*if (thisWidgetSettings.collapsible) {
+ $('<a href="#" title="collapse" class="collapse">COLLAPSE</a>').mousedown(function (e) {
+ e.stopPropagation();
+ }).toggle(function () {
+ $(this).css({backgroundPosition: '0 -15px'})
+ .parents(settings.widgetSelector)
+ .find(settings.contentSelector).hide();
+ return false;
+ },function () {
+ $(this).css({backgroundPosition: ''})
+ .parents(settings.widgetSelector)
+ .find(settings.contentSelector).show();
+ return false;
+ }).appendTo($(settings.handleSelector,this));
+ }*/
+
+ });
+
+ $('#dashContainer .widget-head').hover(
+ function() {
+ $(this).find('a.collapse').show();
+ $(this).find('a.edit').show();
+ $(this).find('a.remove').show();
+ },
+ function() {
+ $(this).find('a.collapse').hide();
+ $(this).find('a.edit').hide();
+ $(this).find('a.remove').hide();
+ }
+ );
+
+ },
+
+ attachStylesheet : function (href) {
+ var $ = this.jQuery;
+ return $('<link href="' + href + '" rel="stylesheet" type="text/css" />').appendTo('head');
+ },
+
+ makeSortable : function () {
+ var dashEE = this,
+ $ = this.jQuery,
+ settings = this.settings,
+ $sortableItems = $(settings.widgetSelector);
+ /*$sortableItems = (function () {
+ var notSortable = '';
+ $(settings.widgetSelector,$(settings.columns)).each(function (i) {
+ if (!dashEE.getWidgetSettings(this.id).movable) {
+ if(!this.id) {
+ this.id = 'widget-no-id-' + i;
+ }
+ notSortable += '#' + this.id + ',';
+ }
+ });
+ return $('> li:not(' + notSortable + ')', settings.columns);
+ })();*/
+
+ //$sortableItems.find(settings.handleSelector).css({
+ $sortableItems.find(settings.handleSelector).css({
+ cursor: 'move'
+ }).mousedown(function (e) {
+ $sortableItems.css({width:''});
+ $(this).parent().css({
+ width: $(this).parent().width() + 'px'
+ });
+ }).mouseup(function () {
+ if(!$(this).parent().hasClass('dragging')) {
+ $(this).parent().css({width:''});
+ } else {
+ $(settings.columns).sortable('disable');
+ }
+ });
+
+ $(settings.columns).sortable({
+ items: $sortableItems,
+ connectWith: $(settings.columns),
+ handle: settings.handleSelector,
+ placeholder: 'widget-placeholder',
+ forcePlaceholderSize: true,
+ revert: 300,
+ delay: 100,
+ opacity: 0.8,
+ containment: 'document',
+ start: function (e,ui) {
+ $(ui.helper).addClass('dragging');
+ },
+ stop: function (e,ui) {
+ $(ui.item).css({width:''}).removeClass('dragging');
+ $(settings.columns).sortable('enable');
+
+ var i = 1;
+ var widgets = '';
+ var lastCol = '';
+ $(settings.widgetSelector).each(function() {
+ var col = parseInt($(this).parents('ul.column').attr('id').substr(-1));
+ widgets += col+':'+$(this).attr('id');
+
+ if(i < $(settings.widgetSelector).size()) {
+ widgets += '|';
+ }
+ ++i;
+ });
+
+ // save new order to DB
+ $.ajax({
+ type: 'GET',
+ url: './index.php?D=cp&C=addons_modules&M=show_module_cp&module=dashee&method=update_widget_order',
+ data: 'order='+widgets,
+ dataTyle: 'html',
+ success: function(html) {
+ $.ee_notice("Widget order updated.", {type: 'success'});
+ },
+ error: function(html) {
+ $.ee_notice("ERROR: Unable to update widget order in DB.", {type: 'error', open: true});
+ }
+ });
+ }
+ });
+ }
+
+};
+
+$().ready(function() {
+ // Override default breadcrumb display to make module look like default CP homepage.
+ $('#breadCrumb ol li').slice(2).remove();
+ $('#breadCrumb ol li:last-child').attr('class', 'last').html('Dashboard');
+
+ // Click event to collapse all widgets.
+ $('a[href="#collapse"]').click(function() {
+ $(dashEE.settings.widgetSelector).each(function () {
+ $(this).find('a.collapse').css({backgroundPosition: '0 -15px'});
+ $(this).find(dashEE.settings.contentSelector).hide();
+ });
+ });
+
+ // Click event to expand all widgets.
+ $('a[href="#expand"]').click(function() {
+ $(dashEE.settings.widgetSelector).each(function () {
+ $(this).find('a.collapse').css({backgroundPosition: ''});
+ $(this).find(dashEE.settings.contentSelector).show();
+ });
+ });
+
+ // Click event to display available widgets listing.
+ $('a[href="#widgets"]').click(function() {
+ if($('a[href="#widgets"]').html() == 'Widgets') {
+ $('#dashListing .content').html('<p>&nbsp;</p><p><center>Loading...</center></p><p><center><img src="../themes/third_party/dashee/images/ajax-loader.gif" /></center></p><p>&nbsp;</p>');
+ $('#dashListing').slideDown();
+ $.ajax({
+ type: 'GET',
+ url: './index.php?D=cp&C=addons_modules&M=show_module_cp&module=dashee&method=get_widget_listing',
+ dataTyle: 'html',
+ success: function(html) {
+ $('#dashListing .content').html(html);
+ },
+ error: function(html) {
+ $('#dashListing .content').html('<p>There was a problem.</p>');
+ }
+ });
+ $('a[href="#widgets"]').html('Close');
+ }
+ else {
+ $('#dashListing').slideUp();
+ $('a[href="#widgets"]').html('Widgets');
+ }
+ });
+
+ dashEE.init();
+});
163 third_party/dashee/ext.dashee.php
@@ -0,0 +1,163 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+/**
+ * ExpressionEngine - by EllisLab
+ *
+ * @package ExpressionEngine
+ * @author ExpressionEngine Dev Team
+ * @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
+ * @license http://expressionengine.com/user_guide/license.html
+ * @link http://expressionengine.com
+ * @since Version 2.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * dashEE Extension
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Extension
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Dashee_ext {
+
+ public $settings = array();
+ public $description = 'Handle redirection and link remapping to alternate dashEE dashboard instead of defaule CP Home.';
+ public $docs_url = 'http://dash-ee.com';
+ public $name = 'dashEE';
+ public $settings_exist = 'n';
+ public $version = '1.0';
+
+ private $_EE;
+
+ /**
+ * Constructor
+ *
+ * @param mixed Settings array or empty string if none exist.
+ */
+ public function __construct($settings = '')
+ {
+ $this->_EE =& get_instance();
+ $this->settings = $settings;
+
+ $this->_base_qs = 'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=dashee';
+ $this->_base_url = BASE .AMP .$this->_base_qs;
+ }
+
+ // ----------------------------------------------------------------------
+
+ /**
+ * Activate Extension
+ *
+ * This function enters the extension into the exp_extensions table
+ *
+ * @see http://codeigniter.com/user_guide/database/index.html for
+ * more information on the db class.
+ *
+ * @return void
+ */
+ public function activate_extension()
+ {
+ // Setup custom settings in this array.
+ $this->settings = array();
+
+ $hooks = array(
+ 'cp_js_end' => 'crumb_remap',
+ 'cp_member_login' => 'member_redirect',
+ );
+
+ foreach ($hooks as $hook => $method)
+ {
+ $data = array(
+ 'class' => __CLASS__,
+ 'method' => $method,
+ 'hook' => $hook,
+ 'settings' => serialize($this->settings),
+ 'version' => $this->version,
+ 'enabled' => 'y'
+ );
+
+ $this->_EE->db->insert('extensions', $data);
+ }
+ }
+
+ // ----------------------------------------------------------------------
+
+ /**
+ * Remap Breadcrumb Nav
+ *
+ * Returns JS to modify default main nav home button, breadcrumb href
+ * and html attributes site wide so users are directed to module instead
+ * of default EE CP Home.
+ *
+ * @return string
+ */
+ public function crumb_remap()
+ {
+ return "
+ $().ready(function() {
+ $('ul#navigationTabs li.home a').attr('href', '".htmlspecialchars_decode($this->_base_url)."');
+ $('#breadCrumb ol li:nth-child(2) a').attr('href', '".htmlspecialchars_decode($this->_base_url)."').html('Dashboard');
+ $('#breadCrumb ol').show();
+ });
+ ";
+ }
+
+ // ----------------------------------------------------------------------
+
+ /**
+ * Redirect Members on Login
+ *
+ * Automatically redirects members to module instead of default EE CP Home
+ * when logging into the CP.
+ *
+ * @return NULL
+ */
+ public function member_redirect()
+ {
+ $this->_EE->functions->redirect($this->_base_url);
+ }
+
+ // ----------------------------------------------------------------------
+
+ /**
+ * Disable Extension
+ *
+ * This method removes information from the exp_extensions table
+ *
+ * @return void
+ */
+ function disable_extension()
+ {
+ $this->_EE->db->where('class', __CLASS__);
+ $this->_EE->db->delete('extensions');
+ }
+
+ // ----------------------------------------------------------------------
+
+ /**
+ * Update Extension
+ *
+ * This function performs any necessary db updates when the extension
+ * page is visited
+ *
+ * @return mixed void on update / false if none
+ */
+ function update_extension($current = '')
+ {
+ if ($current == '' OR $current == $this->version)
+ {
+ return FALSE;
+ }
+ }
+
+ // ----------------------------------------------------------------------
+}
+
+/* End of file ext.dashee.php */
+/* Location: /system/expressionengine/third_party/dashee/ext.dashee.php */
51 third_party/dashee/language/english/lang.dashee.php
@@ -0,0 +1,51 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+$lang = array(
+ 'dashee_module_name' =>
+ 'dashEE',
+
+ 'dashee_module_description' =>
+ 'Fully customizable alternate CP dashboard.',
+
+ 'module_home' => 'dashEE Home',
+
+ 'dashee_term' => 'Dashboard',
+
+ 'btn_collapse' => '- Collapse All',
+ 'btn_expand' => '+ Expand All',
+ 'btn_widgets' => 'Widgets',
+
+ 'widget_added' => 'Widget added.',
+
+ 'permission_denied' => 'You do not have permission to use this widget.',
+
+
+ // Widgets
+ 'wgt_create_links_name' => 'EE Create Links',
+ 'wgt_create_links_description' => 'EE create links from default control panel.',
+
+ 'wgt_modify_links_name' => 'EE Modify Links',
+ 'wgt_modify_links_description' => 'EE modify links from default control panel.',
+
+ 'wgt_view_links_name' => 'EE View Links',
+ 'wgt_view_links_description' => 'EE view links from default control panel.',
+
+ 'wgt_recent_entries_name' => 'Recent Entries',
+ 'wgt_recent_entries_description' => 'Displays ten most recent EE entires.',
+
+ 'wgt_welcome_name' => 'Welcome to dashEE',
+ 'wgt_welcome_description' => 'General module info and links.',
+
+ 'wgt_new_members_name' => 'New Members',
+ 'wgt_new_members_description' => 'The last 10 members who have joined your site.',
+
+ 'wgt_feed_reader_name' => 'RSS Feed Reader',
+ 'wgt_feed_reader_description' => 'Display the 5 most recent posts from an RSS feed.',
+
+ 'wgt_blank_name' => 'Blank Widget',
+ 'wgt_blank_description' => 'Blank text widget, can be configured with whatever content you wish.',
+
+);
+
+/* End of file lang.dashee.php */
+/* Location: /system/expressionengine/third_party/dashee/language/english/lang.dashee.php */
445 third_party/dashee/mcp.dashee.php
@@ -0,0 +1,445 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+/**
+ * ExpressionEngine - by EllisLab
+ *
+ * @package ExpressionEngine
+ * @author ExpressionEngine Dev Team
+ * @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
+ * @license http://expressionengine.com/user_guide/license.html
+ * @link http://expressionengine.com
+ * @since Version 2.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * dashEE Module Control Panel File
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Module
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Dashee_mcp {
+
+ public $return_data;
+
+ private $_EE;
+ private $_model;
+ private $_base_qs;
+ private $_base_url;
+ private $_theme_url;
+ private $_member_id;
+ private $_settings;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->_EE =& get_instance();
+
+ $this->_EE->load->model('dashee_model');
+ $this->_model = $this->_EE->dashee_model;
+
+ $this->_base_qs = 'C=addons_modules' .AMP .'M=show_module_cp' .AMP .'module=dashee';
+ $this->_base_url = BASE .AMP .$this->_base_qs;
+ $this->_theme_url = $this->_model->get_package_theme_url();
+
+ $this->_member_id = $this->_EE->session->userdata('member_id');
+
+ // get current members dash configuration for use throughout module
+ $this->_get_member_settings($this->_member_id);
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Index Function
+ *
+ * @return void
+ */
+ public function index()
+ {
+ $css = $this->_theme_url .'css/cp.css';
+ $js = $this->_theme_url .'js/dashee.js';
+
+ $this->_EE->cp->add_to_head('<link rel="stylesheet" type="text/css" href="'.$css.'" />');
+ $this->_EE->cp->add_to_head('<script type="text/javascript" src="'.$js.'"></script>');
+
+ $this->_EE->cp->set_variable('cp_page_title', lang('dashee_term'));
+
+ $this->_EE->cp->set_right_nav(array('btn_collapse' => '#collapse', 'btn_expand' => '#expand', 'btn_widgets' => '#widgets'));
+
+ // load widgets
+ $widgets = $this->_widget_loader($this->_settings['widgets']);
+
+ return $this->_EE->load->view('index', array('settings' => $this->_settings, 'content' => $widgets), TRUE);
+ }
+
+ /**
+ * AJAX METHOD
+ * Get listing of all available widgets from installed modules.
+ *
+ * @return NULL
+ */
+ public function get_widget_listing()
+ {
+ $this->_EE->load->library('table');
+
+ $map = directory_map(PATH_THIRD, 2);
+
+ // Fetch installed modules.
+ $installed_mods = $this->_model->get_installed_modules();
+
+ // Determine which installed modules have widgets associated with them.
+ $mods_with_widgets = array();
+ foreach($map as $third_party => $jabber)
+ {
+ if(is_array($jabber))
+ {
+ if(in_array($third_party, $installed_mods) AND in_array('widgets', $jabber))
+ {
+ $mods_with_widgets[] = $third_party;
+ }
+ }
+ }
+
+ // Get array of all widgets of installed modules.
+ $table_data = array();
+ asort($mods_with_widgets);
+ foreach($mods_with_widgets as $mod)
+ {
+ $path = PATH_THIRD.$mod.'/widgets/';
+ $map = directory_map(PATH_THIRD.$mod.'/widgets', 1);
+
+ if(is_array($map))
+ {
+ $col = 1;
+ asort($map);
+ foreach($map as $widget)
+ {
+ $this->_EE->lang->loadfile($mod);
+
+ // check widget permissions before adding to table and skip if user doesn't have permission
+ $obj = $this->_get_widget_object($mod, $widget);
+ if(method_exists($obj, 'permissions') && !$obj->permissions())
+ {
+ continue;
+ }
+
+ $table_data[] = array(
+ lang($this->_format_filename($widget).'_name'),
+ lang($this->_format_filename($widget).'_description'),
+ lang(strtolower($mod).'_module_name'),
+ anchor($this->_base_url.AMP.'method=add_widget'.AMP.'mod='.$mod.AMP.'wgt='.$widget, 'Add')
+ );
+ }
+ }
+ }
+
+ echo $this->_EE->load->view('widgets_listing', array('rows' => $table_data), TRUE);
+ exit();
+ }
+
+ /**
+ * Add selected widget to users dashboard and update config.
+ *
+ * @return void
+ */
+ public function add_widget()
+ {
+ $mod = $this->_EE->input->get('mod');
+ $wgt = $this->_EE->input->get('wgt');
+
+ if(isset($mod) AND isset($wgt))
+ {
+ $obj = $this->_get_widget_object($mod, $wgt);
+
+ // determine which column has the least number of widgets in it so you can add the
+ // new one to the one with the least
+ $totals = array();
+ $totals[1] = @count($this->_settings['widgets'][1]);
+ $totals[2] = @count($this->_settings['widgets'][2]);
+ $totals[3] = @count($this->_settings['widgets'][3]);
+ $col = array_keys($totals, min($totals));
+
+ $new_widget = array(
+ 'mod' => $mod,
+ 'wgt' => $wgt,
+ );
+
+ // add widget settings to config if present
+ if(isset($obj->settings))
+ {
+ $new_widget['stng'] = json_encode($obj->settings);
+ }
+
+ $this->_settings['widgets'][$col[0]][] = $new_widget;
+
+ // update members dashboard config in DB
+ $this->_update_member();
+ }
+
+ $this->_EE->session->set_flashdata('message_success', lang('widget_added'));
+ $this->_EE->functions->redirect($this->_base_url);
+ }
+
+ /**
+ * AJAX METHOD
+ * Remove selected widget from users dashboard and update settings.
+ *
+ * @return NULL
+ */
+ public function remove_widget()
+ {
+ $col = $this->_EE->input->get('col');
+ $wgt = $this->_EE->input->get('wgt');
+
+ if(isset($col) AND isset($wgt))
+ {
+ unset($this->_settings['widgets'][$col][$wgt]);
+ $this->_update_member(FALSE);
+ }
+ }
+
+ /**
+ * AJAX METHOD
+ * Update widget order and column placement in DB.
+ *
+ * @return NULL
+ */
+ public function update_widget_order()
+ {
+ $order = $this->_EE->input->get('order');
+
+ if($order)
+ {
+ $widgets = explode('|', $order);
+ $current = $this->_settings['widgets'];
+ $widgets_only = array();
+ $new = array();
+
+ // get widget only settings in accessable array (without column number in front)
+ foreach($current as $col => $wgts)
+ {
+ foreach($wgts as $id => $settings)
+ {
+ $widgets_only[$id] = $settings;
+ }
+ }
+
+ // loop through widgets, separate based on delimiter and create new array based on submitted
+ foreach($widgets as $widget)
+ {
+ $pieces = explode(':', $widget);
+ $new[$pieces[0]][$pieces[1]] = $widgets_only[$pieces[1]];
+ }
+
+ $this->_settings['widgets'] = $new;
+ $this->_update_member(FALSE);
+ }
+
+ return TRUE;
+ }
+
+ /**
+ * AJAX METHOD
+ * Display settings options for selected widget.
+ *
+ * @return NULL
+ */
+ public function widget_settings()
+ {
+ $col = $this->_EE->input->get('col');
+ $wgt = $this->_EE->input->get('wgt');
+
+ if(isset($col) AND isset($wgt))
+ {
+ $widget = $this->_settings['widgets'][$col][$wgt];
+
+ $obj = $this->_get_widget_object($widget['mod'],$widget['wgt']);
+ echo $obj->settings_form(json_decode($widget['stng']));
+ exit();
+ }
+ }
+
+ /**
+ * AJAX METHOD
+ * Attempt to update a widgets settings.
+ *
+ * @return NULL
+ */
+ public function update_settings()
+ {
+ $data = $_POST;
+ $settings = array();
+ $widget = $this->_settings['widgets'][$data['col']][$data['wgt']];
+
+ foreach($data as $field => $value)
+ {
+ $settings[$field] = $value;
+ }
+
+ $settings_json = json_encode($settings);
+ $this->_settings['widgets'][$data['col']][$data['wgt']]['stng'] = $settings_json;
+ $this->_update_member(FALSE);
+
+ $obj = $this->_get_widget_object($widget['mod'],$widget['wgt']);
+ $content = $obj->index(json_decode($settings_json));
+ $result = array(
+ 'title' => $obj->title,
+ 'content' => $content
+ );
+ echo json_encode($result);
+ exit();
+ }
+
+ /**
+ * Get/update users dashEE settings.
+ *
+ * @return array
+ */
+ public function _get_member_settings($member_id)
+ {
+ $settings = $this->_model->get_member_settings($member_id);
+
+ $this->_EE->cp->get_installed_modules();
+
+ // Ensure all widgets in users settings are still installed and files available.
+ $update_member = FALSE;
+ foreach($settings['widgets'] as $col => $widget)
+ {
+ if(is_array($widget))
+ {
+ foreach($widget as $id => $params)
+ {
+ if(!isset($this->_EE->cp->installed_modules[$params['mod']]) ||
+ !file_exists(PATH_THIRD.$params['mod'].'/widgets/'.$params['wgt']))
+ {
+ unset($settings['widgets'][$col][$id]);
+
+ $update_member = TRUE;
+ }
+ }
+ }
+ }
+
+ $this->_settings = $settings;
+
+ if($update_member)
+ {
+ $this->_update_member();
+ }
+ }
+
+ /**
+ * Attempt to update a members dashboard config in DB.
+ *
+ * @return array
+ */
+ private function _update_member($reindex = TRUE)
+ {
+ if($reindex)
+ {
+ // reindex widgets array before saving it to the DB
+ $i = 1;
+ $widgets = array(1 => array(), 2 => array(), 3 => array());
+ foreach($this->_settings['widgets'] as $col => $widget)
+ {
+ if(is_array($widget))
+ {
+ foreach($widget as $id => $params)
+ {
+ $widgets[$col]['wgt'.$i] = $params;
+ ++$i;
+ }
+ }
+ }
+ $this->_settings['widgets'] = $widgets;
+ }
+
+ $this->_model->update_member($this->_member_id, $this->_settings);
+ }
+
+ /**
+ * Load selected widgets for display.
+ *
+ * @return array
+ */
+ private function _widget_loader(array $widgets)
+ {
+ $cols = array(1 => '', 2 => '', 3 => '');
+
+ foreach($widgets as $col => $widget)
+ {
+ if(is_array($widget))
+ {
+ foreach($widget as $id => $params)
+ {
+ $obj = $this->_get_widget_object($params['mod'], $params['wgt']);
+
+ $class = isset($obj->wclass) ? $obj->wclass : '';
+ $dash_code = isset($params['stng']) ? 'dashee="dynamic"' : '';
+
+ // check widget permissions
+ if(method_exists($obj, 'permissions') && !$obj->permissions())
+ {
+ $content = '<p>'.lang('permission_denied').'</p>';
+ }
+ else
+ {
+ $content = $obj->index(@json_decode($params['stng']));
+ }
+
+ $cols[$col] .= '
+ <li id="'.$id.'" class="widget '.$class.'" '.$dash_code.'>
+ <div class="widget-head">
+ <h3>'.$obj->title.'</h3>
+ </div>
+ <div class="widget-content">'.$content.'</div>
+ </li>
+ ';
+ }
+ }
+
+ $cols[$col] .= '&nbsp;';
+ }
+
+ return $cols;
+ }
+
+ /**
+ * Require necessary widget class and return instance.
+ *
+ * @param $module string Module that requested widget is part of.
+ * @param $widget string Requested widget.
+ * @return object
+ */
+ private function _get_widget_object($module, $widget)
+ {
+ include_once(PATH_THIRD.$module.'/widgets/'.$widget);
+ $obj = $this->_format_filename($widget, TRUE);
+ return new $obj();
+ }
+
+ /**
+ * Format widget names for reference.
+ *
+ * @param $name string File name.
+ * @param $cap bool Capitalize filename?
+ * @return string
+ */
+ private function _format_filename($name, $cap = FALSE)
+ {
+ $str = str_replace('.', '_', substr($name, 0, -4));
+ return $cap ? ucfirst($str) : $str;
+ }
+
+}
+/* End of file mcp.dashee.php */
+/* Location: /system/expressionengine/third_party/dashee/mcp.dashee.php */
47 third_party/dashee/mod.dashee.php
@@ -0,0 +1,47 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+/**
+ * ExpressionEngine - by EllisLab
+ *
+ * @package ExpressionEngine
+ * @author ExpressionEngine Dev Team
+ * @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
+ * @license http://expressionengine.com/user_guide/license.html
+ * @link http://expressionengine.com
+ * @since Version 2.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * dashEE Module Front End File
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Module
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Dashee {
+
+ public $return_data;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->EE =& get_instance();
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Start on your custom code here...
+ */
+
+}
+/* End of file mod.dashee.php */
+/* Location: /system/expressionengine/third_party/dashee/mod.dashee.php */
317 third_party/dashee/models/dashee_model.php
@@ -0,0 +1,317 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+/**
+ * ExpressionEngine - by EllisLab
+ *
+ * @package ExpressionEngine
+ * @author ExpressionEngine Dev Team
+ * @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
+ * @license http://expressionengine.com/user_guide/license.html
+ * @link http://expressionengine.com
+ * @since Version 2.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * dashEE Model
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Module
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Dashee_model extends CI_Model {
+
+ private $_EE;
+ private $_package_name;
+ private $_package_version;
+
+ /**
+ * Constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->_EE =& get_instance();
+
+ $this->_package_name = 'dashEE';
+ $this->_package_version = '1.0';
+ }
+
+ /**
+ * Returns the installed package version.
+ *
+ * @access public
+ * @return string
+ */
+ public function get_installed_version()
+ {
+ $result = $this->_EE->db->select('module_version')
+ ->get_where('modules', array('module_name' => $this->get_package_name()), 1);
+
+ return $result->num_rows() === 1 ? $result->row()->module_version : '';
+ }
+
+ /**
+ * Returns the package name.
+ *
+ * @access public
+ * @return string
+ */
+ public function get_package_name()
+ {
+ return $this->_package_name;
+ }
+
+ /**
+ * Returns the package version.
+ *
+ * @access public
+ * @return string
+ */
+ public function get_package_version()
+ {
+ return $this->_package_version;
+ }
+
+ /**
+ * Installs the module.
+ *
+ * @access public
+ * @return bool
+ */
+ public function install_module()
+ {
+ $this->install_module_register();
+ $this->install_module_members_table();
+
+ return TRUE;
+ }
+
+ /**
+ * Registers the module in the database.
+ *
+ * @access public
+ * @return void
+ */
+ public function install_module_register()
+ {
+ $this->_EE->db->insert('modules', array(
+ 'module_name' => ucfirst($this->get_package_name()),
+ 'module_version' => $this->get_package_version(),
+ 'has_cp_backend' => 'y',
+ 'has_publish_fields' => 'n',
+ ));
+ }
+
+ /**
+ * Creates the OmniLog entries table.
+ *
+ * @access public
+ * @return void
+ */
+ public function install_module_members_table()
+ {
+ $this->_EE->load->dbforge();
+
+ $fields = array(
+ 'id' => array(
+ 'type' => 'INT',
+ 'constraint' => 10,
+ 'unsigned' => TRUE,
+ 'auto_increment' => TRUE
+ ),
+ 'member_id' => array(
+ 'type' => 'INT',
+ 'constraint' => 10,
+ 'unsigned' => TRUE,
+ ),
+ 'config' => array(
+ 'type' => 'TEXT',
+ 'null' => TRUE,
+ )
+ );
+
+ $this->_EE->dbforge->add_field($fields);
+ $this->_EE->dbforge->add_key('id', TRUE);
+ $this->_EE->dbforge->create_table('dashee_members', TRUE);
+ }
+
+ /**
+ * Uninstalls the module.
+ *
+ * @access public
+ * @return bool
+ */
+ public function uninstall_module()
+ {
+ $module_name = ucfirst($this->get_package_name());
+
+ // Retrieve the module information.
+ $result = $this->_EE->db
+ ->select('module_id')
+ ->get_where('modules', array('module_name' => $module_name), 1);
+
+ if($result->num_rows() !== 1)
+ {
+ return FALSE;
+ }
+
+ $this->_EE->db->delete('module_member_groups', array('module_id' => $result->row()->module_id));
+ $this->_EE->db->delete('modules', array('module_name' => $module_name));
+
+ // Drop the log entries table.
+ $this->_EE->load->dbforge();
+ $this->_EE->dbforge->drop_table('dashee_members');
+
+ return TRUE;
+ }
+
+ /**
+ * Updates the module.
+ *
+ * @access public
+ * @param string $installed_version The installed version.
+ * @param bool $force Forcibly update the module version number?
+ * @return bool
+ */
+ public function update_package($installed_version = '', $force = FALSE)
+ {
+ if(version_compare($installed_version, $this->get_package_version(), '>='))
+ {
+ return FALSE;
+ }
+
+ /*if(version_compare($installed_version, '1.1.0', '<'))
+ {
+ $this->_update_package_to_version_110();
+ }*/
+
+ // Forcibly update the module version number?
+ if($force === TRUE)
+ {
+ $this->_ee->db->update(
+ 'modules',
+ array('module_version' => $this->get_package_version()),
+ array('module_name' => $this->get_package_name())
+ );
+ }
+
+ return TRUE;
+ }
+
+ /**
+ * Returns the package theme folder URL, appending a forward slash if required.
+ *
+ * @access public
+ * @return string
+ */
+ public function get_package_theme_url()
+ {
+ $theme_url = $this->_EE->config->item('theme_folder_url');
+ $theme_url .= substr($theme_url, -1) == '/' ? 'third_party/' : '/third_party/';
+
+ return $theme_url.strtolower($this->get_package_name()).'/';
+ }
+
+ /**
+ * Get all installed EE modules.
+ *
+ * @access public
+ * @return array
+ */
+ public function get_installed_modules()
+ {
+ $result = $this->_EE->db->select('modules.module_name')
+ ->from('modules')
+ ->order_by('module_name')
+ ->get();
+
+ $installed = array();
+ foreach($result->result_array() as $row)
+ {
+ $installed[] = strtolower($row['module_name']);
+ }
+
+ return $installed;
+ }
+
+ /**
+ * Get members dashboard configuration from DB.
+ *
+ * @access public
+ * @param int $member_id ID of currently logged in user.
+ * @return obj
+ */
+ public function get_member_settings($member_id)
+ {
+ $result = $this->_EE->db->select('*')
+ ->from('dashee_members')
+ ->where('member_id', $member_id)
+ ->get();
+
+ if($result->num_rows() < 1)
+ {
+ // This is a new user with no preferences, return default configuration.
+ $config = array(
+ 'widgets' => array(
+ 1 => array(
+ 'wgt1' => array(
+ 'mod' => 'dashee',
+ 'wgt' => 'wgt.welcome.php'
+ ),
+ 'wgt2' => array(
+ 'mod' => 'dashee',
+ 'wgt' => 'wgt.create_links.php'
+ )
+ ),
+ 2 => array(
+ 'wgt3' => array(
+ 'mod' => 'dashee',
+ 'wgt' => 'wgt.modify_links.php'
+ )
+ ),
+ 3 => array(
+ 'wgt4' => array(
+ 'mod' => 'dashee',
+ 'wgt' => 'wgt.view_links.php'
+ )
+ )
+ )
+ );
+
+ $params = array(
+ 'member_id' => $member_id,
+ 'config' => json_encode($config)
+ );
+
+ $this->_EE->db->insert('dashee_members', $params);
+
+ return json_decode($params['config'], TRUE);
+ }
+ else
+ {
+ return json_decode($result->row()->config, TRUE);
+ }
+ }
+
+ /**
+ * Update members dashboard configuration in DB.
+ *
+ * @access public
+ * @param int $member_id ID of currently logged in user.
+ * @param array $config Member dashboard config.
+ * @return obj
+ */
+ public function update_member($member_id, $config)
+ {
+ return $this->_EE->db->update('exp_dashee_members', array('config' => json_encode($config)), array('member_id' => $member_id));
+ }
+}
+/* End of file dashee_model.php */
+/* Location: /system/expressionengine/third_party/dashee/models/dashee_model.php */
87 third_party/dashee/upd.dashee.php
@@ -0,0 +1,87 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+/**
+ * ExpressionEngine - by EllisLab
+ *
+ * @package ExpressionEngine
+ * @author ExpressionEngine Dev Team
+ * @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
+ * @license http://expressionengine.com/user_guide/license.html
+ * @link http://expressionengine.com
+ * @since Version 2.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * dashEE Module Install/Update File
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Module
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Dashee_upd {
+
+ public $version;
+
+ private $_EE;
+ private $_model;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->_EE =& get_instance();
+
+ $this->_EE->load->add_package_path(PATH_THIRD .'dashee/');
+
+ $this->_EE->load->model('dashee_model');
+ $this->_model = $this->_EE->dashee_model;
+
+ $this->version = $this->_model->get_package_version();
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Installation Method
+ *
+ * @return boolean TRUE
+ */
+ public function install()
+ {
+ return $this->_model->install_module();
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Uninstall
+ *
+ * @return boolean TRUE
+ */
+ public function uninstall()
+ {
+ return $this->_model->uninstall_module();
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Module Updater
+ *
+ * @return boolean TRUE
+ */
+ public function update($current = '')
+ {
+ return $this->_model->update_package($current);
+ }
+
+}
+/* End of file upd.dashee.php */
+/* Location: /system/expressionengine/third_party/dashee/upd.dashee.php */
15 third_party/dashee/views/index.php
@@ -0,0 +1,15 @@
+<div id="dashContainer">
+ <div id="dashListing" style="display:none;">
+ <div class="content">&nbsp;</div>
+ </div>
+
+ <?php $i = 1; ?>
+ <?php foreach($content as $col): ?>
+ <ul id="column<?php echo $i; ?>" class="column"><?php echo $col; ?></ul>
+ <?php ++$i; ?>
+ <?php endforeach; ?>
+</div>
+
+<div id="dashConfirm" style="display:none;">
+ <p>Are you sure you want to remove this widget from your dashboard?</p>
+</div>
19 third_party/dashee/views/widgets_listing.php
@@ -0,0 +1,19 @@
+<?php
+
+$this->table->set_template($cp_table_template);
+$this->table->set_heading(
+ 'Widget',
+ 'Description',
+ 'Module',
+ 'Action'
+ );
+
+foreach($rows as $row)
+{
+ $this->table->add_row($row);
+}
+
+echo $this->table->generate();
+
+?>
+<p>&nbsp;</p>
70 third_party/dashee/widgets/wgt.blank.php
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * Blank Widget
+ *
+ * Display blank boilerplace widget that can be customized with settings.
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Widget
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Wgt_blank
+{
+ public $title;
+ public $settings;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->settings = array(
+ 'title' => 'Blank Widget',
+ 'body' => '<p>This is a blank module. You can fill it with whatever content you wish.</p>'
+ );
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Index Function
+ *
+ * @param object
+ * @return string
+ */
+ public function index($settings = NULL)
+ {
+ $this->title = $settings->title;
+
+ return $settings->body;
+ }
+
+ /**
+ * Settings Form Function
+ * Generate settings form for widget.
+ *
+ * @param object
+ * @return string
+ */
+ public function settings_form($settings)
+ {
+ return form_open('', array('class' => 'dashForm')).'
+
+ <p><label for="title">Widget Title:</label>
+ <input type="text" name="title" value="'.$settings->title.'" /></p>
+
+ <p><label for="body">Widget Body:</label>
+ <textarea name="body">'.$settings->body.'</textarea></p>
+
+ <p><input type="submit" value="Save" /></p>
+
+ '.form_close();
+ }
+
+}
+/* End of file wgt.blank.php */
+/* Location: /system/expressionengine/third_party/dashee/widgets/wgt.blank.php */
91 third_party/dashee/widgets/wgt.create_links.php
@@ -0,0 +1,91 @@
+<?php
+
+/**
+ * EE Create Links Widget
+ *
+ * Display static create links just like on default EE CP home.
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Widget
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Wgt_create_links
+{
+ public $title;
+ public $wclass;
+
+ private $_EE;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->title = lang('create');
+ $this->wclass = 'eedefault';
+
+ $this->_EE =& get_instance();
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Permissions Function
+ * Defines permissions needed for user to be able to add widget.
+ *
+ * @return bool
+ */
+ public function permissions()
+ {
+ if(!$this->_EE->cp->allowed_group('can_access_publish') &&
+ (!$this->_EE->cp->allowed_group('can_access_edit') && !$this->_EE->cp->allowed_group('can_admin_templates')) &&
+ (!$this->_EE->cp->allowed_group('can_admin_channels') && ! $this->_EE->cp->allowed_group('can_admin_sites')))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ /**
+ * Index Function
+ *
+ * @return string
+ */
+ public function index()
+ {
+ $content = '<ul>';
+
+ if($this->_EE->session->userdata['can_access_content'] == 'y')
+ {
+ $content .= '<li class="item"><a href="'.BASE.AMP.'D=cp'.AMP.'C=content_publish'.'">'.lang('entry').'</a></li>';
+ }
+ if($this->_EE->session->userdata['can_admin_templates'] == 'y')
+ {
+ $content .= '<li class="item"><a href="'.BASE.AMP.'D=cp'.AMP.'C=design'.AMP.'M=new_template">'.lang('template').'</a></li>
+ <li class="group"><a href="'.BASE.AMP.'D=cp'.AMP.'C=design'.AMP.'M=new_template_group">'.lang('template_group').'</a></li>';
+ }
+ $this->_EE->cp->get_installed_modules();
+ $this->_EE->load->model('member_model');
+ if(isset($this->_EE->cp->installed_modules['pages']))
+ {
+ if($this->_EE->session->userdata('group_id') == 1 || $this->_EE->member_model->can_access_module('pages'))
+ {
+ $content .= '<li class="item"><a href="'.BASE.AMP.'C=content_publish">'.lang('page').'</a></li>';
+ }
+ }
+ if($this->_EE->session->userdata['can_admin_channels'] == 'y')
+ {
+ $content .= '<li class="group"><a href="'.BASE.AMP.'D=cp'.AMP.'C=admin_content'.AMP.'M=channel_add">'.lang('channel').'</a></li>';
+ }
+
+ $content .= '</ul>';
+
+ return $content;
+ }
+}
+/* End of file wgt.create_links.php */
+/* Location: /system/expressionengine/third_party/dashee/widgets/wgt.create_links.php */
90 third_party/dashee/widgets/wgt.feed_reader.php
@@ -0,0 +1,90 @@
+<?php
+
+/**
+ * RSS Feed Reader Widget
+ *
+ * Display RSS feed post links for provided feed URLs.
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Widget
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Wgt_feed_reader
+{
+ public $title;
+ public $settings;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->settings = array(
+ 'url' => 'http://expressionengine.com/feeds/rss/eeblog/',
+ 'num' => 5
+ );
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Index Function
+ *
+ * @param object
+ * @return string
+ */
+ public function index($settings = NULL)
+ {
+ $EE = get_instance();
+ $EE->load->helper('text');
+
+ $rss = simplexml_load_file($settings->url);
+
+ $display = '';
+ $i = 0;
+ foreach($rss->channel->item as $key => $item)
+ {
+ if($i >= $settings->num) { break; }
+
+ $link = trim($item->link);
+ $title = trim($item->title);
+
+ $display .= '<li>'.anchor($link, $title, 'target="_blank"').'</li>';
+
+ ++$i;
+ }
+
+ $this->title = ellipsize($rss->channel->title, 19, 1);
+
+ return '
+ <ul>'.$display.'</ul>
+ ';
+ }
+
+ /**
+ * Settings Form Function
+ * Generate settings form for widget.
+ *
+ * @param object
+ * @return string
+ */
+ public function settings_form($settings)
+ {
+ return form_open('', array('class' => 'dashForm')).'
+
+ <p><label for="url">Feed URL:</label>
+ <input type="text" name="url" value="'.$settings->url.'" /></p>
+
+ <p><label for="num">Number of Posts:</label>
+ <input type="text" name="num" value="'.$settings->num.'" /></p>
+
+ <p><input type="submit" value="Save" /></p>
+
+ '.form_close();
+ }
+}
+/* End of file wgt.feed_reader.php */
+/* Location: /system/expressionengine/third_party/dashee/widgets/wgt.feed_reader.php */
102 third_party/dashee/widgets/wgt.modify_links.php
@@ -0,0 +1,102 @@
+<?php
+
+/**
+ * EE Modify Links Widget
+ *
+ * Display static modify (or delete) links just like on default EE CP home.
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Widget
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Wgt_modify_links
+{
+ public $title;
+ public $wclass;
+
+ private $_EE;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->title = lang('modify').' <span class="subtext">'.lang('or_delete').'</span>';
+ $this->wclass = 'eedefault';
+
+ $this->_EE =& get_instance();
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Permissions Function
+ * Defines permissions needed for user to be able to add widget.
+ *
+ * @return bool
+ */
+ public function permissions()
+ {
+ if(!$this->_EE->cp->allowed_group('can_access_publish') &&
+ (!$this->_EE->cp->allowed_group('can_access_edit') && !$this->_EE->cp->allowed_group('can_admin_templates')))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ /**
+ * Index Function
+ *
+ * @return string
+ */
+ public function index()
+ {
+ $content = '<ul>
+ <li class="item"><a href="'.BASE.AMP.'D=cp'.AMP.'C=content_edit'.'">'.lang('entry').'</a></li>';
+
+ // templates
+
+ // template groups
+ if($this->_EE->session->userdata['can_admin_templates'] == 'y')
+ {
+ $content .= '<li class="group"><a href="'.BASE.AMP.'D=cp'.AMP.'C=design'.AMP.'M=edit_template_group">'.lang('template_group').'</a></li>';
+ }
+
+ // pages
+ $this->_EE->cp->get_installed_modules();
+ $this->_EE->load->model('member_model');
+ if(isset($this->_EE->cp->installed_modules['pages']))
+ {
+ if($this->_EE->session->userdata('group_id') == 1 || $this->_EE->member_model->can_access_module('pages'))
+ {
+ $content .= '<li class="item"><a href="'.BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=pages">'.lang('page').'</a></li>';
+ }
+ }
+
+ // recent entry
+ $this->_EE->db->select('entry_id, channel_id');
+ $this->_EE->db->from('channel_titles');
+ $this->_EE->db->order_by('entry_date DESC');
+ $this->_EE->db->limit(1);
+ $entry = $this->_EE->db->get()->row();
+ if($entry)
+ {
+ $content .= '<li class="group"><a href="'.BASE.AMP.'C=content_publish'.AMP.'M=entry_form'.AMP.'channel_id='.$entry->channel_id.AMP.'entry_id='.$entry->entry_id.'">'.lang('most_recent_entry').'</a></li>';
+ }
+
+ // comments - doesn't work for some reason... need to revisit
+ /*if($this->_EE->db->table_exists('comments') && $this->_EE->cp->allowed_group('can_moderate_comments'))
+ {
+ $content .= '<li class="item"><a href="'.BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=comment'.AMP.'status=p">'.lang('total_validating_comments').'</a></li>';
+ }*/
+
+ return $content;
+ }
+}
+/* End of file wgt.modify_links.php */
+/* Location: /system/expressionengine/third_party/dashee/widgets/wgt.modify_links.php */
72 third_party/dashee/widgets/wgt.new_members.php
@@ -0,0 +1,72 @@
+<?php
+
+/**
+ * New EE Members Widget
+ *
+ * Display static listing of 10 most recent EE members.
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Widget
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Wgt_new_members
+{
+ public $title;
+
+ private $_EE;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->title = 'New Members';
+
+ $this->_EE =& get_instance();
+ }
+
+ /**
+ * Index Function
+ *
+ * @return string
+ */
+ public function index()
+ {
+ // get most recent 10 members from DB
+ $this->_EE->db->select('member_id, username, join_date');
+ $this->_EE->db->from('members');
+ $this->_EE->db->order_by('join_date DESC');
+ $this->_EE->db->limit(10);
+ $results = $this->_EE->db->get();
+
+ // generate table HTML
+ $display = '';
+ if($results->num_rows() > 0)
+ {
+ foreach($results->result() as $row)
+ {
+ $display .= '
+ <tr class="'.alternator('odd','even').'">
+ <td><a href="'.BASE.AMP.'D=cp'.AMP.'C=myaccount'.AMP.'id='.$row->member_id.'">'.$row->username.'</a></td>
+ <td>'.date('n/j/Y',$row->join_date).'</td>
+ </tr>';
+ }
+ }
+ else
+ {
+ $display = '<tr><td colspan="2"><center>No members have joined yet.</center></td></tr>';
+ }
+
+ return '
+ <table>
+ <thead><tr><th>Username</th><th>Join Date</th></tr></thead>
+ <tbody>'.$display.'</tbody>
+ </table>
+ ';
+ }
+}
+/* End of file wgt.new_members.php */
+/* Location: /system/expressionengine/third_party/dashee/widgets/wgt.new_members.php */
74 third_party/dashee/widgets/wgt.recent_entries.php
@@ -0,0 +1,74 @@
+<?php
+
+/**
+ * Recent Entries Widget
+ *
+ * Display static listing of 10 most recent channel entries.
+ *
+ * @package ExpressionEngine
+ * @subpackage Addons
+ * @category Widget
+ * @author Chris Monnat
+ * @link http://chrismonnat.com
+ */
+
+class Wgt_recent_entries
+{
+ public $title;
+
+ private $_EE;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->title = 'Recent Entries';
+
+ $this->_EE =& get_instance();
+ }
+
+ // ----------------------------------------------------------------
+
+ /**
+ * Index Function
+ *
+ * @return string
+ */
+ public function index()
+ {
+ // get most recent 10 entries from DB
+ $this->_EE->db->select('entry_id, channel_id, title, entry_date');
+ $this->_EE->db->from('channel_titles');
+ $this->_EE->db->order_by('entry_date DESC');
+ $this->_EE->db->limit(10);
+ $entries = $this->_EE->db->get();
+
+ // generate table HTML
+ $display = '';
+ if($entries->num_rows() > 0)
+ {
+ foreach($entries->result() as $entry)
+ {
+ $display .= '
+ <tr class="'.alternator('odd','even').'">
+ <td><a href="'.BASE.AMP.'D=cp'.AMP.'C=content_publish'.AMP.'M=entry_form'.AMP.'channel_id='.$entry->channel_id.AMP.'entry_id='.$entry->entry_id.'">'.$entry->title.'</a></td>
+ <td>'.date('m/d/Y',$entry->entry_date).'</td>
+ </tr>';
+ }
+ }
+ else
+ {
+ $display = '<tr><td colspan="2"><center>No entries have been created.</center></td></tr>';
+ }
+
+ return '
+ <table>
+ <thead><tr><th>Title</th><th>Entry Date</th></tr></thead>
+ <tbody>'.$display.'</tbody>
+ </table>
+ ';
+ }
+}
+/* End of file wgt.recent_entries.php */
+/* Location: /system/expressionengine/third_party/dashee/widgets/wgt.recent_entries.php */