Example #1
0
 protected function getOptions()
 {
     tsmConfig::loadConfig();
     // if VM is not installed
     if (!JFolder::exists(JPATH_ROOT . '/administrator/components/com_virtuemart') or !class_exists('ShopFunctions')) {
         // add the root item
         $option = new stdClass();
         $option->text = JText::_('MOD_SLIDESHOWCK_VIRTUEMART_NOTFOUND');
         $option->value = '0';
         $options[] = $option;
         // Merge any additional options in the XML definition.
         $options = array_merge(parent::getOptions(), $options);
         return $options;
     }
     $categorylist = ShopFunctions::categoryListTree();
     // $categorylist = 'testced';
     $categorylist = trim($categorylist, '</option>');
     $categorylist = explode("</option><option", $categorylist);
     // add the root item
     $option = new stdClass();
     $option->text = JText::_('MOD_SLIDESHOWCK_VIRTUEMART_ROOTNODE');
     $option->value = '0';
     $options[] = $option;
     foreach ($categorylist as $cat) {
         $option = new stdClass();
         $text = explode(">", $cat);
         $option->text = trim($text[1]);
         $option->value = strval(trim(trim(trim($text[0]), '"'), 'value="'));
         $options[] = $option;
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
Example #2
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $layoutName = $this->getLayout();
     $task = vRequest::getCmd('task', $layoutName);
     $this->assignRef('task', $task);
     if ($layoutName == 'edit') {
         //For shoppergroup specific price display
         tsmConfig::loadJLang('com_tsmart_config');
         tsmConfig::loadJLang('com_tsmart_shoppers', true);
         $shoppergroup = $model->getShopperGroup();
         $this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name);
         if ($this->showVendors()) {
             $this->vendorList = ShopFunctions::renderVendorList($shoppergroup->tsmart_vendor_id);
         }
         $this->assignRef('shoppergroup', $shoppergroup);
         $this->addStandardEditViewCommands();
     } else {
         $this->SetViewTitle();
         $showVendors = $this->showVendors();
         $this->assignRef('showVendors', $showVendors);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $shoppergroups = $model->getShopperGroups(false, true);
         $this->assignRef('shoppergroups', $shoppergroups);
         $pagination = $model->getPagination();
         $this->assignRef('sgrppagination', $pagination);
     }
     parent::display($tpl);
 }
