/**
  * Affichage d'un élément.
  *
  */
 public function galleriesItem($aMatches)
 {
     # récupération de l'élément en fonction du slug
     if (!empty($aMatches[0])) {
         $slug = $aMatches[0];
     } else {
         $this->serve404();
     }
     # récupération de l'élément
     $rsItem = $this->okt->galleries->items->getItems(array('slug' => $slug, 'active' => 1, 'language' => $this->okt->user->language));
     if ($rsItem->isEmpty()) {
         $this->serve404();
     }
     # module actuel
     $this->okt->page->module = 'galleries';
     $this->okt->page->action = 'item';
     //$rsItem->image = $rsItem->getImagesInfo();
     if ($this->okt->galleries->config->enable_rte == '' && $rsItem->legend != '') {
         $rsItem->legend = util::nlToP($rsItem->legend);
     }
     # title tag
     $this->okt->page->addTitleTag($this->okt->galleries->getTitle());
     if ($rsItem->title_tag == '') {
         $rsItem->title_tag = $rsItem->title;
     }
     $this->okt->page->addTitleTag($rsItem->title_tag);
     # meta description
     if ($rsItem->meta_description != '') {
         $this->okt->page->meta_description = $rsItem->meta_description;
     } else {
         if ($this->okt->galleries->config->meta_description[$this->okt->user->language] != '') {
             $this->okt->page->meta_description = $this->okt->galleries->config->meta_description[$this->okt->user->language];
         } else {
             $this->okt->page->meta_description = util::getSiteMetaDesc();
         }
     }
     # meta keywords
     if ($rsItem->meta_keywords != '') {
         $this->okt->page->meta_keywords = $rsItem->meta_keywords;
     } else {
         if ($this->okt->galleries->config->meta_keywords[$this->okt->user->language] != '') {
             $this->okt->page->meta_keywords = $this->okt->galleries->config->meta_keywords[$this->okt->user->language];
         } else {
             $this->okt->page->meta_keywords = util::getSiteMetaKeywords();
         }
     }
     # fil d'ariane
     if (!$this->isDefaultRoute(__CLASS__, __FUNCTION__, $slug)) {
         $this->okt->page->breadcrumb->add($this->okt->galleries->getName(), $this->okt->galleries->config->url);
         $rsPath = $this->okt->galleries->tree->getPath($rsItem->gallery_id, true, $this->okt->user->language);
         while ($rsPath->fetch()) {
             $this->okt->page->addTitleTag($rsPath->title);
             $this->okt->page->breadcrumb->add($rsPath->title, galleriesHelpers::getGalleryUrl($rsPath->slug));
         }
         $this->okt->page->breadcrumb->add($rsItem->title, $rsItem->getItemUrl());
     }
     # titre de la page
     $this->okt->page->setTitle($rsItem->title);
     # titre SEO de la page
     $this->okt->page->setTitleSeo(!empty($rsItem->title_seo) ? $rsItem->title_seo : $rsItem->title);
     # affichage du template
     echo $this->okt->tpl->render('galleries/item/' . $this->okt->galleries->config->templates['item']['default'] . '/template', array('rsItem' => $rsItem));
 }
