Exemplo n.º 1
0
 protected function translateToXml()
 {
     $args = func_get_args();
     $v599dcce2998a6b40b1e38e8c6006cb0a = $args[0];
     switch (false) {
         case is_null($this->field_name):
             $v3aabf39f2d943fa886d86dcbbee4d910 = $v599dcce2998a6b40b1e38e8c6006cb0a->getFieldId($this->field_name);
             $v06e3d36fa30cea095545139854ad1fb9 = umiFieldsCollection::getInstance()->getField($v3aabf39f2d943fa886d86dcbbee4d910);
             $v10573b873d2fa5a365d558a45e328e47 = array("full:field" => $v06e3d36fa30cea095545139854ad1fb9);
             break;
         case is_null($this->group_name):
             $vdb0f6f37ebeb6ea09489124345af2a45 = $v599dcce2998a6b40b1e38e8c6006cb0a->getFieldsGroupByName($this->group_name);
             $v10573b873d2fa5a365d558a45e328e47 = array("full:group" => $vdb0f6f37ebeb6ea09489124345af2a45);
             break;
         case !is_array($v599dcce2998a6b40b1e38e8c6006cb0a):
             $v10573b873d2fa5a365d558a45e328e47 = array();
             $v10573b873d2fa5a365d558a45e328e47 = array("nodes:type" => $v599dcce2998a6b40b1e38e8c6006cb0a);
             break;
         default:
             $v10573b873d2fa5a365d558a45e328e47 = array("full:type" => $v599dcce2998a6b40b1e38e8c6006cb0a);
             break;
     }
     return parent::translateToXml($v10573b873d2fa5a365d558a45e328e47);
 }
Exemplo n.º 2
0
 protected function collection()
 {
     switch ($this->requestedType) {
         case 'object':
             return umiObjectsCollection::getInstance();
         case 'page':
             return umiHierarchy::getInstance();
         case 'object-type':
             return umiObjectTypesCollection::getInstance();
         case 'hierarchy-type':
             return umiHierarchyTypesCollection::getInstance();
         case 'field':
             return umiFieldsCollection::getInstance();
         case 'field-type':
             return umiFieldTypesCollection::getInstance();
         case 'domain':
             return domainsCollection::getInstance();
         case 'lang':
             return langsCollection::getInstance();
     }
 }
 protected function analyzeHeaders(umiObjectType $v726e8e4809d4c1b28a6549d86436a124, $v4340fd73e75df7a9d9e45902a59ba3a4)
 {
     $result = array();
     $vd05b6ed7d2345020440df396d6da7f73 = umiFieldsCollection::getInstance();
     $v865c0c0b4ab0e063e5caa3387c1a8741 = 0;
     foreach ($v4340fd73e75df7a9d9e45902a59ba3a4 as $vd5d3db1765287eef77d7927cc956f50a) {
         switch (wa_strtolower($vd5d3db1765287eef77d7927cc956f50a)) {
             case 'id':
                 $result['id'] = $vd5d3db1765287eef77d7927cc956f50a;
                 break;
             case wa_strtolower(getLabel('label-name')):
                 $result['name'] = $vd5d3db1765287eef77d7927cc956f50a;
                 break;
             case wa_strtolower(getLabel('label-alt-name')):
                 if ($this->mode == 'element') {
                     $result['alt-name'] = $vd5d3db1765287eef77d7927cc956f50a;
                     break;
                 }
             case wa_strtolower(getLabel('field-is_active')):
                 if ($this->mode == 'element') {
                     $result['is-active'] = $vd5d3db1765287eef77d7927cc956f50a;
                     break;
                 }
             default:
                 $v945100186b119048837b9859c2c46410 = $this->getFieldId($v726e8e4809d4c1b28a6549d86436a124, $vd5d3db1765287eef77d7927cc956f50a);
                 $v06e3d36fa30cea095545139854ad1fb9 = $vd05b6ed7d2345020440df396d6da7f73->getField($v945100186b119048837b9859c2c46410);
                 if ($v06e3d36fa30cea095545139854ad1fb9 instanceof umiField) {
                     $result[$v06e3d36fa30cea095545139854ad1fb9->getName()] = $vd5d3db1765287eef77d7927cc956f50a;
                 } else {
                     $result['unkonwn-field-' . ++$v865c0c0b4ab0e063e5caa3387c1a8741] = $vd5d3db1765287eef77d7927cc956f50a;
                 }
         }
     }
     return $result;
 }
Exemplo n.º 4
0
 private function getDataByFieldId($v3aabf39f2d943fa886d86dcbbee4d910)
 {
     if ($v06e3d36fa30cea095545139854ad1fb9 = umiFieldsCollection::getInstance()->getField($v3aabf39f2d943fa886d86dcbbee4d910)) {
         $v1e3f04102267eaf5e8d0ca424fd5c561 = $v06e3d36fa30cea095545139854ad1fb9->getFieldTypeId();
         if ($v519504d7d4beb745dac24ccfb6c1d7c9 = umiFieldTypesCollection::getInstance()->getFieldType($v1e3f04102267eaf5e8d0ca424fd5c561)) {
             if ($v17f71d965fe9589ddbd11caf7182243e = $v519504d7d4beb745dac24ccfb6c1d7c9->getDataType()) {
                 return umiFieldType::getDataTypeDB($v17f71d965fe9589ddbd11caf7182243e);
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
 public function assembleErrorFieldsArray($errorFields)
 {
     $result = array();
     $collection = umiFieldsCollection::getInstance();
     foreach ($errorFields as $fieldId) {
         $field = $collection->getField($fieldId);
         $result[] = "data[new][{$field->getName()}]";
     }
     return $result;
 }
 public function saveAddedFieldData($ve62e4d22f2d8630f6e44e2b7c3f70ddc)
 {
     $v0e939a4ffd3aacd724dd3b50147b4353 = $ve62e4d22f2d8630f6e44e2b7c3f70ddc['group-id'];
     $v94757cae63fd3e398c0811a976dd6bbe = $ve62e4d22f2d8630f6e44e2b7c3f70ddc['type-id'];
     $vcaf9b6b99962bf5c2264824231d7a40c = getRequest('data');
     $vd5d3db1765287eef77d7927cc956f50a = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'title');
     $vb068931cc450442b63f5b3d276ea4297 = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'name');
     $ve1c6c9ef2fcbe75f26f815c4ef2e60b4 = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'is_visible');
     $v1e3f04102267eaf5e8d0ca424fd5c561 = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'field_type_id');
     $v051369818a8073bba5feeb0e957eb308 = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'guide_id');
     $v5fa2ecd1dc485ead330e65903d19650a = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'in_search');
     $ve4a2ed2dde6e8354ae6f321744843084 = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'in_filter');
     $v6a2139364f96787c8ce1bbb0070b898c = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'tip');
     $v2a9d32d17ad47ac15c87d2e7c96d0e69 = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'is_required');
     $v6b1a57fa235477758817df3c91158006 = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'restriction_id');
     $v0e8133eb006c0f85ed9444ae07a60842 = umiObjectTypesCollection::getInstance();
     $vd05b6ed7d2345020440df396d6da7f73 = umiFieldsCollection::getInstance();
     $v69552af3a03df9391f70eb1851f817c5 = umiFieldTypesCollection::getInstance();
     $v599dcce2998a6b40b1e38e8c6006cb0a = $v0e8133eb006c0f85ed9444ae07a60842->getType($v94757cae63fd3e398c0811a976dd6bbe);
     if ($v599dcce2998a6b40b1e38e8c6006cb0a instanceof umiObjectType) {
         if ($v599dcce2998a6b40b1e38e8c6006cb0a->getFieldId($vb068931cc450442b63f5b3d276ea4297)) {
             throw new publicAdminException(getLabel('error-non-unique-field-name'));
         }
     }
     $v19dad066c23a79c33b2975590e364a5a = $v69552af3a03df9391f70eb1851f817c5->getFieldType($v1e3f04102267eaf5e8d0ca424fd5c561);
     $v983560f49ede87197144b22c810a5087 = $v19dad066c23a79c33b2975590e364a5a->getDataType();
     if ($v983560f49ede87197144b22c810a5087 == "relation" && $v051369818a8073bba5feeb0e957eb308 == 0) {
         $v051369818a8073bba5feeb0e957eb308 = self::getAutoGuideId($vd5d3db1765287eef77d7927cc956f50a);
     }
     if ($v983560f49ede87197144b22c810a5087 == "optioned" && $v051369818a8073bba5feeb0e957eb308 == 0) {
         $va98d7ac1b7459c54b19858e934794517 = $v0e8133eb006c0f85ed9444ae07a60842->getTypeIdByGUID('emarket-itemoption');
         $v051369818a8073bba5feeb0e957eb308 = self::getAutoGuideId($vd5d3db1765287eef77d7927cc956f50a, $va98d7ac1b7459c54b19858e934794517);
     }
     $v3aabf39f2d943fa886d86dcbbee4d910 = false;
     $va08f2aee9de301619776deb6fee83e50 = $v599dcce2998a6b40b1e38e8c6006cb0a->getParentId();
     $v3f5af10cbb47cb1b6fcf196befc17b95 = $v0e8133eb006c0f85ed9444ae07a60842->getSubTypesList($va08f2aee9de301619776deb6fee83e50);
     foreach ($v3f5af10cbb47cb1b6fcf196befc17b95 as $veb2c84964aa55a68255b7466cd21b62c) {
         if ($veb2c84964aa55a68255b7466cd21b62c == $v94757cae63fd3e398c0811a976dd6bbe) {
             continue;
         }
         $v4ae5fdeb89c7a5a5daf33112bda3f82b = $v0e8133eb006c0f85ed9444ae07a60842->getType($veb2c84964aa55a68255b7466cd21b62c);
         if ($v4ae5fdeb89c7a5a5daf33112bda3f82b instanceof umiObjectType == false) {
             continue;
         }
         if ($v6270c3e00735121953b8585fd836af43 = $v4ae5fdeb89c7a5a5daf33112bda3f82b->getFieldId($vb068931cc450442b63f5b3d276ea4297)) {
             $vd3b250b73d77cb502490809548ef475e = $vd05b6ed7d2345020440df396d6da7f73->getField($v6270c3e00735121953b8585fd836af43);
             if ($vd3b250b73d77cb502490809548ef475e instanceof umiField == false) {
                 continue;
             }
             if ($vd3b250b73d77cb502490809548ef475e->getFieldTypeId() == $v1e3f04102267eaf5e8d0ca424fd5c561 && $vd3b250b73d77cb502490809548ef475e->getTitle() == $vd5d3db1765287eef77d7927cc956f50a) {
                 $v3aabf39f2d943fa886d86dcbbee4d910 = $v6270c3e00735121953b8585fd836af43;
                 break;
             }
         }
     }
     $v6a8e34c52627084d431e3b4c6edebc2d = $v0e8133eb006c0f85ed9444ae07a60842->getSubTypesList($v94757cae63fd3e398c0811a976dd6bbe);
     foreach ($v6a8e34c52627084d431e3b4c6edebc2d as $vdff2729c2ea51cc1722c9df2117032bd) {
         $va0100f1c342300cc8f1c583d2b4ad9ee = $v0e8133eb006c0f85ed9444ae07a60842->getType($vdff2729c2ea51cc1722c9df2117032bd);
         if ($va0100f1c342300cc8f1c583d2b4ad9ee instanceof umiObjectType == false) {
             continue;
         }
         if ($ve6b31d5d6cb774ba4498162622b2575a = $va0100f1c342300cc8f1c583d2b4ad9ee->getFieldId($vb068931cc450442b63f5b3d276ea4297)) {
             $v9efe917b2c0f25687fa4b5e2a36edd5c = $vd05b6ed7d2345020440df396d6da7f73->getField($ve6b31d5d6cb774ba4498162622b2575a);
             if ($v9efe917b2c0f25687fa4b5e2a36edd5c instanceof umiField == false) {
                 continue;
             }
             if ($v9efe917b2c0f25687fa4b5e2a36edd5c->getFieldTypeId() == $v1e3f04102267eaf5e8d0ca424fd5c561 && $v9efe917b2c0f25687fa4b5e2a36edd5c->getTitle() == $vd5d3db1765287eef77d7927cc956f50a) {
                 $v3aabf39f2d943fa886d86dcbbee4d910 = $ve6b31d5d6cb774ba4498162622b2575a;
                 break;
             }
         }
     }
     if ($v3aabf39f2d943fa886d86dcbbee4d910 === false) {
         $v3aabf39f2d943fa886d86dcbbee4d910 = $vd05b6ed7d2345020440df396d6da7f73->addField($vb068931cc450442b63f5b3d276ea4297, $vd5d3db1765287eef77d7927cc956f50a, $v1e3f04102267eaf5e8d0ca424fd5c561, $ve1c6c9ef2fcbe75f26f815c4ef2e60b4, false, false);
         $v06e3d36fa30cea095545139854ad1fb9 = $vd05b6ed7d2345020440df396d6da7f73->getField($v3aabf39f2d943fa886d86dcbbee4d910);
         $v06e3d36fa30cea095545139854ad1fb9->setGuideId($v051369818a8073bba5feeb0e957eb308);
         $v06e3d36fa30cea095545139854ad1fb9->setIsInSearch($v5fa2ecd1dc485ead330e65903d19650a);
         $v06e3d36fa30cea095545139854ad1fb9->setIsInFilter($ve4a2ed2dde6e8354ae6f321744843084);
         $v06e3d36fa30cea095545139854ad1fb9->setTip($v6a2139364f96787c8ce1bbb0070b898c);
         $v06e3d36fa30cea095545139854ad1fb9->setIsRequired($v2a9d32d17ad47ac15c87d2e7c96d0e69);
         $v06e3d36fa30cea095545139854ad1fb9->setRestrictionId($v6b1a57fa235477758817df3c91158006);
         $v06e3d36fa30cea095545139854ad1fb9->commit();
     }
     if ($v599dcce2998a6b40b1e38e8c6006cb0a instanceof umiObjectType) {
         $vdb0f6f37ebeb6ea09489124345af2a45 = $v599dcce2998a6b40b1e38e8c6006cb0a->getFieldsGroup($v0e939a4ffd3aacd724dd3b50147b4353);
         if ($vdb0f6f37ebeb6ea09489124345af2a45 instanceof umiFieldsGroup) {
             $vdb0f6f37ebeb6ea09489124345af2a45->attachField($v3aabf39f2d943fa886d86dcbbee4d910);
             $veeeb23fbd23e52a6a6ff78b9f18cbc4e = $vdb0f6f37ebeb6ea09489124345af2a45->getName();
             $vadce578d04ed03c31f6ac59451fcf8e4 = $v0e8133eb006c0f85ed9444ae07a60842->getChildClasses($v94757cae63fd3e398c0811a976dd6bbe);
             $v7dabf5c198b0bab2eaa42bb03a113e55 = sizeof($vadce578d04ed03c31f6ac59451fcf8e4);
             for ($v865c0c0b4ab0e063e5caa3387c1a8741 = 0; $v865c0c0b4ab0e063e5caa3387c1a8741 < $v7dabf5c198b0bab2eaa42bb03a113e55; $v865c0c0b4ab0e063e5caa3387c1a8741++) {
                 $vd4fd255f51559df00de5424b64292413 = $vadce578d04ed03c31f6ac59451fcf8e4[$v865c0c0b4ab0e063e5caa3387c1a8741];
                 $v793536b8480511c5e2975eba32738d1d = $v0e8133eb006c0f85ed9444ae07a60842->getType($vd4fd255f51559df00de5424b64292413);
                 if ($v793536b8480511c5e2975eba32738d1d instanceof umiObjectType) {
                     if ($v793536b8480511c5e2975eba32738d1d->getFieldId($vb068931cc450442b63f5b3d276ea4297) == $v3aabf39f2d943fa886d86dcbbee4d910) {
                         continue;
                     }
                     $vb19a4f118986f0631ceac2d003e1f4a3 = $v793536b8480511c5e2975eba32738d1d->getFieldsGroupByName($veeeb23fbd23e52a6a6ff78b9f18cbc4e);
                     if ($vb19a4f118986f0631ceac2d003e1f4a3 instanceof umiFieldsGroup) {
                         $vb19a4f118986f0631ceac2d003e1f4a3->attachField($v3aabf39f2d943fa886d86dcbbee4d910, true);
                     } else {
                         throw new coreException("Can't find umiFieldsGroup #{$veeeb23fbd23e52a6a6ff78b9f18cbc4e} in umiObjectType #{$vd4fd255f51559df00de5424b64292413}");
                     }
                 } else {
                     throw new coreException("Can't find umiObjectType #{$vd4fd255f51559df00de5424b64292413}");
                 }
             }
             return $v3aabf39f2d943fa886d86dcbbee4d910;
         } else {
             throw new coreException("Can't find umiFieldsGroup #{$v0e939a4ffd3aacd724dd3b50147b4353}");
         }
     } else {
         throw new coreException("Can't find umiObjectType #{$v94757cae63fd3e398c0811a976dd6bbe}");
     }
 }
 public function detachField($v3aabf39f2d943fa886d86dcbbee4d910)
 {
     if ($this->isLoaded($v3aabf39f2d943fa886d86dcbbee4d910)) {
         $v3aabf39f2d943fa886d86dcbbee4d910 = (int) $v3aabf39f2d943fa886d86dcbbee4d910;
         $vac5c74b64b4b8352ef2f181affb5ac2a = "DELETE FROM cms3_fields_controller WHERE field_id = '{$v3aabf39f2d943fa886d86dcbbee4d910}' AND group_id = '{$this->id}'";
         l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
         if ($v56bd7107802ebe56c6918992f0608ec6 = l_mysql_error()) {
             throw new coreException($v56bd7107802ebe56c6918992f0608ec6);
             return false;
         }
         unset($this->fields[$v3aabf39f2d943fa886d86dcbbee4d910]);
         $vac5c74b64b4b8352ef2f181affb5ac2a = "SELECT COUNT(*) FROM cms3_fields_controller WHERE field_id = '{$v3aabf39f2d943fa886d86dcbbee4d910}'";
         $result = l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
         if ($v56bd7107802ebe56c6918992f0608ec6 = l_mysql_error()) {
             throw new coreException($v56bd7107802ebe56c6918992f0608ec6);
             return false;
         }
         cacheFrontend::getInstance()->flush();
         if (list($v4a8a08f09d37b73795649038408b5f33) = mysql_fetch_row($result)) {
             return $v4a8a08f09d37b73795649038408b5f33 == 0 ? umiFieldsCollection::getInstance()->delField($v3aabf39f2d943fa886d86dcbbee4d910) : true;
         } else {
             return false;
         }
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 8
0
		public function type_field_edit() {
			$field_id = (int) getRequest('param0');
			$type_id = (int) getRequest('param1');
			$mode = (string) getRequest('param2');

			$field = umiFieldsCollection::getInstance()->getField($field_id);

			if($mode == "do") {
				$this->saveEditedFieldData($field);
				if(!getRequest('noredirect')) {
					$this->chooseRedirect();
				}
			}

			$this->setDataType("form");
			$this->setActionType("modify");

			$data = $this->prepareData($field, "field");

			$this->setData($data);
			return $this->doData();

		}
 protected function addMissedProps(&$v691b2ea4f2db17699a29da0c302a91ea, $v82e85d12802becdae851373fcc70c4ff, $v2741adf691b2acf0359a6a73234bc605)
 {
     if (strlen($v2741adf691b2acf0359a6a73234bc605)) {
         $v87306dd4235ed712ebc07fe169b76f83 = umiImportRelations::getInstance()->getNewTypeIdRelation($this->source_id, $v2741adf691b2acf0359a6a73234bc605);
     } else {
         $v87306dd4235ed712ebc07fe169b76f83 = $v691b2ea4f2db17699a29da0c302a91ea->getObject()->getTypeId();
     }
     $v7ae7003da59ae71dcc9f8638ef50593d = umiObjectTypesCollection::getInstance()->getType($v87306dd4235ed712ebc07fe169b76f83);
     foreach ($v82e85d12802becdae851373fcc70c4ff as $v6184026d3eb247fb90d471744679ece5) {
         $v2726ffa1d364725a0e3166638138e8e7 = $v6184026d3eb247fb90d471744679ece5['prop_block_title'];
         $vdf8958b8370cd74e1a8c33230a569b10 = $v6184026d3eb247fb90d471744679ece5['prop_block_name'];
         $ve41aac3b363ca7b963226f92ecda32d5 = $v6184026d3eb247fb90d471744679ece5['prop_block_is_public'];
         if (!$vdf8958b8370cd74e1a8c33230a569b10) {
             if ($v2726ffa1d364725a0e3166638138e8e7) {
                 $vdf8958b8370cd74e1a8c33230a569b10 = translit::convert($v2726ffa1d364725a0e3166638138e8e7);
             } else {
                 $v2726ffa1d364725a0e3166638138e8e7 = "Imported fields group";
                 $vdf8958b8370cd74e1a8c33230a569b10 = "imported";
             }
         }
         if ($v216c92e7f92d45ebbf45c075ceae8c05 = $v7ae7003da59ae71dcc9f8638ef50593d->getFieldsGroupByName($vdf8958b8370cd74e1a8c33230a569b10)) {
         } else {
             $vb2cd255a43fd56eb1b203b521fa0ef69 = $v7ae7003da59ae71dcc9f8638ef50593d->addFieldsGroup($vdf8958b8370cd74e1a8c33230a569b10, $vdf8958b8370cd74e1a8c33230a569b10, true, $ve41aac3b363ca7b963226f92ecda32d5);
             $v216c92e7f92d45ebbf45c075ceae8c05 = $v7ae7003da59ae71dcc9f8638ef50593d->getFieldsGroup($vb2cd255a43fd56eb1b203b521fa0ef69);
             $v216c92e7f92d45ebbf45c075ceae8c05->setTitle($v2726ffa1d364725a0e3166638138e8e7);
             $v216c92e7f92d45ebbf45c075ceae8c05->commit();
         }
         if (!$v6184026d3eb247fb90d471744679ece5['field_type']) {
             $v6184026d3eb247fb90d471744679ece5['field_type'] = "string";
         }
         $v1e3f04102267eaf5e8d0ca424fd5c561 = $this->getFieldTypeId($v6184026d3eb247fb90d471744679ece5['field_type'], $v6184026d3eb247fb90d471744679ece5['is_multiple']);
         if ($v1e3f04102267eaf5e8d0ca424fd5c561 === false) {
             continue;
         }
         $v6184026d3eb247fb90d471744679ece5['name'] = (string) $v6184026d3eb247fb90d471744679ece5['name'];
         if (!$v6184026d3eb247fb90d471744679ece5['name']) {
             $v6184026d3eb247fb90d471744679ece5['name'] = translit::convert($v6184026d3eb247fb90d471744679ece5['title']);
         }
         $v6184026d3eb247fb90d471744679ece5['name'] = translit::convert($v6184026d3eb247fb90d471744679ece5['name']);
         if ($v87306dd4235ed712ebc07fe169b76f83) {
             if (umiImportRelations::getInstance()->getNewFieldId($this->source_id, $v87306dd4235ed712ebc07fe169b76f83, $v6184026d3eb247fb90d471744679ece5['name'])) {
                 continue;
             }
         }
         if ($v6184026d3eb247fb90d471744679ece5['field_type'] == "relation") {
             $v051369818a8073bba5feeb0e957eb308 = self::getAutoGuideId($v6184026d3eb247fb90d471744679ece5['title']);
         } else {
             $v051369818a8073bba5feeb0e957eb308 = false;
         }
         $v3aabf39f2d943fa886d86dcbbee4d910 = umiFieldsCollection::getInstance()->addField($v6184026d3eb247fb90d471744679ece5['name'], $v6184026d3eb247fb90d471744679ece5['title'], $v1e3f04102267eaf5e8d0ca424fd5c561, $v6184026d3eb247fb90d471744679ece5['is_public'], false);
         $v06e3d36fa30cea095545139854ad1fb9 = umiFieldsCollection::getInstance()->getField($v3aabf39f2d943fa886d86dcbbee4d910);
         $v06e3d36fa30cea095545139854ad1fb9->setTip($v6184026d3eb247fb90d471744679ece5['tip']);
         if ($v051369818a8073bba5feeb0e957eb308) {
             $v06e3d36fa30cea095545139854ad1fb9->setGuideId($v051369818a8073bba5feeb0e957eb308);
         }
         $v06e3d36fa30cea095545139854ad1fb9->commit();
         $v216c92e7f92d45ebbf45c075ceae8c05->attachField($v3aabf39f2d943fa886d86dcbbee4d910);
         if ($v87306dd4235ed712ebc07fe169b76f83) {
             umiImportRelations::getInstance()->setFieldIdRelation($this->source_id, $v87306dd4235ed712ebc07fe169b76f83, $v6184026d3eb247fb90d471744679ece5['name'], $v3aabf39f2d943fa886d86dcbbee4d910);
         }
     }
 }
Exemplo n.º 10
0
 public function assembleErrorFields($errorFields)
 {
     $result = array();
     $collection = umiFieldsCollection::getInstance();
     foreach ($errorFields as $fieldId) {
         $field = $collection->getField($fieldId);
         $result[] = $field->getTitle();
     }
     //return !empty($result) ? implode('&', $result) : '';
     return !empty($result) ? implode(', ', $result) : '';
 }
 /**
  * Проверить, все ли обязательные для заполения поля имеют значения
  * @param umiObjectType $type тип данных редактируемого объекта
  * @param Array $data массив передаваемых значений
  * @param Integer $objectId id текущего объекта
  * @param Boolean $isNew true, если мы создаем новый объект или страницу
  * @param Array массив значений, при необходимости скорректированный
  */
 public function checkRequiredData(iUmiObjectType $objectType, $data, $objectId, $isNew)
 {
     if (!is_array($data)) {
         return $data;
     }
     $cmsController = cmsController::getInstance();
     $admin = $cmsController->getCurrentMode() == "admin";
     $wrongFieldsCount = 0;
     $fields = umiFieldsCollection::getInstance();
     foreach ($data as $fieldName => &$value) {
         $fieldId = $objectType->getFieldId($fieldName);
         $field = $fields->getField($fieldId);
         if ($field instanceof umiField == false) {
             continue;
         }
         if ($field->getIsRequired()) {
             if (is_null($value) || $value === false || $value === "") {
                 $fieldTitle = $field->getTitle();
                 $errstr = $admin ? "%errors_missed_field_value%" : getLabel('error-missed-field-value');
                 $this->errorNewMessage($errstr . " \"{$fieldTitle}\"", false, 100, "input-missed-field");
                 ++$wrongFieldsCount;
             }
         }
         if ($restrictionId = $field->getRestrictionId()) {
             $restriction = baseRestriction::get($restrictionId);
             if ($restriction instanceof baseRestriction) {
                 if ($restriction instanceof iNormalizeInRestriction) {
                     $value = $restriction->normalizeIn($value);
                 }
                 if ($restriction->validate($value) == false) {
                     $fieldTitle = $field->getTitle();
                     $errstr = $admin ? "%errors_wrong_field_value%" : getLabel('error-wrong-field-value');
                     $errstr .= " \"{$fieldTitle}\" - " . $restriction->getErrorMessage();
                     $this->errorNewMessage($errstr, false, 101, "input-wrong-field");
                     ++$wrongFieldsCount;
                 }
             }
         }
     }
     if ($wrongFieldsCount > 0) {
         if ($isNew && $objectId) {
             //Delete object and page if exists (thes don't fit for us)
             $hierarchy = umiHierarchy::getInstance();
             $elementIds = $hierarchy->getObjectInstances($objectId);
             if (sizeof($elementIds)) {
                 //Delete created page. For ever.
                 foreach ($elementIds as $elementId) {
                     $hierarchy->delElement($elementId);
                     $hierarchy->removeDeletedElement($elementId);
                 }
             }
             umiObjectsCollection::getInstance()->delObject($objectId);
         }
         $this->errorPanic();
     }
     return $data;
 }
Exemplo n.º 12
0
    /**
     * SQL-запрос, соответствующий кастомной логике для фильтров
     *
     * @return string
     */
    public function getSQL_customFilters()
    {
        $sSQL = <<<SQL
\t\t\tSELECT `coc`.`obj_id`
\t\t\tFROM `{$this->sContentTable}` AS `coc`
\t\t\tWHERE 1
SQL;
        $arCustomFilters = $this->customLogic->filters();
        if (empty($arCustomFilters)) {
            return "";
        }
        $oType = umiObjectTypesCollection::getInstance()->getType($this->objectsTypeId);
        if (!$oType) {
            return "";
        }
        foreach ($arCustomFilters as $i => $arCustomFilter) {
            $iFieldId = $oType->getFieldId($arCustomFilter[0]);
            $sCustomOperator = $arCustomFilter[1];
            $sOperator = "";
            $sValue = $arCustomFilter[2];
            switch ($sCustomOperator) {
                case "eq":
                    $sOperator = "IN";
                    $sValue = is_array($sValue) ? join("','", $sValue) : $sValue;
                    $sValue = "('" . $sValue . "')";
                    break;
                case "noteq":
                    $sOperator = "NOT IN";
                    $sValue = is_array($sValue) ? join("','", $sValue) : $sValue;
                    $sValue = "('" . $sValue . "')";
                    break;
                case "null":
                    $sOperator = "IS";
                    $sValue = "NULL";
                    break;
                case "notnull":
                    $sOperator = "IS NOT";
                    $sValue = "NULL";
                    break;
                case "gt":
                    $sOperator = ">=";
                    $sValue = trim($sValue);
                    break;
                case "lt":
                    $sOperator = "<=";
                    $sValue = trim($sValue);
                    break;
                case "like":
                    $sOperator = "LIKE";
                    break;
            }
            $oField = umiFieldsCollection::getField($iFieldId);
            if (!$oField) {
                continue;
            }
            $sColumn = umiFieldType::getDataTypeDB($oField->getFieldType()->getDataType());
            if (!$sColumn) {
                continue;
            }
            $sCustomExpression = "{$sColumn} {$sOperator} {$sValue}";
            if (in_array($sColumn, array("int_val", "float_val", "rel_val", "tree_val")) && $sValue == 0) {
                $sCustomExpression = "({$sCustomExpression} OR {$sColumn} IS NULL)";
            }
            $sSQL .= " AND `coc`.`obj_id` IN (SELECT `coc{$i}`.`obj_id` FROM `{$this->sContentTable}` AS `coc{$i}` WHERE `coc{$i}`.`field_id` = {$iFieldId}  AND {$sCustomExpression})";
        }
        return $sSQL;
    }
Exemplo n.º 13
0
 public function getFilteredPages($v94757cae63fd3e398c0811a976dd6bbe, $vdfc394bd05a4b48161c790034af522a8, $v2063c1608d6e0baf80249c42e2be5804, $v9d85c254b5062e518a134a61950999c3 = 10, $v66f6181bcb4cff4cd38fbc804a036db6 = "default", $v126424c808da347218ba631a78feaf04 = false, $v3aabf39f2d943fa886d86dcbbee4d910 = false, $v375a52cb87b22005816fe7a418ec6660 = true)
 {
     $ve1ba980ce14a8c0d7e2779f895ab8695 = getRequest('p');
     if ($v126424c808da347218ba631a78feaf04) {
         $ve1ba980ce14a8c0d7e2779f895ab8695 = 0;
     }
     list($v364f9b183bd2dd9e0beb45c754830a6c, $ve6a2fd7211958cfe50efa4d14bd332f5, $v28d65bb7a643774ada22f54ca0679289) = def_module::loadTemplates("filtered_pages/" . $v66f6181bcb4cff4cd38fbc804a036db6, "pages_block", "pages_block_line", "pages_block_empty");
     $v599dcce2998a6b40b1e38e8c6006cb0a = umiObjectTypesCollection::getInstance()->getType($v94757cae63fd3e398c0811a976dd6bbe);
     if ($v599dcce2998a6b40b1e38e8c6006cb0a instanceof umiObjectType) {
         if ($vf8a30f899e9d691c760031d60ea0f3a2 = $v599dcce2998a6b40b1e38e8c6006cb0a->getFieldId($vdfc394bd05a4b48161c790034af522a8)) {
             $v8be74552df93e31bbdd6b36ed74bdb6a = new umiSelection();
             $v8be74552df93e31bbdd6b36ed74bdb6a->forceHierarchyTable(true);
             $v8be74552df93e31bbdd6b36ed74bdb6a->addObjectType($v94757cae63fd3e398c0811a976dd6bbe);
             $v06e3d36fa30cea095545139854ad1fb9 = umiFieldsCollection::getInstance()->getField($vf8a30f899e9d691c760031d60ea0f3a2);
             if ($v051369818a8073bba5feeb0e957eb308 = $v06e3d36fa30cea095545139854ad1fb9->getGuideId()) {
                 if (!is_numeric($v2063c1608d6e0baf80249c42e2be5804)) {
                     $vd47c20d305d6a44856735d5fe5c086ca = umiObjectsCollection::getInstance()->getGuidedItems($v051369818a8073bba5feeb0e957eb308);
                     $v2063c1608d6e0baf80249c42e2be5804 = array_search($v2063c1608d6e0baf80249c42e2be5804, $vd47c20d305d6a44856735d5fe5c086ca);
                 }
             }
             $v8be74552df93e31bbdd6b36ed74bdb6a->addPropertyFilterEqual($vf8a30f899e9d691c760031d60ea0f3a2, $v2063c1608d6e0baf80249c42e2be5804);
             $v8be74552df93e31bbdd6b36ed74bdb6a->addPermissions();
             $v8be74552df93e31bbdd6b36ed74bdb6a->addLimit($v9d85c254b5062e518a134a61950999c3, $ve1ba980ce14a8c0d7e2779f895ab8695);
             $v8be74552df93e31bbdd6b36ed74bdb6a->addActiveFilter(true);
             if ($v3aabf39f2d943fa886d86dcbbee4d910) {
                 $v8be74552df93e31bbdd6b36ed74bdb6a->setOrderByProperty($v3aabf39f2d943fa886d86dcbbee4d910, $v375a52cb87b22005816fe7a418ec6660);
             } else {
                 $v8be74552df93e31bbdd6b36ed74bdb6a->setOrderByObjectId($v375a52cb87b22005816fe7a418ec6660);
             }
             $result = umiSelectionsParser::runSelection($v8be74552df93e31bbdd6b36ed74bdb6a);
             $vfbb44b4487415b134bce9c790a27fe5e = umiSelectionsParser::runSelectionCounts($v8be74552df93e31bbdd6b36ed74bdb6a);
             $vfca1bff8ad8b3a8585abfb0ad523ba42 = array();
             if ($vfbb44b4487415b134bce9c790a27fe5e > 0) {
                 $v691d502cfd0e0626cd3b058e5682ad1c = array();
                 $v12a673c3eb40ea95d992c775443b8709 = umiHierarchy::getInstance();
                 foreach ($result as $v7057e8409c7c531a1a6e9ac3df4ed549) {
                     $v8e2dcfd7e7e24b1ca76c1193f645902b = $v12a673c3eb40ea95d992c775443b8709->getElement($v7057e8409c7c531a1a6e9ac3df4ed549);
                     if ($v8e2dcfd7e7e24b1ca76c1193f645902b instanceof umiHierarchyElement) {
                         $v691d502cfd0e0626cd3b058e5682ad1c[] = def_module::parseTemplate($ve6a2fd7211958cfe50efa4d14bd332f5, array('attribute:id' => $v8e2dcfd7e7e24b1ca76c1193f645902b->id, 'attribute:link' => $v8e2dcfd7e7e24b1ca76c1193f645902b->link, 'node:name' => $v8e2dcfd7e7e24b1ca76c1193f645902b->name));
                     }
                 }
                 $vfca1bff8ad8b3a8585abfb0ad523ba42['subnodes:items'] = $v691d502cfd0e0626cd3b058e5682ad1c;
                 $v66f6181bcb4cff4cd38fbc804a036db6 = $v364f9b183bd2dd9e0beb45c754830a6c;
             } else {
                 $v66f6181bcb4cff4cd38fbc804a036db6 = $v28d65bb7a643774ada22f54ca0679289;
             }
             $vfca1bff8ad8b3a8585abfb0ad523ba42['total'] = $vfbb44b4487415b134bce9c790a27fe5e;
             $vfca1bff8ad8b3a8585abfb0ad523ba42['per_page'] = $v9d85c254b5062e518a134a61950999c3;
             return def_module::parseTemplate($v66f6181bcb4cff4cd38fbc804a036db6, $vfca1bff8ad8b3a8585abfb0ad523ba42);
         } else {
             throw new publicException("Type \"" . $v599dcce2998a6b40b1e38e8c6006cb0a->getName() . "\" doesn't have property \"{$vdfc394bd05a4b48161c790034af522a8}\"");
         }
     } else {
         throw new publicException("Wrong type id \"{$v94757cae63fd3e398c0811a976dd6bbe}\"");
     }
 }
 protected function writeHeader()
 {
     $v8d777f385d3dfec8815d20f7496026dc = array(array('string', 'Id'), array('string', getLabel('label-name')));
     $vd14a8022b085f9ef19d479cbdd581127 = $this->objectTypes;
     $v8797e64b0b663bbad43134e3003a4ef4 = umiFieldsCollection::getInstance();
     $v0e8133eb006c0f85ed9444ae07a60842 = umiObjectTypesCollection::getInstance();
     $vb7c425be9cc8b8cd2f514126b634bf33 = array();
     foreach ($vd14a8022b085f9ef19d479cbdd581127 as $v726e8e4809d4c1b28a6549d86436a124) {
         $v6301cee35ea764a1e241978f93f01069 = $v726e8e4809d4c1b28a6549d86436a124->getId();
         $vb7c425be9cc8b8cd2f514126b634bf33 += $v0e8133eb006c0f85ed9444ae07a60842->getChildClasses($v6301cee35ea764a1e241978f93f01069);
         $vb7c425be9cc8b8cd2f514126b634bf33[] = $v6301cee35ea764a1e241978f93f01069;
     }
     $v220aa887e031ffda4e634a5584f939bc = array();
     foreach ($this->fields as $v972bf3f05d14ffbdb817bef60638ff00) {
         if (!in_array($v972bf3f05d14ffbdb817bef60638ff00, $this->foundFields)) {
             continue;
         }
         $v6d58e323dd91f19ec80d313941942f94 = $v972bf3f05d14ffbdb817bef60638ff00;
         foreach ($vb7c425be9cc8b8cd2f514126b634bf33 as $v6301cee35ea764a1e241978f93f01069) {
             $v599dcce2998a6b40b1e38e8c6006cb0a = $v0e8133eb006c0f85ed9444ae07a60842->getType($v6301cee35ea764a1e241978f93f01069);
             if ($v599dcce2998a6b40b1e38e8c6006cb0a instanceof iUmiObjectType) {
                 if ($v945100186b119048837b9859c2c46410 = $v599dcce2998a6b40b1e38e8c6006cb0a->getFieldId($v972bf3f05d14ffbdb817bef60638ff00)) {
                     $v06e3d36fa30cea095545139854ad1fb9 = $v8797e64b0b663bbad43134e3003a4ef4->getField($v945100186b119048837b9859c2c46410);
                     if ($v06e3d36fa30cea095545139854ad1fb9 instanceof iUmiField) {
                         $v6d58e323dd91f19ec80d313941942f94 = $v06e3d36fa30cea095545139854ad1fb9->getTitle();
                         break;
                     }
                 }
             }
         }
         $v220aa887e031ffda4e634a5584f939bc[] = $v6d58e323dd91f19ec80d313941942f94;
     }
     if ($this->resultsMode == "element") {
         $v8d777f385d3dfec8815d20f7496026dc[] = array('string', getLabel('label-alt-name'));
         $v8d777f385d3dfec8815d20f7496026dc[] = array('string', getLabel('field-is_active'));
     }
     foreach ($v220aa887e031ffda4e634a5584f939bc as $v6d58e323dd91f19ec80d313941942f94) {
         $v8d777f385d3dfec8815d20f7496026dc[] = array('string', $v6d58e323dd91f19ec80d313941942f94);
     }
     $this->writeFileLine($v8d777f385d3dfec8815d20f7496026dc);
 }
Exemplo n.º 15
0
 protected static function getFieldColumn($v945100186b119048837b9859c2c46410)
 {
     static $v0fea6a13c52b4d4725368f24b045ca84 = array();
     if (isset($v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410])) {
         return $v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410];
     }
     $v06e3d36fa30cea095545139854ad1fb9 = umiFieldsCollection::getInstance()->getField($v945100186b119048837b9859c2c46410);
     switch ($v06e3d36fa30cea095545139854ad1fb9->getDataType()) {
         case 'string':
         case 'password':
         case 'tags':
             return $v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410] = 'varchar_val';
         case 'int':
         case 'boolean':
         case 'date':
             return $v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410] = 'int_val';
         case 'counter':
             return $v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410] = 'cnt';
         case 'price':
         case 'float':
             return $v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410] = 'float_val';
         case 'text':
         case 'wysiwyg':
         case 'file':
         case 'img_file':
         case 'swf_file':
         case 'video_file':
             return $v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410] = 'text_val';
         case 'relation':
             return $v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410] = 'rel_val';
         case 'symlink':
             return $v0fea6a13c52b4d4725368f24b045ca84[$v945100186b119048837b9859c2c46410] = 'tree_val';
         case 'optioned':
             return false;
         default:
             throw new selectorException("Unsupported field type \"{$v06e3d36fa30cea095545139854ad1fb9->getDataType()}\"");
     }
 }