Example #3
0
 function display($tpl = null)
 {
     tsmConfig::loadJLang('com_tsmart_countries');
     //co
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel('language');
     $zoneModel = tmsModel::getModel('worldzones');
     $this->SetViewTitle();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $this->language = $model->getData();
         $this->wzsList = $zoneModel->getWorldZonesSelectList();
         $this->addStandardEditViewCommands();
     } else {
         $this->addStandardDefaultViewCommandsEditInline(true, false);
         //First the view lists, it sets the state of the model
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $filter_language = vRequest::getCmd('filter_language', false);
         $this->items = $model->getItemList();
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
Example #4
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 function getInput()
 {
     $key = $this->element['key_field'] ? $this->element['key_field'] : 'value';
     $val = $this->element['value_field'] ? $this->element['value_field'] : $this->name;
     tsmConfig::loadConfig();
     return JHtml::_('select.genericlist', $this->_getProducts(), $this->name, 'class="inputbox"   ', 'value', 'text', $this->value, $this->id);
 }
Example #5
0
 function display($tpl = null)
 {
     // Load the helper(s)
     $this->addHelperPath(VMPATH_ADMIN . DS . 'helpers');
     if (!class_exists('vmPSPlugin')) {
         require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php';
     }
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $layoutName = vRequest::getCmd('layout', 'default');
     $this->SetViewTitle();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         tsmConfig::loadJLang('plg_vmpsplugin', false);
         JForm::addFieldPath(VMPATH_ADMIN . DS . 'fields');
         $shipment = $model->getShipment();
         // Get the payment XML.
         $formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmshipment' . DS . $shipment->shipment_element . DS . $shipment->shipment_element . '.xml');
         if (file_exists($formFile)) {
             $shipment->form = JForm::getInstance($shipment->shipment_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
             $shipment->params = new stdClass();
             $varsToPush = vmPlugin::getVarsToPushFromForm($shipment->form);
             tsmTable::bindParameterableToSubField($shipment, $varsToPush);
             $shipment->form->bind($shipment->getProperties());
         } else {
             $shipment->form = null;
         }
         if (!class_exists('VmImage')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
         }
         if (!class_exists('tsmartModelVendor')) {
             require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
         }
         $vendor_id = 1;
         $currency = tsmartModelVendor::getVendorCurrency($vendor_id);
         $this->assignRef('vendor_currency', $currency->currency_symbol);
         if ($this->showVendors()) {
             $vendorList = ShopFunctions::renderVendorList($shipment->tsmart_vendor_id);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
         $this->assignRef('shipment', $shipment);
         $this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->tsmart_shoppergroup_ids, true);
         $this->addStandardEditViewCommands($shipment->tsmart_shipmentmethod_id);
     } else {
         JToolBarHelper::custom('cloneshipment', 'copy', 'copy', tsmText::_('com_tsmart_SHIPMENT_CLONE'), true);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $this->shipments = $model->getShipments();
         tsmConfig::loadJLang('com_tsmart_shoppers', TRUE);
         foreach ($this->shipments as &$data) {
             // Write the first 5 shoppergroups in the list
             $data->shipmentShoppersList = shopfunctions::renderGuiList($data->tsmart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'shopper');
         }
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
 function getInput()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart');
     $model = tmsModel::getModel('Manufacturer');
     $manufacturers = $model->getManufacturers(true, true, false);
     return JHtml::_('select.genericlist', $manufacturers, $this->name, 'class="inputbox"   ', 'value', 'text', $this->value, $this->id);
 }
Example #7
0
 /**
  * Send the ask question email.
  * @author Kohl Patrick, Christopher Roussel
  */
 public function mailAskquestion()
 {
     vRequest::vmCheckToken();
     if (!class_exists('shopFunctionsF')) {
         require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
     }
     $model = tmsModel::getModel('vendor');
     $mainframe = JFactory::getApplication();
     $vars = array();
     $min = tsmConfig::get('asks_minimum_comment_length', 50) + 1;
     $max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1;
     $commentSize = vRequest::getString('comment');
     if (function_exists('mb_strlen')) {
         $commentSize = mb_strlen($commentSize);
     } else {
         $commentSize = strlen($commentSize);
     }
     $validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);
     $virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1);
     if (!class_exists('VirtueMartModelVendor')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
     }
     $userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
     //$vendorUser = JFactory::getUser($userId);
     if ($commentSize < $min || $commentSize > $max || !$validMail) {
         $this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
         return;
     }
     $user = JFactory::getUser();
     $fromMail = vRequest::getVar('email');
     //is sanitized then
     $fromName = vRequest::getVar('name', '');
     //is sanitized then
     $fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
     $fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
     if (!empty($user->id)) {
         if (empty($fromMail)) {
             $fromMail = $user->email;
         }
         if (empty($fromName)) {
             $fromName = $user->name;
         }
     }
     $vars['user'] = array('name' => $fromName, 'email' => $fromMail);
     $VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
     $vars['vendor'] = array('vendor_store_name' => $fromName);
     if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) {
         $string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
     } else {
         $string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
     }
     $mainframe->enqueueMessage(tsmText::_($string));
     // Display it all
     $view = $this->getView('vendor', 'html');
     $view->setLayout('mail_confirmed');
     $view->display();
 }
Example #8
0
 /**
  * constructs a VmModel
  * setMainTable defines the maintable of the model
  *
  * @author Max Milbers
  */
 function __construct()
 {
     parent::__construct();
     //Todo multivendor nasty hack, to get vendor with id 1
     if (tsmConfig::get('multix', 'none') == 'none') {
         $this->setId(1);
     }
     $this->setMainTable('vendors');
 }
