예제 #1
0
 public function calendarViewMod($data)
 {
     $wdata = array('begin_year' => 2014, 'begin_month' => 1, 'end_year' => intval(date("Y")) + 2, 'end_month' => 11, 'current_year' => intval(date("Y")), 'current_month' => intval(date("m")), 'current_day' => intval(date("d")), 'events' => array());
     $events = \CalendarModel::join(CalendarLangModel::getTableName(), \CalendarModel::getField('id'), '=', CalendarLangModel::getField('calendar_item_id'))->join(\CalendarGroup::getTableName(), \CalendarGroup::getField('id'), '=', \CalendarModel::getField('calendar_group_id'))->join(\CalendarPostModel::getTableName(), \CalendarPostModel::getField('calendar_group_id'), '=', \CalendarGroup::getField('id'))->where(CalendarLangModel::getField('lang_id'), \WebAPL\Language::getId())->where(\CalendarPostModel::getField('post_id'), $data['page']->id)->where(\CalendarModel::getField('enabled'), 1)->select(CalendarLangModel::getField("*"), \CalendarModel::getField('event_date'), \CalendarModel::getField('repeat_frequency'), \CalendarModel::getField('repeat_to_date'), \CalendarModel::getField('person_id'), \CalendarModel::getField('post_id'), \CalendarModel::getField('period'))->orderBy(\CalendarModel::getField('event_date'), 'asc')->get();
     $min_time = mktime(0, 0, 0, $wdata['begin_month'], 1, $wdata['begin_year']);
     $max_time = mktime(0, 0, 0, $wdata['end_month'], 1, $wdata['end_year']);
     $event_list = \CalendarModel::generateEvents($events);
     foreach ($event_list as $event_year) {
         foreach ($event_year as $event_month) {
             foreach ($event_month as $event_day) {
                 foreach ($event_day as $event) {
                     $time = strtotime($event->event_date);
                     if ($min_time > $time) {
                         $min_time = $time;
                     }
                     if ($max_time < $time) {
                         $max_time = $time;
                     }
                 }
             }
         }
     }
     $wdata['events'] = $event_list;
     $wdata['begin_year'] = intval(date('Y', $min_time));
     $wdata['begin_month'] = intval(date('m', $min_time));
     $wdata['end_year'] = intval(date('Y', $max_time));
     $wdata['end_month'] = intval(date('m', $max_time));
     $data['page']->text .= Template::moduleView($this->module_name, "views.calendarPage", $wdata);
     return PageView::defaultView($data);
 }
예제 #2
0
 public function page_bottom_gallery($page)
 {
     $gallery = GalleryPost::where('post_id', $page['id'])->get()->first();
     if ($gallery) {
         $data = array('list' => Files::file_list('gallery', $gallery->gallery_id));
         echo Template::moduleView($this->module_name, 'views.page_gallery', $data);
     }
 }
예제 #3
0
 public function loadHome($page)
 {
     $page_properies = \PostProperty::getPostProperties($page->id);
     if (in_array('show_file_page', $page_properies)) {
         $data = array();
         $data['acte'] = ActeLocaleModel::join(Files::getTableName(), Files::getField('module_id'), '=', ActeLocaleModel::getField('id'))->where(Files::getField('module_name'), 'actelocale')->select(ActeLocaleModel::getField("*"), Files::getField('path'))->orderBy('date_upload', 'desc')->take(2)->get();
         echo Template::moduleView($this->module_name, 'views.sidebar-acte', $data)->render();
     }
 }
예제 #4
0
 public function editact($id)
 {
     \User::onlyHas('actelocale-view');
     $data['act'] = ActeLocaleModel::find($id);
     if ($data['act']) {
         $this->layout->content = Template::moduleView($this->module_name, 'views.form', $data);
         return $this->layout;
     } else {
         throw new Exception("Record not found");
     }
 }
예제 #5
0
 public function soclist()
 {
     \User::onlyHas('socialc-view');
     $pages = \Post::join(\PostLang::getTableName(), \PostLang::getField('post_id'), '=', \Post::getField('id'))->where(\PostLang::getField('lang_id'), \WebAPL\Language::getId())->where(\Post::getField('taxonomy_id'), 1)->orderBy(\PostLang::getField('title'), 'desc')->get();
     $page_list = array();
     $page_json = array();
     foreach ($pages as $page) {
         $page_list[] = "{$page->post_id}:{$page->title}";
         $page_json[$page->post_id] = $page->title;
     }
     $data['pagesString'] = implode(';', $page_list);
     $data['pagesJson'] = json_encode($page_json);
     $this->layout->content = Template::moduleView($this->module_name, 'views.list', $data);
     return $this->layout;
 }
