Skip to content

Instantly share code, notes, and snippets.

@sottwell
Last active May 12, 2017 21:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sottwell/d8ec3603cd7ed3d3c062 to your computer and use it in GitHub Desktop.
Save sottwell/d8ec3603cd7ed3d3c062 to your computer and use it in GitHub Desktop.
Pretty Site Summary dashboard widget - original by W. Shawn Wilkerson - MODX Revolution
<?php
// SiteSummary snippet for Dashboard widget
// W. Shawn Wilkerson
$o = '<table class="classy" style="width:100%;"><thead><tr style="background:#DDE3EA;color:#000;">';
$o .= '<th style="width:50%;padding:8px 0;text-align:center;">Resources</th>';
$o .= '<th style="width:50%;padding:8px 0;text-align:center;">Elements</th>';
$o .= '</tr></thead><tbody><tr><td style="padding:0 1em;">';
$o .= 'Published Resources: ' . $modx->getCount('modResource', array('published' => '1'));
$o .= '<br>Unpublished Resources: ' . $modx->getCount('modResource', array('published' => '0'));
$o .= '<br>Deleted Resources: ' . $modx->getCount('modResource', array('deleted' => '1'));
$o .= '<br>Total: ' . $modx->getCount('modResource');
$o .= '</td><td style="padding:0 1em;">';
$o .= 'Chunks: ' . $modx->getCount('modChunk');
$o .= '<br>Snippets ' . $modx->getCount('modSnippet');
$o .= '<br>Plugins: ' . $modx->getCount('modPlugin');
$o .= '<br>Templates: ' . $modx->getCount('modTemplate');
$o .= '<br>Template Variables: ' . $modx->getCount('modTemplateVar');
$o .= '</td></tr></tbody></table>';
return $o;
@sottwell
Copy link
Author

Installation:

Create a new dashboard widget using the "Inline PHP Code" type. Past in this code. Add the widget to your dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment