예제 #1
0
 public function getYourRequests()
 {
     $user_requests = PagePublishRequests::all_requests(0, ['user_id' => Auth::user()->id], 25);
     if ($user_requests->isEmpty()) {
         $user_requests = 'You have made no requests';
     }
     $user_requests_table = View::make('coaster::partials.tabs.publish_requests.table', array('show' => ['page' => true, 'status' => true, 'requested_by' => false], 'requests' => $user_requests))->render();
     $this->layoutData['title'] = 'Your Publish Requests';
     $this->layoutData['content'] = View::make('coaster::pages.home.requests', array('title' => $this->layoutData['title'], 'requests' => $user_requests_table, 'pagination' => !is_string($user_requests) ? PaginatorRender::run($user_requests, 2) : ''));
 }
예제 #2
0
 public function postRequests($pageId)
 {
     if (empty($pageId)) {
         // block access to all requests
         return 0;
     }
     $type = Request::input('request_type');
     $type = $type ? ['status' => $type] : [];
     $show = Request::input('request_show');
     $show = $show ?: ['page' => false, 'status' => true, 'requested_by' => true];
     $requests = PagePublishRequests::all_requests($pageId, $type, 25);
     if ($requests->isEmpty()) {
         $requests = 'No awaiting requests';
         $pagination = '';
     } else {
         $pagination = PaginatorRender::admin($requests);
     }
     return View::make('coaster::partials.tabs.publish_requests.table', array('show' => $show, 'requests' => $requests, 'pagination' => $pagination))->render();
 }
예제 #3
0
 public function tabRequests()
 {
     $header = '';
     $contents = '';
     $allRequests = PagePublishRequests::all_requests($this->id);
     if (!$allRequests->isEmpty()) {
         $awaitingRequests = PagePublishRequests::all_requests($this->id, ['status' => 'awaiting']);
         $header = 'Publish Requests';
         if ($count = $awaitingRequests->count()) {
             $header .= ' &nbsp; <span class="badge">' . $count . '</span>';
         }
         if ($awaitingRequests->isEmpty()) {
             $awaitingRequests = 'No awaiting requests';
         }
         $requests_table = View::make('coaster::partials.tabs.publish_requests.table', ['show' => ['page' => false, 'status' => true, 'requested_by' => true], 'requests' => $awaitingRequests])->render();
         $contents = View::make('coaster::partials.tabs.publish_requests.main', ['requests_table' => $requests_table]);
     }
     return [$header, $contents];
 }