Last active
May 12, 2017 21:20
-
-
Save sottwell/d8ec3603cd7ed3d3c062 to your computer and use it in GitHub Desktop.
Pretty Site Summary dashboard widget - original by W. Shawn Wilkerson - MODX Revolution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation:
Create a new dashboard widget using the "Inline PHP Code" type. Past in this code. Add the widget to your dashboard.