?
Path : /home/admin/public_html/old/promice/components/com_download/views/download/ |
Current File : /home/admin/public_html/old/promice/components/com_download/views/download/view.html.php |
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_download'.DS.'tables'); class CategoriesViewDownload extends JView { function display($tpl = null){ global $mainframe; $document = & JFactory::getDocument(); $user = & JFactory::getUser(); $cid = JRequest::getInt('cid', 0); $pid = JRequest::getInt('pid', 0); $category =& JTable::getInstance('categories', 'Table'); //call mootools JHTML::_('behavior.mootools'); JHTML::_('behavior.modal'); $document->addStyleSheet($this->baseurl. '/components/com_download/assets/css/styleProducts.css'); $url_images = $this->baseurl. '/components/com_download/assets/images_thumb/'; $Itemid = JRequest::getInt('Itemid'); //cacula width image when change num column $width = 540; $column = $this->get( 'ColumnTemplate' ); $image_width = intval($width/$column->show_template); $image_height = intval($image_width*0.6); //if detail item if ($cid && $pid ){ $products = & $this->get( 'Product' ); } elseif ($cid && !$pid){ //show item of catid $products =& $this->get( 'Data' ); $total = &$this->get('total'); $pagination = &$this->get('pagination'); } //if category is not contain sub-category is show item of category else show new item $check_catid = & $this->get( 'Check_catid' ); $this->assignRef( 'check_catid' , $check_catid ); $this->assignRef( 'category', $category ); $this->assignRef( 'products', $products ); $this->assignRef( 'column' , $column ); $this->assignRef( 'pagination' , $pagination ); $this->assignRef( 'url_images' , $url_images ); //width image $this->assignRef( 'image_width' , $image_width ); $this->assignRef( 'image_height' , $image_height ); $this->assignRef( 'Itemid' , $Itemid ); parent::display($tpl); } }