/** * Process posted data and send email * @param type $module * @param type $params Back-end params * @param type $fields All fields of contact form */ public function doPost($module, $params, $fields) { //xu ly page break và post if (JRequest::get('post') && JRequest::getVar('btqc' . $module->id)) { $data = JRequest::getVar('btqc' . $module->id); //get submitted data //validate data by PHP foreach ($fields as $field) { if ($field->type == 'pagebreak' || $field->type == 'separator') { continue; } //nếu là checkbox và radio được required mà không được submit hoặc không có giá trị nào if ($field->type == 'checkbox' && $field->type == 'radio' && $field->required) { if ($data[$field->alias] && !count($data[$field->alias])) { $this->_result = false; $this->_errorMessages[] = JText::_('ERROR_REQUIRED'); } continue; } else { if ($field->type == 'file') { //nếu file required thì bắt buộc file check if ($field->required) { if (empty($_FILES) || !$_FILES['btqc' . $module->id]['tmp_name']['btqc_f_' . $field->alias]) { $this->_result = false; $this->_errorMessages[] = JText::_('ERROR_FILE_REQUIRED'); continue; } } if (!empty($_FILES)) { if (!key_exists('btqc_f_' . $field->alias, $_FILES['btqc' . $module->id]['tmp_name'])) { continue; } $file = $_FILES['btqc' . $module->id]['tmp_name']['btqc_f_' . $field->alias]; if ($file) { $fileExt = explode('.', $_FILES['btqc' . $module->id]['name']['btqc_f_' . $field->alias]); $fileExt = strtolower($fileExt[1]); //check ext if ($field->ext && strpos($field->ext, $fileExt) === false) { $this->_result = false; $this->_errorMessages[] = sprintf(JText::_('ERROR_EXT'), str_replace('|', ',', $field->ext)); } //check size if (filesize($file) > $field->maxSize * 1024 * 1024) { $this->_result = false; $this->_errorMessages[] = sprintf(JText::_('ERROR_MAXSIZE'), $field->maxSize . 'MB'); } //neu file khong được sumbit mà được required } } continue; } else { if ($field->required && (!key_exists('btqc_f_' . $field->alias, $data) || !$data['btqc_f_' . $field->alias])) { $this->_result = false; $this->_errorMessages[] = JText::_('ERROR_REQUIRED'); continue; } if (!$field->required && (!key_exists('btqc_f_' . $field->alias, $data) || $data['btqc_f_' . $field->alias] == '')) { continue; } //kiểu số if ($field->type == 'number' && $data['btqc_f_' . $field->alias] && !is_numeric($data['btqc_f_' . $field->alias])) { $this->_result = false; $this->_errorMessages[] = JText::_('ERROR_NUMBER'); } //kiểu email if ($field->type == 'email' && $data['btqc_f_' . $field->alias]) { $preg = "/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\\._-] +)+\$/"; if (preg_match($preg, $data['btqc_f_' . $field->alias])) { $this->_result = false; $this->_errorMessages[] = JText::_('ERROR_EMAIL'); } } //kiểu ngày if ($field->type == 'date' && $data['btqc_f_' . $field->alias] && !strtotime($data['btqc_f_' . $field->alias])) { $this->_result = false; $this->_errorMessages[] = JText::_('ERROR_DATE'); } continue; } } } //nếu không có lỗi post và có sài captcha thì kiểm tra captcha if ($this->_result) { if ($params->get('captcha') != '0') { $plugin = BTQuickContactHelper::getCaptchaPlugin($params); if ($plugin) { $captcha = JCaptcha::getInstance($plugin); if (!$captcha->checkAnswer('')) { $this->_result = false; $this->_errorMessages[] = JText::_('ERROR_CAPTCHA'); $this->_jsonResponse['captchaError'] = true; } } } } if ($this->_result) { //send mail if (self::sendMail($data, $fields, $params, $module)) { //show thank you msg $this->_thanksMessage = $params->get('thank_message'); //redirect if ($params->get('redirect_url')) { $this->_jsonResponse['redirectUrl'] = $params->get('redirect_url'); $this->_jsonResponse['timeOut'] = 3000; } } else { $this->_result = false; $this->_errorMessages[] = jText::_('ERROR_SEND_EMAIL'); } } if ($this->_result) { $this->_jsonResponse['success'] = true; $this->_jsonResponse['messages'] = json_encode(array($this->_thanksMessage)); } else { $this->_jsonResponse['success'] = false; $this->_jsonResponse['messages'] = json_encode($this->_errorMessages); } $level = ob_get_level(); while ($level > 0) { ob_end_clean(); $level--; } echo json_encode($this->_jsonResponse); exit; } }
/** * Method to save the submitted ordering values for records. * * @return boolean True on success * * @since 12.2 */ public function saveorder() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Get the input $pks = $this->input->post->get('cid', array(), 'array'); $order = $this->input->post->get('order', array(), 'array'); // Sanitize the input JArrayHelper::toInteger($pks); JArrayHelper::toInteger($order); // Get the model $model = $this->getModel(); if (empty($pks) && empty($order)) { $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), jText::_('COM_MOBILIZE_ERROR_NO_ITEMS_SELECTED'), 'error'); return false; } else { // Save the ordering $return = $model->saveorder($pks, $order); if ($return === false) { // Reorder failed $message = JText::sprintf('JLIB_APPLICATION_ERROR_REORDER_FAILED', $model->getError()); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message, 'error'); return false; } else { // Reorder succeeded. $this->setMessage(JText::_('JLIB_APPLICATION_SUCCESS_ORDERING_SAVED')); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); return true; } } }
if (count($this->inventorylist) > 0) { $i = 0; $k = 0; $keyword = JRequest::getWord('keyword'); foreach ($this->inventorylist as $key => $product) { $checked = JHTML::_('grid.id', $i, $product->virtuemart_product_id); $published = JHTML::_('grid.published', $product, $i); //<!-- low_stock_notification --> if ($product->product_in_stock - $product->product_ordered < 1) { $stockstatut = "out"; } elseif ($product->product_in_stock - $product->product_ordered < $product->low_stock_notification) { $stockstatut = "low"; } else { $stockstatut = "normal"; } $stockstatut = 'class="stock-' . $stockstatut . '" title="' . jText::_('COM_VIRTUEMART_STOCK_LEVEL_' . $stockstatut) . '"'; ?> <tr class="row<?php echo $k; ?> "> <!-- Checkbox --> <td><?php echo $checked; ?> </td> <!-- Product name --> <?php $link = 'index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=' . $product->virtuemart_product_id . '&product_parent_id=' . $product->product_parent_id; ?> <td><?php
<?php echo $item->introtext; ?> </div> <?php } ?> <?php if ($show_readmore) { ?> <a class="btn btn-primary" href="<?php echo $item->link; ?> "><?php echo jText::_('MORE'); ?> </a> <?php } ?> </div> <div style="clear:both"></div> </div> </li> <?php } ?> </ul>
} ?> <div class="clear"></div> </div> <?php } // Product Navigation END ?> <?php // Back To Category Button if ($this->product->virtuemart_category_id) { $catURL = JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $this->product->virtuemart_category_id); $categoryName = $this->product->category_name; } else { $catURL = JRoute::_('index.php?option=com_virtuemart'); $categoryName = jText::_('COM_VIRTUEMART_SHOP_HOME'); } ?> <div class="back-to-category"> <a href="<?php echo $catURL; ?> " class="product-details" title="<?php echo $categoryName; ?> "><?php echo JText::sprintf('COM_VIRTUEMART_CATEGORY_BACK_TO', $categoryName); ?> </a> </div> <?php // Product Title ?>
<?php echo $item->introtext; ?> </div> <?php } ?> <?php if ($show_readmore) { ?> <a class="sppb-btn sppb-btn-primary" href="<?php echo $item->link; ?> "><?php echo jText::_('Find out more'); ?> </a> <?php } ?> </div> <div style="clear:both"></div> </div> </li> <?php } ?> </ul>
?> <b class="caret"></b></a> <ul class="dropdown-menu"> <li class=""><a href="<?php echo jRoute::_('index.php?option=com_virtuemart&view=user'); ?> "><i class="icon icon-user"></i> <?php echo jText::_('COM_VIRTUEMART_YOUR_ACCOUNT_DETAILS'); ?> </a></li> <li class="divider"></li> <li class=""><a href="<?php echo jRoute::_('index.php?option=com_users&task=user.logout&' . jSession::getFormToken() . '=1&return=' . base64_encode('index.php?option=com_virtuemart')); ?> "><i class="icon icon-exit"></i> <?php echo jText::_('COM_VIRTUEMART_BUTTON_LOGOUT'); ?> </a></li> </ul> </li> </ul> </div> </div> </div> </nav> <?php if (count($messages)) { foreach ($messages as $message) { ?> <div class="alert alert-<?php echo $message['type'];
if ($order->virtuemart_user_id) { echo $this->editLink($order->virtuemart_user_id, $order->order_name, 'virtuemart_user_id[]', array('class' => 'hasTooltip', 'title' => JText::_('COM_VIRTUEMART_ORDER_EDIT_USER') . ' ' . $order->order_name), 'user'); } else { echo $order->order_name; } ?> </td> <td class="autosize"> <?php if ($order->order_email) { ?> <a href="mailto:<?php echo $order->order_email; ?> ?subject=<?php echo jText::_('COM_VIRTUEMART_ORDER_LIST_NUMBER'); ?> &body=new" target="_top"><i class="icon-envelope"></i></a> <?php } ?> </td> <!-- Payment method --> <td><?php echo $order->payment_method; ?> </td> <!-- Print view --> <?php /* Print view URL */ $print_url = juri::root() . 'index.php?option=com_virtuemart&view=invoice&layout=invoice&tmpl=component&virtuemart_order_id=' . $order->virtuemart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass;
* @version $Id: default_customfields.php 5699 2012-03-22 08:26:48Z ondrejspilka $ */ // Check to ensure this file is included in Joomla! defined ( '_JEXEC' ) or die ( 'Restricted access' ); ?> <div class="product-fields"> <?php $custom_title = null; foreach ($this->product->customfieldsSorted[$this->position] as $field) { if ( $field->is_hidden ) //OSP http://forum.virtuemart.net/index.php?topic=99320.0 continue; if ($field->display) { ?><div class="product-field product-field-type-<?php echo $field->field_type ?>"> <?php if ($field->custom_title != $custom_title && $field->show_title) { ?> <span class="product-fields-title" ><?php echo JText::_($field->custom_title); ?></span> <?php if ($field->custom_tip) echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png'); } ?> <span class="product-field-display"><?php echo $field->display ?></span> <span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span> </div> <?php $custom_title = $field->custom_title; } } ?> </div>
} else { if ($inStock <= $product->low_stock_notification) { $stockLabel = 'label-warning'; } else { $stockLabel = 'label-success'; } } if ($inStock < 1) { $stockstatut = "OUT"; } elseif ($inStock < $product->low_stock_notification) { $stockstatut = "LOW"; } else { $stockstatut = "NORMAL"; } $orderedLabel = $stockLabel; $stockstatut = $stockLabel . '" title="' . jText::_('COM_VIRTUEMART_STOCK_LEVEL_' . $stockstatut); if ($product->product_ordered == 0) { $orderedLabel = ''; } ?> <tr <?php echo $inStock < $product->product_ordered ? 'class="error"' : ''; ?> > <!-- Checkbox --> <td><?php echo $checked; ?> </td> <!-- Product name --> <td>
</th> <th><span class="icon-eye-open"></span></th> <th class="hidden-phone"><?php echo JText::_('COM_VIRTUEMART_FILES_LIST_FILETYPE'); ?> </th> <th><?php echo $this->sort('published', 'COM_VIRTUEMART_PUBLISHED'); ?> </th> <?php if (Vmconfig::get('multix', 'none') !== 'none' and $this->perms->check('admin')) { ?> <th width="20" class="autosize"> <?php echo jText::_('COM_VIRTUEMART_SHARED'); ?> </th> <?php } ?> <th class="hidden-phone"><?php echo $this->sort('virtuemart_media_id', 'COM_VIRTUEMART_ID'); ?> </th> </tr> </thead> <tbody> <?php if (count($this->files) > 0) { $i = 0;
/** * * get slide list item html */ public function getSlideHtml($item, $numItem) { $sliderID = $item->sliderid; $itemID = $item->id; //get params $params = new JRegistry(); $params->loadString($item->params, "json"); $urlRoot = JURI::root(); //get image url's: $urlImage = $params->get("image"); if (empty($urlImage)) { $urlImage = GlobalsUniteRev::$urlDefaultSlideImage; } $image = UniteFunctionJoomlaRev::getImageFilename($urlImage); $thumbUrl = UniteFunctionJoomlaRev::getImageOutputUrl($image, 200, 100, true); $imageUrl = $urlRoot . $image; $img_file = pathinfo($imageUrl, PATHINFO_BASENAME); $itemTitle = $item->title . " ({$img_file})"; $itemTitle = htmlspecialchars($itemTitle); $linkItem = HelperUniteRev::getViewUrl_Item($sliderID, $itemID); $isPublished = $item->published; ob_start(); $isJoomla3 = UniteFunctionJoomlaRev::isJoomla3(); ?> <li id="item_<?php echo $itemID; ?> "> <span class="slide-col col-checkbox"> <div class='num-item'> <label class="label_numitem" for="check_item_<?php echo $itemID; ?> "><?php echo $numItem; ?> </label> </div> <div class="published_icon_wrapper"> <?php if ($isPublished) { ?> <?php if ($isJoomla3) { //joomla 3 published ?> <a class="publish_link btn btn-micro active" data-published="true" data-itemid="<?php echo $itemID; ?> " title="<?php echo JText::_("COM_UNITEREVOLUTION_UNPUBLISH_ITEM"); ?> " href="javascript:void(0);"> <div class="publish_loader" style="display:none;"></div> <i class="icon-publish"></i> </a> <?php } else { //joomla 2.5 published ?> <a class="jgrid publish_link" data-published="true" data-itemid="<?php echo $itemID; ?> " title="<?php echo JText::_("COM_UNITEREVOLUTION_UNPUBLISH_ITEM"); ?> " href="javascript:void(0);"> <div class="publish_loader" style="display:none;"></div> <span class="state publish"> <span class="text"><?php echo JText::_("COM_UNITEREVOLUTION_PUBLISHED"); ?> </span> </span> </a> <?php } ?> <?php } else { ?> <?php if ($isJoomla3) { //joomla3 unpublish ?> <a class="publish_link btn btn-micro active" data-published="false" data-itemid="<?php echo $itemID; ?> " title="<?php echo JText::_("COM_UNITEREVOLUTION_PUBLISH_ITEM"); ?> " href="javascript:void(0);"> <div class="publish_loader" style="display:none;"></div> <i class="icon-unpublish"></i> </a> <?php } else { //joomla 2.5 unpublish ?> <a class="jgrid publish_link" data-published="false" data-itemid="<?php echo $itemID; ?> " title="<?php echo JText::_("COM_UNITEREVOLUTION_PUBLISH_ITEM"); ?> " href="javascript:void(0);"> <div class="publish_loader" style="display:none;"></div> <span class="state unpublish"> <span class="text"><?php echo JText::_("COM_UNITEREVOLUTION_UNPUBLISHED"); ?> </span> </span> </a> <?php } ?> <?php } ?> </div> </span> <span class="slide-col col-title"> <a class='link_slide_title' href="<?php echo $linkItem; ?> "> <?php echo $itemTitle; ?> </a> <a href="<?php echo $linkItem; ?> " data-itemid="<?php echo $itemID; ?> " class="button_edit_slide btn btn-small btn-small">Edit Slide</a> </span> <span class="slide-col col-image"> <a class="modal" href="<?php echo $imageUrl; ?> "> <img src="<?php echo $thumbUrl; ?> " alt="slide image" /> </a> </span> <span class="slide-col col-operations"> <a href="javascript:void(0)" data-itemid="<?php echo $itemID; ?> " class="button_delete_slide btn btn-danger btn-small">Delete</a> <span class="deleting_slide_loader" style="display:none;"> <?php echo jText::_("COM_UNITEREVOLUTION_DELETING_SLIDE"); ?> </span> <a href="javascript:void(0)" data-itemid="<?php echo $itemID; ?> " class="button_duplicate_slide btn btn-small btn-small">Duplicate</a> <span class="duplicate_slide_loader" style="display:none;"><?php echo JText::_("COM_UNITEREVOLUTION_DUPLICATING_SLIDE"); ?> </span> </span> <span class="slide-col col-handle"> <div class="col-handle-inside"> <span class="ui-icon ui-icon-arrowthick-2-n-s"></span> </div> </span> </li> <?php $content = ob_get_contents(); ob_clean(); ob_end_clean(); return $content; }
/** * Paste the table in json format * */ public function paste() { // TODO Test user ? $json = array(); $json['fields'] = 'error'; $json['msg'] = 'Invalid Token'; $json['structure'] = 'empty'; if (!JRequest::checkToken('get')) { echo json_encode($json); jexit(); } $lang = JRequest::getvar('lg'); $langs = VmConfig::get('active_languages', array()); $language = JFactory::getLanguage(); if (!in_array($lang, $langs)) { $json['msg'] = 'Invalid language ! ' . $lang; $json['langs'] = $langs; echo json_encode($json); jexit(); } $lang = strtolower($lang); // Remove tag if defaut or // if ($language->getDefault() == $lang ) $dblang =''; $dblang = strtr($lang, '-', '_'); $id = JRequest::getInt('id', 0); $viewKey = JRequest::getWord('editView'); // TODO temp trick for vendor if ($viewKey == 'vendor') { $id = 1; } $tables = array('category' => 'categories', 'product' => 'products', 'manufacturer' => 'manufacturers', 'manufacturercategories' => 'manufacturercategories', 'vendor' => 'vendors', 'paymentmethod' => 'paymentmethods', 'shipmentmethod' => 'shipmentmethods'); if (!array_key_exists($viewKey, $tables)) { $json['msg'] = "Invalid view " . $viewKey; echo json_encode($json); jExit(); } $tableName = '#__virtuemart_' . $tables[$viewKey] . '_' . $dblang; $db = JFactory::getDBO(); $q = 'select * FROM `' . $tableName . '` where `virtuemart_' . $viewKey . '_id` =' . $id; $db->setQuery($q); if ($json['fields'] = $db->loadAssoc()) { $json['structure'] = 'filled'; $json['msg'] = jText::_('COM_VIRTUEMART_SELECTED_LANG') . ':' . $lang; } else { $json['structure'] = 'empty'; $db->setQuery('SHOW COLUMNS FROM ' . $tableName); $tableDescribe = $db->loadAssocList(); array_shift($tableDescribe); $fields = array(); foreach ($tableDescribe as $key => $val) { $fields[$val['Field']] = $val['Field']; } $json['fields'] = $fields; $json['msg'] = JText::sprintf('COM_VIRTUEMART_LANG_IS_EMPTY', $lang, jText::_('COM_VIRTUEMART_' . strtoupper($viewKey))); } echo json_encode($json); jExit(); }
?> </label> <input type="text" name="product_in_stock" id="in_stock" value="0"> <input type="hidden" name="virtuemart_product_id" id="virtuemart_product_id" value="0"> <?php echo $this->addStandardHiddenToForm(null, 'updatestock'); ?> </form> </div> <div class="modal-footer"> <button class="btn btn-default" data-dismiss="modal" aria-hidden="true"><?php echo jText::_('COM_VIRTUEMART_CANCEL'); ?> </button> <button type="button" class="btn btn-primary" id="apply_stock"><?php echo jText::_('COM_VIRTUEMART_APPLY'); ?> </button> </div> </div> <script> jQuery(function(){ var $el, form = jQuery('#updateStockModal form'); jQuery('#adminForm').on('click','.updateStock', function(){ var $modal = jQuery('#updateStockModal'); $el = jQuery(this); $modal.find('h3 span').text( $el.attr('data-title') ); $modal.find('#virtuemart_product_id').val( $el.attr('data-id') ); $modal.find('input#in_stock').val( $el.children().text() ); });
<div class="jsn-iconbar jsn-vertical"> <a data-action='social' href="javascript:void(0);" id="select_profile_social" title="<?php echo jText::_('JSN_MOBILIZE_EDIT_SOCIAL'); ?> "><i class="icon-pencil"></i></a> </div> </div> <div class="jsn-row-container row-fluid"> <div id="jsn-switcher" class="jsn-column-container clearafter"> <?php echo $this->_JSNMobilize->getItemsMenuIcon('mobilize-switcher', 'JSN_MOBILIZE_SWITCHER', ''); ?> </div> <div class="jsn-iconbar jsn-vertical"> <a data-action="switcher" title="<?php echo jText::_('JSN_MOBILIZE_EDIT_STYLE'); ?> " href="javascript:void(0);"><i class="icon-pencil"></i></a> <?php $styleSwitcher = !empty($this->_style->jsn_switcher) ? get_magic_quotes_gpc() == true || get_magic_quotes_runtime() == true ? stripslashes($this->_style->jsn_switcher) : $this->_style->jsn_switcher : ''; ?> <input type="hidden" id="input_style_jsn_switcher" class="jsn-input-style" name="style[jsn_switcher]" value='<?php echo htmlentities($styleSwitcher); ?> ' /> </div> </div> </div> <?php if (strtolower($edition) == "free") { ?>
public static function altText($string, $prefix = 'com_virtuemart') { $lang = JFactory::getLanguage(); $name = str_replace(' ', '_', $string); if ($lang->hasKey($prefix . '_' . $name)) { return jText::_($prefix . '_' . $name); } return jText::_($string); }
static function getToolbar($vmView) { // add required stylesheets from admin template $document = JFactory::getDocument(); $document->addStyleSheet('administrator/templates/system/css/system.css'); //now we add the necessary stylesheets from the administrator template //in this case i make reference to the bluestork default administrator template in joomla 1.6 $document->addCustomTag('<link href="administrator/templates/bluestork/css/template.css" rel="stylesheet" type="text/css" />' . "\n\n" . '<!--[if IE 7]>' . "\n" . '<link href="administrator/templates/bluestork/css/ie7.css" rel="stylesheet" type="text/css" />' . "\n" . '<![endif]-->' . "\n" . '<!--[if gte IE 8]>' . "\n\n" . '<link href="administrator/templates/bluestork/css/ie8.css" rel="stylesheet" type="text/css" />' . "\n" . '<![endif]-->' . "\n"); $html = '<div class="toolbar-list" id="toolbar">'; $html .= '<ul>'; $html .= '<li id="toolbar-save" class="button">'; $html .= '<a class="toolbar" onclick="Joomla.submitbutton(\'save\')" > <span class="icon-32-save"> </span> ' . jText::_('COM_VIRTUEMART_SAVE') . ' </a>'; $html .= '</li>'; $html .= '<li id="toolbar-cancel" class="button">'; $html .= '<a class="toolbar" onclick="Joomla.submitbutton(\'cancel\')" > <span class="icon-32-cancel"> </span> ' . jText::_('COM_VIRTUEMART_CANCEL') . ' </a>'; $html .= '</li>'; $html .= '</ul>'; $html .= '<div class="clr"></div>'; $html .= '</div>'; return $html; }
if ($order->virtuemart_user_id) { echo $this->editLink($order->virtuemart_user_id, $order->order_name, 'virtuemart_user_id', array('class' => 'hasTooltip', 'title' => JText::_('COM_VIRTUEMART_ORDER_EDIT_USER') . ' ' . $order->order_name), 'user'); } else { echo $order->order_name; } ?> </td> <td class="autosize"> <?php if ($order->order_email) { ?> <a href="mailto:<?php echo $order->order_email; ?> ?subject=<?php echo jText::_('COM_VIRTUEMART_ORDER_LIST_NUMBER') . ' ' . $order->order_number; ?> &body=new" target="_top"><i class="icon-envelope"></i></a> <?php } ?> </td> <!-- Payment method --> <td><?php echo $order->payment_method; ?> </td> <!-- Print view --> <?php /* Print view URL */ $print_url = juri::root() . 'index.php?option=com_virtuemart&view=invoice&layout=invoice&tmpl=component&virtuemart_order_id=' . $order->virtuemart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass;
/** * Calls the cache server to purge the cache * * @access public * @param string|bool $message Message to be displayed if purge is successful. If this param is false no output would be done * @return null */ private function _purgeCache($message = true) { $purgeRequest = $this->_applicationPath . '(.*)'; // Check if caching server is online $hostname = trim(file_get_contents('/etc/sgcache_ip', true)); $cacheServerSocket = fsockopen($hostname, 80, $errno, $errstr, 2); if (!$cacheServerSocket) { JError::raise(E_ERROR, 500, JText::_('Connection to cache server failed!')); JError::raise(E_ERROR, 500, JText::_($errstr($errno))); return; } $request = "BAN {$purgeRequest} HTTP/1.0\r\nHost: {$_SERVER['SERVER_NAME']}\r\nConnection: Close\r\n\r\n"; if (preg_match('/^www\\./', $_SERVER['SERVER_NAME'])) { $domain_no_www = preg_replace('/^www\\./', '', $_SERVER['SERVER_NAME']); $request2 = "BAN {$purgeRequest} HTTP/1.0\r\nHost: {$domain_no_www}\r\nConnection: Close\r\n\r\n"; } else { $request2 = "BAN {$purgeRequest} HTTP/1.0\r\nHost: www.{$_SERVER['SERVER_NAME']}\r\nConnection: Close\r\n\r\n"; } fwrite($cacheServerSocket, $request); $response = fgets($cacheServerSocket); fclose($cacheServerSocket); $cacheServerSocket = fsockopen($hostname, 80, $errno, $errstr, 2); fwrite($cacheServerSocket, $request2); fclose($cacheServerSocket); if ($message !== false) { if (preg_match('/200/', $response)) { if ($message === true) { JFactory::getApplication()->enqueueMessage(JText::_('SG Cache Successfully Purged!')); } else { JFactory::getApplication()->enqueueMessage(JText::_($message)); } } else { JError::raise(E_NOTICE, 501, JText::_('SG Cache: Purge was not successful!')); JError::raise(E_NOTICE, 501, jText::_('Error: ' . $response)); } } }
/** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; $view = jRequest::getWord('view', 'admin'); $langCurrent = jRequest::getWord('lang', null); $langs = VmConfig::get('active_languages', false); $flagPath = JURI::root(true) . '/administrator/components/com_virtuemart/assets/images/flag/'; ?> <footer class="navbar navbar-default navbar-fixed-bottom dark" role="navigation"> <div class="container"><span style="padding: 0px 32px"><?php echo jText::_('JFIELD_LANGUAGE_LABEL') . ' [' . $langCurrent . '] </span> '; foreach ($langs as $lang) { $tag = substr($lang, 0, 2); $url = JRoute::_('index.php?option=com_virtuemart&view=' . $view . '&lang=' . $tag . '&langswitch=' . $lang . '&tmpl=component', true); if ($langCurrent == $tag) { $btn = 'primary'; } else { $btn = 'default'; } $flagImage = '<img style="vertical-align: middle;" alt="' . $lang . '" src="' . $flagPath . $tag . '.png"> '; ?> <a class="btn btn-<?php echo $btn; ?> " href="<?php echo $url;
?> <span ID="customer-list-BT"> <div class="button2-left" data-type="all" > <div class="blank" style="padding:0 6px;cursor: pointer;" title="<?php echo Jtext::_('COM_VIRTUEMART_PRODUCT_LIST_ALL_SHOPPERS_TIP'); ?> "> <span class="vmicon vmicon-16-forward-off" ></span> <?php echo Jtext::_('COM_VIRTUEMART_PRODUCT_LIST_ALL_SHOPPERS'); ?> </div> </div> <div class="button2-left" data-type="reserved" > <div class="blank" style="padding:0 6px;cursor: pointer;" title="<?php echo jText::_('COM_VIRTUEMART_PRODUCT_LIST_BOOKED_SHOPPERS_TIP'); ?> "> <span class="vmicon vmicon-16-forward" ></span> <?php echo Jtext::_('COM_VIRTUEMART_PRODUCT_LIST_BOOKED_SHOPPERS'); ?> </div> </div> <div class="button2-left" data-type="delivered" > <div class="blank" style="padding:0 6px;cursor: pointer;" title="<?php echo Jtext::_('COM_VIRTUEMART_PRODUCT_LIST_DELIVERED_SHOPPERS_TIP'); ?> " > <span class="vmicon vmicon-16-forward-off" ></span>
</a> <?php endif; ?> <?php endif; ?> <?php if(($item->urls->urla!='') && ($show_url)) : ?> <a href="<?php echo $item->urls->urla; ?>"><?php echo $item->urls->urlatext; ?></a> <?php endif; ?> <?php if($show_introtext) : ?> <div class="sp-portfolio-introtext"> <?php echo $item->introtext; ?> </div> <?php endif; ?> <?php if($show_readmore) : ?> <a class="btn btn-primary" href="<?php echo $item->link; ?>"><?php echo jText::_('MORE'); ?></a> <?php endif; ?> </div> <div style="clear:both"></div> </div> </li> <?php } ?> </ul> <?php if(($ajax_loader && $show_filter) && ($count!=$total)) { ?> <div class="sp-portfolio-loadmore"> <a href="#" class="btn btn-primary btn-large"> <i class="icon-spinner icon-spin"></i>
if ($field->custom_title != $custom_title) { ?> <span class="product-fields-title" ><strong><?php echo JText::_($field->custom_title); ?> </strong></span> <?php //echo JHTML::tooltip($field->custom_tip, $field->custom_title, 'tooltip.png'); } ?> <span class="product-field-display"><?php echo $field->display; ?> </span> <span class="product-field-desc"><?php echo jText::_($field->custom_field_desc); ?> </span> </div> <?php $custom_title = $field->custom_title; } ?> </div> <?php } // Product custom_fields END ?> <?php // Product Packaging
* @license GNU/GPL, see LICENSE.php * EasyBlog 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. * See COPYRIGHT.php for copyright notices and details. */ defined('_JEXEC') or die('Unauthorized Access'); ?> <form action="index.php" method="post" name="adminForm" id="adminForm"> <div class="row"> <div class="col-lg-6"> <div class="panel"> <div class="panel-head"> <b><?php echo jText::_('Details'); ?> </b> </div> <div class="panel-body"> <div class="form-group"> <label for="title" class="col-md-4"> <?php echo JText::_('COM_EASYBLOG_TAG_TITLE'); ?> <i data-html="true" data-placement="top" data-title="<?php echo JText::_('COM_EASYBLOG_TAG_TITLE'); ?> "
public static function trans($text) { $language = JFactory::getLanguage(); $language->load('plg_hikashopshipping_bfmanual', JPATH_ADMINISTRATOR, 'en-GB', true); return jText::_($text); }
$_controller = JRequest::getWord('view', JRequest::getWord('controller', 'virtuemart')); $trigger = 'onVmSiteController'; // $task = JRequest::getWord('task',JRequest::getWord('layout',$_controller) ); $this makes trouble! $task = JRequest::getWord('task'); if (($_controller == 'product' || $_controller == 'category') && ($task == 'save' || $task == 'edit')) { $app = JFactory::getApplication(); if (!class_exists('Permissions')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php'; } if (Permissions::getInstance()->check("admin,storeadmin")) { $jlang = JFactory::getLanguage(); $jlang->load('com_virtuemart', JPATH_ADMINISTRATOR, null, true); $basePath = JPATH_VM_ADMINISTRATOR; $trigger = 'onVmAdminController'; } else { $app->redirect('index.php?option=com_virtuemart', jText::_('COM_VIRTUEMART_RESTRICTED_ACCESS')); } } elseif ($_controller) { $basePath = JPATH_VM_SITE; } } /* Create the controller name */ $_class = 'VirtuemartController' . ucfirst($_controller); if (file_exists($basePath . DS . 'controllers' . DS . $_controller . '.php')) { if (!class_exists($_class)) { require $basePath . DS . 'controllers' . DS . $_controller . '.php'; } } else { // try plugins JPluginHelper::importPlugin('vmextended'); $dispatcher = JDispatcher::getInstance();
/** * This displays a custom handler. * * @param string $html atttributes, Just for displaying the fullsized image */ public function displayCustomFields($datas) { JLoader::register('VmHTML', JPATH_VM_ADMINISTRATOR . '/helpers/html.php'); if ($datas->field_type) { $this->addHidden('field_type', $datas->field_type); } $this->addHiddenByType($datas); $html = ""; // Note stuio42 : never used // JLoader::register('Permissions', JPATH_VM_ADMINISTRATOR.'/helpers/permissions.php'); // if (!Permissions::getInstance ()->check ('admin')) { // $readonly = 'readonly'; // } // else { // $readonly = ''; // } // only input when not set else display if ($datas->field_type) { if ($datas->field_type == 'E') { if (jText::_('custom_' . $datas->custom_element) !== 'vmcustom_' . $datas->custom_element) { $plugin = ' (' . jText::_('vmcustom_' . $datas->custom_element) . ')'; } else { $plugin = ' (' . $datas->custom_element . ')'; } } else { $plugin = ''; } $typeName = jText::_($datas->field_types[$datas->field_type]) . $plugin; $html .= VmHTML::row('value', 'COM_VIRTUEMART_CUSTOM_FIELD_TYPE', $typeName); } else { $html .= VmHTML::row('select', 'COM_VIRTUEMART_CUSTOM_FIELD_TYPE', 'field_type', $this->getOptions($datas->field_types), $datas->field_type, VmHTML::validate('R')); } $html .= VmHTML::row('input', 'COM_VIRTUEMART_TITLE', 'custom_title', $datas->custom_title, VmHTML::validate('S')); $html .= VmHTML::row('booleanlist', 'COM_VIRTUEMART_SHOW_TITLE', 'show_title', $datas->show_title); $html .= VmHTML::row('booleanlist', 'COM_VIRTUEMART_PUBLISHED', 'published', $datas->published); $html .= VmHTML::row('select', 'COM_VIRTUEMART_CUSTOM_PARENT', 'custom_parent_id', $this->getParentList($datas->virtuemart_custom_id), $datas->custom_parent_id, ''); $html .= VmHTML::row('booleanlist', 'COM_VIRTUEMART_CUSTOM_IS_CART_ATTRIBUTE', 'is_cart_attribute', $datas->is_cart_attribute); $html .= VmHTML::row('input', 'COM_VIRTUEMART_DESCRIPTION', 'custom_field_desc', $datas->custom_field_desc); // change input by type $html .= VmHTML::row('input', 'COM_VIRTUEMART_DEFAULT', 'custom_value', $datas->custom_value); $html .= VmHTML::row('input', 'COM_VIRTUEMART_CUSTOM_TIP', 'custom_tip', $datas->custom_tip); $html .= VmHTML::row('input', 'COM_VIRTUEMART_CUSTOM_LAYOUT_POS', 'layout_pos', $datas->layout_pos); //$html .= VmHTML::row('booleanlist','COM_VIRTUEMART_CUSTOM_PARENT','custom_parent_id',$this->getCustomsList(), $datas->custom_parent_id,''); $html .= VmHTML::row('booleanlist', 'COM_VIRTUEMART_CUSTOM_ADMIN_ONLY', 'admin_only', $datas->admin_only); if ($datas->field_type !== 'E') { $html .= VmHTML::row('booleanlist', 'COM_VIRTUEMART_CUSTOM_IS_LIST', 'is_list', $datas->is_list); } $html .= VmHTML::row('booleanlist', 'COM_VIRTUEMART_CUSTOM_IS_HIDDEN', 'is_hidden', $datas->is_hidden); $html .= VmHTML::inputHidden($this->_hidden); return $html; }
public static function getCustomFields($virtuemart_product_id, $cart_key = '', $quantity = 1) { $html = ''; require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php'; $product_model = OPCmini::getModel('product'); $product = $product_model->getProduct($virtuemart_product_id, TRUE, TRUE, TRUE, $quantity, true); $customfieldModel = OPCmini::getModel('Customfields'); if (!method_exists($customfieldModel, 'getproductCustomslist')) { return $html; } $product->customfields = $customfieldModel->getproductCustomslist($virtuemart_product_id); if (empty($product->customfields) and !empty($product->product_parent_id)) { //$product->customfields = $this->productCustomsfieldsClone($product->product_parent_id,true) ; $product->customfields = $customfieldModel->getproductCustomslist($product->product_parent_id, $virtuemart_product_id); $product->customfields_fromParent = TRUE; } $customfieldModel->getProductCustomsField($product); $product->customfields = $customfieldModel->getProductCustomsFieldCart($product); foreach ($product->customfields as $k => $custom) { if (!empty($custom->layout_pos)) { $product->customfieldsSorted[$custom->layout_pos][] = $custom; unset($product->customfields[$k]); } } $product->customfieldsSorted['normal'] = $product->customfields; unset($product->customfields); JHTMLOPC::script('opcattributes.js', 'components/com_onepage/assets/js/'); $html .= ' <form method="post" class="opccartproduct opc-recalculate" action="' . JRoute::_('index.php') . '"> <input name="quantity[0]" class=".quantity-input" type="hidden" value="' . $quantity . '"> <input name="virtuemart_product_id[0]" class="opc_product" type="hidden" value="' . $virtuemart_product_id . '"> <input name="cart_key" value="' . $cart_key . '" type="hidden" /> <input name="cart_virtuemart_product_id" value="' . $cart_key . '" type="hidden" /> <div class="product-fields">'; $custom_title = null; foreach ($product->customfieldsSorted as $positions => $val) { foreach ($val as $field) { if ($field->is_hidden) { //OSP http://forum.virtuemart.net/index.php?topic=99320.0 continue; } if ($field->display) { $html .= '<div class="product-field product-field-type-' . $field->field_type . '">'; if ($field->custom_title != $custom_title && $field->show_title) { $html .= '<span class="product-fields-title" >' . JText::_($field->custom_title) . '</span>'; if ($field->custom_tip) { $html .= JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png'); } } $display = $field->display; $selected = self::getSelected($cart_key, $field->virtuemart_custom_id); $display = str_replace(JText::_('COM_VIRTUEMART_CART_PRICE_FREE'), '', $display); $display = str_replace('value="' . $selected . '"', ' checked="checked" selected="selected" value="' . $selected . '" ', $display); $html .= '<div class="product-field-display" style="clear:both;">' . $display . '</div> <span class="product-field-desc">' . jText::_($field->custom_field_desc) . '</span> </div>'; $custom_title = $field->custom_title; } } } $html .= '</div></form>'; return $html; }
<?php } ?> <?php if ($this->vendor) { $link = JRoute::_('index.php?option=com_virtuemart&view=vendor&virtuemart_vendor_id=' . $this->product->virtuemart_vendor_id); ?> <div> <?php echo jText::_('COM_VIRTUEMART_PRODUCT_DETAILS_VENDOR_LBL') . ' : <a class="link" href="' . $link . '">' . $this->vendor->vendor_store_name . '</a>'; // TODO add link to vendor product list ? ?> <?php echo JText::sprintf('COM_VIRTUEMART_CART_X_PRODUCTS', jText::_('JSHOW')); ?> </div> <?php } ?> </div> </div> </div> <div class="clear"></div> <?php // event onContentBeforeDisplay echo $this->product->event->beforeDisplayContent;
href="<?php echo $link; ?> "> <?php echo jText::_($name); ?> </a> <?php //if ( $this->lang->hasKey($langKey) ) echo jText::_($langKey) ?> </li> <?php } else { ?> <li><?php echo jText::_($custom['name']); ?> </li> <?php } } ?> </ul> </div> <div class="modal-footer"><div class="close btn" data-dismiss="modal" ><?php echo JText::_('JCANCEL'); ?> </div></div> </div> <script type="text/javascript">