Esempio n. 2
0
    } catch (Exception $e) {
        $okt->error->set($e->getMessage());
    }
}
/* Affichage
----------------------------------------------------------*/
# Titre de la page
$okt->page->addGlobalTitle(html::escapeHTML($rsGallery->title));
# Boutons
$okt->page->addButton('galleriesBtSt', array('permission' => true, 'title' => __('c_c_action_Go_back'), 'url' => 'module.php?m=galleries&action=index', 'ui-icon' => 'arrowreturnthick-1-w'));
$okt->page->addButton('galleriesBtSt', array('permission' => $okt->page->action !== 'add' && $okt->checkPerm('galleries_add'), 'title' => __('m_galleries_menu_add_item'), 'url' => 'module.php?m=galleries&action=add' . ($gallery_id ? '&gallery_id=' . $gallery_id : ''), 'ui-icon' => 'image'));
# bouton ajout de plusieurs éléments
$okt->page->addButton('galleriesBtSt', array('permission' => $okt->page->action !== 'add' && $okt->galleries->config->enable_multiple_upload && $okt->checkPerm('galleries_add'), 'title' => __('m_galleries_menu_add_items'), 'url' => 'module.php?m=galleries&action=add_multiples' . ($gallery_id ? '&gallery_id=' . $gallery_id : ''), 'ui-icon' => 'folder-collapsed'));
# bouton ajout depuis un fichier ZIP
$okt->page->addButton('galleriesBtSt', array('permission' => $okt->page->action !== 'add' && $okt->galleries->config->enable_zip_upload && $okt->checkPerm('galleries_add'), 'title' => __('m_galleries_menu_add_zip'), 'url' => 'module.php?m=galleries&action=add_zip' . ($gallery_id ? '&gallery_id=' . $gallery_id : ''), 'ui-icon' => 'script'));
$okt->page->addButton('galleriesBtSt', array('permission' => $rsGallery->active ? true : false, 'title' => __('c_c_action_show'), 'url' => html::escapeHTML(galleriesHelpers::getGalleryUrl($rsGallery->slug)), 'ui-icon' => 'extlink'));
# Récupération des éléments
$rsItems = $okt->galleries->items->getItems(array('language' => $okt->user->language, 'gallery_id' => $gallery_id, 'active' => 2));
# Confirmations
$okt->page->messages->success('switched', __('m_galleries_items_item_switched'));
$okt->page->messages->success('deleted', __('m_galleries_items_item_deleted'));
# Smart columns
$okt->page->smartColumns();
# Modal
$okt->page->applyLbl($okt->galleries->config->lightbox_type);
# Sortables smart columns
$okt->page->js->addReady('
	$(".smartColumns").sortable({
		revert: true,
		handle: "h3",
		update: function(event, ui) {
 /**
  * Retourne l'URL publique d'une galerie
  *
  * @param string $sLanguage
  * @return string
  */
 public function getGalleryUrl($sLanguage = null)
 {
     return galleriesHelpers::getGalleryUrl($this->slug, $sLanguage);
 }
Esempio n. 4
0
# Récupération de la liste complète des galeries
$rsGalleriesList = $okt->galleries->tree->getGalleries(array('active' => 2, 'with_count' => false, 'language' => $okt->user->language));
# Liste des templates utilisables
$oTemplatesItem = new oktTemplatesSet($okt, $okt->galleries->config->templates['item'], 'galleries/item', 'item');
$aTplChoices = array_merge(array(' ' => null), $oTemplatesItem->getUsablesTemplatesForSelect($okt->galleries->config->templates['item']['usables']));
# ajout bouton retour
$okt->page->addButton('galleriesBtSt', array('permission' => true, 'title' => __('c_c_action_Go_back'), 'url' => $iGalleryId ? 'module.php?m=galleries&action=items&gallery_id=' . $iGalleryId : 'module.php?m=galleries&action=index', 'ui-icon' => 'arrowreturnthick-1-w'), 'before');
# boutons update page
if (!empty($aItemData['item']['id'])) {
    $okt->page->addGlobalTitle(__('m_galleries_item_edit_an_item'));
    # bouton switch statut
    $okt->page->addButton('galleriesBtSt', array('permission' => true, 'title' => $aItemData['item']['active'] ? __('c_c_status_Online') : __('c_c_status_Offline'), 'url' => 'module.php?m=galleries&action=edit&item_id=' . $aItemData['item']['id'] . '&switch_status=1', 'ui-icon' => $aItemData['item']['active'] ? 'volume-on' : 'volume-off', 'active' => $aItemData['item']['active']));
    # bouton de suppression si autorisé
    $okt->page->addButton('galleriesBtSt', array('permission' => $okt->checkPerm('galleries_remove'), 'title' => __('c_c_action_Delete'), 'url' => 'module.php?m=galleries&action=delete&item_id=' . $aItemData['item']['id'], 'ui-icon' => 'closethick', 'onclick' => 'return window.confirm(\'' . html::escapeJS(__('m_galleries_item_delete_confirm')) . '\')'));
    # bouton vers la page côté public si publié
    $okt->page->addButton('galleriesBtSt', array('permission' => $aItemData['item']['active'] ? true : false, 'title' => __('c_c_action_Show'), 'url' => galleriesHelpers::getItemUrl($aItemData['locales'][$okt->user->language]['slug']), 'ui-icon' => 'extlink'));
    $okt->page->messages->success('added', __('m_galleries_item_added'));
    $okt->page->messages->success('updated', __('m_galleries_item_updated'));
} else {
    $okt->page->addGlobalTitle(__('m_galleries_item_add_an_item'));
}
# Lockable
$okt->page->lockable();
# Tabs
$okt->page->tabs();
# Modal
$okt->page->applyLbl($okt->galleries->config->lightbox_type);
# RTE
$okt->page->applyRte($okt->galleries->config->enable_rte, 'textarea.richTextEditor');
# Lang switcher
if (!$okt->languages->unique) {