Example #9
0
 function __construct()
 {
     parent::__construct();
     if (tsmConfig::get('shop_is_offline') == '1') {
         vRequest::setVar('layout', 'off_line');
     } else {
         vRequest::setVar('layout', 'default');
     }
 }
 /**
  * Method to get the field input markup. Use as name the view of the desired layout list + "layout".
  * For example <field name="categorylayout" for all layouts of hte category view.
  *
  * @author   Max Milbers
  * @return	string	The field input markup.
  * @since	2.0.24a
  */
 function getInput()
 {
     tsmConfig::loadJLang('com_tsmart');
     $view = substr($this->fieldname, 0, -6);
     $model = tmsModel::getModel('config');
     $vmLayoutList = $model->getFieldList('products');
     $html = JHtml::_('Select.genericlist', $vmLayoutList, $this->name, 'size=1 width=200', 'value', 'text', array($this->value));
     return $html;
 }
Example #11
0
 function getInput()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart');
     $key = $this->element['key_field'] ? $this->element['key_field'] : 'value';
     $val = $this->element['value_field'] ? $this->element['value_field'] : $this->name;
     $model = tmsModel::getModel('vendor');
     $vendors = $model->getVendors(true, true, false);
     return JHtml::_('select.genericlist', $vendors, $this->name, 'class="inputbox"  size="1"', 'tsmart_vendor_id', 'vendor_name', $this->value, $this->id);
 }
Example #12
0
 /**
  * Method to get the field input markup for Access Control Lists.
  * This is an overload of the core Rules form field
  * It address the issue where several rules cannot be used in the same configuration file
  */
 protected function getInput()
 {
     tsmConfig::loadConfig();
     JHtml::_('behavior.tooltip');
     if (JVM_VERSION < 3) {
         return $this->vmRulesJ25();
     } else {
         return $this->vmRules();
     }
 }
Example #13
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart');
     $categorylist = ShopFunctions::categoryListTree(array($this->value));
     $html = '<select class="inputbox"   name="' . $this->name . '" >';
     $html .= '<option value="0">' . tsmText::_('com_tsmart_CATEGORY_FORM_TOP_LEVEL') . '</option>';
     $html .= $categorylist;
     $html .= "</select>";
     return $html;
 }
Example #14
0
 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     if ($tsmart_media_id = vRequest::getInt('tsmart_media_id')) {
         //$db = JFactory::getDBO();
         $query = 'SELECT `file_url`,`file_title` FROM `#__tsmart_medias` where `tsmart_media_id`=' . $tsmart_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 vmJsApi::safe_json_encode($json);
         } else {
             $json->msg = '<b>' . tsmText::_('com_tsmart_NO_IMAGE_SET') . '</b>';
             echo json_encode($json);
         }
     } elseif ($custom_jplugin_id = vRequest::getInt('custom_jplugin_id')) {
         $table = '#__extensions';
         $ext_id = 'extension_id';
         $q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $ext_id . '` = "' . $custom_jplugin_id . '"';
         $db->setQuery($q);
         $this->jCustom = $db->loadObject();
         $customModel = tmsModel::getModel('custom');
         $this->custom = $customModel->getCustom();
         // Get the payment XML.
         $formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->jCustom->element . DS . $this->jCustom->element . '.xml');
         if (file_exists($formFile)) {
             tsmConfig::loadJLang('plg_vmpsplugin', false);
             if (!class_exists('vmPlugin')) {
                 require VMPATH_PLUGINLIBS . DS . 'vmplugin.php';
             }
             $filename = 'plg_vmcustom_' . $this->jCustom->element;
             vmPlugin::loadJLang($filename, 'vmcustom', $this->jCustom->element);
             $this->custom = tmsModel::getModel('custom')->getCustom();
             $varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
             $this->custom->form = JForm::getInstance($this->jCustom->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
             $this->custom->params = new stdClass();
             foreach ($varsToPush as $k => $field) {
                 if (strpos($k, '_') != 0) {
                     $this->custom->params->{$k} = $field[0];
                 }
             }
             $this->custom->form->bind($this->custom->getProperties());
             $form = $this->custom->form;
             include VMPATH_ADMIN . DS . 'fields' . DS . 'formrenderer.php';
             echo '<input type="hidden" value="' . $this->jCustom->element . '" name="custom_value">';
         } else {
             $this->custom->form = null;
             //VmConfig::$echoDebug = 1;
             vmdebug('File does not exist ' . $formFile);
         }
     }
     jExit();
 }
