File: D:/HostingSpaces/SBogers14/coeveringmatrijzen.nl/app/controllers/GalleryController.php
<?php
use Coevering\Facades\MenuService;
use Coevering\Galleries\GalleryService;
use Coevering\Routes\RouteService;
class GalleryController extends BaseController
{
/**
* @var GalleryService
*/
private $galleryService;
/**
* @var RouteService
*/
private $routeService;
/**
* @param GalleryService $galleryService
* @param RouteService $routeService
*/
public function __construct(GalleryService $galleryService, RouteService $routeService)
{
parent::__construct();
$this->pageSlug = 'gallery';
$this->galleryService = $galleryService;
$this->routeService = $routeService;
View::share('submenu', MenuService::getGallery());
}
public function preProductionMolds()
{
$returnUrl = $this->routeService->getByController('ProductsController@preProductionMolds');
$images = array(
'/images/static/fotogalerie/proefmatrijzen001.jpg',
'/images/static/fotogalerie/proefmatrijzen002.jpg',
);
return $this->renderGallery('preProductionMolds',$images, $returnUrl);
}
public function productionMolds()
{
$returnUrl = $this->routeService->getByController('ProductsController@productionMolds');
$images = array(
'/images/static/fotogalerie/productiematrijzen001.jpg',
'/images/static/fotogalerie/productiematrijzen002.jpg',
'/images/static/fotogalerie/productiematrijzen003.jpg',
'/images/static/fotogalerie/productiematrijzen004.jpg',
'/images/static/fotogalerie/productiematrijzen005.jpg',
'/images/static/fotogalerie/productiematrijzen006.jpg',
'/images/static/fotogalerie/productiematrijzen007.jpg',
'/images/static/fotogalerie/productiematrijzen008.jpg',
);
return $this->renderGallery('productionMolds', $images, $returnUrl);
}
public function stackMolds()
{
$returnUrl = $this->routeService->getByController('ProductsController@stackMolds');
$images = array(
'/images/static/fotogalerie/etageMatrijzen001.jpg',
);
return $this->renderGallery('productionMolds', $images, $returnUrl);
}
public function twoKMolds()
{
$returnUrl = $this->routeService->getByController('ProductsController@twoKMolds');
$images = array(
'/images/static/fotogalerie/2kmatrijzen001.jpg',
'/images/static/fotogalerie/2kmatrijzen002.jpg',
'/images/static/fotogalerie/2kmatrijzen003.jpg',
'/images/static/fotogalerie/2kmatrijzen004.jpg',
'/images/static/fotogalerie/2kmatrijzen005.jpg',
);
return $this->renderGallery('2kMolds', $images, $returnUrl);
}
public function precisionMechanicalParts()
{
$returnUrl = $this->routeService->getByController('ProductsController@precisionMechanicalParts');
$images = array(
'/images/static/fotogalerie/onderdelen001.jpg',
'/images/static/fotogalerie/onderdelen002.jpg',
);
return $this->renderGallery('precisionMechanicalParts', $images, $returnUrl);
}
public function machines()
{
$returnUrl = $this->routeService->getByController('MachineryController@milling');
$images = array(
'/images/static/fotogalerie/machinepark-frezen001.jpg',
'/images/static/fotogalerie/machinepark-frezen002.jpg',
'/images/static/fotogalerie/machinepark-frezen003.jpg',
'/images/static/fotogalerie/machinepark-draaien001.jpg',
'/images/static/fotogalerie/machinepark-diepgatboren001.jpg',
'/images/static/fotogalerie/machinepark-slijpen001.jpg',
'/images/static/fotogalerie/machinepark-slijpen002.jpg',
'/images/static/fotogalerie/machinepark-draadvonken001.jpg',
'/images/static/fotogalerie/machinepark-draadvonken002.jpg',
'/images/static/fotogalerie/machinepark-zinkvonken001.jpg',
'/images/static/fotogalerie/machinepark-zinkvonken002.jpg',
'/images/static/fotogalerie/machinepark-3dlaserfrezen001.jpg',
);
return $this->renderGallery('machines', $images, $returnUrl);
}
public function renderGallery($subSlug, $images, $returnUrl)
{
// Setup gallery service
$this->galleryService->setImages($images);
$this->galleryService->setAlt(\Lang::get('app/pageTitles.' . $subSlug));
// Generate content
$imageList = $this->galleryService->createSlider();
$counterList = $this->galleryService->createCounter();
return View::make('layouts.pages.gallery')
->with([
'pageSlug' => $this->pageSlug,
'subSlug' => $subSlug,
'pageTitle' => \Lang::get('app/pageTitles.' . $subSlug) . ' | ' . \Lang::get('app/pageTitles.gallery') . ' | ' . $this->mainTitle,
'images' => $images,
'imageList' => $imageList,
'counterList' => $counterList,
'returnUrl' => $returnUrl,
]);
}
}