Add a field to the internal field detection system
function addField( $name, $location, $type = false )
Add a field to the internal field detection system from an array or delimited string
function addFields( $fields, $location = '*', $delimiter = ',', $callback = false )
Append keywords’s to the resource array
function appendKeywords( $resource )
Apeend a TV to the documents array
function appendTV( $tvname = "", $docIDs )
Translate a result array into a HTML table
function array2table( $array, $recursive = false, $return = false, $null = ' ' )
Make fields array unique
function arrayUnique( $array )
Do basic comparison filtering
function basicFilter ( $value )
Build a URL with regard to Ditto ID
function buildURL( $args, $id = false, $dittoIdentifier = false )
Check the advSortString
function checkAdvSort( $sortBy, $sortDir = 'asc' )
Remove empty items from the array
function cleanArray( $array )
Clean the IDs of any dangerous characters
function cleanIDs( $IDs )
Sort resource array if advanced sorting is needed
function customSort( $data, $fields, $order )
Determine the correct template to apply
function determine( $templates, $x, $start, $stop, $id )
Get Document IDs for future use
function determineIDs( $IDs, $IDType, $TVs, $orderBy, $depth, $showPublishedOnly, $seeThruUnpub, $hideFolders, $hidePrivate, $showInMenuOnly, $myWhere, $keywords, $dateSource, $limit, $summarize, $filter, $paginate, $randomize )
Takes the resource array for an individual document and asks for the return of a 0 or 1 with 1 removing the document and 0 leaving it in the result set.
function exampleFilter( $resource )
Takes the resource array for an individual document and returns the value of the placeholder, in this case the uppercase version of the pagetitle
function exampleFunction( $resource )
Filter documents via either a custom filter or basic filter
function execute( $resource, $filter )
Get a template, based on version by Doze
function fetch( $tpl )
Helper function to appendKeywords
function fetchKeywords( $resource )
Find al the template variables in the template
function findTemplateVars( $tpl )
Returns the contents of file name passed
function get_file_contents( $filename )
Get the author name, or if not available the username
function getAuthor( $createdby )
Get the IDs ready to be processed Similar to the modx version by the same name but much faster
function getChildIDs( $IDs, $depth )
Get documents and append TVs + Prefetch Data, and sort
function getDocuments( $ids = array (), $fields, $TVs, $orderBy, $published = 1, $deleted = 0, $public = 1, $where = '', $limit = "", $keywords = 0, $randomize = 0, $dateSource = false )
Determine if the provided field is a tv, a database field, or something else
function getDocVarType( $field )
Get a parameter or use the default language value
function getParam( $param, $langString )
Get a list of all available parents
function getParentList()
Get a list of all available TVs
function getTVList()
Make all MODx tags safe for the output
function makeMODxSafe( $value )
Turn an array of parameters in the format [“param”] => “value” into a table
function makeParamTable( $parameters = array(), $header = "", $sort = true, $prep = true, $wordwrap = true )
Render a tab
function makeTab( $title, $content )
Sort the resource array by multiple fields Rows->Columns portion by Jon L.
function multiSort( $resource, $orderBy )
Render the noResults output
function noResults( $text, $paginate )
Paginate the documents
function paginate( $start, $stop, $total, $summarize, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter )
Parse the required fields out of the custom placeholders
function parseCustomPlaceholders( $placeholders )
Parse out the fields required for each state
function parseDBFields( $seeThruUnpub )
Find the fields that are contained in the custom placeholders or those that are needed in other functions
function parseFields( $placeholders, $seeThruUnpub, $dateSource, $randomize )
Split up the filters into an array and add the required fields to the fields array
function parseFilters( $filter = false, $cFilters = false, $pFilters = false, $globalDelimiter, $localDelimiter )
Parse out orderBy parameter string
function parseOrderBy( $orderBy, $randomize )
Create the outut for the Info ta
function prepareBasicInfo( $ditto, $ditto_version, $IDs, $summarize, $orderBy, $start, $stop, $total )
Create the output for the Document Info tab
function prepareDocumentInfo( $resource )
Create the content of the Filters tab
function prepareFilters( $filter )
Create the content of the Prefetch tab
function preparePrefetch( $prefetch )
Create the output for the Templates tab
function prepareTemplates( $templates )
Take the templates and parse them for tempalte variables, Check to make sure they have fields, and sort the fields
function process( $template )
Convert relative urls to absolute URLs Based on script from http://wintermute.com.au/bits/2005-09/php-relative-absolute-links/
function relToAbs( $text, $base )
Remove a field to the internal field detection system
function removeField( $name, $location, $type )
Render the document output
function render( $resource, $template, $removeChunk, $dateSource, $dateFormat, $ph = array(), $phx = 1, $x = 0 )
Render the links to the debug console
function render_link( $dittoID, $ditto_base )
Render the contents of the debug console
function render_popup( $ditto, $ditto_base, $ditto_version, $ditto_params, $IDs, $fields, $summarize, $templates, $orderBy, $start, $stop, $total, $filter, $resource )
Render QE links when needed
function renderQELinks( $fields, $resource, $QEPrefix, $placeholders )
Replcae placeholders with their values
function replace( $placeholders, $tpl )