コード例 #1
0
 public function translateProperties(iUmiFieldsGroup $vdb0f6f37ebeb6ea09489124345af2a45, iUmiObject $va8cfde6331bd59eb2ac96f8911c4b666)
 {
     $v47db2588331bbe530c80dd001fc60aed = $vdb0f6f37ebeb6ea09489124345af2a45->getId();
     $va2b861d0e7719d9108522aacfd4181bc = $vdb0f6f37ebeb6ea09489124345af2a45->getName();
     $v033db9a44bb2ef53effec0ac7c905c8c = $vdb0f6f37ebeb6ea09489124345af2a45->getTitle();
     $v71ea3b11aebda17ad80b6499a6ab6fb0 = array();
     $v71ea3b11aebda17ad80b6499a6ab6fb0['attribute:id'] = $v47db2588331bbe530c80dd001fc60aed;
     $v71ea3b11aebda17ad80b6499a6ab6fb0['attribute:name'] = $va2b861d0e7719d9108522aacfd4181bc;
     $v71ea3b11aebda17ad80b6499a6ab6fb0['title'] = $v033db9a44bb2ef53effec0ac7c905c8c;
     $vd05b6ed7d2345020440df396d6da7f73 = $vdb0f6f37ebeb6ea09489124345af2a45->getFields();
     $v71ea3b11aebda17ad80b6499a6ab6fb0['nodes:property'] = array();
     $v865c0c0b4ab0e063e5caa3387c1a8741 = 0;
     $vb116c0edc58650200e8613da6ced1228 = false;
     foreach ($vd05b6ed7d2345020440df396d6da7f73 as $v945100186b119048837b9859c2c46410 => $v06e3d36fa30cea095545139854ad1fb9) {
         $v972bf3f05d14ffbdb817bef60638ff00 = $v06e3d36fa30cea095545139854ad1fb9->getName();
         $v1a8db4c996d8ed8289da5f957879ab94 = $va8cfde6331bd59eb2ac96f8911c4b666->getPropByName($v972bf3f05d14ffbdb817bef60638ff00);
         if (is_null($v1a8db4c996d8ed8289da5f957879ab94)) {
             continue;
         }
         $v84b711c462ff4413ba5f54eef508bc85 = translatorWrapper::get($v1a8db4c996d8ed8289da5f957879ab94)->translate($v1a8db4c996d8ed8289da5f957879ab94);
         if (!empty($v84b711c462ff4413ba5f54eef508bc85)) {
             $vb116c0edc58650200e8613da6ced1228 = true;
             $v71ea3b11aebda17ad80b6499a6ab6fb0['nodes:property'][getRequest('jsonMode') == "force" ? $v865c0c0b4ab0e063e5caa3387c1a8741++ : ++$v865c0c0b4ab0e063e5caa3387c1a8741] = $v84b711c462ff4413ba5f54eef508bc85;
         }
     }
     return $vb116c0edc58650200e8613da6ced1228 ? $v71ea3b11aebda17ad80b6499a6ab6fb0 : array();
 }
コード例 #2
0
 public function chooseTranslator(DOMElement $v173a1756d2d82394cb803161f70f9a38, $v56491f2e1c74898e18bb6e47d2425b19, $ve30d41e6c131a13252ce15184b24d99b = false)
 {
     switch (gettype($v56491f2e1c74898e18bb6e47d2425b19)) {
         case "array":
             $this->translateArray($v173a1756d2d82394cb803161f70f9a38, $v56491f2e1c74898e18bb6e47d2425b19);
             break;
         case "object":
             $v7c27535f88bae9519ceb14a8983c57ff = translatorWrapper::get($v56491f2e1c74898e18bb6e47d2425b19);
             $v7c27535f88bae9519ceb14a8983c57ff->isFull = $ve30d41e6c131a13252ce15184b24d99b;
             $this->chooseTranslator($v173a1756d2d82394cb803161f70f9a38, $v7c27535f88bae9519ceb14a8983c57ff->translate($v56491f2e1c74898e18bb6e47d2425b19));
             break;
         default:
             $this->translateBasic($v173a1756d2d82394cb803161f70f9a38, $v56491f2e1c74898e18bb6e47d2425b19);
             break;
     }
 }
コード例 #3
0
 protected function chooseTranslator($v8d777f385d3dfec8815d20f7496026dc, $ve30d41e6c131a13252ce15184b24d99b = false)
 {
     switch (gettype($v8d777f385d3dfec8815d20f7496026dc)) {
         case 'array':
             $this->translateArray($v8d777f385d3dfec8815d20f7496026dc);
             break;
         case 'object':
             $v7c27535f88bae9519ceb14a8983c57ff = translatorWrapper::get($v8d777f385d3dfec8815d20f7496026dc);
             $v7c27535f88bae9519ceb14a8983c57ff->isFull = $ve30d41e6c131a13252ce15184b24d99b;
             $this->result .= "{\n";
             $this->level++;
             $this->chooseTranslator($v7c27535f88bae9519ceb14a8983c57ff->translate($v8d777f385d3dfec8815d20f7496026dc));
             $this->level--;
             $v5db8dca30c2d7f0c2bc225ae852c5053 = str_repeat("\t", $this->level);
             $this->result .= "\n" . $v5db8dca30c2d7f0c2bc225ae852c5053 . "}";
             break;
         default:
             $this->translateBasic($v8d777f385d3dfec8815d20f7496026dc);
     }
 }
