The Ditto class contains all functions relating to Ditto’s functionality and any supporting functions they need
| Main Class | The Ditto class contains all functions relating to Ditto’s functionality and any supporting functions they need |
| Functions | |
| getTVList | Get a list of all available TVs |
| addField | Add a field to the internal field detection system |
| addFields | Add a field to the internal field detection system from an array or delimited string |
| removeField | Remove a field to the internal field detection system |
| setDisplayFields | Move the detected fields into the Ditto fields array |
| getDocVarType | Determine if the provided field is a tv, a database field, or something else |
| parseOrderBy | Parse out orderBy parameter string |
| checkAdvSort | Check the advSortString |
| parseFilters | Split up the filters into an array and add the required fields to the fields array |
| render | Render the document output |
| parseFields | Find the fields that are contained in the custom placeholders or those that are needed in other functions |
| arrayUnique | Make fields array unique |
| parseCustomPlaceholders | Parse the required fields out of the custom placeholders |
| parseDBFields | Parse out the fields required for each state |
| renderQELinks | Render QE links when needed |
| getAuthor | Get the author name, or if not available the username |
| customSort | Sort resource array if advanced sorting is needed |
| userSort | Sort the resource array by a user defined function |
| multiSort | Sort the resource array by multiple fields Rows->Columns portion by Jon L. |
| determineIDs | Get Document IDs for future use |
| weightedRandom | Execute a random order sort |
| getParentList | Get a list of all available parents |
| appendTV | Apeend a TV to the documents array |
| appendKeywords | Append keywords’s to the resource array |
| fetchKeywords | Helper function to appendKeywords |
| getChildIDs | Get the IDs ready to be processed Similar to the modx version by the same name but much faster |
| getDocuments | Get documents and append TVs + Prefetch Data, and sort |
| getDocumentsLite | Get an array of documents |
| cleanIDs | Clean the IDs of any dangerous characters |
| buildURL | Build a URL with regard to Ditto ID |
| getParam | Get a parameter or use the default language value |
| paginate | Paginate the documents |
| noResults | Render the noResults output |
| relToAbs | Convert relative urls to absolute URLs Based on script from http://wintermute.com.au- /bits- /2005-09- /php-relative-absolute-links- / |
function addField( $name, $location, $type = false )
Add a field to the internal field detection system
function addFields( $fields, $location = '*', $delimiter = ',', $callback = false )
Add a field to the internal field detection system from an array or delimited string
function removeField( $name, $location, $type )
Remove a field to the internal field detection system
function setDisplayFields( $fields, $hiddenFields )
Move the detected fields into the Ditto fields array
function getDocVarType( $field )
Determine if the provided field is a tv, a database field, or something else
function parseFilters( $filter = false, $cFilters = false, $pFilters = false, $globalDelimiter, $localDelimiter )
Split up the filters into an array and add the required fields to the fields array
function render( $resource, $template, $removeChunk, $dateSource, $dateFormat, $ph = array(), $phx = 1, $x = 0 )
Render the document output
function parseFields( $placeholders, $seeThruUnpub, $dateSource, $randomize )
Find the fields that are contained in the custom placeholders or those that are needed in other functions
function parseCustomPlaceholders( $placeholders )
Parse the required fields out of the custom placeholders
function renderQELinks( $fields, $resource, $QEPrefix, $placeholders )
Render QE links when needed
function customSort( $data, $fields, $order )
Sort resource array if advanced sorting is needed
function multiSort( $resource, $orderBy )
Sort the resource array by multiple fields Rows->Columns portion by Jon L. -- intel352@gmail.com Link: http://de3.php.net- /manual- /en- /function.array-multisort.php#73498
function determineIDs( $IDs, $IDType, $TVs, $orderBy, $depth, $showPublishedOnly, $seeThruUnpub, $hideFolders, $hidePrivate, $showInMenuOnly, $myWhere, $keywords, $dateSource, $limit, $summarize, $filter, $paginate, $randomize )
Get Document IDs for future use
function fetchKeywords( $resource )
Helper function to appendKeywords
function getChildIDs( $IDs, $depth )
Get the IDs ready to be processed Similar to the modx version by the same name but much faster
function getDocuments( $ids = array (), $fields, $TVs, $orderBy, $published = 1, $deleted = 0, $public = 1, $where = '', $limit = "", $keywords = 0, $randomize = 0, $dateSource = false )
Get documents and append TVs + Prefetch Data, and sort
function buildURL( $args, $id = false, $dittoIdentifier = false )
Build a URL with regard to Ditto ID
function paginate( $start, $stop, $total, $summarize, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter )
Paginate the documents
function relToAbs( $text, $base )
Convert relative urls to absolute URLs Based on script from http://wintermute.com.au- /bits- /2005-09- /php-relative-absolute-links- /
Get a list of all available TVs
function getTVList()
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 )
Remove a field to the internal field detection system
function removeField( $name, $location, $type )
Move the detected fields into the Ditto fields array
function setDisplayFields( $fields, $hiddenFields )
Determine if the provided field is a tv, a database field, or something else
function getDocVarType( $field )
Parse out orderBy parameter string
function parseOrderBy( $orderBy, $randomize )
Check the advSortString
function checkAdvSort( $sortBy, $sortDir = 'asc' )
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 )
Render the document output
function render( $resource, $template, $removeChunk, $dateSource, $dateFormat, $ph = array(), $phx = 1, $x = 0 )
Find the fields that are contained in the custom placeholders or those that are needed in other functions
function parseFields( $placeholders, $seeThruUnpub, $dateSource, $randomize )
Make fields array unique
function arrayUnique( $array )
Parse the required fields out of the custom placeholders
function parseCustomPlaceholders( $placeholders )
Parse out the fields required for each state
function parseDBFields( $seeThruUnpub )
Render QE links when needed
function renderQELinks( $fields, $resource, $QEPrefix, $placeholders )
Get the author name, or if not available the username
function getAuthor( $createdby )
Sort resource array if advanced sorting is needed
function customSort( $data, $fields, $order )
Sort the resource array by a user defined function
function userSort( $resource, $sort )
Sort the resource array by multiple fields Rows->Columns portion by Jon L.
function multiSort( $resource, $orderBy )
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 )
Execute a random order sort
function weightedRandom( $resource, $field, $show )
Get a list of all available parents
function getParentList()
Apeend a TV to the documents array
function appendTV( $tvname = "", $docIDs )
Append keywords’s to the resource array
function appendKeywords( $resource )
Helper function to appendKeywords
function fetchKeywords( $resource )
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 )
Clean the IDs of any dangerous characters
function cleanIDs( $IDs )
Build a URL with regard to Ditto ID
function buildURL( $args, $id = false, $dittoIdentifier = false )
Get a parameter or use the default language value
function getParam( $param, $langString )
Paginate the documents
function paginate( $start, $stop, $total, $summarize, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter )
Render the noResults output
function noResults( $text, $paginate )
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 )