本文整理汇总了PHP中umiObjectsCollection类的典型用法代码示例。如果您正苦于以下问题:PHP umiObjectsCollection类的具体用法?PHP umiObjectsCollection怎么用?PHP umiObjectsCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了umiObjectsCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: remove
/**
* Удалить объект, представляющий товар в заказе
*/
public function remove()
{
$objects = umiObjectsCollection::getInstance();
if ($this->object instanceof umiObject) {
$objects->delObject($this->object->getId());
}
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:10,代码来源:orderItem.php
示例2: readDataBlock
protected function readDataBlock()
{
$v9a09b4dfda82e3e665e31092d1c3ec8d = parent::readDataBlock();
if ($v9a09b4dfda82e3e665e31092d1c3ec8d->getElementsByTagName('domains')->length) {
$ve4e46deb7f9cc58c7abfb32e5570b6f3 = $v9a09b4dfda82e3e665e31092d1c3ec8d->getElementsByTagName('domains')->item(0);
if ($ve4e46deb7f9cc58c7abfb32e5570b6f3->getElementsByTagName('domain')->length) {
$vad5f82e879a9c5d6b5b442eb37e50551 = $ve4e46deb7f9cc58c7abfb32e5570b6f3->getElementsByTagName('domain')->item(0);
$vfc4dd24e8dcaab0826b9ab09db0da5bf = false;
$v72ee76c5c29383b7c9f9225c1fa4d10b = false;
$v495a73fe6d3367859f634a689771d209 = getRequest('param0');
if ($v495a73fe6d3367859f634a689771d209) {
$v6a7f245843454cf4f28ad7c5e2572aa2 = umiObjectsCollection::getInstance()->getObject($v495a73fe6d3367859f634a689771d209)->elements;
if (is_array($v6a7f245843454cf4f28ad7c5e2572aa2) && count($v6a7f245843454cf4f28ad7c5e2572aa2)) {
$v72ee76c5c29383b7c9f9225c1fa4d10b = $v6a7f245843454cf4f28ad7c5e2572aa2[0]->getDomainId();
}
}
if ($v72ee76c5c29383b7c9f9225c1fa4d10b) {
$vfc4dd24e8dcaab0826b9ab09db0da5bf = domainsCollection::getInstance()->getDomain($v72ee76c5c29383b7c9f9225c1fa4d10b);
} else {
$vfc4dd24e8dcaab0826b9ab09db0da5bf = domainsCollection::getInstance()->getDefaultDomain();
}
if ($vfc4dd24e8dcaab0826b9ab09db0da5bf instanceof domain) {
$v9b98b21540033f68b145fb236bd91a73 = $vfc4dd24e8dcaab0826b9ab09db0da5bf->getHost();
$vad5f82e879a9c5d6b5b442eb37e50551->setAttribute('host', $v9b98b21540033f68b145fb236bd91a73);
}
}
}
return $v9a09b4dfda82e3e665e31092d1c3ec8d;
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:29,代码来源:transferSplitter.php
示例3: closeUmiMessage
/**
* Закрывает одно сообщение и сохраняет информацию об этом в профиле пользователя
*
*/
public function closeUmiMessage()
{
$this->flushAsXML("closeUmiMessage");
$permissions = permissionsCollection::getInstance();
$objects = umiObjectsCollection::getInstance();
$user_id = $permissions->getUserId();
$user = $objects->getObject($user_id);
if ($user instanceof umiObject == false) {
throw new coreException("Can't get current user with id #{$user_id}");
}
$settings_data = $user->getValue("user_settings_data");
$settings_data = unserialize($settings_data);
if (!is_array($settings_data)) {
$settings_data = array();
}
$value = (int) getRequest('value');
if (isset($settings_data['umiMessages']['closed']) && $settings_data['umiMessages']['closed'] != '') {
$closed = explode(';', $settings_data['umiMessages']['closed']);
$closed[] = $value;
$closed = array_unique($closed);
$settings_data['umiMessages']['closed'] = implode(';', $closed);
} else {
$settings_data['umiMessages']['closed'] = $value;
}
$user->setValue("user_settings_data", serialize($settings_data));
$user->commit();
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:31,代码来源:__messages.php
示例4: registerEvent
/**
* Зарегистрировать событие в истории событий
* @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);
}
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:37,代码来源:class.php
示例5: process
public function process($template = null)
{
list($tpl_block, $tpl_item) = def_module::loadTemplates("emarket/payment/invoice/" . $template, 'legal_person_block', 'legal_person_item');
$collection = umiObjectsCollection::getInstance();
$types = umiObjectTypesCollection::getInstance();
$typeId = $types->getBaseType("emarket", "legal_person");
$customer = customer::get();
$order = $this->order;
$mode = getRequest('param2');
if ($mode == 'do') {
$personId = getRequest('legal-person');
$isNew = $personId == null || $personId == 'new';
if ($isNew) {
$typeId = $types->getBaseType("emarket", "legal_person");
$personId = $collection->addObject("", $typeId);
$controller = cmsController::getInstance();
$data = getRequest('data');
if ($data && ($dataModule = $controller->getModule("data"))) {
$person = $collection->getObject($personId);
$person->setName($data['new']['name']);
$dataModule->saveEditedObject($personId, $isNew, true);
}
if ($collection->getObject($personId) instanceof umiObject) {
$customer = customer::get();
$customer->legal_persons = array_merge($customer->legal_persons, array($personId));
}
}
$order->legal_person = $personId;
$order->order();
$order->payment_document_num = $order->id;
$result = $this->printInvoice($order);
$buffer = outputBuffer::current();
$buffer->charset('utf-8');
$buffer->contentType('text/html');
$buffer->clear();
$buffer->push($result);
$buffer->end();
return true;
} else {
if ($mode == 'delete') {
$personId = (int) getRequest('person-id');
if ($collection->isExists($personId)) {
$customer = customer::get();
$customer->legal_persons = array_diff($customer->legal_persons, array($personId));
$collection->delObject($personId);
}
}
}
$items = array();
$persons = $customer->legal_persons;
if (is_array($persons)) {
foreach ($persons as $personId) {
$person = $collection->getObject($personId);
$item_arr = array('attribute:id' => $personId, 'attribute:name' => $person->name);
$items[] = def_module::parseTemplate($tpl_item, $item_arr, false, $personId);
}
}
$block_arr = array('attribute:type-id' => $typeId, 'attribute:type_id' => $typeId, 'xlink:href' => 'udata://data/getCreateForm/' . $typeId, 'subnodes:items' => $items);
return def_module::parseTemplate($tpl_block, $block_arr);
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:60,代码来源:invoice.php
示例6: getGuideList
public function getGuideList($id, $template = 'guidelist', $arrayOnly = false)
{
if (!$id) {
return null;
}
//id справочника
$o = umiObjectsCollection::getInstance();
$items = $o->getGuidedItems($id);
if (!sizeof($items)) {
return null;
}
if ($arrayOnly) {
return $items;
}
list($guide_block, $guide_item) = def_module::loadTemplates("catalog/{$template}.tpl", "guide_block", "guide_item");
$s = '';
$block_array = array();
foreach ($items as $k => $v) {
$line_array = array();
$line_array['id'] = $k;
$line_array['name'] = $items[$k];
$s .= def_module::parseTemplate($guide_item, $line_array);
}
$block_array['lines'] = $s;
unset($items);
$s = def_module::parseTemplate($guide_block, $block_array);
return $s;
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:28,代码来源:__custom.php
示例7: get_filemanager_info
public function get_filemanager_info()
{
$buffer = outputBuffer::current();
$buffer->contentType('text/javascript');
$buffer->option('generation-time', false);
$buffer->clear();
$json = new jsonTranslator();
$folder = (string) getRequest('folder');
$file = (string) getRequest('file');
$folderHash = $folder ? elfinder_get_hash($folder) : '';
$fileHash = $file ? elfinder_get_hash($file) : '';
$objects = umiObjectsCollection::getInstance();
$userId = permissionsCollection::getInstance()->getUserId();
$user = $objects->getObject($userId);
$fmId = $user->getValue('filemanager');
if ($fmId) {
$fm = $objects->getObject($fmId);
$fmPrefix = $fm->getValue('fm_prefix') ? $fm->getValue('fm_prefix') : 'elfinder';
} else {
$fmPrefix = 'elfinder';
}
$lang = cmsController::getInstance()->getCurrentLang()->getPrefix();
$data = array('folder_hash' => $folderHash, 'file_hash' => $fileHash, 'filemanager' => $fmPrefix, 'lang' => $lang);
$result = $json->translateToJson($data);
$buffer->push($result);
$buffer->end();
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:27,代码来源:__files.php
示例8: isAllowedFileType
public static function isAllowedFileType($v566bbee0f961ad71b54c3c2fd36db053)
{
$v566bbee0f961ad71b54c3c2fd36db053 = strtolower($v566bbee0f961ad71b54c3c2fd36db053);
if (in_array($v566bbee0f961ad71b54c3c2fd36db053, self::$forbiddenFileTypes)) {
return false;
}
if (in_array($v566bbee0f961ad71b54c3c2fd36db053, self::$allowedFileTypes) || in_array($v566bbee0f961ad71b54c3c2fd36db053, self::$allowedImageTypes)) {
return true;
}
if (is_null(self::$allowedUserFileTypes)) {
$v8e44f0089b076e18a718eb9ca3d94674 = permissionsCollection::getInstance()->getUserId();
$v23e91e891070db669547556402a176b5 = umiObjectsCollection::getInstance()->getObject($v8e44f0089b076e18a718eb9ca3d94674)->getValue('appended_file_extensions');
self::$allowedUserFileTypes = array();
foreach (explode(',', $v23e91e891070db669547556402a176b5) as $va175f0d82e080972dd2c0cf2c56450b3) {
$va175f0d82e080972dd2c0cf2c56450b3 = strtolower(trim($va175f0d82e080972dd2c0cf2c56450b3));
if (strlen($va175f0d82e080972dd2c0cf2c56450b3)) {
self::$allowedUserFileTypes[] = $va175f0d82e080972dd2c0cf2c56450b3;
}
}
}
if (in_array($v566bbee0f961ad71b54c3c2fd36db053, self::$allowedUserFileTypes)) {
return true;
}
return false;
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:25,代码来源:umiFile.php
示例9: delivery_add
public function delivery_add() {
$mode = (string) getRequest('param0');
$inputData = array(
'type' => 'delivery',
'type-id' => getRequest('type-id'),
'allowed-element-types' => array('delivery')
);
if($mode == "do") {
$data = getRequest("data");
$deliveryType = $data["new"]["delivery_type_id"];
if($typeObject = umiObjectsCollection::getInstance()->getObject($deliveryType)) {
$inputData['type-id'] = umiObjectTypesCollection::getInstance()->getTypeIdByGUID($typeObject->delivery_type_guid);
}
$object = $this->saveAddedObjectData($inputData);
self::checkDeliveryProps($object);
$this->chooseRedirect($this->pre_lang . "/admin/emarket/delivery_edit/{$object->id}/");
}
$this->setDataType("form");
$this->setActionType("create");
$data = $this->prepareData($inputData, "object");
$this->setData($data);
return $this->doData();
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:29,代码来源:__admin_delivery.php
示例10: sendSMS
public function sendSMS()
{
$oObjects = umiObjectsCollection::getInstance();
$SMSobjID = getRequest('system_sms_to');
$telefon = $oObjects->getObject($SMSobjID)->getValue('telefon');
$src = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>SEND</operation>
</operations>
<authentification>
<username>[email protected]</username>
<password>yjdjrhsvcrfz</password>
</authentification>
<message>
<sender>kakadu</sender>
<text>Обратный звонок ' . $_REQUEST['data']['new']['fio'] . ' ' . $_REQUEST['data']['new']['telefon'] . ' ' . ($fio = $_REQUEST['data']['new']['vremya_dlya_zvonka'] . '</text>
</message>
<numbers>
<number>' . $telefon . '</number>
</numbers>
</SMS>');
$Curl = curl_init();
$CurlOptions = array(CURLOPT_URL => 'http://atompark.com/members/sms/xml', CURLOPT_FOLLOWLOCATION => false, CURLOPT_POST => true, CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_CONNECTTIMEOUT => 15, CURLOPT_TIMEOUT => 100, CURLOPT_POSTFIELDS => array('XML' => $src));
curl_setopt_array($Curl, $CurlOptions);
if (false === ($Result = curl_exec($Curl))) {
throw new Exception('Http request failed');
}
curl_close($Curl);
$this->send();
}
开发者ID:tomoonshine,项目名称:postsms,代码行数:31,代码来源:class.php
示例11: onCloneElement
public function onCloneElement(iUmiEventPoint $oEventPoint)
{
if ($oEventPoint->getMode() == 'after') {
/**
* @var umiHierarchy
*/
$hierarchy = umiHierarchy::getInstance();
$elementId = $oEventPoint->getParam('newElementId');
/**
* @var umiHierarchyElement
*/
$element = $hierarchy->getElement($elementId);
if ($element && $element->getTypeId() == umiHierarchyTypesCollection::getInstance()->getTypeByName('vote', 'poll')->getId()) {
$collection = umiObjectsCollection::getInstance();
$answersIDs = $element->getValue('answers');
$newAnswers = array();
foreach ($answersIDs as $answerId) {
if ($newAnswerId = $collection->cloneObject($answerId)) {
$newAnswers[] = $newAnswerId;
$answer = $collection->getObject($newAnswerId);
$answer->setValue('poll_rel', $elementId);
$answer->setValue('count', 0);
$answer->commit();
}
}
$element->setValue('answers', $newAnswers);
$element->commit();
}
}
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:30,代码来源:__events_handlers.php
示例12: import_subscriber
public function import_subscriber($email, $fname, $lname)
{
if (!$email) {
return false;
}
$oSbsSelection = new umiSelection();
$oSbsSelection->setObjectTypeFilter();
$iSbsHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "subscriber")->getId();
$iSbsTypeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iSbsHierarchyTypeId);
$oSbsType = umiObjectTypesCollection::getInstance()->getType($iSbsTypeId);
$oSbsSelection->addObjectType($iSbsTypeId);
$oSbsSelection->setNamesFilter();
$oSbsSelection->addNameFilterEquals($email);
$arrSbsSelResults = umiSelectionsParser::runSelection($oSbsSelection);
if (sizeof($arrSbsSelResults)) {
list($object_id) = $arrSbsSelResults;
} else {
$object_id = umiObjectsCollection::getInstance()->addObject($email, $iSbsTypeId);
}
if ($oSubscriber = umiObjectsCollection::getInstance()->getObject($object_id)) {
$oSubscriber->setName($email);
$oSubscriber->setValue('fname', $fname);
$oSubscriber->setValue('lname', $lname);
$oCurrDate = new umiDate(time());
$oSubscriber->setValue('subscribe_date', $oCurrDate);
$oSubscriber->setValue('subscriber_dispatches', $this->getAllDispatches());
$oSubscriber->commit();
} else {
return false;
}
return $object_id;
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:32,代码来源:__subscribers_import.php
示例13: onAddTopicToDispatch
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;
}
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:34,代码来源:__sysevents.php
示例14: stream_open
public function stream_open($vd6fe1d0be6347b8ef2427fa629c04485, $v15d61712450a686a7f365adf4fef581f, $v93da65a9fd0004d9477aeac024e08e15, $v6385a5865e0b96f09e4142ab2d9e3736)
{
$vb99eb979e6f6efabc396f777b503f7e7 = cacheFrontend::getInstance();
if ($v8d777f385d3dfec8815d20f7496026dc = $vb99eb979e6f6efabc396f777b503f7e7->loadData($vd6fe1d0be6347b8ef2427fa629c04485)) {
return $this->setData($v8d777f385d3dfec8815d20f7496026dc);
}
$vaf31437ce61345f416579830a98c91e5 = $this->parsePath($vd6fe1d0be6347b8ef2427fa629c04485);
$va8cfde6331bd59eb2ac96f8911c4b666 = umiObjectsCollection::getInstance()->getObject($vaf31437ce61345f416579830a98c91e5);
if ($va8cfde6331bd59eb2ac96f8911c4b666 instanceof iUmiObject) {
if (is_null($this->prop_name)) {
$v164d124aa1de584618cde85506eb8cd4 = translatorWrapper::$showEmptyFields;
if (!is_null(getArrayKey($this->params, 'show-empty'))) {
translatorWrapper::$showEmptyFields = true;
}
$v8d777f385d3dfec8815d20f7496026dc = $this->translateToXml($va8cfde6331bd59eb2ac96f8911c4b666);
translatorWrapper::$showEmptyFields = $v164d124aa1de584618cde85506eb8cd4;
} else {
$v23a5b8ab834cb5140fa6665622eb6417 = $va8cfde6331bd59eb2ac96f8911c4b666->getPropByName($this->prop_name);
if ($v23a5b8ab834cb5140fa6665622eb6417 instanceof iUmiObjectProperty) {
$v8d777f385d3dfec8815d20f7496026dc = $this->translateToXml($va8cfde6331bd59eb2ac96f8911c4b666, $v23a5b8ab834cb5140fa6665622eb6417);
} else {
return $this->setDataError('not-found');
}
}
if ($this->expire) {
$vb99eb979e6f6efabc396f777b503f7e7->saveObject($vd6fe1d0be6347b8ef2427fa629c04485, $v8d777f385d3dfec8815d20f7496026dc, $this->expire);
}
return $this->setData($v8d777f385d3dfec8815d20f7496026dc);
} else {
return $this->setDataError('not-found');
}
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:32,代码来源:uobjectStream.php
示例15: translateMessageToXml
protected function translateMessageToXml(iUmiMessage $v78e731027d8fd50ed642340b7c9a63b3)
{
$v5891da2d64975cae48d175d1e001f5da = umiObjectsCollection::getInstance();
$v86c61d2597857a96ae3a6048b5e7c5a7 = $v5891da2d64975cae48d175d1e001f5da->getObject($v78e731027d8fd50ed642340b7c9a63b3->getSenderId());
$result = array('attribute:id' => $v78e731027d8fd50ed642340b7c9a63b3->getId(), 'attribute:title' => $v78e731027d8fd50ed642340b7c9a63b3->getTitle(), 'attribute:type' => $v78e731027d8fd50ed642340b7c9a63b3->getType(), 'attribute:priority' => $v78e731027d8fd50ed642340b7c9a63b3->getPriority(), 'date' => array('attribute:unix_timestamp' => $v78e731027d8fd50ed642340b7c9a63b3->getCreateTime()->getDateTimestamp(), 'node:value' => $v78e731027d8fd50ed642340b7c9a63b3->getCreateTime()->getFormattedDate()), 'sender' => $v86c61d2597857a96ae3a6048b5e7c5a7, 'content' => $v78e731027d8fd50ed642340b7c9a63b3->getContent());
return $result;
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:7,代码来源:umessStream.php
示例16: getDeliveryType
public function getDeliveryType($delivery_id = false)
{
if (!$delivery_id) {
return '';
}
$object = umiObjectsCollection::getInstance()->getObject($delivery_id);
$classPrefix = objectProxyHelper::getClassPrefixByType($object->delivery_type_id);
return $classPrefix;
}
开发者ID:ziL318,项目名称:moon,代码行数:9,代码来源:class.php
示例17: parseSearchRelation
public function parseSearchRelation(umiField $field, $template, $template_item, $template_separator)
{
$block_arr = array();
$name = $field->getName();
$title = $field->getTitle();
$guide_id = $field->getGuideId();
$guide_items = umiObjectsCollection::getInstance()->getGuidedItems($guide_id);
$fields_filter = getRequest('fields_filter');
$value = getArrayKey($fields_filter, $name);
$items = array();
$i = 0;
$sz = sizeof($guide_items);
$is_tpl = !def_module::isXSLTResultMode();
if (!$is_tpl) {
$template_item = true;
}
$unfilter_link = "";
foreach ($guide_items as $object_id => $object_name) {
if (is_array($value)) {
$selected = in_array($object_id, $value) ? "selected" : "";
} else {
$selected = $object_id == $value ? "selected" : "";
}
if ($template_item) {
$line_arr = array();
$line_arr['attribute:id'] = $line_arr['void:object_id'] = $object_id;
$line_arr['node:object_name'] = $object_name;
$params = $_GET;
unset($params['path']);
unset($params['p']);
$params['fields_filter'][$name] = $object_id;
$filter_link = "?" . http_build_query($params, '', '&');
unset($params['fields_filter'][$name]);
$unfilter_link = "?" . http_build_query($params, '', '&');
$line_arr['attribute:filter_link'] = $filter_link;
$line_arr['attribute:unfilter_link'] = $unfilter_link;
if ($selected) {
$line_arr['attribute:selected'] = "selected";
}
$items[] = def_module::parseTemplate($template_item, $line_arr);
if (++$i < $sz) {
if ($is_tpl) {
$items[] = $template_separator;
}
}
} else {
$items[] = "<option value=\"{$object_id}\" {$selected}>{$object_name}</option>";
}
}
$block_arr['attribute:unfilter_link'] = $unfilter_link;
$block_arr['attribute:name'] = $name;
$block_arr['attribute:title'] = $title;
$block_arr['subnodes:values'] = $block_arr['void:items'] = $items;
$block_arr['void:selected'] = $value ? "" : "selected";
return def_module::parseTemplate($template, $block_arr);
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:56,代码来源:__search.php
示例18: normalizeOut
public function normalizeOut($v2063c1608d6e0baf80249c42e2be5804, $v16b2b26000987faccb260b9d39df1269 = false)
{
$v5891da2d64975cae48d175d1e001f5da = umiObjectsCollection::getInstance();
$va8cfde6331bd59eb2ac96f8911c4b666 = $v5891da2d64975cae48d175d1e001f5da->getObject($v16b2b26000987faccb260b9d39df1269);
$v2fc01ec765ec0cb3dcc559126de20b30 = null;
if ($va8cfde6331bd59eb2ac96f8911c4b666 instanceof umiObject && $va8cfde6331bd59eb2ac96f8911c4b666->getValue('diametr_sm')) {
$v2fc01ec765ec0cb3dcc559126de20b30 = 3.1415 * pow($va8cfde6331bd59eb2ac96f8911c4b666->getValue('diametr_sm') / 2, 2);
}
return $v2fc01ec765ec0cb3dcc559126de20b30;
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:10,代码来源:circleSquare.php
示例19: getDeliveryPrice
public function getDeliveryPrice(order $order)
{
$objects = umiObjectsCollection::getInstance();
$deliveryAddress = $objects->getObject($order->delivery_address);
if (!$deliveryAddress) {
return "Невозможно автоматически определить стоимость";
}
$orderPrice = $order->getActualPrice();
$weight = 0;
$items = $order->getItems();
foreach ($items as $item) {
$element = $item->getItemElement();
$itemWeight = (int) $element->getValue("weight");
if ($itemWeight != 0) {
$weight += $itemWeight * $item->getAmount();
} else {
return "Невозможно автоматически определить стоимость";
}
}
$viewPost = $objects->getObject($this->object->viewpost)->getValue("identifier");
if ($viewPost == 44 || $viewPost == 45) {
$weight = $weight / 1000;
$departureCity = $objects->getObject($this->object->departure_city);
$departureCity = $departureCity instanceof umiObject ? $departureCity->getName() : "Москва";
$city = $deliveryAddress->getValue("city");
$response = $this->calculateSumEMS($price, $departureCity, $city, $weight, $min, $max, $flag);
if ($flag == 'ok') {
$price = $response->price;
$min = $response->term->min;
$max = $response->term->max;
$flag = " {$price} руб. (займет от {$min} до {$max} дней)";
}
return $flag;
} else {
$typePost = $objects->getObject($this->object->typepost)->getValue("identifier");
$value = $this->object->setpostvalue ? ceil($order->getActualPrice()) : 0;
$zip = $deliveryAddress->getValue("index");
$url = "http://www.russianpost.ru/autotarif/Autotarif.aspx?viewPost={$viewPost}&countryCode=643&typePost={$typePost}&weight={$weight}&value1={$value}&postOfficeId={$zip}";
$content = umiRemoteFileGetter::get($url);
if (preg_match("/<input id=\"key\" name=\"key\" value=\"(\\d+)\"\\/>/i", $content, $match)) {
$key = trim($match[1]);
$content = umiRemoteFileGetter::get($url, false, array('Content-type' => 'application/x-www-form-urlencoded'), array('key' => $key));
$content = umiRemoteFileGetter::get($url);
}
if (preg_match("/span\\s+id=\"TarifValue\">([^<]+)<\\/span/i", $content, $match)) {
$price = floatval(str_replace(",", ".", trim($match[1])));
if ($price > 0) {
return $price;
} elseif (preg_match("/span\\s+id=\"lblErrStr\">([^<]+)<\\/span/i", $content, $match)) {
return $match[1];
}
}
return "Не определено. Свяжитесь с менеджером для уточнения информации.";
}
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:55,代码来源:russianpost.php
示例20: checkContent
public static function checkContent($v9a0364b9e99bb480dd25e1f0284c8555)
{
$vd499d2db30467ffbbfcf1188e3fa1327 = umiObjectTypesCollection::getInstance()->getTypeIdByGUID('blacklist');
$v1c73f663c4ea5257b7145fd2f7c598ae = umiObjectsCollection::getInstance()->getGuidedItems($vd499d2db30467ffbbfcf1188e3fa1327);
foreach ($v1c73f663c4ea5257b7145fd2f7c598ae as $vd1f5ee0092ec47708f200415f2a89717 => $vc47d187067c6cf953245f128b5fde62a) {
if (strpos($v9a0364b9e99bb480dd25e1f0284c8555, $vc47d187067c6cf953245f128b5fde62a) !== false) {
return false;
}
}
return true;
}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:11,代码来源:antiSpamHelper.php
注:本文中的umiObjectsCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论