Beispiel #1
0
	/**
	 * возвращает календарь. хтмл.
	 */
	public function calendar()
	{
		$this->__loadLib("calendar.php");
		$this->__implement("calendar");

		$year  = getRequest('year') ? (int) getRequest('year') : date('Y');
		$month = getRequest('month') ? (int) getRequest('month') : date('m');


		$calendar = new Calendar();

		$lang_id = cmsController::getInstance()->getCurrentLang()->getId();
		$lang = langsCollection::getInstance()->getLang($lang_id);

		if ($lang->getPrefix() == "ru")
		{
			$calendar->setMonthNames(array("Январь", "Февраль", "Март", "Апрель", "Май", "Июнь",
							"Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"));
			$calendar->setDayNames(array("Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"));
			$calendar->setStartDay(1);
		}

		$result = $calendar->getMonthView($month, $year);

		return $result;

	}
Beispiel #2
0
 public function setDefaultLangId($v78e6dd7a49f5b0cb2106a3a434dd5c86)
 {
     if (langsCollection::getInstance()->isExists($v78e6dd7a49f5b0cb2106a3a434dd5c86)) {
         $this->default_lang_id = $v78e6dd7a49f5b0cb2106a3a434dd5c86;
         $this->setIsUpdated();
         return true;
     } else {
         throw new coreException("Language #{$v78e6dd7a49f5b0cb2106a3a434dd5c86} doesn't exists");
     }
 }
 public function setLangId($v78e6dd7a49f5b0cb2106a3a434dd5c86)
 {
     $v5a05866850c28651fe234659f6c92ada = langsCollection::getInstance();
     if ($v5a05866850c28651fe234659f6c92ada->isExists($v78e6dd7a49f5b0cb2106a3a434dd5c86)) {
         $this->lang_id = (int) $v78e6dd7a49f5b0cb2106a3a434dd5c86;
         $this->setIsUpdated();
         return true;
     } else {
         return false;
     }
 }
 public function lang_del()
 {
     $langId = (int) getRequest('param0');
     $langs = langsCollection::getInstance();
     if (sizeof($langs->getList()) == 1) {
         throw new publicAdminException(getLabel('error-minimum-one-lang-required'));
     }
     if ($langs->getDefaultLang()->getId() == $langId) {
         throw new publicAdminException(getLabel('error-try-delete-default-language'));
     }
     $cmsController = cmsController::getInstance();
     $currentLangId = $cmsController->getCurrentLang()->getId();
     $url = '/admin/config/langs/';
     if ($currentLangId != $langId) {
         $url = $this->pre_lang . $url;
     }
     if (!is_demo()) {
         $langs->delLang($langId);
     }
     $this->chooseRedirect($url);
 }
 public function addTemplate($v435ed7e9f07f740abf511a62c00eef6e, $vd5d3db1765287eef77d7927cc956f50a, $v662cbf1253ac7d8750ed9190c52163e5 = false, $v78e6dd7a49f5b0cb2106a3a434dd5c86 = false, $vf62baf4c4ead98d50d516eca0ac5a746 = false)
 {
     $this->disableCache();
     cacheFrontend::getInstance()->flush();
     $ve4e46deb7f9cc58c7abfb32e5570b6f3 = domainsCollection::getInstance();
     $v5a05866850c28651fe234659f6c92ada = langsCollection::getInstance();
     if (!$ve4e46deb7f9cc58c7abfb32e5570b6f3->isExists($v662cbf1253ac7d8750ed9190c52163e5)) {
         if ($ve4e46deb7f9cc58c7abfb32e5570b6f3->getDefaultDomain()) {
             $v662cbf1253ac7d8750ed9190c52163e5 = $ve4e46deb7f9cc58c7abfb32e5570b6f3->getDefaultDomain()->getId();
         } else {
             return false;
         }
     }
     if (!$v5a05866850c28651fe234659f6c92ada->isExists($v78e6dd7a49f5b0cb2106a3a434dd5c86)) {
         if ($v5a05866850c28651fe234659f6c92ada->getDefaultLang()) {
             $v78e6dd7a49f5b0cb2106a3a434dd5c86 = $v5a05866850c28651fe234659f6c92ada->getDefaultLang()->getId();
         } else {
             return false;
         }
     }
     $vac5c74b64b4b8352ef2f181affb5ac2a = "INSERT INTO cms3_templates VALUES()";
     $result = l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
     $v74f5356453a69e438e0f58ef93103cc0 = l_mysql_insert_id();
     $v66f6181bcb4cff4cd38fbc804a036db6 = new template($v74f5356453a69e438e0f58ef93103cc0);
     $v66f6181bcb4cff4cd38fbc804a036db6->setFilename($v435ed7e9f07f740abf511a62c00eef6e);
     $v66f6181bcb4cff4cd38fbc804a036db6->setTitle($vd5d3db1765287eef77d7927cc956f50a);
     $v66f6181bcb4cff4cd38fbc804a036db6->setDomainId($v662cbf1253ac7d8750ed9190c52163e5);
     $v66f6181bcb4cff4cd38fbc804a036db6->setLangId($v78e6dd7a49f5b0cb2106a3a434dd5c86);
     $v66f6181bcb4cff4cd38fbc804a036db6->setIsDefault($vf62baf4c4ead98d50d516eca0ac5a746);
     if ($vf62baf4c4ead98d50d516eca0ac5a746) {
         $this->setDefaultTemplate($v74f5356453a69e438e0f58ef93103cc0);
     }
     $v66f6181bcb4cff4cd38fbc804a036db6->commit();
     $v66f6181bcb4cff4cd38fbc804a036db6->update();
     $this->templates[$v74f5356453a69e438e0f58ef93103cc0] = $v66f6181bcb4cff4cd38fbc804a036db6;
     return $v74f5356453a69e438e0f58ef93103cc0;
 }
 private function detectLang()
 {
     $vb24bcd6b7d395b852353e079beaec4f9 = getRequest('lang_id');
     $v78e6dd7a49f5b0cb2106a3a434dd5c86 = false;
     if ($vb24bcd6b7d395b852353e079beaec4f9 != null) {
         if (is_array($vb24bcd6b7d395b852353e079beaec4f9)) {
             list($vb24bcd6b7d395b852353e079beaec4f9) = $vb24bcd6b7d395b852353e079beaec4f9;
         }
         $v78e6dd7a49f5b0cb2106a3a434dd5c86 = intval($vb24bcd6b7d395b852353e079beaec4f9);
     } else {
         if (!is_null(getRequest('links')) && is_array($v7ffc4d510260a8544e5550e62ec56bc1 = getRequest('rel'))) {
             if (sizeof($v7ffc4d510260a8544e5550e62ec56bc1) && ($v7552cd149af7495ee7d8225974e50f80 = array_pop($v7ffc4d510260a8544e5550e62ec56bc1))) {
                 $v8e2dcfd7e7e24b1ca76c1193f645902b = umiHierarchy::getInstance()->getElement($v7552cd149af7495ee7d8225974e50f80, true);
                 if ($v8e2dcfd7e7e24b1ca76c1193f645902b instanceof umiHierarchyElement) {
                     $v78e6dd7a49f5b0cb2106a3a434dd5c86 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getLangId();
                 }
             }
         } else {
             list($vb31590b98760b74e7c4e1a809e43152d) = $this->getPathArray();
             $v78e6dd7a49f5b0cb2106a3a434dd5c86 = langsCollection::getInstance()->getLangId($vb31590b98760b74e7c4e1a809e43152d);
         }
     }
     if (!langsCollection::getInstance()->getDefaultLang()) {
         throw new coreException('Cannot find default language');
     }
     if (($this->current_lang = langsCollection::getInstance()->getLang($v78e6dd7a49f5b0cb2106a3a434dd5c86)) === false) {
         if ($this->current_domain) {
             if ($v78e6dd7a49f5b0cb2106a3a434dd5c86 = $this->current_domain->getDefaultLangId()) {
                 $this->current_lang = langsCollection::getInstance()->getLang($v78e6dd7a49f5b0cb2106a3a434dd5c86);
             } else {
                 $this->current_lang = langsCollection::getInstance()->getDefaultLang();
             }
         } else {
             $this->current_lang = langsCollection::getInstance()->getDefaultLang();
         }
     }
     if ($this->current_lang->getId() != $this->current_domain->getDefaultLangId()) {
         $this->pre_lang = "/" . $this->current_lang->getPrefix();
         $_REQUEST['pre_lang'] = $this->pre_lang;
     }
 }
