Version Description
- Enhance: Uninstaller is now configurable so that admin can specify is to wipeout the data or not! This is really great for manual upgrade to the PE versions!
Download this release
Release Info
Developer | xpointer |
Plugin | CSS & JavaScript Toolbox |
Version | 6.0.15 |
Comparing to | |
See all releases |
Code changes from version 6.0.14 to 6.0.15
- access.points/main.accesspoint.php +13 -9
- controllers/settings.php +69 -0
- css-js-toolbox.php +2 -2
- framework/settings/page.inc.php +121 -0
- models/settings.php +55 -0
- models/settings/metabox.php +39 -0
- models/settings/uninstall.php +22 -0
- models/uninstall/db/mysql/uninstall.sql +1 -0
- readme.txt +3 -1
- views/blocks/manager/public/css/blocks.css +1 -0
- views/blocks/manager/public/images/toolbox/settings.png +0 -0
- views/blocks/manager/public/js/blocks-page/blocks-page.js +10 -0
- views/blocks/manager/tmpl/toolbox.html.tmpl +2 -1
- views/settings/manager/public/css/default.css +8 -0
- views/settings/manager/public/js/settings/settings.js +69 -0
- views/settings/manager/tmpl/pages/uninstall.html.tmpl +7 -0
- views/settings/manager/tmpl/settings.html.tmpl +60 -0
- views/settings/manager/view.php +84 -0
access.points/main.accesspoint.php
CHANGED
@@ -65,15 +65,19 @@ class CJTMainAccessPoint extends CJTAccessPoint {
|
|
65 |
*
|
66 |
*/
|
67 |
public static function uninstall() {
|
68 |
-
//
|
69 |
-
|
70 |
-
|
71 |
-
$
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
} // End class.
|
65 |
*
|
66 |
*/
|
67 |
public static function uninstall() {
|
68 |
+
// For the uninstaller to be run eraseData setting must be enabled.
|
69 |
+
cssJSToolbox::import('models:settings:uninstall.php');
|
70 |
+
$settings = new CJTSettingsUninstallPage();
|
71 |
+
if ($settings->eraseData) {
|
72 |
+
// Get the only instance we've for the main access point!
|
73 |
+
$mainAccessPointObject = self::$instance;
|
74 |
+
// Load default controller!
|
75 |
+
$mainAccessPointObject->controllerName = 'default';
|
76 |
+
$controller = $mainAccessPointObject->route(false)
|
77 |
+
// Fire uninstall action!
|
78 |
+
->setAction('uninstall')
|
79 |
+
->_doAction();
|
80 |
+
}
|
81 |
}
|
82 |
|
83 |
} // End class.
|
controllers/settings.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Disallow direct access.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
// import dependencies.
|
10 |
+
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
|
11 |
+
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
class CJTSettingsController extends CJTAjaxController {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* put your comment there...
|
19 |
+
*
|
20 |
+
* @var mixed
|
21 |
+
*/
|
22 |
+
protected $controllerInfo = array('model' => 'settings');
|
23 |
+
|
24 |
+
/**
|
25 |
+
* put your comment there...
|
26 |
+
*
|
27 |
+
*/
|
28 |
+
public function __construct() {
|
29 |
+
parent::__construct();
|
30 |
+
// Actions.
|
31 |
+
$this->registryAction('manageForm');
|
32 |
+
$this->registryAction('save');
|
33 |
+
$this->registryAction('restoreDefault');
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* put your comment there...
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
public function manageFormAction() {
|
41 |
+
// Create settings view.
|
42 |
+
$view = self::getView('settings/manager');
|
43 |
+
// Push settings into the view.
|
44 |
+
$view->settings = $this->model;
|
45 |
+
// Output settings view.
|
46 |
+
$this->httpContentType = 'text/html';
|
47 |
+
$this->response = $view->getTemplate('settings');
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* put your comment there...
|
52 |
+
*
|
53 |
+
*/
|
54 |
+
public function restoreDefaultAction() {
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* put your comment there...
|
60 |
+
*
|
61 |
+
*/
|
62 |
+
public function saveAction() {
|
63 |
+
// Get settings page parameters.
|
64 |
+
$settings = filter_input(INPUT_POST, 'settings', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
|
65 |
+
$this->model->save($settings);
|
66 |
+
$this->response = true;
|
67 |
+
}
|
68 |
+
|
69 |
+
} // End class.
|
css-js-toolbox.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: CSS & JavaScript Toolbox
|
4 |
Plugin URI: http://css-javascript-toolbox.com/css-javascript-toolbox-free
|
5 |
Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
|
6 |
-
Version: 6.0.
|
7 |
Author: Wipeout Media
|
8 |
Author URI: http://css-javascript-toolbox.com/
|
9 |
|
@@ -91,7 +91,7 @@ class CJTPlugin extends CJTHookableClass {
|
|
91 |
/**
|
92 |
*
|
93 |
*/
|
94 |
-
const VERSION = '6.0.
|
95 |
|
96 |
/**
|
97 |
*
|
3 |
Plugin Name: CSS & JavaScript Toolbox
|
4 |
Plugin URI: http://css-javascript-toolbox.com/css-javascript-toolbox-free
|
5 |
Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
|
6 |
+
Version: 6.0.15
|
7 |
Author: Wipeout Media
|
8 |
Author URI: http://css-javascript-toolbox.com/
|
9 |
|
91 |
/**
|
92 |
*
|
93 |
*/
|
94 |
+
const VERSION = '6.0.15 CE';
|
95 |
|
96 |
/**
|
97 |
*
|
framework/settings/page.inc.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
abstract class CJTSettingsPage {
|
10 |
+
|
11 |
+
/**
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
const PREFIX = 'cjt-settings';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* put your comment there...
|
18 |
+
*
|
19 |
+
* @var mixed
|
20 |
+
*/
|
21 |
+
protected $fullName = '';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* put your comment there...
|
25 |
+
*
|
26 |
+
* @var mixed
|
27 |
+
*/
|
28 |
+
protected $page = '';
|
29 |
+
|
30 |
+
/**
|
31 |
+
* put your comment there...
|
32 |
+
*
|
33 |
+
* @var mixed
|
34 |
+
*/
|
35 |
+
protected $prefix = '';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* put your comment there...
|
39 |
+
*
|
40 |
+
* @var mixed
|
41 |
+
*/
|
42 |
+
protected $settings;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* put your comment there...
|
46 |
+
*
|
47 |
+
* @param mixed $prefix
|
48 |
+
* @return CJTSettingsModel
|
49 |
+
*/
|
50 |
+
public function __construct($page, $prefix = self::PREFIX) {
|
51 |
+
$this->page = $page;
|
52 |
+
$this->prefix = $prefix;
|
53 |
+
// Build full name.
|
54 |
+
$this->fullName = "{$prefix}.{$page}";
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* put your comment there...
|
59 |
+
*
|
60 |
+
* @param mixed $property
|
61 |
+
*/
|
62 |
+
public function __get($property) {
|
63 |
+
return isset($this->settings->{$property}) ? $this->settings->{$property} : null;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* put your comment there...
|
68 |
+
*
|
69 |
+
* @param mixed $property
|
70 |
+
* @param mixed $value
|
71 |
+
*/
|
72 |
+
public function __set($property, $value) {
|
73 |
+
$this->settings->{$property} = $value;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* put your comment there...
|
78 |
+
*
|
79 |
+
*/
|
80 |
+
protected function load() {
|
81 |
+
$settings = get_option($this->fullName);
|
82 |
+
if (!$settings) {
|
83 |
+
$settings = array();
|
84 |
+
}
|
85 |
+
$this->settings = (object) $settings;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* put your comment there...
|
90 |
+
*
|
91 |
+
*/
|
92 |
+
public function clear() {
|
93 |
+
$this->settings = (object) array();
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* put your comment there...
|
98 |
+
*
|
99 |
+
*/
|
100 |
+
public function getName() {
|
101 |
+
return $this->page;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* put your comment there...
|
106 |
+
*
|
107 |
+
* @param mixed $data
|
108 |
+
*/
|
109 |
+
public function set($data) {
|
110 |
+
$this->settings = (object) $data;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* put your comment there...
|
115 |
+
*
|
116 |
+
*/
|
117 |
+
public function update() {
|
118 |
+
update_option($this->fullName, $this->settings);
|
119 |
+
}
|
120 |
+
|
121 |
+
} // End class.
|
models/settings.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class CJTSettingsModel {
|
10 |
+
|
11 |
+
/**
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
const SETTINGS_PAGE_DIR = 'settings';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* put your comment there...
|
18 |
+
*
|
19 |
+
* @var mixed
|
20 |
+
*/
|
21 |
+
protected $settingsPagesDir = self::SETTINGS_PAGE_DIR;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* put your comment there...
|
25 |
+
*
|
26 |
+
* @param mixed $page
|
27 |
+
*/
|
28 |
+
public function loadPage($name) {
|
29 |
+
// Settings page file name.
|
30 |
+
$pageFile = "{$name}.php";
|
31 |
+
require_once "{$this->settingsPagesDir}/{$pageFile}";
|
32 |
+
// Create settings page object.
|
33 |
+
$name = str_replace(array('-', '_'), '', ucwords($name));
|
34 |
+
$className = "CJTSettings{$name}Page";
|
35 |
+
return new $className();
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* put your comment there...
|
40 |
+
*
|
41 |
+
* @param mixed $settings
|
42 |
+
*/
|
43 |
+
public function save($settings) {
|
44 |
+
// Each element represent a single settings page.
|
45 |
+
foreach ($settings as $page => $data) {
|
46 |
+
// Get page object.
|
47 |
+
$pObject = $this->loadPage($page);
|
48 |
+
// Update page settings.
|
49 |
+
$pObject->set($data);
|
50 |
+
// Save into the database.
|
51 |
+
$pObject->update();
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
} // End class.
|
models/settings/metabox.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
require_once CJTOOLBOX_FRAMEWORK . '/settings/page.inc.php';
|
6 |
+
|
7 |
+
/**
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
class CJTSettingsMetaboxPage extends CJTSettingsPage {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function __construct() {
|
17 |
+
parent::__construct(get_class($this));
|
18 |
+
// Load metabox settins.
|
19 |
+
$this->load();
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* put your comment there...
|
24 |
+
*
|
25 |
+
* @param mixed $property
|
26 |
+
*/
|
27 |
+
public function __get($property) {
|
28 |
+
$value = null;
|
29 |
+
switch ($property) {
|
30 |
+
// PostTypes always should be array.
|
31 |
+
case 'postTypes':
|
32 |
+
$value = parent::__get($property);
|
33 |
+
$value = is_array($value) ? $value : array();
|
34 |
+
break;
|
35 |
+
}
|
36 |
+
return $value;
|
37 |
+
}
|
38 |
+
|
39 |
+
} // End class.
|
models/settings/uninstall.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
require_once CJTOOLBOX_FRAMEWORK . '/settings/page.inc.php';
|
6 |
+
|
7 |
+
/**
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
class CJTSettingsUninstallPage extends CJTSettingsPage {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* put your comment there...
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
public function __construct() {
|
17 |
+
parent::__construct(get_class($this));
|
18 |
+
// Load metabox settins.
|
19 |
+
$this->load();
|
20 |
+
}
|
21 |
+
|
22 |
+
} // End class.
|
models/uninstall/db/mysql/uninstall.sql
CHANGED
@@ -23,4 +23,5 @@ DELETE FROM #__wordpress_options where option_name = 'meta-box-order_cjtoolbox';
|
|
23 |
DELETE FROM #__wordpress_usermeta where meta_key = 'closedpostboxes_cjtoolbox';
|
24 |
|
25 |
/* User Settings */
|
|
|
26 |
DELETE FROM #__wordpress_options where option_name = 'cjt-settings.CJTSettingsMetaboxPage';
|
23 |
DELETE FROM #__wordpress_usermeta where meta_key = 'closedpostboxes_cjtoolbox';
|
24 |
|
25 |
/* User Settings */
|
26 |
+
DELETE FROM #__wordpress_options where option_name = 'cjt-settings.CJTSettingsUninstallPage';
|
27 |
DELETE FROM #__wordpress_options where option_name = 'cjt-settings.CJTSettingsMetaboxPage';
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ License: GPLv2 or later
|
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
Requires at least: 3.3
|
9 |
Tested up to: 3.5.1
|
10 |
-
Stable tag: 6.0.
|
11 |
|
12 |
Easily add custom CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them wherever you want.
|
13 |
|
@@ -126,6 +126,8 @@ Sometimes a bug decides to rear its ugly head and when this happens, this is whe
|
|
126 |
2. CJT Shortcode button
|
127 |
|
128 |
== Changelog ==
|
|
|
|
|
129 |
|
130 |
= 6.0.14 =
|
131 |
* Add: Accept Shortcode parameters and segments. Provide PHP framework for code blocks to define, validate and reading Shortcode parameters.
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
Requires at least: 3.3
|
9 |
Tested up to: 3.5.1
|
10 |
+
Stable tag: 6.0.15
|
11 |
|
12 |
Easily add custom CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them wherever you want.
|
13 |
|
126 |
2. CJT Shortcode button
|
127 |
|
128 |
== Changelog ==
|
129 |
+
= 6.0.15 =
|
130 |
+
* Enhance: Uninstaller is now configurable so that admin can specify is to wipeout the data or not! This is really great for manual upgrade to the PE versions!
|
131 |
|
132 |
= 6.0.14 =
|
133 |
* Add: Accept Shortcode parameters and segments. Provide PHP framework for code blocks to define, validate and reading Shortcode parameters.
|
views/blocks/manager/public/css/blocks.css
CHANGED
@@ -67,6 +67,7 @@
|
|
67 |
.cjt-toolbox-blocks a.cjttbl-admin-tools { background: url(../images/toolbox/admin-tools.png) no-repeat; }
|
68 |
.cjt-toolbox-blocks a.cjttbl-save-changes { background: url(../images/toolbox/save-changes.png) no-repeat; }
|
69 |
.cjt-toolbox-blocks a.cjttbl-save-changes.cjttbs-disabled {background: url(../images/toolbox/save-changes-inactive.png) no-repeat;}
|
|
|
70 |
.cjt-toolbox-blocks a.cjttbl-add-block { background: url(../images/toolbox/add-new.png) no-repeat; }
|
71 |
.cjt-toolbox-blocks a.cjttbl-cancel-restore {
|
72 |
background: url(../images/toolbox/cancel-restore.png) no-repeat;
|
67 |
.cjt-toolbox-blocks a.cjttbl-admin-tools { background: url(../images/toolbox/admin-tools.png) no-repeat; }
|
68 |
.cjt-toolbox-blocks a.cjttbl-save-changes { background: url(../images/toolbox/save-changes.png) no-repeat; }
|
69 |
.cjt-toolbox-blocks a.cjttbl-save-changes.cjttbs-disabled {background: url(../images/toolbox/save-changes-inactive.png) no-repeat;}
|
70 |
+
.cjt-toolbox-blocks a.cjttbl-global-settings { background: url(../images/toolbox/settings.png) no-repeat; }
|
71 |
.cjt-toolbox-blocks a.cjttbl-add-block { background: url(../images/toolbox/add-new.png) no-repeat; }
|
72 |
.cjt-toolbox-blocks a.cjttbl-cancel-restore {
|
73 |
background: url(../images/toolbox/cancel-restore.png) no-repeat;
|
views/blocks/manager/public/images/toolbox/settings.png
ADDED
Binary file
|
views/blocks/manager/public/js/blocks-page/blocks-page.js
CHANGED
@@ -315,6 +315,16 @@ var CJTBlocksPage;
|
|
315 |
tb_show(CJTBlocksPageI18N.manageBackupsDialogTitle, url);
|
316 |
},
|
317 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
/**
|
319 |
* put your comment there...
|
320 |
*
|
315 |
tb_show(CJTBlocksPageI18N.manageBackupsDialogTitle, url);
|
316 |
},
|
317 |
|
318 |
+
/**
|
319 |
+
* put your comment there...
|
320 |
+
*
|
321 |
+
*/
|
322 |
+
_onmanagesettings : function() {
|
323 |
+
var params = {width: 700, height: 600,TB_iframe : true};
|
324 |
+
var settingsFormURL = CJTBlocksPage.server.getRequestURL('settings', 'manageForm', params);
|
325 |
+
tb_show(CJTBlocksPageI18N.settingsFormTitle, settingsFormURL);
|
326 |
+
},
|
327 |
+
|
328 |
/**
|
329 |
* put your comment there...
|
330 |
*
|
views/blocks/manager/tmpl/toolbox.html.tmpl
CHANGED
@@ -31,7 +31,8 @@
|
|
31 |
<br />
|
32 |
<a class="cjt-tb-link cjt-tb-text-link cjttbl-manage-backups" title="<?php echo cssJSToolbox::getText('Backup Manager - Create, restore, or delete backups') ?>"><?php echo cssJSToolbox::getText('Backups') ?></a>
|
33 |
</div>
|
34 |
-
|
|
|
35 |
<div class="divider"></div>
|
36 |
<a class="cjt-tb-link cjttbl-open-all" title="<?php echo cssJSToolbox::getText('Maximise all code blocks') ?>"></a>
|
37 |
<a class="cjt-tb-link cjttbl-close-all" title="<?php echo cssJSToolbox::getText('Minimise all code blocks') ?>"></a>
|
31 |
<br />
|
32 |
<a class="cjt-tb-link cjt-tb-text-link cjttbl-manage-backups" title="<?php echo cssJSToolbox::getText('Backup Manager - Create, restore, or delete backups') ?>"><?php echo cssJSToolbox::getText('Backups') ?></a>
|
33 |
</div>
|
34 |
+
|
35 |
+
<a class="cjt-tb-link cjttbl-global-settings" title="<?php echo cssJSToolbox::getText('General plugin settings') ?>"></a>
|
36 |
<div class="divider"></div>
|
37 |
<a class="cjt-tb-link cjttbl-open-all" title="<?php echo cssJSToolbox::getText('Maximise all code blocks') ?>"></a>
|
38 |
<a class="cjt-tb-link cjttbl-close-all" title="<?php echo cssJSToolbox::getText('Minimise all code blocks') ?>"></a>
|
views/settings/manager/public/css/default.css
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#settings-tabs {
|
2 |
+
height: 94%;
|
3 |
+
}
|
4 |
+
input[type="submit"].cjt-submit {
|
5 |
+
margin-right: 2px;
|
6 |
+
padding: 0px 30px;
|
7 |
+
margin-top: 7px;
|
8 |
+
}
|
views/settings/manager/public/js/settings/settings.js
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
*/
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function($) {
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
|
13 |
+
var CJTSettingsForm = {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* put your comment there...
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
form : null,
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
server : window.parent.CJTBlocksPage.server,
|
26 |
+
|
27 |
+
/**
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
tabs : null,
|
31 |
+
|
32 |
+
/**
|
33 |
+
* put your comment there...
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
init : function() {
|
37 |
+
// Use jQuery Tabs Plugin for settings page.
|
38 |
+
this.tabs = $('#settings-tabs').tabs();
|
39 |
+
this.form = $('form#settings-page');
|
40 |
+
// Bind submit button event.
|
41 |
+
this.form.submit($.proxy(this._onsubmit, this));
|
42 |
+
},
|
43 |
+
|
44 |
+
/**
|
45 |
+
* put your comment there...
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
_onsubmit : function() {
|
49 |
+
// Show loading.
|
50 |
+
this.tabs.tabs('option', 'disabled', true);
|
51 |
+
// Send request to server.
|
52 |
+
var f = this.form.serialize();
|
53 |
+
this.server.send('settings', 'save', this.form.serializeObject(), 'post')
|
54 |
+
.complete(
|
55 |
+
function() {
|
56 |
+
CJTSettingsForm.tabs.tabs('option', 'disabled', false);
|
57 |
+
window.parent.tb_remove();
|
58 |
+
}
|
59 |
+
);
|
60 |
+
// Supress normal form submission.
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
} // End CJTSettingsForm class.
|
65 |
+
|
66 |
+
// Initialize settings form.
|
67 |
+
$($.proxy(CJTSettingsForm.init, CJTSettingsForm));
|
68 |
+
|
69 |
+
})(jQuery);
|
views/settings/manager/tmpl/pages/uninstall.html.tmpl
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
?>
|
6 |
+
<input type="checkbox" id="uninstall-erase" name="settings[uninstall][eraseData]" value="1" <?php if ($settings->eraseData) echo "checked='checked'"; ?> />
|
7 |
+
<label for="uninstall-erase"><?php echo cssJSToolbox::getText('Wipe out data!') ?></label>
|
views/settings/manager/tmpl/settings.html.tmpl
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// No direct access allowed.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
?>
|
9 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
10 |
+
<head>
|
11 |
+
<title></title>
|
12 |
+
<link rel="stylesheet" type="text/css" href="<?php echo CJTOOLBOX_HTML_CONPONENTS_URL ?>/checkbox-list/public/css/checkbox-list.css" />
|
13 |
+
<?php wp_print_head_scripts() ?>
|
14 |
+
<?php wp_print_styles() ?>
|
15 |
+
</head>
|
16 |
+
<body>
|
17 |
+
<div id="cjtoolbox_popup">
|
18 |
+
<form id="settings-page">
|
19 |
+
<div id="settings-tabs">
|
20 |
+
<ul class="navigator">
|
21 |
+
<?php
|
22 |
+
foreach ($this->pages as $page) :
|
23 |
+
// Tab for each page!
|
24 |
+
// Hidden field to always have somthing submitted in the server side,
|
25 |
+
// if nothing submitted not save loop will processed, and therefor
|
26 |
+
// cannot save empty list of checkboxes as in the case wityh metabox!
|
27 |
+
?>
|
28 |
+
<li>
|
29 |
+
<a href="#<?php echo $page['name'] ?>"><?php echo cssJSToolbox::getText($page['displayName']) ?></a>
|
30 |
+
<input type="hidden" name="settings[<?php echo $page['name'] ?>][page_info][name]" value="<?php echo $page['name'] ?>" />
|
31 |
+
</li>
|
32 |
+
<?php
|
33 |
+
endforeach;
|
34 |
+
?>
|
35 |
+
</ul>
|
36 |
+
<div class="tabs">
|
37 |
+
<?php
|
38 |
+
foreach ($this->pages as $page) :
|
39 |
+
$pageTemplateParams = array(
|
40 |
+
'settings' => $this->settings->loadPage($page['name']),
|
41 |
+
'page' => $page,
|
42 |
+
);
|
43 |
+
?>
|
44 |
+
<div id="<?php echo $page['name'] ?>">
|
45 |
+
<h3><?php echo $page['displayName'] ?></h3>
|
46 |
+
<div class="settings-page-content">
|
47 |
+
<?php echo $this->getPage($page['name'], $pageTemplateParams) ?>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
<?php
|
51 |
+
endforeach;
|
52 |
+
?>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
<input type="submit" name="" value="Submit" class="cjt-submit" />
|
56 |
+
</form>
|
57 |
+
</div>
|
58 |
+
<?php wp_print_footer_scripts() ?>
|
59 |
+
</body>
|
60 |
+
</html>
|
views/settings/manager/view.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
|
6 |
+
// No direct access allowed.
|
7 |
+
defined('ABSPATH') or die("Access denied");
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
class CJTSettingsManagerView extends CJTView {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* put your comment there...
|
16 |
+
*
|
17 |
+
* @var mixed
|
18 |
+
*/
|
19 |
+
protected $pages = array();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* put your comment there...
|
23 |
+
*
|
24 |
+
* @var mixed
|
25 |
+
*/
|
26 |
+
public $settings = null;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* put your comment there...
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
public function __construct($info) {
|
33 |
+
parent::__construct($info);
|
34 |
+
// Define setting pages.
|
35 |
+
$this->pages = array(
|
36 |
+
array('name' => 'uninstall', 'displayName' => cssJSToolbox::getText('Uninstall')),
|
37 |
+
);
|
38 |
+
// Enqueue external resources.
|
39 |
+
$this->enqueueScripts();
|
40 |
+
$this->enqueueStyles();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* put your comment there...
|
45 |
+
*
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
protected function enqueueScripts() {
|
49 |
+
// Use related scripts.
|
50 |
+
self::useScripts(__CLASS__,
|
51 |
+
'jquery-ui-tabs',
|
52 |
+
'jquery-serialize-object',
|
53 |
+
'thickbox',
|
54 |
+
'views:settings:manager:public:js:{CJT-}settings'
|
55 |
+
);
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* put your comment there...
|
60 |
+
*
|
61 |
+
*/
|
62 |
+
protected function enqueueStyles() {
|
63 |
+
// Use related styles.
|
64 |
+
self::useStyles(__CLASS__,
|
65 |
+
'framework:css:{CJT-}forms',
|
66 |
+
'framework:css:jquery-ui-1.8.21.custom',
|
67 |
+
'views:settings:manager:public:css:{CJT-}default'
|
68 |
+
);
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* put your comment there...
|
73 |
+
*
|
74 |
+
* @param mixed $name
|
75 |
+
*/
|
76 |
+
public function getPage($name, $params = array()) {
|
77 |
+
$path = "pages/{$name}";
|
78 |
+
return $this->getTemplate($path, $params);
|
79 |
+
}
|
80 |
+
|
81 |
+
} // End class.
|
82 |
+
|
83 |
+
// Hookable!!
|
84 |
+
CJTSettingsManagerView::define('CJTSettingsManagerView');
|