Version Description
- 2013-04-26
Download this release
Release Info
Developer | kosinix |
Plugin | Cyclone Slider |
Version | 2.5.2 |
Comparing to | |
See all releases |
Code changes from version 2.5.1 to 2.5.2
- README.txt +10 -0
- css/templates.css +0 -1
- cyclone-slider.php +3 -2
- inc/class-cyclone-slider.php +22 -138
- inc/class-cyclone-templates.php +265 -0
- js/templates.js +0 -1
- template-assets.php +120 -0
README.txt
CHANGED
@@ -89,6 +89,11 @@ Inside your theme create a folder named "cycloneslider". Add your templates insi
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
|
|
|
|
92 |
= 2.5.1 - 2013-03-29 =
|
93 |
* Bug fix to allow small images to be inserted.
|
94 |
* Improved cyclone_settings.
|
@@ -167,6 +172,11 @@ Inside your theme create a folder named "cycloneslider". Add your templates insi
|
|
167 |
|
168 |
== Upgrade Notice ==
|
169 |
|
|
|
|
|
|
|
|
|
|
|
170 |
= 2.5.1 - 2013-03-29 =
|
171 |
* Bug fix to allow small images to be inserted.
|
172 |
* Improved cyclone_settings.
|
89 |
|
90 |
== Changelog ==
|
91 |
|
92 |
+
= 2.5.2 - 2013-04-26 =
|
93 |
+
* Added template asset loader to get rid of the compiled css and js that are rewritten on the file system on every save
|
94 |
+
* Move template handling logic to its own class to be used by the template asset loader independently
|
95 |
+
* Removed upgrade notice
|
96 |
+
|
97 |
= 2.5.1 - 2013-03-29 =
|
98 |
* Bug fix to allow small images to be inserted.
|
99 |
* Improved cyclone_settings.
|
172 |
|
173 |
== Upgrade Notice ==
|
174 |
|
175 |
+
= 2.5.2 - 2013-04-26 =
|
176 |
+
* Added template asset loader to get rid of the compiled css and js that are rewritten on the file system on every save
|
177 |
+
* Move template handling logic to its own class to be used by the template asset loader independently
|
178 |
+
* Removed upgrade notice
|
179 |
+
|
180 |
= 2.5.1 - 2013-03-29 =
|
181 |
* Bug fix to allow small images to be inserted.
|
182 |
* Improved cyclone_settings.
|
css/templates.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
|
|
cyclone-slider.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Cyclone Slider 2
|
4 |
Plugin URI: http://www.codefleet.net/cyclone-slider-2/
|
5 |
Description: Create responsive slideshows with ease. Built for both developers and non-developers.
|
6 |
-
Version: 2.5.
|
7 |
Author: Nico Amarilla
|
8 |
Author URI: http://www.codefleet.net/
|
9 |
License:
|
@@ -25,7 +25,7 @@ License:
|
|
25 |
|
26 |
*/
|
27 |
if(!defined('CYCLONE_VERSION')){
|
28 |
-
define('CYCLONE_VERSION', '2.5.
|
29 |
}
|
30 |
if(!defined('CYCLONE_PATH')){
|
31 |
define('CYCLONE_PATH', realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR );
|
@@ -34,6 +34,7 @@ if(!defined('CYCLONE_URL')){
|
|
34 |
define('CYCLONE_URL', plugin_dir_url(__FILE__) );
|
35 |
}
|
36 |
|
|
|
37 |
require_once(CYCLONE_PATH.'inc/class-cyclone-slider.php');
|
38 |
require_once(CYCLONE_PATH.'inc/functions.php');
|
39 |
require_once(CYCLONE_PATH.'inc/class-cyclone-slider-widget.php');
|
3 |
Plugin Name: Cyclone Slider 2
|
4 |
Plugin URI: http://www.codefleet.net/cyclone-slider-2/
|
5 |
Description: Create responsive slideshows with ease. Built for both developers and non-developers.
|
6 |
+
Version: 2.5.2
|
7 |
Author: Nico Amarilla
|
8 |
Author URI: http://www.codefleet.net/
|
9 |
License:
|
25 |
|
26 |
*/
|
27 |
if(!defined('CYCLONE_VERSION')){
|
28 |
+
define('CYCLONE_VERSION', '2.5.2' );
|
29 |
}
|
30 |
if(!defined('CYCLONE_PATH')){
|
31 |
define('CYCLONE_PATH', realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR );
|
34 |
define('CYCLONE_URL', plugin_dir_url(__FILE__) );
|
35 |
}
|
36 |
|
37 |
+
require_once(CYCLONE_PATH.'inc/class-cyclone-templates.php');
|
38 |
require_once(CYCLONE_PATH.'inc/class-cyclone-slider.php');
|
39 |
require_once(CYCLONE_PATH.'inc/functions.php');
|
40 |
require_once(CYCLONE_PATH.'inc/class-cyclone-slider-widget.php');
|
inc/class-cyclone-slider.php
CHANGED
@@ -5,6 +5,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
5 |
public $effects;
|
6 |
public $debug;
|
7 |
private $message_id;
|
|
|
8 |
|
9 |
/**
|
10 |
* Initializes the plugin by setting localization, filters, and administration functions.
|
@@ -58,10 +59,21 @@ if(!class_exists('Cyclone_Slider')):
|
|
58 |
|
59 |
|
60 |
$version = get_option('cycloneslider_version');
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
} // end constructor
|
66 |
|
67 |
|
@@ -120,13 +132,15 @@ if(!class_exists('Cyclone_Slider')):
|
|
120 |
* Registers and enqueues frontend-specific scripts.
|
121 |
*/
|
122 |
public function register_plugin_scripts() {
|
|
|
|
|
123 |
/*** Styles ***/
|
124 |
-
wp_enqueue_style( 'cyclone-templates-styles', self::url().'
|
125 |
|
126 |
/*** Scripts ***/
|
127 |
wp_enqueue_script( 'cyclone-slider', self::url().'js/cyclone-slider.min.js', array('jquery'), CYCLONE_VERSION ); //Consolidated cycle2 script and plugins
|
128 |
|
129 |
-
wp_enqueue_script( 'cyclone-templates-scripts', self::url().'
|
130 |
|
131 |
}
|
132 |
|
@@ -195,18 +209,6 @@ if(!class_exists('Cyclone_Slider')):
|
|
195 |
return $location;
|
196 |
}
|
197 |
|
198 |
-
/**
|
199 |
-
* Show upgrade notice
|
200 |
-
*
|
201 |
-
* @return void
|
202 |
-
*/
|
203 |
-
public function upgrade_notice() {
|
204 |
-
// Only show to admins and cyclone page
|
205 |
-
if('cycloneslider' == get_post_type() and current_user_can('manage_options') ) {
|
206 |
-
echo '<div id="message" class="error"><p>'.__( 'Please resave any one of your slideshow to update the template CSS and JS files.', 'cycloneslider' ).'</p></div>';
|
207 |
-
}
|
208 |
-
}
|
209 |
-
|
210 |
/**
|
211 |
* Add Meta Boxes
|
212 |
*
|
@@ -297,7 +299,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
297 |
|
298 |
$slider_settings = self::get_slideshow_settings($post->ID);
|
299 |
|
300 |
-
$templates =
|
301 |
if($this->debug){
|
302 |
self::debug($templates);
|
303 |
}
|
@@ -338,10 +340,6 @@ if(!class_exists('Cyclone_Slider')):
|
|
338 |
// Save slideshow ettings
|
339 |
$this->save_settings($post_id);
|
340 |
|
341 |
-
// Compile css and js
|
342 |
-
$this->compile_css($post_id);
|
343 |
-
$this->compile_js($post_id);
|
344 |
-
|
345 |
update_option('cycloneslider_version', CYCLONE_VERSION);
|
346 |
}
|
347 |
|
@@ -420,67 +418,6 @@ if(!class_exists('Cyclone_Slider')):
|
|
420 |
}
|
421 |
}
|
422 |
|
423 |
-
|
424 |
-
|
425 |
-
/**
|
426 |
-
* Pulls style.css from templates and combines it into one
|
427 |
-
*/
|
428 |
-
private function compile_css($post_id){
|
429 |
-
$ds = DIRECTORY_SEPARATOR;
|
430 |
-
$content = '';
|
431 |
-
|
432 |
-
if(file_exists(self::path()."css{$ds}common.min.css")){
|
433 |
-
$content .= file_get_contents(self::path()."css{$ds}common.min.css");
|
434 |
-
}
|
435 |
-
|
436 |
-
$template_folders = self::get_all_templates();
|
437 |
-
|
438 |
-
foreach($template_folders as $name=>$folder){
|
439 |
-
$style = $folder['path']."{$ds}style.min.css"; //Minified version
|
440 |
-
$style2 = $folder['path']."{$ds}style.css"; //Unminified version, for old templates to work
|
441 |
-
if(file_exists($style)){
|
442 |
-
$content .= "\r\n".str_replace('$tpl', $folder['url'], file_get_contents($style));//apply url and print css
|
443 |
-
} else if(file_exists($style2)){
|
444 |
-
$content .= "\r\n".str_replace('$tpl', $folder['url'], file_get_contents($style2));//apply url and print css
|
445 |
-
}
|
446 |
-
}
|
447 |
-
|
448 |
-
$save_to = self::path()."css{$ds}templates.css";
|
449 |
-
|
450 |
-
if( @file_put_contents($save_to, $content, LOCK_EX) === false){
|
451 |
-
$this->message_id = 101;
|
452 |
-
add_filter('redirect_post_location', array($this, 'throw_message'));
|
453 |
-
}
|
454 |
-
}
|
455 |
-
|
456 |
-
/**
|
457 |
-
* Pulls script.js from templates and combines it into one
|
458 |
-
*/
|
459 |
-
private function compile_js($post_id){
|
460 |
-
$ds = DIRECTORY_SEPARATOR;
|
461 |
-
$content = '';
|
462 |
-
|
463 |
-
$template_folders = self::get_all_templates();
|
464 |
-
|
465 |
-
foreach($template_folders as $name=>$folder){
|
466 |
-
|
467 |
-
$js = $folder['path']."{$ds}script.min.js"; //Minified version
|
468 |
-
$js2 = $folder['path']."{$ds}script.js"; //Unminified version, for old templates to work
|
469 |
-
if(file_exists($js)){
|
470 |
-
$content .= file_get_contents($js)."\r\n";//Pull contents
|
471 |
-
} else if(file_exists($js2)){
|
472 |
-
$content .= file_get_contents($js2)."\r\n";
|
473 |
-
}
|
474 |
-
|
475 |
-
}
|
476 |
-
|
477 |
-
$save_to = self::path()."js{$ds}templates.js";
|
478 |
-
if( @file_put_contents($save_to, $content, LOCK_EX) === false){
|
479 |
-
$this->message_id = 102;
|
480 |
-
add_filter('redirect_post_location', array($this, 'throw_message'));
|
481 |
-
}
|
482 |
-
}
|
483 |
-
|
484 |
/**
|
485 |
* Get slide image thumb from id. False on fail
|
486 |
*/
|
@@ -778,60 +715,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
778 |
|
779 |
return $templates_used;
|
780 |
}
|
781 |
-
|
782 |
-
/**
|
783 |
-
* Get All Locations
|
784 |
-
*
|
785 |
-
* Get templates folders in plugin and theme folders
|
786 |
-
*
|
787 |
-
* @return array The array of locations containing path and url
|
788 |
-
*/
|
789 |
-
public static function get_all_locations(){
|
790 |
-
$ds = DIRECTORY_SEPARATOR;
|
791 |
-
$template_locations = array();
|
792 |
-
$template_locations[0] = array(
|
793 |
-
'path'=>self::get_templates_folder(), //this resides in the plugin
|
794 |
-
'url'=>self::url().'templates/'
|
795 |
-
);
|
796 |
-
$template_locations[1] = array(
|
797 |
-
'path'=> realpath(get_stylesheet_directory())."{$ds}cycloneslider{$ds}",//this resides in the current theme or child theme
|
798 |
-
'url'=> get_stylesheet_directory_uri()."/cycloneslider/"
|
799 |
-
);
|
800 |
-
return $template_locations;
|
801 |
-
}
|
802 |
-
|
803 |
-
/**
|
804 |
-
* Get All Templates
|
805 |
-
*
|
806 |
-
* Get all templates from all locations. Returns array of templates with keys as name containing array of path and url
|
807 |
-
*
|
808 |
-
* @return array The array of templates containing path and url
|
809 |
-
*/
|
810 |
-
public static function get_all_templates(){
|
811 |
-
$template_locations = self::get_all_locations();
|
812 |
-
$template_folders = array();
|
813 |
-
foreach($template_locations as $location){
|
814 |
-
if($files = @scandir($location['path'])){
|
815 |
-
$c = 0;
|
816 |
-
foreach($files as $name){
|
817 |
-
if($name!='.' and $name!='..' and is_dir($location['path'].$name) and @file_exists($location['path'].$name.DIRECTORY_SEPARATOR.'slider.php') ){ // Check if its a directory
|
818 |
-
$ini_array['slide_type'] = array('image');// Default
|
819 |
-
if(@file_exists($location['path'].$name.DIRECTORY_SEPARATOR.'config.txt')){
|
820 |
-
$ini_array = parse_ini_file($location['path'].$name.DIRECTORY_SEPARATOR.'config.txt'); //Parse ini to get slide types supported
|
821 |
-
}
|
822 |
-
$name = sanitize_title($name);// Change space to dash and all lowercase
|
823 |
-
$template_folders[$name] = array( // Here we override template of the same names. If there is a template with the same name in plugin and theme directory, the one in theme will take over
|
824 |
-
'path'=>$location['path'].$name,
|
825 |
-
'url'=>$location['url'].$name,
|
826 |
-
'supports' => $ini_array['slide_type']
|
827 |
-
);
|
828 |
-
}
|
829 |
-
}
|
830 |
-
}
|
831 |
-
}
|
832 |
-
return $template_folders;
|
833 |
-
}
|
834 |
-
|
835 |
/**
|
836 |
* Gets the slideshow settings. Defaults and filters are applied.
|
837 |
*
|
5 |
public $effects;
|
6 |
public $debug;
|
7 |
private $message_id;
|
8 |
+
public $templates;
|
9 |
|
10 |
/**
|
11 |
* Initializes the plugin by setting localization, filters, and administration functions.
|
59 |
|
60 |
|
61 |
$version = get_option('cycloneslider_version');
|
62 |
+
|
63 |
+
$this->templates = new Cyclone_Templates();
|
64 |
+
$this->templates->add_template_location(
|
65 |
+
array(
|
66 |
+
'path'=>self::get_templates_folder(), //this resides in the plugin
|
67 |
+
'url'=>self::url().'templates/'
|
68 |
+
)
|
69 |
+
);
|
70 |
+
$this->templates->add_template_location(
|
71 |
+
array(
|
72 |
+
'path'=> realpath(get_stylesheet_directory()).DIRECTORY_SEPARATOR.'cycloneslider'.DIRECTORY_SEPARATOR,//this resides in the current theme or child theme
|
73 |
+
'url'=> get_stylesheet_directory_uri()."/cycloneslider/"
|
74 |
+
)
|
75 |
+
);
|
76 |
+
|
77 |
} // end constructor
|
78 |
|
79 |
|
132 |
* Registers and enqueues frontend-specific scripts.
|
133 |
*/
|
134 |
public function register_plugin_scripts() {
|
135 |
+
$theme = wp_get_theme();
|
136 |
+
|
137 |
/*** Styles ***/
|
138 |
+
wp_enqueue_style( 'cyclone-templates-styles', self::url().'template-assets.php?type=css&theme='.$theme->template, array(), CYCLONE_VERSION );
|
139 |
|
140 |
/*** Scripts ***/
|
141 |
wp_enqueue_script( 'cyclone-slider', self::url().'js/cyclone-slider.min.js', array('jquery'), CYCLONE_VERSION ); //Consolidated cycle2 script and plugins
|
142 |
|
143 |
+
wp_enqueue_script( 'cyclone-templates-scripts', self::url().'template-assets.php?type=js&theme='.$theme->template, array('jquery'), CYCLONE_VERSION );//Contains our combined css from ALL templates
|
144 |
|
145 |
}
|
146 |
|
209 |
return $location;
|
210 |
}
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
/**
|
213 |
* Add Meta Boxes
|
214 |
*
|
299 |
|
300 |
$slider_settings = self::get_slideshow_settings($post->ID);
|
301 |
|
302 |
+
$templates = $this->templates->get_all_templates();
|
303 |
if($this->debug){
|
304 |
self::debug($templates);
|
305 |
}
|
340 |
// Save slideshow ettings
|
341 |
$this->save_settings($post_id);
|
342 |
|
|
|
|
|
|
|
|
|
343 |
update_option('cycloneslider_version', CYCLONE_VERSION);
|
344 |
}
|
345 |
|
418 |
}
|
419 |
}
|
420 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
/**
|
422 |
* Get slide image thumb from id. False on fail
|
423 |
*/
|
715 |
|
716 |
return $templates_used;
|
717 |
}
|
718 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
719 |
/**
|
720 |
* Gets the slideshow settings. Defaults and filters are applied.
|
721 |
*
|
inc/class-cyclone-templates.php
ADDED
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(!class_exists('Cyclone_Templates')):
|
3 |
+
class Cyclone_Templates {
|
4 |
+
public $template_locations;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Initializes class
|
8 |
+
*/
|
9 |
+
public function __construct() {
|
10 |
+
$this->template_locations = array();
|
11 |
+
}
|
12 |
+
|
13 |
+
public function add_template_location($location){
|
14 |
+
$this->template_locations[] = $location;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function get_all_templates(){
|
18 |
+
if(is_array($this->template_locations) and !empty($this->template_locations)){
|
19 |
+
$template_folders = array();
|
20 |
+
foreach($this->template_locations as $location){
|
21 |
+
if($files = @scandir($location['path'])){
|
22 |
+
$c = 0;
|
23 |
+
foreach($files as $name){
|
24 |
+
if($name!='.' and $name!='..' and is_dir($location['path'].$name) and @file_exists($location['path'].$name.DIRECTORY_SEPARATOR.'slider.php') ){ // Check if its a directory
|
25 |
+
$ini_array['slide_type'] = array('image');// Default
|
26 |
+
if(@file_exists($location['path'].$name.DIRECTORY_SEPARATOR.'config.txt')){
|
27 |
+
$ini_array = parse_ini_file($location['path'].$name.DIRECTORY_SEPARATOR.'config.txt'); //Parse ini to get slide types supported
|
28 |
+
}
|
29 |
+
$name = $this->sanitize_title($name);// Change space to dash and all lowercase
|
30 |
+
$template_folders[$name] = array( // Here we override template of the same names. If there is a template with the same name in plugin and theme directory, the one in theme will take over
|
31 |
+
'path'=>$location['path'].$name,
|
32 |
+
'url'=>$location['url'].$name,
|
33 |
+
'supports' => $ini_array['slide_type']
|
34 |
+
);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
39 |
+
return $template_folders;
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
//Taken from WP to decouple it
|
45 |
+
function sanitize_title($title, $fallback_title = '', $context = 'save') {
|
46 |
+
$raw_title = $title;
|
47 |
+
|
48 |
+
if ( 'save' == $context )
|
49 |
+
$title = $this->remove_accents($title);
|
50 |
+
|
51 |
+
if ( '' === $title || false === $title )
|
52 |
+
$title = $fallback_title;
|
53 |
+
|
54 |
+
return $title;
|
55 |
+
}
|
56 |
+
|
57 |
+
//Taken from WP to decouple class
|
58 |
+
function remove_accents($string) {
|
59 |
+
if ( !preg_match('/[\x80-\xff]/', $string) )
|
60 |
+
return $string;
|
61 |
+
|
62 |
+
if (seems_utf8($string)) {
|
63 |
+
$chars = array(
|
64 |
+
// Decompositions for Latin-1 Supplement
|
65 |
+
chr(194).chr(170) => 'a', chr(194).chr(186) => 'o',
|
66 |
+
chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
|
67 |
+
chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
|
68 |
+
chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
|
69 |
+
chr(195).chr(134) => 'AE',chr(195).chr(135) => 'C',
|
70 |
+
chr(195).chr(136) => 'E', chr(195).chr(137) => 'E',
|
71 |
+
chr(195).chr(138) => 'E', chr(195).chr(139) => 'E',
|
72 |
+
chr(195).chr(140) => 'I', chr(195).chr(141) => 'I',
|
73 |
+
chr(195).chr(142) => 'I', chr(195).chr(143) => 'I',
|
74 |
+
chr(195).chr(144) => 'D', chr(195).chr(145) => 'N',
|
75 |
+
chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
|
76 |
+
chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
|
77 |
+
chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
|
78 |
+
chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
|
79 |
+
chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
|
80 |
+
chr(195).chr(158) => 'TH',chr(195).chr(159) => 's',
|
81 |
+
chr(195).chr(160) => 'a', chr(195).chr(161) => 'a',
|
82 |
+
chr(195).chr(162) => 'a', chr(195).chr(163) => 'a',
|
83 |
+
chr(195).chr(164) => 'a', chr(195).chr(165) => 'a',
|
84 |
+
chr(195).chr(166) => 'ae',chr(195).chr(167) => 'c',
|
85 |
+
chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
|
86 |
+
chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
|
87 |
+
chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
|
88 |
+
chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
|
89 |
+
chr(195).chr(176) => 'd', chr(195).chr(177) => 'n',
|
90 |
+
chr(195).chr(178) => 'o', chr(195).chr(179) => 'o',
|
91 |
+
chr(195).chr(180) => 'o', chr(195).chr(181) => 'o',
|
92 |
+
chr(195).chr(182) => 'o', chr(195).chr(184) => 'o',
|
93 |
+
chr(195).chr(185) => 'u', chr(195).chr(186) => 'u',
|
94 |
+
chr(195).chr(187) => 'u', chr(195).chr(188) => 'u',
|
95 |
+
chr(195).chr(189) => 'y', chr(195).chr(190) => 'th',
|
96 |
+
chr(195).chr(191) => 'y', chr(195).chr(152) => 'O',
|
97 |
+
// Decompositions for Latin Extended-A
|
98 |
+
chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
|
99 |
+
chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',
|
100 |
+
chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',
|
101 |
+
chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',
|
102 |
+
chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',
|
103 |
+
chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',
|
104 |
+
chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',
|
105 |
+
chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',
|
106 |
+
chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',
|
107 |
+
chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',
|
108 |
+
chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',
|
109 |
+
chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',
|
110 |
+
chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',
|
111 |
+
chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',
|
112 |
+
chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',
|
113 |
+
chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',
|
114 |
+
chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',
|
115 |
+
chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',
|
116 |
+
chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',
|
117 |
+
chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',
|
118 |
+
chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',
|
119 |
+
chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',
|
120 |
+
chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
|
121 |
+
chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
|
122 |
+
chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
|
123 |
+
chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
|
124 |
+
chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
|
125 |
+
chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
|
126 |
+
chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
|
127 |
+
chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',
|
128 |
+
chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',
|
129 |
+
chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',
|
130 |
+
chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',
|
131 |
+
chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',
|
132 |
+
chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',
|
133 |
+
chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',
|
134 |
+
chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',
|
135 |
+
chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',
|
136 |
+
chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
|
137 |
+
chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
|
138 |
+
chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
|
139 |
+
chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
|
140 |
+
chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
|
141 |
+
chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
|
142 |
+
chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
|
143 |
+
chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
|
144 |
+
chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
|
145 |
+
chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
|
146 |
+
chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
|
147 |
+
chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
|
148 |
+
chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
|
149 |
+
chr(197).chr(166) => 'T', chr(197).chr(167) => 't',
|
150 |
+
chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',
|
151 |
+
chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',
|
152 |
+
chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',
|
153 |
+
chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',
|
154 |
+
chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',
|
155 |
+
chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',
|
156 |
+
chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',
|
157 |
+
chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',
|
158 |
+
chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',
|
159 |
+
chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
|
160 |
+
chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
|
161 |
+
chr(197).chr(190) => 'z', chr(197).chr(191) => 's',
|
162 |
+
// Decompositions for Latin Extended-B
|
163 |
+
chr(200).chr(152) => 'S', chr(200).chr(153) => 's',
|
164 |
+
chr(200).chr(154) => 'T', chr(200).chr(155) => 't',
|
165 |
+
// Euro Sign
|
166 |
+
chr(226).chr(130).chr(172) => 'E',
|
167 |
+
// GBP (Pound) Sign
|
168 |
+
chr(194).chr(163) => '',
|
169 |
+
// Vowels with diacritic (Vietnamese)
|
170 |
+
// unmarked
|
171 |
+
chr(198).chr(160) => 'O', chr(198).chr(161) => 'o',
|
172 |
+
chr(198).chr(175) => 'U', chr(198).chr(176) => 'u',
|
173 |
+
// grave accent
|
174 |
+
chr(225).chr(186).chr(166) => 'A', chr(225).chr(186).chr(167) => 'a',
|
175 |
+
chr(225).chr(186).chr(176) => 'A', chr(225).chr(186).chr(177) => 'a',
|
176 |
+
chr(225).chr(187).chr(128) => 'E', chr(225).chr(187).chr(129) => 'e',
|
177 |
+
chr(225).chr(187).chr(146) => 'O', chr(225).chr(187).chr(147) => 'o',
|
178 |
+
chr(225).chr(187).chr(156) => 'O', chr(225).chr(187).chr(157) => 'o',
|
179 |
+
chr(225).chr(187).chr(170) => 'U', chr(225).chr(187).chr(171) => 'u',
|
180 |
+
chr(225).chr(187).chr(178) => 'Y', chr(225).chr(187).chr(179) => 'y',
|
181 |
+
// hook
|
182 |
+
chr(225).chr(186).chr(162) => 'A', chr(225).chr(186).chr(163) => 'a',
|
183 |
+
chr(225).chr(186).chr(168) => 'A', chr(225).chr(186).chr(169) => 'a',
|
184 |
+
chr(225).chr(186).chr(178) => 'A', chr(225).chr(186).chr(179) => 'a',
|
185 |
+
chr(225).chr(186).chr(186) => 'E', chr(225).chr(186).chr(187) => 'e',
|
186 |
+
chr(225).chr(187).chr(130) => 'E', chr(225).chr(187).chr(131) => 'e',
|
187 |
+
chr(225).chr(187).chr(136) => 'I', chr(225).chr(187).chr(137) => 'i',
|
188 |
+
chr(225).chr(187).chr(142) => 'O', chr(225).chr(187).chr(143) => 'o',
|
189 |
+
chr(225).chr(187).chr(148) => 'O', chr(225).chr(187).chr(149) => 'o',
|
190 |
+
chr(225).chr(187).chr(158) => 'O', chr(225).chr(187).chr(159) => 'o',
|
191 |
+
chr(225).chr(187).chr(166) => 'U', chr(225).chr(187).chr(167) => 'u',
|
192 |
+
chr(225).chr(187).chr(172) => 'U', chr(225).chr(187).chr(173) => 'u',
|
193 |
+
chr(225).chr(187).chr(182) => 'Y', chr(225).chr(187).chr(183) => 'y',
|
194 |
+
// tilde
|
195 |
+
chr(225).chr(186).chr(170) => 'A', chr(225).chr(186).chr(171) => 'a',
|
196 |
+
chr(225).chr(186).chr(180) => 'A', chr(225).chr(186).chr(181) => 'a',
|
197 |
+
chr(225).chr(186).chr(188) => 'E', chr(225).chr(186).chr(189) => 'e',
|
198 |
+
chr(225).chr(187).chr(132) => 'E', chr(225).chr(187).chr(133) => 'e',
|
199 |
+
chr(225).chr(187).chr(150) => 'O', chr(225).chr(187).chr(151) => 'o',
|
200 |
+
chr(225).chr(187).chr(160) => 'O', chr(225).chr(187).chr(161) => 'o',
|
201 |
+
chr(225).chr(187).chr(174) => 'U', chr(225).chr(187).chr(175) => 'u',
|
202 |
+
chr(225).chr(187).chr(184) => 'Y', chr(225).chr(187).chr(185) => 'y',
|
203 |
+
// acute accent
|
204 |
+
chr(225).chr(186).chr(164) => 'A', chr(225).chr(186).chr(165) => 'a',
|
205 |
+
chr(225).chr(186).chr(174) => 'A', chr(225).chr(186).chr(175) => 'a',
|
206 |
+
chr(225).chr(186).chr(190) => 'E', chr(225).chr(186).chr(191) => 'e',
|
207 |
+
chr(225).chr(187).chr(144) => 'O', chr(225).chr(187).chr(145) => 'o',
|
208 |
+
chr(225).chr(187).chr(154) => 'O', chr(225).chr(187).chr(155) => 'o',
|
209 |
+
chr(225).chr(187).chr(168) => 'U', chr(225).chr(187).chr(169) => 'u',
|
210 |
+
// dot below
|
211 |
+
chr(225).chr(186).chr(160) => 'A', chr(225).chr(186).chr(161) => 'a',
|
212 |
+
chr(225).chr(186).chr(172) => 'A', chr(225).chr(186).chr(173) => 'a',
|
213 |
+
chr(225).chr(186).chr(182) => 'A', chr(225).chr(186).chr(183) => 'a',
|
214 |
+
chr(225).chr(186).chr(184) => 'E', chr(225).chr(186).chr(185) => 'e',
|
215 |
+
chr(225).chr(187).chr(134) => 'E', chr(225).chr(187).chr(135) => 'e',
|
216 |
+
chr(225).chr(187).chr(138) => 'I', chr(225).chr(187).chr(139) => 'i',
|
217 |
+
chr(225).chr(187).chr(140) => 'O', chr(225).chr(187).chr(141) => 'o',
|
218 |
+
chr(225).chr(187).chr(152) => 'O', chr(225).chr(187).chr(153) => 'o',
|
219 |
+
chr(225).chr(187).chr(162) => 'O', chr(225).chr(187).chr(163) => 'o',
|
220 |
+
chr(225).chr(187).chr(164) => 'U', chr(225).chr(187).chr(165) => 'u',
|
221 |
+
chr(225).chr(187).chr(176) => 'U', chr(225).chr(187).chr(177) => 'u',
|
222 |
+
chr(225).chr(187).chr(180) => 'Y', chr(225).chr(187).chr(181) => 'y',
|
223 |
+
// Vowels with diacritic (Chinese, Hanyu Pinyin)
|
224 |
+
chr(201).chr(145) => 'a',
|
225 |
+
// macron
|
226 |
+
chr(199).chr(149) => 'U', chr(199).chr(150) => 'u',
|
227 |
+
// acute accent
|
228 |
+
chr(199).chr(151) => 'U', chr(199).chr(152) => 'u',
|
229 |
+
// caron
|
230 |
+
chr(199).chr(141) => 'A', chr(199).chr(142) => 'a',
|
231 |
+
chr(199).chr(143) => 'I', chr(199).chr(144) => 'i',
|
232 |
+
chr(199).chr(145) => 'O', chr(199).chr(146) => 'o',
|
233 |
+
chr(199).chr(147) => 'U', chr(199).chr(148) => 'u',
|
234 |
+
chr(199).chr(153) => 'U', chr(199).chr(154) => 'u',
|
235 |
+
// grave accent
|
236 |
+
chr(199).chr(155) => 'U', chr(199).chr(156) => 'u',
|
237 |
+
);
|
238 |
+
|
239 |
+
$string = strtr($string, $chars);
|
240 |
+
} else {
|
241 |
+
// Assume ISO-8859-1 if not UTF-8
|
242 |
+
$chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158)
|
243 |
+
.chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194)
|
244 |
+
.chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202)
|
245 |
+
.chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210)
|
246 |
+
.chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218)
|
247 |
+
.chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227)
|
248 |
+
.chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235)
|
249 |
+
.chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243)
|
250 |
+
.chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251)
|
251 |
+
.chr(252).chr(253).chr(255);
|
252 |
+
|
253 |
+
$chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy";
|
254 |
+
|
255 |
+
$string = strtr($string, $chars['in'], $chars['out']);
|
256 |
+
$double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));
|
257 |
+
$double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');
|
258 |
+
$string = str_replace($double_chars['in'], $double_chars['out'], $string);
|
259 |
+
}
|
260 |
+
|
261 |
+
return $string;
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
endif;
|
js/templates.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
|
|
template-assets.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for compiling css and js assets for cyclone.
|
4 |
+
*/
|
5 |
+
define('APP_PATH', get_file_dir_path() );
|
6 |
+
define('APP_URL', get_file_dir_url() );
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Functions for guessing the path and urls since this script is decoupled from WP and we cannot use the built-in WP functions
|
10 |
+
*/
|
11 |
+
function get_file_dir_path(){
|
12 |
+
return realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR;
|
13 |
+
}
|
14 |
+
function get_file_dir_url(){
|
15 |
+
$pathinfo = pathinfo($_SERVER['SCRIPT_NAME']);
|
16 |
+
if(is_array($pathinfo) and isset($pathinfo['dirname'])){
|
17 |
+
return $pathinfo['dirname'].'/';
|
18 |
+
}
|
19 |
+
return false;
|
20 |
+
}
|
21 |
+
function wp_content_path(){
|
22 |
+
$path = get_file_dir_path();
|
23 |
+
$path = str_replace('plugins'.DIRECTORY_SEPARATOR.'cyclone-slider-2'.DIRECTORY_SEPARATOR, '', $path);
|
24 |
+
return $path;
|
25 |
+
}
|
26 |
+
function wp_content_url(){
|
27 |
+
$url = get_file_dir_url();
|
28 |
+
$url = str_replace('plugins/cyclone-slider-2/', '', $url);
|
29 |
+
return $url;
|
30 |
+
}
|
31 |
+
function theme_path($theme){
|
32 |
+
return wp_content_path().'themes'.DIRECTORY_SEPARATOR.$theme.DIRECTORY_SEPARATOR;
|
33 |
+
}
|
34 |
+
function theme_url($theme){
|
35 |
+
return wp_content_url().'themes/'.$theme.'/';
|
36 |
+
}
|
37 |
+
/**
|
38 |
+
* Pulls style.css from templates and combines it into one
|
39 |
+
*/
|
40 |
+
function compile_css($templates){
|
41 |
+
$ds = DIRECTORY_SEPARATOR;
|
42 |
+
$content = '';
|
43 |
+
|
44 |
+
if(file_exists(APP_PATH."css{$ds}common.min.css")){
|
45 |
+
$content .= file_get_contents(APP_PATH."css{$ds}common.min.css");
|
46 |
+
} else {
|
47 |
+
$content .= file_get_contents(APP_PATH."css{$ds}common.css");
|
48 |
+
}
|
49 |
+
|
50 |
+
$template_folders = $templates->get_all_templates();
|
51 |
+
|
52 |
+
foreach($template_folders as $name=>$folder){
|
53 |
+
$style = $folder['path']."{$ds}style.min.css"; //Minified version
|
54 |
+
$style2 = $folder['path']."{$ds}style.css"; //Unminified version, for old templates to work
|
55 |
+
if(file_exists($style)){
|
56 |
+
$content .= "\r\n".str_replace('$tpl', $folder['url'], file_get_contents($style));//apply url and print css
|
57 |
+
} else if(file_exists($style2)){
|
58 |
+
$content .= "\r\n".str_replace('$tpl', $folder['url'], file_get_contents($style2));//apply url and print css
|
59 |
+
}
|
60 |
+
}
|
61 |
+
header("Content-Type: text/css");
|
62 |
+
echo $content;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Pulls script.js from templates and combines it into one
|
67 |
+
*/
|
68 |
+
function compile_js($templates){
|
69 |
+
$ds = DIRECTORY_SEPARATOR;
|
70 |
+
$content = '';
|
71 |
+
|
72 |
+
$template_folders = $templates->get_all_templates();
|
73 |
+
|
74 |
+
foreach($template_folders as $name=>$folder){
|
75 |
+
|
76 |
+
$js = $folder['path']."{$ds}script.min.js"; //Minified version
|
77 |
+
$js2 = $folder['path']."{$ds}script.js"; //Unminified version, for old templates to work
|
78 |
+
if(file_exists($js)){
|
79 |
+
$content .= file_get_contents($js)."\r\n";//Pull contents
|
80 |
+
} else if(file_exists($js2)){
|
81 |
+
$content .= file_get_contents($js2)."\r\n";
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
85 |
+
header("Content-Type: application/javascript");
|
86 |
+
echo $content;
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Pass in the theme value via GET since we have know way of knowing the current theme used. Default is set to twentytwelve
|
92 |
+
*/
|
93 |
+
$theme = isset($_GET['theme']) ? htmlentities(strip_tags($_GET['theme'])) : 'twentytwelve';
|
94 |
+
$type = isset($_GET['type']) ? htmlentities(strip_tags($_GET['type'])) : '';
|
95 |
+
|
96 |
+
require_once(APP_PATH.'inc'.DIRECTORY_SEPARATOR.'class-cyclone-templates.php');
|
97 |
+
|
98 |
+
$templates = new Cyclone_Templates();
|
99 |
+
$templates->add_template_location(
|
100 |
+
array(
|
101 |
+
'path'=>APP_PATH.'templates'.DIRECTORY_SEPARATOR, //this resides in the plugin
|
102 |
+
'url'=>APP_URL.'templates/'
|
103 |
+
)
|
104 |
+
);
|
105 |
+
$templates->add_template_location(
|
106 |
+
array(
|
107 |
+
'path'=> theme_path($theme).'cycloneslider'.DIRECTORY_SEPARATOR,//this resides in the current theme or child theme
|
108 |
+
'url'=> theme_url($theme)."cycloneslider/"
|
109 |
+
)
|
110 |
+
);
|
111 |
+
|
112 |
+
if($type=='css'){
|
113 |
+
echo compile_css($templates);
|
114 |
+
}
|
115 |
+
if($type=='js'){
|
116 |
+
echo compile_js($templates);
|
117 |
+
}
|
118 |
+
die();
|
119 |
+
|
120 |
+
|