Beispiel #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);
 }
<?php

/**
* @version		$Id: mod_alphacontentbysection.php 2008-05-26 v1.0.0 $
* @package		AlphaContent for Joomla
* @copyright	Copyright (C) 2008. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// Include the syndicate functions only once
require_once dirname(__FILE__) . DS . 'helper.php';
$list = modAlphaContentBySectionHelper::getList($params);