In Joomfish backend, languages dropdown list and content elements dropdown list should be sorted according to the labels in the lists. It is quite painful if you have a lot of content elements not sorted, to select one easily.
One proposal to implement this in Joomfish 2.0 :
- Add the new includes/sorting.php file (see attachment)
- Modify the administrator/components/com_joomfish/controllers/translate.php (see attachment) the following way.
Starting from line #174, add the following lines in green:
========================================================================================
// Required to sort languages and content elements before building dropdown lists
require_once( JPATH_SITE . '/includes/sorting.php' );
// Create the pagination object
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit);
// get list of active languages
$langOptions[] = JHTML::_('select.option', '-1', JText::_('Select Language') );
$langOptions[] = JHTML::_('select.option', 'NULL', JText::_('Select no Translation'));
$langActive = $this->_joomfishManager->getLanguages( false ); // all languages even non active once
if ( count($langActive)>0 ) {
// Sort languages before building dropdown list
$sorter = new objectArraySorter();
$sorter->sort($langActive, "name");
foreach( $langActive as $language )
{
$langOptions[] = JHTML::_('select.option', $language->id, $language->name );
}
}
$langlist = JHTML::_('select.genericlist', $langOptions, 'select_language_id',
'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text',
$language_id );
// get list of element names
$elementNames[] = JHTML::_('select.option', '', JText::_('Please select') );
//$elementNames[] = JHTML::_('select.option', '-1', '- All Content elements' );
// force reload to make sure we get them all
$elements = $this->_joomfishManager->getContentElements(true);
if ( count($elements)>0 ) {
// Sort lcontent elements before building dropdown list
$sorter = new objectArraySorter();
$sorter->sort($elements, "Name");
foreach( $elements as $key => $element )
{
$elementNames[] = JHTML::_('select.option', $key, $element->Name );
}
}
$clist = JHTML::_('select.genericlist', $elementNames, 'catid',
'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $catid );
========================================================================================
Hope this will help the dev team.
Cheers!
EE.
