Exemplo n.º 1
0
 function drawMscList($msc_id)
 {
     $tree = oseMscTree::retrieveTree($msc_id, 'obj');
     $first = $tree[0];
     unset($tree[0]);
     if (count($tree) > 0) {
         $firstNode = $this->drawParent($first);
         $firstNode = $this->drawFirst($firstNode);
         $subTree = $this->drawTree($first->id);
         $subTree = $this->drawSecond($subTree);
         $row = $this->drawRow(array($firstNode, $subTree));
     } else {
         $firstNode = $this->drawLeaf($first);
         $firstNode = $this->drawFirst($firstNode);
         $row = $this->drawRow($firstNode);
     }
     $image = $this->getImage($first);
     $image = $this->drawImage($image);
     return $this->drawCard(array($image, $row));
 }
Exemplo n.º 2
0
	private function drawMscListCart($msc_id, $osePaymentCurrency) {
		$buildList = oseRegistry::call('payment')->getInstance('MscList');
		$buildList->set('currency', $osePaymentCurrency);
		$tree = oseMscTree::retrieveTree($msc_id, 'obj');
		$first = $tree[0];
		unset($tree[0]);
		if (count($tree) > 0) {
			$firstNode = $buildList->drawParent($first);
			$firstNode = $buildList->drawFirst($firstNode);
			$subTree = $buildList->drawTree($first->id);
			$subTree = $buildList->drawSecond($subTree);
			$row = $this->drawRow(array($firstNode, $subTree));
		} else {
			$firstNode = $buildList->drawLeaf($first);
			$msc = oseRegistry::call('msc');
			$paymentInfos = $msc->getExtInfo($msc_id, 'payment');
			$options = oseMscPublic::generatePriceOption($first, $paymentInfos, $osePaymentCurrency);
			if (!empty($options)) {
				$option = array();
				foreach ($options as $obj) {
					$oAttr = array();
					$oAttr['option.value'] = 'value';
					$oAttr['option.attr'] = 'attr';
					$attrStr = 'title="%s" trial_price="%s" trial_recurrence="%s" standard_price="%s" standard_recurrence="%s" has_trial="%s"';
					$oAttr['attr'] = sprintf($attrStr, $obj['title'], oseObject::getValue($obj, 'trial_price', 0), oseObject::getValue($obj, 'trial_recurrence', 0),
							$obj['standard_price'], $obj['standard_recurrence'], oseObject::getValue($obj, 'has_trial', 0));
					$o = oseHTML::getInstance('Select')->option(oseObject::getValue($obj, 'id'), oseObject::getValue($obj, 'title'), $oAttr);
					$option[] = $o;
				}
				$basic = $options[0];
				$listAttr = array();
				$listAttr['list.attr'] = ' class="msc_options"  size="1" style="width:200px"';
				$listAttr['list.translate'] = false;
				$listAttr['option.key'] = 'value';
				$listAttr['id'] = 'msc_option_' . oseObject::getValue($first, 'id');
				$listAttr['option.text'] = 'text';
				$listAttr['list.select'] = oseObject::getValue($obj, 'id');
				$listAttr['option.attr'] = 'attr';
				$combo = oseHTML::getInstance('Select')->genericlist($option, 'msc_option', $listAttr);
				$firstNode['price'] = "<div class='msc-price-box'><span>" . JText::_('Options') . ":</span>" . $buildList->drawPrice($combo . '<div></div>') . '</div>';
			}
			$hackback = JText::_('Subscribe');
			$needle = JText::_('Add');
			if (isset($firstNode['button'])) {
				$firstNode['button'] = preg_replace("/{$hackback}/", $needle, $firstNode['button'], 1);
			}
			$firstNode = $buildList->drawFirst($firstNode);
			$row = $buildList->drawRow($firstNode);
		}
		$image = $buildList->getImage($first);
		$image = $buildList->drawImage($image);
		return $buildList->drawCard(array($image, $row));
	}