Esempio n. 1
0
 /**
  * indexAction
  *
  * Index action of registration controller user module
  *
  * @return null
  */
 public function indexAction()
 {
     // append breadcrumbs
     \common\BreadCrumbs::appendItem(new \common\BreadCrumbsItem(null, \View::$language->register_title));
     // assign data into view
     \View::assign('title', \View::$language->register_title);
     // set output layout
     \View::setLayout('user-register.phtml');
 }
Esempio n. 2
0
 /**
  * indexAction
  *
  * Index action of sign in controller user module
  *
  * @return null
  */
 public function indexAction()
 {
     // add language
     \View::addLanguageItem('signInController');
     // append breadcrumbs
     \common\BreadCrumbs::appendItem(new \common\BreadCrumbsItem(null, \View::$language->sign_in_title));
     // assign data into view
     \View::assign('title', \View::$language->sign_in_title);
     // set output layout
     \View::setLayout('user-sign-in.phtml');
 }
Esempio n. 3
0
 /**
  * indexAction
  *
  * Index action of manual controller documentation module
  *
  * @return null
  */
 public function indexAction()
 {
     // TODO try something like: /documentation/manual/function/imagecreatefromjpeg
     $uri = '/documentation/manual';
     $last = '';
     while ($part = \Router::shiftParam(\Router::DIRTY_SHIFT)) {
         $last = $part;
         $uri .= '/' . $part;
         \common\BreadCrumbs::appendItem(new \common\BreadCrumbsItem($uri, $part));
     }
     // assign data into view
     \View::assign(array('title' => $last ? $last : \View::$language->documentation_manual_title, 'h1' => $last ? $last : \View::$language->documentation_manual_title, 'content' => '<p>' . ($last ? $last : \View::$language->documentation_manual_title) . '</p>'));
     // set output layout
     \View::setLayout('documentation.phtml');
 }
Esempio n. 4
0
 /**
  * indexAction
  *
  * Index action of tracker controller forum module
  *
  * @return null
  */
 public function indexAction()
 {
     \View::addLanguageItem('forumTrackerController');
     // validate request params
     $gtfFilter = new \modules\forum\forms\GetTrackerFilter();
     $gtfFilter->validate();
     // invalid request params
     if (!$gtfFilter->isValid()) {
         throw new \SystemErrorException(array('title' => \View::$language->forum_tracker_error, 'description' => \View::$language->forum_tracker_request_invalid));
     }
     // get request data
     $gtfData = $gtfFilter->getData();
     // get limit settings
     $gtfData->limit = \App::getConfig('forum')->topics_per_page;
     // TODO topics per page from member custom settings
     // calculate offset
     $gtfData->offset = ($gtfData->page - 1) * $gtfData->limit;
     // get tracker topics by filter type
     $topics = helpers\TrackerTopicsHelper::getTopics($gtfData->by, $gtfData->offset, $gtfData->limit);
     if ($gtfData->page > 1 && !$topics) {
         throw new \MemberErrorException(array('code' => 404, 'title' => \View::$language->forum_tracker_error, 'description' => \View::$language->forum_tracker_page_not_found));
     }
     // normalize tracker filter url
     $trackerUrl = '/forum/tracker';
     $filterUrl = $trackerUrl;
     if ($gtfData->by != 'last') {
         $filterUrl = '/forum/tracker?by=' . $gtfData->by;
     }
     // get posts pagination
     $pagination = array();
     $allTopicsCnt = helpers\TrackerTopicsHelper::getAllTopicsCount();
     if ($allTopicsCnt > $gtfData->limit) {
         $pagination = \common\PaginationHelper::getItems($filterUrl, $gtfData->page, $gtfData->limit, $allTopicsCnt);
     }
     // normalize tracker filter title
     $filterTitle = 'forum_tracker_by_' . $gtfData->by . '_title';
     $filterTitle = \View::$language->{$filterTitle};
     // append breadcrumbs
     \common\BreadCrumbs::appendItems(array(new \common\BreadCrumbsItem($trackerUrl, \View::$language->forum_tracker_breadcrumbs_name), new \common\BreadCrumbsItem(null, $filterTitle)));
     // assign data into view
     $filters = helpers\TrackerFilterLinksHelper::getLinks($gtfData->by);
     \View::assign(array('title' => $filterTitle, 'filters' => $filters, 'topics' => $topics, 'pagination' => $pagination));
     // set output layout
     \View::setLayout('forum-tracker.phtml');
 }
