Changeset 2239071
- Timestamp:
- 02/05/2020 01:26:39 PM (6 years ago)
- Location:
- century-toolkit
- Files:
-
- 92 added
- 16 deleted
- 3 edited
-
tags/1.0.6 (added)
-
tags/1.0.6/assets (added)
-
tags/1.0.6/assets/css (added)
-
tags/1.0.6/assets/css/main.css (added)
-
tags/1.0.6/assets/js (added)
-
tags/1.0.6/assets/js/main.js (added)
-
tags/1.0.6/century-toolkit.php (added)
-
tags/1.0.6/i18n (added)
-
tags/1.0.6/i18n/languages (added)
-
tags/1.0.6/i18n/languages/century-toolkit.pot (added)
-
tags/1.0.6/includes (added)
-
tags/1.0.6/includes/abstracts (added)
-
tags/1.0.6/includes/abstracts/abstract-tcy-theme-demo.php (added)
-
tags/1.0.6/includes/admin (added)
-
tags/1.0.6/includes/admin/class-tcy-admin-demo-config.php (added)
-
tags/1.0.6/includes/admin/class-tcy-admin.php (added)
-
tags/1.0.6/includes/class-century-toolkit.php (added)
-
tags/1.0.6/includes/class-tcy-ajax.php (added)
-
tags/1.0.6/includes/class-tcy-autoloader.php (added)
-
tags/1.0.6/includes/class-tcy-customizer-option.php (added)
-
tags/1.0.6/includes/class-tcy-helpers.php (added)
-
tags/1.0.6/includes/class-tcy-logger.php (added)
-
tags/1.0.6/includes/class-tcy-main.php (added)
-
tags/1.0.6/includes/class-tcy-wxr-importer.php (added)
-
tags/1.0.6/includes/importer (added)
-
tags/1.0.6/includes/importer/class-tcy-importer-customizer-importer.php (added)
-
tags/1.0.6/includes/importer/class-tcy-importer-logger-cli.php (added)
-
tags/1.0.6/includes/importer/class-tcy-importer-logger.php (added)
-
tags/1.0.6/includes/importer/class-tcy-importer-main.php (added)
-
tags/1.0.6/includes/importer/class-tcy-importer-widget.php (added)
-
tags/1.0.6/includes/importer/class-tcy-importer-wxr-importer.php (added)
-
tags/1.0.6/includes/tcy-core-functions.php (added)
-
tags/1.0.6/includes/theme-demo (added)
-
tags/1.0.6/includes/theme-demo/class-tcy-theme-demo-blogmagazine-free.php (added)
-
tags/1.0.6/includes/theme-demo/class-tcy-theme-demo-hamroclass-free.php (added)
-
tags/1.0.6/includes/theme-demo/class-tcy-theme-demo-lekh-free.php (added)
-
tags/1.0.6/includes/theme-demo/class-tcy-theme-demo-lekh-pro.php (added)
-
tags/1.0.6/includes/theme-demo/class-tcy-theme-demo-multibusiness.php (added)
-
tags/1.0.6/includes/theme-demo/class-tcy-theme-demo-newspaper-lite.php (added)
-
tags/1.0.6/includes/theme-demo/class-tcy-theme-demo-newspaper-plus.php (added)
-
tags/1.0.6/license.txt (added)
-
tags/1.0.6/readme.txt (added)
-
tags/1.0.6/uninstall.php (added)
-
tags/1.1.0 (added)
-
tags/1.1.0/assets (added)
-
tags/1.1.0/assets/css (added)
-
tags/1.1.0/assets/css/demos.css (added)
-
tags/1.1.0/assets/css/demos.min.css (added)
-
tags/1.1.0/assets/js (added)
-
tags/1.1.0/assets/js/demos.js (added)
-
tags/1.1.0/assets/js/demos.min.js (added)
-
tags/1.1.0/century-toolkit.php (added)
-
tags/1.1.0/includes (added)
-
tags/1.1.0/includes/century-toolkit-demo-data.php (added)
-
tags/1.1.0/includes/class-century-toolkit-install.php (added)
-
tags/1.1.0/includes/class-century-toolkit.php (added)
-
tags/1.1.0/includes/panel (added)
-
tags/1.1.0/includes/panel/classes (added)
-
tags/1.1.0/includes/panel/classes/class-install-demos.php (added)
-
tags/1.1.0/includes/panel/classes/importers (added)
-
tags/1.1.0/includes/panel/classes/importers/class-helpers.php (added)
-
tags/1.1.0/includes/panel/classes/importers/class-parsers.php (added)
-
tags/1.1.0/includes/panel/classes/importers/class-settings-importer.php (added)
-
tags/1.1.0/includes/panel/classes/importers/class-widget-importer.php (added)
-
tags/1.1.0/includes/panel/classes/importers/class-wordpress-importer.php (added)
-
tags/1.1.0/includes/panel/classes/importers/temp.xml (added)
-
tags/1.1.0/includes/panel/demos.php (added)
-
tags/1.1.0/index.php (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/century-toolkit.pot (added)
-
tags/1.1.0/license.txt (added)
-
tags/1.1.0/readme.txt (added)
-
trunk/assets/css/demos.css (added)
-
trunk/assets/css/demos.min.css (added)
-
trunk/assets/css/main.css (deleted)
-
trunk/assets/js/demos.js (added)
-
trunk/assets/js/demos.min.js (added)
-
trunk/assets/js/main.js (deleted)
-
trunk/century-toolkit.php (modified) (1 diff)
-
trunk/i18n (deleted)
-
trunk/includes/abstracts (deleted)
-
trunk/includes/admin (deleted)
-
trunk/includes/century-toolkit-demo-data.php (added)
-
trunk/includes/class-century-toolkit-install.php (added)
-
trunk/includes/class-century-toolkit.php (modified) (1 diff)
-
trunk/includes/class-tcy-ajax.php (deleted)
-
trunk/includes/class-tcy-autoloader.php (deleted)
-
trunk/includes/class-tcy-customizer-option.php (deleted)
-
trunk/includes/class-tcy-helpers.php (deleted)
-
trunk/includes/class-tcy-logger.php (deleted)
-
trunk/includes/class-tcy-main.php (deleted)
-
trunk/includes/class-tcy-wxr-importer.php (deleted)
-
trunk/includes/importer (deleted)
-
trunk/includes/panel (added)
-
trunk/includes/panel/classes (added)
-
trunk/includes/panel/classes/class-install-demos.php (added)
-
trunk/includes/panel/classes/importers (added)
-
trunk/includes/panel/classes/importers/class-helpers.php (added)
-
trunk/includes/panel/classes/importers/class-parsers.php (added)
-
trunk/includes/panel/classes/importers/class-settings-importer.php (added)
-
trunk/includes/panel/classes/importers/class-widget-importer.php (added)
-
trunk/includes/panel/classes/importers/class-wordpress-importer.php (added)
-
trunk/includes/panel/classes/importers/temp.xml (added)
-
trunk/includes/panel/demos.php (added)
-
trunk/includes/tcy-core-functions.php (deleted)
-
trunk/includes/theme-demo (deleted)
-
trunk/index.php (added)
-
trunk/languages (added)
-
trunk/languages/century-toolkit.pot (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/uninstall.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
century-toolkit/trunk/century-toolkit.php
r2204291 r2239071 1 1 <?php 2 /* 3 Plugin Name: Century ToolKit 4 Plugin URI: https://wordpress.org/plugins/century-toolkit/ 5 Description: Demo importer for WordPress themes. 6 Version: 1.0.6 7 Author: ThemeCentury Team 8 Author URI: https://themecentury.com/ 9 License: GPL3 10 License URI: http://www.gnu.org/licenses/gpl.html 11 Text Domain: century-toolkit 12 */ 2 /** 3 * Plugin Name: Century ToolKit 4 * Plugin URI: https://wordpress.org/plugins/century-toolkit 5 * Description: Century ToolKit is specially developed for themecentury themes. This plugin help to import demo content and related settings. 6 * Version: 1.1.0 7 * Author: themecentury 8 * Author URI: https://themecentury.com/ 9 * License: GPL-2.0+ 10 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 11 * Text Domain: century-toolkit 12 * Domain Path: /languages 13 */ 13 14 14 // Block direct access to the main plugin file. 15 if ( ! defined( 'ABSPATH' ) ) { 16 exit; // Exit if accessed directly. 15 if (!defined('ABSPATH')) { 16 exit; // Exit if accessed directly. 17 17 } 18 18 19 // Define TCY_TOOLKIT_FILE.20 if ( ! defined( 'TCY_TOOLKIT_FILE' )) {21 define( 'TCY_TOOLKIT_FILE', __FILE__);19 // Define CENTURY_TOOLKIT_PLUGIN_FILE. 20 if (!defined('CENTURY_TOOLKIT_FILE')) { 21 define('CENTURY_TOOLKIT_FILE', __FILE__); 22 22 } 23 23 24 // Include the main WooCommerce class. 25 if ( ! class_exists( 'ThemeCentury_Demo_Importer' ) ) { 26 include_once dirname( __FILE__ ) . '/includes/class-century-toolkit.php'; 24 // Define CENTURY_TOOLKIT_VERSION. 25 if (!defined('CENTURY_TOOLKIT_VERSION')) { 26 define('CENTURY_TOOLKIT_VERSION', '1.1.0'); 27 } 28 29 // Define CENTURY_TOOLKIT_PLUGIN_URI. 30 if (!defined('CENTURY_TOOLKIT_PLUGIN_URI')) { 31 define('CENTURY_TOOLKIT_PLUGIN_URI', plugins_url('', CENTURY_TOOLKIT_FILE) . '/'); 32 } 33 34 // Define CENTURY_TOOLKIT_PLUGIN_DIR. 35 if (!defined('CENTURY_TOOLKIT_PLUGIN_DIR')) { 36 define('CENTURY_TOOLKIT_PLUGIN_DIR', plugin_dir_path(CENTURY_TOOLKIT_FILE) ); 37 } 38 39 // Include the main Century_Toolkit class. 40 if (!class_exists('Century_Toolkit')) { 41 include_once dirname(__FILE__) . '/includes/class-century-toolkit.php'; 27 42 } 28 43 29 44 /** 30 * Main instance of ThemeCentury_Demo_Importer.45 * Main instance of Century_Toolkit. 31 46 * 32 * Returns the main instance of TETto prevent the need to use globals.47 * Returns the main instance of Century_Toolkit to prevent the need to use globals. 33 48 * 34 49 * @since 1.0.0 35 * @return ThemeCentury_Demo_Importer50 * @return Century_Toolkit 36 51 */ 37 function century_toolkit() { 38 return ThemeCentury_Demo_Importer::instance(); 39 } 52 if(!function_exists('century_toolkit_instance')): 53 54 function century_toolkit_instance(){ 55 56 return Century_Toolkit::instance(); 57 58 } 59 60 endif; 40 61 41 62 // Global for backwards compatibility. 42 $GLOBALS['century-toolkit '] = century_toolkit();63 $GLOBALS['century-toolkit-instance'] = century_toolkit_instance(); -
century-toolkit/trunk/includes/class-century-toolkit.php
r2140357 r2239071 1 1 <?php 2 /**3 * ThemeCentury_Demo_Importer setup4 *5 * @author ThemeCentury6 * @category API7 * @package ThemeCentury_Demo_Importer8 * @since 1.0.09 */10 2 11 if ( ! defined( 'ABSPATH' ) ) { 12 exit; // Exit if accessed directly. 13 } 3 final class Century_Toolkit 4 { 14 5 15 /** 16 * Main ThemeCentury_Demo_Importer Class. 17 * 18 * @class ThemeCentury_Demo_Importer 19 * @version 1.0.0 20 */ 21 final class ThemeCentury_Demo_Importer { 22 23 /** 24 * ThemeCentury_Demo_Importer version. 25 * 26 * @var string 27 */ 28 public $version = '1.2.5'; 29 30 /** 31 * The single instance of the class. 32 * 33 * @var ThemeCentury_Demo_Importer 34 * @since 1.0.0 35 */ 36 protected static $_instance = null; 37 38 /** 39 * Main ThemeCentury_Demo_Importer Instance. 40 * 41 * Ensures only one instance of ThemeCentury_Demo_Importer is loaded or can be loaded. 42 * 43 * @since 1.0.0 44 * @static 45 * @see TET() 46 * @return ThemeCentury_Demo_Importer - Main instance. 47 */ 48 public static function instance() { 49 if ( is_null( self::$_instance ) ) { 50 self::$_instance = new self(); 51 } 52 53 return self::$_instance; 54 } 55 56 /** 57 * Cloning is forbidden. 58 * 59 * @since 1.0.0 60 */ 61 public function __clone() { 62 _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'century-toolkit' ), '1.0.0' ); 63 } 64 65 /** 66 * Unserializing instances of this class is forbidden. 67 * 68 * @since 1.0.0 69 */ 70 public function __wakeup() { 71 _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'century-toolkit' ), '1.0.0' ); 72 } 73 74 /** 75 * Auto-load in-accessible properties on demand. 76 * 77 * @param mixed $key Key name. 78 * 79 * @return mixed 80 */ 81 public function __get( $key ) { 82 if ( in_array( $key, array( '' ), true ) ) { 83 return $this->$key(); 84 } 85 } 86 87 /** 88 * ThemeCentury_Demo_Importer Constructor. 89 */ 90 public function __construct() { 91 $this->define_constants(); 92 $this->includes(); 93 $this->init_hooks(); 94 95 do_action( 'themecentury_toolkit_loaded' ); 96 } 97 98 /** 99 * Hook into actions and filters. 100 * 101 * @since 1.0.0 102 */ 103 private function init_hooks() { 104 //register_activation_hook( TCY_TOOLKIT_FILE, array( 'TCY_Install', 'install' ) ); 105 register_shutdown_function( array( $this, 'log_errors' ) ); 106 add_action( 'after_setup_theme', array( $this, 'include_template_functions' ), 11 ); 107 add_action( 'init', array( $this, 'init' ), 0 ); 108 } 109 110 /** 111 * Ensures fatal errors are logged so they can be picked up in the status report. 112 * 113 * @since 1.0.0 114 */ 115 public function log_errors() { 116 117 } 118 119 /** 120 * Define WC Constants. 121 */ 122 private function define_constants() { 123 $upload_dir = wp_upload_dir( null, false ); 124 125 $this->define( 'TCY_ABSPATH', dirname( TCY_TOOLKIT_FILE ) . '/' ); 126 $this->define( 'TCY_PLUGIN_BASENAME', plugin_basename( TCY_TOOLKIT_FILE ) ); 127 $this->define( 'TCY_VERSION', $this->version ); 128 $this->define( 'CENTURY_TOOLKIT_VERSION', $this->version ); 129 $this->define( 'TCY_LOG_DIR', $upload_dir['basedir'] . '/mg-logs/' ); 130 } 131 132 /** 133 * Define constant if not already set. 134 * 135 * @param string $name Constant name. 136 * @param string|bool $value Constant value. 137 */ 138 private function define( $name, $value ) { 139 if ( ! defined( $name ) ) { 140 define( $name, $value ); 141 } 142 } 143 144 /** 145 * What type of request is this? 146 * 147 * @param string $type admin, ajax, cron or frontend. 148 * 149 * @return bool 150 */ 151 private function is_request( $type ) { 152 switch ( $type ) { 153 case 'admin' : 154 return is_admin(); 155 case 'ajax' : 156 return defined( 'DOING_AJAX' ); 157 case 'cron' : 158 return defined( 'DOING_CRON' ); 159 case 'frontend' : 160 return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ); 161 } 162 } 163 164 /** 165 * Check the active theme. 166 * 167 * @since 1.0.0 168 * 169 * @param string $theme Theme slug to check. 170 * 171 * @return bool 172 */ 173 private function is_active_theme( $theme ) { 174 return get_template() === $theme; 175 } 176 177 /** 178 * Include required core files used in admin and on the frontend. 179 */ 180 public function includes() { 181 /** 182 * Class autoloader. 183 */ 184 include_once( TCY_ABSPATH . 'includes/class-tcy-autoloader.php' ); 185 186 /** 187 * Abstract classes. 188 */ 189 include_once( TCY_ABSPATH . 'includes/abstracts/abstract-tcy-theme-demo.php' ); // TCY_Data for CRUD. 190 /** 191 * Core classes. 192 */ 193 include_once( TCY_ABSPATH . 'includes/tcy-core-functions.php' ); 194 include_once( TCY_ABSPATH . 'includes/class-tcy-ajax.php' ); 6 private static $_instance = null; 195 7 196 8 197 if ( $this->is_request( 'admin' ) ) { 198 include_once( TCY_ABSPATH . 'includes/admin/class-tcy-admin.php' ); 199 } 9 public static function instance() 10 { 11 if (is_null(self::$_instance)) 12 self::$_instance = new self(); 13 return self::$_instance; 14 } 200 15 201 if ( $this->is_request( 'frontend' ) ) {202 $this->frontend_includes();203 }204 }205 16 206 /** 207 * Include required frontend files. 208 */ 209 public function frontend_includes() { 17 public function __construct(){ 210 18 211 } 19 $this->define_constants(); 20 $this->includes(); 21 $this->init_hooks(); 22 } 212 23 213 /** 214 * Function used to Init ThemeCentury_Demo_Importer Template Functions - This makes them pluggable by plugins and themes. 215 */ 216 public function include_template_functions() { 217 } 24 private function define($name, $value) 25 { 26 if (!defined($name)) { 27 define($name, $value); 28 } 29 } 218 30 219 /** 220 * Init ThemeCentury_Demo_Importer when WordPress Initialises. 221 */ 222 public function init() { 223 // Before init action. 224 do_action( 'before_themecentury_toolkit_init' ); 31 private function define_constants() 32 { 33 $upload_dir = wp_upload_dir(null, false); 225 34 226 // Set up localisation.227 $this->load_plugin_textdomain();228 35 229 // Init action. 230 do_action( 'themecentury_toolkit_init' ); 231 } 36 $this->define('CENTURY_TOOLKIT_ABSPATH', dirname(CENTURY_TOOLKIT_FILE) . '/'); 37 $this->define('CENTURY_TOOLKIT_BASENAME', plugin_basename(CENTURY_TOOLKIT_FILE)); 38 $this->define('CENTURY_TOOLKIT_UPLOAD_DIR', $upload_dir['basedir'] . '/century-toolkit-upload/'); 39 $this->define('CENTURY_TOOLKIT_DYNAMIC_CSS_PATH', CENTURY_TOOLKIT_UPLOAD_DIR . 'century-toolkit-dynamic.css'); 40 $this->define('CENTURY_TOOLKIT_DYNAMIC_CSS_URI', $upload_dir['baseurl'] . '/century-toolkit-upload/century-toolkit-dynamic.css'); 232 41 233 /**234 * Load Localisation files.235 *236 * Note: the first-loaded translation file overrides any following ones if the same translation is present.237 *238 * Locales found in:239 * - WP_LANG_DIR/century-toolkit/century-toolkit-LOCALE.mo240 * - WP_LANG_DIR/plugins/century-toolkit-LOCALE.mo241 */242 public function load_plugin_textdomain() {243 $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();244 $locale = apply_filters( 'plugin_locale', $locale, 'century-toolkit' );245 42 246 unload_textdomain( 'century-toolkit' ); 247 load_textdomain( 'century-toolkit', WP_LANG_DIR . '/century-toolkit/century-toolkit-' . $locale . '.mo' ); 248 load_plugin_textdomain( 'century-toolkit', false, plugin_basename( dirname( TCY_TOOLKIT_FILE ) ) . '/i18n/languages' ); 249 } 43 } 250 44 251 /** 252 * Get the plugin url. 253 * 254 * @return string 255 */ 256 public function plugin_url() { 257 return untrailingslashit( plugins_url( '/', TCY_TOOLKIT_FILE ) ); 258 } 45 public function includes() 46 { 47 include_once CENTURY_TOOLKIT_ABSPATH . 'includes/class-century-toolkit-install.php'; 259 48 260 /** 261 * Get the plugin path. 262 * 263 * @return string 264 */ 265 public function plugin_path() { 266 return untrailingslashit( plugin_dir_path( TCY_TOOLKIT_FILE ) ); 267 } 49 include_once CENTURY_TOOLKIT_ABSPATH . 'includes/century-toolkit-demo-data.php'; 50 include_once CENTURY_TOOLKIT_ABSPATH . 'includes/panel/demos.php'; 268 51 269 /** 270 * Get the template path. 271 * 272 * @return string 273 */ 274 public function template_path() { 275 return apply_filters( 'themecentury_toolkit_template_path', 'century-toolkit/' ); 276 } 52 } 277 53 278 /** 279 * Get Ajax URL. 280 * 281 * @return string 282 */ 283 public function ajax_url() { 284 return admin_url( 'admin-ajax.php', 'relative' ); 285 } 54 55 public function init_hooks() 56 { 57 register_activation_hook(CENTURY_TOOLKIT_FILE, array('Century_Toolkit_Install', 'install')); 58 59 add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); 60 61 } 62 63 64 public function load_plugin_textdomain(){ 65 $current_folder_path = dirname(plugin_basename(__FILE__)); 66 load_plugin_textdomain('century-toolkit', false, dirname($current_folder_path) . '/languages/'); 67 } 68 69 /** 70 * Cloning is forbidden. 71 * 72 * @since 1.0.0 73 */ 74 public function __clone() 75 { 76 _doing_it_wrong(__FUNCTION__, __( 'Cheatin’ huh?', 'century-toolkit' ), '1.0.0'); 77 } 78 79 /** 80 * Unserializing instances of this class is forbidden. 81 * 82 * @since 1.0.0 83 */ 84 public function __wakeup() 85 { 86 _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'century-toolkit'), '1.0.0'); 87 } 88 286 89 } -
century-toolkit/trunk/readme.txt
r2204291 r2239071 4 4 Requires at least: 4.0.0 5 5 Tested up to: 5.3 6 Stable tag: 1. 0.66 Stable tag: 1.1.0 7 7 License: GPLv3 or later 8 8 … … 43 43 == Changelog == 44 44 45 = 1.1.0 - 2020/02/05 = 46 * Updated: Century ToolKit Updated 47 45 48 = 1.0.6 - 2019/09/23 = 46 49 * Updated: HamroClass Demo Update … … 59 62 = 1.0.2 - 2019/03/24 = 60 63 * Added: Importer for Lekh theme 61 * Added: Importer for MultiBusiness Theme62 64 63 65 = 1.0.1 - 2019/03/22 =
Note: See TracChangeset
for help on using the changeset viewer.