当前位置: 首页>>代码示例>>PHP>>正文


PHP def_module::loadTemplates方法代码示例

本文整理汇总了PHP中def_module::loadTemplates方法的典型用法代码示例。如果您正苦于以下问题:PHP def_module::loadTemplates方法的具体用法?PHP def_module::loadTemplates怎么用?PHP def_module::loadTemplates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在def_module的用法示例。


在下文中一共展示了def_module::loadTemplates方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 public function process($template = null)
 {
     list($tpl_block, $tpl_item) = def_module::loadTemplates("emarket/payment/invoice/" . $template, 'legal_person_block', 'legal_person_item');
     $collection = umiObjectsCollection::getInstance();
     $types = umiObjectTypesCollection::getInstance();
     $typeId = $types->getBaseType("emarket", "legal_person");
     $customer = customer::get();
     $order = $this->order;
     $mode = getRequest('param2');
     if ($mode == 'do') {
         $personId = getRequest('legal-person');
         $isNew = $personId == null || $personId == 'new';
         if ($isNew) {
             $typeId = $types->getBaseType("emarket", "legal_person");
             $personId = $collection->addObject("", $typeId);
             $controller = cmsController::getInstance();
             $data = getRequest('data');
             if ($data && ($dataModule = $controller->getModule("data"))) {
                 $person = $collection->getObject($personId);
                 $person->setName($data['new']['name']);
                 $dataModule->saveEditedObject($personId, $isNew, true);
             }
             if ($collection->getObject($personId) instanceof umiObject) {
                 $customer = customer::get();
                 $customer->legal_persons = array_merge($customer->legal_persons, array($personId));
             }
         }
         $order->legal_person = $personId;
         $order->order();
         $order->payment_document_num = $order->id;
         $result = $this->printInvoice($order);
         $buffer = outputBuffer::current();
         $buffer->charset('utf-8');
         $buffer->contentType('text/html');
         $buffer->clear();
         $buffer->push($result);
         $buffer->end();
         return true;
     } else {
         if ($mode == 'delete') {
             $personId = (int) getRequest('person-id');
             if ($collection->isExists($personId)) {
                 $customer = customer::get();
                 $customer->legal_persons = array_diff($customer->legal_persons, array($personId));
                 $collection->delObject($personId);
             }
         }
     }
     $items = array();
     $persons = $customer->legal_persons;
     if (is_array($persons)) {
         foreach ($persons as $personId) {
             $person = $collection->getObject($personId);
             $item_arr = array('attribute:id' => $personId, 'attribute:name' => $person->name);
             $items[] = def_module::parseTemplate($tpl_item, $item_arr, false, $personId);
         }
     }
     $block_arr = array('attribute:type-id' => $typeId, 'attribute:type_id' => $typeId, 'xlink:href' => 'udata://data/getCreateForm/' . $typeId, 'subnodes:items' => $items);
     return def_module::parseTemplate($tpl_block, $block_arr);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:60,代码来源:invoice.php

示例2: tagsCloud

 public function tagsCloud($template = "default", $limit = 50, $max_font_size = 16)
 {
     list($template_block, $template_line, $template_separator) = def_module::loadTemplates("stat/" . $template, "tags_block", "tags_block_line", "tags_separator");
     $factory = new statisticFactory(dirname(__FILE__) . '/classes');
     $factory->isValid('allTags');
     $report = $factory->get('allTags');
     $report->setStart(0);
     $report->setFinish(strtotime("+1 day", time()));
     $result = $report->get();
     $max = $result['max'];
     $lines = array();
     $i = 0;
     $sz = sizeof($result['labels']);
     for ($i = 0; $i < min($sz, $limit); $i++) {
         $label = $result['labels'][$i];
         $line_arr = array();
         $tag = $label['tag'];
         $cnt = $label['cnt'];
         $fontSize = ceil($max_font_size * ($cnt / $max));
         $line_arr['node:tag'] = $tag;
         $line_arr['attribute:cnt'] = $cnt;
         $line_arr['attribute:font-size'] = $fontSize;
         $line_arr['void:separator'] = $i < $sz - 1 ? $template_separator : "";
         $line_arr['void:font_size'] = $fontSize;
         $lines[] = def_module::parseTemplate($template_line, $line_arr);
     }
     $block_arr = array();
     $block_arr['subnodes:lines'] = $lines;
     $block_arr['total'] = $sz;
     $block_arr['per_page'] = $limit;
     return def_module::parseTemplate($template_block, $block_arr);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:32,代码来源:__tags_cloud.php

示例3: getGuideList

 public function getGuideList($id, $template = 'guidelist', $arrayOnly = false)
 {
     if (!$id) {
         return null;
     }
     //id справочника
     $o = umiObjectsCollection::getInstance();
     $items = $o->getGuidedItems($id);
     if (!sizeof($items)) {
         return null;
     }
     if ($arrayOnly) {
         return $items;
     }
     list($guide_block, $guide_item) = def_module::loadTemplates("catalog/{$template}.tpl", "guide_block", "guide_item");
     $s = '';
     $block_array = array();
     foreach ($items as $k => $v) {
         $line_array = array();
         $line_array['id'] = $k;
         $line_array['name'] = $items[$k];
         $s .= def_module::parseTemplate($guide_item, $line_array);
     }
     $block_array['lines'] = $s;
     unset($items);
     $s = def_module::parseTemplate($guide_block, $block_array);
     return $s;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:28,代码来源:__custom.php

示例4: process

 public function process($template = null)
 {
     $productId = $this->object->product_id;
     $siteId = $this->object->site_id;
     $productName = $this->order->getId();
     $cmsController = cmsController::getInstance();
     $language = strtolower($cmsController->getCurrentLang()->getPrefix());
     switch ($language) {
         case 'ru':
             $language = 'ru';
             break;
         default:
             $language = 'en';
             break;
     }
     $this->order->order();
     $productPrice = $this->order->getActualPrice();
     $secretCode = $this->object->secret;
     $priceString = number_format($productPrice, 2, '.', '');
     $sign = md5($productId . '-' . $priceString . '-' . $secretCode);
     $answerUrl = $cmsController->getCurrentDomain()->getHost() . "/emarket/gateway/" . $this->order->getId() . "/";
     $param = array();
     $param["formAction"] = "https://payments.chronopay.com/index.php";
     $param["product_id"] = $productId;
     $param["product_price"] = $productPrice;
     $param["language"] = $language;
     $param["order_id"] = $this->order->getId();
     $param["cb_type"] = "P";
     $param["cb_url"] = $answerUrl;
     $param["decline_url"] = $cmsController->getCurrentDomain()->getHost();
     $param["sign"] = $sign;
     $this->order->setPaymentStatus('initialized');
     list($templateString) = def_module::loadTemplates("emarket/payment/chronopay/" . $template, "form_block");
     return def_module::parseTemplate($templateString, $param);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:35,代码来源:chronopay.php

示例5: process

 public function process($template = null)
 {
     $this->order->order();
     $currency = strtoupper(mainConfiguration::getInstance()->get('system', 'default-currency'));
     if ($currency == 'RUR') {
         $currency = 'RUB';
     }
     $amount = number_format($this->order->getActualPrice(), 2, '.', '');
     $orderId = $this->order->getId() . '.' . time();
     $merchantId = $this->object->mnt_id;
     $dataIntegrityCode = $this->object->mnt_data_integrity_code;
     $successUrl = $this->object->mnt_success_url;
     $failUrl = $this->object->mnt_fail_url;
     $testMode = $this->object->mnt_test_mode;
     $systemUrl = $this->object->mnt_system_url;
     if (empty($testMode)) {
         $testMode = 0;
     }
     $signature = md5("{$merchantId}{$orderId}{$amount}{$currency}{$testMode}{$dataIntegrityCode}");
     $param = array();
     $param['formAction'] = "https://{$systemUrl}/assistant.htm";
     $param['mntId'] = $merchantId;
     $param['mnTransactionId'] = $orderId;
     $param['mntCurrencyCode'] = $currency;
     $param['mntAmount'] = $amount;
     $param['mntTestMode'] = $testMode;
     $param['mntSignature'] = $signature;
     $param['mntSuccessUrl'] = $successUrl;
     $param['mntFailUrl'] = $failUrl;
     $this->order->setPaymentStatus('initialized');
     list($templateString) = def_module::loadTemplates("emarket/payment/payanyway/" . $template, "form_block");
     return def_module::parseTemplate($templateString, $param);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:33,代码来源:payanyway.php

示例6: process

 public function process($template = null)
 {
     $this->order->order();
     $currency = strtoupper(mainConfiguration::getInstance()->get('system', 'default-currency'));
     // NB! Possible values for PayOnline are RUB (not RUR!), EUR and USD
     if (!in_array($currency, array('RUB', 'EUR', 'USD'))) {
         $currency = 'RUB';
     }
     $merchantId = $this->object->merchant_id;
     $privateKey = $this->object->private_key;
     $orderId = $this->order->getId();
     $amount = number_format($this->order->getActualPrice(), 2, '.', '');
     $keyString = "MerchantId={$merchantId}&OrderId={$orderId}&Amount={$amount}&Currency={$currency}&PrivateSecurityKey={$privateKey}";
     $securityKey = md5($keyString);
     $formAction = "?MerchantId={$merchantId}&OrderId={$orderId}&Amount={$amount}&Currency={$currency}&SecurityKey={$securityKey}&order-id={$orderId}";
     $formAction = "https://secure.payonlinesystem.com/ru/payment/" . $formAction;
     $param = array();
     $param['formAction'] = $formAction;
     $param['MerchantId'] = $merchantId;
     $param['OrderId'] = $orderId;
     $param['Amount'] = $amount;
     $param['Currency'] = $currency;
     $param['SecurityKey'] = $securityKey;
     $param['orderId'] = $orderId;
     $param['ReturnUrl'] = 'http://' . cmsController::getInstance()->getCurrentDomain()->getHost();
     $this->order->setPaymentStatus('initialized');
     list($templateString) = def_module::loadTemplates("emarket/payment/payonline/" . $template, "form_block");
     return def_module::parseTemplate($templateString, $param);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:29,代码来源:payonline.php

示例7: profile

 public function profile($template = "default", $user_id = false)
 {
     if (!$template) {
         $template = "default";
     }
     list($template_block, $template_bad_user_block) = def_module::loadTemplates("users/profile/" . $template, "profile_block", "bad_user_block");
     $block_arr = array();
     if (!$user_id) {
         $user_id = (int) getRequest('param0');
     }
     if (!$user_id) {
         $permissions = permissionsCollection::getInstance();
         if ($permissions->isAuth()) {
             $user_id = $permissions->getUserId();
         }
     }
     if ($user = selector::get('object')->id($user_id)) {
         $this->validateEntityByTypes($user, array('module' => 'users', 'method' => 'user'));
         $block_arr['xlink:href'] = "uobject://" . $user_id;
         $userTypeId = $user->getTypeId();
         if ($userType = umiObjectTypesCollection::getInstance()->getType($userTypeId)) {
             $userHierarchyTypeId = $userType->getHierarchyTypeId();
             if ($userHierarchyType = umiHierarchyTypesCollection::getInstance()->getType($userHierarchyTypeId)) {
                 if ($userHierarchyType->getName() == "users" && $userHierarchyType->getExt() == "user") {
                     $block_arr['id'] = $user_id;
                     return def_module::parseTemplate($template_block, $block_arr, false, $user_id);
                 }
             }
         }
     } else {
         throw new publicException(getLabel('error-object-does-not-exist', null, $user_id));
     }
     return def_module::parseTemplate($template_bad_user_block, $block_arr);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:34,代码来源:__profile.php

示例8: viewAuthor

 public function viewAuthor($author_id = false, $template = "default")
 {
     if ($author_id === false) {
         throw new publicException(getLabel('error-object-does-not-exist', null, $author_id));
     }
     if (!($author = umiObjectsCollection::getInstance()->getObject($author_id))) {
         throw new publicException(getLabel('error-object-does-not-exist', null, $author_id));
     }
     if (!$template) {
         $template = "default";
     }
     list($template_user, $template_guest, $template_sv) = def_module::loadTemplates("users/author/{$template}", "user_block", "guest_block", "sv_block");
     $block_arr = array();
     if ($author->getTypeId() == umiObjectTypesCollection::getInstance()->getBaseType('users', 'user')) {
         $template = $template_user;
         $block_arr['user_id'] = $author_id;
         $user = $author;
         $block_arr['nickname'] = $user->getValue("login");
         $block_arr['email'] = $user->getValue("e-mail");
         $block_arr['fname'] = $user->getValue("fname");
         $block_arr['lname'] = $user->getValue("lname");
         $block_arr['subnodes:groups'] = $groups = $user->getValue("groups");
         if (in_array(SV_GROUP_ID, $groups)) {
             if ($template_sv) {
                 $template = $template_sv;
             }
         }
     } else {
         if ($author->getValue("is_registrated")) {
             $template = $template_user;
             $block_arr['user_id'] = $user_id = $author->getValue("user_id");
             $user = umiObjectsCollection::getInstance()->getObject($user_id);
             if (!$user instanceof umiObject) {
                 $block_arr['user_id'] = $user_id = intval(regedit::getInstance()->getVal("//modules/users/guest_id"));
                 $user = umiObjectsCollection::getInstance()->getObject($user_id);
             }
             if (!$user instanceof umiObject) {
                 return false;
             }
             $block_arr['nickname'] = $user->getValue("login");
             $block_arr['login'] = $user->getValue("login");
             $block_arr['email'] = $user->getValue("e-mail");
             $block_arr['fname'] = $user->getValue("fname");
             $block_arr['lname'] = $user->getValue("lname");
             $block_arr['subnodes:groups'] = $groups = $user->getValue("groups");
             if (in_array(SV_GROUP_ID, $groups)) {
                 if ($template_sv) {
                     $template = $template_sv;
                 }
             }
         } else {
             $template = $template_guest;
             $block_arr['nickname'] = $author->getValue("nickname");
             $block_arr['email'] = $author->getValue("email");
         }
     }
     return def_module::parseTemplate($template, $block_arr, false, $author_id);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:58,代码来源:__author.php

示例9: json_rate

 public function json_rate($template = "default")
 {
     if (!$template) {
         $template = "default";
     }
     $block_arr = array();
     $element_id = (int) getRequest('param0');
     $element = umiHierarchy::getInstance()->getElement($element_id);
     if (regedit::getInstance()->getVal("//modules/vote/is_graded")) {
         $bid = (int) getRequest('param1');
         if ($bid > 5) {
             $bid = 5;
         }
         if ($bid < 0) {
             $bid = 0;
         }
     } else {
         $bid = (bool) getRequest('param1') ? 1 : -1;
     }
     list($template_ok, $template_not_found, $template_rated, $template_permitted) = def_module::loadTemplates("vote/rate/" . $template, "rate_ok", "rate_not_found", "rate_rated", "rate_permitted");
     if ($is_private = (bool) regedit::getInstance()->getVal("//modules/vote/is_private")) {
         $users_module = cmsController::getInstance()->getModule("users");
         if (!$users_module->is_auth()) {
             header("Content-type: text/javascript; charset=utf-8");
             $template_permitted = def_module::parseTemplate($template_permitted, $block_arr, $element_id);
             $this->flush($template_permitted);
         }
     }
     $block_arr = array();
     $block_arr['request_id'] = getRequest('requestId');
     if ($element) {
         $block_arr['element_id'] = $element_id;
         if (self::getIsRated($element_id)) {
             $rate_voters = $element->getValue("rate_voters");
             $rate_sum = $element->getValue("rate_sum");
             $res = $template_rated;
         } else {
             $rate_voters = (int) $element->getValue("rate_voters");
             $rate_sum = (int) $element->getValue("rate_sum") + (int) $bid;
             $element->setValue("rate_voters", ++$rate_voters);
             $element->setValue("rate_sum", $rate_sum);
             $element->setValue("rate", round($rate_sum / $rate_voters, 2));
             $element->commit();
             umiHierarchy::getInstance()->unloadElement($element_id);
             $res = $template_ok;
             self::setIsRated($element_id);
         }
         $block_arr['current_rating'] = $rate_sum / $rate_voters;
     } else {
         $res = $template_not_found;
     }
     $res = def_module::parseTemplate($res, $block_arr, $element_id);
     header("Content-type: text/javascript; charset=utf-8");
     $this->flush($res);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:55,代码来源:__rate.php

示例10: renderBonusPayment

 public function renderBonusPayment(order $order, $template)
 {
     list($tpl_block) = def_module::loadTemplates("emarket/payment/" . $template, 'bonus_block');
     $customer = customer::get($order->getCustomerId());
     $block_arr = array('bonus' => $this->formatCurrencyPrice(array('reserved_bonus' => $order->getBonusDiscount(), 'available_bonus' => $customer->bonus, 'spent_bonus' => $customer->spent_bonus, 'actual_total_price' => $order->getActualPrice())));
     $block_arr['void:reserved_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $order->getBonusDiscount())));
     $block_arr['void:available_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $customer->bonus)));
     $block_arr['void:spent_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $customer->spent_bonus)));
     $block_arr['void:actual_total_price'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $order->getActualPrice())));
     return def_module::parseTemplate($tpl_block, $block_arr);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:11,代码来源:__payments.php

示例11: shared_file

		public function shared_file($template = "default", $element_path = false) {
			if(!$template) $template = "default";
			list($s_download_file, $s_broken_file, $s_upload_file) = def_module::loadTemplates("filemanager/".$template, "shared_file", "broken_file", "upload_file");

			$element_id = $this->analyzeRequiredPath($element_path);

			$element = umiHierarchy::getInstance()->getElement($element_id);

			$block_arr = Array();
			$template_block = $s_broken_file;
			if ($element) {
				// upload file if allowed
				$iUserId = cmsController::getInstance()->getModule('users')->user_id;
				list($bAllowRead, $bAllowWrite) = permissionsCollection::getInstance()->isAllowedObject($iUserId, $element_id);
				$block_arr['upload_file'] = "";
				if ($bAllowWrite) {
					$block_arr['upload_file'] = $s_upload_file;
					// upload first file in $_FILES
					if (count($_FILES)) {
						$oUploadedFile = umiFile::upload("shared_files", "upload", "./files/");
						if ($oUploadedFile instanceof umiFile) {
							$element->setValue("fs_file", $oUploadedFile);
							$element->commit();
						}
					}
				}

				$block_arr['id'] = $element_id;
				$block_arr['descr'] = ($descr = $element->getValue("descr")) ? $descr : $element->getValue("content");
				$block_arr['alt_name'] = $element->getAltName();
				$block_arr['link'] = umiHierarchy::getInstance()->getPathById($element_id);
				// file
				$block_arr['download_link'] = "";
				$block_arr['file_name'] = "";
				$block_arr['file_size'] = 0;

				$o_file = $element->getValue("fs_file");

				if ($o_file instanceof umiFile) {
					if (!$o_file->getIsBroken()) {
						$template_block = $s_download_file;
						$block_arr['download_link'] = $this->pre_lang."/filemanager/download/".$element_id;
						$block_arr['file_name'] = $o_file->getFileName();
						$block_arr['file_size'] = round($o_file->getSize()/1024, 2);
					}
				}
			} else {
				return cmsController::getInstance()->getModule("users")->auth();
			}

			$this->pushEditable("filemanager", "shared_file", $element_id);

			return self::parseTemplate($template_block, $block_arr);
		}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:54,代码来源:class.php

示例12: process

 public function process($template = null)
 {
     $this->order->order();
     $currency = strtoupper(mainConfiguration::getInstance()->get('system', 'default-currency'));
     $amount = number_format($this->order->getActualPrice(), 2, '.', '');
     $orderId = $this->order->getId();
     $mnt_ubrir_id = $this->object->mnt_ubrir_id;
     $mnt_secret_key = $this->object->mnt_secret_key;
     $mnt_uni_id = $this->object->mnt_uni_id;
     $mnt_uni_login = $this->object->mnt_uni_login;
     $mnt_uni_pass = $this->object->mnt_uni_pass;
     $mnt_uni_emp = $this->object->mnt_uni_emp;
     $mnt_two = $this->object->mnt_two;
     $cmsController = cmsController::getInstance();
     $answerUrl = 'http://' . $cmsController->getCurrentDomain()->getHost() . "/emarket/gateway/" . $this->order->getId() . '/';
     $failUrl = 'http://' . $cmsController->getCurrentDomain()->getHost() . '/emarket/purchase/result/fail/';
     $successUrl = 'http://' . $cmsController->getCurrentDomain()->getHost() . '/emarket/purchase/result/successful/';
     if (is_array($mnt_ubrir_id)) {
         $mnt_ubrir_id = $mnt_ubrir_id[0];
     }
     if (is_array($mnt_secret_key)) {
         $mnt_secret_key = $mnt_secret_key[0];
     }
     $bankHandler = new Ubrir(array('shopId' => $mnt_ubrir_id, 'order_id' => $orderId, 'sert' => $mnt_secret_key, 'amount' => $amount, 'approve_url' => $answerUrl, 'cancel_url' => $failUrl, 'decline_url' => $failUrl));
     $response_order = $bankHandler->prepare_to_pay();
     $new_order_twpg = l_mysql_query('INSERT INTO `umi_twpg` (`umi_id`, `twpg_id`, `session_id`) VALUES ("' . $orderId . '", "' . $response_order->OrderID[0] . '", "' . $response_order->SessionID[0] . '")');
     $param = array();
     if (is_array($mnt_uni_id)) {
         $mnt_uni_id = $mnt_uni_id[0];
     }
     //if(is_array($mnt_uni_login))
     if (is_array($mnt_uni_pass)) {
         $mnt_uni_pass = $mnt_uni_pass[0];
     }
     //var_dump($mnt_uni_login); die;
     $param['sign'] = strtoupper(md5(md5($mnt_uni_id) . '&' . md5($mnt_uni_login) . '&' . md5($mnt_uni_pass) . '&' . md5($orderId) . '&' . md5($amount)));
     $param['twpg_url'] = $response_order->URL[0] . '?orderid=' . $response_order->OrderID[0] . '&sessionid=' . $response_order->SessionID[0];
     $param['uni_id'] = $mnt_uni_id;
     $param['uni_login'] = $mnt_uni_login;
     $param['amount'] = $amount;
     $param['order_id'] = $orderId;
     $param['urlno'] = $failUrl;
     $param['urlok'] = $successUrl;
     if ($mnt_two == 1) {
         $param['uni_submit'] = ' <INPUT TYPE="button" onclick="document.forms.uniteller.submit()" value="Оплатить MasterCard">';
     } else {
         $param['uni_submit'] = '';
     }
     $this->order->setPaymentStatus('initialized');
     list($templateString) = def_module::loadTemplates("tpls/emarket/payment/ubrir/ubrir.tpl", "form_block");
     return def_module::parseTemplate($templateString, $param);
 }
开发者ID:itm-constantine,项目名称:ubrr_umi,代码行数:52,代码来源:ubrir.php

示例13: view

 public function view($elementPath = "", $template = "default")
 {
     if ($this->breakMe()) {
         return;
     }
     $hierarchy = umiHierarchy::getInstance();
     list($template_block) = def_module::loadTemplates("tpls/modulelements/{$template}.tpl", "view");
     $elementId = $this->analyzeRequiredPath($elementPath);
     //echo $elementId;
     $element = $hierarchy->getElement($elementId);
     templater::pushEditable("modulelements", "item_element", $element->id);
     return self::parseTemplate($template_block, array('id' => $element->id), $element->id);
 }
开发者ID:tomoonshine,项目名称:postsms,代码行数:13,代码来源:class.php

示例14: process

		public function process($template = null) {
			$this->order->order();
			$currency = strtoupper( mainConfiguration::getInstance()->get('system', 'default-currency') );
			$amount = number_format($this->order->getActualPrice(), 2, '.', '');
			$param = array();
			$param["formAction"] = "https://rbkmoney.ru/acceptpurchase.aspx";
			$param["eshopId"] = $this->object->eshopId;
			$param["orderId"] = $this->order->id;
			$param["recipientAmount"] = $amount;
			$param["recipientCurrency"] = $currency;
			$param["version"] = "2"; // May be 1 or 2, see documentation
			$this->order->setPaymentStatus('initialized');
			list($templateString) = def_module::loadTemplates("emarket/payment/rbk/".$template, "form_block");
			return def_module::parseTemplate($templateString, $param);
		}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:15,代码来源:rbk.php

示例15: stores

 public function stores($elementId, $template = 'default')
 {
     if (!$template) {
         $tempate = 'default';
     }
     $hierarchy = umiHierarchy::getInstance();
     $objects = umiObjectsCollection::getInstance();
     list($tpl_block, $tpl_block_empty, $tpl_item) = def_module::loadTemplates("emarket/stores/" . $template, 'stores_block', 'stores_block_empty', 'stores_item');
     $elementId = $this->analyzeRequiredPath($elementId);
     if ($elementId == false) {
         throw new publicException("Wrong element id given");
     }
     $element = $hierarchy->getElement($elementId);
     if ($element instanceof iUmiHierarchyElement == false) {
         throw new publicException("Wrong element id given");
     }
     $storesInfo = $element->stores_state;
     $items_arr = array();
     $stores = array();
     $total = 0;
     if (is_array($storesInfo)) {
         foreach ($storesInfo as $storeInfo) {
             $object = $objects->getObject(getArrayKey($storeInfo, 'rel'));
             if ($object instanceof iUmiObject) {
                 $amount = (int) getArrayKey($storeInfo, 'int');
                 $total += $amount;
                 $store = array('attribute:amount' => $amount);
                 if ($object->primary) {
                     $reserved = (int) $element->reserved;
                     $store['attribute:amount'] -= $reserved;
                     $store['attribute:reserved'] = $reserved;
                     $store['attribute:primary'] = 'primary';
                 }
                 $store['item'] = $object;
                 $stores[] = $store;
                 $items_arr[] = def_module::parseTemplate($tpl_item, array('store_id' => $object->id, 'amount' => $amount, 'name' => $object->name), false, $object->id);
             }
         }
     }
     $result = array('stores' => array('attribute:total-amount' => $total, 'nodes:store' => $stores));
     $result['void:total-amount'] = $total;
     $result['void:items'] = $items_arr;
     if (!$total) {
         $tpl_block = $tpl_block_empty;
     }
     return def_module::parseTemplate($tpl_block, $result);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:47,代码来源:__stores.php


注:本文中的def_module::loadTemplates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。