コード例 #4
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();
     }
 }
コード例 #5
0
 protected function translateToXml()
 {
     $args = func_get_args();
     $v47c80780ab608cc046f2a6e6f071feb6 = $args[0];
     $v69ae498121c2d8e63f20c7144a0246d7 = umiObjectsCollection::getInstance();
     $vb81ca7c0ccaa77e7aa91936ab0070695 = umiHierarchy::getInstance();
     $v10573b873d2fa5a365d558a45e328e47 = array();
     switch ($this->mode) {
         case "pages":
             $vb3b32a2d422265cd25c3323ed0157f81 = array();
             foreach ($v47c80780ab608cc046f2a6e6f071feb6 as $v865c0c0b4ab0e063e5caa3387c1a8741 => $v8e2dcfd7e7e24b1ca76c1193f645902b) {
                 if ("total" == (string) $v865c0c0b4ab0e063e5caa3387c1a8741) {
                     continue;
                 }
                 if ($v8e2dcfd7e7e24b1ca76c1193f645902b instanceof umiHierarchyElement) {
                     $v8d777f385d3dfec8815d20f7496026dc = translatorWrapper::get($v8e2dcfd7e7e24b1ca76c1193f645902b)->translate($v8e2dcfd7e7e24b1ca76c1193f645902b);
                     if (count($this->extendedGroups) || count($this->extendedProperties)) {
                         $va8cfde6331bd59eb2ac96f8911c4b666 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject();
                         $v8d777f385d3dfec8815d20f7496026dc['extended'] = array();
                         if (count($this->extendedProperties)) {
                             $v8d777f385d3dfec8815d20f7496026dc['extended']['properties'] = array();
                             foreach ($this->extendedProperties as $v2774487c34477faca610e94a47ebfe34) {
                                 $v1a8db4c996d8ed8289da5f957879ab94 = $va8cfde6331bd59eb2ac96f8911c4b666->getPropByName($v2774487c34477faca610e94a47ebfe34);
                                 if (!$v1a8db4c996d8ed8289da5f957879ab94 instanceof umiObjectProperty) {
                                     continue;
                                 }
                                 $v8d777f385d3dfec8815d20f7496026dc['extended']['properties']['nodes:property'][] = translatorWrapper::get($v1a8db4c996d8ed8289da5f957879ab94)->translate($v1a8db4c996d8ed8289da5f957879ab94);
                             }
                         }
                         if (count($this->extendedGroups)) {
                             $v8d777f385d3dfec8815d20f7496026dc['extended']['groups'] = array();
                             $v8d777f385d3dfec8815d20f7496026dc['extended']['groups']['nodes:group'] = array();
                             $v726e8e4809d4c1b28a6549d86436a124 = $va8cfde6331bd59eb2ac96f8911c4b666->getType();
                             foreach ($this->extendedGroups as $v400b99ba03a116687d9e17a661ee0628) {
                                 $vdb0f6f37ebeb6ea09489124345af2a45 = $v726e8e4809d4c1b28a6549d86436a124->getFieldsGroupByName($v400b99ba03a116687d9e17a661ee0628);
                                 if (!$vdb0f6f37ebeb6ea09489124345af2a45 instanceof umiFieldsGroup) {
                                     continue;
                                 }
                                 $v8d777f385d3dfec8815d20f7496026dc['extended']['groups']['nodes:group'][] = translatorWrapper::get($vdb0f6f37ebeb6ea09489124345af2a45)->translateProperties($vdb0f6f37ebeb6ea09489124345af2a45, $va8cfde6331bd59eb2ac96f8911c4b666);
                             }
                         }
                     }
                     $vb3b32a2d422265cd25c3323ed0157f81[] = $v8d777f385d3dfec8815d20f7496026dc;
                 }
             }
             $v10573b873d2fa5a365d558a45e328e47['nodes:page'] = $vb3b32a2d422265cd25c3323ed0157f81;
             if (isset($v47c80780ab608cc046f2a6e6f071feb6['total'])) {
                 $v10573b873d2fa5a365d558a45e328e47['total'] = $v47c80780ab608cc046f2a6e6f071feb6['total'];
             }
             break;
         case "objects":
             $v5891da2d64975cae48d175d1e001f5da = array();
             foreach ($v47c80780ab608cc046f2a6e6f071feb6 as $v865c0c0b4ab0e063e5caa3387c1a8741 => $va8cfde6331bd59eb2ac96f8911c4b666) {
                 if ("total" == (string) $v865c0c0b4ab0e063e5caa3387c1a8741) {
                     continue;
                 }
                 if ($va8cfde6331bd59eb2ac96f8911c4b666 instanceof umiObject) {
                     $v8d777f385d3dfec8815d20f7496026dc = translatorWrapper::get($va8cfde6331bd59eb2ac96f8911c4b666)->translate($va8cfde6331bd59eb2ac96f8911c4b666);
                     if (count($this->extendedGroups) || count($this->extendedProperties)) {
                         $v8d777f385d3dfec8815d20f7496026dc['extended'] = array();
                         if (count($this->extendedProperties)) {
                             $v8d777f385d3dfec8815d20f7496026dc['extended']['properties'] = array();
                             foreach ($this->extendedProperties as $v2774487c34477faca610e94a47ebfe34) {
                                 $v1a8db4c996d8ed8289da5f957879ab94 = $va8cfde6331bd59eb2ac96f8911c4b666->getPropByName($v2774487c34477faca610e94a47ebfe34);
                                 if (!$v1a8db4c996d8ed8289da5f957879ab94 instanceof umiObjectProperty) {
                                     continue;
                                 }
                                 $v8d777f385d3dfec8815d20f7496026dc['extended']['properties']['nodes:property'][] = translatorWrapper::get($v1a8db4c996d8ed8289da5f957879ab94)->translate($v1a8db4c996d8ed8289da5f957879ab94);
                             }
                         }
                         if (count($this->extendedGroups)) {
                             $v8d777f385d3dfec8815d20f7496026dc['extended']['groups'] = array();
                             $v8d777f385d3dfec8815d20f7496026dc['extended']['groups']['nodes:group'] = array();
                             $v726e8e4809d4c1b28a6549d86436a124 = $va8cfde6331bd59eb2ac96f8911c4b666->getType();
                             foreach ($this->extendedGroups as $v400b99ba03a116687d9e17a661ee0628) {
                                 $vdb0f6f37ebeb6ea09489124345af2a45 = $v726e8e4809d4c1b28a6549d86436a124->getFieldsGroupByName($v400b99ba03a116687d9e17a661ee0628);
                                 if (!$vdb0f6f37ebeb6ea09489124345af2a45 instanceof umiFieldsGroup) {
                                     continue;
                                 }
                                 $v8d777f385d3dfec8815d20f7496026dc['extended']['groups']['nodes:group'][] = translatorWrapper::get($vdb0f6f37ebeb6ea09489124345af2a45)->translateProperties($vdb0f6f37ebeb6ea09489124345af2a45, $va8cfde6331bd59eb2ac96f8911c4b666);
                             }
                         }
                     }
                     $v5891da2d64975cae48d175d1e001f5da[] = $v8d777f385d3dfec8815d20f7496026dc;
                 }
             }
             $v10573b873d2fa5a365d558a45e328e47['nodes:item'] = $v5891da2d64975cae48d175d1e001f5da;
             if (isset($v47c80780ab608cc046f2a6e6f071feb6['total'])) {
                 $v10573b873d2fa5a365d558a45e328e47['total'] = $v47c80780ab608cc046f2a6e6f071feb6['total'];
             }
             break;
         case "count":
             $v10573b873d2fa5a365d558a45e328e47['total'] = $v47c80780ab608cc046f2a6e6f071feb6;
             break;
         default:
             $v10573b873d2fa5a365d558a45e328e47['error'] = "Unknown result mode \"{$this->mode}\"";
             break;
     }
     $v10573b873d2fa5a365d558a45e328e47['attribute:module'] = $this->scheme;
     $v10573b873d2fa5a365d558a45e328e47['attribute:method'] = $this->selectionName;
     $result = parent::translateToXml($v10573b873d2fa5a365d558a45e328e47);
     return $result;
 }
