cannot redeclare JAdminSubMenu - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-17-2010, 08:03 AM   #1 (permalink)
Junior Member
 
Join Date: Feb 2010
Posts: 5
Default cannot redeclare JAdminSubMenu

I am getting this error when I try to get into my database.

Fatal error: Cannot redeclare class JAdminSubMenu in

/home/carlisle/public_html/administrator/modules/mod_submenu/mod_submenu.php on line 32

I don't know more about PHP an was hoping someone could help me - I administer a joomla site and in time will

learn php. I only see a semicolon where line 32 ia. I've read a bit and saw require_once and include_once

lines that can make the code only happen once but am not sure if this appile to my file below.

I am getting code twice for JAdminSubmenu on my site.

code:

PHP Code:
<?php
/**
* @version        $Id:mod_menu.php 2463 2006-02-18 06:05:38Z webImagery $
* @package        Joomla
* @copyright    Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

// Lets get some variables we will need to render the menu
$lang    =& JFactory::getLanguage();
$doc    =& JFactory::getDocument();
$user    =& JFactory::getUser();

// If hidemainmenu is true, we don't want to render this module at all
echo JAdminSubMenu::get();

/**
* Admin Submenu
*
* @package        Joomla
* @since 1.5
*/
class JAdminSubMenu
{                               (charlie here this is where line 32 is)
    function 
get()
    {
        global 
$mainframe;

        
// Lets get some variables we are going to need
        
$menu JToolBar::getInstance('submenu');
        
$list $menu->_bar;
        if(!
is_array($list) || !count($list))
        {
            
$option JRequest::getCmd('option');
            if(
$option == 'com_categories')
            {
                
$section JRequest::getCmd('section');
                if (
$section) {
                    if (
$section != 'content') {
                        
// special handling for specific core components
                        
$map['com_contact_details']    = 'com_contact';
                        
$map['com_banner']            = 'com_banners';

                        
$option = isset( $map[$section] ) ? $map[$section] : $section;
                    }
                }
            }
            
$list JAdminSubMenu::_loadDBList($option);
        }

        if (!
is_array($list) || !count($list)) {
            return 
null;
        }

        
$hide JRequest::getInt('hidemainmenu');
        
$txt "<ul id=\"submenu\">\n";

        
/*
         * Iterate through the link items for building the menu items

         */
        
foreach ($list as $item)
        {
            
$txt .= "<li>\n";
            if (
$hide)
            {
                if (isset (
$item[2]) && $item[2] == 1) {
                    
$txt .= "<span class=\"nolink active\">".$item[0]."</span>\n";
                }
                else {
                    
$txt .= "<span class=\"nolink\">".$item[0]."</span>\n";
                }
            }
            else
            {
                if (isset (
$item[2]) && $item[2] == 1) {
                    
$txt .= "<a class=\"active\" 

href=\""
.JFilterOutput::ampReplace($item[1])."\">".$item[0]."</a>\n";
                }
                else {
                    
$txt .= "<a href=\"".JFilterOutput::ampReplace($item[1])."\">".$item[0]."</a>\n";
                }
            }
            
$txt .= "</li>\n";
        }

        
$txt .= "</ul>\n";

        return 
$txt;
    }

    function 
_loadDBList$componentOption )
    {
        
$db   =& JFactory::getDBO();
        
$lang =& JFactory::getLanguage();

        
$lang->load($componentOption.'.menu');

        
$query 'SELECT a.name, a.admin_menu_link, a.admin_menu_img' .
        
' FROM #__components AS a' .
        
' INNER JOIN #__components AS b ON b.id = a.parent' .
        
' WHERE b.option = ' $db->Quote$componentOption ) .
        
' AND b.parent = 0'.
        
' ORDER BY a.ordering ASC';

        
$db->setQuery($query);
        
$items $db->loadObjectList();

        
// Process the items
        
$subMenuList = array();

        foreach (
$items as $item)
        {
            if (
trim($item->admin_menu_link))
            {
                
// handling for active sub menu item
                
$active 0;
                if (
strpos( @$_SERVER['QUERY_STRING'], $item->admin_menu_link ) !== false ) {
                    
$active 1;
                }

                
$key $componentOption.'.'.$item->name;
                
$subMenuItem[0]    = $lang->hasKey($key) ? JText::_($key) : $item->name;
                
$subMenuItem[1]    = 'index.php?'$item->admin_menu_link;
                
$subMenuItem[2]    = $active;

                
$subMenuList[] = $subMenuItem;
            }
        }

        return 
$subMenuList;
    }
}
ststacytucker9 is offline   Reply With Quote
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:50 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting