# log admin $okt->logAdmin->info(array('code' => 40, 'component' => 'galleries', 'message' => 'item #' . $aItemData['item']['id'])); $okt->redirect('module.php?m=galleries&action=edit&item_id=' . $aItemData['item']['id'] . '&added=1'); } catch (Exception $e) { $okt->error->set($e->getMessage()); } } } } /* Affichage ----------------------------------------------------------*/ # 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'));
$okt->logAdmin->info(array('code' => 40, 'component' => 'news', 'message' => 'category #' . $iCategoryId)); $okt->page->flashMessages->addSuccess(__('m_news_cat_added')); $okt->redirect('module.php?m=news&action=categories&do=edit&category_id=' . $iCategoryId); } catch (Exception $e) { $okt->error->set($e->getMessage()); } } } } /* Affichage ----------------------------------------------------------*/ # Liste des templates utilisables $oTemplatesList = new oktTemplatesSet($okt, $okt->news->config->templates['list'], 'news/list', 'list'); $aTplChoices = array_merge(array(' ' => null), $oTemplatesList->getUsablesTemplatesForSelect($okt->news->config->templates['list']['usables'])); $oItemsTemplatesList = new oktTemplatesSet($okt, $okt->news->config->templates['item'], 'news/item', 'item'); $aItemsTplChoices = array_merge(array(' ' => null), $oItemsTemplatesList->getUsablesTemplatesForSelect($okt->news->config->templates['item']['usables'])); # Calcul de la liste des parents possibles $aAllowedParents = array(__('m_news_cat_first_level') => 0); $aChildrens = array(); if ($iCategoryId) { $rsDescendants = $okt->news->categories->getDescendants($iCategoryId, true); while ($rsDescendants->fetch()) { $aChildrens[] = $rsDescendants->id; } } while ($rsCategories->fetch()) { if (!in_array($rsCategories->id, $aChildrens)) { $aAllowedParents[] = new formSelectOption(str_repeat(' ', $rsCategories->level - 1) . '• ' . html::escapeHTML($rsCategories->title), $rsCategories->id); } } # button set
if (!empty($iMenuId)) { $okt->page->addGlobalTitle(__('c_a_config_navigation_edit_menu')); } else { $okt->page->addGlobalTitle(__('c_a_config_navigation_add_menu')); } # button set $okt->page->setButtonset('navigationBtSt', array('id' => 'navigation-buttonset', 'type' => '', 'buttons' => array(array('permission' => true, 'title' => __('c_c_action_Go_back'), 'url' => 'configuration.php?action=navigation&do=index', 'ui-icon' => 'arrowreturnthick-1-w')))); if ($iMenuId) { # bouton add menu $okt->page->addButton('navigationBtSt', array('permission' => true, 'title' => __('c_a_config_navigation_add_menu'), 'url' => 'configuration.php?action=navigation&do=menu', 'ui-icon' => 'plusthick')); # bouton manage items $okt->page->addButton('navigationBtSt', array('permission' => true, 'title' => __('c_a_config_navigation_manage_items'), 'url' => 'configuration.php?action=navigation&do=items&menu_id=' . $iMenuId, 'ui-icon' => 'pencil')); } # Liste des templates utilisables $oTemplates = new oktTemplatesSet($okt, $okt->config->navigation_tpl, 'navigation', 'navigation'); $aTplChoices = array_merge(array(' ' => null), $oTemplates->getUsablesTemplatesForSelect($okt->config->navigation_tpl['usables'])); # En-tête require OKT_ADMIN_HEADER_FILE; ?> <?php echo $okt->page->getButtonSet('navigationBtSt'); ?> <?php if (!empty($iMenuId)) { ?> <h3><?php _e('c_a_config_navigation_edit_menu'); ?> </h3>