Beispiel #7
0
 public function domainTemplates()
 {
     $domains = domainsCollection::getInstance();
     $langs = langsCollection::getInstance();
     $templates = templatesCollection::getInstance();
     $data = array();
     foreach ($domains->getList() as $domain) {
         $domainId = $domain->getId();
         foreach ($langs->getList() as $lang) {
             $langId = $lang->getId();
             foreach ($templates->getTemplatesList($domainId, $langId) as $template) {
                 $data['templates']['nodes:template'][] = $template;
             }
         }
     }
     foreach ($domains->getList() as $domain) {
         $data['domains']['nodes:domain'][] = $domain;
     }
     foreach ($langs->getList() as $lang) {
         $data['langs']['nodes:lang'][] = $lang;
     }
     $this->setDataType("list");
     $this->setActionType("view");
     $this->setData($data);
     return $this->doData();
 }
 private function getRightAltName($vd84ff935144e00c3e1d395c2379aca47, $v0161cd78b4dc4a09ae9d2bbdb93dddc4 = false)
 {
     if (empty($vd84ff935144e00c3e1d395c2379aca47)) {
         $vd84ff935144e00c3e1d395c2379aca47 = '1';
     }
     if ($this->getRel() == 0 && !IGNORE_MODULE_NAMES_OVERWRITE) {
         $v6c63406410aa57b3c97b88d3feb09990 = regedit::getInstance()->getList("//modules");
         foreach ($v6c63406410aa57b3c97b88d3feb09990 as $v854203cccade0bbe21be239a208aea49) {
             if ($vd84ff935144e00c3e1d395c2379aca47 == $v854203cccade0bbe21be239a208aea49[0]) {
                 $vd84ff935144e00c3e1d395c2379aca47 .= '1';
                 break;
             }
         }
         if (langsCollection::getInstance()->getLangId($vd84ff935144e00c3e1d395c2379aca47)) {
             $vd84ff935144e00c3e1d395c2379aca47 .= '1';
         }
     }
     $vc1332a8893475d77a4cb5226b0e6246d = array();
     preg_match("/^([a-z0-9_.-]*)(\\d*?)\$/U", $vd84ff935144e00c3e1d395c2379aca47, $v66373a9c960d5bb19f89068c5a2797b0);
     $va2d2953131ec91efe3c90d4dbcee3777 = isset($v66373a9c960d5bb19f89068c5a2797b0[2]) ? $v66373a9c960d5bb19f89068c5a2797b0[2] : NULL;
     $v544988e29afe707b134aa03709eb443e = isset($v66373a9c960d5bb19f89068c5a2797b0[1]) ? $v66373a9c960d5bb19f89068c5a2797b0[1] : NULL;
     $v78e6dd7a49f5b0cb2106a3a434dd5c86 = $this->getLangId();
     $v662cbf1253ac7d8750ed9190c52163e5 = $this->getDomainId();
     $vac5c74b64b4b8352ef2f181affb5ac2a = "SELECT alt_name FROM cms3_hierarchy WHERE rel={$this->getRel()} AND id <> {$this->getId()} AND is_deleted = '0' AND lang_id = '{$v78e6dd7a49f5b0cb2106a3a434dd5c86}' AND domain_id = '{$v662cbf1253ac7d8750ed9190c52163e5}' AND alt_name LIKE '{$v544988e29afe707b134aa03709eb443e}%';";
     $result = l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
     while (list($v447b7147e84be512208dcc0995d67ebc) = mysql_fetch_row($result)) {
         $vc1332a8893475d77a4cb5226b0e6246d[] = $v447b7147e84be512208dcc0995d67ebc;
     }
     if (!empty($vc1332a8893475d77a4cb5226b0e6246d) and in_array($vd84ff935144e00c3e1d395c2379aca47, $vc1332a8893475d77a4cb5226b0e6246d)) {
         foreach ($vc1332a8893475d77a4cb5226b0e6246d as $v52dfbb9b0e571701b76699a145406d48) {
             preg_match("/^([a-z0-9_.-]*)(\\d*?)\$/U", $v52dfbb9b0e571701b76699a145406d48, $v66373a9c960d5bb19f89068c5a2797b0);
             if (!empty($v66373a9c960d5bb19f89068c5a2797b0[2])) {
                 $va2d2953131ec91efe3c90d4dbcee3777 = max($va2d2953131ec91efe3c90d4dbcee3777, $v66373a9c960d5bb19f89068c5a2797b0[2]);
             }
         }
         ++$va2d2953131ec91efe3c90d4dbcee3777;
         if ($v0161cd78b4dc4a09ae9d2bbdb93dddc4) {
             $v363b122c528f54df4a0446b6bab05515 = 0;
             for ($v363b122c528f54df4a0446b6bab05515 = 1; $v363b122c528f54df4a0446b6bab05515 < $va2d2953131ec91efe3c90d4dbcee3777; $v363b122c528f54df4a0446b6bab05515++) {
                 if (!in_array($v544988e29afe707b134aa03709eb443e . $v363b122c528f54df4a0446b6bab05515, $vc1332a8893475d77a4cb5226b0e6246d)) {
                     $va2d2953131ec91efe3c90d4dbcee3777 = $v363b122c528f54df4a0446b6bab05515;
                     break;
                 }
             }
         }
     }
     return $v544988e29afe707b134aa03709eb443e . $va2d2953131ec91efe3c90d4dbcee3777;
 }
