Example #1
0
 public function last()
 {
     $this->setDataType("settings");
     $this->setActionType("view");
     $preParams = array();
     $data = $this->prepareData($preParams, 'settings');
     $pool = ConnectionPool::getInstance();
     $connection = $pool->getConnection();
     umiEventFeed::setConnection($connection);
     umiEventFeedType::setConnection($connection);
     $user = $this->getUser();
     $settings = umiEventFeedType::getAllowedList($user->getSettings());
     $newEvents = array('nodes:new-event' => array());
     foreach ($settings as $typeId) {
         $count = umiEventFeed::getListCount(array($typeId), $user->getId());
         if (!$count) {
             continue;
         }
         $newEvents['nodes:new-event'][$typeId]['attribute:type-id'] = $typeId;
         $newEvents['nodes:new-event'][$typeId]['attribute:count'] = $count;
         $newEvents['nodes:new-event'][$typeId]['attribute:name'] = getLabel($typeId . '_new');
         $newEvents['nodes:new-event'][$typeId]['attribute:img'] = getLabel($typeId . '_img');
         $newEvents['nodes:new-event'][$typeId]['events'] = array('nodes:events' => array());
         $typeEvents = umiEventFeed::getUnreadList($typeId, $user->getId(), 3);
         foreach ($typeEvents as $eventId => $event) {
             $newEvents['nodes:new-event'][$typeId]['events']['nodes:event'][$eventId] = self::renderEvent($event);
         }
     }
     $data['new-events'] = $newEvents;
     $this->setData($data);
     return $this->doData();
 }
Example #2
0
	public function guide_items($guide_id = false, $per_page = false, $curr_page = 0) {
		$this->setDataType("list");
		$this->setActionType("modify");

		if(!$curr_page) $curr_page = (int) getRequest('p');
		if(!$per_page) $per_page = getRequest('per_page_limit');
		if(!$per_page) $per_page = $this->per_page;
		if(!$guide_id) $guide_id = (int) getRequest('param0');
		$mode = (string) getRequest('param1');

		if($guide = selector::get('object-type')->id($guide_id)) {
			$this->setHeaderLabel(getLabel('header-data-guide_items') . ' "' . $guide->getName() . '"');
		}
		if($this->ifNotXmlMode()) return $this->doData();

		$sel = new selector('objects');
		$sel->types('object-type')->id($guide_id);
		$sel->limit($per_page * $curr_page, $per_page);

		selectorHelper::detectFilters($sel);

		if($mode == "do") {
			$params = array(
				"type_id" => $guide_id
			);
			$this->saveEditedList("objects", $params);
			$this->chooseRedirect();
		}

		$this->setDataRange($per_page, $curr_page * $per_page);
		$data = $this->prepareData($sel->result, "objects");
		$this->setData($data, $sel->total);
		return $this->doData();
	}
 public function systemEventsNotify(iUmiEventPoint $event)
 {
     $eventId = $event->getEventId();
     $titleLabel = $titleLabel = 'event-' . $eventId . '-title';
     $contentLabel = 'event-' . $eventId . '-content';
     $title = getLabel($titleLabel, 'common/content/config');
     $content = getLabel($contentLabel, 'common/content/config');
     if ($titleLabel == $title) {
         return;
     }
     if ($element = $event->getRef('element')) {
         $hierarchy = umiHierarchy::getInstance();
         $oldbForce = $hierarchy->forceAbsolutePath(true);
         $params = array('%page-name%' => $element->name, '%page-link%' => $element->link);
         $hierarchy->forceAbsolutePath($oldbForce);
     } else {
         $params = array();
     }
     if ($object = $event->getRef('object')) {
         $params['%object-name%'] = $object->name;
         $objectTypes = umiObjectTypesCollection::getInstance();
         $objectType = $objectTypes->getType($object->getTypeId());
         if ($hierarchyTypeId = $objectType->getHierarchyTypeId()) {
             $hierarchyTypes = umiHierarchyTypesCollection::getInstance();
             $hierarchyType = $hierarchyTypes->getType($hierarchyTypeId);
             $params['%object-type%'] = $hierarchyType->getTitle();
         }
     }
     $title = str_replace(array_keys($params), array_values($params), $title);
     $content = str_replace(array_keys($params), array_values($params), $content);
     $this->dispatchSystemEvent($title, $content);
 }
