'doSaveSearch', 'deleteSearch' => 'doDeleteSearch', 'getSavedSearch' => 'doGetSavedSearch', ); public function getIpp() { if (!empty($_POST['ipp'])) { $ipp = intval($_POST['ipp']); if (!empty($ipp) && !empty($_POST['saveIpp']) && 'y' == $_POST['saveIpp']) { Session::setData($this->_getPage4SaveMessage(), 'ipp', $ipp); } } elseif (($sessionIpp = Session::getData($this->_getPage4SaveMessage(), 'ipp'))) { $ipp = intval($sessionIpp); } else { $ipp = DB_List::DEFAULT_IPP; } return $ipp; } /** * @param $DB_List DB_List * @return SavedSearchGrid */ public function setIpp($DB_List) { if (empty($DB_List)) { return $this; } $DB_List->ipp = $this->getIpp(); $DB_List->showPaginationOptions = true; $this->Doc->addItemProp('JSs', 'js/admin_pagination.js'); $this->Doc->addInitFunction('Admin_Pagination.init'); return $this; } function doGetSavedSearchAjax() { $data = array(); $data['id'] = $_REQUEST['id']; $data['id_admin'] = $this->Doc->UserAuth->getData('id'); require_once('app/MemberSearch/MemberSearch.php'); $memberSearch = MemberSearch::getInstance(); $savedSearchData = $memberSearch->getSavedSearch($data); $request = array(); parse_str($savedSearchData['data'], $request); /** @var $form Form */ $form = $this->getFilterForm4List($request); $form->return_form_arr = true; $form->setRendType(FORM_RENDERER_ARRAY_SMARTY); $this->Doc->assign('item', $form->exec()); Constant::set('DEBUG', false); $formHtml = $this->Doc->fetch('Member/filterForm.tpl'); return $this->displayJSON( array( 'data' => $savedSearchData['data'], 'formHtml' => $formHtml ) ); } function doSaveSearchAjax() { $data = array(); $data['name'] = $_REQUEST['name']; $data['id_admin'] = $this->Doc->UserAuth->getData('id'); $data['data'] = $_REQUEST['formData']; require_once('app/MemberSearch/MemberSearch.php'); $memberSearch = MemberSearch::getInstance(); if (!$memberSearch->isUniqueName($data['id_admin'], $data['name'])) { $savedSearches['ok'] = false; $savedSearches['message'] = 'The "' . $data['name'] . '" name is already used for one of the saved searches. Please enter another one.'; return $this->displayJSON($savedSearches); } $memberSearch->addSavedSearch($data); $savedSearches['ok'] = true; $savedSearches['data'] = Qs_Array::assocToIndex($memberSearch->getSavedSearch4Select($data['id_admin']), 'value', 'text'); return $this->displayJSON($savedSearches); } function doDeleteSearchAjax() { $data = array(); $data['id'] = $_REQUEST['id']; $data['id_admin'] = $this->Doc->UserAuth->getData('id'); require_once('app/MemberSearch/MemberSearch.php'); $memberSearch = MemberSearch::getInstance(); $memberSearch->deleteSavedSearch($data); $savedSearches = Qs_Array::assocToIndex($memberSearch->getSavedSearch4Select($data['id_admin']), 'value', 'text'); return $this->displayJSON($savedSearches); } }