function show() { $tmpl = JRequest::getCmd('tmpl', ''); if ($tmpl == 'component') { JRequest::setVar('hidemainmenu', 1); JRequest::setVar('layout', 'show'); ob_end_clean(); parent::display(); exit; } parent::show(); }
function download() { $file_id = JRequest::getInt('file_id'); if (empty($file_id)) { $field_table = JRequest::getString('field_table'); $field_namekey = base64_decode(urldecode(JRequest::getString('field_namekey'))); $name = base64_decode(urldecode(JRequest::getString('name'))); if (empty($field_table) || empty($field_namekey) || empty($name)) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('FILE_NOT_FOUND')); return false; } else { $options = array('thumbnail_x' => JRequest::getInt('thumbnail_x', 0), 'thumbnail_y' => JRequest::getInt('thumbnail_y', 0)); $fileClass = hikashop_get('class.file'); $fileClass->downloadFieldFile($name, $field_table, $field_namekey, $options); exit; } } $order_id = hikashop_getCID('order_id'); if (empty($order_id)) { parent::listing(); return false; } $file_pos = JRequest::getInt('file_pos', 1); $email = JRequest::getVar('email', ''); $fileClass = hikashop_get('class.file'); if (!$fileClass->download($file_id, $order_id, $file_pos, $email)) { switch ($fileClass->error_type) { case 'login': $this->_check(false); break; case 'no_order': parent::listing(); break; default: parent::show(); break; } } return true; }