Example #4
0
 public function last()
 {
     $this->setDataType("settings");
     $this->setActionType("view");
     $vf9a0f0fbe51f3ec810ee16d6774e434e = array();
     $v8d777f385d3dfec8815d20f7496026dc = $this->prepareData($vf9a0f0fbe51f3ec810ee16d6774e434e, 'settings');
     $vb10a8c0bede9eb4ea771b04db3149f28 = ConnectionPool::getInstance();
     $v4717d53ebfdfea8477f780ec66151dcb = $vb10a8c0bede9eb4ea771b04db3149f28->getConnection();
     umiEventFeed::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     umiEventFeedType::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     $vee11cbb19052e40b07aac0ca060c23ee = $this->getUser();
     $v2e5d8aa3dfa8ef34ca5131d20f9dad51 = umiEventFeedType::getAllowedList($vee11cbb19052e40b07aac0ca060c23ee->getSettings());
     $vfc7f6423b4974f8363e6cd8f3e9a6c78 = array('nodes:new-event' => array());
     foreach ($v2e5d8aa3dfa8ef34ca5131d20f9dad51 as $v5f694956811487225d15e973ca38fbab) {
         $ve2942a04780e223b215eb8b663cf5353 = umiEventFeed::getListCount(array($v5f694956811487225d15e973ca38fbab), $vee11cbb19052e40b07aac0ca060c23ee->getId());
         if (!$ve2942a04780e223b215eb8b663cf5353) {
             continue;
         }
         $vfc7f6423b4974f8363e6cd8f3e9a6c78['nodes:new-event'][$v5f694956811487225d15e973ca38fbab]['attribute:type-id'] = $v5f694956811487225d15e973ca38fbab;
         $vfc7f6423b4974f8363e6cd8f3e9a6c78['nodes:new-event'][$v5f694956811487225d15e973ca38fbab]['attribute:count'] = $ve2942a04780e223b215eb8b663cf5353;
         $vfc7f6423b4974f8363e6cd8f3e9a6c78['nodes:new-event'][$v5f694956811487225d15e973ca38fbab]['attribute:name'] = getLabel($v5f694956811487225d15e973ca38fbab . '_new');
         $vfc7f6423b4974f8363e6cd8f3e9a6c78['nodes:new-event'][$v5f694956811487225d15e973ca38fbab]['attribute:img'] = getLabel($v5f694956811487225d15e973ca38fbab . '_img');
         $vfc7f6423b4974f8363e6cd8f3e9a6c78['nodes:new-event'][$v5f694956811487225d15e973ca38fbab]['events'] = array('nodes:events' => array());
         $vdeb9fb6f3a9c98f75f1ee3cdd8ffa40e = umiEventFeed::getUnreadList($v5f694956811487225d15e973ca38fbab, $vee11cbb19052e40b07aac0ca060c23ee->getId(), 3);
         foreach ($vdeb9fb6f3a9c98f75f1ee3cdd8ffa40e as $v53cc4db543d7a569e51c1d76ac6f278e => $v4119639092e62c55ea8be348e4d9260d) {
             $vfc7f6423b4974f8363e6cd8f3e9a6c78['nodes:new-event'][$v5f694956811487225d15e973ca38fbab]['events']['nodes:event'][$v53cc4db543d7a569e51c1d76ac6f278e] = self::renderEvent($v4119639092e62c55ea8be348e4d9260d);
         }
     }
     $v8d777f385d3dfec8815d20f7496026dc['new-events'] = $vfc7f6423b4974f8363e6cd8f3e9a6c78;
     $this->setData($v8d777f385d3dfec8815d20f7496026dc);
     return $this->doData();
 }
Example #5
0
		public function _network_settings($network) {
			$this->setHeaderLabel(getLabel("header-social_networks-settings") . $network->getName());

			$mode = getRequest("param0");
			$cmsController = cmsController::getInstance();

			$type = $network->getCodeName();

			$module = $cmsController->getCurrentModule();
			$method = $cmsController->getCurrentMethod();
			$config = mainConfiguration::getInstance();
			$templateId = $config->get("templates", "{$module}.{$method}");

			$inputData = array(
				'object' => $network->getObject(),
				'type' => $type
			);

			if($mode == "do") {
				$config->set("templates", "{$module}.{$method}", getRequest('template-id'));
				$object = $this->saveEditedObjectData($inputData);
				$this->chooseRedirect($this->pre_lang . '/admin/social_networks/' . $type . '/');
			}

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

			$data = $this->prepareData($inputData, "object");
			$data['template-id'] = array('@id' => $templateId);

			$this->setData($data);
			return $this->doData();
		}
 public function stream_open($vd6fe1d0be6347b8ef2427fa629c04485, $v15d61712450a686a7f365adf4fef581f, $v93da65a9fd0004d9477aeac024e08e15, $v6385a5865e0b96f09e4142ab2d9e3736)
 {
     $vb99eb979e6f6efabc396f777b503f7e7 = cacheFrontend::getInstance();
     if ($v8d777f385d3dfec8815d20f7496026dc = $vb99eb979e6f6efabc396f777b503f7e7->loadData($vd6fe1d0be6347b8ef2427fa629c04485)) {
         return $this->setData($v8d777f385d3dfec8815d20f7496026dc);
     }
     $v264a818e305e0550c3ee63761dd3d911 = $this->parsePath($vd6fe1d0be6347b8ef2427fa629c04485);
     try {
         if (!is_array($v8d777f385d3dfec8815d20f7496026dc)) {
             $v8d777f385d3dfec8815d20f7496026dc = $this->executeMacros($v264a818e305e0550c3ee63761dd3d911);
             if ($v8d777f385d3dfec8815d20f7496026dc === false) {
                 $v8d777f385d3dfec8815d20f7496026dc = array('error' => array('attribute:code' => 'require-more-permissions', 'node:message' => getLabel('error-require-more-permissions')));
             }
         }
     } catch (publicException $ve1671797c52e15f763380b45e841ec32) {
         $vcb5e100e5a9a3e7f6d1fd97512215282 = array();
         if ($v8e95bd427d65fbeeedb980f640074ea2 = $ve1671797c52e15f763380b45e841ec32->getCode()) {
             $vcb5e100e5a9a3e7f6d1fd97512215282['attribute:code'] = $v8e95bd427d65fbeeedb980f640074ea2;
         }
         if ($v1634f20805d929bd08a1f418a78c0615 = $ve1671797c52e15f763380b45e841ec32->getStrCode()) {
             $vcb5e100e5a9a3e7f6d1fd97512215282['attribute:str-code'] = $v1634f20805d929bd08a1f418a78c0615;
         }
         $vcb5e100e5a9a3e7f6d1fd97512215282['node:message'] = $ve1671797c52e15f763380b45e841ec32->getMessage();
         $v8d777f385d3dfec8815d20f7496026dc = array("error" => $vcb5e100e5a9a3e7f6d1fd97512215282);
     }
     if ($v8d777f385d3dfec8815d20f7496026dc === false) {
         return true;
     } else {
         $v8d777f385d3dfec8815d20f7496026dc = $this->translateToXml(getArrayKey($v264a818e305e0550c3ee63761dd3d911, 'module'), getArrayKey($v264a818e305e0550c3ee63761dd3d911, 'method'), $v8d777f385d3dfec8815d20f7496026dc);
         if ($this->expire) {
             $vb99eb979e6f6efabc396f777b503f7e7->saveData($vd6fe1d0be6347b8ef2427fa629c04485, $v8d777f385d3dfec8815d20f7496026dc, $this->expire);
         }
         return $this->setData($v8d777f385d3dfec8815d20f7496026dc);
     }
 }
 public function profile($template = "default", $user_id = false)
 {
     if (!$template) {
         $template = "default";
     }
     list($template_block, $template_bad_user_block) = def_module::loadTemplates("users/profile/" . $template, "profile_block", "bad_user_block");
     $block_arr = array();
     if (!$user_id) {
         $user_id = (int) getRequest('param0');
     }
     if (!$user_id) {
         $permissions = permissionsCollection::getInstance();
         if ($permissions->isAuth()) {
             $user_id = $permissions->getUserId();
         }
     }
     if ($user = selector::get('object')->id($user_id)) {
         $this->validateEntityByTypes($user, array('module' => 'users', 'method' => 'user'));
         $block_arr['xlink:href'] = "uobject://" . $user_id;
         $userTypeId = $user->getTypeId();
         if ($userType = umiObjectTypesCollection::getInstance()->getType($userTypeId)) {
             $userHierarchyTypeId = $userType->getHierarchyTypeId();
             if ($userHierarchyType = umiHierarchyTypesCollection::getInstance()->getType($userHierarchyTypeId)) {
                 if ($userHierarchyType->getName() == "users" && $userHierarchyType->getExt() == "user") {
                     $block_arr['id'] = $user_id;
                     return def_module::parseTemplate($template_block, $block_arr, false, $user_id);
                 }
             }
         }
     } else {
         throw new publicException(getLabel('error-object-does-not-exist', null, $user_id));
     }
     return def_module::parseTemplate($template_bad_user_block, $block_arr);
 }
