سلام ، آیا این بازدید اول شماست ؟ یا
نمایش نتایج: از شماره 1 تا 2 , از مجموع 2

موضوع: اروری هنگام تغییر دادن منو ها

  1. #1

    تاریخ عضویت
    Jun 2011
    نوشته ها
    278
    تشکر
    16
    تشکر شده 78 بار در 70 ارسال

    اروری هنگام تغییر دادن منو ها

    با سلام

    وقتی می خوام اسم یک منو رو عوض کنم این اخطار رو میده .

    ذخیره ناموفق با این ایرادها: JTableMenuType: :ذخیره سازی ناموفق
    JLIB_DATABASE_ERROR_MENUTYPE_CHECKOUT

    کسی تا به حال به این مشکل برنخورده ؟

    جهت مشاهده لینک ها باید ثبت نام کنید یا لاگین کنید.


  2. # ADS
    تبلیغات در جوملا فارسی
    تاریخ عضویت
    Always
    نوشته ها
    Many
     

  3. #2
    Team
    تاریخ عضویت
    Dec 2008
    محل سکونت
    ساری
    نوشته ها
    10,737
    تشکر
    295
    تشکر شده 2,409 بار در 2,066 ارسال
    دروود


    به ادرس زیر برید
    libraries/joomla/table/menutype.php


    کد های زیر رو جایگذاری کنید

    کد:
    <?php/**
     * @package     Joomla.Platform
     * @subpackage  Database
     *
     * @copyright   Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
     * @license     GNU General Public License version 2 or later; see LICENSE
     */
    
    
    defined('JPATH_PLATFORM') or die;
    
    
    /**
     * Menu Types table
     *
     * @package     Joomla.Platform
     * @subpackage  Table
     * @since       11.1
     */
    class JTableMenuType extends JTable
    {
        /**
         * Constructor
         *
         * @param database A database connector object
         */
        public function __construct(&$db)
        {
            parent::__construct('#__menu_types', 'id', $db);
        }
    
    
        /**
         * @return boolean
         */
        function check()
        {
            $this->menutype = JApplication::stringURLSafe($this->menutype);
            if (empty($this->menutype)) {
                $this->setError(JText::_('JLIB_DATABASE_ERROR_MENUTYPE_EMPTY'));
                return false;
            }
    
    
            // Sanitise data.
            if (trim($this->title) == '') {
                $this->title = $this->menutype;
            }
    
    
            $db = $this->getDbo();
    
    
            // Check for unique menutype.
            $db->setQuery(
                'SELECT COUNT(id)' .
                ' FROM #__menu_types' .
                ' WHERE menutype = '.$db->quote($this->menutype).
                '  AND id <> '.(int) $this->id
            );
    
    
            if ($db->loadResult())
            {
                $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_MENUTYPE_EXISTS', $this->menutype));
                return false;
            }
    
    
            return true;
        }
        /**
         * Method to store a row in the database from the JTable instance properties.
         * If a primary key value is set the row with that primary key value will be
         * updated with the instance property values.  If no primary key value is set
         * a new row will be inserted into the database with the properties from the
         * JTable instance.
         *
         * @param   boolean True to update fields even if they are null.
         * @return  boolean True on success.
         * @since   11.1
         * @link    http://docs.joomla.org/JTable/store
         */
        public function store($updateNulls = false)
        {
            if ($this->id) {
                // Get the user id
                $userId = JFactory::getUser()->id;
    
    
                // Get the old value of the table
                $table = JTable::getInstance('Menutype','JTable');
                $table->load($this->id);
    
    
                // Verify that no items are cheched out
                $query = $this->_db->getQuery(true);
                $query->select('id');
                $query->from('#__menu');
                $query->where('menutype='.$this->_db->quote($table->menutype));
                $query->where('checked_out !='.(int) $userId);
                $query->where('checked_out !=0');
                $this->_db->setQuery($query);
                if ($this->_db->loadRowList()) {
                    $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', get_class($this), JText::_('JLIB_DATABASE_ERROR_MENUTYPE_CHECKOUT')));
                    return false;
                }
    
    
                // Verify that no module for this menu are cheched out
                $query = $this->_db->getQuery(true);
                $query->select('id');
                $query->from('#__modules');
                $query->where('module='.$this->_db->quote('mod_menu'));
                $query->where('params LIKE '.$this->_db->quote('%"menutype":'.json_encode($table->menutype).'%'));
                $query->where('checked_out !='.(int) $userId);
                $query->where('checked_out !=0');
                $this->_db->setQuery($query);
                if ($this->_db->loadRowList()) {
                    $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', get_class($this), JText::_('JLIB_DATABASE_ERROR_MENUTYPE_CHECKOUT')));
                    return false;
                }
    
    
                // Update the menu items
                $query = $this->_db->getQuery(true);
                $query->update('#__menu');
                $query->set('menutype='.$this->_db->quote($this->menutype));
                $query->where('menutype='.$this->_db->quote($table->menutype));
                $this->_db->setQuery($query);
                if (!$this->_db->query()) {
                    $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', get_class($this), $this->_db->getErrorMsg()));
                    return false;
                }
    
    
                // Update the module items
                $query = $this->_db->getQuery(true);
                $query->update('#__modules');
                $query->set('params=REPLACE(params,'.$this->_db->quote('"menutype":'.json_encode($table->menutype)).','.$this->_db->quote('"menutype":'.json_encode($this->menutype)).')');
                $query->where('module='.$this->_db->quote('mod_menu'));
                $query->where('params LIKE '.$this->_db->quote('%"menutype":'.json_encode($table->menutype).'%'));
                $this->_db->setQuery($query);
                if (!$this->_db->query()) {
                    $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', get_class($this), $this->_db->getErrorMsg()));
                    return false;
                }
            }
            return parent::store($updateNulls);
        }
        /**
         * Method to delete a row from the database table by primary key value.
         *
         * @param   mixed   An optional primary key value to delete.  If not set the
         *                  instance property value is used.
         * @return  boolean True on success.
         * @since   11.1
         * @link    http://docs.joomla.org/JTable/delete
         */
        public function delete($pk = null)
        {
            // Initialise variables.
            $k = $this->_tbl_key;
            $pk = (is_null($pk)) ? $this->$k : $pk;
    
    
            // If no primary key is given, return false.
            if ($pk !== null)
            {
                // Get the user id
                $userId = JFactory::getUser()->id;
    
    
                // Get the old value of the table
                $table = JTable::getInstance('Menutype','JTable');
                $table->load($pk);
    
    
                // Verify that no items are cheched out
                $query = $this->_db->getQuery(true);
                $query->select('id');
                $query->from('#__menu');
                $query->where('menutype='.$this->_db->quote($table->menutype));
                $query->where('(checked_out NOT IN (0,'.(int) $userId.') OR home=1 AND language='.$this->_db->quote('*').')');
                $this->_db->setQuery($query);
                if ($this->_db->loadRowList()) {
                    $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_DELETE_FAILED', get_class($this), JText::_('JLIB_DATABASE_ERROR_MENUTYPE')));
                    return false;
                }
    
    
                // Verify that no module for this menu are cheched out
                $query = $this->_db->getQuery(true);
                $query->select('id');
                $query->from('#__modules');
                $query->where('module='.$this->_db->quote('mod_menu'));
                $query->where('params LIKE '.$this->_db->quote('%"menutype":'.json_encode($table->menutype).'%'));
                $query->where('checked_out !='.(int) $userId);
                $query->where('checked_out !=0');
                $this->_db->setQuery($query);
                if ($this->_db->loadRowList()) {
                    $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_DELETE_FAILED', get_class($this), JText::_('JLIB_DATABASE_ERROR_MENUTYPE')));
                    return false;
                }
    
    
                // Delete the menu items
                $query = $this->_db->getQuery(true);
                $query->delete();
                $query->from('#__menu');
                $query->where('menutype='.$this->_db->quote($table->menutype));
                $this->_db->setQuery($query);
                if (!$this->_db->query()) {
                    $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_DELETE_FAILED', get_class($this), $this->_db->getErrorMsg()));
                    return false;
                }
    
    
                // Update the module items
                $query = $this->_db->getQuery(true);
                $query->delete();
                $query->from('#__modules');
                $query->where('module='.$this->_db->quote('mod_menu'));
                $query->where('params LIKE '.$this->_db->quote('%"menutype":'.json_encode($table->menutype).'%'));
                $this->_db->setQuery($query);
                if (!$this->_db->query()) {
                    $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_DELETE_FAILED', get_class($this), $this->_db->getErrorMsg()));
                    return false;
                }
            }
            return parent::delete($pk);
        }
    }
    در پناه ایزد

    جهت مشاهده لینک ها باید ثبت نام کنید یا لاگین کنید.


موضوعات مشابه

  1. تغییر مسیر و تغییر نام پوشه مدیریت جوملا
    توسط icons در انجمن نصب جوملا 2.5 فارسی
    پاسخ ها: 1
    آخرين نوشته: 01-25-2013, 07:59 PM
  2. تغییر تقویم فارسی به انگلیسی بدون تغییر زبان
    توسط farzad123 در انجمن سوالهای عمومی جوملا 1.5 فارسی
    پاسخ ها: 2
    آخرين نوشته: 07-29-2011, 06:50 AM
  3. تغییر دادن دومین بدون تغییر در سایت
    توسط sina14 در انجمن متفرقه
    پاسخ ها: 1
    آخرين نوشته: 04-11-2011, 01:02 PM

علاقه مندی ها (Bookmarks)

علاقه مندی ها (Bookmarks)

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •