Пример #1
0
 /**
  * @desc Return the categories manager.
  */
 public static function get_categories_manager()
 {
     if (self::$categories_manager === null) {
         $categories_items_parameters = new CategoriesItemsParameters();
         $categories_items_parameters->set_table_name_contains_items(GallerySetup::$gallery_table);
         $categories_items_parameters->set_field_name_id_category('idcat');
         self::$categories_manager = new CategoriesManager(GalleryCategoriesCache::load(), $categories_items_parameters);
     }
     return self::$categories_manager;
 }
 function main_class($site)
 {
     $this->site = $site;
     $this->engine = $this->site->engine;
     if (!empty($site->get[0])) {
         $site->content = engine::error();
         return;
     }
     $this->site->content = $this->render('main/gallery.php', ['img_list' => GalleryService::custom_get_image_paths(10)]);
     $this->site->content .= $this->render('main/text.php');
     $this->site->content .= $this->render('main/preview.php', ['previews' => PreviewService::getPreviews()]);
     $this->site->content .= $this->render('main/signup.php');
 }
    function get_feed_data_struct($idcat = 0, $name = '')
    {
        if (GalleryService::get_categories_manager()->get_categories_cache()->category_exists($idcat)) {
            $category = GalleryService::get_categories_manager()->get_categories_cache()->get_category($idcat);
            $config = GalleryConfig::load();
            $site_name = GeneralConfig::load()->get_site_name();
            $site_name = $idcat != Category::ROOT_CATEGORY ? $site_name . ' : ' . $category->get_name() : $site_name;
            $feed_module_name = LangLoader::get_message('module_title', 'common', 'gallery');
            $data = new FeedData();
            $data->set_title($feed_module_name . ' - ' . $site_name);
            $data->set_date(new Date());
            $data->set_link(SyndicationUrlBuilder::rss('gallery', $idcat));
            $data->set_host(HOST);
            $data->set_desc($feed_module_name . ' - ' . $site_name);
            $data->set_lang(LangLoader::get_message('xml_lang', 'main'));
            $data->set_auth_bit(Category::READ_AUTHORIZATIONS);
            $categories = GalleryService::get_categories_manager()->get_childrens($idcat, new SearchCategoryChildrensOptions(), true);
            $ids_categories = array_keys($categories);
            $results = PersistenceContext::get_querier()->select('SELECT *
				FROM ' . GallerySetup::$gallery_table . '
				WHERE idcat IN :ids_categories
				ORDER BY timestamp DESC
				LIMIT :pics_number_per_page', array('ids_categories' => $ids_categories, 'pics_number_per_page' => $config->get_pics_number_per_page()));
            foreach ($results as $row) {
                $link = TextHelper::htmlentities(GalleryUrlBuilder::get_link_item($row['idcat'], $row['id']));
                $item = new FeedItem();
                $item->set_title($row['name']);
                $item->set_link($link);
                $item->set_guid($link);
                $item->set_date(new Date($row['timestamp'], Timezone::SERVER_TIMEZONE));
                $item->set_image_url(Url::to_rel('/gallery/pics/' . $row['path']));
                $item->set_auth(GalleryService::get_categories_manager()->get_heritated_authorizations($row['idcat'], Category::READ_AUTHORIZATIONS, Authorizations::AUTH_PARENT_PRIORITY));
                $data->add_item($item);
            }
            $results->dispose();
            return $data;
        }
    }
Пример #4
0
 /**
  * Returns the associative array with all of the lists required to
  * render the html select elements on the detail page.
  *
  * @return array An associative array of option values
  */
 private function getDetailOptions()
 {
     global $logger;
     $logger->debug(get_class($this) . '::getDetailOptions()');
     $options = array();
     $evs = $this->getEnumeratedValueService();
     $pub = $evs->fetch('PublicationState');
     $logger->debug("Number of PubStates: " . count($pub['PublicationState']));
     $options['pubState'] = $pub['PublicationState'];
     $status = $evs->fetch('EventStatus');
     $logger->debug("Number of EventStatus: " . count($status['EventStatus']));
     $options['eventStatus'] = $status['EventStatus'];
     $es = $this->getEventService();
     $exbt = $es->getEventsByPubState('Exhibition');
     $logger->debug("Number of Exhibitions: " . count($exbt));
     $options['exhibition'] = $exbt;
     $crse = $es->getEventsByPubState('Course');
     $logger->debug("Number of Courses: " . count($crse));
     $options['course'] = $crse;
     $vs = $this->getVenueService();
     $vnue = $vs->getVenuesByPubState();
     $logger->debug("Number of Venues: " . count($vnue));
     $options['venue'] = $vnue;
     $gc = $es->getCategories('Genre');
     $logger->debug("Number of Genres: " . count($gc));
     $options['genre'] = $gc;
     $ac = $es->getCategories('Audience');
     $logger->debug("Number of Audiences: " . count($ac));
     $options['audience'] = $ac;
     $sc = $es->getCategories('Series');
     $logger->debug("Number of Series: " . count($sc));
     $options['series'] = $sc;
     $ss = $this->getScheduleService();
     $month = $ss->getMonthArray();
     $logger->debug("Number of Months: " . count($month));
     $options['month'] = $month;
     $year = $ss->getYearArray(1, 1);
     $logger->debug("Number of Years: " . count($year));
     $options['year'] = $year;
     $day = $ss->getDayArray();
     $logger->debug("Number of Days: " . count($day));
     $options['day'] = $day;
     $hour = $ss->getHourArray();
     $logger->debug("Number of Hours: " . count($hour));
     $options['hour'] = $hour;
     $minute = $ss->getMinuteArray(MINUTE_INTERVAL);
     $logger->debug("Number of Minutes: " . count($minute));
     $options['minute'] = $minute;
     $ampm = $ss->getAmpmArray();
     $logger->debug("Number of am/pm: " . count($ampm));
     $options['ampm'] = $ampm;
     $gs = new GalleryService();
     $gal = $gs->getCategories(Event::PROGRAM);
     $logger->debug("Number of Galleries: " . count($gal));
     $options['gallery'] = $gal;
     $jcs = $this->getJoomlaContentService();
     $prart = $jcs->getArticlesByCategory(PRESS_ACTIVE_CATEGORY_ID);
     $options['pressrelease'] = $prart;
     $caart = $jcs->getArticlesByCategory(COMMENT_ARTICLE_CATEGORY_ID);
     //$logger->debug("Number of Articles for Comment Article Category: ". count($caart) ." first item: ". $caart[0]->getTitle());
     $options['commentarticle'] = $caart;
     $relcat = $jcs->getCategoriesBySection(PRGM_CONTENT_SECTION_ID);
     $options['relatedcategory'] = $relcat;
     return $options;
 }
Пример #5
0
        $config->disable_views_counter();
    }
    if (retrieve(POST, 'author_displayed', '')) {
        $config->enable_author_display();
    } else {
        $config->disable_author_display();
    }
    $config->set_member_max_pics_number(retrieve(POST, 'member_max_pics_number', 0));
    $config->set_moderator_max_pics_number(retrieve(POST, 'moderator_max_pics_number', 0));
    $config->set_pics_enlargement_mode(retrieve(POST, 'pics_enlargement_mode', GalleryConfig::FULL_SCREEN));
    $config->set_scroll_type(retrieve(POST, 'scroll_type', GalleryConfig::VERTICAL_DYNAMIC_SCROLL));
    $config->set_pics_number_in_mini(retrieve(POST, 'pics_number_in_mini', 8));
    $config->set_mini_pics_speed(retrieve(POST, 'mini_pics_speed', 6));
    $config->set_authorizations(Authorizations::build_auth_array_from_form(Category::READ_AUTHORIZATIONS, Category::WRITE_AUTHORIZATIONS, Category::MODERATION_AUTHORIZATIONS));
    GalleryConfig::save();
    GalleryService::get_categories_manager()->regenerate_cache();
    ###### Régénération du cache de la gallery #######
    GalleryMiniMenuCache::invalidate();
    AppContext::get_response()->redirect(HOST . REWRITED_SCRIPT);
} elseif ($gallery_cache) {
    //Recréaction miniatures, et inscrustation du logo sur image.
    $Gallery = new Gallery();
    $Gallery->Clear_cache();
    GalleryMiniMenuCache::invalidate();
    AppContext::get_response()->redirect('/gallery/admin_gallery_config.php');
} else {
    $tpl = new FileTemplate('gallery/admin_gallery_config.tpl');
    //Vitesse de défilement des miniatures.
    $mini_pics_speed = '';
    for ($i = 1; $i <= 10; $i++) {
        $selected = $config->get_mini_pics_speed() == $i ? ' selected="selected"' : '';
Пример #6
0
 /**
  * Returns the associative array with all of the lists required to
  * render the html select elements on the detail page.
  *
  * @return array An associative array of option values
  */
 private function getDetailOptions()
 {
     global $logger;
     $logger->debug(get_class($this) . '::getDetailOptions()');
     $options = array();
     $evs = $this->getEnumeratedValueService();
     $pub = $evs->fetch('PublicationState');
     $options['pubState'] = $pub['PublicationState'];
     $gs = new GalleryService();
     $gal = $gs->getChildAlbums(Person::ARTIST);
     $options['gallery'] = $gal;
     $es = $this->getEventService();
     $exbt = $es->getEventsByPubState('Exhibition');
     $options['exhibition'] = $exbt;
     return $options;
 }
 public function __construct()
 {
     parent::__construct(GalleryService::get_categories_manager());
 }
Пример #8
0
 /**
  * Returns the associative array with all of the lists required to 
  * render the html select elements on the detail page.
  * 
  * @return array An associative array of option values
  */
 private function getDetailOptions()
 {
     global $logger;
     $logger->debug(get_class($this) . '::getDetailOptions()');
     $options = array();
     $evs = $this->getEnumeratedValueService();
     $pub = $evs->fetch('PublicationState');
     $logger->debug("Number of PubStates: " . count($pub['PublicationState']));
     $options['pubState'] = $pub['PublicationState'];
     $status = $evs->fetch('EventStatus');
     $logger->debug("Number of EventStatus: " . count($status['EventStatus']));
     $options['eventStatus'] = $status['EventStatus'];
     $es = $this->getEventService();
     $exbt = $es->getEventsByPubState('Exhibition');
     $logger->debug("Number of Exhibitions: " . count($exbt));
     $options['exhibition'] = $exbt;
     $prgm = $es->getEventsByPubState('Program');
     $logger->debug("Number of Programs: " . count($prgm));
     $options['program'] = $prgm;
     $vs = $this->getVenueService();
     $vnue = $vs->getVenuesByPubState();
     $logger->debug("Number of Venues: " . count($vnue));
     $options['venue'] = $vnue;
     $gc = $es->getCategories('Genre');
     $logger->debug("Number of Genres: " . count($gc));
     $options['genre'] = $gc;
     $ac = $es->getCategories('Audience');
     $logger->debug("Number of Audiences: " . count($ac));
     $options['audience'] = $ac;
     $sc = $es->getCategories('Series');
     $logger->debug("Number of Series: " . count($sc));
     $options['series'] = $sc;
     $ss = $this->getScheduleService();
     $month = $ss->getMonthArray();
     $logger->debug("Number of Months: " . count($month));
     $options['month'] = $month;
     $year = $ss->getYearArray(1, 1);
     $logger->debug("Number of Years: " . count($year));
     $options['year'] = $year;
     $day = $ss->getDayArray();
     $logger->debug("Number of Days: " . count($day));
     $options['day'] = $day;
     $hour = $ss->getHourArray();
     $logger->debug("Number of Hours: " . count($hour));
     $options['hour'] = $hour;
     $minute = $ss->getMinuteArray(MINUTE_INTERVAL);
     $logger->debug("Number of Minutes: " . count($minute));
     $options['minute'] = $minute;
     $ampm = $ss->getAmpmArray();
     $logger->debug("Number of am/pm: " . count($ampm));
     $options['ampm'] = $ampm;
     $gs = new GalleryService();
     $gal = $gs->getCategories(Event::COURSE);
     $logger->debug("Number of Galleries: " . count($gal));
     $options['gallery'] = $gal;
     return $options;
 }
Пример #9
0
                 $width = $width_source;
                 $height = $height_source;
             }
         }
         //On genère le tableau pour x colonnes
         $tr_start = is_int($j / $nbr_column_pics) ? '<tr>' : '';
         $j++;
         $tr_end = is_int($j / $nbr_column_pics) ? '</tr>' : '';
         //On raccourci le nom du fichier pour ne pas déformer l'administration.
         $name = strlen($pics) > 20 ? substr($pics, 0, 20) . '...' : $pics;
         //Si la miniature n'existe pas (cache vidé) on regénère la miniature à partir de l'image en taille réelle.
         if (!file_exists('pics/thumbnails/' . $pics) && file_exists('pics/' . $pics)) {
             $Gallery->Resize_pics('pics/' . $pics);
         }
         //Redimensionnement + création miniature
         $categories_tree = GalleryService::get_categories_manager()->get_select_categories_form_field($j . 'cat', '', Category::ROOT_CATEGORY, $search_category_children_options);
         $method = new ReflectionMethod('AbstractFormFieldChoice', 'get_options');
         $method->setAccessible(true);
         $categories_tree_options = $method->invoke($categories_tree);
         $categories_list = '';
         foreach ($categories_tree_options as $option) {
             $categories_list .= $option->display()->render();
         }
         $tpl->assign_block_vars('list', array('ID' => $j, 'THUMNAILS' => '<img src="pics/thumbnails/' . $pics . '" alt="' . $pics . '" />', 'NAME' => $pics, 'UNIQ_NAME' => $pics, 'TR_START' => $tr_start, 'TR_END' => $tr_end, 'CATEGORIES' => $categories_list));
     }
     //Création des cellules du tableau si besoin est.
     while (!is_int($j / $nbr_column_pics)) {
         $j++;
         $tpl->assign_block_vars('end_td_pics', array('TD_END' => '<td style="width:' . $column_width_pics . '%;padding:0">&nbsp;</td>', 'TR_END' => is_int($j / $nbr_column_pics) ? '</tr>' : ''));
     }
 }