コード例 #6
0
 protected function translateData(iUmiObject $va8cfde6331bd59eb2ac96f8911c4b666)
 {
     $v16b2b26000987faccb260b9d39df1269 = $va8cfde6331bd59eb2ac96f8911c4b666->getId();
     $v26b75b176d665f24a5fd22a2ad815763 = array();
     $v26b75b176d665f24a5fd22a2ad815763['attribute:id'] = $v16b2b26000987faccb260b9d39df1269;
     $v26b75b176d665f24a5fd22a2ad815763['attribute:guid'] = $va8cfde6331bd59eb2ac96f8911c4b666->getGUID();
     $v26b75b176d665f24a5fd22a2ad815763['attribute:name'] = $va8cfde6331bd59eb2ac96f8911c4b666->getName();
     $v26b75b176d665f24a5fd22a2ad815763['attribute:type-id'] = $va8cfde6331bd59eb2ac96f8911c4b666->getTypeId();
     $v26b75b176d665f24a5fd22a2ad815763['attribute:type-guid'] = $va8cfde6331bd59eb2ac96f8911c4b666->getTypeGUID();
     $vb0ab4f7791b60b1e8ea01057b77873b0 = $va8cfde6331bd59eb2ac96f8911c4b666->getOwnerId();
     if ($vb0ab4f7791b60b1e8ea01057b77873b0) {
         $v26b75b176d665f24a5fd22a2ad815763['attribute:ownerId'] = $vb0ab4f7791b60b1e8ea01057b77873b0;
     }
     if ($this->isFull === false) {
         $v26b75b176d665f24a5fd22a2ad815763['xlink:href'] = "uobject://" . $v16b2b26000987faccb260b9d39df1269;
         return $v26b75b176d665f24a5fd22a2ad815763;
     }
     $v6301cee35ea764a1e241978f93f01069 = $va8cfde6331bd59eb2ac96f8911c4b666->getTypeId();
     $v726e8e4809d4c1b28a6549d86436a124 = umiObjectTypesCollection::getInstance()->getType($v6301cee35ea764a1e241978f93f01069);
     $v143fdbfa2afa490e521056bd5040d5fd = $v726e8e4809d4c1b28a6549d86436a124->getFieldsGroupsList();
     if (!is_null(getRequest('links'))) {
         $v8b1dc169bf460ee884fceef66c6607d6 = cmsController::getInstance();
         $vef8eea3357eeef6f5ddb3d707ff0e8e8 = umiHierarchyTypesCollection::getInstance();
         $v9b81909fd0da3add2602a8d0ede0e4e7 = umiObjectTypesCollection::getInstance();
         $v641ee90996ed9781bf72b559b9c90742 = $v726e8e4809d4c1b28a6549d86436a124;
         $v865c0c0b4ab0e063e5caa3387c1a8741 = 0;
         do {
             $vacf567c9c3d6cf7c6e2cc0ce108e0631 = $v641ee90996ed9781bf72b559b9c90742->getHierarchyTypeId();
             $v89b0b9deff65f8b9cd1f71bc74ce36ba = $vef8eea3357eeef6f5ddb3d707ff0e8e8->getType($vacf567c9c3d6cf7c6e2cc0ce108e0631);
             if ($v641ee90996ed9781bf72b559b9c90742->getParentId()) {
                 $v641ee90996ed9781bf72b559b9c90742 = $v9b81909fd0da3add2602a8d0ede0e4e7->getType($v641ee90996ed9781bf72b559b9c90742->getParentId());
                 break;
             }
             if ($v641ee90996ed9781bf72b559b9c90742->getParentId() == 0) {
                 break;
             }
         } while (!$v89b0b9deff65f8b9cd1f71bc74ce36ba && $v641ee90996ed9781bf72b559b9c90742);
         if ($v89b0b9deff65f8b9cd1f71bc74ce36ba instanceof iUmiHierarchyType) {
             $v52a43e48ec4649dee819dadabcab1bde = $v89b0b9deff65f8b9cd1f71bc74ce36ba->getName();
             $vddaa6e8c8c412299272e183087b8f7b6 = $v89b0b9deff65f8b9cd1f71bc74ce36ba->getExt();
             if ($ve52043002b9b5525cbc3f3bee69ff9b4 = $v8b1dc169bf460ee884fceef66c6607d6->getModule($v52a43e48ec4649dee819dadabcab1bde)) {
                 $v2a304a1348456ccd2234cd71a81bd338 = $ve52043002b9b5525cbc3f3bee69ff9b4->getObjectEditLink($v16b2b26000987faccb260b9d39df1269, $vddaa6e8c8c412299272e183087b8f7b6);
                 if ($v2a304a1348456ccd2234cd71a81bd338 !== false) {
                     $v26b75b176d665f24a5fd22a2ad815763['edit-link'] = $v2a304a1348456ccd2234cd71a81bd338;
                 }
             }
         }
         if (!isset($v26b75b176d665f24a5fd22a2ad815763['edit-link']) && $v8b1dc169bf460ee884fceef66c6607d6->getCurrentModule() == 'data' && $v8b1dc169bf460ee884fceef66c6607d6->getCurrentMethod() == 'guide_items') {
             $v764b2484f7ecf6b627a89fd3f7fe9f3d = $v8b1dc169bf460ee884fceef66c6607d6->getModule('data');
             $v26b75b176d665f24a5fd22a2ad815763['edit-link'] = $v764b2484f7ecf6b627a89fd3f7fe9f3d->getObjectEditLink($v16b2b26000987faccb260b9d39df1269);
         }
     }
     $v26b75b176d665f24a5fd22a2ad815763['properties'] = array();
     $v26b75b176d665f24a5fd22a2ad815763['properties']['nodes:group'] = array();
     $v865c0c0b4ab0e063e5caa3387c1a8741 = 0;
     foreach ($v143fdbfa2afa490e521056bd5040d5fd as $vdb0f6f37ebeb6ea09489124345af2a45) {
         $v71ea3b11aebda17ad80b6499a6ab6fb0 = array();
         $v03f2ce8694aef1464a97f254c78a26ae = translatorWrapper::get($vdb0f6f37ebeb6ea09489124345af2a45);
         $v71ea3b11aebda17ad80b6499a6ab6fb0 = $v03f2ce8694aef1464a97f254c78a26ae->translateProperties($vdb0f6f37ebeb6ea09489124345af2a45, $va8cfde6331bd59eb2ac96f8911c4b666);
         if (!empty($v71ea3b11aebda17ad80b6499a6ab6fb0)) {
             $v26b75b176d665f24a5fd22a2ad815763['properties']['nodes:group'][getRequest('jsonMode') == "force" ? $v865c0c0b4ab0e063e5caa3387c1a8741++ : ++$v865c0c0b4ab0e063e5caa3387c1a8741] = $v71ea3b11aebda17ad80b6499a6ab6fb0;
         }
     }
     if (sizeof($v26b75b176d665f24a5fd22a2ad815763['properties']['nodes:group']) == 0) {
         unset($v26b75b176d665f24a5fd22a2ad815763['properties']);
     }
     return $v26b75b176d665f24a5fd22a2ad815763;
 }