Example #8
0
 function getItemLabel()
 {
     if (!$this->itemLbl) {
         $this->itemLbl = getLabel($this->item, 'rule_action');
     }
     return $this->itemLbl;
 }
 function CdrResults($rule_id = "", $active_alert_flag = "", $passive_alert_flag = "", $patient_reminder_flag = "")
 {
     $this->id = $rule_id;
     $this->rule = getLabel($this->id, 'clinical_rules');
     $this->active_flag = $active_alert_flag;
     $this->passive_flag = $passive_alert_flag;
     $this->reminder_flag = $patient_reminder_flag;
 }
Example #10
0
 public function viewAuthor($author_id = false, $template = "default")
 {
     if ($author_id === false) {
         throw new publicException(getLabel('error-object-does-not-exist', null, $author_id));
     }
     if (!($author = umiObjectsCollection::getInstance()->getObject($author_id))) {
         throw new publicException(getLabel('error-object-does-not-exist', null, $author_id));
     }
     if (!$template) {
         $template = "default";
     }
     list($template_user, $template_guest, $template_sv) = def_module::loadTemplates("users/author/{$template}", "user_block", "guest_block", "sv_block");
     $block_arr = array();
     if ($author->getTypeId() == umiObjectTypesCollection::getInstance()->getBaseType('users', 'user')) {
         $template = $template_user;
         $block_arr['user_id'] = $author_id;
         $user = $author;
         $block_arr['nickname'] = $user->getValue("login");
         $block_arr['email'] = $user->getValue("e-mail");
         $block_arr['fname'] = $user->getValue("fname");
         $block_arr['lname'] = $user->getValue("lname");
         $block_arr['subnodes:groups'] = $groups = $user->getValue("groups");
         if (in_array(SV_GROUP_ID, $groups)) {
             if ($template_sv) {
                 $template = $template_sv;
             }
         }
     } else {
         if ($author->getValue("is_registrated")) {
             $template = $template_user;
             $block_arr['user_id'] = $user_id = $author->getValue("user_id");
             $user = umiObjectsCollection::getInstance()->getObject($user_id);
             if (!$user instanceof umiObject) {
                 $block_arr['user_id'] = $user_id = intval(regedit::getInstance()->getVal("//modules/users/guest_id"));
                 $user = umiObjectsCollection::getInstance()->getObject($user_id);
             }
             if (!$user instanceof umiObject) {
                 return false;
             }
             $block_arr['nickname'] = $user->getValue("login");
             $block_arr['login'] = $user->getValue("login");
             $block_arr['email'] = $user->getValue("e-mail");
             $block_arr['fname'] = $user->getValue("fname");
             $block_arr['lname'] = $user->getValue("lname");
             $block_arr['subnodes:groups'] = $groups = $user->getValue("groups");
             if (in_array(SV_GROUP_ID, $groups)) {
                 if ($template_sv) {
                     $template = $template_sv;
                 }
             }
         } else {
             $template = $template_guest;
             $block_arr['nickname'] = $author->getValue("nickname");
             $block_arr['email'] = $author->getValue("email");
         }
     }
     return def_module::parseTemplate($template, $block_arr, false, $author_id);
 }
