Created
October 18, 2024 12:30
-
-
Save jaygilmore/a403c56257281bfa28aae39a4c8cd30a to your computer and use it in GitHub Desktop.
Pretty Site Summary dashboard widget - original by W. Shawn Wilkerson - MODX Revolution
This file contains hidden or 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