예제 #6
0
 public function requests_list()
 {
     \User::onlyHas('jobrequest-view');
     $this->layout->content = Template::moduleView($this->module_name, 'views.list');
     return $this->layout;
 }
예제 #7
0
 public function page_group_attachment($post)
 {
     if ($post->view_mod == $this->page_view_mod && \User::has('calendar-view')) {
         $wdata = array('post' => $post->toArray(), 'calendar_groups' => \CalendarGroup::orderBy('name', 'asc')->get(), 'selected_groups' => array());
         $selected_groups = \CalendarPostModel::where('post_id', $post->id)->get();
         foreach ($selected_groups as $item) {
             $wdata['selected_groups'][] = $item->calendar_group_id;
         }
         echo Template::moduleView($this->module_name, 'views.attachment-calendar-page', $wdata);
     }
 }
예제 #8
0
파일: poll.php 프로젝트: vcorobceanu/WebAPL
 /**
  * Action for left menu
  */
 public function left_menu_item()
 {
     if (User::has('poll-view')) {
         echo Template::moduleView($this->module_name, 'views.poll-menu');
     }
 }
예제 #9
0
 public function left_menu_item()
 {
     if (\User::has('chat-view')) {
         echo Template::moduleView($this->module_name, 'views.chat-left-menu');
     }
 }
예제 #10
0
 public function cv_form_ev($post)
 {
     if (isset($post) && (strtotime($post->date_point) == 0 || strtotime($post->date_point) > time())) {
         echo Template::moduleView($this->module_name, 'views.job-form', array('post_id' => $post['id']))->render();
     }
 }
예제 #11
0
 public function sendemails($post)
 {
     $data['post'] = $post;
     echo Template::moduleView($this->module_name, 'views.send_email', $data);
 }
예제 #12
0
 public function secial_complaints_list($data)
 {
     $wdata = array('complaints' => SComplaintsModel::where('enabled', 1)->where('is_private', 0)->where('post_id', $data['page']->id)->orderBy('date_created', 'desc')->paginate(5));
     $data['page']->text = Template::moduleView($this->module_name, 'views.complaints_list', $wdata) . $data['page']->text;
     return PageView::defaultView($data);
 }
예제 #13
0
 public function buttonlist()
 {
     $data = array('online' => Firechat::online());
     echo Template::moduleView($this->module_name, 'views.chat-list-button', $data);
 }
예제 #14
0
파일: poll.php 프로젝트: vcorobceanu/WebAPL
 public function pollShortcode($params)
 {
     $wdata['poll'] = PollModel::getWithVotes($params['id']);
     if (!$wdata['poll']) {
         throw new Exception("Poll not found #{$params['id']}");
     }
     if (PollModel::ivoted($params['id'])) {
         $wdata['total_votes'] = \PollVotesModel::where('poll_id', $wdata['poll']->id)->count();
         return Template::moduleView($this->module_name, 'views.pollResults', $wdata);
     } else {
         return Template::moduleView($this->module_name, 'views.pollItem', $wdata);
     }
 }
예제 #15
0
 public function page_group_attachment($post)
 {
     if (in_array($post->view_mod, array('persons_list', 'city_councilors', 'persons_big', 'persons_secretar', 'persons_mayor', 'group_with_persons', 'persons_with_photo'))) {
         $wdata = array('post' => $post->toArray(), 'person_groups' => PersonGroup::join(PersonGroupLang::getTableName(), PersonGroupLang::getField("group_id"), '=', PersonGroup::getField('id'))->select(PersonGroup::getField("id"), PersonGroupLang::getField("name"))->where(PersonGroupLang::getField("lang_id"), \WebAPL\Language::getId())->orderBy(\PersonGroupLang::getField('name'), 'asc')->get()->toArray(), 'selected_groups' => array());
         $selected_groups = PersonGroupPostModel::where('post_id', $post->id)->get();
         foreach ($selected_groups as $item) {
             $wdata['selected_groups'][] = $item->group_id;
         }
         echo Template::moduleView($this->module_name, 'views.attachment-group-page', $wdata);
     }
 }
예제 #16
0
 public function view()
 {
     $this->layout->content = Template::moduleView($this->module_name, 'views.partners');
     return $this->layout;
 }