Exemplo n.º 16
0
 protected function exportType($v94757cae63fd3e398c0811a976dd6bbe)
 {
     $v599dcce2998a6b40b1e38e8c6006cb0a = umiObjectTypesCollection::getInstance()->getType($v94757cae63fd3e398c0811a976dd6bbe);
     if (!$v599dcce2998a6b40b1e38e8c6006cb0a instanceof umiObjectType) {
         return false;
     }
     if (isset($this->exported_types[$v94757cae63fd3e398c0811a976dd6bbe])) {
         return false;
     }
     if ($this->limit) {
         if ($this->position >= $this->limit) {
             $this->break = true;
             return false;
         }
     }
     $this->exported_types[$v94757cae63fd3e398c0811a976dd6bbe] = 'found';
     $v2e3c048401582f4247d7ccac43657d2d = $v599dcce2998a6b40b1e38e8c6006cb0a->getParentId();
     if ($v2e3c048401582f4247d7ccac43657d2d) {
         if ($this->exportType($v2e3c048401582f4247d7ccac43657d2d)) {
             if ($this->limit && $this->position >= $this->limit) {
                 $this->break = true;
                 return true;
             }
         }
     }
     $v4a8a08f09d37b73795649038408b5f33 = $this->doc->createElement('type');
     $this->translateEntity($v599dcce2998a6b40b1e38e8c6006cb0a, $v4a8a08f09d37b73795649038408b5f33);
     $va240be392fd0549ece5558553983d79b = $this->relations->getOldTypeIdRelation($this->source_id, $v94757cae63fd3e398c0811a976dd6bbe);
     if (!$va240be392fd0549ece5558553983d79b) {
         $va240be392fd0549ece5558553983d79b = $v94757cae63fd3e398c0811a976dd6bbe == self::$ROOT_PAGE_TYPE_ID ? '{root-pages-type}' : $v94757cae63fd3e398c0811a976dd6bbe;
         $this->relations->setTypeIdRelation($this->source_id, $va240be392fd0549ece5558553983d79b, $v94757cae63fd3e398c0811a976dd6bbe);
     }
     $v4a8a08f09d37b73795649038408b5f33->setAttribute('id', $va240be392fd0549ece5558553983d79b);
     $v2e3c048401582f4247d7ccac43657d2d = $v599dcce2998a6b40b1e38e8c6006cb0a->getParentId();
     if ($v2e3c048401582f4247d7ccac43657d2d) {
         $vd3fbb9ff0b93cc92c5414344402a74bb = $this->relations->getOldTypeIdRelation($this->source_id, $v2e3c048401582f4247d7ccac43657d2d);
         if ($vd3fbb9ff0b93cc92c5414344402a74bb === false) {
             $vd3fbb9ff0b93cc92c5414344402a74bb = $v2e3c048401582f4247d7ccac43657d2d == self::$ROOT_PAGE_TYPE_ID ? '{root-pages-type}' : $v2e3c048401582f4247d7ccac43657d2d;
             $this->relations->setTypeIdRelation($this->source_id, $vd3fbb9ff0b93cc92c5414344402a74bb, $v2e3c048401582f4247d7ccac43657d2d);
         }
         $v4a8a08f09d37b73795649038408b5f33->setAttribute('parent-id', $vd3fbb9ff0b93cc92c5414344402a74bb);
     }
     $v3643b86326b2ffcc0a085b4dd3a4309b = new DOMXPath($this->doc);
     if ($v3643b86326b2ffcc0a085b4dd3a4309b->evaluate("base", $v4a8a08f09d37b73795649038408b5f33)->length) {
         $v593616de15330c0fb2d55e55410bf994 = $v3643b86326b2ffcc0a085b4dd3a4309b->evaluate("base", $v4a8a08f09d37b73795649038408b5f33)->item(0);
         $v593616de15330c0fb2d55e55410bf994->removeAttribute('id');
     }
     if ($v3643b86326b2ffcc0a085b4dd3a4309b->evaluate("fieldgroups/group", $v4a8a08f09d37b73795649038408b5f33)->length) {
         foreach ($v3643b86326b2ffcc0a085b4dd3a4309b->evaluate("fieldgroups/group", $v4a8a08f09d37b73795649038408b5f33) as $vdb0f6f37ebeb6ea09489124345af2a45) {
             $v47db2588331bbe530c80dd001fc60aed = $vdb0f6f37ebeb6ea09489124345af2a45->getAttribute('id');
             $v7617417dc7eb3bbc463bf3c66d341d7b = $v599dcce2998a6b40b1e38e8c6006cb0a->getFieldsGroup($v47db2588331bbe530c80dd001fc60aed, true);
             if ($v7617417dc7eb3bbc463bf3c66d341d7b->getIsActive()) {
                 $vdb0f6f37ebeb6ea09489124345af2a45->setAttribute('active', 'active');
             } else {
                 $vdb0f6f37ebeb6ea09489124345af2a45->setAttribute('active', '0');
             }
             if (!$v7617417dc7eb3bbc463bf3c66d341d7b->getIsVisible()) {
                 $vdb0f6f37ebeb6ea09489124345af2a45->setAttribute('visible', '0');
             }
             $vdb0f6f37ebeb6ea09489124345af2a45->removeAttribute('id');
         }
     }
     $v5df80bc8ce306a564d91fa6a4da3d95b = array();
     $v8797e64b0b663bbad43134e3003a4ef4 = umiFieldsCollection::getInstance();
     $v1a13105b7e4eb5fb2e7c9515ac06aa48 = $v3643b86326b2ffcc0a085b4dd3a4309b->evaluate("fieldgroups/group/field", $v4a8a08f09d37b73795649038408b5f33);
     foreach ($v1a13105b7e4eb5fb2e7c9515ac06aa48 as $v06e3d36fa30cea095545139854ad1fb9) {
         $v3aabf39f2d943fa886d86dcbbee4d910 = intval($v06e3d36fa30cea095545139854ad1fb9->getAttribute('id'));
         $v73f329f154a663bfda020aadcdd0b775 = $v06e3d36fa30cea095545139854ad1fb9->getAttribute('name');
         $v528ca8fdf35a8b13b093b5786a22c0bf = $this->relations->getOldFieldName($this->source_id, $v94757cae63fd3e398c0811a976dd6bbe, $v3aabf39f2d943fa886d86dcbbee4d910);
         if ($v528ca8fdf35a8b13b093b5786a22c0bf === false) {
             $this->relations->setFieldIdRelation($this->source_id, $v94757cae63fd3e398c0811a976dd6bbe, $v73f329f154a663bfda020aadcdd0b775, $v3aabf39f2d943fa886d86dcbbee4d910);
             $v528ca8fdf35a8b13b093b5786a22c0bf = $v73f329f154a663bfda020aadcdd0b775;
         } else {
             $v06e3d36fa30cea095545139854ad1fb9->setAttribute('name', $v528ca8fdf35a8b13b093b5786a22c0bf);
         }
         if ($v06e3d36fa30cea095545139854ad1fb9->getElementsByTagName('restriction')->length) {
             $v23604f9ddf406aa61ce8b1eaf9f6d39a = $v06e3d36fa30cea095545139854ad1fb9->getElementsByTagName('restriction')->item(0);
             $v228c63e369a5906eb7f0500a13729edc = $v23604f9ddf406aa61ce8b1eaf9f6d39a->getAttribute('id');
             $this->restrictions[] = $v228c63e369a5906eb7f0500a13729edc;
             $this->restricted_fields[] = array('restriction-id' => $v228c63e369a5906eb7f0500a13729edc, 'field-name' => $v528ca8fdf35a8b13b093b5786a22c0bf, 'type-id' => $va240be392fd0549ece5558553983d79b);
             $v23604f9ddf406aa61ce8b1eaf9f6d39a->removeAttribute('field-type-id');
         }
         $v051369818a8073bba5feeb0e957eb308 = $v06e3d36fa30cea095545139854ad1fb9->hasAttribute('guide-id') ? $v06e3d36fa30cea095545139854ad1fb9->getAttribute('guide-id') : false;
         if ($v051369818a8073bba5feeb0e957eb308 && (!$this->ignoreRelations || in_array('guides', $this->saveRelations))) {
             if ($this->exportType($v051369818a8073bba5feeb0e957eb308)) {
                 if ($this->limit && $this->position >= $this->limit) {
                     $this->break = true;
                     return true;
                 }
             }
             $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('objects');
             $v8be74552df93e31bbdd6b36ed74bdb6a->types('object-type')->id($v051369818a8073bba5feeb0e957eb308);
             $v8be74552df93e31bbdd6b36ed74bdb6a->option('return')->value('id');
             foreach ($v8be74552df93e31bbdd6b36ed74bdb6a->result as $v9b207167e5381c47682c6b4f58a623fb) {
                 if ($this->exportObject($v9b207167e5381c47682c6b4f58a623fb['id'])) {
                     if ($this->limit && $this->position >= $this->limit) {
                         $this->break = true;
                         return true;
                     }
                 }
             }
             $vd4276536125c741369298bfbf2817a8a = $this->relations->getOldTypeIdRelation($this->source_id, $v051369818a8073bba5feeb0e957eb308);
             $v06e3d36fa30cea095545139854ad1fb9->setAttribute('guide-id', $vd4276536125c741369298bfbf2817a8a);
             $v4b43b0aee35624cd95b910189b3dc231 = $this->doc->createElement('relation');
             $v4b43b0aee35624cd95b910189b3dc231->setAttribute('type-id', $va240be392fd0549ece5558553983d79b);
             $v4b43b0aee35624cd95b910189b3dc231->setAttribute('field-name', $v528ca8fdf35a8b13b093b5786a22c0bf);
             $vb2f5ff47436671b6e533d8dc3614845d = $this->doc->createElement('guide');
             $vb2f5ff47436671b6e533d8dc3614845d->setAttribute('id', $vd4276536125c741369298bfbf2817a8a);
             $v4b43b0aee35624cd95b910189b3dc231->appendChild($vb2f5ff47436671b6e533d8dc3614845d);
             $v5df80bc8ce306a564d91fa6a4da3d95b[] = $v4b43b0aee35624cd95b910189b3dc231;
         }
         if ($v06e3d36fa30cea095545139854ad1fb9->getElementsByTagName('type')->length) {
             $v519504d7d4beb745dac24ccfb6c1d7c9 = $v06e3d36fa30cea095545139854ad1fb9->getElementsByTagName('type')->item(0);
             $v519504d7d4beb745dac24ccfb6c1d7c9->removeAttribute('id');
         }
         $vce6ba6b4afd61be6d0f21f1e2a995213 = $v8797e64b0b663bbad43134e3003a4ef4->getField($v3aabf39f2d943fa886d86dcbbee4d910);
         if ($vce6ba6b4afd61be6d0f21f1e2a995213->getIsSystem()) {
             $v06e3d36fa30cea095545139854ad1fb9->setAttribute('system', 'system');
         }
         $v06e3d36fa30cea095545139854ad1fb9->removeAttribute('field-type-id');
     }
     foreach ($v5df80bc8ce306a564d91fa6a4da3d95b as $v4b43b0aee35624cd95b910189b3dc231) {
         $this->relations_container->appendChild($v4b43b0aee35624cd95b910189b3dc231);
     }
     $this->types_container->appendChild($v4a8a08f09d37b73795649038408b5f33);
     $this->exported_types[$v94757cae63fd3e398c0811a976dd6bbe] = $va240be392fd0549ece5558553983d79b;
     $this->position++;
     return true;
 }
