| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | // +----------------------------------------------------------------------+ |
| 3 | 4 | // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) | |
| 4 | 5 | // +----------------------------------------------------------------------+ |
| 5 | 6 | // | This program is free software; you can redistribute it and/or modify | |
| @@ -26,49 +27,40 @@ | ||
| 26 | 27 | * @since 1.0.0 |
| 27 | 28 | */ |
| 28 | 29 | class Visualizer_Plugin { |
| 29 | 30 | |
| 30 | - const NAME = 'visualizer'; | |
| 31 | - const VERSION = '3.0.7'; | |
| 31 | + const NAME = 'visualizer'; | |
| 32 | + const VERSION = '1.7.6'; | |
| 32 | 33 | |
| 33 | 34 | // custom post types |
| 34 | 35 | const CPT_VISUALIZER = 'visualizer'; |
| 35 | 36 | |
| 36 | 37 | // custom meta fields |
| 37 | - const CF_CHART_TYPE = 'visualizer-chart-type'; | |
| 38 | - const CF_SOURCE = 'visualizer-source'; | |
| 39 | - const CF_SERIES = 'visualizer-series'; | |
| 38 | + const CF_CHART_TYPE = 'visualizer-chart-type'; | |
| 39 | + const CF_SOURCE = 'visualizer-source'; | |
| 40 | + const CF_SERIES = 'visualizer-series'; | |
| 40 | 41 | const CF_DEFAULT_DATA = 'visualizer-default-data'; |
| 41 | - const CF_SETTINGS = 'visualizer-settings'; | |
| 42 | + const CF_SETTINGS = 'visualizer-settings'; | |
| 42 | 43 | |
| 43 | - const CF_SOURCE_FILTER = 'visualizer-source-filter'; | |
| 44 | - | |
| 45 | 44 | // custom actions |
| 46 | - const ACTION_GET_CHARTS = 'visualizer-get-charts'; | |
| 45 | + const ACTION_GET_CHARTS = 'visualizer-get-charts'; | |
| 47 | 46 | const ACTION_CREATE_CHART = 'visualizer-create-chart'; |
| 48 | - const ACTION_EDIT_CHART = 'visualizer-edit-chart'; | |
| 49 | - const ACTION_CLONE_CHART = 'visualizer-clone-chart'; | |
| 47 | + const ACTION_EDIT_CHART = 'visualizer-edit-chart'; | |
| 48 | + const ACTION_CLONE_CHART = 'visualizer-clone-chart'; | |
| 50 | 49 | const ACTION_DELETE_CHART = 'visualizer-delete-chart'; |
| 51 | - const ACTION_UPLOAD_DATA = 'visualizer-upload-data'; | |
| 50 | + const ACTION_UPLOAD_DATA = 'visualizer-upload-data'; | |
| 52 | 51 | // Added by Ash/Upwork |
| 53 | - const ACTION_EXPORT_DATA = 'visualizer-export-data'; | |
| 52 | + const ACTION_EXPORT_DATA = 'visualizer-export-data'; | |
| 54 | 53 | |
| 55 | - /** | |
| 56 | - *Action used for fetching specific users/roles for permissions. | |
| 57 | - */ | |
| 58 | - const ACTION_FETCH_PERMISSIONS_DATA = 'visualizer-fetch-permissions-data'; | |
| 59 | - | |
| 60 | 54 | // custom filters |
| 61 | 55 | const FILTER_CHART_WRAPPER_CLASS = 'visualizer-chart-wrapper-class'; |
| 62 | - const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series'; | |
| 63 | - const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data'; | |
| 64 | - const FILTER_GET_CHART_SETTINGS = 'visualizer-get-chart-settings'; | |
| 56 | + const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series'; | |
| 57 | + const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data'; | |
| 58 | + const FILTER_GET_CHART_SETTINGS = 'visualizer-get-chart-settings'; | |
| 65 | 59 | |
| 66 | - const CF_CHART_URL = 'visualizer-chart-url'; | |
| 67 | - const CF_CHART_SCHEDULE = 'visualizer-chart-schedule'; | |
| 68 | 60 | // Added by Ash/Upwork |
| 69 | - const PRO_TEASER_URL = 'http://themeisle.com/plugins/visualizer-charts-and-graphs-pro-addon/'; | |
| 70 | - const PRO_TEASER_TITLE = 'Check PRO version '; | |
| 61 | + const PRO_TEASER_URL = 'http://themeisle.com/plugins/visualizer-charts-and-graphs-pro-addon/'; | |
| 62 | + const PRO_TEASER_TITLE = 'Check PRO version '; | |
| 71 | 63 | // Added by Ash/Upwork |
| 72 | 64 | /** |
| 73 | 65 | * Singletone instance of the plugin. |
| 74 | 66 | * |
| @@ -95,12 +87,20 @@ | ||
| 95 | 87 | * @since 1.0.0 |
| 96 | 88 | * |
| 97 | 89 | * @access private |
| 98 | 90 | */ |
| 99 | - private function __construct() { | |
| 100 | - } | |
| 91 | + private function __construct() {} | |
| 101 | 92 | |
| 102 | 93 | /** |
| 94 | + * Private clone method. | |
| 95 | + * | |
| 96 | + * @since 1.0.0 | |
| 97 | + * | |
| 98 | + * @access private | |
| 99 | + */ | |
| 100 | + private function __clone() {} | |
| 101 | + | |
| 102 | + /** | |
| 103 | 103 | * Returns singletone instance of the plugin. |
| 104 | 104 | * |
| 105 | 105 | * @since 1.0.0 |
| 106 | 106 | * |
| @@ -116,31 +116,14 @@ | ||
| 116 | 116 | return self::$_instance; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | - * Returns chart types. | |
| 121 | - * | |
| 122 | - * @since 1.0.0 | |
| 123 | - * | |
| 124 | - * @static | |
| 125 | - * @access public | |
| 126 | - * @return array | |
| 127 | - */ | |
| 128 | - public static function getChartTypes() { | |
| 129 | - $array = array_keys( Visualizer_Module_Admin::_getChartTypesLocalized() ); | |
| 130 | - | |
| 131 | - return $array; | |
| 132 | - } | |
| 133 | - | |
| 134 | - /** | |
| 135 | 120 | * Returns a module if it was registered before. Otherwise NULL. |
| 136 | 121 | * |
| 137 | 122 | * @since 1.0.0 |
| 138 | 123 | * |
| 139 | 124 | * @access public |
| 140 | - * | |
| 141 | 125 | * @param string $name The name of the module to return. |
| 142 | - * | |
| 143 | 126 | * @return Visualizer_Module|null Returns a module if it was registered or NULL. |
| 144 | 127 | */ |
| 145 | 128 | public function getModule( $name ) { |
| 146 | 129 | return isset( $this->_modules[ $name ] ) ? $this->_modules[ $name ] : null; |
| @@ -151,11 +134,9 @@ | ||
| 151 | 134 | * |
| 152 | 135 | * @since 1.0.0 |
| 153 | 136 | * |
| 154 | 137 | * @access public |
| 155 | - * | |
| 156 | 138 | * @param string $name The name of a module to check. |
| 157 | - * | |
| 158 | 139 | * @return boolean TRUE if the module has been registered. Otherwise FALSE. |
| 159 | 140 | */ |
| 160 | 141 | public function hasModule( $name ) { |
| 161 | 142 | return isset( $this->_modules[ $name ] ); |
| @@ -166,9 +147,8 @@ | ||
| 166 | 147 | * |
| 167 | 148 | * @since 1.0.0 |
| 168 | 149 | * |
| 169 | 150 | * @access public |
| 170 | - * | |
| 171 | 151 | * @param string $class The name of the module to use in the plugin. |
| 172 | 152 | */ |
| 173 | 153 | public function setModule( $class ) { |
| 174 | 154 | $this->_modules[ $class ] = new $class( $this ); |
| @@ -174,14 +154,18 @@ | ||
| 174 | 154 | $this->_modules[ $class ] = new $class( $this ); |
| 175 | 155 | } |
| 176 | 156 | |
| 177 | 157 | /** |
| 178 | - * Private clone method. | |
| 158 | + * Returns chart types. | |
| 179 | 159 | * |
| 180 | 160 | * @since 1.0.0 |
| 181 | 161 | * |
| 182 | - * @access private | |
| 162 | + * @static | |
| 163 | + * @access public | |
| 164 | + * @return array | |
| 183 | 165 | */ |
| 184 | - private function __clone() { | |
| 166 | + public static function getChartTypes() { | |
| 167 | + $array = array_keys( Visualizer_Module_Admin::_getChartTypesLocalized() ); | |
| 168 | + return $array; | |
| 185 | 169 | } |
| 186 | 170 | |
| 187 | 171 | } |