Example #11
0
 function __construct($rule_id = "", $active_alert_flag = "", $passive_alert_flag = "", $patient_reminder_flag = "", $access_control = "")
 {
     $this->id = $rule_id;
     $this->rule = getLabel($this->id, 'clinical_rules');
     $this->active_flag = $active_alert_flag;
     $this->passive_flag = $passive_alert_flag;
     $this->reminder_flag = $patient_reminder_flag;
     $this->access_control = $access_control;
 }
 protected function translateLabel($vd304ba20e96d87411588eeabac850e34)
 {
     $v851f5ac9941d720844d143ed9cfcf60a = "i18n::";
     if (substr($vd304ba20e96d87411588eeabac850e34, 0, strlen($v851f5ac9941d720844d143ed9cfcf60a)) == $v851f5ac9941d720844d143ed9cfcf60a) {
         $v341be97d9aff90c9978347f66f945b77 = getLabel(substr($vd304ba20e96d87411588eeabac850e34, strlen($v851f5ac9941d720844d143ed9cfcf60a)));
     } else {
         $v341be97d9aff90c9978347f66f945b77 = getLabel($vd304ba20e96d87411588eeabac850e34);
     }
     return is_null($v341be97d9aff90c9978347f66f945b77) ? $vd304ba20e96d87411588eeabac850e34 : $v341be97d9aff90c9978347f66f945b77;
 }
 protected function getLabel($i18n)
 {
     $vd304ba20e96d87411588eeabac850e34 = getLabel($i18n);
     if (!$vd304ba20e96d87411588eeabac850e34 || $vd304ba20e96d87411588eeabac850e34 == $i18n) {
         $vd304ba20e96d87411588eeabac850e34 = str_replace('label-', '', $i18n);
         $vd304ba20e96d87411588eeabac850e34 = preg_replace("/(.*?)-[m,f,n]+\$/", "\$1", $vd304ba20e96d87411588eeabac850e34);
         $vd304ba20e96d87411588eeabac850e34 = str_replace('-', ' ', $vd304ba20e96d87411588eeabac850e34);
     }
     return $vd304ba20e96d87411588eeabac850e34;
 }
 function post_review()
 {
     // change the wording for errors here
     // do not change the keys of the array
     $this->_errors = array('no_author' => getLabel('CR_ERROR_NO_AUTHOR'), 'no_review' => getLabel('CR_ERROR_NO_REVIEW'), 'no_rating' => getLabel('CR_ERROR_NO_RATING'), 'no_product' => getLabel('CR_ERROR_NO_PRODUCT'), 'disabled' => getLabel('CR_ERROR_DISABLED'), 'multiple' => getLabel('CR_ERROR_MULTIPLE'), 'anonymous' => getLabel('CR_ERROR_ANONYMOUS'));
     // change the wording for success here
     // do not change the keys of the array
     $this->_success = array('added' => getLabel('CR_SUCCESS_ADDED'), 'accepted' => getLabel('CR_SUCCESS_ACCEPTED'));
     // setting posted cr_id to 0
     $this->_cr_id_posted = 0;
 }
Example #15
0
 function _action_getrows()
 {
     $rows = array();
     $rules = resolve_rules_sql('', '0', TRUE);
     foreach ($rules as $rowRule) {
         $title = getLabel($rowRule['id'], 'clinical_rules');
         $type = "Reminder";
         $row = array("title" => $title, "type" => $type, "id" => $rowRule['id']);
         $rows[] = $row;
     }
     $this->emit_json($rows);
 }
Example #16
0
 public function number()
 {
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->order('number')->desc();
     $sel->limit(0, 1);
     $number = $sel->first ? $sel->first->number + 1 : 1;
     $order = $this->order;
     $order->name = getLabel('order-name-prefix', 'emarket', $number);
     $order->number = $number;
     $order->commit();
     return $number;
 }
 public function discount_add()
 {
     $inputData = array("type" => "discount");
     $mode = (string) getRequest('param0');
     if ($mode == "do") {
         $data = getArrayKey(getRequest('data'), 'new');
         //Create new dicsount
         $discountName = getRequest('name');
         $discountTypeId = getArrayKey($data, 'discount_type_id');
         try {
             $discount = discount::add($discountName, $discountTypeId);
             //Apply modificator
             $modificatorId = getArrayKey($data, 'discount_modificator_id');
             try {
                 $modificatorTypeObject = $this->expectObject($modificatorId, true, true);
             } catch (publicAdminException $e) {
                 if ($discount) {
                     $discount->delete();
                 }
                 $this->errorNewMessage(getLabel('error-modificator-required'));
                 $this->errorPanic();
             }
             $modificatorObject = discountModificator::create($discount, $modificatorTypeObject);
             $discount->setDiscountModificator($modificatorObject);
             //Apply rules
             $rulesId = getArrayKey($data, 'discount_rules_id');
             foreach ($rulesId as $ruleId) {
                 $ruleTypeObject = $this->expectObject($ruleId, true, true);
                 $ruleObject = discountRule::create($discount, $ruleTypeObject);
                 if ($ruleObject instanceof discountRule == false) {
                     $discount->delete();
                     throw new publicAdminException("discountRule #{$ruleId} \"{$ruleTypeObject->name}\" class not found");
                 }
                 $discount->appendDiscountRule($ruleObject);
             }
             $discount->commit();
         } catch (valueRequiredException $e) {
             $this->errorNewMessage($e->getMessage());
             $this->errorPanic();
         }
         $this->chooseRedirect($this->pre_lang . "/admin/emarket/discount_edit/" . $discount->getId() . "/");
     }
     $this->setDataType("form");
     $this->setActionType("create");
     $data = $this->prepareData($inputData, "object");
     $this->setData($data);
     return $this->doData();
 }
