public function actionDisplay($lang, $module_dispatch, $categorie, $type, $HelperPhoto, $album, $titre, $photo, $page) { $DetailPhoto = new DetailPhoto(); $DeletePhoto = new DeletePhoto(); $UpdatePhoto = new UpdatePhoto(); $AddPhoto = new AddPhoto(); $layout = ""; if ($photo != "") { $HelperPhoto->readConfigFile($HelperPhoto->albumPath . '/' . $album . '/' . $HelperPhoto->pictureConfig); $description = stripslashes(isset($HelperPhoto->config[$photo . '_desc']) ? $HelperPhoto->config[$photo . '_desc'] : ''); $legend = stripslashes(isset($HelperPhoto->config[$photo . '_title']) ? $HelperPhoto->config[$photo . '_title'] : ''); $date = stripslashes(isset($HelperPhoto->config[$photo . '_date']) ? $HelperPhoto->config[$photo . '_date'] : ''); $show = $HelperPhoto->config[$photo . '_show'] == 'on' ? "showtrue" : "showfalse"; $image = $HelperPhoto->albumPath . '/' . $album . '/original/' . $photo; if ($type == DETAIL) { $layout .= $DetailPhoto->detail($lang, $module_dispatch, $legend, $description, $date, $image, $show); } elseif ($type == UPDATE) { $show = $HelperPhoto->config[$photo . '_show']; $layout .= $UpdatePhoto->update($lang, $module_dispatch, $categorie, $album, $titre, $legend, $description, $date, $show, $photo, $page); } elseif ($type == DELETE) { $layout .= $DeletePhoto->delete($lang, $module_dispatch, $categorie, $album, $titre, $legend, $description, $date, $image, $show, $photo, $page); } } elseif ($type == ADD) { $layout .= $AddPhoto->add($lang, $module_dispatch, $categorie, $page, $album, $titre); } return $layout; }
<?php // Import include_once 'controller/helper/helper_photo.class.php'; include_once 'controller/action/action_photo.class.php'; include_once 'view/wrapper/classes/photo/add.class.php'; include_once 'view/wrapper/classes/photo/listing.class.php'; include_once 'view/helper/helper_header.class.php'; include_once 'view/helper/helper_layout.class.php'; include_once 'view/helper/helper_pagination.class.php'; // Déclarartion des variables $HelperLayout = new HelperLayout(); $HelperPhoto = new HelperPhoto(); $AddPhoto = new AddPhoto(); $ListingPhoto = new ListingPhoto(); if (!empty($var->categorie)) { // Test si une catégorie a été trouvée $module_dispatch = $var->module; if ($Action->init($lang, $module_dispatch, $var->action, $HelperPhoto, $var->album, $var->photo, $var->legend, $var->description, $var->date, $var->show, $var->submit)) { // Create, update, delete album $var->module_output .= $Action->output; $var->type = $Action->type; } // Construction du header $var->module_output .= $HelperHeader->wrapper($lang, $module_dispatch, $module_dispatch, $var->categorie, $var->ss_categorie, $var->search, $var->sort, $var->page, $var->order, ADD, $var->album, $var->titre); // Chargement de la liste des photos $HelperPhoto->getAlbumPhotosConfig($var->album); $HelperPhoto->parseDirPagination($var->page, $HelperPhoto->albumPath . '/' . $var->album . '/original', $var->sort, $var->order, $var->search); if (count($HelperPhoto->paginationPhotos) > 0) { $i = 0; foreach ($HelperPhoto->paginationPhotos as $file) {