Example #15
0
 function getInput()
 {
     tsmConfig::loadConfig();
     $model = tmsModel::getModel('Manufacturer');
     $manufacturers = $model->getManufacturers(true, true, false);
     $emptyOption = JHtml::_('select.option', '', tsmText::_('com_tsmart_LIST_EMPTY_OPTION'), 'tsmart_manufacturer_id', 'mf_name');
     if (!empty($manufacturers) and is_array($manufacturers)) {
         array_unshift($manufacturers, $emptyOption);
     } else {
         $manufacturers = array($emptyOption);
     }
     return JHtml::_('select.genericlist', $manufacturers, $this->name, 'class="inputbox"  size="1"', 'tsmart_manufacturer_id', 'mf_name', $this->value, $this->id);
 }
Example #16
0
 /**
  * Method to get the field input markup. Use as name the view of the desired layout list + "layout".
  * For example <field name="categorylayout" for all layouts of hte category view.
  *
  * @author   Max Milbers
  * @return	string	The field input markup.
  * @since	2.0.24a
  */
 function getInput()
 {
     tsmConfig::loadJLang('com_tsmart');
     $this->view = (string) $this->element['view'];
     if (empty($this->view)) {
         $view = substr($this->fieldname, 0, -6);
     } else {
         $view = $this->view;
     }
     $vmLayoutList = tsmartModelConfig::getLayoutList($view);
     $html = JHtml::_('Select.genericlist', $vmLayoutList, $this->name, 'size=1 width=200', 'value', 'text', array($this->value));
     return $html;
 }
 protected function getOptions()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart', false);
     $cModel = tmsModel::getModel('currency');
     $values = $cModel->getVendorAcceptedCurrrenciesList();
     $options[] = JHtml::_('select.option', 0, tsmText::_('com_tsmart_DEFAULT_VENDOR_CURRENCY'));
     $options[] = JHtml::_('select.option', -1, tsmText::_('com_tsmart_SELECTED_MODULE_CURRENCY'));
     foreach ($values as $v) {
         $options[] = JHtml::_('select.option', $v->tsmart_currency_id, $v->currency_txt);
     }
     return $options;
 }
Example #18
0
 /**
  * Todo do we need that anylonger? that way.
  * @see JController::display()
  */
 public function display($cachable = false, $urlparams = false)
 {
     $format = vRequest::getCmd('format', 'html');
     if ($format == 'pdf') {
         $viewName = 'pdf';
     } else {
         $viewName = 'orders';
     }
     tsmConfig::loadJLang('com_virtuemart_orders', TRUE);
     tsmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
     $view = $this->getView($viewName, $format);
     // Display it all
     $view->display();
 }
Example #19
0
 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart');
     $option = vRequest::getCmd('option');
     if (!function_exists('curl_init') or !function_exists('curl_exec')) {
         return tsmText::_('com_tsmart_PS_CURL_LIBRARY_NOT_INSTALLED');
     } else {
         $js = "\n jQuery(document).ready(function( \$ ) {\n   \$( '#vmcurl' ) .closest('.control-group').hide();\n });\n ";
         $doc = JFactory::getDocument();
         $doc->addScriptDeclaration($js);
         return '<span id="vmcurl"></span>';
     }
 }
