$this->DB->build(
array(
'select' => 'm.sys_module_key, m.sys_module_title, m.sys_module_application',
'from' => array( 'core_sys_module' => 'm' ),
'order' => 'a.app_title ASC, m.sys_module_title ASC',
'where' => 'm.sys_module_admin=0 AND m.sys_module_visible=1',
'add_join' => array(
array(
'select' => 'a.app_title',
'from' => array( 'core_applications' => 'a' ),
'where' => 'a.app_directory=m.sys_module_application',
'type' => 'left'
)
)
)
);
$this->DB->execute();
$modules = array();
$modules['all'] = "All modules";
while( $r = $this->DB->fetch() )
{
$modules[ $r['sys_module_application'] . '::' . $r['sys_module_key'] ] = $r['app_title'] . ':: ' . $r['sys_module_title'];
}