Beispiel #9
0
 public function copy_to_lang_old()
 {
     $langId = (int) getRequest('lang-id');
     $domainId = (int) getRequest('domain-id');
     $alias_new = (array) getRequest('alias');
     $move_old = (array) getRequest('move');
     $force = (int) getRequest('force');
     $mode = (string) getRequest('mode');
     $elements = getRequest('element');
     if (!is_array($elements)) {
         $elements = array($elements);
     }
     foreach ($alias_new as $k => $v) {
         $alias_new[$k] = umiHierarchy::convertAltName($v);
     }
     if (!is_null($langId)) {
         $hierarchy = umiHierarchy::getInstance();
         if (!$force) {
             $aliases_old = array();
             foreach ($elements as $elementId) {
                 if (!empty($move_old[$elementId])) {
                     continue;
                 }
                 $element = $this->expectElement($elementId, false, true);
                 $alt_name = $element->getAltName();
                 if (!empty($alias_new[$element->getId()])) {
                     $alt_name = $alias_new[$element->getId()];
                 }
                 $errors = array();
                 $element_dst = umiHierarchy::getInstance()->getIdByPath($alt_name, false, $errors, $domainId, $langId);
                 $element_dst = $this->expectElement($element_dst, false, true);
                 if ($element_dst && $element_dst->getAltName() == $alt_name) {
                     $alt_name_normal = $hierarchy->getRightAltName($alt_name, $element_dst, false, true);
                     $aliases_old[$element->getId()] = array($alt_name, $alt_name_normal);
                 }
             }
             if (count($aliases_old)) {
                 $this->setDataType("list");
                 $this->setActionType("view");
                 $data = array('error' => array());
                 //$this->prepareData(array(), "pages");
                 $data['error']['nodes:item'] = array();
                 $data['error']['type'] = '__alias__';
                 $path = "http://" . domainsCollection::getInstance()->getDomain($domainId)->getHost() . "/";
                 if (!langsCollection::getInstance()->getLang($langId)->getIsDefault()) {
                     $path .= langsCollection::getInstance()->getLang($langId)->getPrefix() . '/';
                 }
                 foreach ($aliases_old as $k => $v) {
                     $data['error']['nodes:item'][] = array('attribute:id' => $k, 'attribute:path' => $path, 'attribute:alias' => $v[0], 'attribute:alt_name_normal' => $v[1]);
                 }
                 $this->setData($data);
                 return $this->doData();
             }
         }
         $templatesCollection = templatescollection::getInstance();
         $templates = $templatesCollection->getTemplatesList($domainId, $langId);
         $template_error = false;
         if (empty($templates)) {
             $template_error = true;
         }
         if ($template_error) {
             $this->setDataType("list");
             $this->setActionType("view");
             $data = $this->prepareData(array(), "pages");
             $dstLang = langsCollection::getInstance()->getLang($langId);
             $lang = '';
             if (!$dstLang->getIsDefault()) {
                 $lang .= $dstLang->getPrefix() . '/';
             }
             $data['error'] = array();
             $data['error']['type'] = "__template_not_exists__";
             $data['error']['text'] = sprintf(getLabel('error-no-template-in-domain'), $lang);
             $this->setData($data);
             return $this->doData();
         }
         $template_def = $templatesCollection->getDefaultTemplate($domainId, $langId);
         foreach ($elements as $elementId) {
             $element = $this->expectElement($elementId, false, true);
             $element_template = $templatesCollection->getTemplate($element->getTplId());
             $template_has = false;
             foreach ($templates as $v) {
                 if ($v->getFilename() == $element_template->getFilename()) {
                     $template_has = $v;
                 }
             }
             if (!$template_has) {
                 $template_has = $template_def;
             }
             if (!$template_has) {
                 $template_has = reset($templates);
             }
             //if($element->getLangId() != $langId || true) {
             if ($mode == 'move') {
                 $copyElement = $element;
                 $copyElementId = $element->getId();
             } else {
                 $copyChilds = (bool) getRequest('copy_all');
                 $copyElementId = $hierarchy->cloneElement($element->getId(), 0, true, false);
                 $copyElement = $hierarchy->getElement($copyElementId);
             }
             if ($copyElement instanceof umiHierarchyElement) {
                 $alt_name = $element->getAltName();
                 if (!empty($alias_new[$element->getId()])) {
                     $alt_name = $alias_new[$element->getId()];
                 }
                 if (!empty($move_old[$element->getId()])) {
                     $element_dst = umiHierarchy::getInstance()->getIdByPath($alt_name, false, $errors, $domainId, $langId);
                     $element_dst = $this->expectElement($element_dst, false, true);
                     if ($element_dst && $element_dst->getAltName() == $alt_name) {
                         $hierarchy->delElement($element_dst->getId());
                     }
                 }
                 $copyElement->setLangId($langId);
                 if ($domainId) {
                     $copyElement->setDomainId($domainId);
                 }
                 $copyElement->setAltName($alt_name);
                 if ($template_has) {
                     $copyElement->setTplId($template_has->getId());
                 }
                 $copyElement->commit();
                 $childs = $hierarchy->getChilds($copyElementId);
                 self::changeChildsLang($childs, $langId, $domainId);
             }
         }
     }
     $this->setDataType("list");
     $this->setActionType("view");
     $data = $this->prepareData(array(), "pages");
     $this->setData($data);
     return $this->doData();
 }
