/** * Зарегистрировать событие в истории событий * @param string $eventTypeId идентификатор типа события * @param array $params массив параметров события * @param int $elementId id связанной страницы * @param int $objectId id связанного объекта */ public function registerEvent($eventTypeId, $params = array(), $elementId = null, $objectId = null) { $pool = ConnectionPool::getInstance(); $connection = $pool->getConnection(); umiEventFeed::setConnection($connection); umiEventFeedType::setConnection($connection); try { $eventType = umiEventFeedType::get($eventTypeId); } catch (Exception $e) { $eventType = umiEventFeedType::create($eventTypeId); } $userId = permissionsCollection::getInstance()->getUserId(); $user = umiObjectsCollection::getInstance()->getObject($userId)->getName(); $module = cmsController::getInstance()->getModule('users'); $link = $module->getObjectEditLink($userId); array_unshift($params, $user); array_unshift($params, $link); umiEventFeed::create($eventType, $params, $elementId, $objectId); $maxDays = (int) regedit::getInstance()->getVal("//modules/events/max-days-storing-events"); if ($maxDays > 0) { $lastDate = time() - ($maxDays * 24 * 60 * 60); umiEventFeed::deleteList(array(), $lastDate); } }
public function config() { $regedit = regedit::getInstance(); $params = Array( "config" => Array( "int:per_page" => NULL, "boolean:confirm_user_answer" => NULL ) ); $mode = getRequest("param0"); if($mode == "do") { $params = $this->expectParams($params); $regedit->setVar("//modules/faq/per_page", $params['config']['int:per_page']); $regedit->setVar("//modules/faq/confirm_user_answer", $params['config']['boolean:confirm_user_answer']); $this->chooseRedirect(); } $params['config']['int:per_page'] = (int) $regedit->getVal("//modules/faq/per_page"); $params['config']['boolean:confirm_user_answer'] = (int) $regedit->getVal("//modules/faq/confirm_user_answer"); $this->setDataType("settings"); $this->setActionType("modify"); $data = $this->prepareData($params, "settings"); $this->setData($data); return $this->doData(); }
public function banners_list() { //Deprecated method $regedit = regedit::getInstance(); $regedit->setVar("//modules/banners/default_method_admin", "lists"); $this->redirect($this->pre_lang . "/admin/banners/lists/"); }
static function detectFilters(selector $v8be74552df93e31bbdd6b36ed74bdb6a) { if ($v8be74552df93e31bbdd6b36ed74bdb6a->mode == 'pages') { $ve4e46deb7f9cc58c7abfb32e5570b6f3 = (array) getRequest('domain_id'); foreach ($ve4e46deb7f9cc58c7abfb32e5570b6f3 as $v72ee76c5c29383b7c9f9225c1fa4d10b) { $v8be74552df93e31bbdd6b36ed74bdb6a->where('domain')->equals($v72ee76c5c29383b7c9f9225c1fa4d10b); } $v5a05866850c28651fe234659f6c92ada = (array) getRequest('lang_id'); foreach ($v5a05866850c28651fe234659f6c92ada as $vf585b7f018bb4ced15a03683a733e50b) { $v8be74552df93e31bbdd6b36ed74bdb6a->where('lang')->equals($vf585b7f018bb4ced15a03683a733e50b); } } if ($v8be74552df93e31bbdd6b36ed74bdb6a->mode == 'pages' && sizeof($v8be74552df93e31bbdd6b36ed74bdb6a->types) && is_array(getRequest('rel')) && regedit::getInstance()->getVal('//modules/comments')) { $v8be74552df93e31bbdd6b36ed74bdb6a->types('hierarchy-type')->name('comments', 'comment'); } if (isset($_REQUEST['hierarchy_types'])) { $vc7fcb1af65c062d638abb298ceddb52b = (array) $_REQUEST['hierarchy_types']; foreach ($vc7fcb1af65c062d638abb298ceddb52b as $v9e3669d19b675bd57058fd4664205d2a) { $v9e3669d19b675bd57058fd4664205d2a = explode('-', $v9e3669d19b675bd57058fd4664205d2a); if (sizeof($v9e3669d19b675bd57058fd4664205d2a) == 2) { $v8be74552df93e31bbdd6b36ed74bdb6a->types('hierarchy-type')->name($v9e3669d19b675bd57058fd4664205d2a[0], $v9e3669d19b675bd57058fd4664205d2a[1]); } } } self::detectHierarchyFilters($v8be74552df93e31bbdd6b36ed74bdb6a); self::detectWhereFilters($v8be74552df93e31bbdd6b36ed74bdb6a); self::detectOrderFilters($v8be74552df93e31bbdd6b36ed74bdb6a); self::checkSyncParams($v8be74552df93e31bbdd6b36ed74bdb6a); }
public function paymentCheckStep(order $order, $step) { if ($step == 'address' && !regedit::getInstance()->getVal('//modules/emarket/enable-delivery') || $step == 'bonus' && !customer::get()->bonus) { return false; } return $step; }
public function onAddTopicToDispatch(iUmiEventPoint $oEvent) { $iDispatchId = regedit::getInstance()->getVal("//modules/forum/dispatch_id"); if (!$iDispatchId) { return false; } $dispatches_module = cmsController::getInstance()->getModule('dispatches'); if (!$dispatches_module) { return false; } $iTopicId = (int) $oEvent->getParam('topic_id'); $oTopicElement = umiHierarchy::getInstance()->getElement($iTopicId); if ($oTopicElement instanceof umiHierarchyElement) { $sTitle = (string) getRequest('title'); $sMessage = (string) getRequest('body'); $iHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "message")->getId(); $iMsgTypeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iHierarchyTypeId); $oMsgType = umiObjectTypesCollection::getInstance()->getType($iMsgTypeId); $iMsgObjId = umiObjectsCollection::getInstance()->addObject($sTitle, $iMsgTypeId); $oMsgObj = umiObjectsCollection::getInstance()->getObject($iMsgObjId); if ($oMsgObj instanceof umiObject) { $iReleaseId = $dispatches_module->getNewReleaseInstanceId($iDispatchId); $oMsgObj->setValue('release_reference', $iReleaseId); $oMsgObj->setValue('header', $sTitle); $oMsgObj->setValue('body', $sMessage); $oMsgObj->commit(); return true; } else { return false; } } else { return false; } }
public function partialReindex() { $this->setDataType("settings"); $this->setActionType("view"); $lastId = (int) getRequest("lastId"); $search = searchModel::getInstance(); $total = (int) $search->getAllIndexablePages(); $limit = regedit::getInstance()->getVal("//modules/search/one_iteration_index"); if ($limit==0) { $limit = 5; } $result = $search->index_all($limit, $lastId); $data = Array( 'index-status' => Array( 'attribute:current' => $result['current'], 'attribute:total' => $total, 'attribute:lastId' => $result['lastId'] ) ); $this->setData($data); return $this->doData(); }
public function renderDeliveryAddressesList(order $order, $template = 'default') { list($tpl_block, $tpl_item) = def_module::loadTemplates("emarket/delivery/{$template}", 'delivery_address_block', 'delivery_address_item'); $customer = customer::get(); $addresses = $customer->delivery_addresses; $items_arr = array(); $currentDeliveryId = $order->getValue('delivery_address'); $collection = umiObjectsCollection::getInstance(); if (is_array($addresses)) { foreach ($addresses as $address) { $addressObject = $collection->getObject($address); $item_arr = array('attribute:id' => $address, 'attribute:name' => $addressObject->name); if ($address == $currentDeliveryId) { $item_arr['attribute:active'] = 'active'; $item_arr['void:checked'] = 'checked="checked" '; } else { $item_arr['void:checked'] = ''; } $items_arr[] = def_module::parseTemplate($tpl_item, $item_arr, false, $address); } } $types = umiObjectTypesCollection::getInstance(); $typeId = $types->getBaseType("emarket", "delivery_address"); $block_arr = array('attribute:type-id' => $typeId, 'attribute:type_id' => $typeId, 'xlink:href' => 'udata://data/getCreateForm/' . $typeId, 'subnodes:items' => $items_arr); $regedit = regedit::getInstance(); if ((bool) $regedit->getVal('//modules/emarket/delivery-with-address')) { $block_arr['delivery'] = $this->renderDeliveryList($order, $template, true); } else { $block_arr['void:delivery'] = ''; } return def_module::parseTemplate($tpl_block, $block_arr); }
public function __construct() { parent::__construct(); if(cmsController::getInstance()->getCurrentMode() == "admin") { $configTabs = $this->getConfigTabs(); if ($configTabs) { $configTabs->add("config"); $configTabs->add("rss_list"); $configTabs->add("subjects"); } $this->__loadLib("__admin.php"); $this->__implement("__news"); $this->__loadLib("__subjects.php"); $this->__implement("__subjects_news"); $this->__loadLib("__custom_adm.php"); $this->__implement("__custom_adm_news"); } else { $this->__loadLib("__custom.php"); $this->__implement("__custom_news"); $this->per_page = regedit::getInstance()->getVal("//modules/news/per_page"); } $this->__loadLib("__rss_import.php"); $this->__implement("__rss_import_news"); }
protected function loadEventListeners() { $v6c63406410aa57b3c97b88d3feb09990 = regedit::getInstance()->getList("//modules"); foreach ($v6c63406410aa57b3c97b88d3feb09990 as $v47c80780ab608cc046f2a6e6f071feb6) { $v22884db148f0ffb0d830ba431102b0b5 = $v47c80780ab608cc046f2a6e6f071feb6[0]; $this->loadModuleEventListeners($v22884db148f0ffb0d830ba431102b0b5); } }
function ch_remove_illegal_module($module_name) { if (!trim($module_name, " \r\n\t\\/")) { return; } $regedit = regedit::getInstance(); $regedit->delVar("//modules/{$module_name}"); //ch_remove_dir("./classes/modules/{$module_name}/"); }
public function security() { $regedit = regedit::getInstance(); $params = array('test' => array()); $this->setDataType("settings"); $this->setActionType("modify"); $data = $this->prepareData($params, "settings"); $this->setData($data); return $this->doData(); }
public function __construct() { parent::__construct(); if (cmsController::getInstance()->getCurrentMode() == "admin") { $this->__loadLib("__admin.php"); $this->__implement("__search"); } else { $this->__loadLib("__custom.php"); $this->__implement("__custom_search"); $this->per_page = regedit::getInstance()->getVal("//modules/search/per_page"); } }
public function confirmUserAnswer($oElement) { $bConfirmUserAnswer = (bool) regedit::getInstance()->getVal("//modules/faq/confirm_user_answer"); if (!$bConfirmUserAnswer) { return true; } if ($oElement instanceof umiHierarchyElement && $oElement->getIsActive()) { $iAuthorId = $oElement->getValue("author_id"); $author_name = ""; $author_email = ""; $oAuthor = umiObjectsCollection::getInstance()->getObject($iAuthorId); if ($oAuthor instanceof umiObject) { $author_user = null; if ($oAuthor->getValue("is_registrated")) { $user_id = $oAuthor->getValue("user_id"); $author_user = umiObjectsCollection::getInstance()->getObject($user_id); } if ($author_user instanceof umiObject) { // author user $author_name = $author_user->getValue("lname") . " " . $author_user->getValue("fname"); $author_email = $author_user->getValue("e-mail"); } else { // author guest $author_name = $oAuthor->getValue("nickname"); $author_email = $oAuthor->getValue("email"); } } if (umiMail::checkEmail($author_email)) { list($sMailSubject, $sMailBody) = def_module::loadTemplatesForMail("faq/default", "answer_mail_subj", "answer_mail"); $block_arr = array(); $block_arr['domain'] = $sDomain = $_SERVER['HTTP_HOST']; $block_arr['element_id'] = $iElementId = $oElement->getId(); $block_arr['author_id'] = $oElement->getValue("author_id"); $bOldFHStatus = umiHierarchy::getInstance()->forceAbsolutePath(true); $block_arr['question_link'] = umiHierarchy::getInstance()->getPathById($iElementId); umiHierarchy::getInstance()->forceAbsolutePath($bOldFHStatus); $block_arr['ticket'] = $iElementId; $sSubject = def_module::parseTemplateForMail($sMailSubject, $block_arr, $iElementId); $sBody = def_module::parseTemplateForMail($sMailBody, $block_arr, $iElementId); $from = regedit::getInstance()->getVal("//settings/fio_from"); $from_email = regedit::getInstance()->getVal("//settings/email_from"); $oMail = new umiMail(); $oMail->addRecipient($author_email); $oMail->setFrom($from_email, $from); $oMail->setSubject($sSubject); $oMail->setContent($sBody); $oMail->commit(); } } return true; }
/** * TODO PHPDoc * Enter description here ... */ public function backup_copies() { $regedit = regedit::getInstance(); $backupDir = str_replace(CURRENT_WORKING_DIR, '', SYS_MANIFEST_PATH) . 'backup/'; $params = array("snapshots" => array("status:backup-directory" => $backupDir)); $ent = getRequest('ent'); if (!$ent) { $ent = time(); $this->redirect($this->pre_lang . '/admin/backup/backup_copies/?ent=' . $ent); } $this->setDataType("settings"); $this->setActionType("modify"); $data = $this->prepareData($params, "settings"); $this->setData($data); return $this->doData(); }
public function __construct() { parent::__construct(); if (cmsController::getInstance()->getCurrentMode() == "admin") { $this->__loadLib("__admin.php"); $this->__implement("__photoalbum"); $this->__loadLib("__picasa.php"); $this->__implement("__picasa_photoalbum"); } else { $this->__loadLib("__custom.php"); $this->__implement("__custom_photoalbum"); } if ($per_page = (int) regedit::getInstance()->getVal("//modules/photoalbum/per_page")) { $this->per_page = $per_page; } }
public function __construct() { parent::__construct(); if (cmsController::getInstance()->getCurrentMode() == "admin") { $this->__loadLib("__admin.php"); $this->__implement("__vote"); } else { $this->__loadLib("__rate.php"); $this->__implement("__rate_vote"); $this->__loadLib("__custom.php"); $this->__implement("__custom_vote"); } $this->__loadLib("__events_handlers.php"); $this->__implement("__eventsHandlers"); $this->is_private = intval(regedit::getInstance()->getVal("//modules/vote/is_private")); }
public function __construct() { parent::__construct(); if (cmsController::getInstance()->getCurrentMode() == "admin") { $this->__loadLib("__admin.php"); $this->__implement("__catalog"); $this->__loadLib("__custom_adm.php"); $this->__implement("__custom_adm_catalog"); } else { $this->per_page = regedit::getInstance()->getVal("//modules/catalog/per_page"); $this->__loadLib("__custom.php"); $this->__implement("__custom_catalog"); $this->autoDetectAttributes(); } $this->__loadLib("__search.php"); $this->__implement("__search_catalog"); }
public function mail_config() { $regedit = regedit::getInstance(); $domains = domainsCollection::getInstance()->getList(); $params = array(); $params['status-notifications'] = array('boolean:no-order-status-notification' => $regedit->getVal('//modules/emarket/no-order-status-notification'), 'boolean:no-payment-status-notification' => $regedit->getVal('//modules/emarket/no-payment-status-notification'), 'boolean:no-delivery-status-notification' => $regedit->getVal('//modules/emarket/no-delivery-status-notification')); foreach ($domains as $domain) { $domain_id = $domain->getId(); $domain_name = $domain->getHost(); $seo_info = array(); $seo_info['status:domain'] = $domain_name; if ($domain->getIsDefault() && !$regedit->getVal("//modules/emarket/from-email/{$domain_id}") && !$regedit->getVal("//modules/emarket/from-name/{$domain_id}") && !$regedit->getVal("//modules/emarket/manager-email/{$domain_id}")) { $seo_info['string:email-' . $domain_id] = $regedit->getVal("//modules/emarket/from-email"); $seo_info['string:name-' . $domain_id] = $regedit->getVal("//modules/emarket/from-name"); $seo_info['string:manageremail-' . $domain_id] = $regedit->getVal("//modules/emarket/manager-email"); } else { $seo_info['string:email-' . $domain_id] = $regedit->getVal("//modules/emarket/from-email/{$domain_id}"); $seo_info['string:name-' . $domain_id] = $regedit->getVal("//modules/emarket/from-name/{$domain_id}"); $seo_info['string:manageremail-' . $domain_id] = $regedit->getVal("//modules/emarket/manager-email/{$domain_id}"); } $params[$domain_name] = $seo_info; } $mode = (string) getRequest('param0'); if ($mode == "do") { $params = $this->expectParams($params); foreach ($domains as $domain) { $domain_id = $domain->getId(); $domain_name = $domain->getHost(); $email = $params[$domain_name]['string:email-' . $domain_id]; $name = $params[$domain_name]['string:name-' . $domain_id]; $manageremail = $params[$domain_name]['string:manageremail-' . $domain_id]; $regedit->setVar("//modules/emarket/from-email/{$domain_id}", $email); $regedit->setVar("//modules/emarket/from-name/{$domain_id}", $name); $regedit->setVar("//modules/emarket/manager-email/{$domain_id}", $manageremail); } $regedit->setVar('//modules/emarket/no-order-status-notification', $params['status-notifications']['boolean:no-order-status-notification']); $regedit->setVar('//modules/emarket/no-payment-status-notification', $params['status-notifications']['boolean:no-payment-status-notification']); $regedit->setVar('//modules/emarket/no-delivery-status-notification', $params['status-notifications']['boolean:no-delivery-status-notification']); $this->chooseRedirect(); } $this->setDataType('settings'); $this->setActionType('modify'); $data = $this->prepareData($params, 'settings'); $this->setData($data); return $this->doData(); }
public function cronUnpublishPage($oEvent) { $object_type = umiObjectTypesCollection::getInstance()->getTypeByGUID('root-pages-type'); $field_id = $object_type->getFieldId("expiration_date"); $sel = new umiSelection(); $sel->addPropertyFilterLess($field_id, time()); $sel->addPropertyFilterNotEqual($field_id, 0); $sel->addActiveFilter(true); $sel->forceHierarchyTable(true); $result = umiSelectionsParser::runSelection($sel); $res = array(); foreach ($result as $key => $page_id) { $ePage = umiHierarchy::getInstance()->getElement($page_id, true); $ePage->setIsActive(false); $pageObject = $ePage->getObject(); $pageObject->setValue("publish_status", $this->getPageStatusIdByStatusSid("page_status_unpublish")); $pageObject->commit(); $ePage->commit(); if (!($publishComments = $ePage->getValue("publish_comments"))) { $publishComments = "Отсутствуют."; } $user_id = $ePage->getObject()->getOwnerId(); $oUser = umiObjectsCollection::getInstance()->getObject($user_id); if ($oUser instanceof umiObject && ($user_email = $oUser->getValue("e-mail"))) { //Составляем и посылаем сообщение пользователю $mail_message = new umiMail(); $from = regedit::getInstance()->getVal("//settings/email_from"); $mail_message->setFrom($from); $mail_message->setPriorityLevel("high"); $mail_message->setSubject(getLabel('label-notification-expired-mail-header')); list($body) = def_module::loadTemplatesForMail("mail/expired", "body"); $block['notify_header'] = getLabel('label-notification-expired-mail-header'); $block['page_header'] = $ePage->getName(); $block['publish_comments'] = $publishComments; $domain = domainsCollection::getInstance()->getDomain($ePage->getDomainId()); $page_host = "http://" . $domain->getHost() . umiHierarchy::getInstance()->getPathById($page_id); $block['page_link'] = $page_host; $mail_html = def_module::parseTemplateForMail($body, $block, $page_id); $mail_message->addRecipient($user_email); $mail_message->setContent($mail_html); $mail_message->commit(); $mail_message->send(); } } }
public function __construct() { parent::__construct(); // Если режим работы admin if (cmsController::getInstance()->getCurrentMode() == "admin") { // Добавление вкладок (config стандартная вкладка) $configTabs = $this->getConfigTabs(); if ($configTabs) { $configTabs->add("config"); } // Подгрузить библиотеку __admin.php и класс __modulelements $this->__loadLib("__admin.php"); $this->__implement("__modulelements"); } else { // Получить из реестра значение per_page $this->per_page = regedit::getInstance()->getVal("//modules/modulelements/per_page"); } }
public function onCronSyncCurrency(iUmiEventPoint $event) { $regedit = regedit::getInstance(); if(!$regedit->getVal('//modules/emarket/enable-currency')) return false; $config = mainConfiguration::getInstance(); $sourceUrl = $config->get('modules', 'emarket.currency.sync.source'); $xslPath = CURRENT_WORKING_DIR .'/xsl/currencies/' . $config->get('modules', 'emarket.currency.sync.xsl'); $originalXml = umiRemoteFileGetter::get($sourceUrl); if(function_exists('mb_detect_encoding') && (mb_detect_encoding($originalXml, "UTF-8, ISO-8859-1, GBK, CP1251") != "UTF-8")) { $originalXml = iconv ("CP1251", "UTF-8", $originalXml); $originalXml = preg_replace("/(encoding=\"windows-1251\")/i", "encoding=\"UTF-8\"", $originalXml); } $xslt = new xsltProcessor; $dom = new DomDocument(); $dom->loadXML($originalXml); $xslt->importStyleSheet(DomDocument::load($xslPath)); $resultXml = $xslt->transformToXML($dom); $tmpPath = SYS_CACHE_RUNTIME . 'tmpcurrencies.xml'; file_put_contents($tmpPath, $resultXml); $currenciesList = new baseXmlConfig($tmpPath); $currencies = $currenciesList->getList('/Exchange/Exchange_Rates', array ( 'code' => '/New_Country', 'rate' => '/Rate', 'nominal' => '/Nominal' )); foreach($currencies as $currencyInfo) { $code = getArrayKey($currencyInfo, 'code'); try { if($currency = $this->getCurrency($code)) { $currency->nominal = getArrayKey($currencyInfo, 'nominal'); $currency->rate = getArrayKey($currencyInfo, 'rate'); $currency->commit(); } } catch(privateException $e) {} } unlink($tmpPath); }
public function import_old_blogs() { // Initializing collections $hierarchyTypesCollection = umiHierarchyTypesCollection::getInstance(); $typesCollection = umiObjectTypesCollection::getInstance(); $hierarchy = umiHierarchy::getInstance(); $objects = umiObjectsCollection::getInstance(); // Loading types info $blog20HType = $hierarchyTypesCollection->getTypeByName('blogs20', 'blog'); $blog20Type = $typesCollection->getType($typesCollection->getTypeByHierarchyTypeId($blog20HType->getId())); $blog20PostHType = $hierarchyTypesCollection->getTypeByName('blogs20', 'post'); $blog20PostType = $typesCollection->getType($typesCollection->getTypeByHierarchyTypeId($blog20PostHType->getId())); $blog20CommentHType = $hierarchyTypesCollection->getTypeByName('blogs20', 'comment'); $blog20CommentType = $typesCollection->getType($typesCollection->getTypeByHierarchyTypeId($blog20CommentHType->getId())); $blogHType = $hierarchyTypesCollection->getTypeByName('blogs', 'blog'); $blogType = $typesCollection->getType($typesCollection->getTypeByHierarchyTypeId($blogHType->getId())); $blogPostHType = $hierarchyTypesCollection->getTypeByName('blogs', 'blog_message'); $blogPostType = $typesCollection->getType($typesCollection->getTypeByHierarchyTypeId($blogHType->getId())); $blogCommentHType = $hierarchyTypesCollection->getTypeByName('blogs', 'blog_comment'); $blogCommentType = $typesCollection->getType($typesCollection->getTypeByHierarchyTypeId($blogHType->getId())); // Collecting all blogs $selection = new umiSelection(); $selection->addElementType($blogHType->getId()); $blogList = umiSelectionsParser::runSelection($selection); // Processing each blog foreach ($blogList as $blogId) { $blog = $hierarchy->getElement($blogId, true, false); $newBlogId = $this->makeElementFromExisting($blogId, $blog->getRel(), $blog20HType->getId(), array('content' => 'description', 'prvlist_friends' => 'friendlist')); $selection = new umiSelection(); $selection->addElementType($blogPostHType->getId()); $selection->addHierarchyFilter($blogId); $postList = umiSelectionsParser::runSelection($selection); foreach ($postList as $postId) { $newPostId = $this->makeElementFromExisting($postId, $newBlogId, $blog20PostHType->getId()); $this->import_comments($postId, $newPostId, $blogCommentHType->getId(), $blog20CommentHType->getId()); } } regedit::getInstance()->setVar("//modules/blogs20/import/old", 1); $this->chooseRedirect(getServer('HTTP_REFERER')); return null; // Never pass into here }
public function domain_mirrows() { $domain_id = getRequest('param0'); $mode = getRequest("param1"); $regedit = regedit::getInstance(); $lang_id = cmsController::getInstance()->getCurrentLang()->getId(); //Domain seo settings edit $seo_info = array(); $additional_info = array(); $seo_info['string:seo-title'] = $regedit->getVal("//settings/title_prefix/{$lang_id}/{$domain_id}"); $seo_info['string:seo-keywords'] = $regedit->getVal("//settings/meta_keywords/{$lang_id}/{$domain_id}"); $seo_info['string:seo-description'] = $regedit->getVal("//settings/meta_description/{$lang_id}/{$domain_id}"); $seo_info['string:ga-id'] = $regedit->getVal("//settings/ga-id/{$domain_id}"); $additional_info['string:site_name'] = $regedit->getVal("//settings/site_name/{$domain_id}/{$lang_id}/") ? $regedit->getVal("//settings/site_name/{$domain_id}/{$lang_id}") : $regedit->getVal("//settings/site_name"); $params = array('seo' => $seo_info, 'additional' => $additional_info); if ($mode == "do") { if (!is_demo()) { $this->saveEditedList("domain_mirrows"); $params = $this->expectParams($params); $title = $params['seo']['string:seo-title']; $keywords = $params['seo']['string:seo-keywords']; $description = $params['seo']['string:seo-description']; $ga_id = $params['seo']['string:ga-id']; $siteName = $params['additional']['string:site_name']; $regedit->setVal("//settings/title_prefix/{$lang_id}/{$domain_id}", $title); $regedit->setVal("//settings/meta_keywords/{$lang_id}/{$domain_id}", $keywords); $regedit->setVal("//settings/meta_description/{$lang_id}/{$domain_id}", $description); $regedit->setVal("//settings/ga-id/{$domain_id}", $ga_id); $regedit->setVal("//settings/site_name/{$domain_id}/{$lang_id}", $siteName); } $this->chooseRedirect($this->pre_lang . '/admin/config/domain_mirrows/' . $domain_id . '/'); } $domains = domainsCollection::getInstance()->getDomain($domain_id); $mirrows = $domains->getMirrowsList(); $this->setDataType("list"); $this->setActionType("modify"); $seoData = $this->prepareData($params, 'settings'); $mirrorsData = $this->prepareData($mirrows, "domain_mirrows"); $data = $seoData + $mirrorsData; $this->setData($data, sizeof($domains)); return $this->doData(); }
public function config() { $regedit = regedit::getInstance(); $params = array('config' => array('int:per_page' => NULL, 'int:rss_per_page' => NULL)); $mode = getRequest("param0"); if ($mode == "do") { $params = $this->expectParams($params); $regedit->setVar("//modules/news/per_page", (int) $params['config']['int:per_page']); $regedit->setVar("//modules/news/rss_per_page", (int) $params['config']['int:rss_per_page']); $this->chooseRedirect(); } $params['config']['int:per_page'] = (int) $regedit->getVal("//modules/news/per_page"); $params['config']['int:rss_per_page'] = (int) $regedit->getVal("//modules/news/rss_per_page"); $params['config']['int:rss_per_page'] = $params['config']['int:rss_per_page'] > 0 ? $params['config']['int:rss_per_page'] : 10; $this->setDataType("settings"); $this->setActionType("modify"); $data = $this->prepareData($params, "settings"); $this->setData($data); return $this->doData(); }
protected function createGrid($v9a09b4dfda82e3e665e31092d1c3ec8d) { $v63a9f0ea7bb98050796b649e85481845 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement("umidump"); $v63a9f0ea7bb98050796b649e85481845->setAttribute('xmlns:xlink', 'http://www.w3.org/TR/xlink'); $v0cc175b9c0f1b6a831c399e269772661 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createAttribute("version"); $v0cc175b9c0f1b6a831c399e269772661->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createTextNode(self::VERSION)); $v63a9f0ea7bb98050796b649e85481845->appendChild($v0cc175b9c0f1b6a831c399e269772661); $v9a09b4dfda82e3e665e31092d1c3ec8d->appendChild($v63a9f0ea7bb98050796b649e85481845); $v6f8f57715090da2632453988d9a1501b = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement("meta"); $v8b1dc169bf460ee884fceef66c6607d6 = cmsController::getInstance(); $vb1444fb0c07653567ad325aa25d4e37a = regedit::getInstance(); $vad5f82e879a9c5d6b5b442eb37e50551 = $v8b1dc169bf460ee884fceef66c6607d6->getCurrentDomain(); $v7572559ca86e781ba8fe8073a0b725c6 = $v8b1dc169bf460ee884fceef66c6607d6->getCurrentLang(); $v7b8b965ad4bca0e41ab51de7b31363a1 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('site-name'); $v7b8b965ad4bca0e41ab51de7b31363a1->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createCDATASection(def_module::parseTPLMacroses(macros_sitename()))); $v6f8f57715090da2632453988d9a1501b->appendChild($v7b8b965ad4bca0e41ab51de7b31363a1); $v7b8b965ad4bca0e41ab51de7b31363a1 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('domain'); $v7b8b965ad4bca0e41ab51de7b31363a1->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createCDATASection($vad5f82e879a9c5d6b5b442eb37e50551->getHost())); $v6f8f57715090da2632453988d9a1501b->appendChild($v7b8b965ad4bca0e41ab51de7b31363a1); $v7b8b965ad4bca0e41ab51de7b31363a1 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('lang'); $v7b8b965ad4bca0e41ab51de7b31363a1->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createCDATASection($v7572559ca86e781ba8fe8073a0b725c6->getPrefix())); $v6f8f57715090da2632453988d9a1501b->appendChild($v7b8b965ad4bca0e41ab51de7b31363a1); $v7b8b965ad4bca0e41ab51de7b31363a1 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('source-name'); $v3a6d0284e743dc4a9b86f97d6dd1a3bf = strlen($this->sourceName) ? $this->sourceName : md5($vad5f82e879a9c5d6b5b442eb37e50551->getId() . $v7572559ca86e781ba8fe8073a0b725c6->getId()); $v7b8b965ad4bca0e41ab51de7b31363a1->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createCDATASection($v3a6d0284e743dc4a9b86f97d6dd1a3bf)); $v6f8f57715090da2632453988d9a1501b->appendChild($v7b8b965ad4bca0e41ab51de7b31363a1); $v7b8b965ad4bca0e41ab51de7b31363a1 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('generate-time'); $v5fc732311905cb27e82d67f4f6511f7f = new umiDate(time()); $ve358efa489f58062f10dd7316b65649e = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('timestamp'); $ve358efa489f58062f10dd7316b65649e->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createTextNode($v5fc732311905cb27e82d67f4f6511f7f->getFormattedDate("U"))); $v7b8b965ad4bca0e41ab51de7b31363a1->appendChild($ve358efa489f58062f10dd7316b65649e); $ve358efa489f58062f10dd7316b65649e = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('rfc'); $ve358efa489f58062f10dd7316b65649e->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createTextNode($v5fc732311905cb27e82d67f4f6511f7f->getFormattedDate("r"))); $v7b8b965ad4bca0e41ab51de7b31363a1->appendChild($ve358efa489f58062f10dd7316b65649e); $ve358efa489f58062f10dd7316b65649e = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('utc'); $ve358efa489f58062f10dd7316b65649e->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createTextNode($v5fc732311905cb27e82d67f4f6511f7f->getFormattedDate(DATE_ATOM))); $v7b8b965ad4bca0e41ab51de7b31363a1->appendChild($ve358efa489f58062f10dd7316b65649e); $v6f8f57715090da2632453988d9a1501b->appendChild($v7b8b965ad4bca0e41ab51de7b31363a1); $v63a9f0ea7bb98050796b649e85481845->appendChild($v6f8f57715090da2632453988d9a1501b); return $v63a9f0ea7bb98050796b649e85481845; }
public static final function getList($selfDeliveryOnly = false) { $sel = new selector('objects'); $sel->types('object-type')->name('emarket', 'delivery'); $regedit = regedit::getInstance(); if ((bool) $regedit->getVal('//modules/emarket/delivery-with-address')) { $types = array(); $typesSel = new selector('objects'); $typesSel->types('object-type')->guid('emarket-deliverytype'); $typesSel->where('class_name')->equals('self'); foreach ($typesSel as $typeId) { $types[] = $typeId->id; } if ($selfDeliveryOnly) { $sel->where('delivery_type_id')->equals($types); } else { $sel->where('delivery_type_id')->notequals($types); } } return $sel->result(); }
public function config() { $regedit = regedit::getInstance(); $params = array("config" => array("int:days-before-notification" => null, "int:clicks-before-notification" => null, "boolean:not-use-referer-tags" => null)); $mode = getRequest("param0"); if ($mode == "do") { $params = $this->expectParams($params); $regedit->setVar("//modules/banners/days-before-notification", (int) $params["config"]["int:days-before-notification"]); $regedit->setVar("//modules/banners/clicks-before-notification", (int) $params["config"]["int:clicks-before-notification"]); $regedit->setVar("//modules/banners/not-use-referer-tags", $params["config"]["boolean:not-use-referer-tags"]); $regedit->setVal("//modules/banners/last-check-date", ""); $this->chooseRedirect(); } $params["config"]["int:days-before-notification"] = (int) $regedit->getVal("//modules/banners/days-before-notification"); $params["config"]["int:clicks-before-notification"] = (int) $regedit->getVal("//modules/banners/clicks-before-notification"); $params["config"]["boolean:not-use-referer-tags"] = $regedit->getVal("//modules/banners/not-use-referer-tags"); $this->setDataType("settings"); $this->setActionType("modify"); $data = $this->prepareData($params, "settings"); $this->setData($data); return $this->doData(); }
public function config() { $regedit = regedit::getInstance(); $objectTypesColl = umiObjectTypesCollection::getInstance(); $params = array("config" => array("guide:def_group" => array('type-id' => $objectTypesColl->getTypeIdByGUID('users-users'), 'value' => NULL), "guide:guest_id" => array('type-id' => $objectTypesColl->getTypeIdByGUID('users-user'), 'value' => NULL), "boolean:without_act" => NULL)); $mode = getRequest("param0"); if ($mode == "do") { $params = $this->expectParams($params); $regedit->setVar("//modules/users/def_group", $params['config']['guide:def_group']); $regedit->setVar("//modules/users/guest_id", $params['config']['guide:guest_id']); $regedit->setVar("//modules/users/without_act", $params['config']['boolean:without_act']); $this->chooseRedirect(); } $params['config']['boolean:without_act'] = $regedit->getVal("//modules/users/without_act"); $params['config']['guide:def_group']['value'] = $regedit->getVal("//modules/users/def_group"); $params['config']['guide:guest_id']['value'] = $regedit->getVal("//modules/users/guest_id"); $this->setDataType("settings"); $this->setActionType("modify"); $data = $this->prepareData($params, "settings"); $this->setData($data); return $this->doData(); }
public function mails() { $regedit = regedit::getInstance(); $params = array("mails" => array("email:admin_email" => NULL, "string:email_from" => NULL, "string:fio_from" => NULL)); $mode = getRequest("param0"); if ($mode == "do") { $params = $this->expectParams($params); if (!is_demo()) { $regedit->setVar("//settings/admin_email", $params['mails']['email:admin_email']); $regedit->setVar("//settings/email_from", $params['mails']['string:email_from']); $regedit->setVar("//settings/fio_from", $params['mails']['string:fio_from']); } $this->chooseRedirect(); } $params['mails']['email:admin_email'] = $regedit->getVal("//settings/admin_email"); $params['mails']['string:email_from'] = $regedit->getVal("//settings/email_from"); $params['mails']['string:fio_from'] = $regedit->getVal("//settings/fio_from"); $this->setDataType("settings"); $this->setActionType("modify"); $data = $this->prepareData($params, "settings"); $this->setData($data); return $this->doData(); }