예제 #1
0
 public function Gallery(Request $request, $galleryId)
 {
     $gallery = \Model\PhotoParent\ModelName::where('dostuk', '=', '1')->where('id', '=', $galleryId)->first();
     $images = json_decode($gallery->images);
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $dostukProjects = \Model\Project\ModelName::where('published', '=', true)->where('dostuk', '=', 1)->get();
     return view('Front::channel.dostuk.photos', ['images' => $images, 'backgroundMain' => $backgroundMain, 'gallery' => $gallery, 'dostukProjects' => $dostukProjects]);
 }
예제 #2
0
 public function gallery(Request $request)
 {
     $id = $request->photoParentId;
     $row = \Model\PhotoParent\ModelName::where('id', '=', $id)->first();
     $images = json_decode($row->images);
     // array of images
     $lc = app()->getlocale();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::ns.gallery', ['lc' => $lc, 'images' => $images, 'row' => $row, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
예제 #3
0
 public function post(\Model\Post\ModelName $post)
 {
     $lc = app()->getlocale();
     $post->incrementViewed();
     // Photo Gallery
     $parent = \Model\PhotoParent\ModelName::where('id', '=', $post->parentId)->first();
     if ($parent) {
         $images = json_decode($parent->images);
     } else {
         $images = null;
     }
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::rs.post', ['post' => $post, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft, 'images' => $images]);
 }
예제 #4
0
 public function allphotos()
 {
     $channel = \Model\Channel\ModelName::name('madaniyat')->first();
     $perPage = 24;
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $postAll = \Model\Media\ModelName::where('published', '=', true)->where('madaniyat', '=', '1')->orderBy('id', 'desc')->paginate($perPage);
     $lc = app()->getlocale();
     if ($lc == 'kg') {
         $madaniyatProjects = \Model\Project\ModelName::where('published', '=', true)->where('madaniyat', '=', 1)->where('name', '<>', '')->get();
     } else {
         $madaniyatProjects = \Model\Project\ModelName::where('published', '=', true)->where('madaniyat', '=', 1)->where('nameRu', '<>', '')->get();
     }
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('madaniyat', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     return view('Front::channel.madaniyat.allphotos', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'photoGalleries' => $photoGalleries, 'postAll' => $postAll, 'perPage' => $perPage, 'madaniyatProjects' => $madaniyatProjects]);
 }
예제 #5
0
 public function Post(\Model\Post\ModelName $post)
 {
     $lc = app()->getlocale();
     $post->incrementViewed();
     $categories = \Model\Category\ModelName::all();
     $positionTop = \Model\Banner\ModelName::top()->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     if ($post->parentId != '0' && $post->parentId != null) {
         $parentId = $post->parentId;
         $parentId = \Model\PhotoParent\ModelName::where('id', '=', $parentId)->first();
         $photoChilds = \Model\PhotoChild\ModelName::where('parentId', '=', $parentId->id)->get();
     } else {
         $parentId = '0';
         $photoChilds = '0';
     }
     if ($post->related1 != null) {
         $related1Post = \Model\Post\ModelName::where('id', '=', $post->related1)->first();
     } else {
         $related1Post = null;
     }
     if ($post->related2 != null) {
         $related2Post = \Model\Post\ModelName::where('id', '=', $post->related2)->first();
     } else {
         $related2Post = null;
     }
     if ($post->related3 != null) {
         $related3Post = \Model\Post\ModelName::where('id', '=', $post->related3)->first();
     } else {
         $related3Post = null;
     }
     if ($lc == 'kg') {
         $relatedPosts = \Model\Post\ModelName::where('category_id', '=', $post->category_id)->languagekg()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     } elseif ($lc == 'ru') {
         $relatedPosts = \Model\Post\ModelName::where('category_id', '=', $post->category_id)->languageru()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     }
     return view('Front::post.post', ['post' => $post, 'related1Post' => $related1Post, 'related2Post' => $related2Post, 'related3Post' => $related3Post, 'relatedPosts' => $relatedPosts, 'parentId' => $parentId, 'photoChilds' => $photoChilds, 'categories' => $categories, 'positionTop' => $positionTop, 'backgroundMain' => $backgroundMain]);
 }
예제 #6
0
 public function Gallery(Request $request, $galleryId)
 {
     $gallery = \Model\PhotoParent\ModelName::where('muzkanal', '=', '1')->where('id', '=', $galleryId)->first();
     $images = json_decode($gallery->images);
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::channel.muzkanal.photos', ['images' => $images, 'backgroundMain' => $backgroundMain, 'gallery' => $gallery]);
 }
예제 #7
0
 public function photodelete(Request $request)
 {
     $delete = $request->photoDeleteId;
     $photoParentId = $request->photoParentId;
     $photoParent = \Model\PhotoParent\ModelName::where('id', '=', $photoParentId)->first();
     $files = json_decode($photoParent->images);
     $file = array_only($files, $delete - 1);
     $name = last(last($file));
     $key = array_has($files, $delete);
     if ($key !== false) {
         unset($files[$delete - 1]);
         $storage = \Storage::delete('/froala/uploads/' . $name);
     }
     unset($files[$delete - 1]);
     $jsonFiles = json_encode($files);
     //dd($photoParent->images,$files,$jsonFiles);
     $photoParent->images = $jsonFiles;
     $photoParent->save();
     return redirect()->route('admin.photoParent.index');
 }
예제 #8
0
 public function edit(PhotoChild $photoChild)
 {
     $tags = \Model\Tag\Tag::lists('name', 'id');
     $PhotoParentList = \Model\PhotoParent\ModelName::lists('name', 'id')->toArray();
     return view('Admin::photoChild.edit', ['photoChild' => $photoChild, 'PhotoParentList' => $PhotoParentList, 'tags' => $tags]);
 }
예제 #9
0
 public function destroyChild(Request $request)
 {
     $photoDeleteId = $request->photoDeleteId;
     $photoChild = \Model\PhotoChild\ModelName::where('id', '=', $photoDeleteId)->first();
     $photoParentId = $request->photoParentId;
     $photoChild->delete();
     $photoParent = \Model\PhotoParent\ModelName::where('id', '=', $photoParentId)->first();
     return redirect()->route('admin.photoParent.show', $photoParent);
 }
예제 #10
0
 public function allphotos()
 {
     $channel = \Model\Channel\ModelName::name('balastan')->first();
     $perPage = 24;
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $postAll = \Model\Media\ModelName::where('published', '=', true)->where('balastan', '=', '1')->orderBy('id', 'desc')->paginate($perPage);
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('balastan', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     return view('Front::channel.balastan.allphotos', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'photoGalleries' => $photoGalleries, 'postAll' => $postAll, 'perPage' => $perPage]);
 }
예제 #11
0
 public function Gallery(Request $request, $galleryId)
 {
     $lc = app()->getlocale();
     $gallery = \Model\PhotoParent\ModelName::where('id', '=', $galleryId)->first();
     $images = json_decode($gallery->images);
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::gallery.gallery', ['lc' => $lc, 'images' => $images, 'backgroundMain' => $backgroundMain, 'gallery' => $gallery, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
예제 #12
0
 public function unpublish(Request $request)
 {
     $id = $request->photoParentId;
     $photoParent = \Model\PhotoParent\ModelName::where('id', '=', $id)->first();
     $photoParent->published = 0;
     $photoParent->save();
     return redirect()->route('admin.photoParent.index');
 }
예제 #13
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Post $post)
 {
     $PhotoParentList = \Model\PhotoParent\ModelName::lists('name', 'id')->toArray();
     $relatedPosts = \Model\Post\ModelName::where('title', '<>', '')->lists('title', 'id')->toArray();
     $relatedPosts2 = \Model\Post\ModelName::where('titleRu', '<>', '')->lists('titleRu', 'id')->toArray();
     $tags = \Model\Tag\Tag::lists('name', 'id');
     $tags2 = \Model\Tag\Tag::lists('name', 'id');
     return view('Admin::post.edit', ['post' => $post, 'tags' => $tags, 'tags2' => $tags2, 'relatedPosts' => $relatedPosts, 'relatedPosts2' => $relatedPosts2, 'PhotoParentList' => $PhotoParentList]);
 }
예제 #14
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Post $post)
 {
     $channelList = \Model\Channel\ModelName::lists('display', 'id')->toArray();
     $categoryList = \Model\Category\ModelName::lists('titleRu', 'id')->toArray();
     $PhotoParentList = \Model\PhotoParent\ModelName::lists('name', 'id')->toArray();
     $relatedPosts = \Model\Post\ModelName::where('title', '<>', '')->where('id', '<>', $post->id)->lists('title', 'id')->toArray();
     $relatedPosts2 = \Model\Post\ModelName::where('titleRu', '<>', '')->where('id', '<>', $post->id)->lists('titleRu', 'id')->toArray();
     $dostukProgramList = \Model\Project\ModelName::where('dostuk', '=', '1')->lists('name', 'id')->toArray();
     $birinchiProgramList = \Model\Project\ModelName::where('birinchi', '=', '1')->lists('name', 'id')->toArray();
     $kyrgyzradioProgramList = \Model\Project\ModelName::where('kyrgyzradio', '=', '1')->lists('name', 'id')->toArray();
     $tags = \Model\Tag\Tag::lists('name', 'id');
     $tags2 = \Model\Tag\Tag::lists('name', 'id');
     return view('Admin::post.edit', ['post' => $post, 'tags' => $tags, 'tags2' => $tags2, 'relatedPosts' => $relatedPosts, 'relatedPosts2' => $relatedPosts2, 'channelList' => $channelList, 'categoryList' => $categoryList, 'PhotoParentList' => $PhotoParentList, 'dostukProgramList' => $dostukProgramList, 'birinchiProgramList' => $birinchiProgramList, 'kyrgyzradioProgramList' => $kyrgyzradioProgramList]);
 }