Beispiel #10
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 deleteElementRelatedPages($v7552cd149af7495ee7d8225974e50f80)
 {
     $this->enabled = (bool) $this->config->get('cache', 'static.enabled');
     $vee434023cf89d7dfb21f63d64f0f9d74 = $this->config->get('cache', 'static.mode') == 'nginx';
     if ($this->enabled && $vee434023cf89d7dfb21f63d64f0f9d74) {
         $vb81ca7c0ccaa77e7aa91936ab0070695 = umiHierarchy::getInstance();
         $v8e2dcfd7e7e24b1ca76c1193f645902b = $vb81ca7c0ccaa77e7aa91936ab0070695->getElement($v7552cd149af7495ee7d8225974e50f80);
         if ($v8e2dcfd7e7e24b1ca76c1193f645902b instanceof umiHierarchyElement) {
             if (is_object(domainsCollection::getInstance()->getDomain($v8e2dcfd7e7e24b1ca76c1193f645902b->getDomainId()))) {
                 $vad5f82e879a9c5d6b5b442eb37e50551 = domainsCollection::getInstance()->getDomain($v8e2dcfd7e7e24b1ca76c1193f645902b->getDomainId())->getHost();
                 $v7572559ca86e781ba8fe8073a0b725c6 = langsCollection::getInstance()->getLang($v8e2dcfd7e7e24b1ca76c1193f645902b->getLangId())->getPrefix();
                 $v851148b4fd8fd7ae74bd9100c5c0c898 = $this->config->includeParam('system.static-cache');
                 if (!$v851148b4fd8fd7ae74bd9100c5c0c898) {
                     $v851148b4fd8fd7ae74bd9100c5c0c898 = dirname(dirname(__FILE__)) . '/sys-temp/runtime-cache/';
                 }
                 if (substr($v851148b4fd8fd7ae74bd9100c5c0c898, -1, 1) != '/') {
                     $v851148b4fd8fd7ae74bd9100c5c0c898 .= '/';
                 }
                 $v851148b4fd8fd7ae74bd9100c5c0c898 .= $vad5f82e879a9c5d6b5b442eb37e50551 . $vb81ca7c0ccaa77e7aa91936ab0070695->getPathById($v7552cd149af7495ee7d8225974e50f80);
                 $v8c7dd922ad47494fc02c388e12c00eac = $v851148b4fd8fd7ae74bd9100c5c0c898 . 'index.html';
                 $this->deleteFileIfExists($v8c7dd922ad47494fc02c388e12c00eac);
                 $this->deleteFolderIfEmpty(dirname($v8c7dd922ad47494fc02c388e12c00eac));
             }
         }
     }
     $v47826cacc65c665212b821e6ff80b9b0 = $this->cacheFolder . 'cacheElementsRelations/' . $this->defragmentDirPath($v7552cd149af7495ee7d8225974e50f80) . '/' . $v7552cd149af7495ee7d8225974e50f80 . '.tmp';
     if (!file_exists($v47826cacc65c665212b821e6ff80b9b0)) {
         return false;
     }
     $v8fa14cdd754f91cc6554c9e71929cce7 = fopen($v47826cacc65c665212b821e6ff80b9b0, "r");
     if ($v8fa14cdd754f91cc6554c9e71929cce7 !== false) {
         while (!feof($v8fa14cdd754f91cc6554c9e71929cce7)) {
             $vd6fe1d0be6347b8ef2427fa629c04485 = trim(fgets($v8fa14cdd754f91cc6554c9e71929cce7, 1024));
             if ($this->deleteFileIfExists($vd6fe1d0be6347b8ef2427fa629c04485)) {
                 $this->deleteFileIfExists($vd6fe1d0be6347b8ef2427fa629c04485 . ".store.php");
             }
             $this->deleteFolderIfEmpty(dirname($vd6fe1d0be6347b8ef2427fa629c04485));
         }
         fclose($v8fa14cdd754f91cc6554c9e71929cce7);
         unlink($v47826cacc65c665212b821e6ff80b9b0);
     }
     $this->deleteFolderIfEmpty(dirname($v47826cacc65c665212b821e6ff80b9b0));
     $v6a7f245843454cf4f28ad7c5e2572aa2 = umiHierarchy::getInstance()->getObjectInstances($v7552cd149af7495ee7d8225974e50f80);
     if (is_array($v6a7f245843454cf4f28ad7c5e2572aa2)) {
         foreach ($v6a7f245843454cf4f28ad7c5e2572aa2 as $vb80bb7740288fda1f201890375a60c8f) {
             if ($vb80bb7740288fda1f201890375a60c8f != $v7552cd149af7495ee7d8225974e50f80) {
                 $this->deleteElementRelatedPages($vb80bb7740288fda1f201890375a60c8f);
             }
         }
     }
 }
Beispiel #12
0
 public function getLangsList()
 {
     $vca33584dfc14a6cf50d466b06fc1ac5f = langsCollection::getInstance();
     $v5a05866850c28651fe234659f6c92ada = $vca33584dfc14a6cf50d466b06fc1ac5f->getList();
     $vfca1bff8ad8b3a8585abfb0ad523ba42 = array();
     $vfca1bff8ad8b3a8585abfb0ad523ba42['items'] = array('nodes:item' => $v5a05866850c28651fe234659f6c92ada);
     return $vfca1bff8ad8b3a8585abfb0ad523ba42;
 }
 public function saveEditedLangs($v8d777f385d3dfec8815d20f7496026dc, $vcc86ffa55f0ab6b9ddbf32c1a3d24d67)
 {
     $vdb6d9b451b818ccc9a449383f2f0c450 = langsCollection::getInstance();
     if (is_array($v8d777f385d3dfec8815d20f7496026dc)) {
         foreach ($v8d777f385d3dfec8815d20f7496026dc as $vb80bb7740288fda1f201890375a60c8f => $vcaf9b6b99962bf5c2264824231d7a40c) {
             $vd5d3db1765287eef77d7927cc956f50a = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'title');
             $v851f5ac9941d720844d143ed9cfcf60a = getArrayKey($vcaf9b6b99962bf5c2264824231d7a40c, 'prefix');
             if (!strlen($vd5d3db1765287eef77d7927cc956f50a) || !strlen($v851f5ac9941d720844d143ed9cfcf60a)) {
                 continue;
             }
             $vd5d3db1765287eef77d7927cc956f50a = trim($vd5d3db1765287eef77d7927cc956f50a);
             $v851f5ac9941d720844d143ed9cfcf60a = preg_replace("/[^A-z0-9]*/", "", $v851f5ac9941d720844d143ed9cfcf60a);
             if (!strlen($vd5d3db1765287eef77d7927cc956f50a) || !strlen($v851f5ac9941d720844d143ed9cfcf60a)) {
                 continue;
             }
             if ($vb80bb7740288fda1f201890375a60c8f == "new") {
                 $vb80bb7740288fda1f201890375a60c8f = $vdb6d9b451b818ccc9a449383f2f0c450->addLang($v851f5ac9941d720844d143ed9cfcf60a, $vd5d3db1765287eef77d7927cc956f50a);
             }
             $v447b7147e84be512208dcc0995d67ebc = $vdb6d9b451b818ccc9a449383f2f0c450->getLang($vb80bb7740288fda1f201890375a60c8f);
             if ($v447b7147e84be512208dcc0995d67ebc instanceof iLang) {
                 $v447b7147e84be512208dcc0995d67ebc->setTitle($vd5d3db1765287eef77d7927cc956f50a);
                 $v447b7147e84be512208dcc0995d67ebc->setPrefix($v851f5ac9941d720844d143ed9cfcf60a);
                 $v447b7147e84be512208dcc0995d67ebc->commit();
             } else {
                 throw new coreException("Lang #{$vb80bb7740288fda1f201890375a60c8f} doesn't exists");
             }
         }
     }
 }