Example #18
0
 public function import_do()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     $id = getRequest('param0');
     $objects = umiObjectsCollection::getInstance();
     $settings = $objects->getObject($id);
     if (!$settings instanceof umiObject) {
         throw new publicException(getLabel("exchange-err-settings_notfound"));
     }
     $importFile = $settings->file;
     if (!$importFile instanceof umiFile || $importFile->getIsBroken()) {
         throw new publicException(getLabel("exchange-err-importfile"));
     }
     $format_id = $settings->format;
     $importFormat = $objects->getObject($format_id);
     if (!$importFormat instanceof umiObject) {
         throw new publicException(getLabel("exchange-err-format_undefined"));
     }
     $suffix = $importFormat->sid;
     $import_offset = (int) getSession("import_offset_" . $id);
     $blockSize = mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit") ? mainConfiguration::getInstance()->get("modules", "exchange.splitter.limit") : 25;
     $splitter = umiImportSplitter::get($suffix);
     $splitter->load($importFile->getFilePath(), $blockSize, $import_offset);
     $doc = $splitter->getDocument();
     $dump = $splitter->translate($doc);
     $oldIgnoreSiteMap = umiHierarchy::$ignoreSiteMap;
     umiHierarchy::$ignoreSiteMap = true;
     $importer = new xmlImporter();
     $importer->loadXmlString($dump);
     $elements = $settings->elements;
     if (is_array($elements) && count($elements)) {
         $importer->setDestinationElement($elements[0]);
     }
     $importer->setIgnoreParentGroups($splitter->ignoreParentGroups);
     $importer->setAutoGuideCreation($splitter->autoGuideCreation);
     $importer->setRenameFiles($splitter->getRenameFiles());
     $importer->execute();
     umiHierarchy::$ignoreSiteMap = $oldIgnoreSiteMap;
     $_SESSION["import_offset_" . $id] = $splitter->getOffset();
     if ($splitter->getIsComplete()) {
         unset($_SESSION["import_offset_" . $id]);
     }
     $data = array("attribute:complete" => (int) $splitter->getIsComplete(), "attribute:created" => $importer->created_elements, "attribute:updated" => $importer->updated_elements, "attribute:deleted" => $importer->deleted_elements, "attribute:errors" => $importer->import_errors, "nodes:log" => $importer->getImportLog());
     $this->setData($data);
     return $this->doData();
 }
Example #19
0
 /**
  * Получить типы событий, отслеживаемые пользователем
  */
 public function getUserSettings()
 {
     $pool = ConnectionPool::getInstance();
     $connection = $pool->getConnection();
     umiEventFeedType::setConnection($connection);
     umiEventFeedUser::setConnection($connection);
     $user = $this->getUser();
     $settings = umiEventFeedType::getAllowedList($user->getSettings());
     $types = umiEventFeedType::getList();
     $result = array('nodes:type' => array());
     foreach ($types as $type) {
         $typeId = $type->getId();
         $result['nodes:type'][$typeId]['attribute:id'] = $typeId;
         $result['nodes:type'][$typeId]['attribute:name'] = getLabel($typeId);
         $result['nodes:type'][$typeId]['attribute:checked'] = in_array($typeId, $settings) ? 1 : 0;
     }
     return def_module::parseTemplate('', $result);
 }
