/** * Список созданных заметок */ public function EventCreatedNotes() { if (!$this->CheckUserProfile()) { return parent::EventNotFound(); } $this->sMenuSubItemSelect = 'notes'; /** * Заметки может читать только сам пользователь */ if (!$this->oUserCurrent || $this->oUserCurrent->getId() != $this->oUserProfile->getId()) { return parent::EventNotFound(); } /** * Передан ли номер страницы */ $iPage = $this->GetParamEventMatch(2, 2) ? $this->GetParamEventMatch(2, 2) : 1; /** * Получаем список заметок */ $aResult = E::ModuleUser()->GetUserNotesByUserId($this->oUserProfile->getId(), $iPage, Config::Get('module.user.usernote_per_page')); $aNotes = $aResult['collection']; /** * Формируем постраничность */ $aPaging = E::ModuleViewer()->MakePaging($aResult['count'], $iPage, Config::Get('module.user.usernote_per_page'), Config::Get('pagination.pages.count'), $this->oUserProfile->getUserUrl() . 'created/notes'); /** * Загружаем переменные в шаблон */ E::ModuleViewer()->Assign('aPaging', $aPaging); E::ModuleViewer()->Assign('aNotes', $aNotes); E::ModuleViewer()->AddHtmlTitle(E::ModuleLang()->Get('user_menu_profile') . ' ' . $this->oUserProfile->getLogin()); E::ModuleViewer()->AddHtmlTitle(E::ModuleLang()->Get('user_menu_profile_notes')); /** * Устанавливаем шаблон вывода */ $this->SetTemplateAction('created_notes'); }