Beispiel #14
0
 public function generateFeed($elementId, $xslPath, $typeId = null)
 {
     $this->errorSetErrorPage('/');
     if ($elementId && (!umiHierarchy::getInstance()->isExists($elementId) || !umiHierarchy::getInstance()->getElement($elementId)->getIsActive())) {
         if (def_module::isXSLTResultMode()) {
             $result = array('error' => '%data_feed_nofeed%');
             return def_module::parseTemplate('', $result);
         } else {
             return '%data_feed_nofeed%';
         }
     }
     if ($typeId) {
         list($name, $ext) = explode('-', $typeId);
         $hierarchyType = umiHierarchyTypesCollection::getInstance()->getTypeByName($name, $ext);
         if ($hierarchyType) {
             $typeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($hierarchyType->getId());
         }
     } elseif ($elementId) {
         $typeId = umiHierarchy::getInstance()->getDominantTypeId($elementId);
     } else {
         $typeId = umiObjectTypesCollection::getInstance()->getTypeIdByGUID('news-item');
     }
     $type = umiObjectTypesCollection::getInstance()->getType($typeId);
     if ($type instanceof umiObjectType) {
         $module = $type->getModule();
         $method = $type->getMethod();
     }
     if (!isset($module) && !isset($method)) {
         if (def_module::isXSLTResultMode()) {
             $result = array('error' => '%data_feed_nofeed%');
             return def_module::parseTemplate('', $result);
         } else {
             return '%data_feed_nofeed%';
         }
     }
     if (!$this->checkIfFeedable($module, $method)) {
         if (def_module::isXSLTResultMode()) {
             $result = array('error' => '%data_feed_wrong%');
             return def_module::parseTemplate('', $result);
         } else {
             return '%data_feed_wrong%';
         }
     }
     $rss_per_page = (int) regedit::getInstance()->getVal("//modules/news/rss_per_page");
     $rss_per_page = $rss_per_page > 0 ? $rss_per_page : 10;
     $sel = new selector('pages');
     $sel->option('return')->value('id');
     $sel->where('hierarchy')->page($elementId)->childs(100);
     $sel->types('hierarchy-type')->name($module, $method);
     if ($type->getFieldId('publish_time')) {
         $sel->order('publish_time')->desc();
     }
     $sel->limit(0, $rss_per_page);
     $result = array();
     foreach ($sel->result() as $res) {
         $result[] = $res['id'];
     }
     $exporter = new xmlExporter('rss');
     $exporter->addElements($result);
     $exporter->setIgnoreRelations();
     $umiDump = $exporter->execute();
     $styleFile = CURRENT_WORKING_DIR . "/" . $xslPath;
     if (!is_file($styleFile)) {
         throw new publicException("Can't load exporter {$styleFile}");
     }
     $doc = new DOMDocument("1.0", "utf-8");
     $doc->formatOutput = XML_FORMAT_OUTPUT;
     $doc->loadXML($umiDump->saveXML());
     if (!$elementId) {
         $elementId = umiHierarchy::getInstance()->getDefaultElementId();
     }
     $element = umiHierarchy::getInstance()->getElement($elementId);
     $language = langsCollection::getInstance()->getLang($element->getLangId())->getPrefix();
     $link = umiHierarchy::getInstance()->getPathById($elementId);
     $description = $element->getIsDefault() ? '' : $element->getName();
     $templater = umiTemplater::create('XSLT', $styleFile);
     $templater->setAdditionalVariables(array('link' => $link, 'description' => $description, 'language' => $language));
     $resultXml = $templater->parse($doc);
     $buffer = outputBuffer::current();
     $buffer->contentType('text/xml');
     $buffer->clear();
     $buffer->push($resultXml);
     $buffer->end();
 }
 /**
  * @static
  * Загружает шаблоны, используя шаблонизатор в зависимости от режима работы макросов, возвращает запрошенные блоки
  *
  * @param string $filePath - путь к источнику шаблонов
  * @return array
  */
 public static function loadTemplates($filePath = "")
 {
     $args = func_get_args();
     $templater = self::isXSLTResultMode() ? 'umiTemplaterXSLT' : 'umiTemplaterTPL';
     if (!self::isXSLTResultMode() && !is_file($filePath)) {
         $cmsController = cmsController::getInstance();
         // получаем полный путь к tpl-шаблону
         $defaultLang = langsCollection::getInstance()->getDefaultLang();
         $currentLang = $cmsController->getCurrentLang();
         $resourcesDir = $cmsController->getResourcesDirectory();
         $langPrefix = '';
         if ($defaultLang && $currentLang && $defaultLang->getId() != $currentLang->getId()) {
             $langPrefix = $currentLang->getPrefix();
         }
         if (substr($filePath, -4) === '.tpl') {
             $filePath = substr($filePath, 0, -4);
         }
         $files = array();
         if (system_is_mobile()) {
             $pathArray = explode('/', $filePath);
             $mobileFilePath = '/mobile/' . array_pop($pathArray);
             $mobileFilePath = implode('/', $pathArray) . $mobileFilePath;
             if (strlen($langPrefix)) {
                 $files[] = $mobileFilePath . '.' . $langPrefix;
             }
             $files[] = $mobileFilePath;
         }
         if (strlen($langPrefix)) {
             $files[] = $filePath . '.' . $langPrefix;
         }
         $files[] = $filePath;
         $dir = rtrim($resourcesDir ? $resourcesDir : CURRENT_WORKING_DIR, '/') . '/tpls/';
         foreach ($files as $filePath) {
             $filePath = $dir . $filePath . '.tpl';
             if (is_file($filePath)) {
                 break;
             }
         }
         $args[0] = $filePath;
     }
     $result = call_user_func_array(array($templater, 'getTemplates'), $args);
     return $result;
 }
 public function frontendPanel()
 {
     $permissions = permissionsCollection::getInstance();
     $cmsController = cmsController::getInstance();
     $maxRecentPages = 5;
     $this->flushAsXml('frontendPanel');
     $modules = array();
     $modulesSortedPriorityList = $this->getSortedModulesList();
     foreach ($modulesSortedPriorityList as $moduleInfo) {
         $modules[] = array('attribute:label' => $moduleInfo['label'], 'attribute:type' => $moduleInfo['type'], 'node:name' => $moduleInfo['name']);
     }
     $hierarchy = umiHierarchy::getInstance();
     $key = md5(getServer('HTTP_REFERER'));
     $currentIds = is_array(getSession($key)) ? getSession($key) : array();
     foreach ($currentIds as $i => $id) {
         $currentIds[$i] = $id[2];
     }
     $currentIds = array_unique($currentIds);
     $current = array();
     foreach ($currentIds as $id) {
         $current[] = $hierarchy->getElement($id);
     }
     $recent = new selector('pages');
     $recent->where('is_deleted')->equals(0);
     $recent->where('is_active')->equals(1);
     $recent->where('lang')->equals(langsCollection::getInstance()->getList());
     $recent->order('updatetime')->desc();
     $recent->limit(0, $maxRecentPages);
     if (sizeof($currentIds) && $permissions->isAllowedModule($permissions->getUserId(), 'backup')) {
         $backup = $cmsController->getModule('backup');
         $changelog = $backup->backup_panel($currentIds[0]);
     } else {
         $changelog = null;
     }
     $user = selector::get('object')->id($permissions->getUserId());
     $referer = getRequest('referer') ? getRequest('referer') : getServer('HTTP_REFERER');
     $tickets = new selector('objects');
     $tickets->types('object-type')->name('content', 'ticket');
     $tickets->where('url')->equals($referer);
     $tickets->limit(0, 100);
     $ticketsResult = array();
     foreach ($tickets as $ticket) {
         $user = selector::get('object')->id($ticket->user_id);
         if (!$user) {
             continue;
         }
         $ticketsResult[] = array('attribute:id' => $ticket->id, 'author' => array('attribute:fname' => $user->fname, 'attribute:lname' => $user->lname, 'attribute:login' => $user->login), 'position' => array('attribute:x' => $ticket->x, 'attribute:y' => $ticket->y, 'attribute:width' => $ticket->width, 'attribute:height' => $ticket->height), 'message' => $ticket->message);
     }
     $result = array('user' => array('attribute:id' => $user->id, 'attribute:fname' => $user->fname, 'attribute:lname' => $user->lname, 'attribute:login' => $user->login), 'tickets' => array('nodes:ticket' => $ticketsResult), 'modules' => array('nodes:module' => $modules), 'documents' => array('editable' => array('nodes:page' => $current), 'recent' => array('nodes:page' => $recent->result())));
     if (!$permissions->isAllowedMethod($permissions->getUserId(), 'content', 'tickets')) {
         unset($result['tickets']);
     }
     if ($changelog && sizeof($changelog['nodes:revision'])) {
         $result['changelog'] = $changelog;
     }
     $event = new umiEventPoint('eipFrontendPanelGet');
     $event->setParam("id", getArrayKey($currentIds, 0));
     $event->addRef("result", $result);
     $event->setMode('after');
     $event->call();
     return $result;
 }
    protected function parseElements()
    {
        $v0565942fb39be0978d5774cfa5320fcb = $this->elements;
        $v6a7f245843454cf4f28ad7c5e2572aa2 = "";
        $va5d4db7ed95dbef22bdd6bd8036da60a = umiHierarchy::getInstance()->forceAbsolutePath(true);
        foreach ($v0565942fb39be0978d5774cfa5320fcb as $v7057e8409c7c531a1a6e9ac3df4ed549) {
            $v8e2dcfd7e7e24b1ca76c1193f645902b = umiHierarchy::getInstance()->getElement($v7057e8409c7c531a1a6e9ac3df4ed549);
            if (!$v8e2dcfd7e7e24b1ca76c1193f645902b) {
                continue;
            }
            $vb068931cc450442b63f5b3d276ea4297 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getName();
            $vd84ff935144e00c3e1d395c2379aca47 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getAltName();
            $v2a304a1348456ccd2234cd71a81bd338 = umiHierarchy::getInstance()->getPathById($v7057e8409c7c531a1a6e9ac3df4ed549);
            $v6be379826b20cc58475f636e33f4606b = $v8e2dcfd7e7e24b1ca76c1193f645902b->getParentId();
            $v0715f6d9497f93911417c9c324265771 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getTypeId();
            $vb946c44d711ade3b061653732977d043 = umiHierarchyTypesCollection::getInstance()->getType($v0715f6d9497f93911417c9c324265771);
            $v571927edeba34435dcef63324b2a4f86 = $vb946c44d711ade3b061653732977d043->getTitle();
            $v5cde3b79e1c913665469de8dc2f1f8b6 = $vb946c44d711ade3b061653732977d043->getName();
            $v28843f287b7e7d3ee4ad0be8761e325d = $vb946c44d711ade3b061653732977d043->getExt();
            $vd02e12eb6d6c3f6ebd763197df01e211 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getTplId();
            $vf9bdb7221804d6d17b654ec67c5a0735 = templatesCollection::getInstance()->getTemplate($vd02e12eb6d6c3f6ebd763197df01e211)->getFilename();
            $v78e6dd7a49f5b0cb2106a3a434dd5c86 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getLangId();
            $v7572559ca86e781ba8fe8073a0b725c6 = langsCollection::getInstance()->getLang($v78e6dd7a49f5b0cb2106a3a434dd5c86);
            $vff8b918bc674d6a658430241e4a74574 = $v7572559ca86e781ba8fe8073a0b725c6->getTitle();
            $v753527be46567ad90a4203cf4b40d70e = $v7572559ca86e781ba8fe8073a0b725c6->getPrefix();
            $v662cbf1253ac7d8750ed9190c52163e5 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getDomainId();
            $vad5f82e879a9c5d6b5b442eb37e50551 = domainsCollection::getInstance()->getDomain($v662cbf1253ac7d8750ed9190c52163e5);
            $vf9b9218cbe221f8b9f1292474aa6f3e4 = $vad5f82e879a9c5d6b5b442eb37e50551->getHost();
            $vaf31437ce61345f416579830a98c91e5 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getObject()->getId();
            $ve1c6c9ef2fcbe75f26f815c4ef2e60b4 = (int) $v8e2dcfd7e7e24b1ca76c1193f645902b->getIsVisible();
            $v4264c638e0098acb172519b0436db099 = (int) $v8e2dcfd7e7e24b1ca76c1193f645902b->getIsActive();
            $v3e04dc2abd929a9d02e2e0fa41d24bf9 = new umiDate($v8e2dcfd7e7e24b1ca76c1193f645902b->getUpdateTime());
            $v2e10faa7211633841eebf971b7056c0b = $v3e04dc2abd929a9d02e2e0fa41d24bf9->getFormattedDate("U");
            $vd4f11866a8f58f1071bd3ae29c935c5a = $v3e04dc2abd929a9d02e2e0fa41d24bf9->getFormattedDate("r");
            $vc10cb84e1a90ce84ef3ee424c2b1a2ef = $v3e04dc2abd929a9d02e2e0fa41d24bf9->getFormattedDate(DATE_ATOM);
            $ve05b19ee2921f914301c26bcc4fc8d5a = umiImportRelations::getInstance()->getNewIdRelation($this->source_id, $v6be379826b20cc58475f636e33f4606b);
            $ve7398137766d8a8621035454620c1317 = umiImportRelations::getInstance()->getNewIdRelation($this->source_id, $v7057e8409c7c531a1a6e9ac3df4ed549);
            if ($v7057e8409c7c531a1a6e9ac3df4ed549 && !$ve7398137766d8a8621035454620c1317) {
                umiImportRelations::getInstance()->setIdRelation($this->source_id, $v7057e8409c7c531a1a6e9ac3df4ed549, $v7057e8409c7c531a1a6e9ac3df4ed549);
                $ve7398137766d8a8621035454620c1317 = $v7057e8409c7c531a1a6e9ac3df4ed549;
            }
            if ($v6be379826b20cc58475f636e33f4606b && !$ve05b19ee2921f914301c26bcc4fc8d5a) {
                umiImportRelations::getInstance()->setIdRelation($this->source_id, $v6be379826b20cc58475f636e33f4606b, $v6be379826b20cc58475f636e33f4606b);
                $ve05b19ee2921f914301c26bcc4fc8d5a = $v6be379826b20cc58475f636e33f4606b;
            }
            $v6a7f245843454cf4f28ad7c5e2572aa2 .= <<<END
\t<element id="{$ve7398137766d8a8621035454620c1317}" parentId="{$ve05b19ee2921f914301c26bcc4fc8d5a}" objectId="{$vaf31437ce61345f416579830a98c91e5}" is_visible="{$ve1c6c9ef2fcbe75f26f815c4ef2e60b4}" is_active="{$v4264c638e0098acb172519b0436db099}">
\t\t<name><![CDATA[{$vb068931cc450442b63f5b3d276ea4297}]]></name>
\t\t<link><![CDATA[{$v2a304a1348456ccd2234cd71a81bd338}]]></link>
\t\t<altName><![CDATA[{$vd84ff935144e00c3e1d395c2379aca47}]]></altName>

\t\t<templateId><![CDATA[{$vd02e12eb6d6c3f6ebd763197df01e211}]]></templateId>
\t\t<templatePath><![CDATA[{$vf9bdb7221804d6d17b654ec67c5a0735}]]></templatePath>
\t\t<lang prefix="{$v753527be46567ad90a4203cf4b40d70e}"><![CDATA[{$vff8b918bc674d6a658430241e4a74574}]]></lang>
\t\t<domain><![CDATA[{$vf9b9218cbe221f8b9f1292474aa6f3e4}]]></domain>

\t\t<behaviour>
\t\t\t<title><![CDATA[{$v571927edeba34435dcef63324b2a4f86}]]></title>
\t\t\t<module><![CDATA[{$v5cde3b79e1c913665469de8dc2f1f8b6}]]></module>
\t\t\t<method><![CDATA[{$v28843f287b7e7d3ee4ad0be8761e325d}]]></method>
\t\t</behaviour>

\t\t<updateTime>
\t\t\t\t<timestamp><![CDATA[{$v2e10faa7211633841eebf971b7056c0b}]]></timestamp>
\t\t\t\t<RFC><![CDATA[{$vd4f11866a8f58f1071bd3ae29c935c5a}]]></RFC>
\t\t\t\t<UTC><![CDATA[{$vc10cb84e1a90ce84ef3ee424c2b1a2ef}]]></UTC>
\t\t</updateTime>
\t</element>


END;
            unset($v8e2dcfd7e7e24b1ca76c1193f645902b);
            umiHierarchy::getInstance()->unloadElement($v7057e8409c7c531a1a6e9ac3df4ed549);
        }
        umiHierarchy::getInstance()->forceAbsolutePath($va5d4db7ed95dbef22bdd6bd8036da60a);
        unset($v0565942fb39be0978d5774cfa5320fcb);
        return $v6a7f245843454cf4f28ad7c5e2572aa2;
    }
 protected function exportLang($vf585b7f018bb4ced15a03683a733e50b)
 {
     if (isset($this->exported_langs[$vf585b7f018bb4ced15a03683a733e50b])) {
         return false;
     }
     if ($this->limit) {
         if ($this->position >= $this->limit) {
             $this->break = true;
             return false;
         }
     }
     $v7572559ca86e781ba8fe8073a0b725c6 = langsCollection::getInstance()->getLang($vf585b7f018bb4ced15a03683a733e50b);
     $v4a8a08f09d37b73795649038408b5f33 = $this->doc->createElement('lang');
     $this->translateEntity($v7572559ca86e781ba8fe8073a0b725c6, $v4a8a08f09d37b73795649038408b5f33);
     $v392cdf2310e931972f2459edc1ea2ff2 = $this->relations->getOldLangIdRelation($this->source_id, $vf585b7f018bb4ced15a03683a733e50b);
     if ($v392cdf2310e931972f2459edc1ea2ff2 === false) {
         $this->relations->setLangIdRelation($this->source_id, $vf585b7f018bb4ced15a03683a733e50b, $vf585b7f018bb4ced15a03683a733e50b);
         $v392cdf2310e931972f2459edc1ea2ff2 = $vf585b7f018bb4ced15a03683a733e50b;
     } else {
         $v4a8a08f09d37b73795649038408b5f33->setAttribute('id', $v392cdf2310e931972f2459edc1ea2ff2);
     }
     $this->langs_container->appendChild($v4a8a08f09d37b73795649038408b5f33);
     $this->exported_langs[$vf585b7f018bb4ced15a03683a733e50b] = $v392cdf2310e931972f2459edc1ea2ff2;
     $this->position++;
     return true;
 }
 protected function importTemplate(DOMElement $vcaf9b6b99962bf5c2264824231d7a40c)
 {
     $v61ce6a78cb3c8547fed20990c92edfe3 = $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('id');
     $vd5d3db1765287eef77d7927cc956f50a = $vcaf9b6b99962bf5c2264824231d7a40c->hasAttribute('title') ? $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('title') : null;
     if (!strlen($v61ce6a78cb3c8547fed20990c92edfe3)) {
         $this->reportError($this->getLabel('label-cannot-create-template') . " \"{$vd5d3db1765287eef77d7927cc956f50a}\" " . $this->getLabel('label-with-empty-id'));
         return false;
     }
     $vdb6d9b451b818ccc9a449383f2f0c450 = templatesCollection::getInstance();
     $v435ed7e9f07f740abf511a62c00eef6e = $vcaf9b6b99962bf5c2264824231d7a40c->hasAttribute('filename') ? $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('filename') : null;
     $vee473c9da1c9449806dd22465b875ae8 = $vcaf9b6b99962bf5c2264824231d7a40c->hasAttribute('domain-id') ? $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('domain-id') : null;
     $v596c3edc46f1e96c9f90a4b4cef2ac35 = $vcaf9b6b99962bf5c2264824231d7a40c->hasAttribute('lang-id') ? $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('lang-id') : null;
     $vf62baf4c4ead98d50d516eca0ac5a746 = $vcaf9b6b99962bf5c2264824231d7a40c->hasAttribute('is-default') ? $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('is-default') : null;
     $vb068931cc450442b63f5b3d276ea4297 = $vcaf9b6b99962bf5c2264824231d7a40c->hasAttribute('name') ? $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('name') : null;
     $v599dcce2998a6b40b1e38e8c6006cb0a = $vcaf9b6b99962bf5c2264824231d7a40c->hasAttribute('type') ? $vcaf9b6b99962bf5c2264824231d7a40c->getAttribute('type') : null;
     $v78e6dd7a49f5b0cb2106a3a434dd5c86 = false;
     $v662cbf1253ac7d8750ed9190c52163e5 = false;
     if (!is_null($v596c3edc46f1e96c9f90a4b4cef2ac35)) {
         $v78e6dd7a49f5b0cb2106a3a434dd5c86 = $this->relations->getNewLangIdRelation($this->source_id, $v596c3edc46f1e96c9f90a4b4cef2ac35);
     }
     if (!is_null($vee473c9da1c9449806dd22465b875ae8)) {
         $v662cbf1253ac7d8750ed9190c52163e5 = $this->relations->getNewDomainIdRelation($this->source_id, $vee473c9da1c9449806dd22465b875ae8);
     }
     if (!$v78e6dd7a49f5b0cb2106a3a434dd5c86) {
         $v78e6dd7a49f5b0cb2106a3a434dd5c86 = langsCollection::getInstance()->getDefaultLang()->getId();
     }
     if (!$v662cbf1253ac7d8750ed9190c52163e5) {
         $v662cbf1253ac7d8750ed9190c52163e5 = domainsCollection::getInstance()->getDefaultTemplate()->getId();
     }
     $ve2fa538867c3830a859a5b17ab24644b = false;
     $v74f5356453a69e438e0f58ef93103cc0 = $this->relations->getNewTemplateIdRelation($this->source_id, $v61ce6a78cb3c8547fed20990c92edfe3);
     if ($v74f5356453a69e438e0f58ef93103cc0 && $this->update_ignore) {
         $this->writeLog($this->getLabel('label-template') . " \"" . $vd5d3db1765287eef77d7927cc956f50a . "\" (#{$v61ce6a78cb3c8547fed20990c92edfe3}) " . $this->getLabel('label-already-exists'));
         return $vdb6d9b451b818ccc9a449383f2f0c450->getTemplate($v74f5356453a69e438e0f58ef93103cc0);
     }
     if (!$v74f5356453a69e438e0f58ef93103cc0) {
         if (!$vd5d3db1765287eef77d7927cc956f50a) {
             $vd5d3db1765287eef77d7927cc956f50a = $v61ce6a78cb3c8547fed20990c92edfe3;
         }
         $v74f5356453a69e438e0f58ef93103cc0 = $this->detectTemplateId($v435ed7e9f07f740abf511a62c00eef6e, $v662cbf1253ac7d8750ed9190c52163e5, $v78e6dd7a49f5b0cb2106a3a434dd5c86);
         if (!$v74f5356453a69e438e0f58ef93103cc0) {
             $v74f5356453a69e438e0f58ef93103cc0 = $vdb6d9b451b818ccc9a449383f2f0c450->addTemplate($v435ed7e9f07f740abf511a62c00eef6e, $vd5d3db1765287eef77d7927cc956f50a);
         }
         $this->relations->setTemplateIdRelation($this->source_id, $v61ce6a78cb3c8547fed20990c92edfe3, $v74f5356453a69e438e0f58ef93103cc0);
         $ve2fa538867c3830a859a5b17ab24644b = true;
     }
     $v66f6181bcb4cff4cd38fbc804a036db6 = $vdb6d9b451b818ccc9a449383f2f0c450->getTemplate($v74f5356453a69e438e0f58ef93103cc0);
     if (!$v66f6181bcb4cff4cd38fbc804a036db6 instanceof template) {
         $this->reportError($this->getLabel('label-cannot-detect-template') . "\"{$vd5d3db1765287eef77d7927cc956f50a}\"");
         return false;
     }
     if (!is_null($vf62baf4c4ead98d50d516eca0ac5a746)) {
         $v66f6181bcb4cff4cd38fbc804a036db6->setIsDefault($vf62baf4c4ead98d50d516eca0ac5a746);
     }
     if (!is_null($vb068931cc450442b63f5b3d276ea4297)) {
         $v66f6181bcb4cff4cd38fbc804a036db6->setName($vb068931cc450442b63f5b3d276ea4297);
     }
     if (!is_null($v599dcce2998a6b40b1e38e8c6006cb0a)) {
         $v66f6181bcb4cff4cd38fbc804a036db6->setType($v599dcce2998a6b40b1e38e8c6006cb0a);
     }
     $v66f6181bcb4cff4cd38fbc804a036db6->setLangId($v78e6dd7a49f5b0cb2106a3a434dd5c86);
     $v66f6181bcb4cff4cd38fbc804a036db6->setDomainId($v662cbf1253ac7d8750ed9190c52163e5);
     if ($ve2fa538867c3830a859a5b17ab24644b) {
         $this->created_templates++;
         $this->writeLog($this->getLabel('label-template') . " \"" . $vd5d3db1765287eef77d7927cc956f50a . "\" (" . $v61ce6a78cb3c8547fed20990c92edfe3 . ") " . $this->getLabel('label-has-been-created-m'));
     } elseif ($v66f6181bcb4cff4cd38fbc804a036db6->getIsUpdated()) {
         $this->updated_templates++;
         $this->writeLog($this->getLabel('label-template') . " \"" . $vd5d3db1765287eef77d7927cc956f50a . "\" (" . $v61ce6a78cb3c8547fed20990c92edfe3 . ") " . $this->getLabel('label-has-been-updated-m'));
     }
     $v66f6181bcb4cff4cd38fbc804a036db6->commit();
     return $v66f6181bcb4cff4cd38fbc804a036db6;
 }