Exemplo n.º 17
0
 public static function generateOrderBy($v972bf3f05d14ffbdb817bef60638ff00, $v94757cae63fd3e398c0811a976dd6bbe, $v66f6181bcb4cff4cd38fbc804a036db6 = "default")
 {
     if (!$v66f6181bcb4cff4cd38fbc804a036db6) {
         $v66f6181bcb4cff4cd38fbc804a036db6 = "default";
     }
     list($v364f9b183bd2dd9e0beb45c754830a6c, $v77aec815defa0531d0f88e17982c7876) = def_module::loadTemplates("numpages/" . $v66f6181bcb4cff4cd38fbc804a036db6, "order_by", "order_by_a");
     if (!($v599dcce2998a6b40b1e38e8c6006cb0a = umiObjectTypesCollection::getInstance()->getType($v94757cae63fd3e398c0811a976dd6bbe))) {
         return "";
     }
     $vfca1bff8ad8b3a8585abfb0ad523ba42 = array();
     if (($v3aabf39f2d943fa886d86dcbbee4d910 = $v599dcce2998a6b40b1e38e8c6006cb0a->getFieldId($v972bf3f05d14ffbdb817bef60638ff00)) || $v972bf3f05d14ffbdb817bef60638ff00 == "name") {
         $v21ffce5b8a6cc8cc6a41448dd69623c9 = $_GET;
         unset($v21ffce5b8a6cc8cc6a41448dd69623c9['path']);
         if (array_key_exists('scheme', $v21ffce5b8a6cc8cc6a41448dd69623c9)) {
             unset($v21ffce5b8a6cc8cc6a41448dd69623c9['scheme']);
         }
         $vdb64cd49d22f58e2d5fc26108f11b181 = getArrayKey($v21ffce5b8a6cc8cc6a41448dd69623c9, 'order_filter');
         if (is_array($vdb64cd49d22f58e2d5fc26108f11b181)) {
             $v4f2afc9c4099ee1f39c9f551123e54bd = array_key_exists($v972bf3f05d14ffbdb817bef60638ff00, $vdb64cd49d22f58e2d5fc26108f11b181) ? $v77aec815defa0531d0f88e17982c7876 : $v364f9b183bd2dd9e0beb45c754830a6c;
         } else {
             $v4f2afc9c4099ee1f39c9f551123e54bd = $v364f9b183bd2dd9e0beb45c754830a6c;
         }
         unset($v21ffce5b8a6cc8cc6a41448dd69623c9['order_filter']);
         $v21ffce5b8a6cc8cc6a41448dd69623c9['order_filter'][$v972bf3f05d14ffbdb817bef60638ff00] = 1;
         $v21ffce5b8a6cc8cc6a41448dd69623c9 = self::protectParams($v21ffce5b8a6cc8cc6a41448dd69623c9);
         $v7694f4a66316e53c8cdd9d9954bd611d = sizeof($v21ffce5b8a6cc8cc6a41448dd69623c9) ? "&" . http_build_query($v21ffce5b8a6cc8cc6a41448dd69623c9, '', '&') : "";
         $v7694f4a66316e53c8cdd9d9954bd611d = urldecode($v7694f4a66316e53c8cdd9d9954bd611d);
         $v7694f4a66316e53c8cdd9d9954bd611d = str_replace(array("%", "<", ">", "%3C", "%3E"), array("&#037;", "&lt;", "&gt;", "&lt;", "&gt;"), $v7694f4a66316e53c8cdd9d9954bd611d);
         $vfca1bff8ad8b3a8585abfb0ad523ba42['link'] = "?" . $v7694f4a66316e53c8cdd9d9954bd611d;
         if ($v972bf3f05d14ffbdb817bef60638ff00 == "name") {
             $vfca1bff8ad8b3a8585abfb0ad523ba42['title'] = getLabel('field-name');
         } else {
             $vfca1bff8ad8b3a8585abfb0ad523ba42['title'] = umiFieldsCollection::getInstance()->getField($v3aabf39f2d943fa886d86dcbbee4d910)->getTitle();
         }
         return def_module::parseTemplate($v4f2afc9c4099ee1f39c9f551123e54bd, $vfca1bff8ad8b3a8585abfb0ad523ba42);
     }
     return "";
 }
