예제 #1
0
 function getList(&$params)
 {
     global $mainframe;
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     JPlugin::loadLanguage('com_alphacontent');
     $menuid = intval($params->get('itemidmenu'), 0);
     $componentused = trim($params->get('componentused', 'com_content'));
     $secid = trim($params->get('secid'));
     if ($secid) {
         $ids = explode(',', $secid);
         JArrayHelper::toInteger($ids);
         $secid = ' AND (id=' . implode(' OR id=', $ids) . ')';
     }
     $aid = $user->get('aid', 0);
     $nullDate = $db->getNullDate();
     $date =& JFactory::getDate();
     $now = $date->toMySQL();
     if (!$menuid) {
         return;
     }
     $menu = JSite::getMenu();
     $paramsmenucomponent = $menu->getParams($menuid);
     $url = "index.php?option=com_alphacontent";
     $sort_sections = $paramsmenucomponent->get('orderingsectioncat');
     switch ($componentused) {
         case "com_weblinks":
             $listsections[] = null;
             $listsections[0]->id = 'com_weblinks';
             $listsections[0]->title = JText::_('AC_WEBLINKS');
             $listsections[0]->image = $paramsmenucomponent->get('imageweblinkssection');
             break;
         case "com_contact":
             $listsections[] = null;
             $listsections[0]->id = 'com_contact_details';
             $listsections[0]->title = JText::_('AC_CONTACTS');
             $listsections[0]->image = $paramsmenucomponent->get('imagecontactsection');
             break;
         case "com_content":
         default:
             // Sections
             $query = "SELECT id, title, image" . " FROM #__sections" . " WHERE published = '1' " . " AND access <= '{$aid}'" . $secid . " ORDER BY {$sort_sections}";
             $db->setQuery($query);
             $listsections = $db->loadObjectList();
     }
     modAlphaContentBySectionHelper::getSections($url, $params, $listsections, $sort_sections);
 }