Beispiel #20
0
<?php

ini_set("display_errors", "1");
error_reporting(E_ALL);
require "../standalone.php";
header("Content-type: text/javascript; charset=utf-8");
enableOutputCompression();
$v100b9d7a39ea15296482a66701d97864 = trim(getServer('HTTP_REFERER'), "/");
$v673299140b0e1fd8f19cc1e8f8ab2e29 = langsCollection::getInstance()->getDefaultLang();
$vf93468b031de35b3137ae86c486febac = explode("/", $v100b9d7a39ea15296482a66701d97864);
if (isset($vf93468b031de35b3137ae86c486febac[3])) {
    $v64aa031a650240cac51b92ea0ad20369 = $vf93468b031de35b3137ae86c486febac[3];
    if ($va1eac8b3c6e26be694489a4cba0b6809 = langsCollection::getInstance()->getLangId($v64aa031a650240cac51b92ea0ad20369)) {
        $v673299140b0e1fd8f19cc1e8f8ab2e29 = langsCollection::getInstance()->getLang($va1eac8b3c6e26be694489a4cba0b6809);
    }
}
echo "\nvar pre_lang = '" . $v673299140b0e1fd8f19cc1e8f8ab2e29->getPrefix() . "';\n";
$vc3d518ded8cde6122ff9f877236ad62e = isset($_COOKIE['ilang']) ? $_COOKIE['ilang'] : "";
$vc3d518ded8cde6122ff9f877236ad62e = str_replace('\\', "", $vc3d518ded8cde6122ff9f877236ad62e);
$vc3d518ded8cde6122ff9f877236ad62e = str_replace('/', "", $vc3d518ded8cde6122ff9f877236ad62e);
$vc3d518ded8cde6122ff9f877236ad62e = substr($vc3d518ded8cde6122ff9f877236ad62e, 0, 2);
echo "\naLang = '" . $vc3d518ded8cde6122ff9f877236ad62e . "';\n";
echo file_get_contents(CURRENT_WORKING_DIR . "/js/client/lang/qEdit_" . $vc3d518ded8cde6122ff9f877236ad62e . ".js");
?>