Example #20
0
 public function getUserSettings()
 {
     $vb10a8c0bede9eb4ea771b04db3149f28 = ConnectionPool::getInstance();
     $v4717d53ebfdfea8477f780ec66151dcb = $vb10a8c0bede9eb4ea771b04db3149f28->getConnection();
     umiEventFeedType::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     umiEventFeedUser::setConnection($v4717d53ebfdfea8477f780ec66151dcb);
     $vee11cbb19052e40b07aac0ca060c23ee = $this->getUser();
     $v2e5d8aa3dfa8ef34ca5131d20f9dad51 = umiEventFeedType::getAllowedList($vee11cbb19052e40b07aac0ca060c23ee->getSettings());
     $vd14a8022b085f9ef19d479cbdd581127 = umiEventFeedType::getList();
     $result = array('nodes:type' => array());
     foreach ($vd14a8022b085f9ef19d479cbdd581127 as $v599dcce2998a6b40b1e38e8c6006cb0a) {
         $v5f694956811487225d15e973ca38fbab = $v599dcce2998a6b40b1e38e8c6006cb0a->getId();
         $result['nodes:type'][$v5f694956811487225d15e973ca38fbab]['attribute:id'] = $v5f694956811487225d15e973ca38fbab;
         $result['nodes:type'][$v5f694956811487225d15e973ca38fbab]['attribute:name'] = getLabel($v5f694956811487225d15e973ca38fbab);
         $result['nodes:type'][$v5f694956811487225d15e973ca38fbab]['attribute:checked'] = in_array($v5f694956811487225d15e973ca38fbab, $v2e5d8aa3dfa8ef34ca5131d20f9dad51) ? 1 : 0;
     }
     return def_module::parseTemplate('', $result);
 }
 public function validateValue($v2063c1608d6e0baf80249c42e2be5804)
 {
     if ((is_null($v2063c1608d6e0baf80249c42e2be5804) || $v2063c1608d6e0baf80249c42e2be5804 === false || $v2063c1608d6e0baf80249c42e2be5804 === "") && $this->field->getIsRequired()) {
         throw new valueRequiredException(getLabel('error-value-required', null, $this->getTitle()));
     }
     if ($v2063c1608d6e0baf80249c42e2be5804 && ($v6b1a57fa235477758817df3c91158006 = $this->field->getRestrictionId())) {
         $v3dadfaeb46ec74762b37de11fea7605c = baseRestriction::get($v6b1a57fa235477758817df3c91158006);
         if ($v3dadfaeb46ec74762b37de11fea7605c instanceof baseRestriction) {
             if ($v3dadfaeb46ec74762b37de11fea7605c instanceof iNormalizeInRestriction) {
                 $v2063c1608d6e0baf80249c42e2be5804 = $v3dadfaeb46ec74762b37de11fea7605c->normalizeIn($v2063c1608d6e0baf80249c42e2be5804, $this->object_id);
             }
             if ($v3dadfaeb46ec74762b37de11fea7605c->validate($v2063c1608d6e0baf80249c42e2be5804, $this->object_id) === false) {
                 throw new wrongValueException(getLabel($v3dadfaeb46ec74762b37de11fea7605c->getErrorMessage(), null, $this->getTitle()));
             }
         }
     }
     return $v2063c1608d6e0baf80249c42e2be5804;
 }
function process($nid, &$pages, &$obj, &$counters)
{
    $incremented = array();
    foreach ($pages[$nid] as $o) {
        $type = $o["#type"];
        if ($type == "link") {
            process($o["#link"], $pages, $obj, $counters);
            continue;
        }
        $objProps = $obj[$type];
        $counter = $lowest = $objProps["#counter"];
        $fixed = $objProps["#fixed"];
        if (!$fixed) {
            if (!isset($incremented[$counter])) {
                $last = $lowest = $counter;
                for (; $lowest != null && $counters[$lowest]["value"] == 0; $lowest = $counters[$lowest]["parent"]) {
                    $last = $lowest;
                }
                $lowest = $last;
                $incremented[$counter] = array("#level" => $lowest);
            } else {
                $lowest = $incremented[$counter]["#level"];
            }
        }
        if (isset($counters[$lowest]["children"])) {
            if (!isset($history)) {
                $history = array_merge(array(), $counters);
            }
            foreach ($counters[$lowest]["children"] as $child) {
                $counters[$child]["value"] = 0;
            }
        }
        $counters[$lowest]["value"]++;
        echo getLabel($counters, $lowest) . " - " . $o["#title"] . "<br/>";
    }
    foreach ($incremented as $key => $val) {
        $lowest = $val["#level"];
        $counters[$lowest]["value"] = 0;
    }
    if (isset($history)) {
        $counters = $history;
    }
}
Example #23
0
 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);
 }
