| @@ -1,77 +1,77 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -// +----------------------------------------------------------------------+ | |
| 4 | -// | Copyright 2013 Madpixels (email : visualizer@madpixels.net) | | |
| 5 | -// +----------------------------------------------------------------------+ | |
| 6 | -// | This program is free software; you can redistribute it and/or modify | | |
| 7 | -// | it under the terms of the GNU General Public License, version 2, as | | |
| 8 | -// | published by the Free Software Foundation. | | |
| 9 | -// | | | |
| 10 | -// | This program is distributed in the hope that it will be useful, | | |
| 11 | -// | but WITHOUT ANY WARRANTY; without even the implied warranty of | | |
| 12 | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | |
| 13 | -// | GNU General Public License for more details. | | |
| 14 | -// | | | |
| 15 | -// | You should have received a copy of the GNU General Public License | | |
| 16 | -// | along with this program; if not, write to the Free Software | | |
| 17 | -// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, | | |
| 18 | -// | MA 02110-1301 USA | | |
| 19 | -// +----------------------------------------------------------------------+ | |
| 20 | -// | Author: Eugene Manuilov <eugene@manuilov.org> | | |
| 21 | -// +----------------------------------------------------------------------+ | |
| 22 | - | |
| 23 | -/** | |
| 24 | - * General module what setups all required environment. | |
| 25 | - * | |
| 26 | - * @category Visualizer | |
| 27 | - * @package Module | |
| 28 | - * | |
| 29 | - * @since 1.0.0 | |
| 30 | - */ | |
| 31 | -class Visualizer_Module_Setup extends Visualizer_Module { | |
| 32 | - | |
| 33 | - const NAME = __CLASS__; | |
| 34 | - | |
| 35 | - /** | |
| 36 | - * Constructor. | |
| 37 | - * | |
| 38 | - * @since 1.0.0 | |
| 39 | - * | |
| 40 | - * @access public | |
| 41 | - * @param Visualizer_Plugin $plugin The instance of the plugin. | |
| 42 | - */ | |
| 43 | - public function __construct( Visualizer_Plugin $plugin ) { | |
| 44 | - parent::__construct( $plugin ); | |
| 45 | - | |
| 46 | - $this->_addAction( 'init', 'setupCustomPostTypes' ); | |
| 47 | - $this->_addAction( 'plugins_loaded', 'loadTextDomain' ); | |
| 48 | - } | |
| 49 | - | |
| 50 | - /** | |
| 51 | - * Registers custom post type for charts. | |
| 52 | - * | |
| 53 | - * @since 1.0.0 | |
| 54 | - * @uses register_post_type() To register custom post type for charts. | |
| 55 | - * | |
| 56 | - * @access public | |
| 57 | - */ | |
| 58 | - public function setupCustomPostTypes() { | |
| 59 | - register_post_type( Visualizer_Plugin::CPT_VISUALIZER, array( | |
| 60 | - 'label' => 'Visualizer Charts', | |
| 61 | - 'public' => false, | |
| 62 | - ) ); | |
| 63 | - } | |
| 64 | - | |
| 65 | - /** | |
| 66 | - * Loads plugin text domain translations. | |
| 67 | - * | |
| 68 | - * @since 1.0.0 | |
| 69 | - * @uses load_plugin_textdomain() To load translations for the plugin. | |
| 70 | - * | |
| 71 | - * @access public | |
| 72 | - */ | |
| 73 | - public function loadTextDomain() { | |
| 74 | - load_plugin_textdomain( Visualizer_Plugin::NAME, false, dirname( plugin_basename( VISUALIZER_BASEFILE ) ) . '/languages/' ); | |
| 75 | - } | |
| 76 | - | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +// +----------------------------------------------------------------------+ | |
| 4 | +// | Copyright 2013 Madpixels (email : visualizer@madpixels.net) | | |
| 5 | +// +----------------------------------------------------------------------+ | |
| 6 | +// | This program is free software; you can redistribute it and/or modify | | |
| 7 | +// | it under the terms of the GNU General Public License, version 2, as | | |
| 8 | +// | published by the Free Software Foundation. | | |
| 9 | +// | | | |
| 10 | +// | This program is distributed in the hope that it will be useful, | | |
| 11 | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | | |
| 12 | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | |
| 13 | +// | GNU General Public License for more details. | | |
| 14 | +// | | | |
| 15 | +// | You should have received a copy of the GNU General Public License | | |
| 16 | +// | along with this program; if not, write to the Free Software | | |
| 17 | +// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, | | |
| 18 | +// | MA 02110-1301 USA | | |
| 19 | +// +----------------------------------------------------------------------+ | |
| 20 | +// | Author: Eugene Manuilov <eugene@manuilov.org> | | |
| 21 | +// +----------------------------------------------------------------------+ | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * General module what setups all required environment. | |
| 25 | + * | |
| 26 | + * @category Visualizer | |
| 27 | + * @package Module | |
| 28 | + * | |
| 29 | + * @since 1.0.0 | |
| 30 | + */ | |
| 31 | +class Visualizer_Module_Setup extends Visualizer_Module { | |
| 32 | + | |
| 33 | + const NAME = __CLASS__; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * Constructor. | |
| 37 | + * | |
| 38 | + * @since 1.0.0 | |
| 39 | + * | |
| 40 | + * @access public | |
| 41 | + * @param Visualizer_Plugin $plugin The instance of the plugin. | |
| 42 | + */ | |
| 43 | + public function __construct( Visualizer_Plugin $plugin ) { | |
| 44 | + parent::__construct( $plugin ); | |
| 45 | + | |
| 46 | + $this->_addAction( 'init', 'setupCustomPostTypes' ); | |
| 47 | + $this->_addAction( 'plugins_loaded', 'loadTextDomain' ); | |
| 48 | + } | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * Registers custom post type for charts. | |
| 52 | + * | |
| 53 | + * @since 1.0.0 | |
| 54 | + * @uses register_post_type() To register custom post type for charts. | |
| 55 | + * | |
| 56 | + * @access public | |
| 57 | + */ | |
| 58 | + public function setupCustomPostTypes() { | |
| 59 | + register_post_type( Visualizer_Plugin::CPT_VISUALIZER, array( | |
| 60 | + 'label' => 'Visualizer Charts', | |
| 61 | + 'public' => false, | |
| 62 | + ) ); | |
| 63 | + } | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * Loads plugin text domain translations. | |
| 67 | + * | |
| 68 | + * @since 1.0.0 | |
| 69 | + * @uses load_plugin_textdomain() To load translations for the plugin. | |
| 70 | + * | |
| 71 | + * @access public | |
| 72 | + */ | |
| 73 | + public function loadTextDomain() { | |
| 74 | + load_plugin_textdomain( Visualizer_Plugin::NAME, false, dirname( plugin_basename( VISUALIZER_BASEFILE ) ) . '/languages/' ); | |
| 75 | + } | |
| 76 | + | |
| 77 | 77 | } |