Beispiel #1
0
	function display($tpl = null) {
		$tpl = null;
		$config = oseMscConfig::getConfig('global', 'obj');
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::initScript();
		oseHTML::script($com . '/ose/app.msg.js', '1.5');
		oseHTML::script($com . '/grid/expander.js', '1.5');
		oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $config->frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		$mainframe = JFactory::getApplication('SITE');
		$session = JFactory::getSession();
		$user = JFactory::getUser();
		if ($user->guest) {
			$ItemID = JRequest::getInt("Itemid");
			$return = base64_encode(str_replace("&", "&", JRoute::_("index.php?option=com_osemsc&view=addons&Itemid=" . $ItemID)));
			if (JOOMLA16 == true) {
				$red = str_replace("&", "&", JRoute::_("index.php?option=com_users&view=login&return=" . $return));
			} else {
				$red = str_replace("&", "&", JRoute::_("index.php?option=com_user&view=login&return=" . $return));
			}
			$mainframe->redirect($red, "Please login first.");
		}
		$menu = &JSite::getMenu();
		$item = $menu->getActive();
		$addon_type = '';
		if (!empty($item)) {
			$params = &$menu->getParams($item->id);
			$addon_type = $params->get('addon_type');
		}
		$model = $this->getModel('addons');
		$items = array();
		switch ($addon_type) {
		case 'phoca':
			$items = $model->getAddonCats($addon_type);
			$link = 'index.php?option=com_phocadownload&view=category&id=';
			break;
		case 'roku':
			$items = $model->getAddonInfo($addon_type);
			$link = '';
			break;
		}
		$params = &$mainframe->getParams();
		$page_title = $params->get('page_title');
		$document = &JFactory::getDocument();
		$document->setTitle($params->get('page_title'));
		$this->assignRef('page_title', $page_title);
		$this->assignRef('addon_type', $addon_type);
		$this->assignRef('items', $items);
		$this->assignRef('link', $link);
		$this->prepareDocument();
		parent::display($tpl);
	}
Beispiel #2
0
	function display($tpl = null) {
		$app = JFactory::getApplication('SITE');
		$config = oseMscConfig::getConfig('register', 'obj');
		$items = oseMscPublic::getCartItems();
		$this->checkUser();
		$this->assignRef('item', $items[0]);
		$model = $this->getModel('payment');
		$items = $model->getMemberships();
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		$msc = oseRegistry::call('msc');
		$regForm = empty($config->register_form) ? null : $config->register_form;
		if (!empty($config->payment_system)) {
			$this->setLayout($config->payment_system);
		}
		$tpl = $regForm;
		$this->prepareDocument();
		parent::display($tpl);
	}
Beispiel #3
0
	function display($tpl = null) {
		$config = oseRegistry::call('msc')->getConfig('global', 'obj');
		$frontend_style = $config->frontend_style;
		$config = oseRegistry::call('msc')->getConfig('register', 'obj');
		if ($this->isMobile) {
			// Any mobile device.
			$this->setLayout('mobile');
			JRequest::setvar('tmpl', 'component');
		} else {
			$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
			oseHTML::initScript();
			oseHTML::script($com . '/ose/app.msg.js', '1.5');
			oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
			oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		}
		$this->assignRef('enable_fblogin', $config->enable_fblogin);
		$this->assignRef('facebookapiid', $config->facebookapiid);
		$this->prepareDocument();
		parent::display($tpl);
	}
Beispiel #4
0
	function display($tpl = null) {
		$tpl = null;
		$this->set('_layout', 'default');
		oseHTML::initCss();
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::initScript();
		oseHTML::script($com . '/ose/app.msg.js', '1.5');
		oseHTML::script($com . '/grid/expander.js', '1.5');
		oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
		$config = oseMscConfig::getConfig('global', 'obj');
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $config->frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		$user = JFactory::getUser();
		$app = JFactory::getApplication('SITE');
		$session = JFactory::getSession();
		$db = oseDB::instance();
		$order_id = JRequest::getInt('order_id');
		$payment = oseRegistry::call('payment');
		$where = array();
		$where[] = "`order_id` = " . $db->quote($order_id);
		$order = $payment->getOrder($where, 'obj');
		$orderInfoParams = oseJson::decode($order->params);
		$redirectUrl = urldecode($orderInfoParams->returnUrl);
		$config = oseMscConfig::getConfig('thirdparty', 'obj');
		$account = oseObject::getValue($config, 'gag_account');
		$standard_type = oseObject::getValue($config, 'gag_domain_mode');
		$domain = oseObject::getValue($config, 'gag_domain');
		$htmlTrack = oseMscPublic::htmlTrack($account, $standard_type, $domain, $order_id);
		$code = oseMscPublic::ajaxOrderTrack($account, $order_id);
		if (empty($code)) {
			$code = false;
		} else {
			$code = implode("", $code);
		}
		$document = JFactory::getDocument();
		$document->addScriptDeclaration('var redirectUrl = "' . $redirectUrl . '";');
		$document->addScriptDeclaration($htmlTrack);
		$document->addScriptDeclaration($code);
		$this->assignRef('orderInfo', $order);
		$this->prepareDocument();
		parent::display($tpl);
	}
