addStyleDeclaration( JElementModulelist::makeStyle() );
$r = '
';
$r .= '';
$r .= '';
$r .= JElementModulelist::makeList( true, 'title');
$r .= JElementModulelist::makeList( false, 'title');
$r .= '
';
$r .= '
';
return $r;
}
function makeStyle() {
return '
table {}
table#modulelist-enabledonly td, table#modulelist td
{ padding: 1px 6px 1px 0;}
tr.r1 {background-color: #e8e8e8; }
table.modulelist th.sort { padding-right: 0.4em; padding-left:1px; font-size:110%;}
table.modulelist td.modid { text-align:right; }
table.modulelist th.modid { text-align:right; }
table.modulelist th.hover { background-color:#d0ffd0; }
div#all-mod-lists { height:390px; overflow:auto; background-color:white;}
';
}
function makeList( $enabledonly = true, $order ) {
$orderby = "title";
switch( $order ) {
case "title":
$orderby = "title";
break;
case "titledesc":
$orderby = "title desc";
break;
case "enabled":
$orderby = "published, title";
break;
case "enableddesc":
$orderby = "published desc, title";
break;
case "id":
$orderby = "id";
break;
case "iddesc":
$orderby = "id desc";
break;
case "type":
$orderby = "module, title";
break;
case "typedesc":
$orderby = "module desc, title";
break;
}
$db = &JFactory::getDBO();
$query = "SELECT id, title, module, position, published"
. "\n FROM #__modules WHERE ";
if ( $enabledonly ) {
$query .= "\n published = 1 AND ";
}
$query .= "\n client_id != 1"
. "\n ORDER BY $orderby"
;
$db->setQuery( $query );
$options = $db->loadObjectList();
$arrow = '../modules/mod_metamod/elements/updown.png';
$tick = 'images/tick.png';
$cross = 'images/publish_x.png';
$r = '
' . JText::_('id') . '  |
' . JText::_('name') . '  |
' . JText::_('type') . '  |
' . JText::_('position') . '  |
' . JText::_('MM_ENABLED') . '  |
';
$counter = 0;
foreach ($options as $o) {
$counter = abs( --$counter );
$r .= "\n";
$r .= '| '.$o->id.' |
'.$o->title.' |
'.$o->module.' |
'.$o->position.' |
.') | ';
$r .= "
\n";
}
$r .= "
";
return $r;
}
}