var is_ie = !(navigator.appName.indexOf("Netscape") != -1);

<?php 
if (file_exists("./client/commonClient.js")) {
    echo <<<END
includeJS("/js/client/commonClient.js");
 public function update_sitemap()
 {
     $domainId = (int) getRequest('param0');
     $domain = domainsCollection::getInstance()->getDomain($domainId);
     $complete = false;
     $elements = array();
     $hierarchy = umiHierarchy::getInstance();
     $dirName = CURRENT_WORKING_DIR . "/sys-temp/sitemap/{$domainId}/";
     if (!is_dir($dirName)) {
         mkdir($dirName, 0777, true);
     }
     $filePath = $dirName . "domain";
     if (!file_exists($filePath)) {
         $elements = array();
         $langsCollection = langsCollection::getInstance();
         $langs = $langsCollection->getList();
         foreach ($langs as $lang) {
             $elements = array_merge($elements, $hierarchy->getChildIds(0, false, true, false, $domainId, false, $lang->getId()));
         }
         sort($elements);
         file_put_contents($filePath, serialize($elements));
     }
     $offset = (int) getSession("sitemap_offset_" . $domainId);
     $blockSize = mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit") ? mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit") : 25;
     $elements = unserialize(file_get_contents($filePath));
     for ($i = $offset; $i <= $offset + $blockSize - 1; $i++) {
         if (!array_key_exists($i, $elements)) {
             $complete = true;
             break;
         }
         $element = $hierarchy->getElement($elements[$i], true, true);
         if ($element instanceof umiHierarchyElement) {
             $element->updateSiteMap(true);
         }
     }
     $_SESSION["sitemap_offset_" . $domainId] = $offset + $blockSize;
     if ($complete) {
         unset($_SESSION["sitemap_offset_" . $domainId]);
         unlink($filePath);
     }
     $data = array("attribute:complete" => (int) $complete);
     $this->setData($data);
     return $this->doData();
 }