Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -31,7 +31,7 @@ class _Item extends FormAbstract
|
||||
'class' => '\IPS\core\Foo', // The \Content\Item class
|
||||
'permissionCheck' => 'read', // If a permission key is provided, only content items that the member has that permission for will be available.
|
||||
'maxItems' => NULL, // Maximum items allowed to select, or NULL for unlimited
|
||||
'orderResults' => NULL|array // NULL or array( field, 'asc' ) where field is a mappable content item field (date, title, etc)
|
||||
'orderResults' => NULL|FALSE|array // NULL for default date ordering, FALSE for no ordering, or array( field, 'asc' ) where field is a mappable content item field (date, title, etc)
|
||||
'itemTemplate' => NULL // NULL or array of template group and template name array( \IPS\Theme::i()->getTemplate( 'group', 'app', 'location'), 'name' )
|
||||
'containerIds' => array // Array of container IDs to limit the search
|
||||
'minAjaxLength' => int // Number of characters to type before selector appears
|
||||
@@ -163,6 +163,19 @@ class _Item extends FormAbstract
|
||||
{
|
||||
$items[ $item->$idField ] = $item;
|
||||
}
|
||||
|
||||
/* If we didn't want to order results, reset the order of results as appropriate */
|
||||
if( $this->options['orderResults'] === FALSE )
|
||||
{
|
||||
$_sortedItems = array();
|
||||
|
||||
foreach( $this->value as $id )
|
||||
{
|
||||
$_sortedItems[ $id ] = $items[ $id ];
|
||||
}
|
||||
|
||||
$items = $_sortedItems;
|
||||
}
|
||||
}
|
||||
|
||||
$this->value = $items;
|
||||
|
||||
Reference in new issue
Block a user