Joomla 1.5 Компонент календаря com_eventlist пишет ошибку на странице route.php.

Тема в разделе "Наполнение", создана пользователем renome79, 25.12.2009.

  1. Offline

    renome79 Недавно здесь

    Регистрация:
    14.12.2009
    Сообщения:
    9
    Симпатии:
    0
    Пол:
    Мужской
    Приветствую Вас agruts. Вот файл route.php

    <?php
    /**
    * @version 1.0 $Id: route.php 662 2008-05-09 22:28:53Z schlu $
    * @package Joomla
    * @subpackage EventList
    * @copyright (C) 2005 - 2008 Christoph Lukes
    * @license GNU/GPL, see LICENSE.php
    * EventList is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License 2
    * as published by the Free Software Foundation.

    * EventList is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.

    * You should have received a copy of the GNU General Public License
    * along with EventList; if not, write to the Free Software
    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    */

    defined('_JEXEC') or die('Restricted access');

    // Component Helper
    jimport('joomla.application.component.helper');

    /**
    * EventList Component Route Helper
    * based on Joomla ContentHelperRoute
    *
    * @static
    * @package Joomla
    * @subpackage EventList
    * @since 0.9
    */
    class EventListHelperRoute
    {
    /**
    * Determines an EventList Link
    *
    * @param int The id of an EventList item
    * @param string The view
    * @since 0.9
    *
    * @return string determined Link
    */
    function getRoute($id, $view = 'details')
    {
    //Not needed currently but kept because of a possible hierarchic link structure in future
    $needles = array(
    $view => (int) $id
    );

    //Create the link
    $link = 'index.php?option=com_eventlist&view='.$view.'&id='. $id;

    if($item = EventListHelperRoute::_findItem($needles)) {
    $link .= '&Itemid='.$item->id;
    };

    return $link;
    }

    /**
    * Determines the Itemid
    *
    * searches if a menuitem for this item exists
    * if not the first match will be returned
    *
    * @param array The id and view
    * @since 0.9
    *
    * @return int Itemid
    */
    function _findItem($needles)
    {
    $component =& JComponentHelper::getComponent('com_eventlist');

    $menus = & JSite::getMenu();
    $items = $menus->getItems('componentid', $component->id);
    $user = & JFactory::getUser();
    $access = (int)$user->get('aid');

    //Not needed currently but kept because of a possible hierarchic link structure in future
    foreach($needles as $needle => $id)
    {
    foreach($items as $item)
    {

    if ((@$item->query['view'] == $needle) && (@$item->query['id'] == $id) && ($item->published == 1) && ($item->access <= $access)) {
    return $item;
    }
    }

    //no menuitem exists -> return first possible match
    foreach($items as $item)
    {
    if ($item->published == 1 && $item->access <= $access) {
    return $item;
    }
    }

    }

    return false;
    }
    }
    ?>


    Спасибо большое.
     
  2.  
  3. agruts
    Offline

    agruts Группа поддержки

    Регистрация:
    01.03.2006
    Сообщения:
    609
    Симпатии:
    21
    Пол:
    Мужской
    собсно ошибка возникает изза того, что совершается попытка задействования переменной в обходе по циклу в массиве, которая не является элементом массива.

    выяснилось, что нужно создать пункт меню для компонента EventList и опубликовать его
     
  4. Offline

    Andrey0011 Гость

    Ого КОМПОНЕНТ Календаря впервые слышу.А чтоб не било ошибок установи обычный модуль календаря и у тебя все будет ок.
     
  5. Fanamura
    Offline

    Fanamura Доброта

    Регистрация:
    12.03.2007
    Сообщения:
    5 094
    Симпатии:
    158
    Пол:
    Мужской
    Andrey0011, компонент очень клевый, модуль далеко не всегда достаточен
     
  6. agruts
    Offline

    agruts Группа поддержки

    Регистрация:
    01.03.2006
    Сообщения:
    609
    Симпатии:
    21
    Пол:
    Мужской
    Andrey0011, у топикстартера модуль уже установлен
     
  7. Offline

    Andrey0011 Гость

    Видел компонент календаря реально классный но не чем помочь не могу, я еще не работал с ним.
     

Поделиться этой страницей

Загрузка...