Example #20
0
 function renderMailLayout($doVendor, $recipient)
 {
     $tpl = tsmConfig::get('order_mail_html') ? 'mail_html_notify' : 'mail_raw_notify';
     $this->doVendor = $doVendor;
     $this->fromPdf = false;
     $this->uselayout = $tpl;
     $this->subject = !empty($this->subject) ? $this->subject : tsmText::_('COM_VIRTUEMART_CART_NOTIFY_MAIL_SUBJECT');
     $this->layoutName = $tpl;
     $this->setLayout($tpl);
     $this->isMail = true;
     $this->user = new stdClass();
     $this->user->name = $this->vendor->vendor_store_name;
     $this->user->email = $this->vendorEmail;
     parent::display();
 }
Example #21
0
 protected function getOptions()
 {
     tsmConfig::loadJLang('com_tsmart_orders', TRUE);
     $options = array();
     $db = JFactory::getDBO();
     $query = 'SELECT `order_status_code` AS value, `order_status_name` AS text
              FROM `#__tsmart_orderstates`
              WHERE `tsmart_vendor_id` = 1
              ORDER BY `ordering` ASC ';
     $db->setQuery($query);
     $values = $db->loadObjectList();
     foreach ($values as $value) {
         $options[] = JHtml::_('select.option', $value->value, tsmText::_($value->text));
     }
     return $options;
 }
Example #22
0
 protected function getLabel()
 {
     $description = $this->element['description'];
     tsmConfig::loadConfig();
     $html = '';
     $class = !empty($this->class) ? 'class="' . $this->class . '"' : '';
     if (empty($class)) {
         $class .= "style=\"font-weight: bold; padding: 5px; background-color: #cacaca; float:none; clear:both;\"";
     }
     if ($this->value) {
         $html .= '<div ' . $class . '>';
         $html .= tsmText::_($this->value);
         $html .= '</div>';
     }
     return $html;
 }
Example #23
0
 /**
  * @param $rssURL
  * @param $max
  * @return array|bool
  */
 public static function getRssFeed($rssURL, $max, $cache_time)
 {
     //if (JVM_VERSION < 3){
     $erRep = tsmConfig::setErrorReporting(false, true);
     jimport('simplepie.simplepie');
     $rssFeed = new SimplePie($rssURL);
     $feeds = array();
     $count = $rssFeed->get_item_quantity();
     $limit = min($max, $count);
     for ($i = 0; $i < $limit; $i++) {
         $feed = new StdClass();
         $item = $rssFeed->get_item($i);
         $feed->link = $item->get_link();
         $feed->title = $item->get_title();
         $feed->description = $item->get_description();
         $feeds[] = $feed;
     }
     if ($erRep[0]) {
         ini_set('display_errors', $erRep[0]);
     }
     if ($erRep[1]) {
         error_reporting($erRep[1]);
     }
     return $feeds;
     /*} else {
     			jimport('joomla.feed.factory');
     			$feed = new JFeedFactory;
     			$rssFeed = $feed->getFeed($rssURL,$cache_time);
     
     			if (empty($rssFeed) or !is_object($rssFeed)) return false;
     
     			for ($i = 0; $i < $max; $i++) {
     				if (!$rssFeed->offsetExists($i)) {
     					break;
     				}
     				$feed = new StdClass();
     				$uri = (!empty($rssFeed[$i]->uri) || !is_null($rssFeed[$i]->uri)) ? $rssFeed[$i]->uri : $rssFeed[$i]->guid;
     				$text = !empty($rssFeed[$i]->content) || !is_null($rssFeed[$i]->content) ? $rssFeed[$i]->content : $rssFeed[$i]->description;
     				$feed->link = $uri;
     				$feed->title = $rssFeed[$i]->title;
     				$feed->description = $text;
     				$feeds[] = $feed;
     			}
     			return $feeds;
     		}*/
 }
