Пример #1
0
         */
        public function initPlugin()
        {
            self::registerSlideshowPostType();
            self::registerSlideshowTaxonomy();
        }
        /**
         * Register the slideshow post type
         *
         */
        private function registerSlideshowPostType()
        {
            //register the slide post type
            $labels = array('name' => __('Slides', 'in-slideshow-plugin'), 'singular_name' => __('Slide', 'in-slideshow-plugin'), 'add_new' => __('Add New', 'in-slideshow-plugin'), 'add_new_item' => __('Add New Slide', 'in-slideshow-plugin'), 'edit_item' => __('Edit Slide', 'in-slideshow-plugin'), 'new_item' => __('New Slide', 'in-slideshow-plugin'), 'all_items' => __('All Slides', 'in-slideshow-plugin'), 'view_item' => __('View Slideshow', 'in-slideshow-plugin'), 'search_items' => __('Search Slides', 'in-slideshow-plugin'), 'not_found' => __('No slides found', 'in-slideshow-plugin'), 'not_found_in_trash' => __('No slides found in Trash', 'in-slideshow-plugin'), 'menu_name' => __('Slideshow', 'innd-slideshow-plugin'));
            $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'rewrite' => array('slug' => 'slide'), 'supports' => array('title', 'thumbnail'));
            //Register the slide custom  post type
            register_post_type(self::SLIDESHOW_POST_TYPE, $args);
        }
        /**
         * Register the slideshow taxonomy
         *
         */
        private function registerSlideshowTaxonomy()
        {
            register_taxonomy(self::SLIDESHOW_TAXONOMY_TYPE, 'in-slideshow', array('hierarchical' => true, 'label' => 'Slideshow Group', 'query_var' => true, 'rewrite' => true, 'show_ui' => true, 'show_admin_column' => true));
        }
    }
}
// Get the slideshow controller singleton
$slideshowController = SlideshowController::getSingleton();
Пример #2
0
<?php

include_once "../lib/classes/Properties.php";
include_once SITE_PATH . '/lib/classes/Template.php';
include_once SITE_PATH . '/lib/classes/SlideshowService.php';
include_once SITE_PATH . '/lib/classes/Slideshow.php';
include_once SITE_PATH . '/lib/classes/SlideshowController.php';
$controller = new SlideshowController();
$template = $controller->handleRequest($_GET, $_POST);
$template->render($template->template);