Esempio n. 5
0
 /**
  * indexAction
  *
  * Index action of topic controller forum module
  *
  * @return null
  */
 public function indexAction()
 {
     \View::addLanguageItem('forumTopicController');
     // validate request params
     $gtForm = new forms\GetTopic();
     $gtForm->validate();
     // invalid request params
     if (!$gtForm->isValid()) {
         throw new \SystemErrorException(array('title' => \View::$language->forum_topic_error, 'description' => \View::$language->forum_topic_request_invalid));
     }
     // get request data
     $gtData = $gtForm->getData();
     // get limit settings
     $gtData->limit = \App::getConfig('forum')->posts_per_page;
     // TODO posts per page from member custom settings
     // calculate offset
     $gtData->offset = ($gtData->page - 1) * $gtData->limit;
     // get topic
     $topic = helpers\TopicHelper::getTopicById($gtData->id);
     if (!$topic) {
         throw new \MemberErrorException(array('code' => 404, 'title' => \View::$language->forum_topic_error, 'description' => \View::$language->forum_topic_topic_not_found));
     }
     // get topic posts
     $posts = helpers\TopicPostsHelper::getPostsByTopicId($gtData->id, $gtData->offset, $gtData->limit);
     if (!$posts) {
         $description = $gtData->page == 1 ? \View::$language->forum_topic_first_post_not_found : \View::$language->forum_topic_page_not_found;
         throw new \SystemErrorException(array('title' => \View::$language->forum_topic_error, 'description' => $description));
     }
     // get posts pagination
     $pagination = array();
     if ($topic->posts_count > $gtData->limit) {
         $pagination = \common\PaginationHelper::getItems('/forum/topic?id=' . $topic->id, $gtData->page, $gtData->limit, $topic->posts_count);
     }
     // append breadcrumbs
     \common\BreadCrumbs::appendItems(array(new \common\BreadCrumbsItem('/forum/forum?id=' . $topic->forum_id, $topic->forum_title), new \common\BreadCrumbsItem('/forum/sub-forum?id=' . $topic->subforum_id, $topic->subforum_title), new \common\BreadCrumbsItem(null, $topic->topic_title)));
     // assign data into view
     \View::assign(array('title' => $topic->topic_title, 'topic' => $topic, 'posts' => $posts, 'postsCountOffset' => $gtData->offset + 1, 'pagination' => $pagination));
     // set output layout
     \View::setLayout('forum-topic.phtml');
 }
Esempio n. 6
0
 /**
  * indexAction
  *
  * Index action of subforum controller forum module
  *
  * @return null
  */
 public function indexAction()
 {
     \View::addLanguageItem('forumSubForumController');
     // validate request params
     $gsfForm = new forms\GetSubForum();
     $gsfForm->validate();
     // invalid request params
     if (!$gsfForm->isValid()) {
         throw new \SystemErrorException(array('title' => \View::$language->forum_sub_forum_error, 'description' => \View::$language->forum_sub_forum_request_invalid));
     }
     // get request data
     $gsfData = $gsfForm->getData();
     // get limit settings
     $gsfData->limit = \App::getConfig('forum')->topics_per_page;
     // TODO topics per page from member custom settings
     // calculate offset
     $gsfData->offset = ($gsfData->page - 1) * $gsfData->limit;
     // get subforum
     $subForum = helpers\SubForumHelper::getSubForumById($gsfData->id);
     if (!$subForum) {
         throw new \MemberErrorException(array('code' => 404, 'title' => \View::$language->forum_sub_forum_error, 'description' => \View::$language->forum_sub_forum_sub_forum_not_found));
     }
     // get subforum topics
     $topics = helpers\SubForumTopicsHelper::getTopics($gsfData->id, $gsfData->offset, $gsfData->limit);
     if ($gsfData->page > 1 && !$topics) {
         throw new \SystemErrorException(array('title' => \View::$language->forum_sub_forum_error, 'description' => \View::$language->forum_sub_forum_page_not_found));
     }
     // get posts pagination
     $pagination = array();
     if ($subForum->topics_count > $gsfData->limit) {
         $pagination = \common\PaginationHelper::getItems('/forum/sub-forum?id=' . $subForum->id, $gsfData->page, $gsfData->limit, $subForum->topics_count);
     }
     // append breadcrumbs
     \common\BreadCrumbs::appendItems(array(new \common\BreadCrumbsItem('/forum/forum?id=' . $subForum->forum_id, $subForum->forum_title), new \common\BreadCrumbsItem(null, $subForum->title)));
     // assign data into view
     \View::assign(array('title' => $subForum->title, 'subForum' => $subForum, 'topics' => $topics, 'pagination' => $pagination));
     // set output layout
     \View::setLayout('forum-sub-forum.phtml');
 }
Esempio n. 7
0
 /**
  * indexAction
  *
  * Index action of forum controller forum module
  *
  * @return null
  */
 public function indexAction()
 {
     \View::addLanguageItem('forumForumController');
     // validate request params
     $gfForm = new forms\GetForum();
     $gfForm->validate();
     // invalid request params
     if (!$gfForm->isValid()) {
         throw new \SystemErrorException(array('title' => \View::$language->forum_forum_error, 'description' => \View::$language->forum_forum_request_invalid));
     }
     // get forum tree
     $forum = helpers\ForumsTreeHelper::getTree($gfForm->getData()->id);
     if (!$forum) {
         throw new \MemberErrorException(array('code' => 404, 'title' => \View::$language->forum_forum_error, 'description' => \View::$language->forum_forum_forum_not_found));
     }
     // append breadcrumbs
     \common\BreadCrumbs::appendItem(new \common\BreadCrumbsItem(null, $forum[0]->title));
     // assign data into view
     \View::assign(array('title' => $forum[0]->title, 'forum' => $forum[0]));
     // set output layout
     \View::setLayout('forum-forum.phtml');
 }
Esempio n. 8
0
 /**
  * runBefore
  *
  * Run before action
  *
  * @return null
  */
 public function runBefore()
 {
     \View::addLanguageItem('documentationMainController');
     \common\BreadCrumbs::appendItem(new \common\BreadCrumbsItem('/documentation', \View::$language->documentation_main_title));
 }
Esempio n. 9
0
 /**
  * runBefore
  *
  * Run before action
  *
  * @return null
  */
 public function runBefore()
 {
     \View::addLanguageItem('forumMainController');
     \common\BreadCrumbs::appendItem(new \common\BreadCrumbsItem('/forum', \View::$language->forum_main_title));
 }