Exemplo n.º 18
0
 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;
     }
 }
Exemplo n.º 19
0
 public function autoDetectFilters(umiSelection $sel, $object_type_id)
 {
     if (is_null(getRequest('search-all-text')) == false) {
         $searchStrings = getRequest('search-all-text');
         if (is_array($searchStrings)) {
             foreach ($searchStrings as $searchString) {
                 if ($searchString) {
                     $sel->searchText($searchString);
                 }
             }
         }
     }
     if (array_key_exists("fields_filter", $_REQUEST)) {
         $cmsController = cmsController::getInstance();
         $data_module = $cmsController->getModule("data");
         if (!$data_module) {
             throw new publicException("Need data module installed to use dynamic filters");
         }
         $sel->setPropertyFilter();
         $type = umiObjectTypesCollection::getInstance()->getType($object_type_id);
         $order_filter = getRequest('fields_filter');
         if (!is_array($order_filter)) {
             return false;
         }
         foreach ($order_filter as $field_name => $value) {
             if ($field_name == "name") {
                 $data_module->applyFilterName($sel, $value);
                 continue;
             }
             if ($field_id = $type->getFieldId($field_name)) {
                 $this->isSelectionFiltered = true;
                 $field = umiFieldsCollection::getInstance()->getField($field_id);
                 $field_type_id = $field->getFieldTypeId();
                 $field_type = umiFieldTypesCollection::getInstance()->getFieldType($field_type_id);
                 $data_type = $field_type->getDataType();
                 switch ($data_type) {
                     case "text":
                         $data_module->applyFilterText($sel, $field, $value);
                         break;
                     case "wysiwyg":
                         $data_module->applyFilterText($sel, $field, $value);
                         break;
                     case "string":
                         $data_module->applyFilterText($sel, $field, $value);
                         break;
                     case "tags":
                         $tmp = array_extract_values($value);
                         if (empty($tmp)) {
                             break;
                         }
                     case "boolean":
                         $data_module->applyFilterBoolean($sel, $field, $value);
                         break;
                     case "int":
                         $data_module->applyFilterInt($sel, $field, $value);
                         break;
                     case "symlink":
                     case "relation":
                         $data_module->applyFilterRelation($sel, $field, $value);
                         break;
                     case "float":
                         $data_module->applyFilterFloat($sel, $field, $value);
                         break;
                     case "price":
                         $emarket = $cmsController->getModule('emarket');
                         if ($emarket instanceof def_module) {
                             $defaultCurrency = $emarket->getDefaultCurrency();
                             $currentCurrency = $emarket->getCurrentCurrency();
                             $prices = $emarket->formatCurrencyPrice($value, $defaultCurrency, $currentCurrency);
                             foreach ($value as $index => $void) {
                                 $value[$index] = getArrayKey($prices, $index);
                             }
                         }
                         $data_module->applyFilterPrice($sel, $field, $value);
                         break;
                     case "file":
                     case "img_file":
                     case "swf_file":
                     case "boolean":
                         $data_module->applyFilterInt($sel, $field, $value);
                         break;
                     case "date":
                         $data_module->applyFilterDate($sel, $field, $value);
                         break;
                     default:
                         break;
                 }
             } else {
                 continue;
             }
         }
     } else {
         return false;
     }
 }
 public static function objectsByValue($v0f728ec6147eaec54f5f45e37bce8ddd, $v2ef4385ee1f18f02679161fef2b094d9 = NULL, $v95fc2db4375309c569794b723adc3972 = false, $vf80384e7987156531edaa3afd549957d = true, $v8ef57923ab3049b18fb75541ff476ff7 = NULL)
 {
     $v30a7d3f52b5af853f2a7bba352210a34 = array();
     if (!(is_null($v2ef4385ee1f18f02679161fef2b094d9) || is_array($v2ef4385ee1f18f02679161fef2b094d9) || intval($v2ef4385ee1f18f02679161fef2b094d9) === -1 || strval($v2ef4385ee1f18f02679161fef2b094d9) === 'all' || strval($v2ef4385ee1f18f02679161fef2b094d9) == 'Все')) {
         $v2ef4385ee1f18f02679161fef2b094d9 = array($v2ef4385ee1f18f02679161fef2b094d9);
     }
     $v9effabcdaed14aab9cb00acddfa00fc9 = NULL;
     if ($v95fc2db4375309c569794b723adc3972) {
         if (is_null($v8ef57923ab3049b18fb75541ff476ff7)) {
             $v9effabcdaed14aab9cb00acddfa00fc9 = array(cmsController::getInstance()->getCurrentDomain()->getId());
         } elseif (intval($v8ef57923ab3049b18fb75541ff476ff7) === -1 || strval($v8ef57923ab3049b18fb75541ff476ff7) === 'all' || strval($v8ef57923ab3049b18fb75541ff476ff7) == 'Все') {
             $v9effabcdaed14aab9cb00acddfa00fc9 = array();
         } elseif (is_array($v8ef57923ab3049b18fb75541ff476ff7)) {
             $v9effabcdaed14aab9cb00acddfa00fc9 = array_map('intval', $v8ef57923ab3049b18fb75541ff476ff7);
         } else {
             $v9effabcdaed14aab9cb00acddfa00fc9 = array(intval($v8ef57923ab3049b18fb75541ff476ff7));
         }
     }
     $v06e3d36fa30cea095545139854ad1fb9 = umiFieldsCollection::getInstance()->getField($v0f728ec6147eaec54f5f45e37bce8ddd);
     if ($v06e3d36fa30cea095545139854ad1fb9 instanceof umiField) {
         $v5fd6df40d7c4dd7f503475344d8c145c = $v06e3d36fa30cea095545139854ad1fb9->getFieldType()->getDataType();
         $v8ae9391858dfdc11dbd8f15cf9b04a26 = umiFieldType::getDataTypeDB($v5fd6df40d7c4dd7f503475344d8c145c);
     } else {
         throw new coreException("Field #{$v945100186b119048837b9859c2c46410} not found");
     }
     $v6301cee35ea764a1e241978f93f01069 = umiSelectionsParser::getObjectTypeByFieldId($v0f728ec6147eaec54f5f45e37bce8ddd);
     $v80071f37861c360a27b7327e132c911a = umiBranch::getBranchedTableByTypeId($v6301cee35ea764a1e241978f93f01069);
     $v01b41e749613a642fc384ed8af3245fc = "{$v80071f37861c360a27b7327e132c911a} `o`";
     if ($v95fc2db4375309c569794b723adc3972) {
         $v01b41e749613a642fc384ed8af3245fc .= ", cms3_hierarchy `h`";
     }
     if ($v95fc2db4375309c569794b723adc3972) {
         $v7dd0d06edf4c4299ce1a5978eb469fd8 = "h.id";
     } else {
         $v7dd0d06edf4c4299ce1a5978eb469fd8 = "o.obj_id";
     }
     $vc3a74cf64b6ccb62fa49a21123cbc72f = $v95fc2db4375309c569794b723adc3972 ? " AND h.obj_id = o.obj_id AND h.is_active=1 AND h.is_deleted=0" : "";
     if ($v95fc2db4375309c569794b723adc3972 && is_array($v9effabcdaed14aab9cb00acddfa00fc9) && count($v9effabcdaed14aab9cb00acddfa00fc9)) {
         $vc3a74cf64b6ccb62fa49a21123cbc72f .= " AND h.domain_id IN ('" . implode("', '", $v9effabcdaed14aab9cb00acddfa00fc9) . "')";
     }
     $v86f6d00b1c7dbb44f4cd5edf49c29aa0 = "";
     if (!(intval($v2ef4385ee1f18f02679161fef2b094d9) === -1 || strval($v2ef4385ee1f18f02679161fef2b094d9) === 'all' || strval($v2ef4385ee1f18f02679161fef2b094d9) === 'Âñå')) {
         $v86f6d00b1c7dbb44f4cd5edf49c29aa0 = " AND o.{$v8ae9391858dfdc11dbd8f15cf9b04a26} " . (is_null($v2ef4385ee1f18f02679161fef2b094d9) ? "IS NULL" : "IN ('" . implode("', '", $v2ef4385ee1f18f02679161fef2b094d9) . "')");
     }
     if ($vf80384e7987156531edaa3afd549957d) {
         $vf3e7552257b4e44beacffb073506f43d = "SELECT o." . $v8ae9391858dfdc11dbd8f15cf9b04a26 . " as `value`, COUNT(" . $v7dd0d06edf4c4299ce1a5978eb469fd8 . ") as `items` FROM " . $v01b41e749613a642fc384ed8af3245fc . " WHERE o.field_id = " . $v0f728ec6147eaec54f5f45e37bce8ddd . $v86f6d00b1c7dbb44f4cd5edf49c29aa0 . $vc3a74cf64b6ccb62fa49a21123cbc72f . " GROUP BY o." . $v8ae9391858dfdc11dbd8f15cf9b04a26 . " ORDER BY `items`";
     } else {
         $vf3e7552257b4e44beacffb073506f43d = "SELECT DISTINCT " . $v7dd0d06edf4c4299ce1a5978eb469fd8 . " as `item` FROM " . $v01b41e749613a642fc384ed8af3245fc . " WHERE o.field_id = " . $v0f728ec6147eaec54f5f45e37bce8ddd . $v86f6d00b1c7dbb44f4cd5edf49c29aa0 . $vc3a74cf64b6ccb62fa49a21123cbc72f;
     }
     $ve7d010371cfd5717d3d0b7d8e4c87803 = array();
     $v98291d7af1e21c41194125137e4f90ec = l_mysql_query($vf3e7552257b4e44beacffb073506f43d);
     $ved05f7aecf3d274bef532a3ade31ad02 = mysql_errno();
     $v89d8e64b77430ce4f0fe8ead989285bd = l_mysql_error();
     if ($v98291d7af1e21c41194125137e4f90ec === false || $ved05f7aecf3d274bef532a3ade31ad02) {
         throw new coreException("Error executing db query (errno " . $ved05f7aecf3d274bef532a3ade31ad02 . ", error " . $v89d8e64b77430ce4f0fe8ead989285bd . ", query " . $vf3e7552257b4e44beacffb073506f43d . ")");
     } else {
         while ($v7b93a31f8c7688c32c5a551b0e4937ee = mysql_fetch_assoc($v98291d7af1e21c41194125137e4f90ec)) {
             $ve7d010371cfd5717d3d0b7d8e4c87803[] = $v7b93a31f8c7688c32c5a551b0e4937ee;
         }
     }
     if ($vf80384e7987156531edaa3afd549957d) {
         $v30a7d3f52b5af853f2a7bba352210a34['values'] = array();
         $vae886317ab0305e3e6a1638659ea03fa = 0;
         $v663ccf380acaf3f549f1612654dc109d = 0;
         foreach ($ve7d010371cfd5717d3d0b7d8e4c87803 as $vabd12a9143f26fa85e562e69c01c48db) {
             $v97023380f9705264978115e6ce880ca5 = intval($vabd12a9143f26fa85e562e69c01c48db['items']);
             $v30a7d3f52b5af853f2a7bba352210a34['values'][] = array('value' => $vabd12a9143f26fa85e562e69c01c48db['value'], 'cnt' => $v97023380f9705264978115e6ce880ca5);
             if ($v97023380f9705264978115e6ce880ca5 > $vae886317ab0305e3e6a1638659ea03fa) {
                 $vae886317ab0305e3e6a1638659ea03fa = $v97023380f9705264978115e6ce880ca5;
             }
             $v663ccf380acaf3f549f1612654dc109d += $v97023380f9705264978115e6ce880ca5;
         }
         $v30a7d3f52b5af853f2a7bba352210a34['max'] = $vae886317ab0305e3e6a1638659ea03fa;
         $v30a7d3f52b5af853f2a7bba352210a34['sum'] = $v663ccf380acaf3f549f1612654dc109d;
     } else {
         foreach ($ve7d010371cfd5717d3d0b7d8e4c87803 as $vabd12a9143f26fa85e562e69c01c48db) {
             $v30a7d3f52b5af853f2a7bba352210a34[] = $vabd12a9143f26fa85e562e69c01c48db['item'];
         }
     }
     return $v30a7d3f52b5af853f2a7bba352210a34;
 }
