0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: manufacturercategories.php.tar
home/academiac/www/administrator/components/com_virtuemart/models/manufacturercategories.php 0000604 00000010421 15137215237 0027052 0 ustar 00 <?php /** * * Manufacturer category model * * @package VirtueMart * @subpackage Manufacturer category * @author Patrick Kohl * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart 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. * @version $Id: manufacturercategories.php 6350 2012-08-14 17:18:08Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); if(!class_exists('VmModel'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmmodel.php'); /** * Model class for manufacturer category * * @package VirtueMart * @subpackage Manufacturer category * @author */ class VirtuemartModelManufacturercategories extends VmModel { /** * constructs a VmModel * setMainTable defines the maintable of the model * @author Max Milbers */ function __construct() { parent::__construct('virtuemart_manufacturercategories_id'); $this->setMainTable('manufacturercategories'); $this->addvalidOrderingFieldName(array('mf_category_name')); $config=JFactory::getConfig(); } /** * Retrieve the detail record for the current $id if the data has not already been loaded. * */ // function getManufacturerCategory(){ //// $db = JFactory::getDBO(); // if (empty($this->_data)) { // $this->_data = $this->getTable('manufacturercategories'); // $this->_data->load((int)$this->_id); // } //// print_r( $this->_db->_sql ); // if (!$this->_data) { // $this->_data = new stdClass(); // $this->_id = 0; // $this->_data = null; // } // return $this->_data; // } /** * Delete all record ids selected * * @return boolean True is the remove was successful, false otherwise. */ function remove($categoryIds) { $table = $this->getTable('manufacturercategories'); foreach($categoryIds as $categoryId) { if($table->checkManufacturer($categoryId)) { if (!$table->delete($categoryId)) { vmError($table->getError()); return false; } } else { vmError(get_class( $this ).'::remove '.$categoryId.' '.$table->getError()); return false; } } return true; } /** * Retireve a list of countries from the database. * * @param string $onlyPuiblished True to only retreive the published categories, false otherwise * @param string $noLimit True if no record count limit is used, false otherwise * @return object List of manufacturer categories objects */ function getManufacturerCategories($onlyPublished=false, $noLimit=false) { $this->_noLimit = $noLimit; $select = '* FROM `#__virtuemart_manufacturercategories_'.VMLANG.'` as l'; $joinedTables = ' JOIN `#__virtuemart_manufacturercategories` as mc using (`virtuemart_manufacturercategories_id`)'; $where = array(); if ($onlyPublished) { $where[] = ' `#__virtuemart_manufacturercategories`.`published` = 1'; } // $query .= ' ORDER BY `#__virtuemart_manufacturercategories`.`mf_category_name`'; $whereString = ''; if (count($where) > 0) $whereString = ' WHERE '.implode(' AND ', $where) ; if ( JRequest::getCmd('view') == 'manufacturercategories') { $ordering = $this->_getOrdering(); } else { $ordering = ' order by mf_category_name DESC'; } return $this->_data = $this->exeSortSearchListQuery(0,$select,$whereString,$joinedTables,$ordering); } /** * Build category filter * * @return object List of category to build filter select box */ function getCategoryFilter(){ $db = JFactory::getDBO(); $query = 'SELECT `virtuemart_manufacturercategories_id` as `value`, `mf_category_name` as text' .' FROM #__virtuemart_manufacturercategories_'.VMLANG.'`'; $db->setQuery($query); $categoryFilter[] = JHTML::_('select.option', '0', '- '. JText::_('COM_VIRTUEMART_SELECT_MANUFACTURER_CATEGORY') .' -' ); $categoryFilter = array_merge($categoryFilter, (array)$db->loadObjectList()); return $categoryFilter; } } // pure php no closing tag home/academiac/www/administrator/components/com_virtuemart/tables/manufacturercategories.php 0000604 00000004525 15137215246 0027051 0 ustar 00 <?php /** * * Manufacturer Category table * * @package VirtueMart * @subpackage Manufacturer category * @author Patrick Kohl * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart 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. * @version $Id: manufacturercategories.php 4731 2011-11-17 01:35:45Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); if(!class_exists('VmTable'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmtable.php'); /** * Manufacturer category table class * The class is used to manage the manufacturer category in the shop. * * @package VirtueMart * @author Patrick Kohl */ class TableManufacturercategories extends VmTable { /** @var int Primary key */ var $virtuemart_manufacturercategories_id = 0; /** @var string manufacturer category name */ var $mf_category_name = ''; /** @var string manufacturer category description */ var $mf_category_desc = ''; /** @var int published or unpublished */ var $published = 1; /** * @author Max Milbers * @param JDataBase $db */ function __construct(&$db) { parent::__construct('#__virtuemart_manufacturercategories', 'virtuemart_manufacturercategories_id', $db); $this->setUniqueName('mf_category_name'); $this->setLoggable(); $this->setTranslatable(array('mf_category_name','mf_category_desc')); $this->setSlug('mf_category_name'); } /* * Verify that user have to delete all manufacturers of a particular category before that category can be removed * * @return boolean True if category is ready to be removed, otherwise False */ function checkManufacturer($categoryId = 0) { if($categoryId > 0) { $db = JFactory::getDBO(); $q = 'SELECT count(*)' .' FROM #__virtuemart_manufacturers' .' WHERE virtuemart_manufacturercategories_id = '.$categoryId; $db->setQuery($q); $mCount = $db->loadResult(); if($mCount > 0) { vmInfo('COM_VIRTUEMART_REMOVE_IN_USE'); return false; } } return true; } } // pure php no closing tag home/academiac/www/administrator/components/com_virtuemart/controllers/manufacturercategories.php 0000604 00000002471 15137246475 0030153 0 ustar 00 <?php /** * * Manufacturer category controller * * @package VirtueMart * @subpackage Manufacturer Category * @author Patrick Kohl * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart 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. * @version $Id: manufacturercategories.php 6007 2012-05-07 12:58:30Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); // Load the controller framework jimport('joomla.application.component.controller'); if(!class_exists('VmController'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmcontroller.php'); /** * Manufacturer category controller * * @package VirtueMart * @subpackage Manufacturer * @author */ class VirtuemartControllermanufacturercategories extends VmController { /** * Method to display the view * * @access public * @author */ function __construct() { parent::__construct('virtuemart_manufacturercategories_id'); } } // pure php no closing tag
©
2018.