Snippet Call

[[viewRevoObjects?objectType=`ALL`]] (caution: over 30 printed pages)
[[viewRevoObjects?objectType=`Chunk`]]
[[viewRevoObjects?objectType=`Plugin`]]
[[viewRevoObjects?objectType=`Resource`]]
[[viewRevoObjects?objectType=`Snippet`]]
[[viewRevoObjects?objectType=`Template`]]
[[viewRevoObjects?objectType=`TemplateVar`]]

Code

<?php

/**
 * File viewRevoObjects.php (requires MODx Revolution 2.1)
 * Created on: 9/17/11 at 9:49 AM
 * Project shawn_wilkerson
 * @elements
 * @version 1.0
 * @category
 * @author W. Shawn Wilkerson
 * @link http://www.shawnWilkerson.com
 * @copyright Copyright (c) 2011, Sanity LLC. All rights reserved.
 * @license
 *
 */
if (!function_exists('retrieveObject')) {
    function retrieveObject($name)
    {
        $rt = '';
        global $modx;
        $tblName = 'mod' . $name;
        $rt .= '<h1>' . $tblName . ' ([[++settings_version]])</h1>';
        $rt .= '<h2>Table Fields</h2>';
        $rt .= '<pre>' . print_r($modx->getFields($tblName), true) . '</pre>';
        $rt .= '<h2>Table Construction (meta defined in schema)</h2>';
        $rt .= '<pre>' . print_r($modx->getFieldMeta($tblName), true) . '</pre>';
        $rt .= '<h2>Aggregate Relations</h2>';
        $rt .= '<pre>' . print_r($modx->getAggregates($tblName), true) . '</pre>';
        $rt .= '<h2>Composite Relations</h2>';
        $rt .= '<pre>' . print_r($modx->getComposites($tblName), true) . '</pre>';
        $rt .= '<h2>Ancestors</h2>';
        $rt .= '<pre>' . print_r($modx->getAncestry($tblName), true) . '</pre>';
        return $rt;
    }
}

$wsw = '';
$modxObjects = array('Chunk', 'Plugin', 'UserProfile', 'Resource', 'Snippet', 'Template', 'TemplateVar', 'User');
$objType = $modx->getOption('objectType', $scriptProperties, 'User');

if ($objType == "ALL") {
    foreach ($modxObjects as $name) {
        $wsw .= retrieveObject($name);
    }
} else {
    if (in_array($objType, $modxObjects)) {
        $wsw = retrieveObject($objType);
    }
}
$wsw = str_replace(array('(', ')', 'Array'), '', $wsw);
return $wsw;

Sample Output

modChunk: MODX Revolution object for HTML Chunks
modPlugin: MODX Revolution object for PHP Plugins
modResource: MODX Revolution base object for weblinks, documents, resources, and static content
modSnippet: MODX Revolution object for PHP code
modTemplate: MODX Revolution object for xhtml, html, html5, and other types of templates
modTemplateVar: MODX Revolution object attaching variables directly to Templates
modUser: MODX Revolution object central to all user specific functionality
modUserProfile: MODX Revolution user object is separate from the user profile.

In this article