pepebe
6/15/2015 - 4:36 AM

Pretty Site Summary dashboard widget - original by W. Shawn Wilkerson - MODX Revolution

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;