Skip to content

Instantly share code, notes, and snippets.

@jaygilmore
Created October 18, 2024 12:30
Show Gist options
  • Save jaygilmore/a403c56257281bfa28aae39a4c8cd30a to your computer and use it in GitHub Desktop.
Save jaygilmore/a403c56257281bfa28aae39a4c8cd30a 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment