/**
  * Show the admin panel.
  *
  * @param  App\Repositories\ContactRepository $contact_gestion
  * @param  App\Repositories\BlogRepository $blog_gestion
  * @param  App\Repositories\CommentRepository $comment_gestion
  * @return Response
  */
 public function admin(ContactRepository $contact_gestion, BlogRepository $blog_gestion, CommentRepository $comment_gestion)
 {
     $nbrMessages = $contact_gestion->getNumber();
     $nbrUsers = $this->user_gestion->getNumber();
     $nbrPosts = $blog_gestion->getNumber();
     $nbrComments = $comment_gestion->getNumber();
     return view('back.index', compact('nbrMessages', 'nbrUsers', 'nbrPosts', 'nbrComments'));
 }
 /**
  * نمایش داشبورد ادمین
  *
  * @param  App\Repositories\PostRepository $PostRepository
  * @param  App\Repositories\CommentRepository $CommentRepository
  * @return Response
  */
 public function Index(PostRepository $PostRepository, CommentRepository $CommentRepository)
 {
     $nbrPosts = $PostRepository->getNumber();
     $nbrComments = $CommentRepository->getNumber();
     $posts = $PostRepository->lists($this->nbrPages);
     $links = $posts->setPath('')->render();
     return view('admin.DashBoard', compact('posts', 'links', 'nbrPosts', 'nbrComments'));
 }
Esempio n. 3
0
 /**
  * Show the media panel.
  *
  * @return Response
  */
 public function filemanager(ContactRepository $contact_gestion, BlogRepository $blog_gestion, CommentRepository $comment_gestion)
 {
     $url = config('medias.url');
     $nbrMessages = $contact_gestion->getNumber();
     $nbrUsers = $this->user_gestion->getNumber();
     $nbrPosts = $blog_gestion->getNumber();
     $nbrComments = $comment_gestion->getNumber();
     return view('back.filemanager', compact('url', 'nbrMessages', 'nbrUsers', 'nbrPosts', 'nbrComments'));
 }
Esempio n. 4
0
 /**
  * Show the admin panel.
  *
  * @param  App\Repositories\ContactRepository $contact_gestion
  * @param  App\Repositories\BlogRepository $blog_gestion
  * @param  App\Repositories\CommentRepository $comment_gestion
  * @return Response
  */
 public function index(BlogRepository $blog_gestion, CommentRepository $comment_gestion)
 {
     $nbrPosts = $blog_gestion->getNumber();
     $nbrComments = $comment_gestion->getNumber();
     $tasklistall = Tasklist::all();
     Session::put('tasklisttkey', $tasklistall);
     $taskcount = Tasklist::count();
     Session::put('taskcountkey', $taskcount);
     return view('back.partials.ru', compact('nbrPosts', 'nbrComments', 'taskcountkey', 'tasklisttkey'));
 }
 /**
  * تایید یک کامنت
  *
  * @param  Illuminate\Http\Request $request
  * @return Response
  */
 public function updateApprove(Request $request)
 {
     $input = $request->all();
     $SendParam = $input['SendParam'];
     $SendParam = json_decode($SendParam);
     if (is_array($SendParam->cmt_ids)) {
         $this->CommentRepository->updateBatchApproved($SendParam->approved, $SendParam->cmt_ids);
     } else {
         $this->CommentRepository->updateApprove($SendParam->approved, $SendParam->cmt_ids);
     }
     return response()->json();
 }
Esempio n. 6
0
 /**
  * Show the admin panel.
  *
  * @param  App\Repositories\ContactRepository $contact_gestion
  * @param  App\Repositories\BlogRepository $blog_gestion
  * @param  App\Repositories\CommentRepository $comment_gestion
  * @return Response
  */
 public function admin(ContactRepository $contact_gestion, BlogRepository $blog_gestion, CommentRepository $comment_gestion)
 {
     $nbrMessages = $contact_gestion->getNumber();
     $nbrUsers = $this->user_gestion->getNumber();
     $nbrPosts = $blog_gestion->getNumber();
     $nbrComments = $comment_gestion->getNumber();
     $tasklistall = Tasklist::all();
     Session::put('tasklisttkey', $tasklistall);
     $taskcount = Tasklist::count();
     Session::put('taskcountkey', $taskcount);
     return view('back.index', compact('nbrMessages', 'nbrUsers', 'nbrPosts', 'nbrComments', 'taskcountkey', 'tasklisttkey'));
 }
 /**
  * Create a new comment on a post
  *
  * @return string
  */
 public function postComment()
 {
     try {
         //Must be an ajax request
         if (!$this->input->is_ajax_request()) {
             //Raise error
             throw new Exception('The request is not allowed', 422);
         }
         //User must be logged in
         if (!$this->auth->check()) {
             //Raise error
             throw new Exception('You must be logged in to proceed', 422);
         }
         //Set validation
         $this->form_validation->set_rules('post_id', 'Post Identifier', 'required|xss_clean');
         $this->form_validation->set_rules('comment', 'Comment', 'required|xss_clean');
         //Apply validation
         if ($this->form_validation->run() == false) {
             //Raise error
             throw new Exception('Missing parameters', '422');
         }
         //Create comment and return
         echo json_encode(['error' => false, 'commentRow' => $this->load->view('partials/_single-comment-row', ['comment' => $this->commentRepo->createComment($this->postRepo->getPost($this->input->post('post_id')), $this->input->post('comment'), $this->auth->user())], true)]);
     } catch (Exception $e) {
         //Unexpected error
         echo json_encode(['error' => true, 'message' => $e->getMessage()]);
     }
 }
Esempio n. 8
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Illuminate\Http\Request $request
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request, $id)
 {
     $this->comment_gestion->destroy($id);
     if ($request->ajax()) {
         return response()->json(['id' => $id]);
     }
     return redirect('comment');
 }
 /**
  * تابعی برای نمایش یک پست و کامنتهای مربوطه با آیدی پست
  * @param  int $pst_id
  * @return view
  */
 public function readPost($pst_id)
 {
     $post = $this->PostRepository->get($pst_id);
     //----> کوئری یوزر عادی
     $comments = $this->CommentRepository->getApprovedByPostId($pst_id);
     $newPostsList = $this->PostRepository->newPostsList($this->nbrPages);
     $mostLikePostsList = $this->PostRepository->mostLikePostsList($this->nbrPages);
     return view('layout.ReadPost', compact('newPostsList', 'mostLikePostsList', 'pst_id', 'post', 'comments'));
 }
 /**
  * نمایش فرم افزودن پست
  *
  * @return Response
  */
 public function addPostForm()
 {
     $nbrPosts = $this->PostRepository->getNumber();
     $nbrComments = $this->CommentRepository->getNumber();
     $nbrTags = $this->PostRepository->getTags();
     $url = config('medias.url');
     $FormUrl = Route('insertPost');
     $FormMethod = "POST";
     return view('admin.Post.Form', compact('nbrTags', 'nbrPosts', 'nbrComments', 'FormUrl', 'FormMethod', 'url'));
 }
 /**
  * Toggle comment seen status.
  *
  * @param Request $request
  * @param $id
  * @return \Illuminate\Http\JsonResponse
  */
 public function seen(Request $request, $id)
 {
     $this->comment->toggleStatus($id, 'seen', $request->input('seen'));
     return response()->json();
 }
 /**
  * Delete comment.
  *
  * @param $id
  */
 public function delete(CommentDeleteRequest $request)
 {
     $this->comment->delete($request->input('id'));
 }
 /**
  * 删除
  *
  * @param ineger $id
  */
 public function getDestroy($id)
 {
     $this->commentRepository->destroy($id);
     return responseSuccess('删除成功');
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show(Category $category, Post $post, CommentRepository $comment)
 {
     return view('blog.post', ['post' => $post, 'categories' => $category->all(), 'comments' => $comment->getPostComments($post)]);
 }