Example #24
0
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $mainframe = JFactory::getApplication();
     $pathway = $mainframe->getPathway();
     if (!class_exists('VmImage')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
     }
     $virtuemart_manufacturer_id = vRequest::getInt('virtuemart_manufacturer_id', 0);
     $mf_category_id = vRequest::getInt('mf_category_id', 0);
     // get necessary models
     $model = tmsModel::getModel('manufacturer');
     if ($virtuemart_manufacturer_id != 0) {
         $manufacturer = $model->getManufacturer();
         $model->addImages($manufacturer, 1);
         $manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"', false);
         if (tsmConfig::get('enable_content_plugin', 0)) {
             if (!class_exists('shopFunctionsF')) {
                 require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
             }
             shopFunctionsF::triggerContentPlugin($manufacturer, 'manufacturer', 'mf_desc');
         }
         $document->setTitle(tsmText::_('COM_VIRTUEMART_MANUFACTURER_DETAILS') . ' ' . strip_tags($manufacturer->mf_name));
         //added so that the canonical points to page with visible products thx to P2Peter
         // remove joomla canonical before adding it
         foreach ($document->_links as $k => $array) {
             if ($array['relation'] == 'canonical') {
                 unset($document->_links[$k]);
                 break;
             }
         }
         $document->addHeadLink(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' . $virtuemart_manufacturer_id, FALSE), 'canonical', 'rel', '');
         $this->assignRef('manufacturerImage', $manufacturerImage);
         $this->assignRef('manufacturer', $manufacturer);
         $pathway->addItem(strip_tags($manufacturer->mf_name));
         $this->setLayout('details');
     } else {
         $document->setTitle(tsmText::_('COM_VIRTUEMART_MANUFACTURER_PAGE'));
         $manufacturers = $model->getManufacturers(true, true, true);
         $model->addImages($manufacturers, 1);
         $this->assignRef('manufacturers', $manufacturers);
         $this->setLayout('default');
     }
     parent::display($tpl);
 }
Example #25
0
 function synchronizeMedia()
 {
     if (vmAccess::manager('media')) {
         $configPaths = array('assets_general_path', 'media_category_path', 'media_product_path', 'media_manufacturer_path', 'media_vendor_path');
         foreach ($configPaths as $path) {
             $this->renameFileExtension(VMPATH_ROOT . DS . tsmConfig::get($path));
         }
         if (!class_exists('Migrator')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'migrator.php';
         }
         $migrator = new Migrator();
         $result = $migrator->portMedia();
         $this->setRedirect($this->redirectPath, $result);
     } else {
         $msg = 'Forget IT';
         $this->setRedirect('index.php?option=com_tsmart', $msg);
     }
 }
Example #26
0
 function getInput()
 {
     defined('DS') or define('DS', DIRECTORY_SEPARATOR);
     if (!class_exists('tsmConfig')) {
         require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_tsmart' . DS . 'helpers' . DS . 'config.php';
     }
     if (!class_exists('tmsModel')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'tsmmodel.php';
     }
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart');
     $key = $this->element['key_field'] ? $this->element['key_field'] : 'value';
     $val = $this->element['value_field'] ? $this->element['value_field'] : $this->name;
     $model = tmsModel::getModel('Orderstatus');
     $orderStatus = $model->getOrderStatusList(true);
     foreach ($orderStatus as $orderState) {
         $orderState->order_status_name = tsmText::_($orderState->order_status_name);
     }
     return JHtml::_('select.genericlist', $orderStatus, $this->name, 'class="inputbox" multiple="true" size="1"', 'order_status_code', 'order_status_name', $this->value, $this->id);
 }