コード例 #7
0
 protected function translateData(iUmiHierarchyElement $v8e2dcfd7e7e24b1ca76c1193f645902b)
 {
     $v7552cd149af7495ee7d8225974e50f80 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getId();
     $v26b75b176d665f24a5fd22a2ad815763 = array();
     $v8b1dc169bf460ee884fceef66c6607d6 = cmsController::getInstance();
     $vb81ca7c0ccaa77e7aa91936ab0070695 = umiHierarchy::getInstance();
     $v6942e8fa62b3cc9d93881a58210e2fd7 = umiHierarchyTypesCollection::getInstance();
     $v0e8133eb006c0f85ed9444ae07a60842 = umiObjectTypesCollection::getInstance();
     $v5891da2d64975cae48d175d1e001f5da = umiObjectsCollection::getInstance();
     $vb1444fb0c07653567ad325aa25d4e37a = regedit::getInstance();
     $v26b75b176d665f24a5fd22a2ad815763['@id'] = $v7552cd149af7495ee7d8225974e50f80;
     $v26b75b176d665f24a5fd22a2ad815763['@parentId'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getParentId();
     $v26b75b176d665f24a5fd22a2ad815763['@link'] = $vb81ca7c0ccaa77e7aa91936ab0070695->getPathById($v7552cd149af7495ee7d8225974e50f80);
     if ($vf62baf4c4ead98d50d516eca0ac5a746 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getIsDefault()) {
         $v26b75b176d665f24a5fd22a2ad815763['@is-default'] = $vf62baf4c4ead98d50d516eca0ac5a746;
     }
     if ($ve1c6c9ef2fcbe75f26f815c4ef2e60b4 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getIsVisible()) {
         $v26b75b176d665f24a5fd22a2ad815763['@is-visible'] = $ve1c6c9ef2fcbe75f26f815c4ef2e60b4;
     }
     if ($v4264c638e0098acb172519b0436db099 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getIsActive()) {
         $v26b75b176d665f24a5fd22a2ad815763['@is-active'] = $v4264c638e0098acb172519b0436db099;
     }
     if ($vf49e2553045b3240a95c36854d36dddc = $v8e2dcfd7e7e24b1ca76c1193f645902b->getIsDeleted()) {
         $v26b75b176d665f24a5fd22a2ad815763['@is-deleted'] = $vf49e2553045b3240a95c36854d36dddc;
     }
     $v840767d63139b4dca4928d5ec734c79e = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject()->getValue("lockuser");
     if ($v840767d63139b4dca4928d5ec734c79e > 0) {
         $v31e6b624e5c05c45b0f1e8a7f59801ba = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject()->getValue("locktime");
         $vcdd638e00095e76c42db80d69dfdec30 = $v8b1dc169bf460ee884fceef66c6607d6->getModule("users")->user_id;
         $vd5034fb9092631c8a2869ebb11b5c591 = $vb1444fb0c07653567ad325aa25d4e37a->getVal("//settings/lock_duration");
         if ($v31e6b624e5c05c45b0f1e8a7f59801ba && $v31e6b624e5c05c45b0f1e8a7f59801ba->timestamp + $vd5034fb9092631c8a2869ebb11b5c591 > time()) {
             if ($vcdd638e00095e76c42db80d69dfdec30 != $v840767d63139b4dca4928d5ec734c79e) {
                 $v797bf25c165393c1aa5fd92576e0f011['user-id'] = $v840767d63139b4dca4928d5ec734c79e;
                 $v0db00a6b60c9e7fa0cda63a96270ca2b = $v5891da2d64975cae48d175d1e001f5da->getObject($v840767d63139b4dca4928d5ec734c79e);
                 $v797bf25c165393c1aa5fd92576e0f011['login'] = $v0db00a6b60c9e7fa0cda63a96270ca2b->getValue("login");
                 $v797bf25c165393c1aa5fd92576e0f011['lname'] = $v0db00a6b60c9e7fa0cda63a96270ca2b->getValue("lname");
                 $v797bf25c165393c1aa5fd92576e0f011['fname'] = $v0db00a6b60c9e7fa0cda63a96270ca2b->getValue("fname");
                 $v797bf25c165393c1aa5fd92576e0f011['father-name'] = $v0db00a6b60c9e7fa0cda63a96270ca2b->getValue("father_name");
                 $v797bf25c165393c1aa5fd92576e0f011['locktime'] = $v31e6b624e5c05c45b0f1e8a7f59801ba->getFormattedDate();
                 $v797bf25c165393c1aa5fd92576e0f011['@ts'] = $v31e6b624e5c05c45b0f1e8a7f59801ba->timestamp;
                 $v26b75b176d665f24a5fd22a2ad815763['locked-by'] = $v797bf25c165393c1aa5fd92576e0f011;
             }
         } else {
             $va8cfde6331bd59eb2ac96f8911c4b666 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject();
             $va8cfde6331bd59eb2ac96f8911c4b666->setValue("lockuser", null);
             $va8cfde6331bd59eb2ac96f8911c4b666->setValue("locktime", null);
             $va8cfde6331bd59eb2ac96f8911c4b666->commit();
             $v8e2dcfd7e7e24b1ca76c1193f645902b->commit();
         }
     }
     $v71860c77c6745379b0d44304d66b6a13 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject();
     $vac89cc3bb8407b8f6f24df3d2f088752 = $v71860c77c6745379b0d44304d66b6a13->getValue("expiration_date");
     $ve7e2aab29960a1faeb82a86368ea4b58 = $v71860c77c6745379b0d44304d66b6a13->getValue("publish_status");
     $vdbf113427c1e27923793e77460b11ee7 = $v5891da2d64975cae48d175d1e001f5da->getObject($ve7e2aab29960a1faeb82a86368ea4b58);
     $v9acb44549b41563697bb490144ec6258 = array();
     if ($vb1444fb0c07653567ad325aa25d4e37a->getVal("//settings/expiration_control")) {
         if ($vdbf113427c1e27923793e77460b11ee7) {
             $v9acb44549b41563697bb490144ec6258['attribute:id'] = strlen($vfa816edb83e95bf0c8da580bdfd491ef = $vdbf113427c1e27923793e77460b11ee7->getValue("publish_status_id")) ? $vfa816edb83e95bf0c8da580bdfd491ef : 'page_status_publish';
             $v9acb44549b41563697bb490144ec6258['node:name'] = $vdbf113427c1e27923793e77460b11ee7->getName();
             $v018e77635d40709feb0c09c6fb84ee00['status'] = $v9acb44549b41563697bb490144ec6258;
             if ($vac89cc3bb8407b8f6f24df3d2f088752) {
                 $v018e77635d40709feb0c09c6fb84ee00['attribute:ts'] = $vac89cc3bb8407b8f6f24df3d2f088752->timestamp;
                 $v018e77635d40709feb0c09c6fb84ee00['date'] = $vac89cc3bb8407b8f6f24df3d2f088752->getFormattedDate();
                 $v018e77635d40709feb0c09c6fb84ee00['comments'] = $v71860c77c6745379b0d44304d66b6a13->getValue("publish_comments");
             }
         } else {
             $v9acb44549b41563697bb490144ec6258['@id'] = 'page_status_publish';
             $v9acb44549b41563697bb490144ec6258['#name'] = getLabel('object-status-publish');
             $v018e77635d40709feb0c09c6fb84ee00['status'] = $v9acb44549b41563697bb490144ec6258;
             $v018e77635d40709feb0c09c6fb84ee00['@ts'] = "";
         }
         $v26b75b176d665f24a5fd22a2ad815763['expiration'] = $v018e77635d40709feb0c09c6fb84ee00;
     }
     if (!is_null(getRequest('virtuals'))) {
         $v08a0dea3e6dbfe263d3379b421a06959 = $vb81ca7c0ccaa77e7aa91936ab0070695->checkIsVirtual(array($v7552cd149af7495ee7d8225974e50f80 => false));
         if (isset($v08a0dea3e6dbfe263d3379b421a06959[$v7552cd149af7495ee7d8225974e50f80]) && $v08a0dea3e6dbfe263d3379b421a06959[$v7552cd149af7495ee7d8225974e50f80]) {
             $v26b75b176d665f24a5fd22a2ad815763['virtual-copy'] = array('attribute:count' => $v08a0dea3e6dbfe263d3379b421a06959[$v7552cd149af7495ee7d8225974e50f80]);
         }
     }
     $v26b75b176d665f24a5fd22a2ad815763['@object-id'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject()->getId();
     $v26b75b176d665f24a5fd22a2ad815763['@object-guid'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject()->getGUID();
     $v26b75b176d665f24a5fd22a2ad815763['@type-id'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject()->getTypeId();
     $v26b75b176d665f24a5fd22a2ad815763['@type-guid'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject()->getTypeGUID();
     $v26b75b176d665f24a5fd22a2ad815763['@update-time'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getUpdatetime();
     $v26b75b176d665f24a5fd22a2ad815763['@alt-name'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getAltName();
     if (!is_null(getRequest('templates'))) {
         $v26b75b176d665f24a5fd22a2ad815763['@template-id'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getTplId();
         $v26b75b176d665f24a5fd22a2ad815763['@domain-id'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getDomainId();
         $v26b75b176d665f24a5fd22a2ad815763['@lang-id'] = $v8e2dcfd7e7e24b1ca76c1193f645902b->getLangId();
     }
     if (!is_null(getRequest('childs'))) {
         $vadce578d04ed03c31f6ac59451fcf8e4 = $vb81ca7c0ccaa77e7aa91936ab0070695->getChildsCount($v7552cd149af7495ee7d8225974e50f80, true, true, 1);
         $v26b75b176d665f24a5fd22a2ad815763['childs'] = $vadce578d04ed03c31f6ac59451fcf8e4;
     }
     if (!is_null(getRequest('permissions'))) {
         $vfd7b7118ef3b11157505a66f465d672f = permissionsCollection::getInstance();
         $v61b9295e93e2ba331ea1e6f1b79f459d = $vfd7b7118ef3b11157505a66f465d672f->isAllowedObject($vfd7b7118ef3b11157505a66f465d672f->getUserId(), $v7552cd149af7495ee7d8225974e50f80);
         $v26b75b176d665f24a5fd22a2ad815763['permissions'] = ($v61b9295e93e2ba331ea1e6f1b79f459d[4] ? 16 : 0) | ($v61b9295e93e2ba331ea1e6f1b79f459d[3] ? 8 : 0) | ($v61b9295e93e2ba331ea1e6f1b79f459d[2] ? 4 : 0) | ($v61b9295e93e2ba331ea1e6f1b79f459d[1] ? 2 : 0) | ($v61b9295e93e2ba331ea1e6f1b79f459d[0] ? 1 : 0);
     }
     $v0715f6d9497f93911417c9c324265771 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getTypeId();
     $vb946c44d711ade3b061653732977d043 = $v6942e8fa62b3cc9d93881a58210e2fd7->getType($v0715f6d9497f93911417c9c324265771);
     if (!is_null(getRequest('links')) && !$v8e2dcfd7e7e24b1ca76c1193f645902b->isDeleted) {
         $v5cd36db381c0678623647c8c221e158e = $vb946c44d711ade3b061653732977d043->getName();
         if ($v35360fb26b66092afbb3474e0dfe5c73 = $v8b1dc169bf460ee884fceef66c6607d6->getModule($v5cd36db381c0678623647c8c221e158e)) {
             $v807765384d9d5527da8848df14a4f02f = $v35360fb26b66092afbb3474e0dfe5c73->getEditLink($v7552cd149af7495ee7d8225974e50f80, $vb946c44d711ade3b061653732977d043->getExt());
             if (is_array($v807765384d9d5527da8848df14a4f02f)) {
                 if ($v807765384d9d5527da8848df14a4f02f[0]) {
                     $v26b75b176d665f24a5fd22a2ad815763['create-link'] = $v807765384d9d5527da8848df14a4f02f[0];
                 }
                 if ($v807765384d9d5527da8848df14a4f02f[1]) {
                     $v26b75b176d665f24a5fd22a2ad815763['edit-link'] = $v807765384d9d5527da8848df14a4f02f[1];
                 }
             }
         }
     }
     if ($vb946c44d711ade3b061653732977d043 instanceof iUmiHierarchyType) {
         $v26b75b176d665f24a5fd22a2ad815763['basetype'] = $vb946c44d711ade3b061653732977d043;
     }
     $v26b75b176d665f24a5fd22a2ad815763['name'] = str_replace(array("<", ">"), array('&lt;', '&gt;'), $v8e2dcfd7e7e24b1ca76c1193f645902b->getName());
     if ($this->isFull == false) {
         $v26b75b176d665f24a5fd22a2ad815763['xlink:href'] = "upage://" . $v7552cd149af7495ee7d8225974e50f80;
         return $v26b75b176d665f24a5fd22a2ad815763;
     }
     $va8cfde6331bd59eb2ac96f8911c4b666 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject();
     $v6301cee35ea764a1e241978f93f01069 = $va8cfde6331bd59eb2ac96f8911c4b666->getTypeId();
     $v726e8e4809d4c1b28a6549d86436a124 = $v0e8133eb006c0f85ed9444ae07a60842->getType($v6301cee35ea764a1e241978f93f01069);
     $v143fdbfa2afa490e521056bd5040d5fd = $v726e8e4809d4c1b28a6549d86436a124->getFieldsGroupsList();
     $v26b75b176d665f24a5fd22a2ad815763['properties'] = array('nodes:group' => array());
     $v865c0c0b4ab0e063e5caa3387c1a8741 = 0;
     foreach ($v143fdbfa2afa490e521056bd5040d5fd as $vdb0f6f37ebeb6ea09489124345af2a45) {
         $v03f2ce8694aef1464a97f254c78a26ae = translatorWrapper::get($vdb0f6f37ebeb6ea09489124345af2a45);
         $vb1a1a039830b9d5ddf71ccd5304e9e50 = $v03f2ce8694aef1464a97f254c78a26ae->translateProperties($vdb0f6f37ebeb6ea09489124345af2a45, $va8cfde6331bd59eb2ac96f8911c4b666);
         if (!empty($vb1a1a039830b9d5ddf71ccd5304e9e50)) {
             $v26b75b176d665f24a5fd22a2ad815763['properties']['nodes:group'][getRequest('jsonMode') == "force" ? $v865c0c0b4ab0e063e5caa3387c1a8741++ : ++$v865c0c0b4ab0e063e5caa3387c1a8741] = $vb1a1a039830b9d5ddf71ccd5304e9e50;
         }
     }
     return $v26b75b176d665f24a5fd22a2ad815763;
 }
コード例 #8
0
 /**
  * @static
  * Выполняет разбор шаблона, используя необходимый шаблонизатор в зависимости от режима работы макросов
  *
  * @param mixed $template - шаблон для разбора
  * @param array $arr - массив переменнх
  * @param bool|int $parseElementPropsId - установить id страницы в качестве области видимости блока
  * @param bool|int $parseObjectPropsId  - установить id объекта в качестве области видимости блока
  * @param null|bool $xsltResultMode - принудительно устанавливает режим работы макросов перед разбором
  * и восстанавливает предыдущий режим работы в конце работы
  * @return mixed - результат разбора шаблона
  */
 public static function parseTemplate($template, $arr, $parseElementPropsId = false, $parseObjectPropsId = false, $xsltResultMode = null)
 {
     $controller = cmsController::getInstance();
     if (!is_array($arr)) {
         $arr = array();
     }
     $oldResultMode = null;
     if (is_bool($xsltResultMode)) {
         $oldResultMode = self::isXSLTResultMode($xsltResultMode);
     }
     if (self::isXSLTResultMode()) {
         //$templater = umiTemplater::create('XSLT');
         $result = array();
         $extProps = self::getMacrosExtendedProps();
         $extGroups = self::getMacrosExtendedGroups();
         if ((!empty($extProps) || !empty($extGroups)) && ($parseElementPropsId || $parseObjectPropsId)) {
             if ($parseElementPropsId) {
                 $entity = umiHierarchy::getInstance()->getElement($parseElementPropsId);
                 if ($entity) {
                     $entity = $entity->getObject();
                 }
             } else {
                 $entity = umiObjectsCollection::getInstance()->getObject($parseObjectPropsId);
             }
             /**
              * @var umiObject $entity
              */
             if ($entity) {
                 $extPropsInfo = array();
                 foreach ($extProps as $fieldName) {
                     if ($fieldName == 'name' && !isset($arr['attribute:name'], $arr['@name'])) {
                         $arr['@name'] = $entity->getName();
                     } elseif ($extProp = $entity->getPropByName($fieldName)) {
                         $extPropsInfo[] = $extProp;
                     }
                 }
                 if (count($extPropsInfo)) {
                     if (!isset($arr['extended'])) {
                         $arr['extended'] = array();
                     }
                     $arr['extended']['properties'] = array('+property' => $extPropsInfo);
                 }
                 $extGroupsInfo = array();
                 foreach ($extGroups as $groupName) {
                     if ($group = $entity->getType()->getFieldsGroupByName($groupName)) {
                         $groupWrapper = translatorWrapper::get($group);
                         $extGroupsInfo[] = $groupWrapper->translateProperties($group, $entity);
                     }
                 }
                 if (count($extGroupsInfo)) {
                     if (!isset($arr['extended'])) {
                         $arr['extended'] = array();
                     }
                     $arr['extended']['groups'] = array('+group' => $extGroupsInfo);
                 }
             }
         }
         foreach ($arr as $key => $val) {
             if (is_null($val) || $val === false || $val === "") {
                 continue;
             }
             if (is_array($val)) {
                 $val = self::parseTemplate($template, $val);
             }
             $subKey = xmlTranslator::getSubKey($key);
             if ($subKey == "subnodes") {
                 $realKey = xmlTranslator::getRealKey($key);
                 $result[$realKey] = array('nodes:item' => $val);
                 continue;
             }
             $result[$key] = $val;
         }
         return $result;
     } else {
         $templater = umiTemplater::create('TPL');
         $variables = array();
         foreach ($arr as $m => $v) {
             $m = self::getRealKey($m);
             if (is_array($v)) {
                 $res = "";
                 $v = array_values($v);
                 $sz = sizeof($v);
                 for ($i = 0; $i < $sz; $i++) {
                     $str = $v[$i];
                     $listClassFirst = $i == 0 ? "first" : "";
                     $listClassLast = $i == $sz - 1 ? "last" : "";
                     $listClassOdd = ($i + 1) % 2 == 0 ? "odd" : "";
                     $listClassEven = $listClassOdd ? "" : "even";
                     $listPosition = $i + 1;
                     $listComma = $listClassLast ? '' : ', ';
                     $from = array('%list-class-first%', '%list-class-last%', '%list-class-odd%', '%list-class-even%', '%list-position%', '%list-comma%');
                     $to = array($listClassFirst, $listClassLast, $listClassOdd, $listClassEven, $listPosition, $listComma);
                     $res .= str_replace($from, $to, $str);
                 }
                 $v = $res;
             }
             if (!is_object($v)) {
                 $variables[$m] = $v;
             }
         }
         $arr = $variables;
     }
     $templater->setScope($parseElementPropsId, $parseObjectPropsId);
     $result = $templater->parse($arr, $template);
     if (!is_null($oldResultMode)) {
         self::isXSLTResultMode($oldResultMode);
     }
     return $result;
 }