Beispiel #5
0
	function display($tpl = null) {
		$user = oseMscPublic::getUser();
		$mainframe = JFactory::getApplication();
		$params = clone ($mainframe->getParams('com_osemsc'));
		$msc_id = $params->get('msc');
		$status = $params->get('status', 'all');
		if (empty($msc_id)) {
			$mainframe->redirect('index.php', 'Please choose a membership to show');
		}
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/msc5backend.css', '1.5');
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::script($com . '/grid/SearchField.js');
		$document = JFactory::getDocument();
		$document->addScriptDeclaration('var osememlist_msc_id = ' . $msc_id . '; var osememlist_status = \'' . $status . '\';');
		$this->prepareDocument();
		if (!empty($tpl)) {
			parent::display($tpl);
		} else {
			parent::display();
		}
	}
Beispiel #6
0
	function display($tpl = null) {
		$tpl = null;
		$this->set('_layout', 'default');
		$user = JFactory::getUser();
		$app = JFactory::getApplication('SITE');
		if ($user->guest) {
			$session = JFactory::getSession();
			$session->set('oseReturnUrl', base64_encode('index.php?option=com_osemsc&view=member'));
			$app->redirect('index.php?option=com_osemsc&view=login');
		} else {
			if (!$this->isMobile) {
				$this->loadViewJs();
				$this->loadGridJs();
				$this->loadMultiSelect();
				$member = oseRegistry::call('member');
				$view = $member->getInstance('PanelView');
				$member->instance($user->id);
				$hasMember = $member->getMemberOwnedMscInfo(true, null, 'obj');
				if ($hasMember > 0) {
					$result = $member->getMemberPanelView('Member');
					if (isset($result['layout'])) {
						$this->set('_layout', $result['layout']);
					}
					if (!empty($result['tpl'])) {
						$tpl = $result['tpl'];
					}
					$companyAddons = $this->getAddons('member_company');
					$this->assignRef('companyAddons', $companyAddons);
				} else {
					$this->set('_layout', 'default');
				}
			} else {
				$this->setLayout('mobile');
				JRequest::setvar('tmpl', 'component');
			}
		}
		$this->prepareDocument();
		parent::display($tpl);
	}
Beispiel #7
0
	function display($tpl = null) {
		$tpl = null;
		$this->set('_layout', 'default');
		oseHTML::initCss();
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::initScript();
		oseHTML::script($com . '/ose/app.msg.js', '1.5');
		oseHTML::script($com . '/grid/expander.js', '1.5');
		oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
		$config = oseMscConfig::getConfig('global', 'obj');
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $config->frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		$user = JFactory::getUser();
		$app = JFactory::getApplication('SITE');
		$session = JFactory::getSession();
		$db = oseDB::instance();
		$token = (isset($_REQUEST['token'])) ? urlencode($_REQUEST['token']) : "";
		$payment = oseRegistry::call('payment');
		$payment_mode = JRequest::getVar('mode');
		$orderID = JRequest::getInt('orderID');
		if (empty($orderID) || !is_numeric($orderID)) {
			echo "Order data is interrupted, payment process is terminated.";
		}
		if ($payment_mode == 'm') {
			$orderInfo = $payment->PaypalAPIPay($orderID, $token);
		} else {
			$orderInfo = $payment->PaypalAPICreateProfile($orderID, $token);
		}
		$where = array();
		$where[] = "`order_id` = " . $db->quote($orderID);
		$order = $payment->getOrder($where, 'obj');
		$orderInfoParams = oseJson::decode($order->params);
		$redirectUrl = urldecode($orderInfoParams->returnUrl);
		$document = JFactory::getDocument();
		$document->addScriptDeclaration('var redirectUrl = "' . $redirectUrl . '";');
		$this->assignRef('orderInfo', $orderInfo);
		$this->prepareDocument();
		parent::display($tpl);
	}