Exemplo n.º 21
0
 public function subscribe($sTemplate = "default")
 {
     $sResult = "";
     if (!$sTemplate) {
         $sTemplate = "default";
     }
     list($sUnregistredForm, $sRegistredForm, $sDispatchesForm, $sDispatchRowForm) = def_module::loadTemplates("dispatches/" . $sTemplate, "subscribe_unregistred_user", "subscribe_registred_user", "subscriber_dispatches", "subscriber_dispatch_row");
     $iSbsHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "subscriber")->getId();
     $iSbsTypeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iSbsHierarchyTypeId);
     $oSbsType = umiObjectTypesCollection::getInstance()->getType($iSbsTypeId);
     // check user registred
     $this->is_auth = false;
     if ($oMdlUsers = cmsController::getInstance()->getModule("users")) {
         if ($oMdlUsers->is_auth()) {
             $iUserId = (int) $oMdlUsers->user_id;
             $this->is_auth = true;
             $this->user_id = $iUserId;
         }
     }
     if ($this->is_auth) {
         $arrRegBlock = array();
         // gen subscribe_registred_user form
         // check curr user in subscribers list
         $arrSbsDispatches = array();
         $oSubscriber = self::getSubscriberByUserId($this->user_id);
         if ($oSubscriber instanceof umiObject) {
             $arrSbsDispatches = $oSubscriber->getValue('subscriber_dispatches');
         }
         $arrRegBlock['subscriber_dispatches'] = self::parseDispatches($sDispatchesForm, $sDispatchRowForm, $arrSbsDispatches);
         $sResult = def_module::parseTemplate($sRegistredForm, $arrRegBlock);
     } else {
         // gen subscribe_unregistred_user form
         $arrUnregBlock = array();
         $iSbsGenderFldId = $oSbsType->getFieldId('gender');
         $oSbsGenderFld = umiFieldsCollection::getInstance()->getField($iSbsGenderFldId);
         $arrGenders = umiObjectsCollection::getInstance()->getGuidedItems($oSbsGenderFld->getGuideId());
         $sGenders = array();
         foreach ($arrGenders as $iGenderId => $sGenderName) {
             $sGenders[] = "<option value=\"" . $iGenderId . "\">" . $sGenderName . "</option>";
         }
         $arrUnregBlock['void:sbs_genders'] = $sGenders;
         $sResult = def_module::parseTemplate($sUnregistredForm, $arrUnregBlock);
     }
     //$block_arr['action'] = $this->pre_lang . "/dispatcher/subscribe_do/";
     return $sResult;
 }