Source for file data.sort.php
Documentation is available at data.sort.php
* This plugin will sort the lines within a {sort} block
* @subpackage plugins_data
define( 'PLUGIN_GUID_DATASORT', 'datasort' );
'auto_activate' => FALSE,
'load_function' => 'data_sort',
'help_page' => 'DataPluginSort',
'description' => tra( "This plugin will sort the lines within a {sort} block." ),
'help_function' => 'data_sort_help',
'syntax' => "{sort sort= }". tra( "Lines to be sorted" ). "{sort}",
<table class="data help">
<th>'. tra( 'Key' ). '</th>
<th>'. tra( 'Value' ). '</th>
<th>'. tra( 'Comments' ). '</th>
<td>'. tra( "key-words"). '<br />'. tra("(optional)"). '</td>
<td>'. tra( 'Will sort the lines in the desired direction. Choices are:' ). '<strong>asc</strong>, <strong>desc</strong>, <strong>reverse</strong>, <strong>shuffle</strong>'. tra( 'Default:' ). '<strong>asc</strong>'. '</td>
tra( "Example: " ). '{sort sort=shuffle}<br />Line 1<br />Line 2<br />Line 3<br />{sort}';
* Load Function - data_sort
* @param pCommonObject object
* @param pParseHash array
function data_sort( $pData, $pParams, $pCommonObject, $pParseHash ) {
$sort = ( !empty( $pParams['sort'] )) ? $pParams['sort'] : 'asc';
} elseif( $sort == "desc" ) {
} elseif( $sort == "reverse" ) {
} elseif( $sort == "shuffle" ) {
$parseHash['content_id'] = $pParseHash['content_id'];
$parseHash['user_id'] = $pParseHash['user_id'];
$parseHash['no_cache'] = TRUE;
$parseHash['data'] = trim( $pData );
return $pCommonObject->parseData( $parseHash );
|