Пример #10
0
        $tpl->assign_block_vars('image_up', array('NAME' => stripslashes($imageup['name']), 'IMG' => '<a href="gallery.php?cat=' . $imageup['idcat'] . '&amp;id=' . $g_idpics . '#pics_max"><img src="pics/' . $imageup['path'] . '" alt="' . $imageup['name'] . '" /></a>', 'L_SUCCESS_UPLOAD' => $LANG['success_upload_img'], 'U_CAT' => '<a href="gallery.php?cat=' . $imageup['idcat'] . '">' . $categories[$imageup['idcat']]->get_name() . '</a>'));
    }
    //Affichage du quota d'image uploadée.
    $category_authorizations = GalleryService::get_categories_manager()->get_heritated_authorizations($id_category, Category::WRITE_AUTHORIZATIONS, Authorizations::AUTH_PARENT_PRIORITY);
    $quota = isset($category_authorizations['r-1']) ? $category_authorizations['r-1'] != '3' : true;
    if ($quota) {
        switch (AppContext::get_current_user()->get_level()) {
            case 2:
                $l_pics_quota = $LANG['illimited'];
                break;
            case 1:
                $l_pics_quota = $config->get_moderator_max_pics_number();
                break;
            default:
                $l_pics_quota = $config->get_member_max_pics_number();
        }
        $nbr_upload_pics = $Gallery->get_nbr_upload_pics(AppContext::get_current_user()->get_id());
        $tpl->assign_block_vars('image_quota', array('L_IMAGE_QUOTA' => sprintf($LANG['image_quota'], $nbr_upload_pics, $l_pics_quota)));
    }
    $search_category_children_options = new SearchCategoryChildrensOptions();
    $search_category_children_options->add_authorizations_bits(Category::READ_AUTHORIZATIONS);
    $search_category_children_options->add_authorizations_bits(Category::WRITE_AUTHORIZATIONS);
    $tpl->put_all(array('CAT_ID' => $id_category, 'GALLERY' => !empty($id_category) ? $categories[$id_category]->get_name() : $LANG['gallery'], 'CATEGORIES_TREE' => GalleryService::get_categories_manager()->get_select_categories_form_field('cat', LangLoader::get_message('form.category', 'common'), $id_category, $search_category_children_options)->display()->render(), 'WIDTH_MAX' => $config->get_max_width(), 'HEIGHT_MAX' => $config->get_max_height(), 'WEIGHT_MAX' => $config->get_max_weight(), 'IMG_FORMAT' => 'JPG, PNG, GIF', 'L_IMG_FORMAT' => $LANG['img_format'], 'L_WIDTH_MAX' => $LANG['width_max'], 'L_HEIGHT_MAX' => $LANG['height_max'], 'L_WEIGHT_MAX' => $LANG['weight_max'], 'L_ADD_IMG' => $LANG['add_pic'], 'L_GALLERY' => $LANG['gallery'], 'L_GALLERY_INDEX' => $LANG['gallery_index'], 'L_CATEGORIES' => $LANG['categories'], 'L_NAME' => $LANG['name'], 'L_UNIT_PX' => LangLoader::get_message('unit.pixels', 'common'), 'L_UNIT_KO' => LangLoader::get_message('unit.kilobytes', 'common'), 'L_UPLOAD' => $LANG['upload_img'], 'U_GALLERY_CAT_LINKS' => $cat_links, 'U_GALLERY_ACTION_ADD' => GalleryUrlBuilder::get_link_cat_add($id_category, null, AppContext::get_session()->get_token()), 'U_INDEX' => url('.php')));
    $tpl->display();
} else {
    $module = AppContext::get_extension_provider_service()->get_provider('gallery');
    if ($module->has_extension_point(HomePageExtensionPoint::EXTENSION_POINT)) {
        echo $module->get_extension_point(HomePageExtensionPoint::EXTENSION_POINT)->get_home_page()->get_view()->display();
    }
}
require_once '../kernel/footer.php';
Пример #11
0
         $display_link = HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&amp;cat=' . $row['idcat']);
     } elseif ($config->get_pics_enlargement_mode() == GalleryConfig::POPUP) {
         //Ouverture en popup simple.
         $display_link = 'javascript:display_pics_popup(\'' . HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&amp;cat=' . $row['idcat']) . '\', \'' . $row['width'] . '\', \'' . $row['height'] . '\')';
     } elseif ($config->get_pics_enlargement_mode() == GalleryConfig::RESIZE) {
         //Ouverture en agrandissement simple.
         $display_link = 'javascript:display_pics(' . $row['id'] . ', \'' . HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&amp;cat=' . $row['idcat']) . '\', 0)';
     } else {
         //Ouverture nouvelle page.
         $display_link = 'admin_gallery.php?cat=' . $row['idcat'] . '&amp;id=' . $row['id'] . '#pics_max';
     }
     //Liste des catégories.
     $search_category_children_options = new SearchCategoryChildrensOptions();
     $search_category_children_options->add_authorizations_bits(Category::READ_AUTHORIZATIONS);
     $search_category_children_options->add_authorizations_bits(Category::WRITE_AUTHORIZATIONS);
     $categories_tree = GalleryService::get_categories_manager()->get_select_categories_form_field($row['id'] . 'cat', '', $row['idcat'], $search_category_children_options);
     $method = new ReflectionMethod('AbstractFormFieldChoice', 'get_options');
     $method->setAccessible(true);
     $categories_tree_options = $method->invoke($categories_tree);
     $cat_list = '';
     foreach ($categories_tree_options as $option) {
         $cat_list .= $option->display()->render();
     }
     $group_color = User::get_group_color($row['groups'], $row['level']);
     $tpl->assign_block_vars('pics.list', array('C_APPROVED' => $row['aprob'], 'ID' => $row['id'], 'IMG' => '<img src="pics/thumbnails/' . $row['path'] . '" alt="' . $name . '" />', 'PATH' => $row['path'], 'NAME' => stripslashes($name_cut), 'TITLE' => stripslashes($row['name']), 'RENAME_FILE' => '<span id="fihref' . $row['id'] . '"><a href="javascript:display_rename_file(\'' . $row['id'] . '\', \'' . addslashes($row['name']) . '\', \'' . addslashes($name_cut) . '\');" title="' . LangLoader::get_message('edit', 'common') . '" class="fa fa-edit"></a></span>', 'TR_START' => $tr_start, 'TR_END' => $tr_end, 'CAT' => $cat_list, 'U_DISPLAY' => $display_link, 'U_POSTOR' => $LANG['by'] . ' <a class="' . UserService::get_level_class($row['level']) . '"' . (!empty($group_color) ? ' style="color:' . $group_color . '"' : '') . ' href="' . UserUrlBuilder::profile($row['user_id'])->rel() . '">' . $row['display_name'] . '</a>'));
 }
 $result->dispose();
 //Création des cellules du tableau si besoin est.
 while (!is_int($j / $nbr_column_pics)) {
     $j++;
     $tpl->assign_block_vars('pics.end_td_pics', array('TD_END' => '<td style="width:' . $column_width_pics . '%">&nbsp;</td>', 'TR_END' => is_int($j / $nbr_column_pics) ? '</tr>' : ''));
 private function is_authorized($bit, $mode = Authorizations::AUTH_CHILD_PRIORITY)
 {
     $auth = GalleryService::get_categories_manager()->get_heritated_authorizations($this->id_category, $bit, $mode);
     return AppContext::get_current_user()->check_auth($auth, $bit);
 }
Пример #13
0
AppContext::get_session()->no_session_location();
//Permet de ne pas mettre jour la page dans la session.
include_once '../gallery/gallery_begin.php';
require_once '../kernel/header_no_display.php';
if (AppContext::get_current_user()->is_readonly()) {
    exit;
}
$config = GalleryConfig::load();
$request = AppContext::get_request();
$increment_view = $request->get_getint('increment_view', 0);
$rename_pics = $request->get_getint('rename_pics', 0);
$aprob_pics = $request->get_getint('aprob_pics', 0);
$id_file = $request->get_postint('id_file', 0);
//Notation.
if (!empty($increment_view)) {
    $categories = GalleryService::get_categories_manager()->get_categories_cache()->get_categories();
    $g_idpics = $request->get_getint('id', 0);
    $g_idcat = $request->get_getint('cat', 0);
    if (empty($g_idpics) || !empty($g_idcat) && !isset($categories[$g_idcat])) {
        exit;
    }
    //Niveau d'autorisation de la catégorie
    if (!GalleryAuthorizationsService::check_authorizations($g_idcat)->read()) {
        exit;
    }
    //Mise à jour du nombre de vues.
    PersistenceContext::get_querier()->inject("UPDATE " . GallerySetup::$gallery_table . " SET views = views + 1 WHERE idcat = :idcat AND id = :id", array('idcat' => $g_idcat, 'id' => $g_idpics));
} else {
    AppContext::get_session()->csrf_get_protect();
    //Protection csrf
    if (!empty($rename_pics)) {
 private function generate_response()
 {
     $response = new SiteDisplayResponse($this->tpl);
     $graphical_environment = $response->get_graphical_environment();
     $graphical_environment->set_page_title($this->get_category()->get_name(), $this->lang['module_title']);
     $graphical_environment->get_seo_meta_data()->set_description($this->get_category()->get_description());
     $graphical_environment->get_seo_meta_data()->set_canonical_url(GalleryUrlBuilder::display_category($this->get_category()->get_id(), $this->get_category()->get_rewrited_name(), AppContext::get_request()->get_getint('page', 1)));
     $breadcrumb = $graphical_environment->get_breadcrumb();
     $breadcrumb->add($this->lang['module_title'], GalleryUrlBuilder::home());
     $categories = array_reverse(GalleryService::get_categories_manager()->get_parents($this->get_category()->get_id(), true));
     foreach ($categories as $id => $category) {
         if ($category->get_id() != Category::ROOT_CATEGORY) {
             $breadcrumb->add($category->get_name(), GalleryUrlBuilder::display_category($category->get_id(), $category->get_rewrited_name()));
         }
     }
     return $response;
 }
Пример #15
0
 /**
  * Returns the associative array with all of the lists required to
  * render the html select elements on the detail page.
  *
  * @return array An associative array of option values
  */
 private function getDetailOptions()
 {
     global $logger;
     $logger->debug(get_class($this) . '::getDetailOptions()');
     $options = array();
     $evs = $this->getEnumeratedValueService();
     $pub = $evs->fetch('PublicationState');
     $logger->debug("Number of PubStates: " . count($pub['PublicationState']));
     $options['pubState'] = $pub['PublicationState'];
     $es = $this->getEventService();
     $exbt = $es->getEventsByPubState('Exhibition');
     $logger->debug("Number of Exhibitions: " . count($exbt));
     $options['exhibition'] = $exbt;
     $prgm = $es->getEventsByPubState('Program');
     $logger->debug("Number of Programs: " . count($prgm));
     $options['program'] = $prgm;
     $crse = $es->getEventsByPubState('Course');
     $logger->debug("Number of Courses: " . count($crse));
     $options['course'] = $crse;
     $gs = new GalleryService();
     $gal = $gs->getCategories(Venue::VENUE);
     $logger->debug("Number of Galleries: " . count($gal));
     $options['gallery'] = $gal;
     return $options;
 }
 protected function get_categories_manager()
 {
     return GalleryService::get_categories_manager();
 }
Пример #17
0
 *
 ###################################################*/
if (defined('PHPBOOST') !== true) {
    exit;
}
load_module_lang('gallery');
//Chargement de la langue du module.
//Création de l'arborescence des catégories.
$module_title = LangLoader::get_message('module_title', 'common', 'gallery');
$Bread_crumb->add($module_title, GalleryUrlBuilder::home());
$id_category = AppContext::get_request()->get_getint('cat', 0);
if (!empty($id_category)) {
    try {
        $category = GalleryService::get_categories_manager()->get_categories_cache()->get_category($id_category);
    } catch (CategoryNotFoundException $e) {
        $error_controller = PHPBoostErrors::unexisting_page();
        DispatchManager::redirect($error_controller);
    }
} else {
    $category = GalleryService::get_categories_manager()->get_categories_cache()->get_category(Category::ROOT_CATEGORY);
}
$parent_categories = array_reverse(GalleryService::get_categories_manager()->get_parents($id_category));
foreach ($parent_categories as $cat) {
    if ($cat->get_id() != Category::ROOT_CATEGORY) {
        $Bread_crumb->add($cat->get_name(), url('gallery.php?cat=' . $cat->get_id(), 'gallery-' . $cat->get_id() . '.php'));
    }
}
define('TITLE', $module_title . ($category->get_id() != Category::ROOT_CATEGORY ? ' - ' . $category->get_name() : ''));
if ($category->get_id() != Category::ROOT_CATEGORY) {
    $Bread_crumb->add($category->get_name(), url('gallery.php?cat=' . $category->get_id(), 'gallery-' . $category->get_id() . '.php'));
}