public function setValue($v2063c1608d6e0baf80249c42e2be5804)
 {
     if (is_array($v2063c1608d6e0baf80249c42e2be5804)) {
         $v2063c1608d6e0baf80249c42e2be5804 = array_distinct($v2063c1608d6e0baf80249c42e2be5804);
     }
     parent::setValue($v2063c1608d6e0baf80249c42e2be5804);
 }
Example #2
0
 public static function convert($v341be97d9aff90c9978347f66f945b77, $va0f0bc95016c862498bbad29d1f4d9d4 = '_')
 {
     if (!$va0f0bc95016c862498bbad29d1f4d9d4) {
         $va0f0bc95016c862498bbad29d1f4d9d4 = '_';
     }
     $v341be97d9aff90c9978347f66f945b77 = umiObjectProperty::filterInputString($v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = str_replace(self::$fromLower, self::$toLower, $v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = str_replace(self::$fromUpper, self::$toLower, $v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = strtolower($v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = preg_replace("/([^A-z0-9_\\-]+)/", $va0f0bc95016c862498bbad29d1f4d9d4, $v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = preg_replace("/[\\/\\\\',\t`\\^\\[\\]]*/", "", $v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = str_replace(chr(8470), "", $v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = preg_replace("/[ \\.]+/", $va0f0bc95016c862498bbad29d1f4d9d4, $v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = preg_replace("/([" . $va0f0bc95016c862498bbad29d1f4d9d4 . "]+)/", $va0f0bc95016c862498bbad29d1f4d9d4, $v341be97d9aff90c9978347f66f945b77);
     $v341be97d9aff90c9978347f66f945b77 = trim(trim($v341be97d9aff90c9978347f66f945b77), $va0f0bc95016c862498bbad29d1f4d9d4);
     return $v341be97d9aff90c9978347f66f945b77;
 }
 public function tags_mk_cloud($i_domain_id = NULL, $s_template = "tags", $i_per_page = -1, $b_ignore_paging = true, $b_by_usage = false, $arr_users = array())
 {
     // init and context :
     $s_tpl_tags = "cloud_tags";
     $s_tpl_tag = "cloud_tag";
     $s_tpl_tag_sep = "cloud_tagseparator";
     $s_tpl_tags_empty = "cloud_tags_empty";
     // validate input :
     if (!$arr_users || intval($arr_users) === -1 || strval($arr_users) === 'all' || $arr_users == "Все") {
         $arr_users = array();
     }
     if (is_int($arr_users)) {
         $arr_users = array(intval($arr_users));
     } elseif (is_array($arr_users)) {
         $arr_users = array_map('intval', $arr_users);
     } else {
         $arr_users = array(intval(strval($arr_users)));
     }
     $i_per_page = intval($i_per_page);
     if (!$i_per_page) {
         $i_per_page = 10;
     }
     if ($i_per_page === -1) {
         $b_ignore_paging = true;
     }
     $s_template = strval($s_template);
     if (!strlen($s_template)) {
         $s_template = "tags";
     }
     $i_curr_page = intval(getRequest('p'));
     if ($b_ignore_paging) {
         $i_curr_page = 0;
     }
     // load templates :
     list($tpl_tags, $tpl_tag, $tpl_tag_sep, $tpl_tags_empty) = $this->loadTemplates("content/" . $s_template, $s_tpl_tags, $s_tpl_tag, $s_tpl_tag_sep, $s_tpl_tags_empty);
     // process :
     $max_font_size = 32;
     $min_font_size = 10;
     //
     $s_prefix = '';
     //
     if ($b_by_usage) {
         $o_object_type = umiObjectTypesCollection::getInstance()->getTypeByGUID('root-pages-type');
         $i_tags_field_id = $o_object_type->getFieldId('tags');
         //
         $result = umiObjectProperty::objectsByValue($i_tags_field_id, 'all', true, true, $i_domain_id ? $i_domain_id : -1);
     } else {
         $stat = cmsController::getInstance()->getModule('stat');
         $sStatIncPath = dirname(dirname(dirname(dirname(__FILE__)))) . '/stat/classes';
         if (class_exists("statisticFactory") == false) {
             return;
         }
         $factory = new statisticFactory($sStatIncPath);
         $factory->isValid('allTags');
         $report = $factory->get('allTags');
         if ($i_domain_id) {
             $s_prefix = 'Domain';
             $v_domains = $report->setDomain($i_domain_id);
         } else {
             $s_prefix = 'Account';
             $v_domains = $report->setDomain(-1);
         }
         if (is_array($arr_users) && count($arr_users)) {
             $report->setUserIDs($arr_users);
         }
         $result = $report->get();
     }
     if (isset($result['values']) && is_array($result['values'])) {
         natsort2d($result['values'], "cnt");
         $result['values'] = array_slice($result['values'], -$i_per_page, $i_per_page);
         natsort2d($result['values'], "value");
     }
     $max = intval($result['max']);
     $sum = intval($result['sum']);
     $arrTags = array();
     $s_values_label = $b_by_usage ? 'values' : 'labels';
     $s_value_label = $b_by_usage ? 'value' : 'tag';
     $s_value_cnt = 'cnt';
     $sz = sizeof($result[$s_values_label]);
     for ($i = 0; $i < $sz; $i++) {
         $label = $result[$s_values_label][$i];
         $tag = $label[$s_value_label];
         if (is_null($tag)) {
             continue;
         }
         //$tag = '[nontagged]';
         $cnt = intval($label[$s_value_cnt]);
         $f_weight = round($cnt * 100 / $sum, 1);
         $font_size = round(($max_font_size - $min_font_size) / 100 * $f_weight + $min_font_size);
         $arrTags[$tag] = array('weight' => $f_weight, 'font' => $font_size);
     }
     //
     $summ_weight = 0;
     if (count($arrTags)) {
         $arrTagsTplteds = array();
         foreach ($arrTags as $sTag => $arrTagStat) {
             $summ_weight += $arrTagStat['weight'];
             $params = array('tag' => $sTag, 'tag_urlencoded' => rawurlencode($sTag), 'attribute:weight' => $arrTagStat['weight'], 'attribute:font' => $arrTagStat['font'], 'attribute:context' => $s_prefix);
             $arrTagsTplteds[] = def_module::parseTemplate($tpl_tag, $params);
         }
         if (isset($arrTagsTplteds[0]) && is_array($arrTagsTplteds[0])) {
             // udata
             $arrForTags = array('subnodes:items' => $arrTagsTplteds);
         } else {
             // not udata
             $arrForTags = array('items' => implode($tpl_tag_sep, $arrTagsTplteds));
         }
         //
         $arrForTags['attribute:summ_weight'] = ceil($summ_weight);
         $arrForTags['attribute:context'] = $s_prefix;
         // RETURN
         return def_module::parseTemplate($tpl_tags, $arrForTags);
     } else {
         $arrForTags = array();
         // RETURN
         return def_module::parseTemplate($tpl_tags_empty, $arrForTags);
     }
 }
 public function __destruct()
 {
     umiObjectProperty::$USE_FORCE_OBJECTS_CREATION = $this->forceObjectCreation;
     $this->closeFile();
 }
Example #5
0
 public function tryPreAuth()
 {
     $v870fd5468174f846789cb0d56d95bed7 = "";
     $v61b14997da4f52f41ee7b0d90f09e670 = "";
     $ve218c54eefdbe103350435489a6595cb = "";
     $v2b2dccfdbf6e767de8512d66da6d18ca = 'u-login';
     $vad1ffbcb1d643a30a5f6cc9950526e81 = 'u-password';
     $ve57492e1c3bb8975edf9399351741cf8 = 'u-password-md5';
     $v0a7cb1c6ec211bc445c36725ebfb7bab = 'u-session-id';
     $v50b6116b0f49a6cb34e310d17da0ccc4 = ini_get("session.name");
     if ($v870fd5468174f846789cb0d56d95bed7 = getCookie($v2b2dccfdbf6e767de8512d66da6d18ca)) {
         if ($v61b14997da4f52f41ee7b0d90f09e670 = getCookie($vad1ffbcb1d643a30a5f6cc9950526e81)) {
             $v61b14997da4f52f41ee7b0d90f09e670 = md5($v61b14997da4f52f41ee7b0d90f09e670);
         } else {
             $v61b14997da4f52f41ee7b0d90f09e670 = getCookie($ve57492e1c3bb8975edf9399351741cf8);
         }
     }
     if (function_exists('apache_request_headers')) {
         $v47722c9511693b9a32d48982e48a7b9b = apache_request_headers();
         if (isset($v47722c9511693b9a32d48982e48a7b9b[$v2b2dccfdbf6e767de8512d66da6d18ca])) {
             $v870fd5468174f846789cb0d56d95bed7 = umiObjectProperty::filterInputString(str_replace(chr(0), "", $v47722c9511693b9a32d48982e48a7b9b[$v2b2dccfdbf6e767de8512d66da6d18ca]));
         }
         if (isset($v47722c9511693b9a32d48982e48a7b9b[$ve57492e1c3bb8975edf9399351741cf8])) {
             $v61b14997da4f52f41ee7b0d90f09e670 = umiObjectProperty::filterInputString(str_replace(chr(0), "", $v47722c9511693b9a32d48982e48a7b9b[$ve57492e1c3bb8975edf9399351741cf8]));
         } elseif (isset($v47722c9511693b9a32d48982e48a7b9b[$vad1ffbcb1d643a30a5f6cc9950526e81])) {
             $v61b14997da4f52f41ee7b0d90f09e670 = md5(umiObjectProperty::filterInputString(str_replace(chr(0), "", $v47722c9511693b9a32d48982e48a7b9b[$vad1ffbcb1d643a30a5f6cc9950526e81])));
         }
         if (isset($v47722c9511693b9a32d48982e48a7b9b[$v0a7cb1c6ec211bc445c36725ebfb7bab])) {
             $ve218c54eefdbe103350435489a6595cb = umiObjectProperty::filterInputString(str_replace(chr(0), "", $v47722c9511693b9a32d48982e48a7b9b[$v0a7cb1c6ec211bc445c36725ebfb7bab]));
         }
     }
     if (isset($_POST[$v2b2dccfdbf6e767de8512d66da6d18ca])) {
         $v870fd5468174f846789cb0d56d95bed7 = umiObjectProperty::filterInputString(str_replace(chr(0), "", $_POST[$v2b2dccfdbf6e767de8512d66da6d18ca]));
     }
     if (isset($_POST[$ve57492e1c3bb8975edf9399351741cf8])) {
         $v61b14997da4f52f41ee7b0d90f09e670 = umiObjectProperty::filterInputString(str_replace(chr(0), "", $_POST[$ve57492e1c3bb8975edf9399351741cf8]));
     } elseif (isset($_POST[$vad1ffbcb1d643a30a5f6cc9950526e81])) {
         $v61b14997da4f52f41ee7b0d90f09e670 = md5(umiObjectProperty::filterInputString(str_replace(chr(0), "", $_POST[$vad1ffbcb1d643a30a5f6cc9950526e81])));
     }
     if (isset($_POST[$v0a7cb1c6ec211bc445c36725ebfb7bab])) {
         $ve218c54eefdbe103350435489a6595cb = umiObjectProperty::filterInputString(str_replace(chr(0), "", $_POST[$v0a7cb1c6ec211bc445c36725ebfb7bab]));
     }
     if (isset($_GET[$v2b2dccfdbf6e767de8512d66da6d18ca])) {
         $v870fd5468174f846789cb0d56d95bed7 = umiObjectProperty::filterInputString(str_replace(chr(0), "", $_GET[$v2b2dccfdbf6e767de8512d66da6d18ca]));
     }
     if (isset($_GET[$ve57492e1c3bb8975edf9399351741cf8])) {
         $v61b14997da4f52f41ee7b0d90f09e670 = umiObjectProperty::filterInputString(str_replace(chr(0), "", $_GET[$ve57492e1c3bb8975edf9399351741cf8]));
     } elseif (isset($_GET[$vad1ffbcb1d643a30a5f6cc9950526e81])) {
         $v61b14997da4f52f41ee7b0d90f09e670 = md5(umiObjectProperty::filterInputString(str_replace(chr(0), "", $_GET[$vad1ffbcb1d643a30a5f6cc9950526e81])));
     }
     if (isset($_GET[$v0a7cb1c6ec211bc445c36725ebfb7bab])) {
         $ve218c54eefdbe103350435489a6595cb = umiObjectProperty::filterInputString(str_replace(chr(0), "", $_GET[$v0a7cb1c6ec211bc445c36725ebfb7bab]));
     }
     if (strlen($v870fd5468174f846789cb0d56d95bed7) && strlen($v61b14997da4f52f41ee7b0d90f09e670)) {
         $vf5b788937450a693e6cbec05d8b8b13f = umiObjectTypesCollection::getInstance()->getBaseType("users", "user");
         $v8636cb7e3d45cd4e1e8e863d3286393e = umiObjectTypesCollection::getInstance()->getType($vf5b788937450a693e6cbec05d8b8b13f);
         $v8f671407d6df210b2670166a82e0fc1a = $v8636cb7e3d45cd4e1e8e863d3286393e->getFieldId("login");
         $v98fc9fb0068cf0cdca3ce2e0cb0843d6 = $v8636cb7e3d45cd4e1e8e863d3286393e->getFieldId("password");
         $v713d1619aba4eeb6679aec2b499e1b33 = $v8636cb7e3d45cd4e1e8e863d3286393e->getFieldId("is_activated");
         $v8be74552df93e31bbdd6b36ed74bdb6a = new umiSelection();
         $v8be74552df93e31bbdd6b36ed74bdb6a->setLimitFilter();
         $v8be74552df93e31bbdd6b36ed74bdb6a->addLimit(1);
         $v8be74552df93e31bbdd6b36ed74bdb6a->setObjectTypeFilter();
         $v8be74552df93e31bbdd6b36ed74bdb6a->addObjectType($vf5b788937450a693e6cbec05d8b8b13f);
         $v8be74552df93e31bbdd6b36ed74bdb6a->setPropertyFilter();
         $v8be74552df93e31bbdd6b36ed74bdb6a->addPropertyFilterEqual($v8f671407d6df210b2670166a82e0fc1a, $v870fd5468174f846789cb0d56d95bed7);
         $v8be74552df93e31bbdd6b36ed74bdb6a->addPropertyFilterEqual($v98fc9fb0068cf0cdca3ce2e0cb0843d6, $v61b14997da4f52f41ee7b0d90f09e670);
         $v8be74552df93e31bbdd6b36ed74bdb6a->addPropertyFilterEqual($v713d1619aba4eeb6679aec2b499e1b33, 1);
         $result = umiSelectionsParser::runSelection($v8be74552df93e31bbdd6b36ed74bdb6a);
         if (sizeof($result) === 1) {
             $vbc8a7343779d62b3f0dc86f78848bde1 = intval($result[0]);
             if (!session_id()) {
                 session_start();
             }
             $vc87c62534434262e1d1c1348215684ef = session_id();
             system_runSession();
             if (strlen($vc87c62534434262e1d1c1348215684ef) && isset($_SESSION) && isset($_SESSION['cms_login']) && isset($_SESSION['cms_pass']) && isset($_SESSION['user_id']) && $_SESSION['cms_login'] === $v870fd5468174f846789cb0d56d95bed7 && $_SESSION['cms_pass'] === $v61b14997da4f52f41ee7b0d90f09e670 && $_SESSION['user_id'] === $vbc8a7343779d62b3f0dc86f78848bde1) {
                 $_SESSION['starttime'] = time();
                 return self::PREAUTH_ALREADY;
             }
             if (strlen($ve218c54eefdbe103350435489a6595cb)) {
                 if (strlen($vc87c62534434262e1d1c1348215684ef)) {
                     session_destroy();
                 }
                 session_id($ve218c54eefdbe103350435489a6595cb);
                 session_start();
                 $_SESSION['starttime'] = time();
                 if (!(isset($_SESSION['cms_login']) && isset($_SESSION['cms_pass']) && isset($_SESSION['user_id']) && $_SESSION['cms_login'] === $v870fd5468174f846789cb0d56d95bed7 && $_SESSION['cms_pass'] === $v61b14997da4f52f41ee7b0d90f09e670 && $_SESSION['user_id'] === $vbc8a7343779d62b3f0dc86f78848bde1)) {
                     session_destroy();
                 } else {
                     $vd69634a59b2cc5df7d632e48474afc94 = new umiEventPoint("users_prelogin_successfull");
                     $vd69634a59b2cc5df7d632e48474afc94->setParam("prelogin_mode", self::PREAUTH_SUCCESS_RESTORE);
                     $vd69634a59b2cc5df7d632e48474afc94->setParam("user_id", $vbc8a7343779d62b3f0dc86f78848bde1);
                     umiEventsController::getInstance()->callEvent($vd69634a59b2cc5df7d632e48474afc94);
                     return self::PREAUTH_SUCCESS_RESTORE;
                 }
             } else {
                 @session_start();
                 $_SESSION['cms_login'] = $v870fd5468174f846789cb0d56d95bed7;
                 $_SESSION['cms_pass'] = $v61b14997da4f52f41ee7b0d90f09e670;
                 $_SESSION['user_id'] = $vbc8a7343779d62b3f0dc86f78848bde1;
                 $v41275a535677f79ff347e01bc530c176 = permissionsCollection::getInstance();
                 if ($v41275a535677f79ff347e01bc530c176->isSv($vbc8a7343779d62b3f0dc86f78848bde1)) {
                     $_SESSION['user_is_sv'] = true;
                 }
                 session_commit();
                 session_start();
                 $_SESSION['starttime'] = time();
                 $vd69634a59b2cc5df7d632e48474afc94 = new umiEventPoint("users_prelogin_successfull");
                 $vd69634a59b2cc5df7d632e48474afc94->setParam("prelogin_mode", self::PREAUTH_SUCCESS_NEW);
                 $vd69634a59b2cc5df7d632e48474afc94->setParam("user_id", $vbc8a7343779d62b3f0dc86f78848bde1);
                 umiEventsController::getInstance()->callEvent($vd69634a59b2cc5df7d632e48474afc94);
                 if (isset($_REQUEST['u-login-store']) && (intval($_REQUEST['u-login-store']) || strtoupper($_REQUEST['u-login-store']) === 'ON')) {
                     setcookie($v2b2dccfdbf6e767de8512d66da6d18ca, $v870fd5468174f846789cb0d56d95bed7, time() + 60 * 60 * 24 * 31, "/");
                     setcookie($ve57492e1c3bb8975edf9399351741cf8, $v61b14997da4f52f41ee7b0d90f09e670, time() + 60 * 60 * 24 * 31, "/");
                 }
                 return self::PREAUTH_SUCCESS_NEW;
             }
         }
     }
     return self::PREAUTH_INVALID;
 }
Example #6
0
 /**
  * @desc Выводит содержимое публикации
  * @param int $postId Идентификатор публикации
  * @param string $template имя файла шаблона
  * @return string|array
  */
 public function postView($postId = false, $template = 'default')
 {
     $userId = cmsController::getInstance()->getModule('users')->user_id;
     if (!$postId) {
         $postId = ($tmp = getRequest('param0')) ? $tmp : $postId;
     }
     if ($postId === false) {
         $this->redirect(getServer('HTTP_REFERER'));
     }
     $postId = umiObjectProperty::filterInputString($postId);
     list($sTemplate) = self::loadTemplates('blogs20/' . $template, 'post_view');
     $oHierarchy = umiHierarchy::getInstance();
     $oPost = $oHierarchy->getElement($postId);
     if (!$oPost) {
         throw new publicException(getLabel('error-page-does-not-exist', null, $postId));
     }
     if ($oPost->getTypeId() != umiHierarchyTypesCollection::getInstance()->getTypeByName("blogs20", "post")->getId()) {
         throw new publicException("The id(#{$postId}) given is not an id of the blog's post");
     }
     if (!$oPost->getIsActive() && $oPost->getObject()->getOwnerId() != $userId) {
         $this->redirect('/blogs20/draughtsList/');
     }
     $oBlog = $oHierarchy->getElement($oPost->getRel());
     $sPostLink = $oHierarchy->getPathById($postId, true);
     $sBlogLink = $oHierarchy->getPathById($oBlog->getId(), true);
     $aParams = array();
     $aParams['name'] = $oPost->getName();
     $aParams['content'] = $this->prepareContent(system_parse_short_calls($oPost->getValue('content'), $postId));
     $aParams['pid'] = $postId;
     $aParams['bid'] = $oBlog->getId();
     $aParams['blog_title'] = $oBlog->getValue('title');
     $aParams['blog_name'] = $oBlog->getName();
     $aParams['post_link'] = $sPostLink;
     $aParams['blog_link'] = $sBlogLink;
     $aParams['author_id'] = $oPost->getObject()->getOwnerId();
     //		$aParams['publish_time'] = $oPost->getValue('publish_time')->getFormattedDate('U');
     $this->pushEditable("blogs20", "post", $postId);
     return self::parseTemplate($sTemplate, $aParams, $postId);
 }
 public function setTitle($vd5d3db1765287eef77d7927cc956f50a)
 {
     $vd5d3db1765287eef77d7927cc956f50a = $this->translateI18n($vd5d3db1765287eef77d7927cc956f50a, "fields-group");
     $this->title = umiObjectProperty::filterInputString($vd5d3db1765287eef77d7927cc956f50a);
     $this->setIsUpdated();
 }
Example #8
0
 public function setTip($v6a2139364f96787c8ce1bbb0070b898c)
 {
     $this->tip = umiObjectProperty::filterInputString($v6a2139364f96787c8ce1bbb0070b898c);
     $this->setIsUpdated();
 }
 protected function importElement($vfc07ae6b81515e9c73cb36ac08488ca1)
 {
     $this->importedElements += 1;
     $v2114c8075d855b3cea53d5d880c68948 = $vfc07ae6b81515e9c73cb36ac08488ca1['old_element_id'];
     $v75cacdb2219ff0da09cc2f909ea64759 = $vfc07ae6b81515e9c73cb36ac08488ca1['old_element_object_id'];
     $v777ccf80e4e83a9e7cdddd6ebc1edff7 = umiImportRelations::getInstance()->getNewIdRelation($this->source_id, $v2114c8075d855b3cea53d5d880c68948);
     $v161c9aaa4fe035e7b2f465bc59f3ab45 = new umiEventPoint("import_element");
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setMode("before");
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("new_element_id", $v777ccf80e4e83a9e7cdddd6ebc1edff7);
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("old_element_id", $v2114c8075d855b3cea53d5d880c68948);
     $v161c9aaa4fe035e7b2f465bc59f3ab45->addRef("element_info", $vfc07ae6b81515e9c73cb36ac08488ca1);
     $v161c9aaa4fe035e7b2f465bc59f3ab45->addRef("props", $this->xml_objects[$v75cacdb2219ff0da09cc2f909ea64759]['props']);
     umiEventsController::getInstance()->callEvent($v161c9aaa4fe035e7b2f465bc59f3ab45);
     $v28b2e67839ab215dcac5f868963f2bcb = $vfc07ae6b81515e9c73cb36ac08488ca1['old_parent_id'];
     $this->importedElementsArr[] = $v2114c8075d855b3cea53d5d880c68948;
     $v10b04069381b2fef4e0a41e0ea65b914 = $vfc07ae6b81515e9c73cb36ac08488ca1['element_name'];
     $v9c668e7b8b95154aabe003bcfd8e15df = $vfc07ae6b81515e9c73cb36ac08488ca1['old_element_alt_name'];
     $v2741adf691b2acf0359a6a73234bc605 = $vfc07ae6b81515e9c73cb36ac08488ca1['old_type_id'];
     $v53f070b923b86cc3c1b95e9950674c7c = $vfc07ae6b81515e9c73cb36ac08488ca1['element_is_active'];
     $v712546bad453a4d99cb79be316f6e64b = $vfc07ae6b81515e9c73cb36ac08488ca1['element_is_visible'];
     $v25f5c3dfce7a3048a8e9f70bad15bdd3 = $vfc07ae6b81515e9c73cb36ac08488ca1['element_is_deleted'];
     if ($v9c668e7b8b95154aabe003bcfd8e15df) {
         $vd84ff935144e00c3e1d395c2379aca47 = $v9c668e7b8b95154aabe003bcfd8e15df;
     } else {
         $vd84ff935144e00c3e1d395c2379aca47 = $v10b04069381b2fef4e0a41e0ea65b914;
     }
     $vd84ff935144e00c3e1d395c2379aca47 = translit::convert($vd84ff935144e00c3e1d395c2379aca47);
     if ($v25f5c3dfce7a3048a8e9f70bad15bdd3 !== NULL) {
         if ($v25f5c3dfce7a3048a8e9f70bad15bdd3) {
             umiHierarchy::getInstance()->delElement($v777ccf80e4e83a9e7cdddd6ebc1edff7);
             $this->importLog[] = "Element \"" . $v10b04069381b2fef4e0a41e0ea65b914 . "\" (" . $v2114c8075d855b3cea53d5d880c68948 . ") has been deleted";
             $this->deletedElements++;
             return true;
         }
     }
     if ($v28b2e67839ab215dcac5f868963f2bcb === "0") {
         $v0a4066771994dd2315e8a742e4de72fc = $v28b2e67839ab215dcac5f868963f2bcb;
     } else {
         $v0a4066771994dd2315e8a742e4de72fc = umiImportRelations::getInstance()->getNewIdRelation($this->source_id, $v28b2e67839ab215dcac5f868963f2bcb);
     }
     if ($v0a4066771994dd2315e8a742e4de72fc === false) {
         $v0a4066771994dd2315e8a742e4de72fc = $this->destination_element_id;
     }
     $v3252048a9dc6701c34b83c15c5be40f7 = false;
     if ($v777ccf80e4e83a9e7cdddd6ebc1edff7 === false && $v0a4066771994dd2315e8a742e4de72fc !== false) {
         $v555b8759c62b778531f7d10a1cfc1252 = $vfc07ae6b81515e9c73cb36ac08488ca1['new_domain_id'];
         $ve795657a63adabb22cdc79a959474fdd = $vfc07ae6b81515e9c73cb36ac08488ca1['new_lang_id'];
         $v5b4c55fc70f920b984055561aff116b3 = $vfc07ae6b81515e9c73cb36ac08488ca1['element_hierarchy_type_id'];
         $ve274c3c0bb91d6582078fbbce8f388f6 = $vfc07ae6b81515e9c73cb36ac08488ca1['new_tpl_id'];
         $v69203671ddb68b3848f87700fe06de55 = $vfc07ae6b81515e9c73cb36ac08488ca1['new_type_id'];
         $v616300e8f201203152145e6776ad27d1 = umiImportRelations::getInstance()->getNewIdRelation($this->source_id, $v28b2e67839ab215dcac5f868963f2bcb);
         $v777ccf80e4e83a9e7cdddd6ebc1edff7 = umiHierarchy::getInstance()->addElement($v0a4066771994dd2315e8a742e4de72fc, $v5b4c55fc70f920b984055561aff116b3, $v10b04069381b2fef4e0a41e0ea65b914, $vd84ff935144e00c3e1d395c2379aca47, $v69203671ddb68b3848f87700fe06de55, $v555b8759c62b778531f7d10a1cfc1252, $ve795657a63adabb22cdc79a959474fdd, $ve274c3c0bb91d6582078fbbce8f388f6);
         umiImportRelations::getInstance()->setIdRelation($this->source_id, $v2114c8075d855b3cea53d5d880c68948, $v777ccf80e4e83a9e7cdddd6ebc1edff7);
         if ($v777ccf80e4e83a9e7cdddd6ebc1edff7) {
             $v3252048a9dc6701c34b83c15c5be40f7 = true;
         }
     }
     permissionsCollection::getInstance()->setDefaultPermissions($v777ccf80e4e83a9e7cdddd6ebc1edff7);
     $v691b2ea4f2db17699a29da0c302a91ea = umiHierarchy::getInstance()->getElement($v777ccf80e4e83a9e7cdddd6ebc1edff7, true, true);
     if (!$v691b2ea4f2db17699a29da0c302a91ea instanceof umiHierarchyElement) {
         $this->importLog[] = "Can't create element \"{$v10b04069381b2fef4e0a41e0ea65b914}\" ({$v2114c8075d855b3cea53d5d880c68948})";
         $this->importErrors++;
         return false;
     }
     $v161c9aaa4fe035e7b2f465bc59f3ab45 = new umiEventPoint("import_element");
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setMode("process");
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("new_element", $v691b2ea4f2db17699a29da0c302a91ea);
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("old_element_id", $v2114c8075d855b3cea53d5d880c68948);
     $v161c9aaa4fe035e7b2f465bc59f3ab45->addRef("element_info", $vfc07ae6b81515e9c73cb36ac08488ca1);
     $v161c9aaa4fe035e7b2f465bc59f3ab45->addRef("props", $this->xml_objects[$v75cacdb2219ff0da09cc2f909ea64759]['props']);
     umiEventsController::getInstance()->callEvent($v161c9aaa4fe035e7b2f465bc59f3ab45);
     if ($v53f070b923b86cc3c1b95e9950674c7c !== NULL) {
         $v691b2ea4f2db17699a29da0c302a91ea->setIsActive($v53f070b923b86cc3c1b95e9950674c7c);
     }
     if ($v712546bad453a4d99cb79be316f6e64b !== NULL) {
         $v691b2ea4f2db17699a29da0c302a91ea->setIsVisible($v712546bad453a4d99cb79be316f6e64b);
     }
     if ($vd84ff935144e00c3e1d395c2379aca47) {
         $v691b2ea4f2db17699a29da0c302a91ea->setAltName($vd84ff935144e00c3e1d395c2379aca47);
     }
     if ($v10b04069381b2fef4e0a41e0ea65b914) {
         $v691b2ea4f2db17699a29da0c302a91ea->setName($v10b04069381b2fef4e0a41e0ea65b914);
     }
     $v82e85d12802becdae851373fcc70c4ff = array();
     $v50fe03ab7bf37089a7e88da9b31ffb3b = $this->xml_objects[$v75cacdb2219ff0da09cc2f909ea64759]['props'];
     foreach ($v50fe03ab7bf37089a7e88da9b31ffb3b as $vdfc394bd05a4b48161c790034af522a8 => $v410e0a26c217dfabf8a5653e8f9e68ef) {
         $v2771be291c4a714ca95fd1f45a32403e = $v410e0a26c217dfabf8a5653e8f9e68ef['values'];
         $v519504d7d4beb745dac24ccfb6c1d7c9 = $v410e0a26c217dfabf8a5653e8f9e68ef['field_type'];
         if ($v519504d7d4beb745dac24ccfb6c1d7c9 == "img_file") {
             if (isset($v2771be291c4a714ca95fd1f45a32403e[0])) {
                 $v2771be291c4a714ca95fd1f45a32403e[0] = new umiImageFile($v2771be291c4a714ca95fd1f45a32403e[0]);
             }
         }
         $vdfc394bd05a4b48161c790034af522a8 = translit::convert($vdfc394bd05a4b48161c790034af522a8);
         if ($v691b2ea4f2db17699a29da0c302a91ea->getObject()->getPropByName($vdfc394bd05a4b48161c790034af522a8)) {
             if ($v519504d7d4beb745dac24ccfb6c1d7c9 == 'price' && strlen($v410e0a26c217dfabf8a5653e8f9e68ef['currency_code'])) {
                 $vfcaea7edd270964cc145ea48e4367d43 = cmsController::getInstance()->getModule('emarket');
                 if ($vfcaea7edd270964cc145ea48e4367d43) {
                     $v78a5eb43deef9a7b5b9ce157b9d52ac4 = isset($v2771be291c4a714ca95fd1f45a32403e[0]) ? floatval($v2771be291c4a714ca95fd1f45a32403e[0]) : 0;
                     $v1af0389838508d7016a9841eb6273962 = $vfcaea7edd270964cc145ea48e4367d43->getCurrency($v410e0a26c217dfabf8a5653e8f9e68ef['currency_code']);
                     if ($v1af0389838508d7016a9841eb6273962) {
                         $v30de5920b8dd5258394e19caa86bbe80 = $vfcaea7edd270964cc145ea48e4367d43->formatCurrencyPrice(array($v78a5eb43deef9a7b5b9ce157b9d52ac4), $vfcaea7edd270964cc145ea48e4367d43->getDefaultCurrency(), $v1af0389838508d7016a9841eb6273962);
                         $v2771be291c4a714ca95fd1f45a32403e = isset($v30de5920b8dd5258394e19caa86bbe80[0]) ? floatval($v30de5920b8dd5258394e19caa86bbe80[0]) : 0;
                     }
                 }
             }
             $v691b2ea4f2db17699a29da0c302a91ea->setValue($vdfc394bd05a4b48161c790034af522a8, $v2771be291c4a714ca95fd1f45a32403e);
         } else {
             $v82e85d12802becdae851373fcc70c4ff[] = $v410e0a26c217dfabf8a5653e8f9e68ef;
         }
     }
     $this->addMissedProps($v691b2ea4f2db17699a29da0c302a91ea, $v82e85d12802becdae851373fcc70c4ff, $v2741adf691b2acf0359a6a73234bc605);
     if (count($v82e85d12802becdae851373fcc70c4ff)) {
         $v691b2ea4f2db17699a29da0c302a91ea->getObject()->update();
     }
     foreach ($v82e85d12802becdae851373fcc70c4ff as $v410e0a26c217dfabf8a5653e8f9e68ef) {
         $v2771be291c4a714ca95fd1f45a32403e = $v410e0a26c217dfabf8a5653e8f9e68ef['values'];
         $v519504d7d4beb745dac24ccfb6c1d7c9 = $v410e0a26c217dfabf8a5653e8f9e68ef['field_type'];
         if ($v519504d7d4beb745dac24ccfb6c1d7c9 == "img_file") {
             if ($v2771be291c4a714ca95fd1f45a32403e[0]) {
                 $v2771be291c4a714ca95fd1f45a32403e[0] = new umiImageFile($v2771be291c4a714ca95fd1f45a32403e[0]);
             }
         }
         if (!$v410e0a26c217dfabf8a5653e8f9e68ef['name']) {
             $v410e0a26c217dfabf8a5653e8f9e68ef['name'] = translit::convert($v410e0a26c217dfabf8a5653e8f9e68ef['title']);
         }
         $v410e0a26c217dfabf8a5653e8f9e68ef['name'] = translit::convert($v410e0a26c217dfabf8a5653e8f9e68ef['name']);
         if (!$v691b2ea4f2db17699a29da0c302a91ea->setValue($v410e0a26c217dfabf8a5653e8f9e68ef['name'], $v2771be291c4a714ca95fd1f45a32403e)) {
             continue;
         }
     }
     $v691b2ea4f2db17699a29da0c302a91ea->commit();
     if ($v3252048a9dc6701c34b83c15c5be40f7) {
         $this->importLog[] = "Element \"" . $v10b04069381b2fef4e0a41e0ea65b914 . "\" (" . $v2114c8075d855b3cea53d5d880c68948 . ") has been created";
         $this->createdElements++;
     } else {
         $this->importLog[] = "Element \"" . $v10b04069381b2fef4e0a41e0ea65b914 . "\" (" . $v2114c8075d855b3cea53d5d880c68948 . ") has been updated";
         $this->updatedElements++;
     }
     $v5e949eb2c66f5d51b8a4d4185a693b3f = umiObjectProperty::$USE_FORCE_OBJECTS_CREATION;
     umiObjectProperty::$USE_FORCE_OBJECTS_CREATION = false;
     $v9dfb9e2c355fe22768c93f6e0c33f1f9 = umiObjectTypesCollection::getInstance()->getBaseType("eshop", "store");
     $v6f95a0b0f896cf9349af3afc8a2752df = umiObjectTypesCollection::getInstance()->getBaseType("eshop", "store_relation");
     $va8973f92932ba8c02915c86424eb77b0 = cmsController::getInstance()->getModule("eshop");
     if ($va8973f92932ba8c02915c86424eb77b0 && $v9dfb9e2c355fe22768c93f6e0c33f1f9 && $v6f95a0b0f896cf9349af3afc8a2752df) {
         if (isset($this->xml_stores[$v75cacdb2219ff0da09cc2f909ea64759])) {
             foreach ($this->xml_stores[$v75cacdb2219ff0da09cc2f909ea64759] as $v57f6446eb03e6af4fa631be4795f0c9b) {
                 $v4ab09853d1229afdaa2c4b00b44b4828 = $v57f6446eb03e6af4fa631be4795f0c9b['old_store_id'];
                 $vbd047b181e82cec3af1400e7ee193be5 = $v57f6446eb03e6af4fa631be4795f0c9b['amount'];
                 $vb137c8149c716d240351a4b96434a60c = $this->getStoreIdByName($v4ab09853d1229afdaa2c4b00b44b4828);
                 if ($vb137c8149c716d240351a4b96434a60c === false) {
                     $vb137c8149c716d240351a4b96434a60c = umiObjectsCollection::getInstance()->addObject($v4ab09853d1229afdaa2c4b00b44b4828, $v9dfb9e2c355fe22768c93f6e0c33f1f9);
                 }
                 $vd47cbc7965be6318a50b0b921e4de391 = umiObjectsCollection::getInstance()->getObject($vb137c8149c716d240351a4b96434a60c);
                 if ($vd47cbc7965be6318a50b0b921e4de391 instanceof umiObject) {
                     $vd47cbc7965be6318a50b0b921e4de391->setName($v4ab09853d1229afdaa2c4b00b44b4828);
                     $vd47cbc7965be6318a50b0b921e4de391->commit();
                     $va8973f92932ba8c02915c86424eb77b0->setStoreAmount($v691b2ea4f2db17699a29da0c302a91ea->getId(), $vb137c8149c716d240351a4b96434a60c, $vbd047b181e82cec3af1400e7ee193be5);
                 }
             }
         }
     }
     umiObjectProperty::$USE_FORCE_OBJECTS_CREATION = $v5e949eb2c66f5d51b8a4d4185a693b3f;
     $v161c9aaa4fe035e7b2f465bc59f3ab45 = new umiEventPoint("import_element");
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setMode("after");
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("new_element_id", $v777ccf80e4e83a9e7cdddd6ebc1edff7);
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("old_element_id", $v2114c8075d855b3cea53d5d880c68948);
     $v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("element_info", $vfc07ae6b81515e9c73cb36ac08488ca1);
     umiEventsController::getInstance()->callEvent($v161c9aaa4fe035e7b2f465bc59f3ab45);
     umiHierarchy::getInstance()->unloadElement($v777ccf80e4e83a9e7cdddd6ebc1edff7);
 }
Example #10
0
 public function commit()
 {
     l_mysql_query("START TRANSACTION /* Saving object {$this->id} */");
     $v3c9c288f4021bd9f84c98cc0eddd1838 = umiObjectProperty::$USE_TRANSACTIONS;
     umiObjectProperty::$USE_TRANSACTIONS = false;
     if ($this->checkSelf()) {
         foreach ($this->properties as $v23a5b8ab834cb5140fa6665622eb6417) {
             if (is_object($v23a5b8ab834cb5140fa6665622eb6417)) {
                 $v23a5b8ab834cb5140fa6665622eb6417->commit();
             }
         }
     }
     parent::commit();
     l_mysql_query("COMMIT");
     umiObjectProperty::$USE_TRANSACTIONS = $v3c9c288f4021bd9f84c98cc0eddd1838;
 }
Example #11
0
 public function reserve($reserve = true)
 {
     if ($this->is_reserved == $reserve) {
         return false;
     }
     $primaryStore = $this->getPrimaryStore();
     if (!$primaryStore) {
         return false;
     }
     foreach ($this->getItems() as $item) {
         if ($element = $item->getItemElement()) {
             $amount = $item->getAmount();
             $storesState = $element->getValue('stores_state', array('filter' => array('rel' => $primaryStore->id)));
             if (sizeof($storesState)) {
                 $total = $storesState[0];
                 $total = (int) getArrayKey($total, 'int');
             } else {
                 $total = 0;
             }
             $reserved = (int) $element->reserved + $amount * ($reserve ? 1 : -1);
             $element->reserved = $reserved > 0 ? $reserved > $total ? $total : $reserved : 0;
             $oldFilter = umiObjectProperty::$IGNORE_FILTER_INPUT_STRING;
             umiObjectProperty::$IGNORE_FILTER_INPUT_STRING = true;
             $element->commit();
             umiObjectProperty::$IGNORE_FILTER_INPUT_STRING = $oldFilter;
         }
     }
     $this->is_reserved = $reserve;
     $this->commit();
     return true;
 }
Example #12
0
 protected static function saveFieldValue($name, $value, $target, $save = false)
 {
     $hierarchy = umiHierarchy::getInstance();
     if ($i = strpos($name, '[')) {
         if (preg_match_all("/\\[([^\\[^\\]]+)\\]/", substr($name, $i), $out)) {
             $optionParams = array('filter' => array(), 'field-type' => null);
             foreach ($out[1] as $param) {
                 if (strpos($param, ':')) {
                     list($seekType, $seekValue) = explode(':', $param);
                     $optionParams['filter'][$seekType] = $seekValue;
                 } else {
                     $optionParams['field-type'] = $param;
                 }
             }
         }
         $name = substr($name, 0, $i);
     } else {
         $optionParams = null;
     }
     if ($name != 'name' && $name != 'alt_name') {
         $object = $target instanceof iUmiHierarchyElement ? $target->getObject() : $target;
         $property = $object->getPropByName($name);
         if ($property instanceof iUmiObjectProperty == false) {
             throw new publicException(getLabel('eip-no-field') . ": \"{$name}\"");
         }
         $field = $property->getField();
     }
     if ($name == 'name' || $name == 'alt_name') {
         $type = 'string';
     } else {
         $type = $field->getDataType();
     }
     if (is_string($value)) {
         $value = __editor_content::filterStringValue($value);
     }
     $oldLink = null;
     $newLink = null;
     if ($save) {
         umiObjectProperty::$IGNORE_FILTER_INPUT_STRING = true;
         if ($name == 'h1' || $name == 'name') {
             $value = strip_tags($value);
             $value = str_replace(array('&nbsp;', '&amp;'), array(' ', '&'), $value);
             if ($name === 'name') {
                 // При изменении name: если name==h1, name=h1=new_value
                 // При изменении name: если name!=h1, name=new_value.
                 if ($target->getName() === (string) $target->getValue('h1')) {
                     $target->setValue('h1', $value);
                 }
                 $target->setName($value);
             } else {
                 // При изменении h1: если h1 == name && name=='', name=h1=new_value
                 // При изменении h1: если h1 == name и name != '', h1=new_value
                 // При изменении h1: если h1 != name, h1=new_value
                 if ($target->getName() === (string) $target->getValue('h1') && $target->getName() === '') {
                     $target->setName($value);
                 }
                 $target->setValue('h1', $value);
             }
             if ($target instanceof iUmiHierarchyElement) {
                 $oldLink = $hierarchy->getPathById($target->id);
                 $altName = $target->getAltName();
                 if (!$altName || substr($altName, 0, 1) == '_') {
                     $target->setAltName($value);
                     $target->commit();
                 }
                 $newLink = $hierarchy->getPathById($target->id, false, false, true);
             }
         } elseif ($name == 'alt_name') {
             if ($target instanceof iUmiHierarchyElement) {
                 $target->setAltName($value);
                 $target->commit();
                 $newLink = $hierarchy->getPathById($target->id, false, false, true);
             }
         } else {
             if ($type == 'date') {
                 $date = new umiDate();
                 $date->setDateByString($value);
                 $value = $date;
                 unset($date);
                 $value = $value->getFormattedDate('U');
             }
             if ($type == 'optioned') {
                 $seekType = getArrayKey($optionParams, 'field-type');
                 $filter = getArrayKey($optionParams, 'filter');
                 $oldValue = $target->getValue($name);
                 foreach ($oldValue as $i => $v) {
                     foreach ($filter as $t => $s) {
                         if (getArrayKey($v, $t) != $s) {
                             continue 2;
                         }
                         $oldValue[$i][$seekType] = $value;
                     }
                 }
                 $value = $oldValue;
                 unset($oldValue);
             }
             if ($type == 'symlink') {
                 $value = $value;
             }
             if ($type == 'wysiwyg') {
                 $out = array();
                 if (preg_match_all("/href=[\"']?([^ ^\"^']+)[\"']?/i", $value, $out)) {
                     foreach ($out[1] as $link) {
                         $id = $hierarchy->getIdByPath($link);
                         if ($id) {
                             $link = str_replace("/", "\\/", $link);
                             $value = preg_replace("/(href=[\"']?)" . $link . "([\"']?)/i", "\\1%content get_page_url({$id})%\\2", $value);
                         }
                     }
                 }
             } else {
                 $value = str_replace(array('&nbsp;', '&amp;'), array(' ', '&'), $value);
             }
             if (in_array($type, array('text', 'string', 'int', 'float', 'price', 'date', 'tags', 'counter'))) {
                 $value = preg_replace("/<br ?\\/?>/i", "\n", $value);
                 $value = strip_tags($value);
             }
             if (in_array($type, array('img_file', 'swf_file', 'file', 'video_file')) && $value) {
                 if (substr($value, 0, 1) != '.') {
                     $value = '.' . $value;
                 }
             }
             $target->setValue($name, $value);
         }
         $target->commit();
         umiObjectProperty::$IGNORE_FILTER_INPUT_STRING = false;
         if ($target instanceof iUmiHierarchyElement) {
             $backup = backupModel::getInstance();
             $backup->fakeBackup($target->id);
         }
         $oEventPoint = new umiEventPoint("eipSave");
         $oEventPoint->setMode("after");
         $oEventPoint->setParam("field_name", $name);
         $oEventPoint->setParam("obj", $target);
         def_module::setEventPoint($oEventPoint);
     }
     if ($name == 'name') {
         $value = $target->getName();
     } else {
         $value = $target->getValue($name, $optionParams);
     }
     if ($save) {
         $value = xmlTranslator::executeMacroses($value);
     }
     if ($type == 'date') {
         if ($value) {
             $date = new umiDate();
             $date->setDateByString($value);
             $value = $date->getFormattedDate('Y-m-d H:i');
         } else {
             $value = '';
         }
     }
     if ($type == 'tags' && is_array($value)) {
         $value = implode(', ', $value);
     }
     if ($type == 'optioned' && !is_null($optionParams)) {
         $value = isset($value[0]) ? $value[0] : '';
         $type = getArrayKey($optionParams, 'field-type');
     }
     $result = array('attribute:name' => $name, 'attribute:type' => $type);
     if ($type == 'relation') {
         $items_arr = array();
         if ($value) {
             if (!is_array($value)) {
                 $value = array($value);
             }
             $objects = umiObjectsCollection::getInstance();
             foreach ($value as $objectId) {
                 $object = $objects->getObject($objectId);
                 $items_arr[] = $object;
             }
         }
         $result['attribute:guide-id'] = $field->getGuideId();
         if ($field->getFieldType()->getIsMultiple()) {
             $result['attribute:multiple'] = 'multiple';
         }
         $type = selector::get('object-type')->id($field->getGuideId());
         if ($type && $type->getIsPublic()) {
             $result['attribute:public'] = 'public';
         }
         $result['nodes:item'] = $items_arr;
     } else {
         if ($type == 'symlink') {
             $result['nodes:page'] = is_array($value) ? $value : array();
         } else {
             $result['node:value'] = $value;
         }
     }
     if ($oldLink != $newLink) {
         $result['attribute:old-link'] = $oldLink;
         $result['attribute:new-link'] = $newLink;
     }
     return $result;
 }
Example #13
0
 public function setDateByString($ved2f216e8eb7276d3e828504ebdf5437)
 {
     $ved2f216e8eb7276d3e828504ebdf5437 = umiObjectProperty::filterInputString($ved2f216e8eb7276d3e828504ebdf5437);
     $vd7e6d55ba379a13d08c25d15faf2a23b = strlen($ved2f216e8eb7276d3e828504ebdf5437) ? self::getTimeStamp($ved2f216e8eb7276d3e828504ebdf5437) : 0;
     return $this->setDateByTimeStamp($vd7e6d55ba379a13d08c25d15faf2a23b);
 }
 public function execute()
 {
     if (!is_null(getRequest('links'))) {
         $this->oldGetLinks = getRequest('links');
         unset($_REQUEST['links']);
     }
     $this->position = 0;
     $this->break = false;
     $v9a09b4dfda82e3e665e31092d1c3ec8d = new DOMDocument("1.0", "utf-8");
     $v9a09b4dfda82e3e665e31092d1c3ec8d->formatOutput = XML_FORMAT_OUTPUT;
     $v63a9f0ea7bb98050796b649e85481845 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement("umidump");
     $v63a9f0ea7bb98050796b649e85481845->setAttribute('xmlns:xlink', 'http://www.w3.org/TR/xlink');
     $v0cc175b9c0f1b6a831c399e269772661 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createAttribute("version");
     $v0cc175b9c0f1b6a831c399e269772661->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createTextNode(self::VERSION));
     $v63a9f0ea7bb98050796b649e85481845->appendChild($v0cc175b9c0f1b6a831c399e269772661);
     $v9a09b4dfda82e3e665e31092d1c3ec8d->appendChild($v63a9f0ea7bb98050796b649e85481845);
     $this->translator = new xmlTranslator($v9a09b4dfda82e3e665e31092d1c3ec8d);
     if ($this->showAllFields) {
         $ved2767f3d8b91be52c4cb22eb81a04b3 = xmlTranslator::$showHiddenFieldGroups;
         xmlTranslator::$showHiddenFieldGroups = true;
         $vcf90eeb77dd5c141a9e9b72790489e27 = xmlTranslator::$showUnsecureFields;
         xmlTranslator::$showUnsecureFields = true;
     }
     $v07d2e301ed1b9e6b89b58497f1810239 = umiObjectProperty::$IGNORE_CACHE;
     umiObjectProperty::$IGNORE_CACHE = true;
     $this->doc = $v9a09b4dfda82e3e665e31092d1c3ec8d;
     $this->root = $v63a9f0ea7bb98050796b649e85481845;
     if (file_exists(CURRENT_WORKING_DIR . '/sys-temp/runtime-cache/' . md5($this->source_name))) {
         $vf1f713c9e000f5d3f280adbd124df4f5 = unserialize(file_get_contents(CURRENT_WORKING_DIR . '/sys-temp/runtime-cache/' . md5($this->source_name)));
         $this->exported_files = $vf1f713c9e000f5d3f280adbd124df4f5['exported_files'];
         $this->exported_types = $vf1f713c9e000f5d3f280adbd124df4f5['exported_types'];
         $this->exported_langs = $vf1f713c9e000f5d3f280adbd124df4f5['exported_langs'];
         $this->exported_domains = $vf1f713c9e000f5d3f280adbd124df4f5['exported_domains'];
         $this->exported_templates = $vf1f713c9e000f5d3f280adbd124df4f5['exported_templates'];
         $this->exported_elements = $vf1f713c9e000f5d3f280adbd124df4f5['exported_elements'];
         $this->exported_objects = $vf1f713c9e000f5d3f280adbd124df4f5['exported_objects'];
         $this->exported_restrictions = $vf1f713c9e000f5d3f280adbd124df4f5['exported_restrictions'];
         $this->restricted_fields = $vf1f713c9e000f5d3f280adbd124df4f5['restricted_fields'];
         $this->restrictions = $vf1f713c9e000f5d3f280adbd124df4f5['restrictions'];
         $this->exported_registry_items = $vf1f713c9e000f5d3f280adbd124df4f5['exported_registry_items'];
         $this->exported_data_types = $vf1f713c9e000f5d3f280adbd124df4f5['exported_data_types'];
         $this->exported_dirs = $vf1f713c9e000f5d3f280adbd124df4f5['exported_dirs'];
     }
     $this->createGrid();
     if ($this->directories && !$this->break) {
         $this->exportDirs();
     }
     if ($this->files && !$this->break) {
         $this->exportFiles();
     }
     if ($this->langs && !$this->break) {
         $this->exportLangs();
     }
     if ($this->domains && !$this->break) {
         $this->exportDomains();
     }
     if ($this->templates && !$this->break) {
         $this->exportTemplates();
     }
     if ($this->data_types && !$this->break) {
         $this->exportDataTypes();
     }
     if ($this->types && !$this->break) {
         $this->exportTypes();
     }
     if ($this->objects && !$this->break) {
         $this->exportObjects();
     }
     if ($this->elements && !$this->break) {
         $this->exportElements();
     }
     if ($this->branches && !$this->break) {
         $this->exportBranches();
     }
     if ($this->restrictions && !$this->break) {
         $this->exportRestrictions();
     }
     if ($this->registry && !$this->break) {
         $this->exportRegs();
     }
     $v8277e0910d750195b448797616e091ad = $this->doc;
     $v6f8f57715090da2632453988d9a1501b = $this->meta_container;
     $this->completed = !$this->break;
     if (count($this->branches) && $this->completed) {
         $v92ec19ffde05e15769b1bb3ee05ad745 = array();
         foreach ($this->branches as $v09fd5b139469053e6cd6e28cf8725337) {
             if (isset($this->exported_elements[$v09fd5b139469053e6cd6e28cf8725337]) && $this->exported_elements[$v09fd5b139469053e6cd6e28cf8725337] != 'found') {
                 $v09fd5b139469053e6cd6e28cf8725337 = $this->exported_elements[$v09fd5b139469053e6cd6e28cf8725337];
             }
             $v92ec19ffde05e15769b1bb3ee05ad745[] = $v09fd5b139469053e6cd6e28cf8725337;
         }
         $v7b8b965ad4bca0e41ab51de7b31363a1 = $v8277e0910d750195b448797616e091ad->createElement('branches');
         $this->translateEntity(array('nodes:id' => $v92ec19ffde05e15769b1bb3ee05ad745), $v7b8b965ad4bca0e41ab51de7b31363a1);
         $v6f8f57715090da2632453988d9a1501b->appendChild($v7b8b965ad4bca0e41ab51de7b31363a1);
     }
     $this->saveState();
     if ($this->showAllFields) {
         xmlTranslator::$showHiddenFieldGroups = $ved2767f3d8b91be52c4cb22eb81a04b3;
         xmlTranslator::$showUnsecureFields = $vcf90eeb77dd5c141a9e9b72790489e27;
     }
     umiObjectProperty::$IGNORE_CACHE = $v07d2e301ed1b9e6b89b58497f1810239;
     if (!is_null($this->oldGetLinks)) {
         $_REQUEST['links'] = $this->oldGetLinks;
     }
     return $this->doc;
 }
Example #15
0
 private function renderOptioned(umiObjectProperty &$property, $template, $showNull = false)
 {
     $name = $property->getName();
     $title = $property->getTitle();
     $value = $property->getValue();
     list($tpl_block, $tpl_block_empty, $tpl_item) = self::loadTemplates("data/" . $template, "optioned_block", "optioned_block_empty", "optioned_item");
     if (empty($value) && !$showNull) {
         return $tpl_block_empty;
     }
     $items_arr = array();
     foreach ($value as $info) {
         $objectId = getArrayKey($info, 'rel');
         $elementId = getArrayKey($info, 'symlink');
         $item_arr = array('int' => getArrayKey($info, 'int'), 'float' => getArrayKey($info, 'float'), 'text' => getArrayKey($info, 'text'), 'varchar' => getArrayKey($info, 'varchar'), 'field_name' => $name);
         if ($objectId) {
             if ($object = selector::get('object')->id($objectId)) {
                 $item_arr['object-id'] = $object->id;
                 $item_arr['object-name'] = $object->name;
             }
         }
         if ($elementId) {
             if ($element = selector::get('element')->id($elementId)) {
                 $item_arr['element-id'] = $element->id;
                 $item_arr['element-name'] = $element->name;
                 $item_arr['element-link'] = $element->link;
             }
         }
         $items_arr[] = self::parseTemplate($tpl_item, $item_arr, false, $objectId);
     }
     $arr = array('field_id' => $property->getField()->getId(), 'field_name' => $name, 'name' => $name, 'title' => $title, 'subnodes:items' => $items_arr);
     return self::parseTemplate($tpl_block, $arr);
 }
Example #16
0
 public function save_editable_region()
 {
     // fix for 2.7.4 eip
     if (cmsController::getInstance()->getCurrentMode() != 'admin') {
         return self::old_eip_save_editable_region();
     }
     $iEntityId = getRequest('param0');
     $sPropName = getRequest('param1');
     $content = getRequest('data');
     $bIsObject = (bool) getRequest('is_object');
     if (is_array($content) && count($content) == 1) {
         $content = $content[0];
     } else {
         if (is_array($content) && isset($content[0])) {
             $temp = array();
             foreach ($content as $item) {
                 $temp[] = is_array($item) ? $item[0] : $item;
             }
             $content = $temp;
         }
     }
     $oEntity = $bIsObject ? umiObjectsCollection::getInstance()->getObject($iEntityId) : umiHierarchy::getInstance()->getElement($iEntityId);
     // Checking rights
     $bDisallowed = false;
     $permissions = permissionsCollection::getInstance();
     $userId = $permissions->getUserId();
     if (!$permissions->isSv($userId)) {
         if ($bIsObject) {
             $bDisallowed = !($oEntity->getOwnerId() == $userId);
             if ($bDisallowed) {
                 //Check module permissions
                 $object = selector::get('object')->id($iEntityId);
                 $module = $object->getModule();
                 $method = $object->getMethod();
                 if ($module && $method) {
                     $bDisallowed = !$permissions->isAllowedMethod($userId, $module, $method);
                 }
             }
         } else {
             list($r, $w) = $permissions->isAllowedObject($userId, $iEntityId);
             if (!$w) {
                 $bDisallowed = true;
             }
         }
     }
     if ($bDisallowed) {
         throw new publicAdminException(getLabel('error-no-permissions'));
     }
     $event = new umiEventPoint("systemModifyPropertyValue");
     $event->addRef("entity", $oEntity);
     $event->setParam("property", $sPropName);
     $event->addRef("newValue", $content);
     $event->setMode("before");
     try {
         $event->call();
     } catch (wrongValueException $e) {
         throw new publicAdminException($e->getMessage());
     }
     if ($oEntity instanceof iUmiHierarchyElement) {
         $backupModel = backupModel::getInstance();
         $backupModel->addLogMessage($oEntity->getId());
     }
     if ($bIsObject && !$this->checkAllowedColumn($oEntity, $sPropName)) {
         throw new publicAdminException(getLabel('error-no-permissions'));
     }
     if ($bIsObject && $sPropName == 'is_activated') {
         $guestId = $permissions->getGuestId();
         if ($iEntityId == SV_USER_ID) {
             throw new publicAdminException(getLabel('error-users-swtich-activity-sv'));
         }
         if ($iEntityId == $guestId) {
             throw new publicAdminException(getLabel('error-users-swtich-activity-guest'));
         }
         if ($iEntityId == $userId) {
             throw new publicAdminException(getLabel('error-users-swtich-activity-self'));
         }
     }
     $sPropValue = "";
     if ($oEntity) {
         $bOldVal = umiObjectProperty::$IGNORE_FILTER_INPUT_STRING;
         umiObjectProperty::$IGNORE_FILTER_INPUT_STRING = true;
         $oObject = !$bIsObject ? $oEntity->getObject() : $oEntity;
         $oldValue = null;
         try {
             if ($sPropName == 'name') {
                 if (is_string($content) && strlen($content)) {
                     $oldValue = $oEntity->name;
                     $oEntity->name = $content;
                     if ($oEntity instanceof iUmiHierarchyElement) {
                         $oEntity->h1 = $content;
                     }
                 }
                 $result = array('name' => $content);
             } else {
                 $property = $oObject->getPropByName($sPropName);
                 if ($property->getDataType() == 'date') {
                     $date = new umiDate();
                     $date->setDateByString($content);
                     $content = $date;
                 }
                 $oldValue = $oEntity->getValue($sPropName);
                 $oEntity->setValue($sPropName, $content);
                 if ($oEntity instanceof iUmiHierarchyElement && $sPropName == 'h1') {
                     $oEntity->name = $content;
                 }
                 $result = array('property' => $property);
                 translatorWrapper::get($property);
                 umiObjectPropertyWrapper::$showEmptyFields = true;
             }
         } catch (fieldRestrictionException $e) {
             throw new publicAdminException($e->getMessage());
         }
         $oEntity->commit();
         umiObjectProperty::$IGNORE_FILTER_INPUT_STRING = $bOldVal;
         $oObject->update();
         $oEntity->update();
         if ($oEntity instanceof umiEntinty) {
             $oEntity->commit();
         }
         $event->setParam("oldValue", $oldValue);
         $event->setParam("newValue", $content);
         $event->setMode("after");
         $event->call();
         $this->setData($result);
         return $this->doData();
     }
 }
 protected function importPropValue(umiEntinty $vf5e638cc78dd325906c1298a0c21fb6b, DOMElement $vcaf9b6b99962bf5c2264824231d7a40c, $vd08e820fd4eb48eede47aa5985d10cc8 = false)
 {
     $v3a229433643cf8ea25f2a9b198ea70d8 = $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('name');
     $vb068931cc450442b63f5b3d276ea4297 = self::translateName($v3a229433643cf8ea25f2a9b198ea70d8);
     $v1a13105b7e4eb5fb2e7c9515ac06aa48 = $this->parser->evaluate("value", $vcaf9b6b99962bf5c2264824231d7a40c);
     if (!$v1a13105b7e4eb5fb2e7c9515ac06aa48->length && $vd08e820fd4eb48eede47aa5985d10cc8) {
         $v1a13105b7e4eb5fb2e7c9515ac06aa48 = $this->parser->evaluate("default-value", $vcaf9b6b99962bf5c2264824231d7a40c);
     }
     if (!$v1a13105b7e4eb5fb2e7c9515ac06aa48->length) {
         if ($vd08e820fd4eb48eede47aa5985d10cc8) {
             $this->reportError($this->getLabel('label-property') . " \"{$vb068931cc450442b63f5b3d276ea4297}\" " . $this->getLabel('label-has-no-values'));
         }
         return false;
     }
     $v67236e502346412a98a0bb965b7a59e6 = $v1a13105b7e4eb5fb2e7c9515ac06aa48->item(0);
     $v94757cae63fd3e398c0811a976dd6bbe = $vf5e638cc78dd325906c1298a0c21fb6b instanceof umiHierarchyElement ? $vf5e638cc78dd325906c1298a0c21fb6b->getObjectTypeId() : $vf5e638cc78dd325906c1298a0c21fb6b->getTypeId();
     $v599dcce2998a6b40b1e38e8c6006cb0a = umiObjectTypesCollection::getInstance()->getType($v94757cae63fd3e398c0811a976dd6bbe);
     $v3aabf39f2d943fa886d86dcbbee4d910 = $v599dcce2998a6b40b1e38e8c6006cb0a->getFieldId($vb068931cc450442b63f5b3d276ea4297, false);
     $v06e3d36fa30cea095545139854ad1fb9 = umiFieldsCollection::getInstance()->getField($v3aabf39f2d943fa886d86dcbbee4d910);
     if (!$v06e3d36fa30cea095545139854ad1fb9 instanceof umiField && $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('allow-runtime-add') == '1') {
         $v562feb4548b66febf02774b4f339552e = $vcaf9b6b99962bf5c2264824231d7a40c->parentNode;
         $vdb0f6f37ebeb6ea09489124345af2a45 = $this->importTypeGroup($v599dcce2998a6b40b1e38e8c6006cb0a, $v562feb4548b66febf02774b4f339552e, false);
         if (!$vdb0f6f37ebeb6ea09489124345af2a45 instanceof umiFieldsGroup) {
             return false;
         }
         $v06e3d36fa30cea095545139854ad1fb9 = $this->importField($vdb0f6f37ebeb6ea09489124345af2a45, $vcaf9b6b99962bf5c2264824231d7a40c);
         $vf5e638cc78dd325906c1298a0c21fb6b instanceof umiHierarchyElement ? $vf5e638cc78dd325906c1298a0c21fb6b->getObject()->update() : $vf5e638cc78dd325906c1298a0c21fb6b->update();
     }
     if (!$v06e3d36fa30cea095545139854ad1fb9 instanceof umiField) {
         return false;
     }
     switch ($v06e3d36fa30cea095545139854ad1fb9->getDataType()) {
         case "optioned":
         case "symlink":
             return false;
         case "date":
             $vd7e6d55ba379a13d08c25d15faf2a23b = intval($v67236e502346412a98a0bb965b7a59e6->getAttribute('unix-timestamp'));
             $v8059f160e1aa1f9d3921049ce93b00e1 = new umiDate();
             if ($vd7e6d55ba379a13d08c25d15faf2a23b) {
                 $v8059f160e1aa1f9d3921049ce93b00e1->setDateByTimeStamp($vd7e6d55ba379a13d08c25d15faf2a23b);
             } else {
                 $v8059f160e1aa1f9d3921049ce93b00e1->setDateByString($v67236e502346412a98a0bb965b7a59e6->nodeValue);
             }
             $vf5e638cc78dd325906c1298a0c21fb6b->setValue($vb068931cc450442b63f5b3d276ea4297, $v8059f160e1aa1f9d3921049ce93b00e1);
             break;
         case "price":
             $vfcaea7edd270964cc145ea48e4367d43 = cmsController::getInstance()->getModule('emarket');
             $v78a5eb43deef9a7b5b9ce157b9d52ac4 = $v67236e502346412a98a0bb965b7a59e6->nodeValue;
             $v78a5eb43deef9a7b5b9ce157b9d52ac4 = str_replace(',', '.', $v78a5eb43deef9a7b5b9ce157b9d52ac4);
             $v78a5eb43deef9a7b5b9ce157b9d52ac4 = floatval(preg_replace("/[^0-9.,]/", "", $v78a5eb43deef9a7b5b9ce157b9d52ac4));
             $v52e3817fff5250b5391ef85b1ce23bdb = $v67236e502346412a98a0bb965b7a59e6->hasAttribute('currency-code') ? $v67236e502346412a98a0bb965b7a59e6->getAttribute('currency-code') : $v67236e502346412a98a0bb965b7a59e6->getAttribute('currency_code');
             if (strlen($v52e3817fff5250b5391ef85b1ce23bdb) && $vfcaea7edd270964cc145ea48e4367d43) {
                 $v1af0389838508d7016a9841eb6273962 = $vfcaea7edd270964cc145ea48e4367d43->getCurrency($v52e3817fff5250b5391ef85b1ce23bdb);
                 if ($v1af0389838508d7016a9841eb6273962) {
                     $result = $vfcaea7edd270964cc145ea48e4367d43->formatCurrencyPrice(array($v78a5eb43deef9a7b5b9ce157b9d52ac4), $vfcaea7edd270964cc145ea48e4367d43->getDefaultCurrency(), $v1af0389838508d7016a9841eb6273962);
                     $v78a5eb43deef9a7b5b9ce157b9d52ac4 = $result[0];
                 }
             }
             $vf5e638cc78dd325906c1298a0c21fb6b->setValue($vb068931cc450442b63f5b3d276ea4297, $v78a5eb43deef9a7b5b9ce157b9d52ac4);
             break;
         case "file":
         case "img_file":
         case "video_file":
         case "swf_file":
             if ($this->renameFiles) {
                 $v9d22547e12eafcfadf56ff88b9d67f4d = false;
                 $vf83cd85f6404a7018af0fcf071f35751 = $vf5e638cc78dd325906c1298a0c21fb6b->getValue($vb068931cc450442b63f5b3d276ea4297);
                 if ($vf83cd85f6404a7018af0fcf071f35751 instanceof umiFile) {
                     $v9d22547e12eafcfadf56ff88b9d67f4d = $vf83cd85f6404a7018af0fcf071f35751->getFilePath();
                 }
                 $vbf0e61d0f411b035bf846149824fe352 = ltrim(trim($v67236e502346412a98a0bb965b7a59e6->nodeValue, "\r\n"), ".");
                 $v435ed7e9f07f740abf511a62c00eef6e = basename($vbf0e61d0f411b035bf846149824fe352);
                 $v736007832d2167baaae763fd3a3f3cf1 = dirname($vbf0e61d0f411b035bf846149824fe352);
                 $vabf77184f55403d75b9d51d79162a7ca = explode(".", $v435ed7e9f07f740abf511a62c00eef6e);
                 $vabf77184f55403d75b9d51d79162a7ca = end($vabf77184f55403d75b9d51d79162a7ca);
                 $vd70819bac4952f91adc9954c5b055aca = translit::convert(trim($vf5e638cc78dd325906c1298a0c21fb6b->getName(), "\r\n"));
                 $v435ed7e9f07f740abf511a62c00eef6e = $vd70819bac4952f91adc9954c5b055aca;
                 $ve2942a04780e223b215eb8b663cf5353 = 0;
                 $v149603e6c03516362a8da23f624db945 = error_reporting(0);
                 while (true) {
                     if (!file_exists(CURRENT_WORKING_DIR . '/' . $vbf0e61d0f411b035bf846149824fe352)) {
                         break 2;
                     } else {
                         if ($v9d22547e12eafcfadf56ff88b9d67f4d) {
                             $v46cd4eff50a3aca89f0fbc7ea6a79453 = CURRENT_WORKING_DIR . ltrim($v9d22547e12eafcfadf56ff88b9d67f4d, ".");
                             if (file_exists($v46cd4eff50a3aca89f0fbc7ea6a79453)) {
                                 unlink($v46cd4eff50a3aca89f0fbc7ea6a79453);
                             }
                         }
                     }
                     if (!file_exists(CURRENT_WORKING_DIR . '/' . $v736007832d2167baaae763fd3a3f3cf1 . '/' . $v435ed7e9f07f740abf511a62c00eef6e . '.' . $vabf77184f55403d75b9d51d79162a7ca)) {
                         break;
                     }
                     $ve2942a04780e223b215eb8b663cf5353++;
                     $v435ed7e9f07f740abf511a62c00eef6e = $vd70819bac4952f91adc9954c5b055aca . '_' . $ve2942a04780e223b215eb8b663cf5353;
                 }
                 $v435ed7e9f07f740abf511a62c00eef6e .= '.' . $vabf77184f55403d75b9d51d79162a7ca;
                 rename(CURRENT_WORKING_DIR . '/' . $vbf0e61d0f411b035bf846149824fe352, CURRENT_WORKING_DIR . '/' . $v736007832d2167baaae763fd3a3f3cf1 . '/' . $v435ed7e9f07f740abf511a62c00eef6e);
                 error_reporting($v149603e6c03516362a8da23f624db945);
                 $vbf0e61d0f411b035bf846149824fe352 = '.' . $v736007832d2167baaae763fd3a3f3cf1 . '/' . $v435ed7e9f07f740abf511a62c00eef6e;
                 $vf5e638cc78dd325906c1298a0c21fb6b->setValue($vb068931cc450442b63f5b3d276ea4297, $vbf0e61d0f411b035bf846149824fe352);
             } else {
                 $v47826cacc65c665212b821e6ff80b9b0 = ltrim(trim($v67236e502346412a98a0bb965b7a59e6->nodeValue, "\r\n"), ".");
                 $vf5e638cc78dd325906c1298a0c21fb6b->setValue($vb068931cc450442b63f5b3d276ea4297, "." . $v47826cacc65c665212b821e6ff80b9b0);
             }
             break;
         case "relation":
             if ($this->auto_guide_creation) {
                 if ($vb068931cc450442b63f5b3d276ea4297 == 'payment_status_id' && $v599dcce2998a6b40b1e38e8c6006cb0a->getMethod() == 'order') {
                     $vfcaea7edd270964cc145ea48e4367d43 = cmsController::getInstance()->getModule('emarket');
                     if ($vfcaea7edd270964cc145ea48e4367d43) {
                         umiObjectProperty::$USE_FORCE_OBJECTS_CREATION = false;
                         $v903931b3a9d25a70683f51ab9d363d2e = $v67236e502346412a98a0bb965b7a59e6->nodeValue;
                         $v70a17ffa722a3985b86d30b034ad06d7 = order::get($vf5e638cc78dd325906c1298a0c21fb6b->id);
                         $v70a17ffa722a3985b86d30b034ad06d7->setPaymentStatus($v903931b3a9d25a70683f51ab9d363d2e);
                         $v70a17ffa722a3985b86d30b034ad06d7->commit();
                         umiObjectProperty::$USE_FORCE_OBJECTS_CREATION = true;
                     }
                 } elseif ($vb068931cc450442b63f5b3d276ea4297 == 'status_id' && $v599dcce2998a6b40b1e38e8c6006cb0a->getMethod() == 'order') {
                     $vfcaea7edd270964cc145ea48e4367d43 = cmsController::getInstance()->getModule('emarket');
                     if ($vfcaea7edd270964cc145ea48e4367d43) {
                         $v903931b3a9d25a70683f51ab9d363d2e = $v67236e502346412a98a0bb965b7a59e6->nodeValue;
                         $v70a17ffa722a3985b86d30b034ad06d7 = order::get($vf5e638cc78dd325906c1298a0c21fb6b->id);
                         $vc8db1069270b4aad8a8d03a1d939bc26 = $v70a17ffa722a3985b86d30b034ad06d7->getOrderStatus();
                         $vf48da84a2621e8cad36af3c0af958502 = $v70a17ffa722a3985b86d30b034ad06d7->getCodeByStatus($vc8db1069270b4aad8a8d03a1d939bc26);
                         if (!in_array($vf48da84a2621e8cad36af3c0af958502, array('ready', 'canceled', 'rejected'))) {
                             umiObjectProperty::$USE_FORCE_OBJECTS_CREATION = false;
                             $v70a17ffa722a3985b86d30b034ad06d7->setOrderStatus($v903931b3a9d25a70683f51ab9d363d2e);
                             $v70a17ffa722a3985b86d30b034ad06d7->commit();
                             umiObjectProperty::$USE_FORCE_OBJECTS_CREATION = true;
                         }
                     }
                 } else {
                     $v691d502cfd0e0626cd3b058e5682ad1c = array();
                     $v1a13105b7e4eb5fb2e7c9515ac06aa48 = $v67236e502346412a98a0bb965b7a59e6->getElementsByTagName("item");
                     foreach ($v1a13105b7e4eb5fb2e7c9515ac06aa48 as $ve795119eccc6565f098fca8454bad366) {
                         $v691d502cfd0e0626cd3b058e5682ad1c[] = $ve795119eccc6565f098fca8454bad366->getAttribute('name');
                     }
                     $vf5e638cc78dd325906c1298a0c21fb6b->setValue($vb068931cc450442b63f5b3d276ea4297, $v691d502cfd0e0626cd3b058e5682ad1c);
                 }
             }
             break;
         case "tags":
             $v1a13105b7e4eb5fb2e7c9515ac06aa48 = $this->parser->evaluate("combined", $vcaf9b6b99962bf5c2264824231d7a40c);
             if ($v67236e502346412a98a0bb965b7a59e6 = $v1a13105b7e4eb5fb2e7c9515ac06aa48->item(0)) {
                 $vf5e638cc78dd325906c1298a0c21fb6b->setValue($vb068931cc450442b63f5b3d276ea4297, trim($v67236e502346412a98a0bb965b7a59e6->nodeValue, "\r\n"));
             }
             break;
         case "string":
         case "text":
         case "wysiwyg":
         case "boolean":
         case "counter":
         case "float":
         case "int":
             if ($vb068931cc450442b63f5b3d276ea4297 == 'payment_type_id' || $vb068931cc450442b63f5b3d276ea4297 == 'modificator_type_id' || $vb068931cc450442b63f5b3d276ea4297 == 'rule_type_id' || $vb068931cc450442b63f5b3d276ea4297 == 'delivery_type_id') {
                 $v7f7cfde5ec586119b48911a2c75851e5 = $this->relations->getNewTypeIdRelation($this->source_id, $v67236e502346412a98a0bb965b7a59e6->nodeValue);
                 if ($v7f7cfde5ec586119b48911a2c75851e5) {
                     $vf5e638cc78dd325906c1298a0c21fb6b->setValue($vb068931cc450442b63f5b3d276ea4297, $v7f7cfde5ec586119b48911a2c75851e5);
                 }
                 break;
             }
         default:
             $vf5e638cc78dd325906c1298a0c21fb6b->setValue($vb068931cc450442b63f5b3d276ea4297, trim($v67236e502346412a98a0bb965b7a59e6->nodeValue, "\r\n"));
             break;
     }
 }
 protected function save()
 {
     $vb068931cc450442b63f5b3d276ea4297 = umiObjectProperty::filterInputString($this->name);
     $v1e0ca5b1252f1f6b1e0ac91be7e7219e = umiObjectProperty::filterInputString($this->guid);
     $v6be379826b20cc58475f636e33f4606b = (int) $this->parent_id;
     $v1945c9a2a5e2ba6133f1db6757a35fcb = (int) $this->is_locked;
     $v7617e8d03bb811f5c37135234006b114 = (int) $this->is_guidable;
     $v117256556af3bd1a0c9710a593d93814 = (int) $this->is_public;
     $v0715f6d9497f93911417c9c324265771 = (int) $this->hierarchy_type_id;
     $v23aec26e2b521c0e5f1061b3d04983a5 = (int) $this->sortable;
     $vac5c74b64b4b8352ef2f181affb5ac2a = "UPDATE cms3_object_types SET name = '{$vb068931cc450442b63f5b3d276ea4297}', guid = '{$v1e0ca5b1252f1f6b1e0ac91be7e7219e}', parent_id = '{$v6be379826b20cc58475f636e33f4606b}', is_locked = '{$v1945c9a2a5e2ba6133f1db6757a35fcb}', is_guidable = '{$v7617e8d03bb811f5c37135234006b114}', is_public = '{$v117256556af3bd1a0c9710a593d93814}', hierarchy_type_id = '{$v0715f6d9497f93911417c9c324265771}', sortable = '{$v23aec26e2b521c0e5f1061b3d04983a5}' WHERE id = '{$this->id}'";
     l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
     cacheFrontend::getInstance()->flush();
     if ($v56bd7107802ebe56c6918992f0608ec6 = l_mysql_error()) {
         throw new coreException($v56bd7107802ebe56c6918992f0608ec6);
     }
     return true;
 }
 public function setAltName($vd84ff935144e00c3e1d395c2379aca47, $v5c42c04954c401e189bb85786bde8adb = true)
 {
     if (!$vd84ff935144e00c3e1d395c2379aca47) {
         $vd84ff935144e00c3e1d395c2379aca47 = $this->getName();
     }
     if ($v5c42c04954c401e189bb85786bde8adb) {
         $vd84ff935144e00c3e1d395c2379aca47 = umiHierarchy::convertAltName($vd84ff935144e00c3e1d395c2379aca47);
         if (!$vd84ff935144e00c3e1d395c2379aca47) {
             $vd84ff935144e00c3e1d395c2379aca47 = "_";
         }
     }
     $vd295b8117d72bf06e54a27bcbfc782cf = $this->alt_name;
     $this->alt_name = $this->getRightAltName(umiObjectProperty::filterInputString($vd84ff935144e00c3e1d395c2379aca47));
     if (!$this->alt_name) {
         $this->alt_name = $vd84ff935144e00c3e1d395c2379aca47;
     }
     $v1988c61c48f30d2b39eed4edcf1e3c8b = $this->alt_name;
     if ($v1988c61c48f30d2b39eed4edcf1e3c8b !== $vd295b8117d72bf06e54a27bcbfc782cf) {
         $this->setIsUpdated();
     }
 }
 public static function filterInputString($vb45cffe084dd3d20d928bee85e7b0f21)
 {
     $vb45cffe084dd3d20d928bee85e7b0f21 = umiObjectProperty::filterCDATA($vb45cffe084dd3d20d928bee85e7b0f21);
     $vb45cffe084dd3d20d928bee85e7b0f21 = l_mysql_real_escape_string($vb45cffe084dd3d20d928bee85e7b0f21);
     if (isset($_SERVER['DOCUMENT_ROOT']) && cmsController::getInstance()->getCurrentMode() != "admin" && !umiObjectProperty::$IGNORE_FILTER_INPUT_STRING && !(defined("CRON") && CRON)) {
         $vb45cffe084dd3d20d928bee85e7b0f21 = str_replace(array("&#037;", "&#37;"), "%", $vb45cffe084dd3d20d928bee85e7b0f21);
         $vb45cffe084dd3d20d928bee85e7b0f21 = htmlspecialchars(htmlspecialchars_decode($vb45cffe084dd3d20d928bee85e7b0f21), ENT_NOQUOTES);
         $vb45cffe084dd3d20d928bee85e7b0f21 = str_replace("%", "&#37;", $vb45cffe084dd3d20d928bee85e7b0f21);
     }
     return $vb45cffe084dd3d20d928bee85e7b0f21;
 }
 public function tags_mk_eff_cloud($i_domain_id = NULL, $s_template = "tags", $i_per_page = -1, $b_ignore_paging = true, $arr_users = array())
 {
     if (!$arr_users || intval($arr_users) === -1 || strval($arr_users) === 'all' || $arr_users == "Все") {
         $arr_users = array();
     }
     if (is_int($arr_users)) {
         $arr_users = array(intval($arr_users));
     } elseif (is_array($arr_users)) {
         $arr_users = array_map('intval', $arr_users);
     } else {
         $arr_users = array(intval(strval($arr_users)));
     }
     $i_per_page = intval($i_per_page);
     if (!$i_per_page) {
         $i_per_page = 10;
     }
     if ($i_per_page === -1) {
         $b_ignore_paging = true;
     }
     $s_template = strval($s_template);
     if (!strlen($s_template)) {
         $s_template = "tags";
     }
     $i_curr_page = intval(getRequest('p'));
     if ($b_ignore_paging) {
         $i_curr_page = 0;
     }
     // load templates :
     list($tpl_tags, $tpl_tag, $tpl_tag_sep, $tpl_tags_empty) = $this->loadTemplates("content/" . $s_template, "cloud_tags", "cloud_tag", "cloud_tagseparator", "cloud_tags_empty");
     // process :
     $max_font_size = 32;
     $min_font_size = 10;
     $s_prefix = 'Account';
     if ($i_domain_id) {
         $s_prefix = 'Domain';
     }
     // by usage :
     $o_object_type = umiObjectTypesCollection::getInstance()->getTypeByGUID('root-pages-type');
     $i_tags_field_id = $o_object_type->getFieldId('tags');
     //
     $result_u = umiObjectProperty::objectsByValue($i_tags_field_id, 'all', true, true, $i_domain_id ? $i_domain_id : -1);
     // by popularity
     $stat = cmsController::getInstance()->getModule('stat');
     $sStatIncPath = dirname(dirname(dirname(dirname(__FILE__)))) . '/stat/classes';
     $factory = new statisticFactory($sStatIncPath);
     $factory->isValid('allTags');
     $report = $factory->get('allTags');
     if ($i_domain_id) {
         $v_domains = $report->setDomain($i_domain_id);
     } else {
         $v_domains = $report->setDomain(-1);
     }
     if (is_array($arr_users) && count($arr_users)) {
         $report->setUserIDs($arr_users);
     }
     $result_p = $report->get();
     $arrTags = array();
     $i_sum_u = intval($result_u['sum']);
     $i_sum_p = intval($result_p['sum']);
     $arr_usage_tags = $result_u['values'];
     $arr_popular_tags = $result_p['labels'];
     $arr_u_tags = array();
     $arr_p_tags = array();
     $arr_eff_tags = array();
     foreach ($arr_usage_tags as $arr_next_tag) {
         $s_tag = $arr_next_tag['value'];
         $i_tag = intval($arr_next_tag['cnt']);
         $arr_u_tags[$s_tag] = round($i_tag * 100 / $i_sum_u, 1);
         if (!isset($arr_eff_tags[$s_tag])) {
             $arr_eff_tags[$s_tag] = 0;
         }
     }
     foreach ($arr_popular_tags as $arr_next_tag) {
         $s_tag = $arr_next_tag['tag'];
         $i_tag = intval($arr_next_tag['cnt']);
         $arr_p_tags[$s_tag] = round($i_tag * 100 / $i_sum_p, 1);
         if (!isset($arr_eff_tags[$s_tag])) {
             $arr_eff_tags[$s_tag] = 0;
         }
     }
     foreach ($arr_eff_tags as $s_tag => $i_efficiency) {
         if (isset($arr_u_tags[$s_tag]) && isset($arr_p_tags[$s_tag])) {
             $arr_eff_tags[$s_tag] = round($arr_p_tags[$s_tag] / $arr_u_tags[$s_tag], 1);
         } elseif (isset($arr_u_tags[$s_tag])) {
             $arr_eff_tags[$s_tag] = 0;
             // 0/100
         } elseif (isset($arr_p_tags[$s_tag])) {
             $arr_eff_tags[$s_tag] = 1000;
             // 100/0.1 (0.1 - round(x/y, 1))
         }
     }
     $arrTags = array();
     foreach ($arr_eff_tags as $s_tag => $i_efficiency) {
         if (is_null($s_tag)) {
             $s_tag = '[nontagged]';
         }
         $f_weight = round($i_efficiency / 10, 1);
         $i_font = round(($max_font_size - $min_font_size) / 100 * $f_weight + $min_font_size);
         $arrTags[$s_tag] = array('weight' => $f_weight, 'font' => $i_font);
     }
     $summ_weight = 0;
     if (count($arrTags)) {
         $arrTagsTplteds = array();
         foreach ($arrTags as $sTag => $arrTagStat) {
             $summ_weight += $arrTagStat['weight'];
             $params = array('tag' => $sTag, 'tag_urlencoded' => rawurlencode($sTag), 'attribute:weight' => $arrTagStat['weight'], 'attribute:font' => $arrTagStat['font'], 'attribute:context' => $s_prefix);
             $arrTagsTplteds[] = def_module::parseTemplate($tpl_tag, $params);
         }
         if (isset($arrTagsTplteds[0]) && is_array($arrTagsTplteds[0])) {
             // udata
             $arrForTags = array('subnodes:items' => $arrTagsTplteds);
         } else {
             // not udata
             $arrForTags = array('items' => implode($tpl_tag_sep, $arrTagsTplteds));
         }
         //
         $arrForTags['attribute:summ_weight'] = $summ_weight;
         $arrForTags['attribute:context'] = $s_prefix;
         // RETURN
         return def_module::parseTemplate($tpl_tags, $arrForTags);
     } else {
         $arrForTags = array();
         // RETURN
         return def_module::parseTemplate($tpl_tags_empty, $arrForTags);
     }
 }