[feedback-ok] Sorting Languages List & Content Elements List

Hi this forum is closed as we do have a new feedback and suggestion system on http://feedback.joomfish.net - the forum includes all references to all suggestions. May be you can help us with migrating the threads to the new service.
Forum rules
Hi this forum is closed as we do have a new feedback and suggestion system on http://feedback.joomfish.net - the forum includes all references to all suggestions. May be you can help us with migrating the threads to the new service.

[feedback-ok] Sorting Languages List & Content Elements List

Postby eelziere on Sat Jun 14, 2008 3:28 pm

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.
eelziere
Newbee
 
Posts: 3
Joined: Sat Jun 14, 2008 3:01 pm

Re: Sorting Languages List & Content Elements List

Postby eelziere on Sat Jun 14, 2008 3:32 pm

Sorry, I forgot to attach the includes/sorting.php file. Here it is (inside the zip archive)!
Attachments
sorting.zip
(357 Bytes) Downloaded 240 times
eelziere
Newbee
 
Posts: 3
Joined: Sat Jun 14, 2008 3:01 pm

Re: Sorting Languages List & Content Elements List

Postby ivo.apostolov on Sat Jun 14, 2008 3:55 pm

How the languages and content elements are sorted in that way?
By default, these are displayed in alphabetic order
User avatar
ivo.apostolov
Contributor
 
Posts: 3248
Joined: Sat Oct 20, 2007 10:39 am
Location: Sofia

Re: Sorting Languages List & Content Elements List

Postby Geraint on Sat Jun 14, 2008 7:02 pm

@eelziere

In the future it would be good to offer sorting based on the column title clicked on all the lists (translations as well as content elements and languages). I'll try to get this done for Joomfish 2.1

Geraint
Joomfish club members can get priority forum support at the Support Forum. As well as access to a variety of custom Joomfish addons and benefits.

Join the Joomfish club today!
Geraint
Contributor
 
Posts: 2920
Joined: Sat Oct 20, 2007 9:13 am


Return to Wish List 2.x

Who is online

Users browsing this forum: No registered users and 2 guests