Beispiel #8
0
	function display($tpl = null) {
		$model = $this->getModel('memberships');
		$items = $model->getMemberships();
		$session = JFactory::getSession();
		$osePaymentCurrency = $session->get('osePaymentCurrency', oseRegistry::call('msc')->getConfig('currency', 'obj')->primary_currency);
		$cards = array();
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::initScript();
		oseHTML::script($com . '/ose/app.msg.js', '1.5');
		oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
		$register_form = oseRegistry::call('msc')->getConfig('register', 'obj')->register_form;
		$layout = JRequest::getCmd("layout");
		if (empty($register_form) || $register_form == 'default') {
			$layout = (!empty($layout) && ($layout == 'detail' || $layout == 'cartdetail')) ? "cartdetail" : 'cart';
			$this->setLayout($layout);
			$type = 'cart';
		} else {
			$layout = (!empty($layout) && ($layout == 'detail')) ? $layout : 'default';
			$this->setLayout($layout);
			$user = JFactory::getUser();
			$tpl = null;
			$type = 'os';
		}
		if ($layout == 'default' || $layout == 'cart') {
			$cards = $model->drawMscList($osePaymentCurrency, $items, $type);
		} else {
			foreach ($items as $item) {
				$msc_id = JRequest::getInt('msc_id', oseObject::getValue($item, 'id'));
				$cards = $model->getMembershipCard($msc_id);
				break;
			}
		}
		$config = oseMscConfig::getConfig('global', 'obj');
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $config->frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		$this->assignRef('cards', $cards);
		$this->prepareDocument();
		parent::display($tpl);
	}
Beispiel #9
0
	function display($tpl = null) {
		$user = oseMscPublic::getUser();
		$app = JFactory::getApplication('SITE');
		$cart = oseMscPublic::getCart();
		$osePaymentCurrency = $cart->get('currency');
		// Add Detect
		if ($this->isMobile) {
			$this->setLayout('mobile');
			JRequest::setVar('tmpl', 'component');
		} else {
			$this->loadMultiSelect();
			$this->loadFileUpload();
		}
		$model = $this->getModel('register');
		$msc_id = JRequest::getInt('msc_id', 0);
		$msc_option = JRequest::getCmd('msc_option', null);
		if (!empty($msc_id)) {
			if (empty($msc_option)) {
				$msc = oseRegistry::call('msc');
				$paymentInfos = $msc->getExtInfo($msc_id, 'payment');
				foreach ($paymentInfos as $paymentInfo) {
					$msc_option = oseObject::getValue($paymentInfo, 'id');
					break;
				}
				$model->addToCart($msc_id, $msc_option);
			} else {
				$model->addToCart($msc_id, $msc_option);
			}
		}
		$config = oseMscConfig::getConfig('register', 'obj');
		if (!$isMobile) {
			if (!empty($config->register_form) && $config->register_form != 'default') {
				$layout = JRequest::getCmd("layout");
				if (empty($layout)) {
					$layout = 'default';
				}
				$this->setLayout($layout);
				switch ($layout) {
				case ('onestep'):
				default:
					$headerObjs = $this->getAddons('registerOS_header');
					$bodyObjs = $this->getAddons('registerOS_body');
					$footerObjs = $this->getAddons('registerOS_footer');
					if ($user->guest) {
						$tpl = '';
						$headerObjs = $this->filter($headerObjs, array('welcome'), false);
					} else {
						$tpl = 'payment';
						$headerObjs = $this->filter($headerObjs, array('login'), false);
						$bodyObjs = $this->filter($bodyObjs, array('juser', 'juser_e', 'mailing', 'jomsocial'), false);
					}
					$this->loadAddons($headerObjs, 'registerOS');
					$this->loadAddons($bodyObjs, 'registerOS');
					$this->loadAddons($footerObjs, 'registerOS');
					$this->assignRef('registerOS_header', $headerObjs);
					$this->assignRef('registerOS_body', $bodyObjs);
					$this->assignRef('registerOS_footer', $footerObjs);
					$this->assignRef('enable_fblogin', $config->enable_fblogin);
					$this->assignRef('facebookapiid', $config->facebookapiid);
					break;
				}
			} else {
				$this->setLayout('cart');
				$tpl = "default";
				$headerObjs = $this->getAddons('registerOS_header');
				$bodyObjs = $this->getAddons('registerOS_body');
				$footerObjs = $this->getAddons('registerOS_footer');
				if ($user->guest) {
					$tpl = 'default';
				} else {
					$tpl = 'payment';
					$headerObjs = $this->filter($headerObjs, array('login'), false);
					$bodyObjs = $this->filter($bodyObjs, array('juser', 'juser_e'), false);
				}
				$this->loadAddons($headerObjs, 'registerOS');
				$this->loadAddons($bodyObjs, 'registerOS');
				$this->loadAddons($footerObjs, 'registerOS');
				$this->assignRef('registerOS_header', $headerObjs);
				$this->assignRef('registerOS_body', $bodyObjs);
				$this->assignRef('registerOS_footer', $footerObjs);
			}
		}
		$profiles = $this->getProfileList();
		$document = JFactory::getDocument();
		$document->addScriptDeclaration('var oseGetProfileFields = function()	{return ' . oseJson::encode($profiles) . '};');
		$this->prepareDocument();
		$this->addTemplatePath(JPATH_SITE . DS . 'ose' . DS . 'msc' . DS . 'views' . DS . 'register' . DS . 'tmpl');
		if (!empty($tpl)) {
			parent::display($tpl);
		} else {
			parent::display();
		}
	}