0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: view.json.php.tar
home/academiac/www/administrator/components/com_virtuemart/views/custom/view.json.php 0000604 00000005222 15137224510 0025413 0 ustar 00 <?php /** * * Description * * @package VirtueMart * @subpackage * @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: view.html.php 3006 2011-04-08 13:16:08Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); // Load the view framework jimport( 'joomla.application.component.view'); /** * Json View class for the VirtueMart Component * * @package VirtueMart * @author Patrick Kohl */ class VirtuemartViewCustom extends JView { /* json object */ private $json = null; function display($tpl = null) { $db = JFactory::getDBO(); if ( $virtuemart_media_id = JRequest::getInt('virtuemart_media_id') ) { //$db = JFactory::getDBO(); $query='SELECT `file_url`,`file_title` FROM `#__virtuemart_medias` where `virtuemart_media_id`='.$virtuemart_media_id; $db->setQuery( $query ); $json = $db->loadObject(); if (isset($json->file_url)) { $json->file_url = JURI::root().$json->file_url; $json->msg = 'OK'; echo json_encode($json); } else { $json->msg = '<b>'.JText::_('COM_VIRTUEMART_NO_IMAGE_SET').'</b>'; echo json_encode($json); } } elseif ( $custom_jplugin_id = JRequest::getInt('custom_jplugin_id') ) { if (JVM_VERSION===1) { $table = '#__plugins'; $ext_id = 'id'; } else { $table = '#__extensions'; $ext_id = 'extension_id'; } $q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $ext_id . '` = "'.$custom_jplugin_id.'"'; $db ->setQuery($q); $this->plugin = $db ->loadObject(); if (!class_exists('vmParameters')) require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php'); $parameters = new vmParameters($this->plugin->params, $this->plugin->element , 'plugin' ,'vmcustom'); if (!class_exists('vmPlugin')) require(JPATH_VM_ADMINISTRATOR . DS . 'plugins' . DS . 'vmplugin.php'); $filename = 'plg_vmcustom_' . $this->plugin->element; vmPlugin::loadJLang($filename,'vmcustom',$this->plugin->element); echo $parameters->render(); echo '<input type="hidden" value="'.$this->plugin->element.'" name="custom_value">'; jExit(); } jExit(); } } // pure php no closing tag home/academiac/www/administrator/components/com_virtuemart/views/userfields/view.json.php 0000604 00000004350 15137322621 0026251 0 ustar 00 <?php /** * * Description * * @package VirtueMart * @subpackage * @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: view.html.php 3006 2011-04-08 13:16:08Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); // Load the view framework jimport( 'joomla.application.component.view'); /** * Json View class for the VirtueMart Component * * @package VirtueMart * @author Patrick Kohl */ class VirtuemartViewUserfields extends JView { function display($tpl = null) { $db = JFactory::getDBO(); if ( $field = JRequest::getVar('field') ) { if (strpos($field, 'plugin') !==false) { if (JVM_VERSION===1) { $table = '#__plugins'; //$ext_id = 'id'; } else { $table = '#__extensions'; //$ext_id = 'extension_id'; } $field = substr($field, 6); $q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `element` = "'.$field.'"'; $db ->setQuery($q); $this->plugin = $db ->loadObject(); if (!class_exists('vmParameters')) require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php'); $parameters = new vmParameters($this->plugin , $this->plugin->element , 'plugin' ,'vmuserfield'); $lang = JFactory::getLanguage(); $filename = 'plg_vmuserfield_' . $this->plugin->element; if(VmConfig::get('enableEnglish', 1)){ $lang->load($filename, JPATH_ADMINISTRATOR, 'en-GB', true); } $lang->load($filename, JPATH_ADMINISTRATOR, $lang->getDefault(), true); $lang->load($filename, JPATH_ADMINISTRATOR, null, true); echo $parameters->render(); //echo '<input type="hidden" value="'.$this->plugin->element.'" name="custom_value">'; jExit(); } } jExit(); } } // pure php no closing tag home/academiac/www/administrator/components/com_virtuemart/views/product/view.json.php 0000604 00000017232 15137355035 0025574 0 ustar 00 <?php /** * * Description * * @package VirtueMart * @subpackage * @author * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2012 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$ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); // Load the view framework jimport( 'joomla.application.component.view'); // Load some common models if(!class_exists('VirtueMartModelCustomfields')) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'customfields.php'); /** * HTML View class for the VirtueMart Component * * @package VirtueMart * @author */ class VirtuemartViewProduct extends JView { var $json = array(); function __construct( ){ $this->type = JRequest::getWord('type', false); $this->row = JRequest::getInt('row', false); $this->db = JFactory::getDBO(); $this->model = VmModel::getModel('Customfields') ; } function display($tpl = null) { $filter = JRequest::getVar('q', JRequest::getVar('term', false) ); $id = JRequest::getInt('id', false); $virtuemart_product_id = JRequest::getVar('virtuemart_product_id',array(),'', 'array'); if(is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0){ $product_id = (int)$virtuemart_product_id[0]; } else { $product_id = (int)$virtuemart_product_id; } //$customfield = $this->model->getcustomfield(); /* Get the task */ if ($this->type=='relatedproducts') { $query = "SELECT virtuemart_product_id AS id, CONCAT(product_name, '::', product_sku) AS value FROM #__virtuemart_products_".VMLANG." JOIN `#__virtuemart_products` AS p using (`virtuemart_product_id`)"; if ($filter) $query .= " WHERE product_name LIKE '%". $this->db->getEscaped( $filter, true ) ."%' or product_sku LIKE '%". $this->db->getEscaped( $filter, true ) ."%' limit 0,10"; self::setRelatedHtml($query,'R'); } else if ($this->type=='relatedcategories') { $query = "SELECT virtuemart_category_id AS id, CONCAT(category_name, '::', virtuemart_category_id) AS value FROM #__virtuemart_categories_".VMLANG; if ($filter) $query .= " WHERE category_name LIKE '%". $this->db->getEscaped( $filter, true ) ."%' limit 0,10"; self::setRelatedHtml($query,'Z'); } else if ($this->type=='custom') { $query = "SELECT CONCAT(virtuemart_custom_id, '|', custom_value, '|', field_type) AS id, CONCAT(custom_title, '::', custom_tip) AS value FROM #__virtuemart_customs"; if ($filter) $query .= " WHERE custom_title LIKE '%".$filter."%' limit 0,50"; $this->db->setQuery($query); $this->json['value'] = $this->db->loadObjectList(); $this->json['ok'] = 1 ; } else if ($this->type=='fields') { $fieldTypes= $this->model->getField_types() ; $query = 'SELECT *,`custom_value` as value FROM `#__virtuemart_customs` WHERE (`virtuemart_custom_id`='.$id.' or `custom_parent_id`='.$id.' ) '; $query .= 'order by `ordering` asc'; $this->db->setQuery($query); $rows = $this->db->loadObjectlist(); $html = array (); foreach ($rows as $field) { if ($field->field_type =='C' ){ $this->json['table'] = 'childs'; $q='SELECT `virtuemart_product_id` FROM `#__virtuemart_products` WHERE `published`=1 AND `product_parent_id`= '.JRequest::getInt('virtuemart_product_id'); //$this->db->setQuery(' SELECT virtuemart_product_id, product_name FROM `#__virtuemart_products` WHERE `product_parent_id` ='.(int)$product_id); $this->db->setQuery($q); if ($childIds = $this->db->loadResultArray()) { // Get childs foreach ($childIds as $childId) { $field->custom_value = $childId; $display = $this->model->displayProductCustomfieldBE($field,$childId,$this->row); if ($field->is_cart_attribute) $cartIcone= 'default'; else $cartIcone= 'default-off'; $html[] = '<div class="removable"> <td>'.$field->custom_title.'</td> <td>'.$display.$field->custom_tip.'</td> <td>'.JText::_($fieldTypes[$field->field_type]).' '.$this->model->setEditCustomHidden($field, $this->row).' </td> <td><span class="vmicon vmicon-16-'.$cartIcone.'"></span></td> <td></td> </div>'; $this->row++; } } } elseif ($field->field_type =='E') { $this->json['table'] = 'customPlugins'; $display = $this->model->displayProductCustomfieldBE($field,$product_id,$this->row); if ($field->is_cart_attribute) { $cartIcone= 'default'; } else { $cartIcone= 'default-off'; } $html[] = ' <tr class="removable"> <td><span class="hasTip" title="'.JText::_($field->custom_tip).'">'.$field->custom_title.'</td> <td>'.$display.' '.$this->model->setEditCustomHidden($field, $this->row).' <p>'.JTEXT::_('COM_VIRTUEMART_CUSTOM_ACTIVATE_JAVASCRIPT').'</p></td> <td><span class="vmicon vmicon-16-'.$cartIcone.'"></span>'.JText::_('COM_VIRTUEMART_CUSTOM_EXTENSION').'</td> <td><span class="vmicon vmicon-16-move"></span> <span class="vmicon vmicon-16-remove"></span><input class="ordering" type="hidden" value="'.$this->row.'" name="field['.$this->row .'][ordering]" /> </td> </tr>'; $this->row++; } else { $this->json['table'] = 'fields'; $display = $this->model->displayProductCustomfieldBE($field,$product_id,$this->row); if ($field->is_cart_attribute) $cartIcone= 'default'; else $cartIcone= 'default-off'; $html[] = '<tr class="removable"> <td><span class="hasTip" title="'.JText::_($field->custom_tip).'">'.$field->custom_title.'</td> <td>'.$display.'</td> <td><span class="vmicon vmicon-16-'.$cartIcone.'"></span>'.JText::_($fieldTypes[$field->field_type]).' '.$this->model->setEditCustomHidden($field, $this->row).' </td> <td><span class="vmicon vmicon-16-move"></span><span class="vmicon vmicon-16-remove"></span><input class="ordering" type="hidden" value="'.$this->row.'" name="field['.$this->row .'][ordering]" /></td> </tr>'; $this->row++; } } $this->json['value'] = $html; $this->json['ok'] = 1 ; } else if ($this->type=='userlist') { $status = JRequest::getvar('status'); $productShoppers=0; if ($status) { $productModel = VmModel::getModel('product'); $productShoppers = $productModel->getProductShoppersByStatus($product_id ,$status); } if(!class_exists('ShopFunctions'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'shopfunctions.php'); $html = ShopFunctions::renderProductShopperList($productShoppers); $this->json['value'] = $html; } else $this->json['ok'] = 0 ; if ( empty($this->json)) { $this->json['value'] = null; $this->json['ok'] = 1 ; } echo json_encode($this->json); } function setRelatedHtml($query,$fieldType) { $this->db->setQuery($query); $this->json = $this->db->loadObjectList(); $query = 'SELECT * FROM `#__virtuemart_customs` WHERE field_type ="'.$fieldType.'" '; $this->db->setQuery($query); $customs = $this->db->loadObject(); foreach ($this->json as &$related) { $customs->custom_value = $related->id; $display = $this->model->displayProductCustomfieldBE($customs,$related->id,$this->row); $html = '<div class="vm_thumb_image"> <div class="vmicon vmicon-16-remove"></div> <span>'.$display.'</span> '.$this->model->setEditCustomHidden($customs, $this->row).' </div>'; $related->label = $html; } } } // pure php no closing tag home/academiac/www/components/com_virtuemart/views/cart/view.json.php 0000604 00000004653 15140554663 0022172 0 ustar 00 <?php /** * * View for the shopping cart * * @package VirtueMart * @subpackage * @author Max Milbers * @link http://www.virtuemart.net * @copyright Copyright (c) 2013 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: view.html.php 6292 2012-07-20 12:27:44Z alatak $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); // Load the view framework if(!class_exists('VmView'))require(JPATH_VM_SITE.DS.'helpers'.DS.'vmview.php'); /** * View for the shopping cart * @package VirtueMart * @author Max Milbers */ class VirtueMartViewCart extends VmView { public function display($tpl = null) { $document = JFactory::getDocument(); $layoutName = $this->getLayout(); if (!$layoutName) $layoutName = JRequest::getWord('layout', 'default'); $this->assignRef('layoutName', $layoutName); $format = JRequest::getWord('format'); if (!class_exists('VirtueMartCart')) require(JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php'); $cart = VirtueMartCart::getCart(); $this->assignRef('cart', $cart); $this->prepareContinueLink(); shopFunctionsF::setVmTemplate($this, 0, 0, $layoutName); parent::display($tpl); } private function prepareContinueLink() { // Get a continue link $menuid = JRequest::getInt('Itemid',''); if(!empty($menuid)){ $menuid = '&Itemid='.$menuid; } else $menuid = ''; $virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId(); $categoryLink = ''; if ($virtuemart_category_id) { $categoryLink = '&virtuemart_category_id=' . $virtuemart_category_id; } $continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryLink.$menuid, FALSE); $continue_link_html = '<a class="continue_link" href="' . $continue_link . '" ><span>' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</span></a>'; $this->assignRef('continue_link_html', $continue_link_html); $this->assignRef('continue_link', $continue_link); $cart_link = JRoute::_('index.php?option=com_virtuemart&view=cart'.$menuid, FALSE); $this->assignRef('cart_link', $cart_link); } } //no closing tag
©
2018.