Example #27
0
 /**
  * Handle the save task
  */
 function save($data = 0)
 {
     vRequest::vmCheckToken();
     $model = tmsModel::getModel('config');
     $data = vRequest::getPost();
     if (strpos($data['offline_message'], '|') !== false) {
         $data['offline_message'] = str_replace('|', '', $data['offline_message']);
     }
     $msg = '';
     if ($model->store($data)) {
         $msg = tsmText::_('com_tsmart_CONFIG_SAVED');
         // Load the newly saved values into the session.
         tsmConfig::loadConfig();
     }
     $redir = 'index.php?option=com_tsmart';
     if (vRequest::getCmd('task') == 'apply') {
         $redir = $this->redirectPath;
     }
     $this->setRedirect($redir, $msg);
 }
Example #28
0
 protected function getInput()
 {
     tsmConfig::loadConfig();
     tsmConfig::loadJLang('com_tsmart');
     if (!is_array($this->value)) {
         $this->value = array($this->value);
     }
     $categorylist = ShopFunctions::categoryListTree($this->value);
     $name = $this->name;
     if ($this->multiple) {
         $name = $this->name;
         $this->multiple = ' multiple="multiple" ';
     }
     $html = '<select class="inputbox"   name="' . $name . '" ' . $this->multiple . ' >';
     if (!$this->multiple) {
         $html .= '<option value="0">' . tsmText::_('com_tsmart_CATEGORY_FORM_TOP_LEVEL') . '</option>';
     }
     $html .= $categorylist;
     $html .= "</select>";
     return $html;
 }
Example #29
0
 function display($tpl = null)
 {
     // Load the helper(s)
     jimport('joomla.filesystem.file');
     $config = JFactory::getConfig();
     $log_path = $config->get('log_path', VMPATH_ROOT . "/log");
     $layoutName = vRequest::getCmd('layout', 'default');
     tsmConfig::loadJLang('com_tsmart_log');
     if ($layoutName == 'edit') {
         $logFile = basename(vRequest::filterPath(vRequest::getString('logfile', '')));
         $this->SetViewTitle('LOG', $logFile);
         $fileContent = file_get_contents($log_path . DS . $logFile);
         $this->fileContentByLine = explode("\n", $fileContent);
         JToolBarHelper::cancel();
     } else {
         if (!class_exists('JFolder')) {
             require VMPATH_LIBS . DS . 'joomla' . DS . 'filesystem' . DS . 'folder.php';
         }
         $this->logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html'));
         $this->SetViewTitle('LOG');
         $this->path = $log_path;
     }
     parent::display($tpl);
 }
Example #30
0
    function sendPostRequest()
    {
        $post_variables = $this->getPostVariables();
        $jump_url = $this->getJumpUrl();
        $html = '';
        if ($this->_method->debug) {
            $html .= '<form action="' . $jump_url . '" method="post" name="vm_realex_form" target="realex">';
        } else {
            if (tsmConfig::get('css')) {
                $msg = tsmText::_('VMPAYMENT_REALEX_HPP_API_REDIRECT_MESSAGE', true);
            } else {
                $msg = '';
            }
            vmJsApi::addJScript('vm.paymentFormAutoSubmit', '
  			jQuery(document).ready(function($){
   				jQuery("body").addClass("vmLoading");
  				var msg="' . $msg . '";
   				jQuery("body").append("<div class=\\"vmLoadingDiv\\"><div class=\\"vmLoadingDivMsg\\">"+msg+"</div></div>");
    			jQuery("#vmPaymentForm").submit();
			})
		');
            $html .= '<form action="' . $jump_url . '" method="post" name="vm_realex_form" id="vmPaymentForm" accept-charset="UTF-8">';
        }
        $html .= '<input type="hidden" name="charset" value="utf-8">';
        foreach ($post_variables as $name => $value) {
            $html .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
        }
        if ($this->_method->debug) {
            $html .= '<div style="background-color:red;color:white;padding:10px;">
						<input type="submit"  value="The method is in debug mode. Click here to be redirected to Realex" />
						</div>';
            $this->debugLog($post_variables, 'sendPostRequest:', 'debug');
        }
        $html .= '</form>';
        return $html;
    }