/**
  * Retourne l'URL publique d'une rubrique
  *
  * @param string $sLanguage
  * @return string
  */
 public function getCategoryUrl($sLanguage = null)
 {
     return pagesHelpers::getCategoryUrl($this->category_slug, $sLanguage);
 }
Example #2
0
}
# fin Okatea : affichage des pages de la rubrique id 1
?>

		<?php 
# début Okatea : affichage des sous-rubriques de la rubrique id 1
if ($okt->modules->moduleExists('pages')) {
    echo pagesHelpers::getSubCatsByCatId(1);
}
# fin Okatea : affichage des sous-rubriques de la rubrique id 1
?>

		<?php 
# début Okatea : affichage de l'arbre des rubriques
if ($okt->modules->moduleExists('pages')) {
    echo pagesHelpers::getCategories();
}
# fin Okatea : affichage de l'arbre des rubriques
?>


		<?php 
# début Okatea : affichage des news de la rubrique id 1
if ($okt->modules->moduleExists('news')) {
    echo newsHelpers::getPostsByCatId(1);
}
# fin Okatea : affichage des news de la rubrique id 1
?>

		<?php 
# début Okatea : affichage des sous-rubriques de la rubrique id 1
Example #3
0
            }
        }
        # Images
        if ($okt->pages->config->images['enable']) {
            $aPageData['images'] = $rsPage->getImagesInfo();
        }
        # Fichiers
        if ($okt->pages->config->files['enable']) {
            $aPageData['files'] = $rsPage->getFilesInfo();
        }
        # Permissions
        if ($okt->pages->canUsePerms()) {
            $aPageData['perms'] = $okt->pages->getPagePermissions($aPageData['post']['id']);
        }
        # URL
        $sPageUrl = pagesHelpers::getPageUrl($aPageData['locales'][$okt->user->language]['slug']);
    }
}
# -- TRIGGER MODULE PAGES : adminPostInit
$okt->pages->triggers->callTrigger('adminPostInit', $okt, $aPageData, $rsPage, $rsPageI18n);
/* Traitements
----------------------------------------------------------*/
# switch page status
if (!empty($_GET['switch_status']) && !empty($aPageData['post']['id'])) {
    try {
        $okt->pages->switchPageStatus($aPageData['post']['id']);
        # log admin
        $okt->logAdmin->info(array('code' => 32, 'component' => 'pages', 'message' => 'page #' . $aPageData['post']['id']));
        $okt->redirect('module.php?m=pages&action=edit&post_id=' . $aPageData['post']['id'] . '&switched=1');
    } catch (Exception $e) {
        $okt->error->set($e->getMessage());
Example #4
0
 /**
  * Retourne sous forme de liste HTML les sous-catégories d'une catégorie donnée.
  *
  * @param integer $iCatId				L'identifiant de la catégorie a lister.
  * @param string $sBlockFormat			Masque de formatage du bloc de la liste.
  * @param string $sItemFormat 			Masque de formatage d'un élément de la liste.
  * @param string $sItemActiveFormat 	Masque de formatage de l'élément actif de la liste.
  * @param string $sLinkFormat 			Masque de formatage d'un lien de la liste.
  * @param string $sItemsGlue 			Chaine de liaison entre les éléments.
  * @return string
  */
 public function getSubCatsByCatId($iCatId, $sBlockFormat = '<ul>%s</ul>', $sItemFormat = '<li>%s</li>', $sItemActiveFormat = '<li class="active"><strong>%s</strong></li>', $sLinkFormat = '<a href="%s">%s</a>', $sItemsGlue = '')
 {
     trigger_error('Deprecated method, please use pagesHelpers::getSubCatsByCatId() instead', E_USER_WARNING);
     return pagesHelpers::getSubCatsByCatId($iCatId, $sBlockFormat, $sItemFormat, $sItemActiveFormat, $sLinkFormat, $sItemsGlue);
 }
Example #5
0
while ($rsCategories->fetch()) {
    if (!in_array($rsCategories->id, $aChildrens)) {
        $aAllowedParents[] = new formSelectOption(str_repeat('&nbsp;&nbsp;&nbsp;', $rsCategories->level - 1) . '&bull; ' . html::escapeHTML($rsCategories->title), $rsCategories->id);
    }
}
# button set
$okt->page->setButtonset('pagesCatsBtSt', array('id' => 'pages-cats-buttonset', 'type' => '', 'buttons' => array(array('permission' => true, 'title' => __('c_c_action_Go_back'), 'url' => 'module.php?m=pages&amp;action=categories', 'ui-icon' => 'arrowreturnthick-1-w'))));
if ($iCategoryId) {
    # bouton add cat
    $okt->page->addButton('pagesCatsBtSt', array('permission' => true, 'title' => __('m_pages_cats_add_category'), 'url' => 'module.php?m=pages&amp;action=categories&amp;do=add', 'ui-icon' => 'plusthick'));
    # bouton switch statut
    $okt->page->addButton('pagesCatsBtSt', array('permission' => true, 'title' => $aCategoryData['active'] ? __('c_c_status_Online') : __('c_c_status_Offline'), 'url' => 'module.php?m=pages&amp;action=categories&amp;do=edit&amp;switch_status=1&amp;category_id=' . $iCategoryId, 'ui-icon' => $aCategoryData['active'] ? 'volume-on' : 'volume-off', 'active' => $aCategoryData['active']));
    # bouton de suppression
    $okt->page->addButton('pagesCatsBtSt', array('permission' => $iCategoryNumPages == 0, 'title' => __('c_c_action_Delete'), 'url' => 'module.php?m=pages&amp;action=categories&amp;delete=' . $iCategoryId, 'ui-icon' => 'closethick', 'onclick' => 'return window.confirm(\'' . html::escapeJS(__('m_pages_cats_delete_confirm')) . '\')'));
    # bouton vers la catégorie côté public
    $okt->page->addButton('pagesCatsBtSt', array('permission' => $aCategoryData['active'] ? true : false, 'title' => __('c_c_action_Show'), 'url' => pagesHelpers::getCategoryUrl($aCategoryLocalesData[$okt->user->language]['slug']), 'ui-icon' => 'extlink'));
}
# Titre de la page
$okt->page->addGlobalTitle(__('m_pages_cats_categories'), 'module.php?m=pages&action=categories');
if ($iCategoryId) {
    $path = $okt->pages->categories->getPath($iCategoryId, true, $okt->user->language);
    while ($path->fetch()) {
        $okt->page->addGlobalTitle($path->title, 'module.php?m=pages&action=categories&do=edit&category_id=' . $path->id);
    }
} else {
    $okt->page->addGlobalTitle(__('m_pages_cats_add_category'));
}
# Lockable
$okt->page->lockable();
# Tabs
$okt->page->tabs();