public function releases() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = (int) getRequest('p'); $offset = $limit * $curr_page; $dispatchId = getRequest("param0") ? getRequest("param0") : getRequest('id'); if (is_array($dispatchId)) { $dispatchId = isset($dispatchId[0]) ? $dispatchId[0] : null; } $sel = new selector('objects'); $sel->types('object-type')->name('dispatches', 'release'); if ($dispatchId) { $sel->where('disp_reference')->equals($dispatchId); } $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "objects"); $this->setData($data, $sel->length); return $this->doData(); }
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 orders() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = (int) getRequest('p'); $offset = $limit * $curr_page; $sel = new selector('objects'); $sel->types('object-type')->name('emarket', 'order'); $sel->where('status_id')->isNull(false); $sel->where('name')->notequals('dummy'); $sel->limit($offset, $limit); if (!getRequest('order_filter')) { $sel->order('order_date')->desc(); } selectorHelper::detectFilters($sel); $domains = getRequest('domain_id'); if (is_array($domains) && sizeof($domains)) { $domainsCollection = domainsCollection::getInstance(); if (sizeof($domainsCollection->getList()) > 1) { $sel->where('domain_id')->equals($domains[0]); } } $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "objects"); $this->setData($data, $sel->length); return $this->doData(); }
public function getReleaseMessages($iReleaseId = false) { $iHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "message")->getId(); $iMsgTypeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iHierarchyTypeId); $oMsgType = umiObjectTypesCollection::getInstance()->getType($iMsgTypeId); $sel = new selector('objects'); $sel->types('object-type')->name('dispatches', 'message'); if($iReleaseId) { $sel->where('release_reference')->equals($iReleaseId); } selectorHelper::detectFilters($sel); return $sel->result; }
public function getObjectsListNotField($path = false, $field = '', $limit = false, $ignore_paging = false, $i_need_deep = 0) { if (!$i_need_deep) { $i_need_deep = intval(getRequest('param4')); } if (!$i_need_deep) { $i_need_deep = 1; } $i_need_deep = intval($i_need_deep); if ($i_need_deep === -1) { $i_need_deep = 100; } $category_id = $this->analyzeRequiredPath($path); if ($category_id === false && $path != KEYWORD_GRAB_ALL) { throw new publicException(getLabel('error-page-does-not-exist', null, $path)); } $per_page = $limit ? $limit : $this->per_page; $curr_page = getRequest('p'); if ($ignore_paging) { $curr_page = 0; } $sel = new selector('pages'); $sel->types('hierarchy-type')->name('catalog', 'object'); $sel->where('hierarchy')->page($category_id)->childs($i_need_deep); $sel->where($field)->isnull(true); selectorHelper::detectFilters($sel); if ($curr_page !== "all") { $curr_page = (int) $curr_page; $sel->limit($per_page * $curr_page, $per_page); } $result = $sel->result(); $total = $sel->length(); $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:alt_name'] = $element->getAltName(); $line_arr['attribute:link'] = umiHierarchy::getInstance()->getPathById($element->getId()); $line_arr['xlink:href'] = "upage://" . $element->getId(); $line_arr['name'] = $element->getName(); $line_arr['descr'] = $element->getValue('descr_mini'); $lines[] = $line_arr; } $block_arr['items']['nodes:item'] = $lines; $block_arr['total'] = $total; $block_arr['per_page'] = $per_page; $block_arr['category_id'] = $category_id; return $block_arr; }
public function export() { $this->setDataType("list"); $this->setActionType("view"); $limit = getRequest('per_page_limit'); $curr_page = (int) getRequest('p'); $offset = $limit * $curr_page; $sel = new selector('objects'); $sel->types('object-type')->name('exchange', 'export'); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "objects"); $this->setData($data, $sel->length); return $this->doData(); }
public function lists() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = (int) getRequest('p'); $offset = $limit * $curr_page; $sel = new selector('pages'); $sel->types('hierarchy-type')->name('vote', 'poll'); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "pages"); $this->setData($data, $sel->length); return $this->doData(); }
public function stores() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = (int) getRequest('p'); $offset = $curr_page * $limit; $sel = new selector('objects'); $sel->types('object-type')->name('emarket', 'store'); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "objects"); $this->setData($data, $sel->length); return $this->doData(); }
public function last_messages() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = getRequest('p'); $offset = $curr_page * $limit; $sel = new selector('pages'); $sel->types('hierarchy-type')->name('forum', 'message'); $sel->order('publish_time')->desc(); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $data = $this->prepareData($sel->result, "pages"); $this->setData($data, $sel->length); $this->setDataRangeByPerPage($limit, $curr_page); return $this->doData(); }
public function lists() { $this->setDataType("list"); $this->setActionType("view"); $this->generatePicasaButton(); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = getRequest('p'); $offset = $curr_page * $limit; $sel = new selector('pages'); $sel->types('hierarchy-type')->name('photoalbum', 'album'); $sel->types('hierarchy-type')->name('photoalbum', 'photo'); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $data = $this->prepareData($sel->result, "pages"); $this->setData($data, $sel->length); $this->setDataRangeByPerPage($limit, $curr_page); return $this->doData(); }
public function discounts() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $objectTypes = umiObjectTypesCollection::getInstance(); $type_id = $objectTypes->getBaseType("emarket", "discount"); $limit = getRequest('per_page_limit'); $curr_page = (int) getRequest('p'); $offset = $limit * $curr_page; $sel = new selector('objects'); $sel->types('object-type')->name('emarket', 'discount'); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "objects"); $this->setData($data, $sel->length); return $this->doData(); }
public function tree() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = getRequest('p'); $offset = $curr_page * $limit; $sel = new selector('pages'); $sel->types('hierarchy-type')->name('catalog', 'category'); $sel->types('hierarchy-type')->name('catalog', 'object'); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $data = $this->prepareData($sel->result, "pages"); //Завершаем вывод $this->setData($data, $sel->length); $this->setDataRangeByPerPage($limit, $curr_page); return $this->doData(); }
public function view_noactive_comments() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } //Получение id родительской страницы. Если передан неверный id, будет выброшен exception $parent_id = $this->expectElementId('param0'); $limit = 20; $curr_page = (int) getRequest('p'); $offset = $limit * $curr_page; $sel = new selector('pages'); $sel->types('hierarchy-type')->name('comments', 'comment'); $sel->where('is_active')->equals(false); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "pages"); $this->setData($data, $sel->total); return $this->doData(); }
public function tickets() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = getRequest('p'); $offset = $curr_page * $limit; $sel = new selector('objects'); $sel->types('object-type')->name('content', 'ticket'); $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); if (isset($_REQUEST['order_filter']['name'])) { $_REQUEST['order_filter']['message'] = $_REQUEST['order_filter']['name']; unset($_REQUEST['order_filter']['name']); } $data = $this->prepareData($sel->result, "objects"); $this->setData($data, $sel->length); $this->setDataRangeByPerPage($limit, $curr_page); return $this->doData(); }
public function lists() { // Установить формат вывода list // Устанавливаем действие над списокм - "view" - просмотр списка $this->setDataType("list"); $this->setActionType("view"); // если не XmlMode то выдоча того что есть if ($this->ifNotXmlMode()) { return $this->doData(); } // Установить лимит в 20 $limit = 20; /** * Обратите внимание! * Эта строка необходима для корректного определения * текущей страницы Возвращает параметр из $_SERVER['QUERY_STRING'] */ $curr_page = getRequest('p'); // вычисляем смещение от начала списка $offset = $curr_page * $limit; // Установить параметры выборки // Выбирать страницы связанных с методами groupelements и item_element // Установить лимит Смещение от начала списка и количество страниц $sel = new selector('pages'); $sel->types('hierarchy-type')->name('modulelements', 'groupelements'); $sel->types('hierarchy-type')->name('modulelements', 'item_element'); $sel->limit($offset, $limit); // ? Очевидно какой-нибудь фильтр selectorHelper::detectFilters($sel); // Подготавливаем данные, чтобы потом корректно их вывести $data = $this->prepareData($sel->result, "pages"); // Данные, длинна $this->setData($data, $sel->length); $this->setDataRangeByPerPage($limit, $curr_page); return $this->doData(); }
public function getGuideItems($template = "default", $guide_id = false, $per_page = 100, $curr_page = 0) { if (!$curr_page) { $curr_page = (int) getRequest('p'); } if (!$guide_id) { $guide_id = (int) getRequest('param0'); } if (!$template) { $template = "default"; } list($template_block, $template_block_empty, $template_line) = def_module::loadTemplates("data/" . $template, "guide_block", "guide_block_empty", "guide_block_line"); $sel = new selector('objects'); $sel->types('object-type')->id($guide_id); $sel->limit($per_page * $curr_page, $per_page); selectorHelper::detectFilters($sel); $block_arr = array(); $lines = array(); foreach ($sel->result as $element) { $line_arr = array(); $line_arr['attribute:id'] = $element->getId(); $line_arr['xlink:href'] = "uobject://" . $element->getId(); $line_arr['node:text'] = $element->getName(); $lines[] = self::parseTemplate($template_line, $line_arr); } $block_arr['attribute:guide_id'] = $guide_id; $block_arr['subnodes:items'] = $lines; $block_arr['total'] = $sel->total; return self::parseTemplate($template_block, $block_arr); }
public function load_tree_node() { $this->setDataType("list"); $this->setActionType("view"); $sel = new selector('pages'); selectorHelper::detectFilters($sel); $data = $this->prepareData($sel->result, "pages"); $this->setData($data, $sel->length); return $this->doData(); }
public function messages() { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = (int) getRequest("p"); $offset = $limit * $curr_page; $sel = new selector('objects'); if ($types = getRequest('object_types')) { $sel->types('object-type')->id($types); } else { $sel->types('object-type')->name('webforms', 'form'); } $sel->limit($offset, $limit); selectorHelper::detectFilters($sel); $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "objects"); $this->setData($data, $sel->length); return $this->doData(); }
public function listItems($itemType) { $this->setDataType("list"); $this->setActionType("view"); if ($this->ifNotXmlMode()) { $data['nodes:blogs'] = array(array('nodes:blog' => $this->getAllBlogs())); $this->setData($data, 0); return $this->doData(); } $limit = getRequest('per_page_limit'); $curr_page = getRequest('p'); $offset = $limit * $curr_page; $sel = new selector('pages'); $sel->limit($offset, $limit); switch ($itemType) { case 'comment': $sel->types('hierarchy-type')->name('blogs20', 'comment'); break; case 'post': if (!is_null(getRequest('rel'))) { $sel->types('hierarchy-type')->name('blogs20', 'comment'); } $sel->types('hierarchy-type')->name('blogs20', 'post'); break; default: $sel->types('hierarchy-type')->name('blogs20', 'blog'); $sel->types('hierarchy-type')->name('blogs20', 'comment'); $sel->types('hierarchy-type')->name('blogs20', 'post'); } selectorHelper::detectFilters($sel); $this->setDataRange($limit, $offset); $data = $this->prepareData($sel->result, "pages"); $this->setData($data, $sel->length); return $this->doData(); }
public function getPermissionsOwners() { $this->flushAsXML('getPermissionsOwners'); $buffer = outputBuffer::current(); $objects = umiObjectsCollection::getInstance(); $objectTypes = umiObjectTypesCollection::getInstance(); $groupTypeId = $objectTypes->getBaseType('users', 'users'); $svGroupId = $objects->getObjectIdByGUID('users-users-15'); $svId = $objects->getObjectIdByGUID('system-supervisor'); $restrict = array($svId, $svGroupId); $sel = new selector('objects'); $sel->types('object-type')->name('users', 'users'); $sel->types('object-type')->name('users', 'user'); $sel->limit(0, 15); selectorHelper::detectFilters($sel); $items = array(); foreach ($sel as $object) { if (in_array($object->id, $restrict)) { continue; } $usersList = array(); if ($object->getTypeId() == $groupTypeId) { $users = new selector('objects'); $users->types('object-type')->name('users', 'user'); $users->where('groups')->equals($object->id); $users->limit(0, 5); foreach ($users as $user) { $usersList[] = array('attribute:id' => $user->id, 'attribute:name' => $user->name, 'xlink:href' => $user->xlink); } $type = 'group'; } else { $type = 'user'; } $items[] = array('attribute:id' => $object->id, 'attribute:name' => $object->name, 'attribute:type' => $type, 'xlink:href' => $object->xlink, 'nodes:user' => $usersList); } return array('list' => array('nodes:owner' => $items)); }