本文整理汇总了PHP中def_module::isXSLTResultMode方法的典型用法代码示例。如果您正苦于以下问题:PHP def_module::isXSLTResultMode方法的具体用法?PHP def_module::isXSLTResultMode怎么用?PHP def_module::isXSLTResultMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类def_module
的用法示例。
在下文中一共展示了def_module::isXSLTResultMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLoginzaProvider
public function getLoginzaProvider()
{
$loginzaAPI = new loginzaAPI();
$result = array();
foreach ($loginzaAPI->getProvider() as $k => $v) {
$result['providers']['nodes:provider'][] = array('attribute:name' => $k, 'attribute:title' => $v);
}
$result['widget_url'] = $loginzaAPI->getWidgetUrl() . "&providers_set=google,yandex,mailru,vkontakte,facebook,twitter,loginza,rambler,lastfm,myopenid,openid,mailruapi";
if (def_module::isXSLTResultMode()) {
return $result;
} else {
return $result['widget_url'];
}
}
示例2: beginProcessing
private function beginProcessing(DOMElement $v8d6652e544ac78162c4dfe3994130b01)
{
def_module::isXSLTResultMode(true);
$this->processRedirection();
$v21ffce5b8a6cc8cc6a41448dd69623c9 = $this->extractParams($v8d6652e544ac78162c4dfe3994130b01);
if (isset($v21ffce5b8a6cc8cc6a41448dd69623c9['cache'])) {
$this->cache = $v21ffce5b8a6cc8cc6a41448dd69623c9['cache'];
}
$this->processGeneration();
$this->processTransformation();
$this->processValidation();
if ($this->externalCall) {
$this->processSerialization();
return true;
} else {
return $this->buffer;
}
}
示例3: generateCaptcha
public static function generateCaptcha($v66f6181bcb4cff4cd38fbc804a036db6 = "default", $vb082bdddeadb1ea23f679c64ae900ef9 = "sys_captcha", $ve98737036f7752124468103e7fcdb14d = "")
{
if (!self::isNeedCaptha()) {
return def_module::isXSLTResultMode() ? array('comment:explain' => 'Captcha is not required for logged users') : '';
}
if (!$v66f6181bcb4cff4cd38fbc804a036db6) {
$v66f6181bcb4cff4cd38fbc804a036db6 = "default";
}
if (!$vb082bdddeadb1ea23f679c64ae900ef9) {
$vb082bdddeadb1ea23f679c64ae900ef9 = "sys_captcha";
}
if (!$ve98737036f7752124468103e7fcdb14d) {
$ve98737036f7752124468103e7fcdb14d = "";
}
$v9af24b163db8fe13fd0c36ae8c4080c1 = "?" . time();
$vfca1bff8ad8b3a8585abfb0ad523ba42 = array();
$vfca1bff8ad8b3a8585abfb0ad523ba42['void:input_id'] = $vb082bdddeadb1ea23f679c64ae900ef9;
$vfca1bff8ad8b3a8585abfb0ad523ba42['attribute:captcha_hash'] = $ve98737036f7752124468103e7fcdb14d;
$vfca1bff8ad8b3a8585abfb0ad523ba42['attribute:random_string'] = $v9af24b163db8fe13fd0c36ae8c4080c1;
$vfca1bff8ad8b3a8585abfb0ad523ba42['url'] = array('attribute:random-string' => $v9af24b163db8fe13fd0c36ae8c4080c1, 'node:value' => '/captcha.php');
list($vb7c60eca084c05c6f9d7b6f220a32025) = def_module::loadTemplates("captcha/" . $v66f6181bcb4cff4cd38fbc804a036db6, "captcha");
return def_module::parseTemplate($vb7c60eca084c05c6f9d7b6f220a32025, $vfca1bff8ad8b3a8585abfb0ad523ba42);
}
示例4: xmlTranslator
$rootNode = $dom->createElement("result");
$dom->appendChild($rootNode);
$rootNode->setAttribute('xmlns:xlink', 'http://www.w3.org/TR/xlink');
// принудительный режим xslt для получения глобальных переменных
def_module::isXSLTResultMode(true);
$globalVars = $cmsController->getGlobalVariables();
$translator = new xmlTranslator($dom);
$translator->translateToXml($rootNode, $globalVars);
$buffer->contentType('text/xml');
$buffer->push($dom->saveXML());
} elseif (getRequest("jsonMode") == 'force') {
// flush json
$buffer->contentType('text/javascript');
$buffer->option('generation-time', false);
// принудительный режим xslt для получения глобальных переменных
def_module::isXSLTResultMode(true);
$globalVars = $cmsController->getGlobalVariables();
$translator = new jsonTranslator();
$result = $translator->translateToJson($globalVars);
$buffer->push($result);
} else {
// enable callstack
if (!is_null(getRequest('showStreamsCalls'))) {
$currentTemplater->setEnabledCallStack(!$config->get('debug', 'callstack.disabled'));
}
$templatesSource = $currentTemplater->getTemplatesSource();
list($commonTemplate) = $currentTemplater->getTemplates($templatesSource, 'common');
$globalVars = $cmsController->getGlobalVariables();
if ($currentElementId = $cmsController->getCurrentElementId()) {
$currentTemplater->setScope($currentElementId);
}
示例5: generateNumPage
public static function generateNumPage($vfbb44b4487415b134bce9c790a27fe5e, $v9d85c254b5062e518a134a61950999c3, $v66f6181bcb4cff4cd38fbc804a036db6 = "default", $v51746fc9cfaaf892e94c2d56d7508b37 = "p", $vc381645e69cb46e1f8cd9c8efaf89360 = false)
{
$v9d85c254b5062e518a134a61950999c3 = intval($v9d85c254b5062e518a134a61950999c3);
if ($v9d85c254b5062e518a134a61950999c3 == 0) {
$v9d85c254b5062e518a134a61950999c3 = $vfbb44b4487415b134bce9c790a27fe5e;
}
if (!$v66f6181bcb4cff4cd38fbc804a036db6) {
$v66f6181bcb4cff4cd38fbc804a036db6 = "default";
}
if (!$v51746fc9cfaaf892e94c2d56d7508b37) {
$v51746fc9cfaaf892e94c2d56d7508b37 = "p";
}
list($v364f9b183bd2dd9e0beb45c754830a6c, $v28d65bb7a643774ada22f54ca0679289, $v839bf4ce4f682ac29d72f21f39abbd61, $v4a1835dbba88e0fe534a30ac2fa8558a, $vb286163c2d7138578b6b3613433eed50, $v7c958e8e1861de153b774584fc4bca8b, $v0a017ef40a7bd9bd3d55a6a131fb2022, $v95b746440a532f0586864ff101da4948, $vc86804a0ba2ef9ad4f4da84c7288edb4, $vedc51c4694ab5eba9c080cb3832bdf35, $vb5974b598b6ced7f5f1c063fbaac66a2, $va2cbeb34cf8f6b425c8854901c7958b6, $vbfda3d6978660f5cd25c31b54d38eed8) = def_module::loadTemplates("numpages/" . $v66f6181bcb4cff4cd38fbc804a036db6, "pages_block", "pages_block_empty", "pages_item", "pages_item_a", "pages_quant", "pages_tobegin", "pages_tobegin_a", "pages_toend", "pages_toend_a", "pages_toprev", "pages_toprev_a", "pages_tonext", "pages_tonext_a");
$vb0efae39904aed41aca525e2d7ccb04f = def_module::isXSLTResultMode();
if ($vfbb44b4487415b134bce9c790a27fe5e <= 0 || $vfbb44b4487415b134bce9c790a27fe5e <= $v9d85c254b5062e518a134a61950999c3) {
return $vb0efae39904aed41aca525e2d7ccb04f ? "" : $v28d65bb7a643774ada22f54ca0679289;
}
$v3c6e0b8a9c15224a8228b9a98ca1531d = $v51746fc9cfaaf892e94c2d56d7508b37;
$v4cb7e30dcd90a438883f04c9fd09bd0e = (string) getRequest($v3c6e0b8a9c15224a8228b9a98ca1531d);
$v21ffce5b8a6cc8cc6a41448dd69623c9 = $_GET;
if (array_key_exists($v3c6e0b8a9c15224a8228b9a98ca1531d, $v21ffce5b8a6cc8cc6a41448dd69623c9)) {
unset($v21ffce5b8a6cc8cc6a41448dd69623c9[$v3c6e0b8a9c15224a8228b9a98ca1531d]);
}
unset($v21ffce5b8a6cc8cc6a41448dd69623c9['path']);
if (array_key_exists('scheme', $v21ffce5b8a6cc8cc6a41448dd69623c9)) {
unset($v21ffce5b8a6cc8cc6a41448dd69623c9['scheme']);
}
if ($vc381645e69cb46e1f8cd9c8efaf89360 === false) {
$vc381645e69cb46e1f8cd9c8efaf89360 = self::$max_pages;
}
$vfca1bff8ad8b3a8585abfb0ad523ba42 = array();
$vb3b32a2d422265cd25c3323ed0157f81 = array();
$v8b0b5c2528ffe15f18ef92e17ee3157d = ceil($vfbb44b4487415b134bce9c790a27fe5e / $v9d85c254b5062e518a134a61950999c3);
if (!$v8b0b5c2528ffe15f18ef92e17ee3157d) {
$v8b0b5c2528ffe15f18ef92e17ee3157d = 1;
}
$v21ffce5b8a6cc8cc6a41448dd69623c9 = self::protectParams($v21ffce5b8a6cc8cc6a41448dd69623c9);
$v7694f4a66316e53c8cdd9d9954bd611d = sizeof($v21ffce5b8a6cc8cc6a41448dd69623c9) ? "&" . http_build_query($v21ffce5b8a6cc8cc6a41448dd69623c9, '', '&') : "";
if ($vb0efae39904aed41aca525e2d7ccb04f == false) {
$v7694f4a66316e53c8cdd9d9954bd611d = str_replace("%", "%", $v7694f4a66316e53c8cdd9d9954bd611d);
}
$v7694f4a66316e53c8cdd9d9954bd611d = str_replace(array("<", ">", "%3C", "%3E"), array("<", ">", "<", ">"), $v7694f4a66316e53c8cdd9d9954bd611d);
for ($v865c0c0b4ab0e063e5caa3387c1a8741 = 0; $v865c0c0b4ab0e063e5caa3387c1a8741 < $v8b0b5c2528ffe15f18ef92e17ee3157d; $v865c0c0b4ab0e063e5caa3387c1a8741++) {
$v69ba0c89abba8a3e9cc0c5e32be0d35d = array();
$v7b8b965ad4bca0e41ab51de7b31363a1 = $v865c0c0b4ab0e063e5caa3387c1a8741 + 1;
if ($v4cb7e30dcd90a438883f04c9fd09bd0e - $vc381645e69cb46e1f8cd9c8efaf89360 >= $v865c0c0b4ab0e063e5caa3387c1a8741) {
continue;
}
if ($v4cb7e30dcd90a438883f04c9fd09bd0e + $vc381645e69cb46e1f8cd9c8efaf89360 <= $v865c0c0b4ab0e063e5caa3387c1a8741) {
break;
}
if ($v4cb7e30dcd90a438883f04c9fd09bd0e != "all") {
$v4f2afc9c4099ee1f39c9f551123e54bd = $v865c0c0b4ab0e063e5caa3387c1a8741 == $v4cb7e30dcd90a438883f04c9fd09bd0e ? $v4a1835dbba88e0fe534a30ac2fa8558a : $v839bf4ce4f682ac29d72f21f39abbd61;
} else {
$v4f2afc9c4099ee1f39c9f551123e54bd = $v839bf4ce4f682ac29d72f21f39abbd61;
}
$v2a304a1348456ccd2234cd71a81bd338 = "?{$v3c6e0b8a9c15224a8228b9a98ca1531d}={$v865c0c0b4ab0e063e5caa3387c1a8741}" . $v7694f4a66316e53c8cdd9d9954bd611d;
$v69ba0c89abba8a3e9cc0c5e32be0d35d['attribute:link'] = $v2a304a1348456ccd2234cd71a81bd338;
$v69ba0c89abba8a3e9cc0c5e32be0d35d['attribute:page-num'] = $v865c0c0b4ab0e063e5caa3387c1a8741;
if ($v4cb7e30dcd90a438883f04c9fd09bd0e == $v865c0c0b4ab0e063e5caa3387c1a8741) {
$v69ba0c89abba8a3e9cc0c5e32be0d35d['attribute:is-active'] = true;
}
$v69ba0c89abba8a3e9cc0c5e32be0d35d['node:num'] = $v7b8b965ad4bca0e41ab51de7b31363a1;
$v69ba0c89abba8a3e9cc0c5e32be0d35d['void:quant'] = ($v865c0c0b4ab0e063e5caa3387c1a8741 < $v4cb7e30dcd90a438883f04c9fd09bd0e + $vc381645e69cb46e1f8cd9c8efaf89360 - 1 and $v865c0c0b4ab0e063e5caa3387c1a8741 < $v8b0b5c2528ffe15f18ef92e17ee3157d - 1) ? $vb286163c2d7138578b6b3613433eed50 : "";
$vb3b32a2d422265cd25c3323ed0157f81[] = def_module::parseTemplate($v4f2afc9c4099ee1f39c9f551123e54bd, $v69ba0c89abba8a3e9cc0c5e32be0d35d);
}
$vfca1bff8ad8b3a8585abfb0ad523ba42['subnodes:items'] = $vfca1bff8ad8b3a8585abfb0ad523ba42['void:pages'] = $vb3b32a2d422265cd25c3323ed0157f81;
if (!$vb0efae39904aed41aca525e2d7ccb04f) {
$vfca1bff8ad8b3a8585abfb0ad523ba42['tobegin'] = $v4cb7e30dcd90a438883f04c9fd09bd0e == 0 || $v8b0b5c2528ffe15f18ef92e17ee3157d <= 1 ? $v0a017ef40a7bd9bd3d55a6a131fb2022 : $v7c958e8e1861de153b774584fc4bca8b;
$vfca1bff8ad8b3a8585abfb0ad523ba42['toprev'] = $v4cb7e30dcd90a438883f04c9fd09bd0e == 0 || $v8b0b5c2528ffe15f18ef92e17ee3157d <= 1 ? $vb5974b598b6ced7f5f1c063fbaac66a2 : $vedc51c4694ab5eba9c080cb3832bdf35;
$vfca1bff8ad8b3a8585abfb0ad523ba42['toend'] = $v4cb7e30dcd90a438883f04c9fd09bd0e == $v8b0b5c2528ffe15f18ef92e17ee3157d - 1 || $v8b0b5c2528ffe15f18ef92e17ee3157d <= 1 ? $vc86804a0ba2ef9ad4f4da84c7288edb4 : $v95b746440a532f0586864ff101da4948;
$vfca1bff8ad8b3a8585abfb0ad523ba42['tonext'] = $v4cb7e30dcd90a438883f04c9fd09bd0e == $v8b0b5c2528ffe15f18ef92e17ee3157d - 1 || $v8b0b5c2528ffe15f18ef92e17ee3157d <= 1 ? $vbfda3d6978660f5cd25c31b54d38eed8 : $va2cbeb34cf8f6b425c8854901c7958b6;
}
if ($v4cb7e30dcd90a438883f04c9fd09bd0e != 0) {
$v5446dec5267237b6586d5ea62673ec8a = "?{$v3c6e0b8a9c15224a8228b9a98ca1531d}=0" . $v7694f4a66316e53c8cdd9d9954bd611d;
if ($vb0efae39904aed41aca525e2d7ccb04f) {
$vfca1bff8ad8b3a8585abfb0ad523ba42['tobegin_link'] = array('attribute:page-num' => 0, 'node:value' => $v5446dec5267237b6586d5ea62673ec8a);
} else {
$vfca1bff8ad8b3a8585abfb0ad523ba42['tobegin_link'] = $v5446dec5267237b6586d5ea62673ec8a;
}
}
if ($v4cb7e30dcd90a438883f04c9fd09bd0e < $v8b0b5c2528ffe15f18ef92e17ee3157d - 1) {
$vf6482501a577488d9d516673a818b529 = "?{$v3c6e0b8a9c15224a8228b9a98ca1531d}=" . ($v8b0b5c2528ffe15f18ef92e17ee3157d - 1) . $v7694f4a66316e53c8cdd9d9954bd611d;
if ($vb0efae39904aed41aca525e2d7ccb04f) {
$vfca1bff8ad8b3a8585abfb0ad523ba42['toend_link'] = array('attribute:page-num' => $v8b0b5c2528ffe15f18ef92e17ee3157d - 1, 'node:value' => $vf6482501a577488d9d516673a818b529);
} else {
$vfca1bff8ad8b3a8585abfb0ad523ba42['toend_link'] = $vf6482501a577488d9d516673a818b529;
}
}
if ($v4cb7e30dcd90a438883f04c9fd09bd0e - 1 >= 0) {
$v40ea974cc7981d1dce9ba3aede6d20cb = "?{$v3c6e0b8a9c15224a8228b9a98ca1531d}=" . ($v4cb7e30dcd90a438883f04c9fd09bd0e - 1) . $v7694f4a66316e53c8cdd9d9954bd611d;
if ($vb0efae39904aed41aca525e2d7ccb04f) {
$vfca1bff8ad8b3a8585abfb0ad523ba42['toprev_link'] = array('attribute:page-num' => $v4cb7e30dcd90a438883f04c9fd09bd0e - 1, 'node:value' => $v40ea974cc7981d1dce9ba3aede6d20cb);
} else {
$vfca1bff8ad8b3a8585abfb0ad523ba42['toprev_link'] = $v40ea974cc7981d1dce9ba3aede6d20cb;
}
}
if ($v4cb7e30dcd90a438883f04c9fd09bd0e < $v8b0b5c2528ffe15f18ef92e17ee3157d - 1) {
$vd6b69f3495f46527af2f79a8b02da78b = "?{$v3c6e0b8a9c15224a8228b9a98ca1531d}=" . ($v4cb7e30dcd90a438883f04c9fd09bd0e + 1) . $v7694f4a66316e53c8cdd9d9954bd611d;
if ($vb0efae39904aed41aca525e2d7ccb04f) {
//.........这里部分代码省略.........
示例6: parseSearchSymlink
public function parseSearchSymlink(umiField $field, $template, $category_id)
{
$block_arr = array();
$items = array();
$name = $field->getName();
$title = $field->getTitle();
$sel = new selector('pages');
$sel->types('hierarchy-type');
$sel->where('hierarchy')->page($category_id)->childs(1);
$guide_items = array();
foreach ($sel->result as $element) {
if ($value = $element->getValue($name)) {
foreach ($value as $object) {
$guide_items[$object->id] = $object->name;
}
}
}
$fields_filter = getRequest('fields_filter');
$value = getArrayKey($fields_filter, $name);
$is_tpl = !def_module::isXSLTResultMode();
$unfilter_link = "";
foreach ($guide_items as $object_id => $object_name) {
if (is_array($value)) {
$selected = in_array($object_id, $value) ? "selected" : "";
} else {
$selected = $object_id == $value ? "selected" : "";
}
if ($is_tpl) {
$items[] = "<option value=\"{$object_id}\" {$selected}>{$object_name}</option>";
} else {
$line_arr = array();
$line_arr['attribute:id'] = $line_arr['void:object_id'] = $object_id;
$line_arr['node:object_name'] = $object_name;
$params = $_GET;
unset($params['path']);
unset($params['p']);
$params['fields_filter'][$name] = $object_id;
$filter_link = "?" . http_build_query($params, '', '&');
unset($params['fields_filter'][$name]);
$unfilter_link = "?" . http_build_query($params, '', '&');
$line_arr['attribute:filter_link'] = $filter_link;
$line_arr['attribute:unfilter_link'] = $unfilter_link;
if ($selected) {
$line_arr['attribute:selected'] = "selected";
}
$items[] = def_module::parseTemplate('', $line_arr);
}
}
$block_arr['attribute:unfilter_link'] = $unfilter_link;
$block_arr['attribute:name'] = $name;
$block_arr['attribute:title'] = $title;
$block_arr['subnodes:values'] = $block_arr['void:items'] = $items;
$block_arr['void:selected'] = $value ? "" : "selected";
return def_module::parseTemplate($template, $block_arr);
}
示例7: parse
public function parse($v87cd8b8808600624d8c590cfc2e6e94b, $v9a0364b9e99bb480dd25e1f0284c8555 = null)
{
if (empty($v9a0364b9e99bb480dd25e1f0284c8555)) {
return strval($v9a0364b9e99bb480dd25e1f0284c8555);
}
if (strpos($v9a0364b9e99bb480dd25e1f0284c8555, '%') === false && strpos($v9a0364b9e99bb480dd25e1f0284c8555, '[ms_') === false) {
return $v9a0364b9e99bb480dd25e1f0284c8555;
}
$v031162dfa4ba07c7379009026922ac7a = $this->startParseCallReport($v87cd8b8808600624d8c590cfc2e6e94b, $v9a0364b9e99bb480dd25e1f0284c8555);
if ($this->parseLevel > self::$maxParseLevel) {
return $v9a0364b9e99bb480dd25e1f0284c8555;
}
$v4a4342178dad007c454130c4dd77d9e4 = def_module::isXSLTResultMode(false);
$v63fb636909f1ebad67110e49117e6de4 = $v9a0364b9e99bb480dd25e1f0284c8555;
if (strpos($v9a0364b9e99bb480dd25e1f0284c8555, '<!--') !== false) {
$v9a0364b9e99bb480dd25e1f0284c8555 = $this->parseComments($v9a0364b9e99bb480dd25e1f0284c8555);
}
if ($this->scopeElementId) {
$v9a0364b9e99bb480dd25e1f0284c8555 = str_replace('%id%', $this->scopeElementId, $v9a0364b9e99bb480dd25e1f0284c8555);
}
$v9a0364b9e99bb480dd25e1f0284c8555 = $this->parseShortMacroses($v9a0364b9e99bb480dd25e1f0284c8555, $v87cd8b8808600624d8c590cfc2e6e94b);
$v9a0364b9e99bb480dd25e1f0284c8555 = $this->parseCompleteMacroses($v9a0364b9e99bb480dd25e1f0284c8555, $v87cd8b8808600624d8c590cfc2e6e94b);
def_module::isXSLTResultMode($v4a4342178dad007c454130c4dd77d9e4);
if ($v63fb636909f1ebad67110e49117e6de4 === $v9a0364b9e99bb480dd25e1f0284c8555) {
$this->stopCallReport($v031162dfa4ba07c7379009026922ac7a);
return $v9a0364b9e99bb480dd25e1f0284c8555;
}
if (strpos($v9a0364b9e99bb480dd25e1f0284c8555, '[ms_') !== false) {
$v9a0364b9e99bb480dd25e1f0284c8555 = str_replace(array_keys(self::$msResultStack), array_values(self::$msResultStack), $v9a0364b9e99bb480dd25e1f0284c8555);
}
if (strpos($v9a0364b9e99bb480dd25e1f0284c8555, '%') !== false) {
$this->parseLevel++;
$v9a0364b9e99bb480dd25e1f0284c8555 = $this->parse($v87cd8b8808600624d8c590cfc2e6e94b, $v9a0364b9e99bb480dd25e1f0284c8555);
}
$this->stopCallReport($v031162dfa4ba07c7379009026922ac7a);
return $v9a0364b9e99bb480dd25e1f0284c8555;
}
示例8: getGlobalVariables
public function getGlobalVariables($v2d4260a0fcf0c77266e1b8f41bd4080c = false)
{
static $v6d9fecd2868e8a635b6d088c3e8068c2;
if (!$v2d4260a0fcf0c77266e1b8f41bd4080c && !is_null($v6d9fecd2868e8a635b6d088c3e8068c2)) {
return $v6d9fecd2868e8a635b6d088c3e8068c2;
}
$v6d9fecd2868e8a635b6d088c3e8068c2 = array();
if ($this->getCurrentMode() == 'admin') {
return $v6d9fecd2868e8a635b6d088c3e8068c2 = $this->prepareAdminSideGlobalVariables();
}
if (def_module::isXSLTResultMode()) {
return $v6d9fecd2868e8a635b6d088c3e8068c2 = $this->prepareClientSideGlobalVariablesForXSLT();
} else {
return $v6d9fecd2868e8a635b6d088c3e8068c2 = $this->prepareClientSideGlobalVariablesForTPL();
}
}
示例9: purchase
/**
* Вызов необходимого шага оформления заказа
* @param String $template
* @return Array
*/
public function purchase($template = 'default')
{
$this->loadPurchaseSteps();
list($tpl_block) = def_module::loadTemplates("emarket/" . $template, 'purchase');
$stage = getRequest('param0');
$step = getRequest('param1');
$mode = getRequest('param2');
$order = $this->getBasketOrder();
if ($order->isEmpty() && $stage != 'result') {
throw new publicException('%error-market-empty-basket%');
}
$stage = self::getStage($stage);
if (sizeof(self::$purchaseSteps) == 2 && $stage == 'result' && !getRequest('param0')) {
$stage = '';
}
$controller = cmsController::getInstance();
if (!$stage) {
$order->order();
$urlPrefix = $controller->getUrlPrefix() ? $controller->getUrlPrefix() . '/' : '';
$this->redirect($this->pre_lang . '/' . $urlPrefix . 'emarket/purchase/result/successful/');
}
$checkStepMethod = $stage . 'CheckStep';
$step = $this->{$checkStepMethod}($order, $step);
if (!$step) {
$urlPrefix = $controller->getUrlPrefix() ? $controller->getUrlPrefix() . '/' : '';
$this->redirect($this->pre_lang . '/' . $urlPrefix . 'emarket/purchase/' . $stage . '/choose/');
}
$stageResult = $this->{$stage}($order, $step, $mode, $template);
$result = array('purchasing' => array('attribute:stage' => $stage, 'attribute:step' => $step));
$this->setHeader("%header-{$stage}-{$step}%");
if (is_array($stageResult)) {
$result['purchasing'] = array_merge($result['purchasing'], $stageResult);
} else {
if (!def_module::isXSLTResultMode()) {
$result['purchasing'] = $stageResult;
} else {
throw new publicException("Incorrect return value from {$stage}() purchasing method");
}
}
return def_module::parseTemplate($tpl_block, $result);
}
示例10: doSelection
public function doSelection($template = "default", $uselName)
{
$this->templatesMode('tpl');
$scheme_old = getRequest('scheme');
$params = func_get_args();
$params = array_slice($params, 2, sizeof($params) - 2);
$stream = new uselStream();
$result = $stream->call($uselName, $params);
$oldResultMode = def_module::isXSLTResultMode(false);
list($objects_block, $objects_line, $objects_empty, $elements_block, $elements_line, $elements_empty, $separator, $separator_last) = self::loadTemplates("data/usel/" . $template, "objects_block", "objects_block_line", "objects_block_empty", "elements_block", "elements_block_line", "elements_block_empty", "separator", "separator_last");
switch ($result['mode']) {
case "objects":
$tpl_block = $objects_block;
$tpl_line = $objects_line;
$tpl_empty = $objects_empty;
break;
case "pages":
$tpl_block = $elements_block;
$tpl_line = $elements_line;
$tpl_empty = $elements_empty;
break;
default:
throw new publicException("Unsupported return mode \"{$result['mode']}\"");
}
if ($result['sel'] instanceof selector) {
$sel = $result['sel'];
$results = $sel->result;
$total = $sel->length;
$limit = $sel->limit;
if ($total == 0) {
$tpl_block = $tpl_empty;
}
$objectsCollection = umiObjectsCollection::getInstance();
$hierarchy = umiHierarchy::getInstance();
$block_arr = array();
$lines = array();
$objectId = false;
$elementId = false;
$sz = sizeof($results);
$c = 0;
foreach ($results as $item) {
$line_arr = array();
if ($result['mode'] == "objects") {
$object = $item;
if ($object instanceof iUmiObject) {
$objectId = $object->id;
$line_arr['attribute:id'] = $object->id;
$line_arr['attribute:name'] = $object->getName();
$line_arr['attribute:type-id'] = $object->getTypeId();
$line_arr['xlink:href'] = "uobject://" . $objectId;
} else {
continue;
}
} else {
$element = $item;
if ($element instanceof iUmiHierarchyElement) {
$elementId = $element->id;
$line_arr['attribute:id'] = $element->id;
$line_arr['attribute:name'] = $element->getName();
$line_arr['attribute:link'] = $hierarchy->getPathById($element->id);
$line_arr['xlink:href'] = "upage://" . $element->id;
} else {
continue;
}
}
$line_arr['void:separator'] = $sz == $c + 1 && $separator_last ? $separator_last : $separator;
$lines[] = self::parseTemplate($tpl_line, $line_arr, $elementId, $objectId);
++$c;
}
$block_arr['subnodes:items'] = $lines;
$block_arr['total'] = $total;
$block_arr['per_page'] = $limit;
$result = self::parseTemplate($tpl_block, $block_arr);
def_module::isXSLTResultMode($oldResultMode);
return $result;
} else {
throw new publicException("Can't execute selection");
}
}
示例11: setIsInited
public function setIsInited($v22af645d1859cb5ca6da0c484f1f37ea)
{
return def_module::isXSLTResultMode($v22af645d1859cb5ca6da0c484f1f37ea);
}
示例12: renderBasket
public function renderBasket($v39f17319be96f2b5889115ba057e5c2a = "default")
{
if (!$v39f17319be96f2b5889115ba057e5c2a) {
$v39f17319be96f2b5889115ba057e5c2a = "default";
}
list($vf58ad3dd007a99ae7d915c495d9cad32, $v1939afb0d115f6754194039ec5cbec79, $v935e03f6c23aeace729a03e1fc6f3265, $v5eb14216753d182c5586aa87b9163a28) = def_module::loadTemplates("eshop/basket/{$v39f17319be96f2b5889115ba057e5c2a}", "basket", "basket_empty", "basket_item", "basket_new_item");
$vfca1bff8ad8b3a8585abfb0ad523ba42 = array();
$v906e631fd3cab146a7f686acb519cf5a = $this->recalcBasket();
$v906e631fd3cab146a7f686acb519cf5a = $this->recalcCurrency($v906e631fd3cab146a7f686acb519cf5a, $this->currencyInfo['exchange']);
if (isset($this->globalDiscount)) {
$v3bacb6f274aeafcc61c1e858b65914a5 = $this->recalcCurrency($this->globalDiscount, $this->currencyInfo['exchange']);
}
$vfca1bff8ad8b3a8585abfb0ad523ba42['void:order_price'] = number_format($v906e631fd3cab146a7f686acb519cf5a, $v906e631fd3cab146a7f686acb519cf5a - floor($v906e631fd3cab146a7f686acb519cf5a) > 0.005 ? 2 : 0, '.', '');
$vfca1bff8ad8b3a8585abfb0ad523ba42['subnodes:items'] = array();
$vfca1bff8ad8b3a8585abfb0ad523ba42['void:currency_symbol'] = $this->currencyInfo['symbol'];
$vfca1bff8ad8b3a8585abfb0ad523ba42['void:currency_choose'] = $this->renderCurrencyChooser();
if (isset($v3bacb6f274aeafcc61c1e858b65914a5)) {
$vfca1bff8ad8b3a8585abfb0ad523ba42['void:global_discount'] = number_format($v3bacb6f274aeafcc61c1e858b65914a5, $v3bacb6f274aeafcc61c1e858b65914a5 - floor($v3bacb6f274aeafcc61c1e858b65914a5) > 0.005 ? 2 : 0, '.', '');
} else {
$vfca1bff8ad8b3a8585abfb0ad523ba42['void:global_discount'] = 0;
}
$ve2942a04780e223b215eb8b663cf5353 = 0;
$v78a5eb43deef9a7b5b9ce157b9d52ac4 = 0;
if ($this->oUserBasket instanceof umiObject) {
$vdc7a98f1b58b3830d6bad4f2d3d7f80c = $this->oUserBasket->getValue('items');
$vd2bb979f7fab52c3ef9df04a5c695a42 = array();
foreach ($vdc7a98f1b58b3830d6bad4f2d3d7f80c as $v4871f4bb9cbe707fa1e58df3ca89e64c) {
$v937104c02a5902ba5850d12f4d9c3459 = umiObjectsCollection::getInstance()->getObject($v4871f4bb9cbe707fa1e58df3ca89e64c);
if ($v937104c02a5902ba5850d12f4d9c3459 instanceof umiObject) {
$v8e9156e0217af72801862c5f519b575a = $this->renderBasketItem($v937104c02a5902ba5850d12f4d9c3459, $v935e03f6c23aeace729a03e1fc6f3265, $ve2942a04780e223b215eb8b663cf5353, $v78a5eb43deef9a7b5b9ce157b9d52ac4);
if ($v8e9156e0217af72801862c5f519b575a !== false) {
$vfca1bff8ad8b3a8585abfb0ad523ba42['subnodes:items'][] = $v8e9156e0217af72801862c5f519b575a;
$vd2bb979f7fab52c3ef9df04a5c695a42[] = $v4871f4bb9cbe707fa1e58df3ca89e64c;
}
umiObjectsCollection::getInstance()->unloadObject($v4871f4bb9cbe707fa1e58df3ca89e64c);
}
}
$this->oUserBasket->setValue("items", $vd2bb979f7fab52c3ef9df04a5c695a42);
$this->oUserBasket->commit();
} else {
foreach ($this->arrBasket as $vc39bd8d80533e4c1195e806feddc6e33 => $v6ad9da766f68c8a186c7128f54dc2fe7) {
$v266dfb6190a3ce57973bce176a01701e = umiHierarchy::getInstance()->getElement($vc39bd8d80533e4c1195e806feddc6e33);
$vfca1bff8ad8b3a8585abfb0ad523ba42['subnodes:items'][] = $this->renderBasketItem($v266dfb6190a3ce57973bce176a01701e, $v935e03f6c23aeace729a03e1fc6f3265, $ve2942a04780e223b215eb8b663cf5353, $v78a5eb43deef9a7b5b9ce157b9d52ac4);
umiHierarchy::getInstance()->unloadElement($vc39bd8d80533e4c1195e806feddc6e33);
}
}
$vfca1bff8ad8b3a8585abfb0ad523ba42['attribute:order-id'] = $vfca1bff8ad8b3a8585abfb0ad523ba42['void:order_id'] = $this->iBasketOrderId;
$vfca1bff8ad8b3a8585abfb0ad523ba42['attribute:total-count'] = $vfca1bff8ad8b3a8585abfb0ad523ba42['void:total_count'] = $ve2942a04780e223b215eb8b663cf5353;
$v78a5eb43deef9a7b5b9ce157b9d52ac4 = $this->recalcCurrency($v78a5eb43deef9a7b5b9ce157b9d52ac4, $this->currencyInfo['exchange']);
$vfca1bff8ad8b3a8585abfb0ad523ba42['attribute:total-price'] = $vfca1bff8ad8b3a8585abfb0ad523ba42['void:total_price'] = number_format($v78a5eb43deef9a7b5b9ce157b9d52ac4, $v78a5eb43deef9a7b5b9ce157b9d52ac4 - floor($v78a5eb43deef9a7b5b9ce157b9d52ac4) > 0.005 ? 2 : 0, '.', '');
$v640eac53ad75db5c49a9ec86390d8530 = cmsController::getInstance()->getCurrentTemplater();
if (count($vfca1bff8ad8b3a8585abfb0ad523ba42['subnodes:items'])) {
if (def_module::isXSLTResultMode()) {
$vfca1bff8ad8b3a8585abfb0ad523ba42['subnodes:items'][] = $v5eb14216753d182c5586aa87b9163a28;
}
return def_module::parseTemplate($vf58ad3dd007a99ae7d915c495d9cad32, $vfca1bff8ad8b3a8585abfb0ad523ba42);
} else {
if (!def_module::isXSLTResultMode()) {
$vfca1bff8ad8b3a8585abfb0ad523ba42['subnodes:items'][] = $v5eb14216753d182c5586aa87b9163a28;
}
return def_module::parseTemplate($v1939afb0d115f6754194039ec5cbec79, $vfca1bff8ad8b3a8585abfb0ad523ba42);
}
}
示例13: subscribe_do
public function subscribe_do()
{
$sResult = "";
// input
$sSbsMail = trim(getRequest('sbs_mail'));
$sSbsLName = getRequest('sbs_lname');
$sSbsFName = getRequest('sbs_fname');
$iSbsGender = (int) getRequest('sbs_gender');
$sSbsFatherName = getRequest('sbs_father_name');
$arrSbsDispatches = getRequest('subscriber_dispatches');
if (is_array($arrSbsDispatches)) {
$arrSbsDispatches = array_map('intval', $arrSbsDispatches);
} else {
$arrSbsDispatches = array();
}
$controller = cmsController::getInstance();
$templater = $controller->getCurrentTemplater();
$oSubscriber = null;
// check user registred
$this->is_auth = false;
if ($oMdlUsers = $controller->getModule("users")) {
if ($oMdlUsers->is_auth()) {
$iUserId = (int) $oMdlUsers->user_id;
$this->is_auth = true;
$this->user_id = $iUserId;
if ($oUserObj = umiObjectsCollection::getInstance()->getObject($iUserId)) {
$sSbsMail = $oUserObj->getValue("e-mail");
$sSbsLName = $oUserObj->getValue("lname");
$sSbsFName = $oUserObj->getValue("fname");
$sSbsFatherName = $oUserObj->getValue("father_name");
$iSbsGender = $oUserObj->getValue("gender");
}
$oSubscriber = self::getSubscriberByUserId($iUserId);
} elseif (umiMail::checkEmail($sSbsMail)) {
$oSubscriber = self::getSubscriberByMail($sSbsMail);
$arrSbsDispatches = self::getAllDispatches();
} else {
$sResult = "%subscribe_incorrect_email%";
return !def_module::isXSLTResultMode() ? $sResult : array("result" => $sResult);
}
if (!$oSubscriber instanceof umiObject && !empty($sSbsMail)) {
$oSubscriber = self::getSubscriberByMail($sSbsMail);
}
} elseif (!umiMail::checkEmail($sSbsMail)) {
$sResult = "%subscribe_incorrect_email%";
return !def_module::isXSLTResultMode() ? $sResult : array("result" => $sResult);
}
if ($oSubscriber instanceof umiObject) {
$iSbsObjId = $oSubscriber->getId();
if (!$this->is_auth) {
list($template_block) = def_module::loadTemplates("dispatches/default", "subscribe_guest_alredy_subscribed");
$block_arr = array();
$block_arr['unsubscribe_link'] = $this->pre_lang . "/dispatches/unsubscribe/" . $oSubscriber->getId() . "/?email=" . $oSubscriber->name;
return def_module::parseTemplate($template_block, $block_arr);
}
} else {
// create sbs
$iSbsHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "subscriber")->getId();
$iSbsTypeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iSbsHierarchyTypeId);
$iSbsObjId = umiObjectsCollection::getInstance()->addObject($sSbsMail, $iSbsTypeId);
}
if (count($arrSbsDispatches)) {
$from = regedit::getInstance()->getVal("//settings/fio_from");
$from_email = regedit::getInstance()->getVal("//settings/email_from");
list($template_mail, $template_mail_subject) = def_module::loadTemplatesForMail("dispatches/default", "subscribe_confirm", "subscribe_confirm_subject");
$mail_arr = array();
$mail_arr['domain'] = $domain = $_SERVER['HTTP_HOST'];
$mail_arr['unsubscribe_link'] = "http://" . $domain . $this->pre_lang . "/dispatches/unsubscribe/" . $iSbsObjId . "/?email=" . $sSbsMail;
$mail_subject = def_module::parseTemplateForMail($template_mail_subject, $mail_arr);
$mail_content = def_module::parseTemplateForMail($template_mail, $mail_arr);
$confirmMail = new umiMail();
$confirmMail->addRecipient($sSbsMail);
$confirmMail->setFrom($from_email, $from);
$confirmMail->setSubject($mail_subject);
$confirmMail->setContent($mail_content);
$confirmMail->commit();
}
// try get object
$oSubscriber = umiObjectsCollection::getInstance()->getObject($iSbsObjId);
if ($oSubscriber instanceof umiObject) {
$oSubscriber->setName($sSbsMail);
$oSubscriber->setValue('lname', $sSbsLName);
$oSubscriber->setValue('fname', $sSbsFName);
$oSubscriber->setValue('father_name', $sSbsFatherName);
$oCurrDate = new umiDate(time());
$oSubscriber->setValue('subscribe_date', $oCurrDate);
$oSubscriber->setValue('gender', $iSbsGender);
if ($this->is_auth) {
$oSubscriber->setValue('uid', $this->user_id);
$oSubscriber->setValue('subscriber_dispatches', $arrSbsDispatches);
$sDispForm = "%subscribe_subscribe_user%:<br /><ul>%rows%</ul>";
$sDispFormRow = "<li>%disp_name%</li>";
$sResult = self::parseDispatches($sDispForm, $sDispFormRow, $arrSbsDispatches, true);
} else {
// subscriber has all dispatches
$oSubscriber->setValue('subscriber_dispatches', $arrSbsDispatches);
$sResult = "%subscribe_subscribe%";
}
$oSubscriber->commit();
}
//.........这里部分代码省略.........
示例14: post
public function post($template = "default")
{
if (!$template) {
$template = getRequest('template');
}
if (!$template) {
$template = "default";
}
if (!def_module::isXSLTResultMode()) {
list($template_block, $template_block_voted, $template_block_closed, $template_block_ok) = def_module::loadTemplates("vote/" . $template, "js_block", "js_block_voted", "js_block_closed", "js_block_ok");
} else {
list($template_block, $template_block_voted, $template_block_closed, $template_block_ok) = array(false, false, false, false);
}
$item_id = (int) getRequest('param0');
$item = umiObjectsCollection::getInstance()->getObject($item_id);
$referer_url = getServer("HTTP_REFERER") ? getServer("HTTP_REFERER") : "/";
$this->errorRegisterFailPage($referer_url);
if (!$item instanceof umiObject) {
$this->errorNewMessage(getLabel('error-page-does-not-exist', null, ''));
$this->errorPanic();
}
$poll_rel = $item->getValue("poll_rel");
$object_id = $poll_rel;
$object = umiObjectsCollection::getInstance()->getObject($object_id);
if (!$object instanceof umiObject) {
$this->errorNewMessage(getLabel('error-page-does-not-exist', null, ''));
$this->errorPanic();
}
if ($this->checkIsVoted($object_id)) {
$res = $template_block_voted ? $template_block_voted : "Вы уже проголосовали";
} else {
if ($object->getValue("is_closed")) {
$res = $template_block_closed ? $template_block_closed : "Ошибка. Голосование не активно, либо закрыто.";
} else {
$count = $item->getValue("count");
$item->setValue("count", ++$count);
$item->setValue("poll_rel", $poll_rel);
$item->commit();
if ($this->is_private) {
$oUsersMdl = cmsController::getInstance()->getModule("users");
if ($oUsersMdl) {
$oUser = umiObjectsCollection::getInstance()->getObject($oUsersMdl->user_id);
if ($oUser instanceof umiObject) {
$arrRatedPages = $oUser->getValue("rated_pages");
$arrRatedPagesIds = array();
foreach ($arrRatedPages as $vVal) {
if ($vVal instanceof umiHierarchyElement) {
$arrRatedPagesIds[] = intval($vVal->getId());
} else {
$arrRatedPagesIds[] = intval($vVal);
}
}
$arrVotePages = umiHierarchy::getInstance()->getObjectInstances($object_id);
$arrVotePages = array_map("intval", $arrVotePages);
$arrRated = array_merge($arrRatedPagesIds, $arrVotePages);
$oUser->setValue("rated_pages", array_unique($arrRated));
$oUser->commit();
}
}
}
$oEventPoint = new umiEventPoint("pollPost");
$oEventPoint->setMode("after");
$oEventPoint->setParam("poll", $object);
$oEventPoint->setParam("answer", $item);
$this->setEventPoint($oEventPoint);
$res = $template_block_ok ? $template_block_ok : "Ваше мнение учтено";
}
if (!isset($_SESSION['vote_polled']) || !is_array($_SESSION['vote_polled'])) {
$_SESSION['vote_polled'] = array();
}
}
$_SESSION['vote_polled'][] = $object_id;
$res = def_module::parseTPLMacroses($res);
if ($template_block) {
$block_arr = array();
$block_arr['res'] = $res;
$r = $this->parseTemplate($template_block, $block_arr);
$this->flush($r, "text/javascript");
} else {
$this->flush("alert('{$res}');", "text/javascript");
}
}
示例15: posted
public function posted($template = false)
{
$templater = cmsController::getInstance()->getCurrentTemplater();
$template = $template ? $template : (string) getRequest('template');
$template = $template ? $template : (string) getRequest('param0');
$res = false;
if ($template && is_numeric($template)) {
$sel = new selector('objects');
$sel->types('object-type')->name('webforms', 'template');
$sel->where('form_id')->equals($template);
$sel->limit(0, 1);
if ($sel->result) {
$oTemplate = $sel->result[0];
$res = $oTemplate->getValue('posted_message');
}
if (!$res && !def_module::isXSLTResultMode()) {
try {
list($template) = $this->loadTemplates("./tpls/webforms/" . $template, "posted");
$res = $template;
} catch (publicException $e) {
}
}
}
if (!$res) {
if (defined('CURRENT_VERSION_LINE') && CURRENT_VERSION_LINE == 'demo') {
$res = "%webforms_thank_you_demo%";
} else {
$res = "%webforms_thank_you%";
}
}
return $templater->putLangs($res);
}