Version Description
- Release date: 2015-11-10
- Changed Installer version to 1.7
- Changed Common version to 1.8
Download this release
Release Info
Developer | iworks |
Plugin | Toolset Types – Custom Post Types, Custom Fields and Taxonomies |
Version | 1.8.9 |
Comparing to | |
See all releases |
Code changes from version 1.8.8 to 1.8.9
- embedded/bootstrap.php +1 -1
- embedded/classes/editor.php +1 -0
- embedded/plugin.php +1 -1
- embedded/readme.txt +1 -1
- embedded/resources/js/post-relationship.js +13 -1
- embedded/toolset/toolset-common/changelog.txt +13 -0
- embedded/toolset/toolset-common/classes/class-toolset-admin-bar-menu.php +39 -5
- embedded/toolset/toolset-common/expression-parser/js/parser.js +4 -1
- embedded/toolset/toolset-common/functions.php +103 -9
- embedded/toolset/toolset-common/res/css/toolset-common.css +8 -0
- embedded/toolset/toolset-common/toolset-forms/classes/class.colorpicker.php +1 -1
- embedded/toolset/toolset-common/toolset-forms/classes/class.credfile.php +7 -1
- embedded/toolset/toolset-common/toolset-forms/classes/class.field_factory.php +12 -2
- embedded/toolset/toolset-common/toolset-forms/classes/class.types.php +3 -3
- embedded/toolset/toolset-common/toolset-forms/classes/class.video.php +1 -0
- embedded/toolset/toolset-common/toolset-forms/classes/class.wysiwyg.php +4 -1
- embedded/toolset/toolset-common/toolset-forms/classes/submit.php +40 -38
- embedded/toolset/toolset-common/toolset-forms/css/wpt-jquery-ui/jquery-ui-1.11.4.custom.css +3 -2
- embedded/toolset/toolset-common/toolset-forms/css/wpt-toolset-backend.css +8 -0
- embedded/toolset/toolset-common/toolset-forms/js/conditional.js +4 -2
- embedded/toolset/toolset-common/toolset-forms/js/jquery_upload/file_upload.js +31 -125
- embedded/toolset/toolset-common/toolset-forms/js/main.js +12 -1
- embedded/toolset/toolset-common/toolset-forms/readme.txt +5 -0
- embedded/toolset/toolset-common/utility/js/utils.js +650 -661
- embedded/toolset/toolset-common/utility/utils.php +12 -12
- embedded/toolset/toolset-common/visual-editor/res/js/icl_editor_addon_plugin.js +5 -0
- embedded/toolset/toolset-common/visual-editor/res/js/icl_media_manager.js +45 -28
- includes/fields.php +40 -17
- plus/installer/changelog.txt +4 -0
- plus/installer/includes/class-installer-theme.php +1 -1
- plus/installer/includes/installer.class.php +124 -113
- plus/installer/installer.php +1 -1
- plus/installer/loader.php +2 -2
- plus/installer/repositories.xml +3 -3
- readme.txt +45 -39
- wpcf.php +2 -2
embedded/bootstrap.php
CHANGED
@@ -156,7 +156,7 @@ function wpcf_embedded_init() {
|
|
156 |
// Define necessary constants if plugin is not present
|
157 |
// This ones are skipped if used as embedded code!
|
158 |
if ( !defined( 'WPCF_VERSION' ) ) {
|
159 |
-
define( 'WPCF_VERSION', '1.8.
|
160 |
define( 'WPCF_META_PREFIX', 'wpcf-' );
|
161 |
}
|
162 |
|
156 |
// Define necessary constants if plugin is not present
|
157 |
// This ones are skipped if used as embedded code!
|
158 |
if ( !defined( 'WPCF_VERSION' ) ) {
|
159 |
+
define( 'WPCF_VERSION', '1.8.9' );
|
160 |
define( 'WPCF_META_PREFIX', 'wpcf-' );
|
161 |
}
|
162 |
|
embedded/classes/editor.php
CHANGED
@@ -279,6 +279,7 @@ class WPCF_Editor
|
|
279 |
$function = 'wpcf_fields_' . strtolower( $this->field['type'] )
|
280 |
. '_editor_submit';
|
281 |
|
|
|
282 |
if ( function_exists( $function ) ) {
|
283 |
/*
|
284 |
* Callback
|
279 |
$function = 'wpcf_fields_' . strtolower( $this->field['type'] )
|
280 |
. '_editor_submit';
|
281 |
|
282 |
+
$shortcode = '';
|
283 |
if ( function_exists( $function ) ) {
|
284 |
/*
|
285 |
* Callback
|
embedded/plugin.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
-
Version: 1.8.
|
9 |
*/
|
10 |
/**
|
11 |
*
|
5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
+
Version: 1.8.9
|
9 |
*/
|
10 |
/**
|
11 |
*
|
embedded/readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: CMS, custom field, custom fields, custom post type, custom post types, fie
|
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.4
|
7 |
Tested up to: 4.3,1
|
8 |
-
Stable tag: 1.8.
|
9 |
|
10 |
The Embedded version lets you create custom types, taxonomies and fields for your theme or plugin, without requiring any plugin.
|
11 |
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.4
|
7 |
Tested up to: 4.3,1
|
8 |
+
Stable tag: 1.8.9
|
9 |
|
10 |
The Embedded version lets you create custom types, taxonomies and fields for your theme or plugin, without requiring any plugin.
|
11 |
|
embedded/resources/js/post-relationship.js
CHANGED
@@ -410,6 +410,12 @@ jQuery(document).ready(function($) {
|
|
410 |
* select2
|
411 |
*/
|
412 |
wpcfBindSelect2($);
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
}
|
414 |
});
|
415 |
return false;
|
@@ -611,7 +617,7 @@ jQuery(document).ready(function($) {
|
|
611 |
return false;
|
612 |
});
|
613 |
$('#wpcf-post-relationship').on('click', '.wpcf-pr-save-ajax', function() {
|
614 |
-
var $button = $(this), $row = $button.parents('tr'), rowId = $row.attr('id'), valid = true;
|
615 |
if (typeof wptValidation == 'undefined') {
|
616 |
$('.js-types-validate', $row).each(function() {
|
617 |
if ($('#post').validate().element($(this)) == false) {
|
@@ -681,6 +687,12 @@ jQuery(document).ready(function($) {
|
|
681 |
* select2
|
682 |
*/
|
683 |
wpcfBindSelect2($);
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
}
|
685 |
}
|
686 |
});
|
410 |
* select2
|
411 |
*/
|
412 |
wpcfBindSelect2($);
|
413 |
+
|
414 |
+
var data_for_events = {
|
415 |
+
table: $table
|
416 |
+
}
|
417 |
+
|
418 |
+
$( document ).trigger( 'js_event_wpcf_types_relationship_child_added', [ data_for_events ] );
|
419 |
}
|
420 |
});
|
421 |
return false;
|
617 |
return false;
|
618 |
});
|
619 |
$('#wpcf-post-relationship').on('click', '.wpcf-pr-save-ajax', function() {
|
620 |
+
var $button = $(this), $row = $button.parents('tr'), rowId = $row.attr('id'), valid = true, $table = $row.closest( '.js-types-child-table' );
|
621 |
if (typeof wptValidation == 'undefined') {
|
622 |
$('.js-types-validate', $row).each(function() {
|
623 |
if ($('#post').validate().element($(this)) == false) {
|
687 |
* select2
|
688 |
*/
|
689 |
wpcfBindSelect2($);
|
690 |
+
|
691 |
+
var data_for_events = {
|
692 |
+
table: $table
|
693 |
+
}
|
694 |
+
|
695 |
+
$( document ).trigger( 'js_event_wpcf_types_relationship_child_saved', [ data_for_events ] );
|
696 |
}
|
697 |
}
|
698 |
});
|
embedded/toolset/toolset-common/changelog.txt
CHANGED
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
Common 1.6.2 (September 25, 2015)
|
2 |
- Tagged for CRED 1.4, Types 1.8.2
|
3 |
|
1 |
+
Common 1.8 (November 10, 2015)
|
2 |
+
- Tagged for Views 1.11.1, Types 1.8.9 and CRED 1.4.2
|
3 |
+
- Improved the media manager script.
|
4 |
+
- Added helper functions for dealing with $_GET, $_POST and arrays.
|
5 |
+
- Improved CRED file uploads.
|
6 |
+
- Improved taxonomy management in CRED forms.
|
7 |
+
- Improved usermeta fields management in CRED forms.
|
8 |
+
|
9 |
+
-------------------------------------------------------------------------------------------------------------------
|
10 |
+
Common 1.7 (October 30, 2015)
|
11 |
+
- Tagged for Views 1.11 and Layouts 1.4
|
12 |
+
|
13 |
+
-------------------------------------------------------------------------------------------------------------------
|
14 |
Common 1.6.2 (September 25, 2015)
|
15 |
- Tagged for CRED 1.4, Types 1.8.2
|
16 |
|
embedded/toolset/toolset-common/classes/class-toolset-admin-bar-menu.php
CHANGED
@@ -9,7 +9,7 @@ if ( ! class_exists( 'Toolset_Admin_Bar_Menu' ) ) {
|
|
9 |
|
10 |
/**
|
11 |
* Avoid executing more than once the code
|
12 |
-
* @var
|
13 |
*/
|
14 |
private $done;
|
15 |
|
@@ -60,10 +60,12 @@ if ( ! class_exists( 'Toolset_Admin_Bar_Menu' ) ) {
|
|
60 |
|
61 |
}
|
62 |
}
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
67 |
public function admin_bar_menu( $wp_admin_bar ) {
|
68 |
// Check this haven't called more than once
|
69 |
if ( $this->done ) {
|
@@ -117,6 +119,35 @@ if ( ! class_exists( 'Toolset_Admin_Bar_Menu' ) ) {
|
|
117 |
'href' => $href,
|
118 |
);
|
119 |
$wp_admin_bar->add_node( $args );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
$settings_href = $this->get_settings_href();
|
122 |
$args = array(
|
@@ -268,6 +299,9 @@ if ( ! class_exists( 'Toolset_Admin_Bar_Menu' ) ) {
|
|
268 |
|
269 |
/**
|
270 |
* Get the best plugin available
|
|
|
|
|
|
|
271 |
* @return string (layouts|views|)
|
272 |
*/
|
273 |
private function get_default_plugin() {
|
9 |
|
10 |
/**
|
11 |
* Avoid executing more than once the code
|
12 |
+
* @var bool
|
13 |
*/
|
14 |
private $done;
|
15 |
|
60 |
|
61 |
}
|
62 |
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @see action admin_bar_menu
|
67 |
+
* @param $wp_admin_bar
|
68 |
+
*/
|
69 |
public function admin_bar_menu( $wp_admin_bar ) {
|
70 |
// Check this haven't called more than once
|
71 |
if ( $this->done ) {
|
119 |
'href' => $href,
|
120 |
);
|
121 |
$wp_admin_bar->add_node( $args );
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Collect an array of menu item definitions and create submenu items in the Toolset Admin bar menu.
|
125 |
+
*
|
126 |
+
* @param array $menu_item_definitions array()
|
127 |
+
* @param string $context Current context - see Toolset_Admin_Bar_Menu::get_context().
|
128 |
+
* @param int|bool $post_id Id of the currently displayed post or false if not applicable.
|
129 |
+
* @return array Array of menu item definition. Each definition is an array with following keys:
|
130 |
+
* string $title Title of the menu item.
|
131 |
+
* string $edit_url URL of the menu item.
|
132 |
+
* string $menu_id Slug of the item. Should be unique.
|
133 |
+
* If some of the arguments is missing or empty after sanitizing, the menu item will be skipped.
|
134 |
+
* @since 1.7
|
135 |
+
*/
|
136 |
+
$menu_item_definitions = apply_filters( 'toolset_filter_toolset_admin_bar_menu_insert', array(), $this->get_context(), get_the_ID() );
|
137 |
+
|
138 |
+
foreach( $menu_item_definitions as $menu_row ) {
|
139 |
+
$title = sanitize_text_field( toolset_getarr( $menu_row, 'title', null ) );
|
140 |
+
$edit_url = esc_url_raw( toolset_getarr( $menu_row, 'href', null ) );
|
141 |
+
$menu_id = esc_attr( toolset_getarr( $menu_row, 'menu_id', null ) );
|
142 |
+
if( !empty( $title ) && !empty( $edit_url ) && !empty( $menu_id ) ) {
|
143 |
+
$wp_admin_bar->add_node( array(
|
144 |
+
'parent' => 'toolset_admin_bar_menu',
|
145 |
+
'id' => $menu_id,
|
146 |
+
'title' => $title,
|
147 |
+
'href' => $edit_url
|
148 |
+
) );
|
149 |
+
}
|
150 |
+
}
|
151 |
|
152 |
$settings_href = $this->get_settings_href();
|
153 |
$args = array(
|
299 |
|
300 |
/**
|
301 |
* Get the best plugin available
|
302 |
+
*
|
303 |
+
* @fixme I don't agree. All Toolset plugins are the best plugin.
|
304 |
+
*
|
305 |
* @return string (layouts|views|)
|
306 |
*/
|
307 |
private function get_default_plugin() {
|
embedded/toolset/toolset-common/expression-parser/js/parser.js
CHANGED
@@ -119,8 +119,11 @@ window.ToolsetParser=window.ToolsetParser ||
|
|
119 |
{
|
120 |
var found=false;
|
121 |
var ii=a.length;
|
|
|
|
|
|
|
122 |
while(--ii>=0)
|
123 |
-
{
|
124 |
if (a[ii]==v)
|
125 |
{
|
126 |
found=true;
|
119 |
{
|
120 |
var found=false;
|
121 |
var ii=a.length;
|
122 |
+
//Fixed https://onthegosystems.myjetbrains.com/youtrack/issue/cred-262
|
123 |
+
if (ii==0 && v=='') return true;
|
124 |
+
//####################################################################
|
125 |
while(--ii>=0)
|
126 |
+
{
|
127 |
if (a[ii]==v)
|
128 |
{
|
129 |
found=true;
|
embedded/toolset/toolset-common/functions.php
CHANGED
@@ -526,20 +526,32 @@ class WPV_wpcf_switch_post_from_attr_id
|
|
526 |
|
527 |
}
|
528 |
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
534 |
|
535 |
add_filter( 'the_content', 'WPV_wpcf_record_post_relationship_belongs', 0, 1 );
|
536 |
-
|
537 |
-
$WPV_wpcf_post_relationship = Array();
|
538 |
|
539 |
function WPV_wpcf_record_post_relationship_belongs( $content ) {
|
540 |
|
541 |
-
global $post, $WPV_wpcf_post_relationship;
|
542 |
static $related = array();
|
|
|
543 |
|
544 |
if ( !empty( $post->ID ) && function_exists( 'wpcf_pr_get_belongs' ) ) {
|
545 |
|
@@ -557,11 +569,29 @@ function WPV_wpcf_record_post_relationship_belongs( $content ) {
|
|
557 |
}
|
558 |
}
|
559 |
}
|
560 |
-
|
|
|
561 |
|
562 |
return $content;
|
563 |
}
|
564 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
565 |
/**
|
566 |
* Form for Enlimbo calls for wpv-control shortcode calls
|
567 |
*
|
@@ -620,3 +650,67 @@ function wpv_dismiss_message_ajax() {
|
|
620 |
die( 'ajax' );
|
621 |
}
|
622 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
526 |
|
527 |
}
|
528 |
|
529 |
+
/**
|
530 |
+
* Add a filter on the content so that we can record any related posts.
|
531 |
+
*
|
532 |
+
* These can then be used in id attributes of Types and Views shortcodes:
|
533 |
+
* [types field='my-field' id="$room"] displays my-field from the related room.
|
534 |
+
* [wpv-post-title id="$room"] display the title of the related room.
|
535 |
+
*
|
536 |
+
* Then, clear the recorded relationships and take care of nested structures by restoring states.
|
537 |
+
*
|
538 |
+
* Note that this is also done for the Views wpv_filter_wpv_the_content_suppressed filter
|
539 |
+
* used on [wpv-post-body view_template="..." suppress_filters="true"]
|
540 |
+
* so that we also have parent data stored and restored when nesting Content Templates without all the filters.
|
541 |
+
*/
|
542 |
+
|
543 |
+
$WPV_wpcf_post_relationship = array();
|
544 |
+
$WPV_wpcf_post_relationship_depth = 0;
|
545 |
+
$WPV_wpcf_post_relationship_track = array();
|
546 |
|
547 |
add_filter( 'the_content', 'WPV_wpcf_record_post_relationship_belongs', 0, 1 );
|
548 |
+
add_filter( 'wpv_filter_wpv_the_content_suppressed', 'WPV_wpcf_record_post_relationship_belongs', 0, 1 );
|
|
|
549 |
|
550 |
function WPV_wpcf_record_post_relationship_belongs( $content ) {
|
551 |
|
552 |
+
global $post, $WPV_wpcf_post_relationship, $WPV_wpcf_post_relationship_depth, $WPV_wpcf_post_relationship_track;
|
553 |
static $related = array();
|
554 |
+
$WPV_wpcf_post_relationship_depth++;
|
555 |
|
556 |
if ( !empty( $post->ID ) && function_exists( 'wpcf_pr_get_belongs' ) ) {
|
557 |
|
569 |
}
|
570 |
}
|
571 |
}
|
572 |
+
|
573 |
+
$WPV_wpcf_post_relationship_track[ $WPV_wpcf_post_relationship_depth ] = $WPV_wpcf_post_relationship;
|
574 |
|
575 |
return $content;
|
576 |
}
|
577 |
|
578 |
+
add_filter( 'the_content', 'WPV_wpcf_restore_post_relationship_belongs', PHP_INT_MAX, 1 );
|
579 |
+
add_filter( 'wpv_filter_wpv_the_content_suppressed', 'WPV_wpcf_restore_post_relationship_belongs', PHP_INT_MAX, 1 );
|
580 |
+
|
581 |
+
function WPV_wpcf_restore_post_relationship_belongs( $content ) {
|
582 |
+
global $WPV_wpcf_post_relationship, $WPV_wpcf_post_relationship_depth, $WPV_wpcf_post_relationship_track;
|
583 |
+
$WPV_wpcf_post_relationship_depth--;
|
584 |
+
if (
|
585 |
+
$WPV_wpcf_post_relationship_depth > 0
|
586 |
+
&& isset( $WPV_wpcf_post_relationship_track[ $WPV_wpcf_post_relationship_depth ] )
|
587 |
+
) {
|
588 |
+
$WPV_wpcf_post_relationship = $WPV_wpcf_post_relationship_track[ $WPV_wpcf_post_relationship_depth ];
|
589 |
+
} else {
|
590 |
+
$WPV_wpcf_post_relationship = array();
|
591 |
+
}
|
592 |
+
return $content;
|
593 |
+
}
|
594 |
+
|
595 |
/**
|
596 |
* Form for Enlimbo calls for wpv-control shortcode calls
|
597 |
*
|
650 |
die( 'ajax' );
|
651 |
}
|
652 |
|
653 |
+
|
654 |
+
/**
|
655 |
+
* Safely retrieve a key from $_POST variable.
|
656 |
+
*
|
657 |
+
* This is a wrapper for toolset_getarr(). See that for more information.
|
658 |
+
*
|
659 |
+
* @param string $key See toolset_getarr().
|
660 |
+
* @param mixed $default See toolset_getarr().
|
661 |
+
* @param null|array $valid See toolset_getarr().
|
662 |
+
*
|
663 |
+
* @return mixed See toolset_getarr().
|
664 |
+
*
|
665 |
+
* @since 1.7
|
666 |
+
*/
|
667 |
+
function toolset_getpost( $key, $default = '', $valid = null ) {
|
668 |
+
return toolset_getarr( $_POST, $key, $default, $valid );
|
669 |
+
}
|
670 |
+
|
671 |
+
|
672 |
+
/**
|
673 |
+
* Safely retrieve a key from $_GET variable.
|
674 |
+
*
|
675 |
+
* This is a wrapper for toolset_getarr(). See that for more information.
|
676 |
+
*
|
677 |
+
* @param string $key See toolset_getarr().
|
678 |
+
* @param mixed $default See toolset_getarr().
|
679 |
+
* @param null|array $valid See toolset_getarr().
|
680 |
+
*
|
681 |
+
* @return mixed See wpv_getarr().
|
682 |
+
*
|
683 |
+
* @since 1.7
|
684 |
+
*/
|
685 |
+
function toolset_getget( $key, $default = '', $valid = null ) {
|
686 |
+
return toolset_getarr( $_GET, $key, $default, $valid );
|
687 |
+
}
|
688 |
+
|
689 |
+
|
690 |
+
/**
|
691 |
+
* Safely retrieve a key from given array (meant for $_POST, $_GET, etc).
|
692 |
+
*
|
693 |
+
* Checks if the key is set in the source array. If not, default value is returned. Optionally validates against array
|
694 |
+
* of allowed values and returns default value if the validation fails.
|
695 |
+
*
|
696 |
+
* @param array $source The source array.
|
697 |
+
* @param string $key The key to be retrieved from the source array.
|
698 |
+
* @param mixed $default Default value to be returned if key is not set or the value is invalid. Optional.
|
699 |
+
* Default is empty string.
|
700 |
+
* @param null|array $valid If an array is provided, the value will be validated against it's elements.
|
701 |
+
*
|
702 |
+
* @return mixed The value of the given key or $default.
|
703 |
+
*
|
704 |
+
* @since 1.7
|
705 |
+
*/
|
706 |
+
function toolset_getarr( &$source, $key, $default = '', $valid = null ) {
|
707 |
+
if( isset( $source[ $key ] ) ) {
|
708 |
+
$val = $source[ $key ];
|
709 |
+
if( is_array( $valid ) && !in_array( $val, $valid ) ) {
|
710 |
+
return $default;
|
711 |
+
}
|
712 |
+
return $val;
|
713 |
+
} else {
|
714 |
+
return $default;
|
715 |
+
}
|
716 |
+
}
|
embedded/toolset/toolset-common/res/css/toolset-common.css
CHANGED
@@ -13,6 +13,7 @@ Toolset Primary Button Style - use with .button.button-primary-toolset classname
|
|
13 |
box-shadow: inset 0 1px 0 rgba(239, 239, 239, 0.5), 0 1px 0 rgba(0,0,0,.15);
|
14 |
color: #fff !important;
|
15 |
text-decoration: none;
|
|
|
16 |
}
|
17 |
|
18 |
.wp-core-ui .button-primary-toolset.hover,
|
@@ -44,6 +45,13 @@ Toolset Primary Button Style - use with .button.button-primary-toolset classname
|
|
44 |
box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
.wp-core-ui .button-primary-toolset[disabled],
|
48 |
.wp-core-ui .button-primary-toolset:disabled,
|
49 |
.wp-core-ui .button-primary-toolset.disabled {
|
13 |
box-shadow: inset 0 1px 0 rgba(239, 239, 239, 0.5), 0 1px 0 rgba(0,0,0,.15);
|
14 |
color: #fff !important;
|
15 |
text-decoration: none;
|
16 |
+
text-shadow: 0 -1px 1px #EF6223, 1px 0 1px #EF6223, 0 1px 1px #EF6223, -1px 0 1px #EF6223;
|
17 |
}
|
18 |
|
19 |
.wp-core-ui .button-primary-toolset.hover,
|
45 |
box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
|
46 |
}
|
47 |
|
48 |
+
.wp-core-ui .notice .button-primary-toolset.active,
|
49 |
+
.wp-core-ui .notice .button-primary-toolset.active:hover,
|
50 |
+
.wp-core-ui .notice .button-primary-toolset.active:focus,
|
51 |
+
.wp-core-ui .notice .button-primary-toolset:active {
|
52 |
+
vertical-align: baseline;
|
53 |
+
}
|
54 |
+
|
55 |
.wp-core-ui .button-primary-toolset[disabled],
|
56 |
.wp-core-ui .button-primary-toolset:disabled,
|
57 |
.wp-core-ui .button-primary-toolset.disabled {
|
embedded/toolset/toolset-common/toolset-forms/classes/class.colorpicker.php
CHANGED
@@ -62,7 +62,7 @@ class WPToolset_Field_Colorpicker extends FieldFactory
|
|
62 |
'args' => array(
|
63 |
'hexadecimal'
|
64 |
),
|
65 |
-
'message' => __(
|
66 |
);
|
67 |
return $validation;
|
68 |
}
|
62 |
'args' => array(
|
63 |
'hexadecimal'
|
64 |
),
|
65 |
+
'message' => __('Please use a valid hexadecimal value.', 'wpv-views' ),
|
66 |
);
|
67 |
return $validation;
|
68 |
}
|
embedded/toolset/toolset-common/toolset-forms/classes/class.credfile.php
CHANGED
@@ -89,7 +89,13 @@ class WPToolset_Field_Credfile extends WPToolset_Field_Textfield {
|
|
89 |
|
90 |
//require_once WPTOOLSET_COMMON_PATH . "/utility/utils.php";
|
91 |
//wp_localize_script('my_ajax_file_uploader_thing', 'settings', array('ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('uploader_nonce')));
|
92 |
-
wp_localize_script('my_ajax_file_uploader', 'settings',
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
|
95 |
public static function registerScripts() {
|
89 |
|
90 |
//require_once WPTOOLSET_COMMON_PATH . "/utility/utils.php";
|
91 |
//wp_localize_script('my_ajax_file_uploader_thing', 'settings', array('ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('uploader_nonce')));
|
92 |
+
wp_localize_script('my_ajax_file_uploader', 'settings',
|
93 |
+
array('media_settings' => self::get_image_sizes('thumbnail'),
|
94 |
+
'ajaxurl' => plugins_url("submit.php", __FILE__),
|
95 |
+
'delete_confirm_text' => __('Are you sure to delete this file ?', 'wp-cred'),
|
96 |
+
'delete_alert_text' => __('Generic Error in deleting file', 'wp-cred'),
|
97 |
+
'too_big_file_alert_text' => __('File is too big', 'wp-cred'),
|
98 |
+
'nonce' => wp_create_nonce('ajax_nonce')));
|
99 |
}
|
100 |
|
101 |
public static function registerScripts() {
|
embedded/toolset/toolset-common/toolset-forms/classes/class.field_factory.php
CHANGED
@@ -140,9 +140,19 @@ abstract class FieldFactory extends FieldAbstract
|
|
140 |
|
141 |
public function getAttr() {
|
142 |
if ( array_key_exists( 'attribute', $this->_data ) ) {
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
-
return array();
|
146 |
}
|
147 |
|
148 |
public function getWPMLAction()
|
140 |
|
141 |
public function getAttr() {
|
142 |
if ( array_key_exists( 'attribute', $this->_data ) ) {
|
143 |
+
/**
|
144 |
+
* Change field attributes
|
145 |
+
*
|
146 |
+
* This filter allow to change field attributes.
|
147 |
+
*
|
148 |
+
* @since x.x.x
|
149 |
+
*
|
150 |
+
* @param array $attributes array with field attributes
|
151 |
+
* @param object $field current field
|
152 |
+
*/
|
153 |
+
return apply_filters( 'toolset_field_factory_get_attributes', $this->_data['attribute'], $this);
|
154 |
}
|
155 |
+
return apply_filters( 'toolset_field_factory_get_attributes', array(), $this);
|
156 |
}
|
157 |
|
158 |
public function getWPMLAction()
|
embedded/toolset/toolset-common/toolset-forms/classes/class.types.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
if ( !class_exists('WPToolset_Types') ){
|
14 |
class WPToolset_Types
|
15 |
{
|
16 |
-
|
17 |
/**
|
18 |
* Filters Types field to match data structure needed for shared code.
|
19 |
*
|
@@ -409,7 +409,7 @@ class WPToolset_Types
|
|
409 |
|
410 |
// Get field settings
|
411 |
$c_field = self::getConfig( $c_field_id );
|
412 |
-
|
413 |
// If it's Types field
|
414 |
if ( !empty( $c_field ) ) {
|
415 |
|
@@ -463,7 +463,7 @@ class WPToolset_Types
|
|
463 |
*/
|
464 |
public static function getFields()
|
465 |
{
|
466 |
-
return get_option( 'wpcf-fields', array() );
|
467 |
}
|
468 |
|
469 |
/**
|
13 |
if ( !class_exists('WPToolset_Types') ){
|
14 |
class WPToolset_Types
|
15 |
{
|
16 |
+
static $is_user_meta = false;
|
17 |
/**
|
18 |
* Filters Types field to match data structure needed for shared code.
|
19 |
*
|
409 |
|
410 |
// Get field settings
|
411 |
$c_field = self::getConfig( $c_field_id );
|
412 |
+
|
413 |
// If it's Types field
|
414 |
if ( !empty( $c_field ) ) {
|
415 |
|
463 |
*/
|
464 |
public static function getFields()
|
465 |
{
|
466 |
+
return self::$is_user_meta ? get_option( 'wpcf-usermeta', array() ) : get_option( 'wpcf-fields', array() );
|
467 |
}
|
468 |
|
469 |
/**
|
embedded/toolset/toolset-common/toolset-forms/classes/class.video.php
CHANGED
@@ -55,6 +55,7 @@ class WPToolset_Field_Video extends WPToolset_Field_File
|
|
55 |
'mpe',
|
56 |
'mpeg',
|
57 |
'mpg',
|
|
|
58 |
);
|
59 |
$valid_extensions = apply_filters( 'toolset_valid_video_extentions', $valid_extensions);
|
60 |
$validation['extension'] = array(
|
55 |
'mpe',
|
56 |
'mpeg',
|
57 |
'mpg',
|
58 |
+
'quicktime'
|
59 |
);
|
60 |
$valid_extensions = apply_filters( 'toolset_valid_video_extentions', $valid_extensions);
|
61 |
$validation['extension'] = array(
|
embedded/toolset/toolset-common/toolset-forms/classes/class.wysiwyg.php
CHANGED
@@ -20,7 +20,10 @@ class WPToolset_Field_Wysiwyg extends WPToolset_Field_Textarea
|
|
20 |
$markup = '';
|
21 |
if ( is_admin() ) {
|
22 |
$markup .= '<div class="form-item form-item-markup">';
|
23 |
-
$markup .= sprintf(
|
|
|
|
|
|
|
24 |
}
|
25 |
$markup .= stripcslashes($this->getDescription());
|
26 |
$markup .= $this->_editor($attributes);
|
20 |
$markup = '';
|
21 |
if ( is_admin() ) {
|
22 |
$markup .= '<div class="form-item form-item-markup">';
|
23 |
+
$markup .= sprintf(
|
24 |
+
'<label class="wpt-form-label wpt-form-textfield-label">%s</label>',
|
25 |
+
stripcslashes($this->getTitle())
|
26 |
+
);
|
27 |
}
|
28 |
$markup .= stripcslashes($this->getDescription());
|
29 |
$markup .= $this->_editor($attributes);
|
embedded/toolset/toolset-common/toolset-forms/classes/submit.php
CHANGED
@@ -47,7 +47,7 @@ send_origin_headers();
|
|
47 |
$data = array();
|
48 |
|
49 |
if (isset($_REQUEST['nonce']) && check_ajax_referer('ajax_nonce', 'nonce', false)) {
|
50 |
-
|
51 |
if (isset($_POST['action']) && $_POST['action'] == 'delete' && isset($_POST['file'])) {
|
52 |
$file = $_POST['file'];
|
53 |
|
@@ -87,50 +87,52 @@ if (isset($_REQUEST['nonce']) && check_ajax_referer('ajax_nonce', 'nonce', false
|
|
87 |
// }
|
88 |
//$data = ($res) ? array('result' => $res) : array('result' => $res, 'error' => 'Error Deleting ' . $file);
|
89 |
} else {
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
foreach ($_FILES as $file) {
|
99 |
//For repetitive
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
105 |
}
|
106 |
}
|
107 |
-
}
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
|
|
129 |
}
|
|
|
|
|
|
|
130 |
}
|
131 |
-
$data = ($error) ? array('error' => 'There was an error uploading your files: ' . $res['error']) : array('files' => $files, 'delete_nonce' => time());
|
132 |
} else {
|
133 |
-
$data = array('error' => 'Error
|
134 |
}
|
135 |
}
|
136 |
} else {
|
47 |
$data = array();
|
48 |
|
49 |
if (isset($_REQUEST['nonce']) && check_ajax_referer('ajax_nonce', 'nonce', false)) {
|
50 |
+
|
51 |
if (isset($_POST['action']) && $_POST['action'] == 'delete' && isset($_POST['file'])) {
|
52 |
$file = $_POST['file'];
|
53 |
|
87 |
// }
|
88 |
//$data = ($res) ? array('result' => $res) : array('result' => $res, 'error' => 'Error Deleting ' . $file);
|
89 |
} else {
|
90 |
+
if (isset($_GET['id'])) {
|
91 |
+
$post_id = intval($_GET['id']);
|
92 |
+
$error = false;
|
93 |
+
$files = array();
|
94 |
+
|
95 |
+
$upload_overrides = array('test_form' => false);
|
96 |
+
if (!empty($_FILES)) {
|
97 |
+
foreach ($_FILES as $file) {
|
|
|
98 |
//For repetitive
|
99 |
+
foreach ($file as &$f) {
|
100 |
+
if (is_array($f)) {
|
101 |
+
foreach ($f as $p) {
|
102 |
+
$f = $p;
|
103 |
+
break;
|
104 |
+
}
|
105 |
}
|
106 |
}
|
|
|
107 |
|
108 |
+
$res = wp_handle_upload($file, $upload_overrides);
|
109 |
+
|
110 |
+
if (!isset($res['error'])) {
|
111 |
+
|
112 |
+
$attachment = array(
|
113 |
+
'post_mime_type' => $res['type'],
|
114 |
+
'post_title' => basename($res['file']),
|
115 |
+
'post_content' => '',
|
116 |
+
'post_status' => 'inherit',
|
117 |
+
'post_parent' => $post_id,
|
118 |
+
'post_type' => 'attachment',
|
119 |
+
'guid' => $res['url'],
|
120 |
+
);
|
121 |
+
$attach_id = wp_insert_attachment($attachment, $res['file']);
|
122 |
+
$attach_data = wp_generate_attachment_metadata($attach_id, $res['file']);
|
123 |
+
wp_update_attachment_metadata($attach_id, $attach_data);
|
124 |
+
|
125 |
+
$files[] = $res['url'];
|
126 |
+
} else {
|
127 |
+
$error = true;
|
128 |
+
}
|
129 |
}
|
130 |
+
$data = ($error) ? array('error' => 'There was an error uploading your files: ' . $res['error']) : array('files' => $files, 'delete_nonce' => time());
|
131 |
+
} else {
|
132 |
+
$data = array('error' => 'Error: Files is too big, Max upload size is: ' . ini_get('post_max_size'));
|
133 |
}
|
|
|
134 |
} else {
|
135 |
+
$data = array('result' => false, 'error' => 'Error post id: check _cred_cred_prefix_post_id');
|
136 |
}
|
137 |
}
|
138 |
} else {
|
embedded/toolset/toolset-common/toolset-forms/css/wpt-jquery-ui/jquery-ui-1.11.4.custom.css
CHANGED
@@ -53,10 +53,11 @@
|
|
53 |
filter:Alpha(Opacity=0); /* support: IE8 */
|
54 |
}
|
55 |
|
|
|
56 |
.ui-front {
|
57 |
z-index: 100;
|
58 |
}
|
59 |
-
|
60 |
|
61 |
/* Interaction Cues
|
62 |
----------------------------------*/
|
@@ -258,7 +259,7 @@
|
|
258 |
----------------------------------*/
|
259 |
.ui-datepicker.ui-widget {
|
260 |
font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
|
261 |
-
font-size: 1.1em
|
262 |
}
|
263 |
.ui-datepicker.ui-widget .ui-widget {
|
264 |
font-size: 1em;
|
53 |
filter:Alpha(Opacity=0); /* support: IE8 */
|
54 |
}
|
55 |
|
56 |
+
/*
|
57 |
.ui-front {
|
58 |
z-index: 100;
|
59 |
}
|
60 |
+
*/
|
61 |
|
62 |
/* Interaction Cues
|
63 |
----------------------------------*/
|
259 |
----------------------------------*/
|
260 |
.ui-datepicker.ui-widget {
|
261 |
font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
|
262 |
+
/*font-size: 1.1em;*/
|
263 |
}
|
264 |
.ui-datepicker.ui-widget .ui-widget {
|
265 |
font-size: 1em;
|
embedded/toolset/toolset-common/toolset-forms/css/wpt-toolset-backend.css
CHANGED
@@ -286,6 +286,7 @@ img.ui-datepicker-trigger {
|
|
286 |
box-shadow: inset 0 1px 0 rgba(239, 239, 239, 0.5), 0 1px 0 rgba(0,0,0,.15);
|
287 |
color: #fff;
|
288 |
text-decoration: none;
|
|
|
289 |
}
|
290 |
|
291 |
.wp-core-ui .button-primary-toolset.hover,
|
@@ -317,6 +318,13 @@ img.ui-datepicker-trigger {
|
|
317 |
box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
|
318 |
}
|
319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
.wp-core-ui .button-primary-toolset[disabled],
|
321 |
.wp-core-ui .button-primary-toolset:disabled,
|
322 |
.wp-core-ui .button-primary-toolset.disabled {
|
286 |
box-shadow: inset 0 1px 0 rgba(239, 239, 239, 0.5), 0 1px 0 rgba(0,0,0,.15);
|
287 |
color: #fff;
|
288 |
text-decoration: none;
|
289 |
+
text-shadow: 0 -1px 1px #EF6223, 1px 0 1px #EF6223, 0 1px 1px #EF6223, -1px 0 1px #EF6223;
|
290 |
}
|
291 |
|
292 |
.wp-core-ui .button-primary-toolset.hover,
|
318 |
box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
|
319 |
}
|
320 |
|
321 |
+
.wp-core-ui .notice .button-primary-toolset.active,
|
322 |
+
.wp-core-ui .notice .button-primary-toolset.active:hover,
|
323 |
+
.wp-core-ui .notice .button-primary-toolset.active:focus,
|
324 |
+
.wp-core-ui .notice .button-primary-toolset:active {
|
325 |
+
vertical-align: baseline;
|
326 |
+
}
|
327 |
+
|
328 |
.wp-core-ui .button-primary-toolset[disabled],
|
329 |
.wp-core-ui .button-primary-toolset:disabled,
|
330 |
.wp-core-ui .button-primary-toolset.disabled {
|
embedded/toolset/toolset-common/toolset-forms/js/conditional.js
CHANGED
@@ -619,7 +619,8 @@ var wptCond = (function ($) {
|
|
619 |
result = parser.eval();
|
620 |
}
|
621 |
catch (e) {
|
622 |
-
|
|
|
623 |
}
|
624 |
|
625 |
//https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/196173370/comments#309696464
|
@@ -713,7 +714,8 @@ var wptCond = (function ($) {
|
|
713 |
result2 = parser.eval();
|
714 |
}
|
715 |
catch (e) {
|
716 |
-
|
|
|
717 |
}
|
718 |
|
719 |
_showHide(result || result2, _getAffected(field, formID));
|
619 |
result = parser.eval();
|
620 |
}
|
621 |
catch (e) {
|
622 |
+
if (wptCondDebug)
|
623 |
+
console.info("Error in Tokenizer", e, expression, " there may be an error in your expression syntax");
|
624 |
}
|
625 |
|
626 |
//https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/196173370/comments#309696464
|
714 |
result2 = parser.eval();
|
715 |
}
|
716 |
catch (e) {
|
717 |
+
if (wptCondDebug)
|
718 |
+
console.info("Error in Tokenizer", e, expression, " there may be an error in your expression syntax");
|
719 |
}
|
720 |
|
721 |
_showHide(result || result2, _getAffected(field, formID));
|
embedded/toolset/toolset-common/toolset-forms/js/jquery_upload/file_upload.js
CHANGED
@@ -1,107 +1,3 @@
|
|
1 |
-
//console.log(settings.ajaxurl);
|
2 |
-
//jQuery(function ()
|
3 |
-
//{
|
4 |
-
// // Variable to store your files
|
5 |
-
// var files;
|
6 |
-
//
|
7 |
-
// // Add events
|
8 |
-
// jQuery('input[type=file]').on('change', prepareUpload);
|
9 |
-
// jQuery('.cred-form').on('submit', uploadFiles);
|
10 |
-
//
|
11 |
-
// // Grab the files and set them to our variable
|
12 |
-
// function prepareUpload(event)
|
13 |
-
// {
|
14 |
-
// files = event.target.files;
|
15 |
-
// console.log(files);
|
16 |
-
// }
|
17 |
-
//
|
18 |
-
// // Catch the form submit and upload the files
|
19 |
-
// function uploadFiles(event)
|
20 |
-
// {
|
21 |
-
// event.stopPropagation(); // Stop stuff happening
|
22 |
-
// event.preventDefault(); // Totally stop stuff happening
|
23 |
-
//
|
24 |
-
// var data = new FormData();
|
25 |
-
// jQuery.each(jQuery('input[type="file"]')[0].files, function(i, file) {
|
26 |
-
// data.append('file-'+i, file);
|
27 |
-
// });
|
28 |
-
//
|
29 |
-
// jQuery.ajax({
|
30 |
-
// url: settings.ajaxurl+"?files",
|
31 |
-
// type: 'POST',
|
32 |
-
// data: data,
|
33 |
-
// cache: false,
|
34 |
-
// dataType: 'json',
|
35 |
-
// processData: false, // Don't process the files
|
36 |
-
// contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
37 |
-
// success: function (data, textStatus, jqXHR)
|
38 |
-
// {
|
39 |
-
// if (typeof data.error === 'undefined')
|
40 |
-
// {
|
41 |
-
// // Success so call function to process the form
|
42 |
-
// //submitForm(event, data);
|
43 |
-
// }
|
44 |
-
// else
|
45 |
-
// {
|
46 |
-
// // Handle errors here
|
47 |
-
// console.log('ERRORS: ' + data.error);
|
48 |
-
// }
|
49 |
-
// },
|
50 |
-
// error: function (jqXHR, textStatus, errorThrown)
|
51 |
-
// {
|
52 |
-
// // Handle errors here
|
53 |
-
// console.log('ERRORS: ' + textStatus);
|
54 |
-
// // STOP LOADING SPINNER
|
55 |
-
// }
|
56 |
-
// });
|
57 |
-
// }
|
58 |
-
//
|
59 |
-
// function submitForm(event, data)
|
60 |
-
// {
|
61 |
-
// // Create a jQuery object from the form
|
62 |
-
// jQueryform = jQuery(event.target);
|
63 |
-
//
|
64 |
-
// // Serialize the form data
|
65 |
-
// var formData = jQueryform.serialize();
|
66 |
-
//
|
67 |
-
// // You should sterilise the file names
|
68 |
-
// jQuery.each(data.files, function (key, value)
|
69 |
-
// {
|
70 |
-
// formData = formData + '&filenames[]=' + value;
|
71 |
-
// });
|
72 |
-
//
|
73 |
-
// jQuery.ajax({
|
74 |
-
// url: 'submit.php',
|
75 |
-
// type: 'POST',
|
76 |
-
// data: formData,
|
77 |
-
// cache: false,
|
78 |
-
// dataType: 'json',
|
79 |
-
// success: function (data, textStatus, jqXHR)
|
80 |
-
// {
|
81 |
-
// if (typeof data.error === 'undefined')
|
82 |
-
// {
|
83 |
-
// // Success so call function to process the form
|
84 |
-
// console.log('SUCCESS: ' + data.success);
|
85 |
-
// }
|
86 |
-
// else
|
87 |
-
// {
|
88 |
-
// // Handle errors here
|
89 |
-
// console.log('ERRORS: ' + data.error);
|
90 |
-
// }
|
91 |
-
// },
|
92 |
-
// error: function (jqXHR, textStatus, errorThrown)
|
93 |
-
// {
|
94 |
-
// // Handle errors here
|
95 |
-
// console.log('ERRORS: ' + textStatus);
|
96 |
-
// },
|
97 |
-
// complete: function ()
|
98 |
-
// {
|
99 |
-
// // STOP LOADING SPINNER
|
100 |
-
// }
|
101 |
-
// });
|
102 |
-
// }
|
103 |
-
//});
|
104 |
-
|
105 |
function getExtension(filename) {
|
106 |
return filename.split('.').pop().toLowerCase();
|
107 |
}
|
@@ -134,11 +30,9 @@ jQuery(function () {
|
|
134 |
|
135 |
function o(i, file) {
|
136 |
var url = settings.ajaxurl;
|
137 |
-
console.log("URL:" + url);
|
138 |
var nonce = settings.nonce;
|
139 |
-
console.log("NONCE:" + nonce);
|
140 |
-
var id = jQuery("input[name='_cred_cred_prefix_post_id']").val();
|
141 |
-
console.log("ID:" + id);
|
142 |
|
143 |
var curr_file = file;
|
144 |
var validation = jQuery(curr_file).attr('data-wpt-validate');
|
@@ -159,22 +53,30 @@ jQuery(function () {
|
|
159 |
}
|
160 |
}
|
161 |
|
|
|
|
|
162 |
jQuery(file).fileupload({
|
163 |
-
url: url + '?nonce=' + nonce,
|
164 |
dataType: 'json',
|
165 |
cache: false,
|
166 |
maxChunkSize: 0,
|
167 |
-
formData: {id:
|
168 |
//acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
169 |
done: function (e, data) {
|
170 |
var id = jQuery(curr_file).attr('id');
|
171 |
-
var wpt_id = id.replace("_file", "");
|
172 |
//progress bar hide
|
173 |
//jQuery('#progress_' + wpt_id).css({'width': '0%'});
|
174 |
-
jQuery('#progress_' + wpt_id + ' .progress-bar').css(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
{'width': '0%'}
|
176 |
);
|
177 |
-
jQuery('#
|
178 |
|
179 |
if (data._response.result.error && data._response.result.error != '') {
|
180 |
alert(data._response.result.error);
|
@@ -183,13 +85,13 @@ jQuery(function () {
|
|
183 |
jQuery.each(data.result.files, function (index, file) {
|
184 |
|
185 |
var id = jQuery(curr_file).attr('id');
|
186 |
-
console.log(id);
|
187 |
var wpt_id = id.replace("_file", "");
|
188 |
// var wpt_id = jQuery(curr_file).attr('data-wpt-name');
|
189 |
// wpt_id = wpt_id.replace(/[^a-z0-9\-\_]/gi, '');
|
190 |
-
console.log(wpt_id);
|
191 |
var myid = wpt_id;
|
192 |
-
console.log(myid);
|
193 |
|
194 |
if (id.toLowerCase().indexOf("wpt-form-el") >= 0) {
|
195 |
var number = id.replace(/[^0-9]/g, '');
|
@@ -198,7 +100,7 @@ jQuery(function () {
|
|
198 |
} else
|
199 |
var hidden_id = wpt_id + '_hidden';
|
200 |
|
201 |
-
console.log(hidden_id);
|
202 |
|
203 |
//hidden text set
|
204 |
jQuery('#' + hidden_id).val(file);
|
@@ -231,7 +133,7 @@ jQuery(function () {
|
|
231 |
|
232 |
//add function to delete button
|
233 |
jQuery("#butt_" + myid).on('click', function () {
|
234 |
-
if (confirm(
|
235 |
jQuery("#loaded_" + myid).remove();
|
236 |
jQuery("#butt_" + myid).remove();
|
237 |
|
@@ -249,12 +151,11 @@ jQuery(function () {
|
|
249 |
dataType: 'json',
|
250 |
success: function (data)
|
251 |
{
|
252 |
-
console.log(data);
|
253 |
if (!data.result) {
|
254 |
if (data.error)
|
255 |
alert(data.error);
|
256 |
else
|
257 |
-
alert(
|
258 |
}
|
259 |
credfile_fu_init();
|
260 |
},
|
@@ -276,7 +177,7 @@ jQuery(function () {
|
|
276 |
uploadErrors.push(validation_message);
|
277 |
}
|
278 |
if (data.originalFiles[0]['size'].length && data.originalFiles[0]['size'] > 5000000) {
|
279 |
-
uploadErrors.push(
|
280 |
}
|
281 |
if (uploadErrors.length > 0) {
|
282 |
alert(uploadErrors.join("\n"));
|
@@ -290,12 +191,17 @@ jQuery(function () {
|
|
290 |
},
|
291 |
progressall: function (e, data) {
|
292 |
var progress = parseInt(data.loaded / data.total * 100, 10);
|
293 |
-
console.log("progress => " + progress + "%");
|
294 |
var id = jQuery(curr_file).attr('id');
|
295 |
-
var wpt_id = id.replace("_file", "");
|
296 |
-
jQuery('#progress_' + wpt_id).show();
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
//jQuery('#progress_' + wpt_id).css({'width': '100%'});
|
298 |
-
jQuery('#
|
299 |
{'width': progress + '%'}
|
300 |
);
|
301 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
function getExtension(filename) {
|
2 |
return filename.split('.').pop().toLowerCase();
|
3 |
}
|
30 |
|
31 |
function o(i, file) {
|
32 |
var url = settings.ajaxurl;
|
33 |
+
//console.log("URL:" + url);
|
34 |
var nonce = settings.nonce;
|
35 |
+
//console.log("NONCE:" + nonce);
|
|
|
|
|
36 |
|
37 |
var curr_file = file;
|
38 |
var validation = jQuery(curr_file).attr('data-wpt-validate');
|
53 |
}
|
54 |
}
|
55 |
|
56 |
+
var myid = jQuery("input[name='_cred_cred_prefix_post_id']").val();
|
57 |
+
|
58 |
jQuery(file).fileupload({
|
59 |
+
url: url + '?id=' + myid + '&nonce=' + nonce,
|
60 |
dataType: 'json',
|
61 |
cache: false,
|
62 |
maxChunkSize: 0,
|
63 |
+
formData: {id: myid},
|
64 |
//acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
65 |
done: function (e, data) {
|
66 |
var id = jQuery(curr_file).attr('id');
|
|
|
67 |
//progress bar hide
|
68 |
//jQuery('#progress_' + wpt_id).css({'width': '0%'});
|
69 |
+
// jQuery('#progress_' + wpt_id + ' .progress-bar').css(
|
70 |
+
// {'width': '0%'}
|
71 |
+
// );
|
72 |
+
// jQuery('#progress_' + wpt_id).hide();
|
73 |
+
|
74 |
+
var wpt_id = jQuery(this).next(".meter").attr("id"); //id.replace("_file", "");
|
75 |
+
jQuery('#' + wpt_id).show();
|
76 |
+
jQuery('#' + wpt_id + ' .progress-bar').css(
|
77 |
{'width': '0%'}
|
78 |
);
|
79 |
+
jQuery('#' + wpt_id).hide();
|
80 |
|
81 |
if (data._response.result.error && data._response.result.error != '') {
|
82 |
alert(data._response.result.error);
|
85 |
jQuery.each(data.result.files, function (index, file) {
|
86 |
|
87 |
var id = jQuery(curr_file).attr('id');
|
88 |
+
//console.log(id);
|
89 |
var wpt_id = id.replace("_file", "");
|
90 |
// var wpt_id = jQuery(curr_file).attr('data-wpt-name');
|
91 |
// wpt_id = wpt_id.replace(/[^a-z0-9\-\_]/gi, '');
|
92 |
+
//console.log(wpt_id);
|
93 |
var myid = wpt_id;
|
94 |
+
//console.log(myid);
|
95 |
|
96 |
if (id.toLowerCase().indexOf("wpt-form-el") >= 0) {
|
97 |
var number = id.replace(/[^0-9]/g, '');
|
100 |
} else
|
101 |
var hidden_id = wpt_id + '_hidden';
|
102 |
|
103 |
+
//console.log(hidden_id);
|
104 |
|
105 |
//hidden text set
|
106 |
jQuery('#' + hidden_id).val(file);
|
133 |
|
134 |
//add function to delete button
|
135 |
jQuery("#butt_" + myid).on('click', function () {
|
136 |
+
if (confirm(settings.delete_confirm_text)) {
|
137 |
jQuery("#loaded_" + myid).remove();
|
138 |
jQuery("#butt_" + myid).remove();
|
139 |
|
151 |
dataType: 'json',
|
152 |
success: function (data)
|
153 |
{
|
|
|
154 |
if (!data.result) {
|
155 |
if (data.error)
|
156 |
alert(data.error);
|
157 |
else
|
158 |
+
alert(settings.delete_alert_text);
|
159 |
}
|
160 |
credfile_fu_init();
|
161 |
},
|
177 |
uploadErrors.push(validation_message);
|
178 |
}
|
179 |
if (data.originalFiles[0]['size'].length && data.originalFiles[0]['size'] > 5000000) {
|
180 |
+
uploadErrors.push(settings.too_big_file_alert_text);
|
181 |
}
|
182 |
if (uploadErrors.length > 0) {
|
183 |
alert(uploadErrors.join("\n"));
|
191 |
},
|
192 |
progressall: function (e, data) {
|
193 |
var progress = parseInt(data.loaded / data.total * 100, 10);
|
|
|
194 |
var id = jQuery(curr_file).attr('id');
|
195 |
+
// var wpt_id = id.replace("_file", "");
|
196 |
+
// jQuery('#progress_' + wpt_id).show();
|
197 |
+
// //jQuery('#progress_' + wpt_id).css({'width': '100%'});
|
198 |
+
// jQuery('#progress_' + wpt_id + ' .progress-bar').css(
|
199 |
+
// {'width': progress + '%'}
|
200 |
+
// );
|
201 |
+
var wpt_id = jQuery(this).next(".meter").attr("id"); //id.replace("_file", "");
|
202 |
+
jQuery('#' + wpt_id).show();
|
203 |
//jQuery('#progress_' + wpt_id).css({'width': '100%'});
|
204 |
+
jQuery('#' + wpt_id + ' .progress-bar').css(
|
205 |
{'width': progress + '%'}
|
206 |
);
|
207 |
},
|
embedded/toolset/toolset-common/toolset-forms/js/main.js
CHANGED
@@ -335,9 +335,20 @@ toolsetForms.CRED_taxonomy = function () {
|
|
335 |
self.add_new_show_hide(taxonomy, this);
|
336 |
});
|
337 |
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
self.add_new_show_hide = function (taxonomy, button) {
|
339 |
var form = jQuery(button).closest('form');
|
340 |
-
jQuery(
|
|
|
|
|
|
|
|
|
|
|
341 |
self.hide_parent_button_if_no_terms(taxonomy, button);
|
342 |
}
|
343 |
|
335 |
self.add_new_show_hide(taxonomy, this);
|
336 |
});
|
337 |
|
338 |
+
//https://onthegosystems.myjetbrains.com/youtrack/issue/cred-286
|
339 |
+
// self.add_new_show_hide = function (taxonomy, button) {
|
340 |
+
// var form = jQuery(button).closest('form');
|
341 |
+
// jQuery('.js-wpt-hierarchical-taxonomy-add-new-' + taxonomy, form).toggle();
|
342 |
+
// self.hide_parent_button_if_no_terms(taxonomy, button);
|
343 |
+
// }
|
344 |
self.add_new_show_hide = function (taxonomy, button) {
|
345 |
var form = jQuery(button).closest('form');
|
346 |
+
var add_wrap = jQuery(".js-wpt-hierarchical-taxonomy-add-new-" + taxonomy);
|
347 |
+
if(add_wrap.is(":visible")){
|
348 |
+
add_wrap.hide();
|
349 |
+
}else{
|
350 |
+
add_wrap.show();
|
351 |
+
}
|
352 |
self.hide_parent_button_if_no_terms(taxonomy, button);
|
353 |
}
|
354 |
|
embedded/toolset/toolset-common/toolset-forms/readme.txt
CHANGED
@@ -30,6 +30,11 @@ function my_toolset_valid_image_extentions($valid_extensions)
|
|
30 |
|
31 |
= Changelog =
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
2015-06-29
|
34 |
|
35 |
- Added ability to have default value for custom fields
|
30 |
|
31 |
= Changelog =
|
32 |
|
33 |
+
2015-10-08
|
34 |
+
|
35 |
+
- Fixed a problem with backslashes in WYSIWYG field title
|
36 |
+
https://onthegosystems.myjetbrains.com/youtrack/issue/tssupp-682
|
37 |
+
|
38 |
2015-06-29
|
39 |
|
40 |
- Added ability to have default value for custom fields
|
embedded/toolset/toolset-common/utility/js/utils.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
/**
|
2 |
-
* @author
|
3 |
-
* @version
|
4 |
-
* @revision
|
5 |
*/
|
6 |
|
7 |
if( typeof WPV_Toolset == 'undefined' )
|
8 |
{
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
}
|
13 |
|
14 |
if( typeof WPV_Toolset.Utils == 'undefined' ) WPV_Toolset.Utils = {};
|
@@ -35,7 +35,7 @@ WPV_Toolset.Utils.restoreEventPropagation = function( event ){
|
|
35 |
refEvent.returnValue = true;
|
36 |
refEvent.timeStamp = ( new Date() ).getTime();
|
37 |
} catch( e ){
|
38 |
-
|
39 |
return event;
|
40 |
}
|
41 |
|
@@ -58,141 +58,141 @@ WPV_Toolset.Utils.restoreEventPropagation = function( event ){
|
|
58 |
|
59 |
WPV_Toolset.Utils.do_ajax_post = function( params, callback_object )
|
60 |
{
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
};
|
88 |
|
89 |
;(function ( $, window, document, undefined ) {
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
dontShowAgainText:'',
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
|
197 |
if( self.prms.dontShowAgain && typeof self.prms.dontShowAgain === 'function' && self.prms.dontShowAgainText !== '' ){
|
198 |
self.$dontContainer = $('<span class="dont-wrap"></span>')
|
@@ -202,158 +202,158 @@ WPV_Toolset.Utils.do_ajax_post = function( params, callback_object )
|
|
202 |
self.$dontContainer.append( self.$dont_show, self.$dont_label );
|
203 |
self.box.append( self.$dontContainer );
|
204 |
|
205 |
-
self.prms.dontShowAgain.call(self.$dont_show, self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
self.remove.on('click', function(event){
|
212 |
-
self.wpvMessageRemove();
|
213 |
-
});
|
214 |
-
}
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
//if( is_open ) self.wpvMessageRemove();
|
219 |
-
if ( self.prms.position == 'before' ) {
|
220 |
-
self.container.prepend( self.box );
|
221 |
-
} else {
|
222 |
-
self.container.append( self.box );
|
223 |
-
}
|
224 |
-
self.container.data('has_message', true );
|
225 |
-
self.box.hide();
|
226 |
-
|
227 |
-
if( null !== self.prms.referTo )
|
228 |
-
{
|
229 |
-
self.box.css({
|
230 |
-
"position":"absolute",
|
231 |
-
"z-index":10000,
|
232 |
-
"top": self.prms.referTo.position().top + self.prms.offestY + "px",
|
233 |
-
"left": self.prms.referTo.position().left + self.prms.referTo.width() + self.prms.offestX + "px"
|
234 |
-
});
|
235 |
-
}
|
236 |
-
|
237 |
-
self.container.data( 'message-box', self.box );
|
238 |
-
|
239 |
-
self.box.fadeTo( null != prev ? 0 : self.prms.fadeIn, 1, function(){
|
240 |
$(this).trigger('wpv-message-open');
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
$(this).trigger('wpv-message-remove');
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
self.container.data('has_message', false );
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
$(this).trigger('wpv-message-remove');
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
|
306 |
|
307 |
-
|
308 |
|
309 |
-
|
310 |
-
|
311 |
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
|
324 |
-
|
325 |
|
326 |
-
|
327 |
|
328 |
-
|
329 |
-
|
330 |
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
|
335 |
-
|
336 |
-
|
337 |
|
338 |
-
|
339 |
-
|
340 |
|
341 |
-
|
342 |
-
|
343 |
|
344 |
-
|
345 |
|
346 |
-
|
347 |
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
})( jQuery, window, document );
|
352 |
|
353 |
jQuery( function( $ ) {
|
354 |
-
|
355 |
$( this )
|
356 |
-
|
357 |
.show()
|
358 |
.wpvToolsetHelp();
|
359 |
});
|
@@ -361,313 +361,313 @@ jQuery( function( $ ) {
|
|
361 |
|
362 |
if ( typeof jQuery.fn.wpvToolsetHelp === 'undefined' ) {
|
363 |
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
|
447 |
}
|
448 |
|
449 |
(function ($) {
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
})( jQuery );
|
467 |
|
468 |
(function ($) {
|
469 |
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
|
539 |
})( jQuery );
|
540 |
|
541 |
(function ($) {
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
|
656 |
})( jQuery );
|
657 |
|
658 |
WPV_Toolset.Utils.Loader = function()
|
659 |
{
|
660 |
-
|
661 |
-
|
662 |
|
663 |
-
|
664 |
|
665 |
-
|
666 |
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
|
672 |
if( typeof after === 'undefined' )
|
673 |
{
|
@@ -678,100 +678,100 @@ WPV_Toolset.Utils.Loader = function()
|
|
678 |
}
|
679 |
|
680 |
return self.loader;
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
|
690 |
return self.loader;
|
691 |
-
|
692 |
};
|
693 |
|
694 |
if( typeof _ != 'undefined' )
|
695 |
{
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
};
|
727 |
|
728 |
|
729 |
|
730 |
(function($) {
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
})(jQuery);
|
743 |
|
744 |
//Courtesy from http://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery
|
745 |
WPV_Toolset.Utils.escapeHtml = function(str) {
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
};
|
768 |
|
769 |
WPV_Toolset.Utils.editor_decode64 = function(input) {
|
770 |
var output = "",
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
"QRSTUVWXYZabcdef" +
|
776 |
"ghijklmnopqrstuv" +
|
777 |
"wxyz0123456789+/" +
|
@@ -1020,8 +1020,6 @@ String.prototype.regexEscape = function regexEscape() {
|
|
1020 |
|
1021 |
}
|
1022 |
});
|
1023 |
-
|
1024 |
-
return this;
|
1025 |
};
|
1026 |
|
1027 |
})(jQuery, window, document);
|
@@ -1109,25 +1107,8 @@ String.prototype.regexEscape = function regexEscape() {
|
|
1109 |
}).end();
|
1110 |
};
|
1111 |
|
1112 |
-
}(jQuery, window, document))
|
1113 |
-
;
|
1114 |
-
|
1115 |
-
/*
|
1116 |
-
|
1117 |
-
http://bigwilliam.com/jquery-fire-event-after-window-resize-is-completed/
|
1118 |
|
1119 |
-
// Usage
|
1120 |
-
$(window).resize(function() {
|
1121 |
-
var output = $('.output');
|
1122 |
-
$(output).text('RESIZING...');
|
1123 |
-
// Wait for it...
|
1124 |
-
waitForFinalEvent(function() {
|
1125 |
-
$(output).text('EVENT FIRED!');
|
1126 |
-
//...
|
1127 |
-
}, 500, "some unique string");
|
1128 |
-
});
|
1129 |
-
|
1130 |
-
*/
|
1131 |
var waitForFinalEvent = ( function () {
|
1132 |
var timers = {};
|
1133 |
return function ( callback, ms, uniqueId ) {
|
@@ -1137,7 +1118,7 @@ var waitForFinalEvent = ( function () {
|
|
1137 |
if ( timers[uniqueId] ) {
|
1138 |
clearTimeout( timers[uniqueId] );
|
1139 |
}
|
1140 |
-
|
1141 |
timers[uniqueId] = setTimeout( callback, ms );
|
1142 |
};
|
1143 |
} )();
|
@@ -1194,8 +1175,8 @@ if (!String.prototype.trim) {
|
|
1194 |
* @since unknown
|
1195 |
*/
|
1196 |
WPV_Toolset.Utils._strip_tags_and_preserve_text = function( text ){
|
1197 |
-
|
1198 |
-
|
1199 |
};
|
1200 |
|
1201 |
|
@@ -1210,16 +1191,24 @@ WPV_Toolset.Utils._strip_tags_and_preserve_text = function( text ){
|
|
1210 |
* @param {string} confirmationMessage Confirmation message that should be shown by the browser.
|
1211 |
*/
|
1212 |
WPV_Toolset.Utils.setConfirmUnload = function(checkIfConfirmationNeededCallback, onBeforeUnloadCallback, confirmationMessage) {
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/**
|
2 |
+
* @author Riccardo Strobbia
|
3 |
+
* @version 1.2
|
4 |
+
* @revision 04/06/2015 00:35
|
5 |
*/
|
6 |
|
7 |
if( typeof WPV_Toolset == 'undefined' )
|
8 |
{
|
9 |
+
var WPV_Toolset = {};
|
10 |
+
WPV_Toolset.message = {};
|
11 |
+
WPV_Toolset.message.container = null;
|
12 |
}
|
13 |
|
14 |
if( typeof WPV_Toolset.Utils == 'undefined' ) WPV_Toolset.Utils = {};
|
35 |
refEvent.returnValue = true;
|
36 |
refEvent.timeStamp = ( new Date() ).getTime();
|
37 |
} catch( e ){
|
38 |
+
// console.log(e.message );
|
39 |
return event;
|
40 |
}
|
41 |
|
58 |
|
59 |
WPV_Toolset.Utils.do_ajax_post = function( params, callback_object )
|
60 |
{
|
61 |
+
jQuery.post(ajaxurl, params, function (response) {
|
62 |
+
|
63 |
+
if ( (typeof(response) !== 'undefined') && response !== null && ( response.message || response.Data ) ) {
|
64 |
+
|
65 |
+
if( callback_object && callback_object.success && typeof callback_object.success == 'function' )
|
66 |
+
callback_object.success.call( this, response, params );
|
67 |
+
WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_success_'+params.action, response, params);
|
68 |
+
}
|
69 |
+
else if( (typeof(response) !== 'undefined') && response !== null && response.error )
|
70 |
+
{
|
71 |
+
|
72 |
+
if( callback_object && callback_object.error && typeof callback_object.error == 'function' )
|
73 |
+
callback_object.error.call(this);
|
74 |
+
WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_error_'+params.action, response, params);
|
75 |
+
}
|
76 |
+
}, 'json')
|
77 |
+
.fail(function (jqXHR, textStatus, errorThrown) {
|
78 |
+
console.log('Ajax call failed', textStatus, errorThrown)
|
79 |
+
if( callback_object && callback_object.fail && typeof callback_object.fail == 'function' )
|
80 |
+
callback_object.fail.call(this, errorThrown);
|
81 |
+
WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_fail_'+params.action, textStatus, errorThrown, params );
|
82 |
+
})
|
83 |
+
.always(function () {
|
84 |
+
//console.log( arguments );
|
85 |
+
WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_complete_'+params.action, arguments, params);
|
86 |
+
});
|
87 |
};
|
88 |
|
89 |
;(function ( $, window, document, undefined ) {
|
90 |
|
91 |
+
// Create the defaults once
|
92 |
+
var pluginName = "wpvToolsetMessage",
|
93 |
+
dataPlugin = "plugin_" + pluginName,
|
94 |
+
defaults = {
|
95 |
+
text : "Enter a customized text to be displayed",
|
96 |
+
type: '',
|
97 |
+
inline: false,
|
98 |
+
position : "after",
|
99 |
+
header: false,
|
100 |
+
headerText: false,
|
101 |
+
close: false,
|
102 |
+
use_this: true,
|
103 |
+
fadeIn: 100,
|
104 |
+
fadeOut: 100,
|
105 |
+
stay: false,
|
106 |
+
onClose: false,
|
107 |
+
onOpen: false,
|
108 |
+
onDestroy:false,
|
109 |
+
dontShowAgain:null,
|
110 |
dontShowAgainText:'',
|
111 |
+
args:[],
|
112 |
+
referTo: null,
|
113 |
+
offestX: -20,
|
114 |
+
offsetY: 0,
|
115 |
+
classname: '',
|
116 |
+
stay_for: 1200, // Ignored when 'msPerCharacter is given.
|
117 |
+
msPerCharacter: 50 // Ignered when 'stay_for' is given. This value is multiplied by the number of defaults.text characters count.
|
118 |
+
},
|
119 |
+
has_stay = false,
|
120 |
+
is_open = false,
|
121 |
+
prev = null,
|
122 |
+
prev_text = '';
|
123 |
+
|
124 |
+
// The actual plugin constructor
|
125 |
+
function Plugin(element, options) {
|
126 |
+
var self = this;
|
127 |
+
|
128 |
+
self.container = $(element);
|
129 |
+
|
130 |
+
self.prms = $.extend({}, defaults, options);
|
131 |
+
self._defaults = defaults;
|
132 |
+
self._name = pluginName;
|
133 |
+
|
134 |
+
self.box = null;
|
135 |
+
self.header = null;
|
136 |
+
self.remove = null;
|
137 |
+
self.tag = self.prms.inline ? 'span' : 'p';
|
138 |
+
self.bool = false;
|
139 |
+
|
140 |
+
if ( typeof (options.stay_for) === 'undefined' && typeof(self.prms.msPerCharacter) === 'number' ) { // If stay_for parameter wasn't passes when the plugin wass called AND msPerCharacter has correct type
|
141 |
+
self.prms.stay_for = self.prms.text.length * self.prms.msPerCharacter;
|
142 |
+
}
|
143 |
+
|
144 |
+
}
|
145 |
+
|
146 |
+
Plugin.prototype = {
|
147 |
+
init: function () {
|
148 |
+
var self = this;
|
149 |
+
|
150 |
+
if( self.container.data('has_message' ) )
|
151 |
+
{
|
152 |
+
self.destroy();
|
153 |
+
}
|
154 |
+
|
155 |
+
if( self.container.children().length > 0 )
|
156 |
+
{
|
157 |
+
self.container.children().each(function(i){
|
158 |
+
if( $(this).text() == self.prms.text )
|
159 |
+
{
|
160 |
+
self.bool = true;
|
161 |
+
}
|
162 |
+
});
|
163 |
+
}
|
164 |
+
|
165 |
+
if( self.bool ) return;
|
166 |
+
|
167 |
+
if( has_stay )
|
168 |
+
{
|
169 |
+
if( prev )
|
170 |
+
{
|
171 |
+
var rem = prev;
|
172 |
+
prev = null;
|
173 |
+
has_stay = false;
|
174 |
+
is_open = false;
|
175 |
+
rem.fadeTo( 0, 0, function(){
|
176 |
+
rem.remove();
|
177 |
+
rem = null;
|
178 |
+
});
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
if( self.prms.header && self.prms.headerText )
|
183 |
+
{
|
184 |
+
self.box = $('<div class="toolset-alert toolset-alert-'+self.prms.type+' '+self.prms.classname+'" />');
|
185 |
+
self.header = $('<h2 class="toolset-alert-self.header" />');
|
186 |
+
self.box.append(self.header);
|
187 |
+
self.header.text(self.prms.headerText);
|
188 |
+
self.box.append('<'+self.tag+'></'+self.tag+'>');
|
189 |
+
self.box.find(self.tag).html( self.prms.text );
|
190 |
+
}
|
191 |
+
else
|
192 |
+
{
|
193 |
+
self.box = $('<'+self.tag+' class="toolset-alert toolset-alert-'+self.prms.type+' '+self.prms.classname+'" />');
|
194 |
+
self.box.html( self.prms.text );
|
195 |
+
}
|
196 |
|
197 |
if( self.prms.dontShowAgain && typeof self.prms.dontShowAgain === 'function' && self.prms.dontShowAgainText !== '' ){
|
198 |
self.$dontContainer = $('<span class="dont-wrap"></span>')
|
202 |
self.$dontContainer.append( self.$dont_show, self.$dont_label );
|
203 |
self.box.append( self.$dontContainer );
|
204 |
|
205 |
+
self.prms.dontShowAgain.call(self.$dont_show, self, self.prms.args);
|
206 |
+
}
|
207 |
+
|
208 |
+
if( self.prms.close ){
|
209 |
+
self.remove = $('<i class="toolset-alert-close fa fa-times-circle icon-remove-sign js-icon-remove-sign"></i>');
|
210 |
+
self.box.append( self.remove );
|
211 |
+
self.remove.on('click', function(event){
|
212 |
+
self.wpvMessageRemove();
|
213 |
+
});
|
214 |
+
}
|
215 |
+
|
216 |
+
|
217 |
+
|
218 |
+
//if( is_open ) self.wpvMessageRemove();
|
219 |
+
if ( self.prms.position == 'before' ) {
|
220 |
+
self.container.prepend( self.box );
|
221 |
+
} else {
|
222 |
+
self.container.append( self.box );
|
223 |
+
}
|
224 |
+
self.container.data('has_message', true );
|
225 |
+
self.box.hide();
|
226 |
+
|
227 |
+
if( null !== self.prms.referTo )
|
228 |
+
{
|
229 |
+
self.box.css({
|
230 |
+
"position":"absolute",
|
231 |
+
"z-index":10000,
|
232 |
+
"top": self.prms.referTo.position().top + self.prms.offestY + "px",
|
233 |
+
"left": self.prms.referTo.position().left + self.prms.referTo.width() + self.prms.offestX + "px"
|
234 |
+
});
|
235 |
}
|
236 |
|
237 |
+
self.container.data( 'message-box', self.box );
|
238 |
+
|
239 |
+
self.box.fadeTo( null != prev ? 0 : self.prms.fadeIn, 1, function(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
$(this).trigger('wpv-message-open');
|
241 |
+
prev = $(this);
|
242 |
+
prev_text = self.prms.text;
|
243 |
+
is_open = true;
|
244 |
+
if( self.prms.onOpen && typeof self.prms.onOpen == 'function' )
|
245 |
+
{
|
246 |
+
self.prms.onOpen.apply( self, self.prms.args );
|
247 |
+
}
|
248 |
+
if( self.prms.stay ){
|
249 |
+
has_stay = true;
|
250 |
+
}
|
251 |
+
else
|
252 |
+
{
|
253 |
+
var remove_message = _.bind(self.wpvMessageRemove, self);
|
254 |
+
_.delay( remove_message, self.prms.stay_for );
|
255 |
+
//self.wpvMessageRemove();
|
256 |
+
}
|
257 |
+
});
|
258 |
+
|
259 |
+
return self;
|
260 |
+
},
|
261 |
+
wpvMessageRemove: function () {
|
262 |
+
|
263 |
+
var self = this;
|
264 |
+
|
265 |
+
if( self.box || self.container.data( 'message-box') )
|
266 |
+
{
|
267 |
+
var box = self.box || self.container.data( 'message-box');
|
268 |
+
|
269 |
+
box.fadeTo( self.prms.fadeOut, 0, function(){
|
270 |
$(this).trigger('wpv-message-remove');
|
271 |
+
is_open = false;
|
272 |
+
prev = null;
|
273 |
+
prev_text = '';
|
274 |
+
has_stay = false;
|
275 |
+
if( self.prms.onClose && typeof self.prms.onClose == 'function' )
|
276 |
+
{
|
277 |
+
self.prms.onClose.apply( self, self.prms.args );
|
278 |
+
}
|
279 |
+
|
280 |
+
$( this ).remove();
|
281 |
self.container.data('has_message', false );
|
282 |
+
self.container.data( 'message-box', null );
|
283 |
+
self.box = null;
|
284 |
+
});
|
285 |
+
}
|
286 |
+
|
287 |
+
return self;
|
288 |
+
},
|
289 |
+
destroy:function()
|
290 |
+
{
|
291 |
$(this).trigger('wpv-message-remove');
|
292 |
+
this.container.empty();
|
293 |
+
if( this.prms.onDestroy && typeof this.prms.onDestroy == 'function' )
|
294 |
+
{
|
295 |
+
this.prms.onDestroy.apply( this, this.prms.args );
|
296 |
+
}
|
297 |
+
this.box = null;
|
298 |
+
this.container.data( 'message-box', null );
|
299 |
+
this.container.data('has_message', false );
|
300 |
+
},
|
301 |
+
has_message:function(){
|
302 |
+
return this.container.data('has_message');
|
303 |
+
}
|
304 |
+
};
|
305 |
|
306 |
|
307 |
+
$.fn[ pluginName ] = function ( arg ) {
|
308 |
|
309 |
+
return this.each(function(){
|
310 |
+
var args, instance;
|
311 |
|
312 |
+
if ( !( $(this).data( dataPlugin ) instanceof Plugin ) ) {
|
313 |
+
// if no instance, create one
|
314 |
+
$(this).data( dataPlugin, new Plugin( $(this), arg ) );
|
315 |
+
}
|
316 |
+
// do not use this one if you want the plugin to be a singleton bound to the DOM element
|
317 |
+
else
|
318 |
+
{
|
319 |
+
// if instance delete reference and do another one
|
320 |
+
$(this).data( dataPlugin, null );
|
321 |
+
$(this).data( dataPlugin, new Plugin( $(this), arg ) );
|
322 |
+
}
|
323 |
|
324 |
+
instance = $(this).data( dataPlugin );
|
325 |
|
326 |
+
instance.element = $(this);
|
327 |
|
328 |
+
// call Plugin.init( arg )
|
329 |
+
if (typeof arg === 'undefined' || typeof arg === 'object') {
|
330 |
|
331 |
+
if ( typeof instance['init'] === 'function' ) {
|
332 |
+
instance.init( arg );
|
333 |
+
}
|
334 |
|
335 |
+
// checks that the requested public method exists
|
336 |
+
} else if ( typeof arg === 'string' && typeof instance[arg] === 'function' ) {
|
337 |
|
338 |
+
// copy arguments & remove function name
|
339 |
+
args = Array.prototype.slice.call( arguments, 1 );
|
340 |
|
341 |
+
// call the method
|
342 |
+
return instance[arg].apply( instance, args );
|
343 |
|
344 |
+
} else {
|
345 |
|
346 |
+
$.error('Method ' + arg + ' does not exist on jQuery.' + pluginName);
|
347 |
|
348 |
+
}
|
349 |
+
});
|
350 |
+
};
|
351 |
})( jQuery, window, document );
|
352 |
|
353 |
jQuery( function( $ ) {
|
354 |
+
$.each( $( '.js-show-toolset-message:not(.js-show-toolset-message-inited)' ), function() {
|
355 |
$( this )
|
356 |
+
.addClass( 'js-show-toolset-message-inited' )
|
357 |
.show()
|
358 |
.wpvToolsetHelp();
|
359 |
});
|
361 |
|
362 |
if ( typeof jQuery.fn.wpvToolsetHelp === 'undefined' ) {
|
363 |
|
364 |
+
/* Help messages */
|
365 |
+
(function($){
|
366 |
+
|
367 |
+
$.fn.wpvToolsetHelp = function( options ) {
|
368 |
+
|
369 |
+
var thiz = this;
|
370 |
+
|
371 |
+
var $container = this;
|
372 |
+
var prms = $.extend( {
|
373 |
+
content : ( thiz.contents().length !== 0 ) ? thiz.contents() : "Enter a customized text to be displayed",
|
374 |
+
tutorialButtonText : ( typeof(thiz.data('tutorial-button-text' )) !== 'undefined' ) ? thiz.data('tutorial-button-text') : null,
|
375 |
+
tutorialButtonURL : ( typeof(thiz.data('tutorial-button-url' )) !== 'undefined' ) ? thiz.data('tutorial-button-url') : null,
|
376 |
+
linkText : ( typeof(thiz.data('link-text')) !== 'undefined' ) ? thiz.data('link-text') : null,
|
377 |
+
linkURL : ( typeof(thiz.data('link-url')) !== 'undefined' ) ? thiz.data('link-url') : null,
|
378 |
+
footer : ( typeof(thiz.data('footer')) !== 'undefined' ) ? thiz.data('footer') : false,
|
379 |
+
classname : ( typeof(thiz.data('classname')) !== 'undefined' ) ? thiz.data('classname') : '',
|
380 |
+
close: ( typeof(thiz.data('close')) !== 'undefined' ) ? thiz.data('close') : true,
|
381 |
+
hidden: ( typeof(thiz.data('hidden')) !== 'undefined' ) ? thiz.data('hidden') : false,
|
382 |
+
onClose: false,
|
383 |
+
args:[]
|
384 |
+
}, options );
|
385 |
+
|
386 |
+
if ( $.type(prms.content) === 'string' ) {
|
387 |
+
prms.content = $('<p>' + prms.content + '</p>');
|
388 |
+
}
|
389 |
+
|
390 |
+
var $box = $('<div class="toolset-help ' + prms.classname + '"><div class="toolset-help-content"></div><div class="toolset-help-sidebar"></div></div>');
|
391 |
+
|
392 |
+
var $footer = $('<div class="toolset-help-footer"><button class="js-toolset-help-close js-toolset-help-close-forever button-secondary">'+ wpv_help_box_texts.wpv_dont_show_it_again +'</button><button class="js-toolset-help-close js-toolset-help-close-once button-primary">'+ wpv_help_box_texts.wpv_close +'</button></div>');
|
393 |
+
|
394 |
+
if (prms.footer === true) {
|
395 |
+
$footer.appendTo($box);
|
396 |
+
}
|
397 |
+
|
398 |
+
prms.content.appendTo($box.find('.toolset-help-content'));
|
399 |
+
|
400 |
+
this.wpvHelpRemove = function() {
|
401 |
+
if( $box )
|
402 |
+
$box.fadeOut('fast', function(){
|
403 |
+
// $(this).remove();
|
404 |
+
if ( prms.onClose && typeof prms.onClose === 'function' ) {
|
405 |
+
prms.onClose.apply( $container, prms.args );
|
406 |
+
}
|
407 |
+
});
|
408 |
+
return this;
|
409 |
+
};
|
410 |
+
|
411 |
+
if ( (prms.tutorialButtonText && prms.tutorialButtonURL) || (prms.linkText && prms.linkURL) ) {
|
412 |
+
var $toolbar = $('<p class="toolset-help-content-toolbar"></p>');
|
413 |
+
$toolbar.appendTo($box.find('.toolset-help-content'));
|
414 |
+
if (prms.tutorialButtonText && prms.tutorialButtonURL) {
|
415 |
+
$('<a href="' + prms.tutorialButtonURL + '" class="btn">' + prms.tutorialButtonText + '</a>').appendTo($toolbar);
|
416 |
+
}
|
417 |
+
if (prms.linkText && prms.linkURL) {
|
418 |
+
$('<a href="' + prms.linkURL + '">' + prms.linkText + '</a>').appendTo($toolbar);
|
419 |
+
}
|
420 |
+
}
|
421 |
+
|
422 |
+
if (prms.close === true) {
|
423 |
+
$('<i class="icon-remove fa fa-times js-toolset-help-close js-toolset-help-close-main"></i>').appendTo($box);
|
424 |
+
}
|
425 |
+
|
426 |
+
// bind close event to all close buttons
|
427 |
+
var $closeButtons = $box.find('.js-toolset-help-close');
|
428 |
+
if ( $closeButtons.length !== 0 ) {
|
429 |
+
$closeButtons.on('click',function(){
|
430 |
+
$container.wpvHelpRemove();
|
431 |
+
});
|
432 |
+
}
|
433 |
+
|
434 |
+
$box.appendTo($container).hide();
|
435 |
+
if ($container.hasClass('js-show-toolset-message')) {
|
436 |
+
$box.unwrap();
|
437 |
+
}
|
438 |
+
if (prms.hidden === false) {
|
439 |
+
$box.fadeIn('fast');
|
440 |
+
}
|
441 |
+
|
442 |
+
return this;
|
443 |
+
};
|
444 |
+
|
445 |
+
})(jQuery);
|
446 |
|
447 |
}
|
448 |
|
449 |
(function ($) {
|
450 |
+
$.fn.insertAtIndex = function(index,selector){
|
451 |
+
var opts = $.extend({
|
452 |
+
index: 0,
|
453 |
+
selector: '<div/>'
|
454 |
+
}, {index: index, selector: selector});
|
455 |
+
return this.each(function() {
|
456 |
+
var p = $(this);
|
457 |
+
var i = ($.isNumeric(opts.index) ? parseInt(opts.index,10) : 0);
|
458 |
+
if (i <= 0)
|
459 |
+
p.prepend(opts.selector);
|
460 |
+
else if( i > p.children().length-1 )
|
461 |
+
p.append(opts.selector);
|
462 |
+
else
|
463 |
+
p.children().eq(i).before(opts.selector);
|
464 |
+
});
|
465 |
+
};
|
466 |
})( jQuery );
|
467 |
|
468 |
(function ($) {
|
469 |
|
470 |
+
$.fn.loaderOverlay = function( action,options )
|
471 |
+
// action: 'show'|'hide' attributes are optional.
|
472 |
+
// options: fadeInSpeed, fadeOutSpeed, displayOverlay, class. attributes are optional
|
473 |
+
{
|
474 |
+
|
475 |
+
var defaults = {
|
476 |
+
fadeInSpeed : 'fast',
|
477 |
+
fadeOutSpeed : 'fast',
|
478 |
+
displayLoader: true,
|
479 |
+
class: null
|
480 |
+
};
|
481 |
+
|
482 |
+
var prms = $.extend( defaults, options );
|
483 |
+
var $overlayContainer = this;
|
484 |
+
var $overlayEl = $('<div class="loader-overlay" />');
|
485 |
+
|
486 |
+
var showOverlay = function() {
|
487 |
+
if ( ! $overlayContainer.data('has-overlay') ) {
|
488 |
+
$overlayEl
|
489 |
+
.appendTo($overlayContainer)
|
490 |
+
.hide()
|
491 |
+
.fadeIn(prms.fadeInSpeed, function() {
|
492 |
+
$overlayContainer.data('has-overlay', true);
|
493 |
+
$overlayContainer.data('overlay-el', $overlayEl);
|
494 |
+
} );
|
495 |
+
}
|
496 |
+
};
|
497 |
+
|
498 |
+
var hideOverlay = function() {
|
499 |
+
if ( $overlayContainer.data('has-overlay') ) {
|
500 |
+
$overlayContainer.data('overlay-el')
|
501 |
+
.fadeOut(prms.fadeOutSpeed, function() {
|
502 |
+
$overlayEl.remove();
|
503 |
+
$overlayContainer.data('has-overlay', false);
|
504 |
+
} );
|
505 |
+
}
|
506 |
+
};
|
507 |
+
|
508 |
+
if ( prms.class !== null ) {
|
509 |
+
$overlayEl.addClass(prms.class);
|
510 |
+
}
|
511 |
+
if ( prms.displayLoader ) {
|
512 |
+
$('<div class="preloader" />').appendTo($overlayEl);
|
513 |
+
}
|
514 |
+
|
515 |
+
if ( typeof(action) !== 'undefined' ) { // When 'action' parameter is given
|
516 |
+
|
517 |
+
if ( action === 'show' ) {
|
518 |
+
showOverlay();
|
519 |
+
}
|
520 |
+
else if ( action === 'hide' ) {
|
521 |
+
hideOverlay();
|
522 |
+
}
|
523 |
+
|
524 |
+
}
|
525 |
+
else { // when the method is called without 'action' parameter
|
526 |
+
|
527 |
+
if ( $overlayContainer.data('has-overlay') ) { // hide overlay if it's displayed
|
528 |
+
hideOverlay();
|
529 |
+
}
|
530 |
+
else { // show overlay if not
|
531 |
+
showOverlay();
|
532 |
+
}
|
533 |
+
|
534 |
+
}
|
535 |
+
|
536 |
+
return this;
|
537 |
+
};
|
538 |
|
539 |
})( jQuery );
|
540 |
|
541 |
(function ($) {
|
542 |
+
/*
|
543 |
+
Basic usage:
|
544 |
+
$element.ddlWpPointer(); // will show a pointer if it's hidden OR hide a pointer if it's shown
|
545 |
+
|
546 |
+
1. $element have to be valid jQuery selector
|
547 |
+
2. data-toolipt-header HTML attribute is required to display the header
|
548 |
+
3. data-tooltip-content HTML attribute is required to display the content
|
549 |
+
|
550 |
+
Customization:
|
551 |
+
$element.ddlWpPointer('action', // action: 'show' | 'hide'
|
552 |
+
{
|
553 |
+
content: $element // $element have to be valid jQuery selector content element should contain H3 for the header and P for the content. Example: <div><h3>Header</h3><p>Content</p></div>
|
554 |
+
edge: 'left' // 'left' | 'right' | 'top' | 'bottom'
|
555 |
+
align: 'center' // 'center' | 'right' | 'left'
|
556 |
+
offset: 'x y' // example: '0 15'
|
557 |
+
})
|
558 |
+
|
559 |
+
*/
|
560 |
+
$.fn.ddlWpPointer = function( action, options )
|
561 |
+
{
|
562 |
+
var $el = this;
|
563 |
+
|
564 |
+
//$.jStorage.flush();
|
565 |
+
|
566 |
+
var defaults = {
|
567 |
+
headerText: function() {
|
568 |
+
var header = $el.data('tooltip-header');
|
569 |
+
if ( header ) {
|
570 |
+
return header;
|
571 |
+
}
|
572 |
+
else {
|
573 |
+
return 'use <b>data-tooltip-header="header text"</b> attribute to create a header';
|
574 |
+
}
|
575 |
+
},
|
576 |
+
contentText : function() {
|
577 |
+
var content = $el.data('tooltip-content');
|
578 |
+
if ( content ) {
|
579 |
+
return content;
|
580 |
+
}
|
581 |
+
else {
|
582 |
+
return 'use <b>data-tooltip-content="content text"</b> attribute to create a content';
|
583 |
+
}
|
584 |
+
},
|
585 |
+
content: function() { // returns string by default (data-tooltip-header and data-tooltip-content attibutes), but can be overridden by jQuery obj
|
586 |
+
return '<h3>'+ defaults.headerText() +'</h3><p>'+ defaults.contentText() +'</p>';
|
587 |
+
},
|
588 |
+
edge : 'left',
|
589 |
+
align : 'center',
|
590 |
+
offset: '0 0',
|
591 |
+
stay_hidden: false
|
592 |
+
};
|
593 |
+
|
594 |
+
var prms = $.extend( defaults, options );
|
595 |
+
|
596 |
+
var showPointer = function() {
|
597 |
+
|
598 |
+
if ( ! $el.data('has-wppointer') ) {
|
599 |
+
$el
|
600 |
+
.pointer({
|
601 |
+
content: function() {
|
602 |
+
return prms.content;
|
603 |
+
},
|
604 |
+
position: {
|
605 |
+
edge: prms.edge,
|
606 |
+
align: prms.align,
|
607 |
+
offset: prms.offset
|
608 |
+
},
|
609 |
+
close: function() {
|
610 |
+
|
611 |
+
$el.data('has-wppointer', false);
|
612 |
+
$el.trigger('help_tooltip_closes', options );
|
613 |
+
}
|
614 |
+
})
|
615 |
+
.pointer('open');
|
616 |
+
|
617 |
+
$el.data('has-wppointer', true);
|
618 |
+
}
|
619 |
+
};
|
620 |
+
|
621 |
+
var hidePointer = function() {
|
622 |
+
|
623 |
+
if ( $el.data('has-wppointer') ) {
|
624 |
+
|
625 |
+
$el.pointer('close');
|
626 |
+
$el.data('has-wppointer', false);
|
627 |
+
|
628 |
+
}
|
629 |
+
|
630 |
+
};
|
631 |
+
|
632 |
+
if ( typeof(action) !== 'undefined' ) { // When 'action' parameter is given
|
633 |
+
|
634 |
+
if ( action === 'show' && prms.stay_hidden !== true ) {
|
635 |
+
showPointer();
|
636 |
+
}
|
637 |
+
else if ( action === 'hide' ) {
|
638 |
+
hidePointer();
|
639 |
+
}
|
640 |
+
|
641 |
+
}
|
642 |
+
else { // when the method is called without 'action' parameter
|
643 |
+
|
644 |
+
if ( $el.data('has-wppointer') ) { // hide pointer if it's displayed
|
645 |
+
hidePointer();
|
646 |
+
}
|
647 |
+
else if( prms.stay_hidden !== true ) { // show it if not
|
648 |
+
showPointer();
|
649 |
+
}
|
650 |
+
|
651 |
+
}
|
652 |
+
|
653 |
+
return this;
|
654 |
+
};
|
655 |
|
656 |
})( jQuery );
|
657 |
|
658 |
WPV_Toolset.Utils.Loader = function()
|
659 |
{
|
660 |
+
//fake comment
|
661 |
+
var self = this;
|
662 |
|
663 |
+
self.loading = false; self.el = null;
|
664 |
|
665 |
+
self.loader = jQuery('<div class="ajax-loader spinner"></div>');
|
666 |
|
667 |
+
self.loadShow = function( el, after )
|
668 |
+
{
|
669 |
+
self.el = el;
|
670 |
+
self.loading = true;
|
671 |
|
672 |
if( typeof after === 'undefined' )
|
673 |
{
|
678 |
}
|
679 |
|
680 |
return self.loader;
|
681 |
+
};
|
682 |
+
self.loadHide = function()
|
683 |
+
{
|
684 |
+
self.loader.fadeOut(400, function(){
|
685 |
|
686 |
+
self.loading = false;
|
687 |
+
jQuery(this).remove();
|
688 |
+
});
|
689 |
|
690 |
return self.loader;
|
691 |
+
};
|
692 |
};
|
693 |
|
694 |
if( typeof _ != 'undefined' )
|
695 |
{
|
696 |
+
WPV_Toolset.Utils.flatten = function(x, result, prefix) {
|
697 |
+
if(_.isObject(x)) {
|
698 |
+
_.each(x, function(v, k) {
|
699 |
+
WPV_Toolset.Utils.flatten(v, result, prefix ? prefix + '_' + k : k)
|
700 |
+
})
|
701 |
+
} else {
|
702 |
+
result[prefix] = x
|
703 |
+
}
|
704 |
+
return result
|
705 |
+
};
|
706 |
+
WPV_Toolset.Utils.flatten_filter_by_key = function( x, result, prefix, filter )
|
707 |
+
{
|
708 |
+
var res = [],
|
709 |
+
find = WPV_Toolset.Utils.flatten( x, result, prefix );
|
710 |
+
|
711 |
+
if ( !filter ) return _.values( find );
|
712 |
+
|
713 |
+
_.each(find, function( element, index, list ){
|
714 |
+
if( index.indexOf( prefix ? prefix + '_'+filter : filter ) !== -1 || filter === index )
|
715 |
+
res.push( element );
|
716 |
+
});
|
717 |
+
|
718 |
+
return res;
|
719 |
+
}
|
720 |
+
WPV_Toolset.Utils.containsObject = function (obj, list) {
|
721 |
+
var res = _.find(list, function(val){
|
722 |
+
return _.isEqual(obj, val);
|
723 |
+
});
|
724 |
+
return (_.isObject(res))? true:false;
|
725 |
+
};
|
726 |
};
|
727 |
|
728 |
|
729 |
|
730 |
(function($) {
|
731 |
+
$.fn.textWidth = function() {
|
732 |
+
var text = this.html() || this.text() || this.val();
|
733 |
+
return( $.textWidth( text ) );
|
734 |
+
};
|
735 |
+
$.textWidth = function(text) {
|
736 |
+
var div = $('#textWidth');
|
737 |
+
if (div.length === 0)
|
738 |
+
div = $('<div id="textWidth" style="display: none;"></div>').appendTo($('body'));
|
739 |
+
div.html(text);
|
740 |
+
return(div.width());
|
741 |
+
};
|
742 |
})(jQuery);
|
743 |
|
744 |
//Courtesy from http://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery
|
745 |
WPV_Toolset.Utils.escapeHtml = function(str) {
|
746 |
+
if (typeof(str) == "string"){
|
747 |
+
try{
|
748 |
+
var newStr = "";
|
749 |
+
var nextCode = 0;
|
750 |
+
for (var i = 0;i < str.length;i++){
|
751 |
+
nextCode = str.charCodeAt(i);
|
752 |
+
if (nextCode > 0 && nextCode < 128){
|
753 |
+
newStr += "&#"+nextCode+";";
|
754 |
+
}
|
755 |
+
else{
|
756 |
+
newStr += "?";
|
757 |
+
}
|
758 |
+
}
|
759 |
+
return newStr;
|
760 |
+
}
|
761 |
+
catch(err){
|
762 |
+
}
|
763 |
+
}
|
764 |
+
else{
|
765 |
+
return str;
|
766 |
+
}
|
767 |
};
|
768 |
|
769 |
WPV_Toolset.Utils.editor_decode64 = function(input) {
|
770 |
var output = "",
|
771 |
+
chr1, chr2, chr3 = "",
|
772 |
+
enc1, enc2, enc3, enc4 = "",
|
773 |
+
i = 0,
|
774 |
+
keyStr = "ABCDEFGHIJKLMNOP" +
|
775 |
"QRSTUVWXYZabcdef" +
|
776 |
"ghijklmnopqrstuv" +
|
777 |
"wxyz0123456789+/" +
|
1020 |
|
1021 |
}
|
1022 |
});
|
|
|
|
|
1023 |
};
|
1024 |
|
1025 |
})(jQuery, window, document);
|
1107 |
}).end();
|
1108 |
};
|
1109 |
|
1110 |
+
}(jQuery, window, document));
|
|
|
|
|
|
|
|
|
|
|
1111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1112 |
var waitForFinalEvent = ( function () {
|
1113 |
var timers = {};
|
1114 |
return function ( callback, ms, uniqueId ) {
|
1118 |
if ( timers[uniqueId] ) {
|
1119 |
clearTimeout( timers[uniqueId] );
|
1120 |
}
|
1121 |
+
|
1122 |
timers[uniqueId] = setTimeout( callback, ms );
|
1123 |
};
|
1124 |
} )();
|
1175 |
* @since unknown
|
1176 |
*/
|
1177 |
WPV_Toolset.Utils._strip_tags_and_preserve_text = function( text ){
|
1178 |
+
var rex = /<\/?(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|noframes|noscript|object|ol|optgroup|option|output|p|param|plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|spacer|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\b[^<>]*>/ig
|
1179 |
+
return _.escape( text.replace(rex , "") ).trim();
|
1180 |
};
|
1181 |
|
1182 |
|
1191 |
* @param {string} confirmationMessage Confirmation message that should be shown by the browser.
|
1192 |
*/
|
1193 |
WPV_Toolset.Utils.setConfirmUnload = function(checkIfConfirmationNeededCallback, onBeforeUnloadCallback, confirmationMessage) {
|
1194 |
+
window.onbeforeunload = function(e) {
|
1195 |
+
if(checkIfConfirmationNeededCallback()) {
|
1196 |
+
|
1197 |
+
onBeforeUnloadCallback();
|
1198 |
+
|
1199 |
+
// For IE and Firefox prior to version 4
|
1200 |
+
if (e) {
|
1201 |
+
e.returnValue = confirmationMessage;
|
1202 |
+
}
|
1203 |
+
return confirmationMessage;
|
1204 |
+
}
|
1205 |
+
};
|
1206 |
};
|
1207 |
+
|
1208 |
+
if( typeof _ !== 'undefined' && typeof _.capitalize === 'undefined' ){
|
1209 |
+
_.mixin({
|
1210 |
+
capitalize: function(string) {
|
1211 |
+
return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
|
1212 |
+
}
|
1213 |
+
});
|
1214 |
+
}
|
embedded/toolset/toolset-common/utility/utils.php
CHANGED
@@ -268,7 +268,7 @@ if( !class_exists('Toolset_ErrorHandler') ){
|
|
268 |
*/
|
269 |
public static function started()
|
270 |
{
|
271 |
-
return (bool)
|
272 |
}
|
273 |
|
274 |
/**
|
@@ -278,7 +278,7 @@ if( !class_exists('Toolset_ErrorHandler') ){
|
|
278 |
*/
|
279 |
public static function getNestedLevel()
|
280 |
{
|
281 |
-
return count(
|
282 |
}
|
283 |
|
284 |
/**
|
@@ -286,14 +286,14 @@ if( !class_exists('Toolset_ErrorHandler') ){
|
|
286 |
*
|
287 |
* @param int $errorLevel
|
288 |
*/
|
289 |
-
public static function start($errorLevel =
|
290 |
{
|
291 |
-
if (!
|
292 |
set_error_handler(array(get_called_class(), 'addError'), $errorLevel);
|
293 |
register_shutdown_function( array(get_called_class(), 'handle_shutdown'), true );
|
294 |
}
|
295 |
|
296 |
-
|
297 |
}
|
298 |
|
299 |
/**
|
@@ -307,10 +307,10 @@ if( !class_exists('Toolset_ErrorHandler') ){
|
|
307 |
{
|
308 |
$errorException = null;
|
309 |
|
310 |
-
if (
|
311 |
-
$errorException = array_pop(
|
312 |
|
313 |
-
if (!
|
314 |
restore_error_handler();
|
315 |
}
|
316 |
|
@@ -324,7 +324,7 @@ if( !class_exists('Toolset_ErrorHandler') ){
|
|
324 |
|
325 |
|
326 |
public static function handle_shutdown( ){
|
327 |
-
if(
|
328 |
do_action('toolset-shutdown-hander');
|
329 |
}
|
330 |
exit;
|
@@ -346,11 +346,11 @@ if( !class_exists('Toolset_ErrorHandler') ){
|
|
346 |
*/
|
347 |
public static function clean()
|
348 |
{
|
349 |
-
if (
|
350 |
restore_error_handler();
|
351 |
}
|
352 |
|
353 |
-
|
354 |
}
|
355 |
|
356 |
/**
|
@@ -364,7 +364,7 @@ if( !class_exists('Toolset_ErrorHandler') ){
|
|
364 |
*/
|
365 |
public static function addError($errno, $errstr = '', $errfile = '', $errline = 0)
|
366 |
{
|
367 |
-
$stack = &
|
368 |
$stack = new ErrorException($errstr, 0, $errno, $errfile, $errline, $stack);
|
369 |
}
|
370 |
}
|
268 |
*/
|
269 |
public static function started()
|
270 |
{
|
271 |
+
return (bool) self::getNestedLevel();
|
272 |
}
|
273 |
|
274 |
/**
|
278 |
*/
|
279 |
public static function getNestedLevel()
|
280 |
{
|
281 |
+
return count(self::$stack);
|
282 |
}
|
283 |
|
284 |
/**
|
286 |
*
|
287 |
* @param int $errorLevel
|
288 |
*/
|
289 |
+
public static function start($errorLevel = E_WARNING)
|
290 |
{
|
291 |
+
if (!self::$stack) {
|
292 |
set_error_handler(array(get_called_class(), 'addError'), $errorLevel);
|
293 |
register_shutdown_function( array(get_called_class(), 'handle_shutdown'), true );
|
294 |
}
|
295 |
|
296 |
+
self::$stack[] = null;
|
297 |
}
|
298 |
|
299 |
/**
|
307 |
{
|
308 |
$errorException = null;
|
309 |
|
310 |
+
if (self::$stack) {
|
311 |
+
$errorException = array_pop(self::$stack);
|
312 |
|
313 |
+
if (!self::$stack) {
|
314 |
restore_error_handler();
|
315 |
}
|
316 |
|
324 |
|
325 |
|
326 |
public static function handle_shutdown( ){
|
327 |
+
if( self::is_fatal() ){
|
328 |
do_action('toolset-shutdown-hander');
|
329 |
}
|
330 |
exit;
|
346 |
*/
|
347 |
public static function clean()
|
348 |
{
|
349 |
+
if (self::$stack) {
|
350 |
restore_error_handler();
|
351 |
}
|
352 |
|
353 |
+
self::$stack = array();
|
354 |
}
|
355 |
|
356 |
/**
|
364 |
*/
|
365 |
public static function addError($errno, $errstr = '', $errfile = '', $errline = 0)
|
366 |
{
|
367 |
+
$stack = & self::$stack[count(self::$stack) - 1];
|
368 |
$stack = new ErrorException($errstr, 0, $errno, $errfile, $errline, $stack);
|
369 |
}
|
370 |
}
|
embedded/toolset/toolset-common/visual-editor/res/js/icl_editor_addon_plugin.js
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
var WPV_Toolset = WPV_Toolset || {};
|
2 |
|
3 |
WPV_Toolset.activeUrlEditor = null;
|
1 |
+
/**
|
2 |
+
* @version 1.2
|
3 |
+
* @type {{}|WPV_Toolset}
|
4 |
+
* @revision: 25/09/2015 22:31
|
5 |
+
*/
|
6 |
var WPV_Toolset = WPV_Toolset || {};
|
7 |
|
8 |
WPV_Toolset.activeUrlEditor = null;
|
embedded/toolset/toolset-common/visual-editor/res/js/icl_media_manager.js
CHANGED
@@ -1,4 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
var WPV_Toolset = WPV_Toolset || {};
|
|
|
|
|
|
|
|
|
2 |
|
3 |
if ( typeof WPV_Toolset.only_img_src_allowed_here === "undefined" ) {
|
4 |
/*
|
@@ -21,42 +30,51 @@ if ( typeof WPV_Toolset.only_img_src_allowed_here === "undefined" ) {
|
|
21 |
];
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
/**
|
25 |
* Thanks to Thomas Griffin for his super useful example on Github
|
26 |
*
|
27 |
* https://github.com/thomasgriffin/New-Media-Image-Uploader
|
28 |
*/
|
29 |
-
jQuery(document).ready(function($){
|
30 |
-
|
31 |
-
// Prepare the variable that holds our custom media manager.
|
32 |
-
var wpv_media_frame;
|
33 |
-
// var wp_media_post_id = wp.media.model.settings.post.id; // Store the old id
|
34 |
-
var toolset_edit_data = jQuery( '#toolset-edit-data' ),
|
35 |
-
set_to_post_id = toolset_edit_data.val(),
|
36 |
-
toolset_edit_plugin = toolset_edit_data.data( 'plugin' );
|
37 |
|
38 |
-
|
39 |
-
$(document.body).on('click', '.js-wpv-media-manager', function(e){ //mojo-open-media is the class of our form button
|
40 |
// Prevent the default action from occuring.
|
41 |
-
e.preventDefault(
|
42 |
-
|
43 |
-
var
|
44 |
-
|
|
|
|
|
|
|
|
|
45 |
set_to_post_id = referred_id;
|
46 |
}
|
47 |
-
|
48 |
-
var active_textarea = $(this).data('content');
|
49 |
window.wpcfActiveEditor = active_textarea;
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
54 |
return;
|
55 |
} else {
|
56 |
-
//
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
-
|
|
|
60 |
//Create our media frame
|
61 |
className: 'media-frame mojo-media-frame js-wpv-media-frame',
|
62 |
frame: 'post',
|
@@ -66,8 +84,7 @@ jQuery(document).ready(function($){
|
|
66 |
}
|
67 |
});
|
68 |
|
69 |
-
|
70 |
-
wpv_media_frame.on('open', function(event){
|
71 |
var media_button_insert = $('.media-button-insert'),
|
72 |
media_frame = $('.js-wpv-media-frame');
|
73 |
$('li.selected').removeClass('selected').find('a.check').trigger('click');
|
@@ -79,9 +96,9 @@ jQuery(document).ready(function($){
|
|
79 |
});
|
80 |
});
|
81 |
|
82 |
-
|
83 |
// Watch changes in wp-includes/js/media-editor.js
|
84 |
-
var media_attachment =
|
85 |
filetype = media_attachment.type;
|
86 |
if ( filetype == 'image' ) {
|
87 |
var size = $('.attachment-display-settings .size').val(),// WARNING size might be undefined for some image types, like BMP or TIFF, that do not generate thumbnails
|
@@ -242,7 +259,7 @@ jQuery(document).ready(function($){
|
|
242 |
});
|
243 |
|
244 |
// Now that everything has been set, let's open up the frame.
|
245 |
-
|
246 |
});
|
247 |
});
|
248 |
|
1 |
+
/**
|
2 |
+
* @version 1.2
|
3 |
+
* @type {{}|WPV_Toolset|{}|WPV_Toolset}
|
4 |
+
* @revision 25/09/2015 22:31
|
5 |
+
*/
|
6 |
var WPV_Toolset = WPV_Toolset || {};
|
7 |
+
WPV_Toolset.media_manager = WPV_Toolset.media_manager || {};
|
8 |
+
WPV_Toolset.media_manager.set_to_post_id = 0;
|
9 |
+
WPV_Toolset.media_manager.current_plugin = '';
|
10 |
+
WPV_Toolset.media_manager.instances = {};
|
11 |
|
12 |
if ( typeof WPV_Toolset.only_img_src_allowed_here === "undefined" ) {
|
13 |
/*
|
30 |
];
|
31 |
}
|
32 |
|
33 |
+
jQuery( document ).ready( function( $ ) {
|
34 |
+
if ( $( '#toolset-edit-data' ).length > 0 ) {
|
35 |
+
WPV_Toolset.media_manager.set_to_post_id = $( '#toolset-edit-data' ).val();
|
36 |
+
WPV_Toolset.media_manager.current_plugin = $( '#toolset-edit-data' ).data( 'plugin' );
|
37 |
+
}
|
38 |
+
});
|
39 |
+
|
40 |
/**
|
41 |
* Thanks to Thomas Griffin for his super useful example on Github
|
42 |
*
|
43 |
* https://github.com/thomasgriffin/New-Media-Image-Uploader
|
44 |
*/
|
45 |
+
jQuery( document ).ready( function( $ ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
+
$( document.body ).on( 'click', '.js-wpv-media-manager', function( e ) {
|
|
|
48 |
// Prevent the default action from occuring.
|
49 |
+
e.preventDefault();
|
50 |
+
// Check whether we need to set the parent post ID value
|
51 |
+
var set_to_post_id = WPV_Toolset.media_manager.set_to_post_id,
|
52 |
+
referred_id = $( this ).attr( 'data-id' );
|
53 |
+
if (
|
54 |
+
typeof referred_id !== 'undefined'
|
55 |
+
&& referred_id !== false
|
56 |
+
) {
|
57 |
set_to_post_id = referred_id;
|
58 |
}
|
59 |
+
// Set the active target by its content data attribute value
|
60 |
+
var active_textarea = $( this ).data( 'content' );
|
61 |
window.wpcfActiveEditor = active_textarea;
|
62 |
+
// Make sure the post parent ID is an integer, force zero otherwise
|
63 |
+
set_to_post_id = parseInt( set_to_post_id ) || 0;
|
64 |
+
// If the frame already exists, re-open it.
|
65 |
+
if ( WPV_Toolset.media_manager.instances[ set_to_post_id ] ) {
|
66 |
+
WPV_Toolset.media_manager.instances[ set_to_post_id ].open();
|
67 |
return;
|
68 |
} else {
|
69 |
+
// Otherwise, set the model post ID and create the frame
|
70 |
+
//if ( set_to_post_id !== 0 ) {
|
71 |
+
wp.media.model.settings.post.id = set_to_post_id;
|
72 |
+
//} else {
|
73 |
+
//wp.media.model.settings.post.id = 0;
|
74 |
+
//}
|
75 |
}
|
76 |
+
|
77 |
+
WPV_Toolset.media_manager.instances[ set_to_post_id ] = wp.media({
|
78 |
//Create our media frame
|
79 |
className: 'media-frame mojo-media-frame js-wpv-media-frame',
|
80 |
frame: 'post',
|
84 |
}
|
85 |
});
|
86 |
|
87 |
+
WPV_Toolset.media_manager.instances[ set_to_post_id ].on('open', function(event){
|
|
|
88 |
var media_button_insert = $('.media-button-insert'),
|
89 |
media_frame = $('.js-wpv-media-frame');
|
90 |
$('li.selected').removeClass('selected').find('a.check').trigger('click');
|
96 |
});
|
97 |
});
|
98 |
|
99 |
+
WPV_Toolset.media_manager.instances[ set_to_post_id ].on('insert', function(){
|
100 |
// Watch changes in wp-includes/js/media-editor.js
|
101 |
+
var media_attachment = WPV_Toolset.media_manager.instances[ set_to_post_id ].state().get('selection').first().toJSON(),
|
102 |
filetype = media_attachment.type;
|
103 |
if ( filetype == 'image' ) {
|
104 |
var size = $('.attachment-display-settings .size').val(),// WARNING size might be undefined for some image types, like BMP or TIFF, that do not generate thumbnails
|
259 |
});
|
260 |
|
261 |
// Now that everything has been set, let's open up the frame.
|
262 |
+
WPV_Toolset.media_manager.instances[ set_to_post_id ].open();
|
263 |
});
|
264 |
});
|
265 |
|
includes/fields.php
CHANGED
@@ -506,25 +506,48 @@ function wpcf_admin_custom_fields_change_type( $fields, $type,
|
|
506 |
}
|
507 |
$fields = wpcf_types_cf_under_control( 'add',
|
508 |
array('fields' => $fields, 'type' => $type), $post_type, $meta_name );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
$allowed = array(
|
510 |
-
'audio'
|
511 |
-
'textfield'
|
512 |
-
'textarea'
|
513 |
-
'date'
|
514 |
-
'email'
|
515 |
-
'embed'
|
516 |
-
'file'
|
517 |
-
'image'
|
518 |
-
'numeric'
|
519 |
-
'phone'
|
520 |
-
'select'
|
521 |
-
'skype'
|
522 |
-
'url'
|
523 |
-
'checkbox'
|
524 |
-
'radio'
|
525 |
-
'video'
|
526 |
-
'wysiwyg'
|
527 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
$all_fields = wpcf_admin_fields_get_fields( false, false, false, $meta_name );
|
529 |
foreach ( $fields as $field_id ) {
|
530 |
if ( !isset( $all_fields[$field_id] ) ) {
|
506 |
}
|
507 |
$fields = wpcf_types_cf_under_control( 'add',
|
508 |
array('fields' => $fields, 'type' => $type), $post_type, $meta_name );
|
509 |
+
|
510 |
+
/**
|
511 |
+
* wpcf_filter_field_control_change_type_allowed_types_from
|
512 |
+
*
|
513 |
+
* Filter the field types that you can switch to, given a type field
|
514 |
+
*
|
515 |
+
* @param array Valid targets for a given origin type
|
516 |
+
* @param string Field type to switch from
|
517 |
+
*
|
518 |
+
* @since 1.8.9
|
519 |
+
*/
|
520 |
$allowed = array(
|
521 |
+
'audio' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'url', 'textarea', 'textfield', 'email', 'date', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'audio' ),
|
522 |
+
'textfield' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'textfield', 'textarea', 'email', 'url', 'date', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'textfield' ),
|
523 |
+
'textarea' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'textfield', 'textarea', 'email', 'url', 'date', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'textarea' ),
|
524 |
+
'date' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'date', 'textarea', 'textfield', 'email', 'url', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'date' ),
|
525 |
+
'email' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'email', 'textarea', 'textfield', 'date', 'url', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'email' ),
|
526 |
+
'embed' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'url', 'textarea', 'textfield', 'email', 'date', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'embed' ),
|
527 |
+
'file' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'file', 'textarea', 'textfield', 'email', 'url', 'phone', 'fdate', 'image', 'numeric', 'audio', 'video', 'embed'), 'file' ),
|
528 |
+
'image' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'image', 'textarea', 'textfield', 'email', 'url', 'phone', 'file', 'idate', 'numeric', 'audio', 'video', 'embed'), 'image' ),
|
529 |
+
'numeric' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'numeric', 'textarea', 'textfield', 'email', 'url', 'phone', 'file', 'image', 'date', 'audio', 'video', 'embed'), 'numeric' ),
|
530 |
+
'phone' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'phone', 'textarea', 'textfield', 'email', 'url', 'date', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'phone' ),
|
531 |
+
'select' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'select', 'textarea', 'textfield', 'date', 'email', 'url', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'select' ),
|
532 |
+
'skype' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'skype', 'textarea', 'textfield', 'date', 'email', 'url', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'skype' ),
|
533 |
+
'url' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'url', 'textarea', 'textfield', 'email', 'date', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'url' ),
|
534 |
+
'checkbox' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'checkbox', 'textarea', 'textfield', 'email', 'url', 'date', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'checkbox' ),
|
535 |
+
'radio' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'radio', 'textarea', 'textfield', 'email', 'url', 'date', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'radio' ),
|
536 |
+
'video' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'url', 'textarea', 'textfield', 'email', 'date', 'phone', 'file', 'image', 'numeric', 'audio', 'video', 'embed'), 'video' ),
|
537 |
+
'wysiwyg' => apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', array('wysiwyg', 'textarea'), 'wysiwyg' ),
|
538 |
);
|
539 |
+
|
540 |
+
/**
|
541 |
+
* wpcf_filter_field_control_change_type_allowed_types
|
542 |
+
*
|
543 |
+
* Filter the pairs field type origin -> valid field type targets when using the fields control change field type feature
|
544 |
+
*
|
545 |
+
* @param array $allowed Valid correspondence between field types and target field types
|
546 |
+
*
|
547 |
+
* @since 1.8.9
|
548 |
+
*/
|
549 |
+
$allowed = apply_filters( 'wpcf_filter_field_control_change_type_allowed_types', $allowed );
|
550 |
+
|
551 |
$all_fields = wpcf_admin_fields_get_fields( false, false, false, $meta_name );
|
552 |
foreach ( $fields as $field_id ) {
|
553 |
if ( !isset( $all_fields[$field_id] ) ) {
|
plus/installer/changelog.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
= 1.6.8 =
|
2 |
* Sanitized an input that was a potential security issue
|
3 |
|
1 |
+
= 1.7.0 =
|
2 |
+
* New format for the products data file.
|
3 |
+
* Other fixes
|
4 |
+
|
5 |
= 1.6.8 =
|
6 |
* Sanitized an input that was a potential security issue
|
7 |
|
plus/installer/includes/class-installer-theme.php
CHANGED
@@ -41,7 +41,7 @@ class Installer_Theme_Class {
|
|
41 |
protected $installer_themes_available_updates;
|
42 |
|
43 |
/** The Themes */
|
44 |
-
protected $installer_themes;
|
45 |
|
46 |
/** Repository with themes */
|
47 |
protected $installer_repo_with_themes;
|
41 |
protected $installer_themes_available_updates;
|
42 |
|
43 |
/** The Themes */
|
44 |
+
protected $installer_themes = array();
|
45 |
|
46 |
/** Repository with themes */
|
47 |
protected $installer_repo_with_themes;
|
plus/installer/includes/installer.class.php
CHANGED
@@ -93,11 +93,13 @@ final class WP_Installer{
|
|
93 |
|
94 |
public function init(){
|
95 |
global $pagenow;
|
96 |
-
|
97 |
if(empty($this->settings['_pre_1_0_clean_up'])) {
|
98 |
$this->_pre_1_0_clean_up();
|
99 |
}
|
100 |
|
|
|
|
|
101 |
if ( !function_exists( 'get_plugins' ) ) {
|
102 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
103 |
}
|
@@ -278,7 +280,9 @@ final class WP_Installer{
|
|
278 |
|
279 |
foreach($package['products'] as $product){
|
280 |
|
281 |
-
foreach($product['
|
|
|
|
|
282 |
|
283 |
if(!isset($repositories_plugins[$repository_id][$download['slug']])){
|
284 |
$repositories_plugins[$repository_id][$download['slug']] = array(
|
@@ -350,7 +354,9 @@ final class WP_Installer{
|
|
350 |
|
351 |
if( $product['subscription_type'] == $subscription_type || $this->have_superior_subscription($subscription_type, $product) ) {
|
352 |
|
353 |
-
foreach ($product['
|
|
|
|
|
354 |
|
355 |
if (!isset($rep_plugins[$download['slug']])) {
|
356 |
$r_plugins[$download['slug']] = $download['slug'];
|
@@ -431,37 +437,44 @@ final class WP_Installer{
|
|
431 |
|
432 |
}
|
433 |
|
434 |
-
public function get_settings(){
|
435 |
-
|
|
|
|
|
|
|
436 |
|
437 |
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
|
|
|
|
445 |
}
|
446 |
-
$settings = unserialize($_settings);
|
447 |
-
}
|
448 |
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
|
|
455 |
}
|
456 |
}
|
457 |
}
|
458 |
-
}
|
459 |
|
460 |
|
461 |
-
|
462 |
|
|
|
463 |
|
464 |
-
|
|
|
|
|
|
|
465 |
}
|
466 |
|
467 |
//backward compatibility, will remove 'basename' in version 1.8
|
@@ -471,21 +484,72 @@ final class WP_Installer{
|
|
471 |
|
472 |
foreach ($settings['repositories'] as $repository_id => $repository) {
|
473 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
foreach ($repository['data']['packages'] as $package_id => $package) {
|
475 |
|
476 |
foreach ($package['products'] as $product_id => $product) {
|
477 |
|
478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
|
480 |
-
|
481 |
-
|
|
|
|
|
|
|
|
|
|
|
482 |
|
|
|
483 |
}
|
484 |
|
|
|
|
|
485 |
}
|
|
|
486 |
}
|
487 |
|
488 |
}
|
|
|
489 |
}
|
490 |
|
491 |
}
|
@@ -633,7 +697,7 @@ final class WP_Installer{
|
|
633 |
|
634 |
}
|
635 |
|
636 |
-
$error = sprintf(__("Installer cannot display the products information because the automatic
|
637 |
$error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code><br /><br />';
|
638 |
$error .= sprintf(__("In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code.", 'installer'), '<a href="' . admin_url('update-core.php') . '">', '</a>');
|
639 |
|
@@ -671,7 +735,7 @@ final class WP_Installer{
|
|
671 |
$body = wp_remote_retrieve_body($response);
|
672 |
if($body){
|
673 |
$products = json_decode($body, true);
|
674 |
-
|
675 |
if(is_array($products)){
|
676 |
$this->settings['repositories'][$id]['data'] = $products;
|
677 |
$this->settings = $this->_pre_1_6_backwards_compatibility($this->settings);
|
@@ -681,7 +745,8 @@ final class WP_Installer{
|
|
681 |
}
|
682 |
|
683 |
$this->log( sprintf("Checked for %s updates: %s", $id, $data['products']) );
|
684 |
-
|
|
|
685 |
}
|
686 |
|
687 |
// cleanup
|
@@ -719,7 +784,6 @@ final class WP_Installer{
|
|
719 |
|
720 |
$this->localize_strings();
|
721 |
$this->set_filtered_prices($args);
|
722 |
-
$this->filter_downloads_by_icl(); //downloads for ICL users
|
723 |
$this->set_hierarchy_and_order();
|
724 |
|
725 |
foreach($this->settings['repositories'] as $repository_id => $repository){
|
@@ -833,7 +897,12 @@ final class WP_Installer{
|
|
833 |
|
834 |
// downloads
|
835 |
if(isset($subscription_type) && !$expired && $product['subscription_type'] == $subscription_type){
|
836 |
-
$
|
|
|
|
|
|
|
|
|
|
|
837 |
}
|
838 |
|
839 |
//subpackages
|
@@ -1150,7 +1219,10 @@ final class WP_Installer{
|
|
1150 |
|
1151 |
foreach( $package['products'] as $product_id => $product ){
|
1152 |
|
1153 |
-
foreach( $product['
|
|
|
|
|
|
|
1154 |
if( empty( $versions[$download['slug']] ) ) {
|
1155 |
$v = $this->get_plugin_installed_version($download['name'], $download['slug']);
|
1156 |
if($v){
|
@@ -1324,7 +1396,9 @@ final class WP_Installer{
|
|
1324 |
|
1325 |
foreach($package['products'] as $product){
|
1326 |
|
1327 |
-
foreach($product['
|
|
|
|
|
1328 |
|
1329 |
if($download['slug'] == $slug || $download['name'] == $plugin['Name'] || $download['name'] == $plugin['Title']){ //match order: slug, name, title
|
1330 |
|
@@ -1599,7 +1673,9 @@ final class WP_Installer{
|
|
1599 |
foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package){
|
1600 |
foreach($package['products'] as $product) {
|
1601 |
|
1602 |
-
foreach($product['
|
|
|
|
|
1603 |
|
1604 |
if($download['slug'] == $slug){
|
1605 |
$version = $download['version'];
|
@@ -1848,7 +1924,9 @@ final class WP_Installer{
|
|
1848 |
|
1849 |
foreach($package['products'] as $product){
|
1850 |
|
1851 |
-
foreach($product['
|
|
|
|
|
1852 |
|
1853 |
if($download['slug'] == $slug){
|
1854 |
|
@@ -1895,8 +1973,6 @@ final class WP_Installer{
|
|
1895 |
|
1896 |
if(!empty($this->settings['repositories'])){
|
1897 |
|
1898 |
-
$this->filter_downloads_by_icl(); //downloads for ICL users
|
1899 |
-
|
1900 |
$plugins = get_plugins();
|
1901 |
|
1902 |
foreach($plugins as $plugin_id => $plugin){
|
@@ -1921,7 +1997,9 @@ final class WP_Installer{
|
|
1921 |
|
1922 |
foreach($package['products'] as $product){
|
1923 |
|
1924 |
-
foreach($product['
|
|
|
|
|
1925 |
|
1926 |
if(!empty($download['free-on-wporg'])) {
|
1927 |
continue;
|
@@ -1983,7 +2061,9 @@ final class WP_Installer{
|
|
1983 |
|
1984 |
foreach($package['products'] as $product){
|
1985 |
|
1986 |
-
foreach($product['
|
|
|
|
|
1987 |
|
1988 |
if(!empty($download['free-on-wporg'])) {
|
1989 |
continue;
|
@@ -2275,78 +2355,6 @@ final class WP_Installer{
|
|
2275 |
return $a['order'] > $b['order'];
|
2276 |
}
|
2277 |
|
2278 |
-
public function filter_downloads_by_icl(){
|
2279 |
-
if(function_exists('wpml_site_uses_icl') && wpml_site_uses_icl()){
|
2280 |
-
|
2281 |
-
if(!empty($this->settings['repositories'])) {
|
2282 |
-
foreach ($this->settings['repositories'] as $repository_id => $repository) {
|
2283 |
-
|
2284 |
-
if (empty($repository['data']['packages'])) continue;
|
2285 |
-
|
2286 |
-
foreach ($repository['data']['packages'] as $package_id => $package) {
|
2287 |
-
foreach($package['products'] as $product_id => $product){
|
2288 |
-
|
2289 |
-
foreach($product['downloads'] as $download_id => $download){
|
2290 |
-
|
2291 |
-
if(isset($download['version-for-icl']) && isset($download['url-for-icl'])){
|
2292 |
-
$download['version'] = $download['version-for-icl'];
|
2293 |
-
$download['url'] = $download['url-for-icl'];
|
2294 |
-
unset($download['version-for-icl']);
|
2295 |
-
unset($download['url-for-icl']);
|
2296 |
-
$this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id] = $download;
|
2297 |
-
|
2298 |
-
}
|
2299 |
-
|
2300 |
-
}
|
2301 |
-
}
|
2302 |
-
|
2303 |
-
}
|
2304 |
-
|
2305 |
-
}
|
2306 |
-
}
|
2307 |
-
|
2308 |
-
}
|
2309 |
-
|
2310 |
-
// Exception: WPML before 3.2 should not be able to upgrade to 3.2+ automatically
|
2311 |
-
// Only when the exact folder name is used: sitepress-multilignaul-cms
|
2312 |
-
$plugins = get_plugins();
|
2313 |
-
foreach($plugins as $id => $plugin){
|
2314 |
-
if( dirname($id) == 'sitepress-multilingual-cms' ){
|
2315 |
-
$wpml_version = $plugin['Version'];
|
2316 |
-
|
2317 |
-
}
|
2318 |
-
}
|
2319 |
-
|
2320 |
-
if(!empty($wpml_version) && version_compare( $wpml_version, '3.2', '<' )){
|
2321 |
-
if(!empty($this->settings['repositories']['wpml'])) {
|
2322 |
-
|
2323 |
-
foreach ($this->settings['repositories']['wpml']['data']['packages'] as $package_id => $package) {
|
2324 |
-
foreach($package['products'] as $product_id => $product){
|
2325 |
-
|
2326 |
-
foreach($product['downloads'] as $download_id => $download){
|
2327 |
-
|
2328 |
-
$this->settings['repositories']['wpml']['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id]['changelog'] = '';
|
2329 |
-
$this->settings['repositories']['wpml']['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id]['description'] = '';
|
2330 |
-
|
2331 |
-
if(isset($download['version-for-icl']) && isset($download['url-for-icl'])){
|
2332 |
-
$download['version'] = $download['version-for-icl'];
|
2333 |
-
$download['url'] = $download['url-for-icl'];
|
2334 |
-
unset($download['version-for-icl']);
|
2335 |
-
unset($download['url-for-icl']);
|
2336 |
-
$this->settings['repositories']['wpml']['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id] = $download;
|
2337 |
-
|
2338 |
-
}
|
2339 |
-
|
2340 |
-
}
|
2341 |
-
}
|
2342 |
-
|
2343 |
-
}
|
2344 |
-
}
|
2345 |
-
}
|
2346 |
-
// Exception pre-WPML 3.2 - END
|
2347 |
-
|
2348 |
-
}
|
2349 |
-
|
2350 |
public function get_support_tag_by_name( $name, $repository ){
|
2351 |
|
2352 |
if( is_array($this->settings['repositories'][$repository]['data']['support_tags'] )){
|
@@ -2384,7 +2392,9 @@ final class WP_Installer{
|
|
2384 |
|
2385 |
foreach ($package['products'] as $product) {
|
2386 |
|
2387 |
-
foreach ($product['
|
|
|
|
|
2388 |
|
2389 |
if ($download['slug'] == $wp_plugin_slug) {
|
2390 |
$plugin_repository = $repository_id;
|
@@ -2463,7 +2473,8 @@ final class WP_Installer{
|
|
2463 |
|
2464 |
foreach($package['products'] as $product){
|
2465 |
|
2466 |
-
foreach($product['
|
|
|
2467 |
|
2468 |
//match by folder, will change to match by name and folder
|
2469 |
if($download['slug'] == $wp_plugin_slug) {
|
93 |
|
94 |
public function init(){
|
95 |
global $pagenow;
|
96 |
+
|
97 |
if(empty($this->settings['_pre_1_0_clean_up'])) {
|
98 |
$this->_pre_1_0_clean_up();
|
99 |
}
|
100 |
|
101 |
+
$this->settings = $this->_old_products_format_backwards_compatibility($this->settings);
|
102 |
+
|
103 |
if ( !function_exists( 'get_plugins' ) ) {
|
104 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
105 |
}
|
280 |
|
281 |
foreach($package['products'] as $product){
|
282 |
|
283 |
+
foreach($product['plugins'] as $plugin_slug){
|
284 |
+
|
285 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
286 |
|
287 |
if(!isset($repositories_plugins[$repository_id][$download['slug']])){
|
288 |
$repositories_plugins[$repository_id][$download['slug']] = array(
|
354 |
|
355 |
if( $product['subscription_type'] == $subscription_type || $this->have_superior_subscription($subscription_type, $product) ) {
|
356 |
|
357 |
+
foreach ($product['plugins'] as $plugin_slug) {
|
358 |
+
|
359 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
360 |
|
361 |
if (!isset($rep_plugins[$download['slug']])) {
|
362 |
$r_plugins[$download['slug']] = $download['slug'];
|
437 |
|
438 |
}
|
439 |
|
440 |
+
public function get_settings($refresh = false){
|
441 |
+
|
442 |
+
if($refresh || empty($this->settings)){
|
443 |
+
|
444 |
+
$_settings = get_option('wp_installer_settings');
|
445 |
|
446 |
|
447 |
+
if (is_array($_settings) || empty($_settings)) { //backward compatibility 1.1
|
448 |
+
$this->settings = $_settings;
|
449 |
+
|
450 |
+
} else {
|
451 |
+
$_settings = base64_decode($_settings);
|
452 |
+
if ($this->_gz_on) {
|
453 |
+
$_settings = gzuncompress($_settings);
|
454 |
+
}
|
455 |
+
$this->settings = unserialize($_settings);
|
456 |
}
|
|
|
|
|
457 |
|
458 |
+
if (is_multisite() && isset($settings['repositories'])) {
|
459 |
+
$network_settings = maybe_unserialize(get_site_option('wp_installer_network'));
|
460 |
+
if ($network_settings) {
|
461 |
+
foreach ($this->settings['repositories'] as $rep_id => $repository) {
|
462 |
+
if (isset($network_settings[$rep_id])) {
|
463 |
+
$this->settings['repositories'][$rep_id]['subscription'] = $network_settings[$rep_id];
|
464 |
+
}
|
465 |
}
|
466 |
}
|
467 |
}
|
|
|
468 |
|
469 |
|
470 |
+
$this->settings = $this->_pre_1_6_backwards_compatibility($this->settings);
|
471 |
|
472 |
+
$this->settings = $this->_old_products_format_backwards_compatibility($this->settings);
|
473 |
|
474 |
+
}
|
475 |
+
|
476 |
+
|
477 |
+
return $this->settings;
|
478 |
}
|
479 |
|
480 |
//backward compatibility, will remove 'basename' in version 1.8
|
484 |
|
485 |
foreach ($settings['repositories'] as $repository_id => $repository) {
|
486 |
|
487 |
+
foreach ($repository['data']['downloads']['plugins'] as $slug => $download) {
|
488 |
+
|
489 |
+
$settings['repositories'][$repository_id]['data']['downloads']['plugins'][$slug]['slug'] = $download['basename'];
|
490 |
+
|
491 |
+
}
|
492 |
+
}
|
493 |
+
|
494 |
+
}
|
495 |
+
|
496 |
+
return $settings;
|
497 |
+
|
498 |
+
}
|
499 |
+
|
500 |
+
//backward compatibility - support old products list format (downloads under products instead of global downloads list)
|
501 |
+
private function _old_products_format_backwards_compatibility($settings){
|
502 |
+
|
503 |
+
if( version_compare($this->version(), '1.8', '<') && !empty($settings['repositories']) ) {
|
504 |
+
|
505 |
+
foreach ($settings['repositories'] as $repository_id => $repository) {
|
506 |
+
|
507 |
+
$populate_downloads = false;
|
508 |
+
|
509 |
foreach ($repository['data']['packages'] as $package_id => $package) {
|
510 |
|
511 |
foreach ($package['products'] as $product_id => $product) {
|
512 |
|
513 |
+
if (!isset($product['plugins'])) {
|
514 |
+
|
515 |
+
$populate_downloads = true;
|
516 |
+
|
517 |
+
foreach ($product['downloads'] as $download_id => $download) {
|
518 |
+
|
519 |
+
$settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['plugins'][] = $download['slug'];
|
520 |
+
|
521 |
+
}
|
522 |
+
|
523 |
+
}
|
524 |
+
|
525 |
+
}
|
526 |
+
|
527 |
+
}
|
528 |
+
|
529 |
+
if ($populate_downloads) {
|
530 |
+
|
531 |
+
// Add downloads branch
|
532 |
+
foreach ($repository['data']['packages'] as $package_id => $package) {
|
533 |
|
534 |
+
foreach ($package['products'] as $product_id => $product) {
|
535 |
+
|
536 |
+
foreach ($product['downloads'] as $download_id => $download) {
|
537 |
+
|
538 |
+
if (!isset($settings['repositories'][$repository_id]['data']['downloads']['plugins'][$download['slug']])) {
|
539 |
+
$settings['repositories'][$repository_id]['data']['downloads']['plugins'][$download['slug']] = $download;
|
540 |
+
}
|
541 |
|
542 |
+
$settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['plugins'][] = $download['slug'];
|
543 |
}
|
544 |
|
545 |
+
unset($settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['downloads']);
|
546 |
+
|
547 |
}
|
548 |
+
|
549 |
}
|
550 |
|
551 |
}
|
552 |
+
|
553 |
}
|
554 |
|
555 |
}
|
697 |
|
698 |
}
|
699 |
|
700 |
+
$error = sprintf(__("Installer cannot display the products information because the automatic updating for %s was explicitly disabled with the configuration below (usually in wp-config.php):", 'installer'), strtoupper( join(', ', $repository_names) ));
|
701 |
$error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code><br /><br />';
|
702 |
$error .= sprintf(__("In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code.", 'installer'), '<a href="' . admin_url('update-core.php') . '">', '</a>');
|
703 |
|
735 |
$body = wp_remote_retrieve_body($response);
|
736 |
if($body){
|
737 |
$products = json_decode($body, true);
|
738 |
+
|
739 |
if(is_array($products)){
|
740 |
$this->settings['repositories'][$id]['data'] = $products;
|
741 |
$this->settings = $this->_pre_1_6_backwards_compatibility($this->settings);
|
745 |
}
|
746 |
|
747 |
$this->log( sprintf("Checked for %s updates: %s", $id, $data['products']) );
|
748 |
+
|
749 |
+
|
750 |
}
|
751 |
|
752 |
// cleanup
|
784 |
|
785 |
$this->localize_strings();
|
786 |
$this->set_filtered_prices($args);
|
|
|
787 |
$this->set_hierarchy_and_order();
|
788 |
|
789 |
foreach($this->settings['repositories'] as $repository_id => $repository){
|
897 |
|
898 |
// downloads
|
899 |
if(isset($subscription_type) && !$expired && $product['subscription_type'] == $subscription_type){
|
900 |
+
foreach($product['plugins'] as $plugin_slug){
|
901 |
+
|
902 |
+
$row['downloads'][] = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
903 |
+
|
904 |
+
}
|
905 |
+
|
906 |
}
|
907 |
|
908 |
//subpackages
|
1219 |
|
1220 |
foreach( $package['products'] as $product_id => $product ){
|
1221 |
|
1222 |
+
foreach( $product['plugins'] as $plugin_slug ){
|
1223 |
+
|
1224 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
1225 |
+
|
1226 |
if( empty( $versions[$download['slug']] ) ) {
|
1227 |
$v = $this->get_plugin_installed_version($download['name'], $download['slug']);
|
1228 |
if($v){
|
1396 |
|
1397 |
foreach($package['products'] as $product){
|
1398 |
|
1399 |
+
foreach($product['plugins'] as $plugin_slug){
|
1400 |
+
|
1401 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
1402 |
|
1403 |
if($download['slug'] == $slug || $download['name'] == $plugin['Name'] || $download['name'] == $plugin['Title']){ //match order: slug, name, title
|
1404 |
|
1673 |
foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package){
|
1674 |
foreach($package['products'] as $product) {
|
1675 |
|
1676 |
+
foreach($product['plugins'] as $plugin_slug){
|
1677 |
+
|
1678 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
1679 |
|
1680 |
if($download['slug'] == $slug){
|
1681 |
$version = $download['version'];
|
1924 |
|
1925 |
foreach($package['products'] as $product){
|
1926 |
|
1927 |
+
foreach($product['plugins'] as $plugin_slug){
|
1928 |
+
|
1929 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
1930 |
|
1931 |
if($download['slug'] == $slug){
|
1932 |
|
1973 |
|
1974 |
if(!empty($this->settings['repositories'])){
|
1975 |
|
|
|
|
|
1976 |
$plugins = get_plugins();
|
1977 |
|
1978 |
foreach($plugins as $plugin_id => $plugin){
|
1997 |
|
1998 |
foreach($package['products'] as $product){
|
1999 |
|
2000 |
+
foreach($product['plugins'] as $plugin_slug){
|
2001 |
+
|
2002 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
2003 |
|
2004 |
if(!empty($download['free-on-wporg'])) {
|
2005 |
continue;
|
2061 |
|
2062 |
foreach($package['products'] as $product){
|
2063 |
|
2064 |
+
foreach($product['plugins'] as $plugin_slug){
|
2065 |
+
|
2066 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
2067 |
|
2068 |
if(!empty($download['free-on-wporg'])) {
|
2069 |
continue;
|
2355 |
return $a['order'] > $b['order'];
|
2356 |
}
|
2357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2358 |
public function get_support_tag_by_name( $name, $repository ){
|
2359 |
|
2360 |
if( is_array($this->settings['repositories'][$repository]['data']['support_tags'] )){
|
2392 |
|
2393 |
foreach ($package['products'] as $product) {
|
2394 |
|
2395 |
+
foreach ($product['plugins'] as $plugin_slug) {
|
2396 |
+
|
2397 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
2398 |
|
2399 |
if ($download['slug'] == $wp_plugin_slug) {
|
2400 |
$plugin_repository = $repository_id;
|
2473 |
|
2474 |
foreach($package['products'] as $product){
|
2475 |
|
2476 |
+
foreach($product['plugins'] as $plugin_slug){
|
2477 |
+
$download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
|
2478 |
|
2479 |
//match by folder, will change to match by name and folder
|
2480 |
if($download['slug'] == $wp_plugin_slug) {
|
plus/installer/installer.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
define('WP_INSTALLER_VERSION', '1.
|
3 |
|
4 |
include_once dirname(__FILE__) . '/includes/installer.class.php';
|
5 |
|
1 |
<?php
|
2 |
+
define('WP_INSTALLER_VERSION', '1.7.0');
|
3 |
|
4 |
include_once dirname(__FILE__) . '/includes/installer.class.php';
|
5 |
|
plus/installer/loader.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Installer
|
4 |
Plugin URI: http://wp-compatibility.com/installer-plugin/
|
5 |
Description: Need help buying, installing and upgrading commercial themes and plugins? **Installer** handles all this for you, right from the WordPress admin. Installer lets you find themes and plugins from different sources, then, buy them from within the WordPress admin. Instead of manually uploading and unpacking, you'll see those themes and plugins available, just like any other plugin you're getting from WordPress.org.
|
6 |
-
Version: 1.
|
7 |
Author: OnTheGoSystems Inc.
|
8 |
Author URI: http://www.onthegosystems.com/
|
9 |
*/
|
@@ -28,7 +28,7 @@ $wp_installer_instance = dirname(__FILE__) . '/installer.php';
|
|
28 |
global $wp_installer_instances;
|
29 |
$wp_installer_instances[$wp_installer_instance] = array(
|
30 |
'bootfile' => $wp_installer_instance,
|
31 |
-
'version' => '1.
|
32 |
);
|
33 |
|
34 |
// Exception: When WPML prior 3.2 is used, that instance must be used regardless of another newer instance
|
3 |
Plugin Name: Installer
|
4 |
Plugin URI: http://wp-compatibility.com/installer-plugin/
|
5 |
Description: Need help buying, installing and upgrading commercial themes and plugins? **Installer** handles all this for you, right from the WordPress admin. Installer lets you find themes and plugins from different sources, then, buy them from within the WordPress admin. Instead of manually uploading and unpacking, you'll see those themes and plugins available, just like any other plugin you're getting from WordPress.org.
|
6 |
+
Version: 1.7.0
|
7 |
Author: OnTheGoSystems Inc.
|
8 |
Author URI: http://www.onthegosystems.com/
|
9 |
*/
|
28 |
global $wp_installer_instances;
|
29 |
$wp_installer_instances[$wp_installer_instance] = array(
|
30 |
'bootfile' => $wp_installer_instance,
|
31 |
+
'version' => '1.7.0'
|
32 |
);
|
33 |
|
34 |
// Exception: When WPML prior 3.2 is used, that instance must be used regardless of another newer instance
|
plus/installer/repositories.xml
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
<repository>
|
4 |
<id>wpml</id>
|
5 |
<apiurl>https://api.wpml.org/</apiurl>
|
6 |
-
<products>http://d2salfytceyqoe.cloudfront.net/
|
7 |
</repository>
|
8 |
<repository>
|
9 |
<id>toolset</id>
|
10 |
-
<apiurl>
|
11 |
-
<products>http://d7j863fr5jhrr.cloudfront.net/
|
12 |
</repository>
|
13 |
</repositories>
|
3 |
<repository>
|
4 |
<id>wpml</id>
|
5 |
<apiurl>https://api.wpml.org/</apiurl>
|
6 |
+
<products>http://d2salfytceyqoe.cloudfront.net/wpml33-products.json</products>
|
7 |
</repository>
|
8 |
<repository>
|
9 |
<id>toolset</id>
|
10 |
+
<apiurl>http://api.wp-types.com/</apiurl>
|
11 |
+
<products>http://d7j863fr5jhrr.cloudfront.net/toolset33-products.json</products>
|
12 |
</repository>
|
13 |
</repositories>
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: CMS, custom field, custom fields, custom post type, custom post types, fie
|
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.4
|
7 |
Tested up to: 4.3.1
|
8 |
-
Stable tag: 1.8.
|
9 |
|
10 |
The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields.
|
11 |
|
@@ -155,11 +155,17 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
155 |
|
156 |
== Changelog ==
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
= 1.8.8 =
|
159 |
|
160 |
* Release date: 2015-11-02
|
161 |
-
*
|
162 |
-
*
|
163 |
|
164 |
= 1.8.7.2 =
|
165 |
|
@@ -170,15 +176,15 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
170 |
= 1.8.7.1 =
|
171 |
|
172 |
* Release date: 2015-10-20
|
173 |
-
*
|
174 |
|
175 |
= 1.8.7 =
|
176 |
|
177 |
* Release date: 2015-10-18
|
178 |
* Fixed a problem with shortcode playlist.
|
179 |
* Fixed a problem with backslash in WYSIWYG field name.
|
180 |
-
*
|
181 |
-
*
|
182 |
|
183 |
= 1.8.6.2 =
|
184 |
|
@@ -194,7 +200,7 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
194 |
= 1.8.6 =
|
195 |
|
196 |
* Release date: 2015-09-28
|
197 |
-
*
|
198 |
* Fixed a meta post data before use and if is too complex just do not handle this in Types.
|
199 |
* Fixed a problem with selecting file in child tabele when is no WYSIWYG or other file field on edit screen.
|
200 |
* When we get User Group we added information about affected roles.
|
@@ -286,12 +292,12 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
286 |
= 1.7.6 =
|
287 |
|
288 |
* Release date: 2015-07-20
|
289 |
-
*
|
290 |
|
291 |
= 1.7.6 =
|
292 |
|
293 |
* Release date: 2015-07-20
|
294 |
-
*
|
295 |
|
296 |
= 1.7.5 =
|
297 |
|
@@ -301,7 +307,7 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
301 |
= 1.7.4 =
|
302 |
|
303 |
* Release date: 2015-07-09
|
304 |
-
*
|
305 |
|
306 |
= 1.7.3 =
|
307 |
|
@@ -399,7 +405,7 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
399 |
= 1.6.5 =
|
400 |
|
401 |
* Release date: 2015-02-10
|
402 |
-
*
|
403 |
* Added ability to hide custom post types on post relationships list. https://wp-types.com/forums/topic/post-relationship-doesnt-show-post-type-events-created-by-events-espresso/ using filter add_filter('wpcf_show_ui_hide_in_relationships', '__return_false');
|
404 |
* Fixed a problem with deleting last children on post relationships table.
|
405 |
* Added filter to allow use "?" in image url. https://wp-types.com/forums/topic/image-custom-field-is-not-storing-image-path-with-parameters/
|
@@ -409,9 +415,9 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
409 |
* Fixed a conflict with Formidable-Pro plugin https://wp-types.com/forums/topic/plugin-conflict/
|
410 |
* Fixed creating new post in relationships. WP 4.1 need real title not faked by one space.
|
411 |
* Fixed problem with validate fields on user create page. http://wp-types.com/forums/topic/custom-usermeta-bypassed-even-required-is-set/
|
412 |
-
*
|
413 |
* Fixed problem with default label which contains single quote character (eg. French) https://wp-types.com/forums/topic/default-label-always-shown/
|
414 |
-
*
|
415 |
|
416 |
= 1.6.4 =
|
417 |
|
@@ -452,17 +458,17 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
452 |
= 1.6.2 =
|
453 |
|
454 |
* Release date: 2014-08-29
|
455 |
-
*
|
456 |
-
*
|
457 |
-
*
|
458 |
|
459 |
= 1.6.1 =
|
460 |
|
461 |
* Release date: 2014-08-22
|
462 |
-
*
|
463 |
-
*
|
464 |
-
*
|
465 |
-
*
|
466 |
|
467 |
= 1.6 =
|
468 |
|
@@ -484,13 +490,13 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
484 |
* Improved import button, which is disabled until user select a import file.
|
485 |
* Improved custom display logic UI for conditional display in custom fields edit screen.
|
486 |
* Prevent raising group chose overlay on "Custom Fields Control" screen if there is no group.
|
487 |
-
*
|
488 |
* Removed Zebra library and created new Toolset fields library.
|
489 |
* Tweak import/export screen when is something wrong with imported file
|
490 |
-
*
|
491 |
* Unify code with other Toolset plugins
|
492 |
-
*
|
493 |
-
*
|
494 |
|
495 |
= 1.5.7 =
|
496 |
|
@@ -668,30 +674,30 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
668 |
* Added control of the number of children displayed in the Fields table
|
669 |
* Added optional hour and minutes to the Date field
|
670 |
* Added check to make sure the single and plural names of a Custom Post Type are different
|
671 |
-
*
|
672 |
-
*
|
673 |
-
*
|
674 |
-
*
|
675 |
-
*
|
676 |
-
*
|
677 |
-
*
|
678 |
-
*
|
679 |
-
*
|
680 |
|
681 |
= 1.1.3.4 =
|
682 |
-
*
|
683 |
|
684 |
= 1.1.3.2 =
|
685 |
-
*
|
686 |
* Added support for localized custom post slugs via WPML
|
687 |
|
688 |
= 1.1.3.1 =
|
689 |
-
*
|
690 |
* Fixed a bug displaying Types credit footer when not asked to do so
|
691 |
|
692 |
= 1.1.3 =
|
693 |
-
*
|
694 |
-
*
|
695 |
* Fixed many small bugs and glitches
|
696 |
* Sync with Views 1.1.3
|
697 |
|
@@ -789,7 +795,7 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
789 |
* You can now enable custom field groups for content with specific templates
|
790 |
|
791 |
= 0.9.4.1 =
|
792 |
-
*
|
793 |
|
794 |
= 0.9.5 =
|
795 |
Try the new parent/child relationship between different post types!
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.4
|
7 |
Tested up to: 4.3.1
|
8 |
+
Stable tag: 1.8.9
|
9 |
|
10 |
The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields.
|
11 |
|
155 |
|
156 |
== Changelog ==
|
157 |
|
158 |
+
= 1.8.9 =
|
159 |
+
|
160 |
+
* Release date: 2015-11-10
|
161 |
+
* Changed Installer version to 1.7
|
162 |
+
* Changed Common version to 1.8
|
163 |
+
|
164 |
= 1.8.8 =
|
165 |
|
166 |
* Release date: 2015-11-02
|
167 |
+
* Replaced esc_attr_e to esc_attr in skype field.
|
168 |
+
* Changed Installer version to 1.6.8.
|
169 |
|
170 |
= 1.8.7.2 =
|
171 |
|
176 |
= 1.8.7.1 =
|
177 |
|
178 |
* Release date: 2015-10-20
|
179 |
+
* Added check to do not translate if value to translate is empty or not a string.
|
180 |
|
181 |
= 1.8.7 =
|
182 |
|
183 |
* Release date: 2015-10-18
|
184 |
* Fixed a problem with shortcode playlist.
|
185 |
* Fixed a problem with backslash in WYSIWYG field name.
|
186 |
+
* Improved WPML integration, replace `icl_t()` by filter `wpml_translate_single_string`.
|
187 |
+
* Changed Installer version to 1.6.7 - to reduce requests to Toolset API.
|
188 |
|
189 |
= 1.8.6.2 =
|
190 |
|
200 |
= 1.8.6 =
|
201 |
|
202 |
* Release date: 2015-09-28
|
203 |
+
* Replaced parameter "numberposts" with "posts_per_page" in post relationships query.
|
204 |
* Fixed a meta post data before use and if is too complex just do not handle this in Types.
|
205 |
* Fixed a problem with selecting file in child tabele when is no WYSIWYG or other file field on edit screen.
|
206 |
* When we get User Group we added information about affected roles.
|
292 |
= 1.7.6 =
|
293 |
|
294 |
* Release date: 2015-07-20
|
295 |
+
* Changed Installer version to 1.6.4 - to reduce load time and avoid to much update requests.
|
296 |
|
297 |
= 1.7.6 =
|
298 |
|
299 |
* Release date: 2015-07-20
|
300 |
+
* Changed Installer version to 1.6.4 - to reduce load time and avoid to much update requests.
|
301 |
|
302 |
= 1.7.5 =
|
303 |
|
307 |
= 1.7.4 =
|
308 |
|
309 |
* Release date: 2015-07-09
|
310 |
+
* Changed Installer version to 1.6.1
|
311 |
|
312 |
= 1.7.3 =
|
313 |
|
405 |
= 1.6.5 =
|
406 |
|
407 |
* Release date: 2015-02-10
|
408 |
+
* Changed in relationships, now all posts are showed, even those which have show_ui to false.
|
409 |
* Added ability to hide custom post types on post relationships list. https://wp-types.com/forums/topic/post-relationship-doesnt-show-post-type-events-created-by-events-espresso/ using filter add_filter('wpcf_show_ui_hide_in_relationships', '__return_false');
|
410 |
* Fixed a problem with deleting last children on post relationships table.
|
411 |
* Added filter to allow use "?" in image url. https://wp-types.com/forums/topic/image-custom-field-is-not-storing-image-path-with-parameters/
|
415 |
* Fixed a conflict with Formidable-Pro plugin https://wp-types.com/forums/topic/plugin-conflict/
|
416 |
* Fixed creating new post in relationships. WP 4.1 need real title not faked by one space.
|
417 |
* Fixed problem with validate fields on user create page. http://wp-types.com/forums/topic/custom-usermeta-bypassed-even-required-is-set/
|
418 |
+
* Improved Edit CPT and Edit CT screens to be more compatible with WP Admin UI
|
419 |
* Fixed problem with default label which contains single quote character (eg. French) https://wp-types.com/forums/topic/default-label-always-shown/
|
420 |
+
* Improved display list of custom fields groups.
|
421 |
|
422 |
= 1.6.4 =
|
423 |
|
458 |
= 1.6.2 =
|
459 |
|
460 |
* Release date: 2014-08-29
|
461 |
+
* Fixed addslashes warning
|
462 |
+
* Fixed display problems with Types shortcodes
|
463 |
+
* Fixed PHP error for checkboxes
|
464 |
|
465 |
= 1.6.1 =
|
466 |
|
467 |
* Release date: 2014-08-22
|
468 |
+
* Fixed Formfactory::createForm and Formfactory::displayForm errors on some systems
|
469 |
+
* Fixed anonymous function problem with wysiwyg field
|
470 |
+
* Fixed datepicker.css so it only styles the datepicker popup
|
471 |
+
* Fixed escaping problems with the Types shortcode
|
472 |
|
473 |
= 1.6 =
|
474 |
|
490 |
* Improved import button, which is disabled until user select a import file.
|
491 |
* Improved custom display logic UI for conditional display in custom fields edit screen.
|
492 |
* Prevent raising group chose overlay on "Custom Fields Control" screen if there is no group.
|
493 |
+
* Removed serialize/unserialize for exported relationships to avoid object injection.
|
494 |
* Removed Zebra library and created new Toolset fields library.
|
495 |
* Tweak import/export screen when is something wrong with imported file
|
496 |
+
* Fixed several security issues
|
497 |
* Unify code with other Toolset plugins
|
498 |
+
* Added debug information output for improved customer support
|
499 |
+
* Added "required" validation audio, file and video fields
|
500 |
|
501 |
= 1.5.7 =
|
502 |
|
674 |
* Added control of the number of children displayed in the Fields table
|
675 |
* Added optional hour and minutes to the Date field
|
676 |
* Added check to make sure the single and plural names of a Custom Post Type are different
|
677 |
+
* Fixed handling of required conditional fields
|
678 |
+
* Removed use of mb_ereg and mb_string functions
|
679 |
+
* Fixed JavaScript escaping
|
680 |
+
* Fixed rendering of shortcodes inside types shortcode
|
681 |
+
* Fixed Open_basedir restriction
|
682 |
+
* Fixed AJAX popup CSS and JS
|
683 |
+
* Fixed translation of "Add another field" and "Delete field" buttons
|
684 |
+
* Fixed exporting and importing of Types Taxonomy
|
685 |
+
* Fixed exporting and importing of conditional settings for groups
|
686 |
|
687 |
= 1.1.3.4 =
|
688 |
+
* Fixed adding child posts for WordPress 3.5
|
689 |
|
690 |
= 1.1.3.2 =
|
691 |
+
* Fixed 'em' tags in radio.php and select.php
|
692 |
* Added support for localized custom post slugs via WPML
|
693 |
|
694 |
= 1.1.3.1 =
|
695 |
+
* Fixed saving fields in WP 3.5
|
696 |
* Fixed a bug displaying Types credit footer when not asked to do so
|
697 |
|
698 |
= 1.1.3 =
|
699 |
+
* Added support for resizing remote images
|
700 |
+
* Fixed long and short date formats
|
701 |
* Fixed many small bugs and glitches
|
702 |
* Sync with Views 1.1.3
|
703 |
|
795 |
* You can now enable custom field groups for content with specific templates
|
796 |
|
797 |
= 0.9.4.1 =
|
798 |
+
* Fixed a few problems found in the 0.9.4 release
|
799 |
|
800 |
= 0.9.5 =
|
801 |
Try the new parent/child relationship between different post types!
|
wpcf.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
-
Version: 1.8.
|
9 |
*/
|
10 |
/**
|
11 |
*
|
@@ -16,7 +16,7 @@ if ( !defined( 'WPCF_VERSION' ) ) {
|
|
16 |
/**
|
17 |
* make sure that WPCF_VERSION in embedded/bootstrap.php is the same!
|
18 |
*/
|
19 |
-
define( 'WPCF_VERSION', '1.8.
|
20 |
}
|
21 |
|
22 |
define( 'WPCF_REPOSITORY', 'http://api.wp-types.com/' );
|
5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
+
Version: 1.8.9
|
9 |
*/
|
10 |
/**
|
11 |
*
|
16 |
/**
|
17 |
* make sure that WPCF_VERSION in embedded/bootstrap.php is the same!
|
18 |
*/
|
19 |
+
define( 'WPCF_VERSION', '1.8.9' );
|
20 |
}
|
21 |
|
22 |
define( 'WPCF_REPOSITORY', 'http://api.wp-types.com/' );
|