function Error($erroname)
{
    $html .= "<div id='inline1' style='display: block;'>";
    $html .= "<p>";
    $html .= "<form id='formReserva' name='form1' method='post' novalidate action='index.php?actionType=reservas.forma.pgto.cielo' style='max-width: initial'>";
    $html .= "<div class='ContainerAcomodacao pag-deposito'>";
    $html .= "<p>";
    $html .= "<div class='sep-pattern-1'></div>";
    $html .= "<center>";
    $html .= "<h1 class='alert-green' style='font-size: 2.4rem; padding: 98px;'>";
    $html .= getLabel($erroname, $_SESSION['LANGUAGE']);
    $html .= "</h1>";
    $html .= "</center>";
    $html .= "<div class='sep-pattern-1'></div>";
    $html .= "</p>";
    $html .= "</div>";
    $html .= "<div><a class='BtnFiltro small full-width push-right' href='./pacotes-e-promocoes'>" . getLabel('LABEL_PACOTES', $_SESSION['LANGUAGE']) . "</a></div>";
    $html .= "</form>";
    $html .= "</p>";
    $html .= "</div>";
    return utf8_encode($html);
}
Example #25
0
 public function process($template = null)
 {
     $this->order->order();
     $shopId = $this->object->shop_id;
     $bankId = $this->object->bank_id;
     $scid = $this->object->scid;
     if (!strlen($shopId) || !strlen($scid)) {
         throw new publicException(getLabel('error-payment-wrong-settings'));
     }
     $productPrice = (double) $this->order->getActualPrice();
     $param = array();
     $param['shopId'] = $shopId;
     $param['Sum'] = $productPrice;
     $param['BankId'] = $bankId;
     $param['scid'] = $scid;
     $param['CustomerNumber'] = $this->order->getId();
     $param['formAction'] = $this->object->demo_mode ? 'https://demomoney.yandex.ru/eshop.xml' : 'https://money.yandex.ru/eshop.xml';
     $param['orderId'] = $this->order->getId();
     $this->order->setPaymentStatus('initialized');
     list($templateString) = def_module::loadTemplates("emarket/payment/yandex/" . $template, "form_block");
     return def_module::parseTemplate($templateString, $param);
 }
 public function export($v92ec19ffde05e15769b1bb3ee05ad745)
 {
     $vb80bb7740288fda1f201890375a60c8f = getRequest('param0');
     $v100664c6e2c0333b19a729f2f3ddb7dd = CURRENT_WORKING_DIR . "/sys-temp/yml/";
     if (!file_exists($v100664c6e2c0333b19a729f2f3ddb7dd . $vb80bb7740288fda1f201890375a60c8f . 'el')) {
         throw new publicException('<a href="' . getLabel("label-errors-no-information") . '" target="blank">' . getLabel("label-errors-no-information") . '</a>');
     }
     $v2a05e4f9b3949ba2c0b7d413a0863c3f = unserialize(file_get_contents($v100664c6e2c0333b19a729f2f3ddb7dd . $vb80bb7740288fda1f201890375a60c8f . 'el'));
     $v0f635d0e0f3874fff8b581c132e6c7a7 = $v100664c6e2c0333b19a729f2f3ddb7dd . $vb80bb7740288fda1f201890375a60c8f . ".xml";
     if (file_exists($v0f635d0e0f3874fff8b581c132e6c7a7)) {
         unlink($v0f635d0e0f3874fff8b581c132e6c7a7);
     }
     file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, '<?xml version="1.0" encoding="windows-1251"?><!DOCTYPE yml_catalog SYSTEM "shops.dtd"><yml_catalog date="' . date('Y-m-d H:i') . '"><shop>');
     if (file_exists($v100664c6e2c0333b19a729f2f3ddb7dd . 'shop' . $vb80bb7740288fda1f201890375a60c8f)) {
         file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, file_get_contents($v100664c6e2c0333b19a729f2f3ddb7dd . 'shop' . $vb80bb7740288fda1f201890375a60c8f), FILE_APPEND);
     }
     if (file_exists($v100664c6e2c0333b19a729f2f3ddb7dd . 'currencies')) {
         file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, file_get_contents($v100664c6e2c0333b19a729f2f3ddb7dd . 'currencies'), FILE_APPEND);
     }
     if (file_exists($v100664c6e2c0333b19a729f2f3ddb7dd . 'categories' . $vb80bb7740288fda1f201890375a60c8f)) {
         file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, '<categories>', FILE_APPEND);
         $vb0b5ccb4a195a07fd3eed14affb8695f = unserialize(file_get_contents($v100664c6e2c0333b19a729f2f3ddb7dd . 'categories' . $vb80bb7740288fda1f201890375a60c8f));
         foreach ($vb0b5ccb4a195a07fd3eed14affb8695f as $v88be62ccbc2801ce90084c1356d22820 => $vb068931cc450442b63f5b3d276ea4297) {
             file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, $vb068931cc450442b63f5b3d276ea4297, FILE_APPEND);
         }
         file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, '</categories>', FILE_APPEND);
     }
     file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, '<offers>', FILE_APPEND);
     foreach ($v2a05e4f9b3949ba2c0b7d413a0863c3f as $v7ac41b7f1504a8782ee40cd469d95431) {
         $v47826cacc65c665212b821e6ff80b9b0 = $v100664c6e2c0333b19a729f2f3ddb7dd . $v7ac41b7f1504a8782ee40cd469d95431 . '.txt';
         if (is_file($v47826cacc65c665212b821e6ff80b9b0)) {
             file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, file_get_contents($v47826cacc65c665212b821e6ff80b9b0), FILE_APPEND);
         }
     }
     file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, '</offers></shop></yml_catalog>', FILE_APPEND);
     return file_get_contents($v0f635d0e0f3874fff8b581c132e6c7a7);
 }
 public function watermark()
 {
     $regedit = regedit::getInstance();
     $params = array("watermark" => array("string:image" => NULL, "int:alpha" => NULL, "select:valign" => array("top" => getLabel("watermark-valign-top"), "bottom" => getLabel("watermark-valign-bottom"), "bottom" => getLabel("watermark-valign-center")), "select:halign" => array("left" => getLabel("watermark-halign-left"), "right" => getLabel("watermark-halign-right"), "center" => getLabel("watermark-halign-center"))));
     $mode = getRequest("param0");
     if ($mode == "do") {
         $params = $this->expectParams($params);
         if ($regedit->getKey("//settings/watermark") === false) {
             $regedit->setVar("//settings/watermark", "");
         }
         $imagePath = trim($params['watermark']['string:image']);
         $imagePath = str_replace("./", "", $imagePath);
         if (substr($imagePath, 0, 1) == "/") {
             $imagePath = substr($imagePath, 1);
         }
         if (!empty($imagePath) && file_exists("./" . $imagePath)) {
             $imagePath = "./" . $imagePath;
         }
         if (intval($params['watermark']['int:alpha']) > 0 && intval($params['watermark']['int:alpha']) <= 100) {
             $regedit->setVar("//settings/watermark/alpha", $params['watermark']['int:alpha']);
         }
         $regedit->setVar("//settings/watermark/image", $imagePath);
         $regedit->setVar("//settings/watermark/valign", $params['watermark']['select:valign']);
         $regedit->setVar("//settings/watermark/halign", $params['watermark']['select:halign']);
         $this->chooseRedirect();
     }
     $params['watermark']['string:image'] = $regedit->getVal("//settings/watermark/image");
     $params['watermark']['int:alpha'] = $regedit->getVal("//settings/watermark/alpha");
     $params['watermark']['select:valign'] = array("top" => getLabel("watermark-valign-top"), "bottom" => getLabel("watermark-valign-bottom"), "center" => getLabel("watermark-valign-center"), "value" => $regedit->getVal("//settings/watermark/valign"));
     $params['watermark']['select:halign'] = array("left" => getLabel("watermark-halign-left"), "right" => getLabel("watermark-halign-right"), "center" => getLabel("watermark-valign-center"), "value" => $regedit->getVal("//settings/watermark/halign"));
     $this->setDataType("settings");
     $this->setActionType("modify");
     $data = $this->prepareData($params, "settings");
     $this->setData($data);
     return $this->doData();
 }
Example #28
0
 public function getObjectsListField($path = false, $field = '')
 {
     $category_id = $this->analyzeRequiredPath($path);
     if ($category_id === false && $path != KEYWORD_GRAB_ALL) {
         throw new publicException(getLabel('error-page-does-not-exist', null, $path));
     }
     $sel = new selector('pages');
     $sel->types('hierarchy-type')->name('catalog', 'object');
     $sel->where('hierarchy')->page($category_id)->childs(1);
     $sel->where($field)->equals(1);
     $result = $sel->result();
     $block_arr = array();
     $lines = array();
     for ($i = 0; $i < sizeof($result); $i++) {
         $element =& $result[$i];
         $line_arr = array();
         $line_arr['attribute:id'] = $element->getId();
         $line_arr['attribute:link'] = umiHierarchy::getInstance()->getPathById($element->getId());
         $line_arr['node:text'] = $element->getName();
         $lines[] = $line_arr;
     }
     $block_arr['items']['nodes:item'] = $lines;
     return $block_arr;
 }
 public function get_page_id($url)
 {
     $hierarchy = umiHierarchy::getInstance();
     $elementId = $hierarchy->getIdByPath($url);
     if ($elementId) {
         return $elementId;
     } else {
         throw new publicException(getLabel('error-page-does-not-exist', null, $url));
     }
 }
    if ($qtos_tipo->DESTAQUE == "1") {
        $destaque = "<span class='AtivoStatus' onclick=\"javascript:getAlterstatusfullunico('{$qtos_tipo->CODFOTO}', 'CODFOTO', 'DESTAQUE', 'fotos', 'CODDICA', 'dicas_rel_fotos', '" . $_GET['coddica'] . "', '" . getLabel('LABEL_JS_REGISTRO', $_SESSION['LANGUAGE']) . "')\">" . getLabel('LABEL_ATIVO', $_SESSION['LANGUAGE']) . "</span>";
    } else {
        $destaque = "<span class='InativoStatus' onclick=\"javascript:getAlterstatusfullunico('{$qtos_tipo->CODFOTO}', 'CODFOTO', 'DESTAQUE', 'fotos', 'CODDICA', 'dicas_rel_fotos', '" . $_GET['coddica'] . "', '" . getLabel('LABEL_JS_REGISTRO', $_SESSION['LANGUAGE']) . "')\">" . getLabel('LABEL_INATIVO', $_SESSION['LANGUAGE']) . "</span>";
    }
    if ($i % 2 == 0) {
        $pi .= "<tr class='LinhaPar'>";
    } else {
        $pi .= "<tr class='LinhaImpar'>";
    }
    $foto = str_replace("..", $dados_relevantes->SITE, $qtos_tipo->URL);
    $pi .= "<td align='right'><img src='{$qtos_tipo->URL}' title='{$qtos_tipo->TITULO}' alt='{$qtos_tipo->TITULO}' width='100%'/></td>";
    $pi .= "<td>{$qtos_tipo->DTA}</td>";
    $pi .= "<td>{$qtos_tipo->TITULO}</td>";
    $pi .= "<td><textarea rows='4' cols='40'>{$foto}</textarea></td>";
    $pi .= "<td align='center'>{$destaque}</td>";
    $pi .= "<td align='center'>{$status}</td>";
    $pi .= "<td align='center'><div onclick=\"window.location='index.php?actionType=gerenciar.dicas.fotos.del&coddica=" . $_GET['coddica'] . "&codfoto={$qtos_tipo->CODFOTO}'\">" . getLabel('LABAL_ICO_DEL', $_SESSION['LANGUAGE']) . "</div></td>";
    $owner = mysql_query("SELECT login.LOGIN FROM login\r\r\t\t\t\t\t\t\t\t\tINNER JOIN login_rel_pessoa ON login_rel_pessoa.CODLOGIN=login.CODLOGIN\r\r\t\t\t\t\t\t\t\t\tWHERE login_rel_pessoa.CODPESSOA='{$qtos_tipo->OWNER}'");
    $owner = mysql_fetch_object($owner);
    $pi .= "<td>{$owner->LOGIN}</td>";
    $pi .= "</tr>";
    $i++;
}
$pi .= "</table>";
$pi .= "</div>";
$pi .= "</td>";
$pi .= "</tr>";
$pi .= "</table>";
$pi .= "</div>";
$pi .= "</form>";