Version Description
- wp.org review
Download this release
Release Info
| Developer | machothemes |
| Plugin | |
| Version | 1.3.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.3.3 to 1.3.4
- Modula.php +55 -37
- README.txt +4 -1
- admin/edit-gallery.php +1 -1
- admin/include/image-list.php +19 -19
- admin/include/tinymce-galleries.php +5 -5
- admin/welcome-screen/sections/comparison-table.php +13 -13
- admin/welcome-screen/sections/getting-started.php +39 -39
- admin/welcome-screen/sections/modula-v2.php +3 -3
- lib/class-epsilon-plugin-request.php +0 -225
- lib/class-modula-feedback.php +0 -252
- lib/class-modula-review.php +7 -7
- lib/db-class.php +142 -22
- lib/gallery-class.php +22 -22
Modula.php
CHANGED
|
@@ -5,20 +5,20 @@
|
|
| 5 |
* Description: Modula is one of the best & most creative WordPress gallery plugins. Use it to create a great grid or
|
| 6 |
* masonry image gallery.
|
| 7 |
* Author: Macho Themes
|
| 8 |
-
* Version: 1.3.
|
| 9 |
* Author URI: https://www.machothemes.com/
|
| 10 |
*/
|
| 11 |
|
| 12 |
define( 'MODULA_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
| 13 |
define( 'MODULA_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
|
| 14 |
|
| 15 |
-
define( 'MODULA_VERSION', '1.3.
|
| 16 |
define( 'MODULA_PLUGIN_BASE', plugin_basename( __FILE__ ) );
|
| 17 |
-
define( 'MODULA_PREVIOUS_PLUGIN_VERSION', '1.3.
|
| 18 |
define( 'MODULA_FILE_', __FILE__ );
|
| 19 |
|
| 20 |
function modula_lite_create_db_tables() {
|
| 21 |
-
include_once(
|
| 22 |
modula_lite_install_db();
|
| 23 |
}
|
| 24 |
|
|
@@ -28,7 +28,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 28 |
private $loadedData;
|
| 29 |
private $fields = array();
|
| 30 |
|
| 31 |
-
private $version = "1.3.
|
| 32 |
|
| 33 |
private $defaultValues = array(
|
| 34 |
'width' => 100,
|
|
@@ -79,9 +79,6 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 79 |
$this->define_hover_effects();
|
| 80 |
$this->ModulaDB = $this->create_db_conn();
|
| 81 |
|
| 82 |
-
require_once 'lib/class-modula-feedback.php';
|
| 83 |
-
new Modula_Feedback( __FILE__ );
|
| 84 |
-
|
| 85 |
add_filter( 'widget_text', 'do_shortcode' );
|
| 86 |
add_filter( 'mce_buttons', array( $this, 'editor_button' ) );
|
| 87 |
add_filter( 'mce_external_plugins', array( $this, 'register_editor_plugin' ) );
|
|
@@ -468,8 +465,8 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 468 |
return;
|
| 469 |
}
|
| 470 |
|
| 471 |
-
wp_enqueue_script( 'modula-fancybox', plugins_url(
|
| 472 |
-
wp_enqueue_style( 'modula-fancybox', plugins_url(
|
| 473 |
|
| 474 |
}
|
| 475 |
|
|
@@ -648,7 +645,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 648 |
//delete gallery
|
| 649 |
function delete_gallery() {
|
| 650 |
if ( check_admin_referer( "Modula", "Modula" ) ) {
|
| 651 |
-
$id =
|
| 652 |
$this->ModulaDB->deleteGallery( $id );
|
| 653 |
}
|
| 654 |
|
|
@@ -657,7 +654,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 657 |
|
| 658 |
public function update_config() {
|
| 659 |
if ( check_admin_referer( "Modula", "Modula" ) ) {
|
| 660 |
-
$id = $_POST['id'];
|
| 661 |
$config = stripslashes( $_POST['config'] );
|
| 662 |
|
| 663 |
$this->ModulaDB->update_config( $id, $config );
|
|
@@ -668,7 +665,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 668 |
|
| 669 |
public function get_config() {
|
| 670 |
if ( check_admin_referer( "Modula", "Modula" ) ) {
|
| 671 |
-
$id = $_POST['id'];
|
| 672 |
|
| 673 |
$data = $this->ModulaDB->getConfig( $id );
|
| 674 |
|
|
@@ -684,11 +681,11 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 684 |
function create_gallery() {
|
| 685 |
if ( check_admin_referer( "Modula", "Modula" ) ) {
|
| 686 |
$data = $this->defaultValues;
|
| 687 |
-
$data["name"] = $_POST['name'];
|
| 688 |
-
$data["description"] = $_POST['description'];
|
| 689 |
-
$data["width"] = $_POST['width'];
|
| 690 |
-
$data["height"] = $_POST['height'];
|
| 691 |
-
$data["img_size"] =
|
| 692 |
$data["hasResizedImages"] = true;
|
| 693 |
|
| 694 |
$this->ModulaDB->addGallery( $data );
|
|
@@ -708,7 +705,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 708 |
//clone gallery
|
| 709 |
function clone_gallery() {
|
| 710 |
if ( check_admin_referer( 'Modula', 'Modula' ) ) {
|
| 711 |
-
$sourceId =
|
| 712 |
$g = $this->ModulaDB->getGalleryById( $sourceId, $this->defaultValues );
|
| 713 |
$g->name .= "(copy)";
|
| 714 |
$this->ModulaDB->addGallery( $g );
|
|
@@ -787,17 +784,17 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 787 |
public function add_gallery_scripts() {
|
| 788 |
wp_enqueue_script( 'jquery' );
|
| 789 |
|
| 790 |
-
wp_register_script( 'modula', plugins_url(
|
| 791 |
wp_enqueue_script( 'modula' );
|
| 792 |
|
| 793 |
-
wp_register_style( 'modula_stylesheet', plugins_url(
|
| 794 |
wp_enqueue_style( 'modula_stylesheet' );
|
| 795 |
|
| 796 |
-
wp_register_style( 'effects_stylesheet', plugins_url(
|
| 797 |
wp_enqueue_style( 'effects_stylesheet' );
|
| 798 |
|
| 799 |
-
wp_register_script( 'lightbox2_script', plugins_url(
|
| 800 |
-
wp_register_style( 'lightbox2_stylesheet', plugins_url(
|
| 801 |
}
|
| 802 |
|
| 803 |
//Admin Section - register scripts and styles
|
|
@@ -814,18 +811,18 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 814 |
wp_enqueue_script( 'media-upload' );
|
| 815 |
wp_enqueue_script( 'thickbox' );
|
| 816 |
|
| 817 |
-
wp_register_style( 'materialize', plugins_url(
|
| 818 |
wp_enqueue_style( 'materialize' );
|
| 819 |
|
| 820 |
-
wp_register_style( 'styles', plugins_url(
|
| 821 |
wp_enqueue_style( 'styles' );
|
| 822 |
|
| 823 |
-
wp_register_style( 'effects', plugins_url(
|
| 824 |
wp_enqueue_style( 'effects' );
|
| 825 |
|
| 826 |
-
wp_register_script( 'materialize', plugins_url(
|
| 827 |
|
| 828 |
-
wp_register_script( 'modula', plugins_url(
|
| 829 |
'materialize',
|
| 830 |
'jquery',
|
| 831 |
'media-upload',
|
|
@@ -834,7 +831,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 834 |
|
| 835 |
wp_enqueue_script( 'modula' );
|
| 836 |
|
| 837 |
-
wp_register_style( 'materialdesign-icons', plugins_url(
|
| 838 |
wp_enqueue_style( 'materialdesign-icons' );
|
| 839 |
|
| 840 |
wp_enqueue_style( 'thickbox' );
|
|
@@ -854,7 +851,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 854 |
$overview = add_menu_page( esc_html__( 'Manage Galleries', 'modula-gallery' ), esc_html__( 'Modula', 'modula-gallery' ), 'edit_posts', 'modula-lite-admin', array(
|
| 855 |
$this,
|
| 856 |
'add_overview',
|
| 857 |
-
), plugins_url(
|
| 858 |
|
| 859 |
|
| 860 |
if ( ! get_option( "Modula_skip_fix" ) && get_option( "Modula_db_version" ) && count( $this->ModulaDB->getGalleries() ) > 0 ) {
|
|
@@ -932,7 +929,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 932 |
public function delete_image() {
|
| 933 |
if ( check_admin_referer( 'Modula', 'Modula' ) ) {
|
| 934 |
foreach ( explode( ",", $_POST["id"] ) as $id ) {
|
| 935 |
-
$this->ModulaDB->deleteImage(
|
| 936 |
}
|
| 937 |
}
|
| 938 |
die();
|
|
@@ -980,15 +977,35 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 980 |
if ( check_admin_referer( 'Modula', 'Modula' ) ) {
|
| 981 |
$result = false;
|
| 982 |
// $type = $_POST['type'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 983 |
$imageUrl = esc_url( $_POST['img_url'] );
|
| 984 |
$imageCaption = stripslashes( $_POST['description'] );
|
| 985 |
$title = stripslashes( $_POST['title'] );
|
| 986 |
-
|
| 987 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 988 |
$imageId = intval( $_POST['img_id'] );
|
| 989 |
$sortOrder = intval( $_POST['sortOrder'] );
|
| 990 |
-
|
| 991 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 992 |
|
| 993 |
$data = array(
|
| 994 |
"target" => $target,
|
|
@@ -1137,6 +1154,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 1137 |
$id = $this->ModulaDB->getNewGalleryId();
|
| 1138 |
}
|
| 1139 |
|
|
|
|
| 1140 |
if ( $result ) {
|
| 1141 |
print "{\"success\":true,\"id\":" . $id . "}";
|
| 1142 |
} else {
|
|
@@ -1148,7 +1166,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
| 1148 |
|
| 1149 |
public function edit_gallery() {
|
| 1150 |
if ( isset( $_GET['galleryId'] ) ) {
|
| 1151 |
-
$this->loadedData = $this->ModulaDB->getGalleryById(
|
| 1152 |
$modula_fields = $this->fields;
|
| 1153 |
$modula_parent_page = "dashboard";
|
| 1154 |
|
| 5 |
* Description: Modula is one of the best & most creative WordPress gallery plugins. Use it to create a great grid or
|
| 6 |
* masonry image gallery.
|
| 7 |
* Author: Macho Themes
|
| 8 |
+
* Version: 1.3.4
|
| 9 |
* Author URI: https://www.machothemes.com/
|
| 10 |
*/
|
| 11 |
|
| 12 |
define( 'MODULA_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
| 13 |
define( 'MODULA_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
|
| 14 |
|
| 15 |
+
define( 'MODULA_VERSION', '1.3.4' );
|
| 16 |
define( 'MODULA_PLUGIN_BASE', plugin_basename( __FILE__ ) );
|
| 17 |
+
define( 'MODULA_PREVIOUS_PLUGIN_VERSION', '1.3.3' );
|
| 18 |
define( 'MODULA_FILE_', __FILE__ );
|
| 19 |
|
| 20 |
function modula_lite_create_db_tables() {
|
| 21 |
+
include_once( MODULA_PLUGIN_DIR_PATH . '/lib/install-db.php' );
|
| 22 |
modula_lite_install_db();
|
| 23 |
}
|
| 24 |
|
| 28 |
private $loadedData;
|
| 29 |
private $fields = array();
|
| 30 |
|
| 31 |
+
private $version = "1.3.4";
|
| 32 |
|
| 33 |
private $defaultValues = array(
|
| 34 |
'width' => 100,
|
| 79 |
$this->define_hover_effects();
|
| 80 |
$this->ModulaDB = $this->create_db_conn();
|
| 81 |
|
|
|
|
|
|
|
|
|
|
| 82 |
add_filter( 'widget_text', 'do_shortcode' );
|
| 83 |
add_filter( 'mce_buttons', array( $this, 'editor_button' ) );
|
| 84 |
add_filter( 'mce_external_plugins', array( $this, 'register_editor_plugin' ) );
|
| 465 |
return;
|
| 466 |
}
|
| 467 |
|
| 468 |
+
wp_enqueue_script( 'modula-fancybox', plugins_url( 'admin/fancybox/jquery.fancybox.min.js', __FILE__), array( 'jquery' ) );
|
| 469 |
+
wp_enqueue_style( 'modula-fancybox', plugins_url( 'admin/fancybox/jquery.fancybox.min.css', __FILE__) );
|
| 470 |
|
| 471 |
}
|
| 472 |
|
| 645 |
//delete gallery
|
| 646 |
function delete_gallery() {
|
| 647 |
if ( check_admin_referer( "Modula", "Modula" ) ) {
|
| 648 |
+
$id = absint( $_POST['gid'] );
|
| 649 |
$this->ModulaDB->deleteGallery( $id );
|
| 650 |
}
|
| 651 |
|
| 654 |
|
| 655 |
public function update_config() {
|
| 656 |
if ( check_admin_referer( "Modula", "Modula" ) ) {
|
| 657 |
+
$id = absint($_POST['id']);
|
| 658 |
$config = stripslashes( $_POST['config'] );
|
| 659 |
|
| 660 |
$this->ModulaDB->update_config( $id, $config );
|
| 665 |
|
| 666 |
public function get_config() {
|
| 667 |
if ( check_admin_referer( "Modula", "Modula" ) ) {
|
| 668 |
+
$id = absint($_POST['id']);
|
| 669 |
|
| 670 |
$data = $this->ModulaDB->getConfig( $id );
|
| 671 |
|
| 681 |
function create_gallery() {
|
| 682 |
if ( check_admin_referer( "Modula", "Modula" ) ) {
|
| 683 |
$data = $this->defaultValues;
|
| 684 |
+
$data["name"] = sanitize_text_field($_POST['name']);
|
| 685 |
+
$data["description"] = wp_filter_post_kses($_POST['description']);
|
| 686 |
+
$data["width"] = sanitize_text_field($_POST['width']);
|
| 687 |
+
$data["height"] = absint($_POST['height']);
|
| 688 |
+
$data["img_size"] = absint( $_POST['img_size'] );
|
| 689 |
$data["hasResizedImages"] = true;
|
| 690 |
|
| 691 |
$this->ModulaDB->addGallery( $data );
|
| 705 |
//clone gallery
|
| 706 |
function clone_gallery() {
|
| 707 |
if ( check_admin_referer( 'Modula', 'Modula' ) ) {
|
| 708 |
+
$sourceId = absint( $_POST['gid'] );
|
| 709 |
$g = $this->ModulaDB->getGalleryById( $sourceId, $this->defaultValues );
|
| 710 |
$g->name .= "(copy)";
|
| 711 |
$this->ModulaDB->addGallery( $g );
|
| 784 |
public function add_gallery_scripts() {
|
| 785 |
wp_enqueue_script( 'jquery' );
|
| 786 |
|
| 787 |
+
wp_register_script( 'modula', plugins_url( 'scripts/jquery.modula.js', __FILE__ ) , array( 'jquery' ) );
|
| 788 |
wp_enqueue_script( 'modula' );
|
| 789 |
|
| 790 |
+
wp_register_style( 'modula_stylesheet', plugins_url( 'scripts/modula.css', __FILE__ ), null, $this->version );
|
| 791 |
wp_enqueue_style( 'modula_stylesheet' );
|
| 792 |
|
| 793 |
+
wp_register_style( 'effects_stylesheet', plugins_url( 'scripts/effects.css', __FILE__ ), null, $this->version );
|
| 794 |
wp_enqueue_style( 'effects_stylesheet' );
|
| 795 |
|
| 796 |
+
wp_register_script( 'lightbox2_script', plugins_url( 'lightbox/lightbox2/js/lightbox.min.js', __FILE__ ), array( 'jquery' ), $this->version, true );
|
| 797 |
+
wp_register_style( 'lightbox2_stylesheet', plugins_url( 'lightbox/lightbox2/css/lightbox.min.css', __FILE__ ) );
|
| 798 |
}
|
| 799 |
|
| 800 |
//Admin Section - register scripts and styles
|
| 811 |
wp_enqueue_script( 'media-upload' );
|
| 812 |
wp_enqueue_script( 'thickbox' );
|
| 813 |
|
| 814 |
+
wp_register_style( 'materialize', plugins_url( 'admin/css/materialize.css', __FILE__ ) );
|
| 815 |
wp_enqueue_style( 'materialize' );
|
| 816 |
|
| 817 |
+
wp_register_style( 'styles', plugins_url( 'admin/css/style.css', __FILE__ ) );
|
| 818 |
wp_enqueue_style( 'styles' );
|
| 819 |
|
| 820 |
+
wp_register_style( 'effects', plugins_url( 'scripts/effects.css', __FILE__ ) );
|
| 821 |
wp_enqueue_style( 'effects' );
|
| 822 |
|
| 823 |
+
wp_register_script( 'materialize', plugins_url( 'admin/scripts/materialize.js', __FILE__ ), array( 'jquery' ) );
|
| 824 |
|
| 825 |
+
wp_register_script( 'modula', plugins_url( 'admin/scripts/modula-admin.js', __FILE__ ), array(
|
| 826 |
'materialize',
|
| 827 |
'jquery',
|
| 828 |
'media-upload',
|
| 831 |
|
| 832 |
wp_enqueue_script( 'modula' );
|
| 833 |
|
| 834 |
+
wp_register_style( 'materialdesign-icons', plugins_url( 'admin/css/materialdesignicons.css', __FILE__ ) );
|
| 835 |
wp_enqueue_style( 'materialdesign-icons' );
|
| 836 |
|
| 837 |
wp_enqueue_style( 'thickbox' );
|
| 851 |
$overview = add_menu_page( esc_html__( 'Manage Galleries', 'modula-gallery' ), esc_html__( 'Modula', 'modula-gallery' ), 'edit_posts', 'modula-lite-admin', array(
|
| 852 |
$this,
|
| 853 |
'add_overview',
|
| 854 |
+
), plugins_url( 'admin/icon.png', __FILE__ ) );
|
| 855 |
|
| 856 |
|
| 857 |
if ( ! get_option( "Modula_skip_fix" ) && get_option( "Modula_db_version" ) && count( $this->ModulaDB->getGalleries() ) > 0 ) {
|
| 929 |
public function delete_image() {
|
| 930 |
if ( check_admin_referer( 'Modula', 'Modula' ) ) {
|
| 931 |
foreach ( explode( ",", $_POST["id"] ) as $id ) {
|
| 932 |
+
$this->ModulaDB->deleteImage( absint( $id ) );
|
| 933 |
}
|
| 934 |
}
|
| 935 |
die();
|
| 977 |
if ( check_admin_referer( 'Modula', 'Modula' ) ) {
|
| 978 |
$result = false;
|
| 979 |
// $type = $_POST['type'];
|
| 980 |
+
|
| 981 |
+
$target_values = array( '', '_self', '_blank' );
|
| 982 |
+
$halign_values = array( 'left', 'right', 'center' );
|
| 983 |
+
$valign_values = array( 'top', 'bottom', 'middle' );
|
| 984 |
+
|
| 985 |
$imageUrl = esc_url( $_POST['img_url'] );
|
| 986 |
$imageCaption = stripslashes( $_POST['description'] );
|
| 987 |
$title = stripslashes( $_POST['title'] );
|
| 988 |
+
if ( in_array( $_POST['target'], $target_values ) ) {
|
| 989 |
+
$target = sanitize_text_field($_POST['target']);
|
| 990 |
+
}else{
|
| 991 |
+
$target = '';
|
| 992 |
+
}
|
| 993 |
+
|
| 994 |
+
$link = isset( $_POST['link'] ) ? esc_url_raw( $_POST['link'] ) : null;
|
| 995 |
$imageId = intval( $_POST['img_id'] );
|
| 996 |
$sortOrder = intval( $_POST['sortOrder'] );
|
| 997 |
+
|
| 998 |
+
if ( in_array( $_POST['halign'], $halign_values ) ) {
|
| 999 |
+
$halign = sanitize_text_field($_POST['halign']);
|
| 1000 |
+
}else{
|
| 1001 |
+
$halign = 'center';
|
| 1002 |
+
}
|
| 1003 |
+
|
| 1004 |
+
if ( in_array( $_POST['valign'], $valign_values ) ) {
|
| 1005 |
+
$valign = sanitize_text_field($_POST['valign']);
|
| 1006 |
+
}else{
|
| 1007 |
+
$valign = 'middle';
|
| 1008 |
+
}
|
| 1009 |
|
| 1010 |
$data = array(
|
| 1011 |
"target" => $target,
|
| 1154 |
$id = $this->ModulaDB->getNewGalleryId();
|
| 1155 |
}
|
| 1156 |
|
| 1157 |
+
|
| 1158 |
if ( $result ) {
|
| 1159 |
print "{\"success\":true,\"id\":" . $id . "}";
|
| 1160 |
} else {
|
| 1166 |
|
| 1167 |
public function edit_gallery() {
|
| 1168 |
if ( isset( $_GET['galleryId'] ) ) {
|
| 1169 |
+
$this->loadedData = $this->ModulaDB->getGalleryById( absint( $_GET['galleryId'] ), $this->defaultValues );
|
| 1170 |
$modula_fields = $this->fields;
|
| 1171 |
$modula_parent_page = "dashboard";
|
| 1172 |
|
README.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: machothemes, silkalns
|
|
| 3 |
Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, wordpress portfolio plugin, masonry gallery, fancy gallery, media gallery, mosaic gallery, polaroid gallery, portfolio gallery
|
| 4 |
Requires at least: 3.8
|
| 5 |
Tested up to: 4.9
|
| 6 |
-
Stable tag: 1.3.
|
| 7 |
License: GPLv3 or later
|
| 8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
| 9 |
|
|
@@ -173,6 +173,9 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo
|
|
| 173 |
|
| 174 |
== Changelog ==
|
| 175 |
|
|
|
|
|
|
|
|
|
|
| 176 |
= 1.3.3 =
|
| 177 |
* Added notification for Modula 2.0
|
| 178 |
* Added Compatibility with AO
|
| 3 |
Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, wordpress portfolio plugin, masonry gallery, fancy gallery, media gallery, mosaic gallery, polaroid gallery, portfolio gallery
|
| 4 |
Requires at least: 3.8
|
| 5 |
Tested up to: 4.9
|
| 6 |
+
Stable tag: 1.3.4
|
| 7 |
License: GPLv3 or later
|
| 8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
| 9 |
|
| 173 |
|
| 174 |
== Changelog ==
|
| 175 |
|
| 176 |
+
= 1.3.4 =
|
| 177 |
+
* wp.org review
|
| 178 |
+
|
| 179 |
= 1.3.3 =
|
| 180 |
* Added notification for Modula 2.0
|
| 181 |
* Added Compatibility with AO
|
admin/edit-gallery.php
CHANGED
|
@@ -164,7 +164,7 @@ include( "header.php" );
|
|
| 164 |
<!-- show preview -->
|
| 165 |
|
| 166 |
<div class="item effect-pufrobo">
|
| 167 |
-
<img src="<?php
|
| 168 |
<div class="figc">
|
| 169 |
<div class="figc-inner">
|
| 170 |
|
| 164 |
<!-- show preview -->
|
| 165 |
|
| 166 |
<div class="item effect-pufrobo">
|
| 167 |
+
<img src="<?php echo plugins_url( 'admin/images/effect.jpg', dirname(__FILE__) ) ?>" class="pic">
|
| 168 |
<div class="figc">
|
| 169 |
<div class="figc-inner">
|
| 170 |
|
admin/include/image-list.php
CHANGED
|
@@ -4,27 +4,27 @@
|
|
| 4 |
$sizes = ModulaLiteTools::get_image_size_links($image->imageId);
|
| 5 |
$thumb = array_key_exists("150x150", $sizes) ? $sizes["150x150"] : $image->imagePath;
|
| 6 |
?>
|
| 7 |
-
<div class='item card' data-image-id="<?php
|
| 8 |
-
<input type="hidden" name="filter-list" value="<?php
|
| 9 |
-
<div class="figure card-image" style="background-image: url('<?php
|
| 10 |
<img class="thumb" src="<?php echo plugins_url('../images/square.gif', __FILE__) ?>" />
|
| 11 |
|
| 12 |
<?php
|
| 13 |
if(!empty($image->filters))
|
| 14 |
{
|
| 15 |
-
|
| 16 |
|
| 17 |
foreach(explode('|', $image->filters) as $f)
|
| 18 |
{
|
| 19 |
if(in_array($f, $active_filters))
|
| 20 |
{
|
| 21 |
-
|
| 22 |
}
|
| 23 |
}
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
}
|
| 30 |
|
|
@@ -34,24 +34,24 @@
|
|
| 34 |
</div>
|
| 35 |
<div class="card-content">
|
| 36 |
<p class="truncate">
|
| 37 |
-
<?php
|
| 38 |
</p>
|
| 39 |
<div class="data">
|
| 40 |
-
<input class="copy" type="hidden" name="id" value="<?php
|
| 41 |
-
<input class="copy" type="hidden" name="img_id" value="<?php
|
| 42 |
-
<input class="copy" type="hidden" name="sortOrder" value="<?php
|
| 43 |
-
<input class="copy" type="hidden" name="filters" value="<?php
|
| 44 |
<select name="img_url" class="select">
|
| 45 |
<?php foreach($sizes as $k => $v) : ?>
|
| 46 |
-
<option <?php
|
| 47 |
<?php endforeach ?>
|
| 48 |
</select>
|
| 49 |
-
<input type="hidden" name="link" value="<?php
|
| 50 |
-
<input type="hidden" name="target" value="<?php
|
| 51 |
-
<input type="hidden" name="valign" value="<?php
|
| 52 |
-
<input type="hidden" name="halign" value="<?php
|
| 53 |
-
<input type="hidden" name="sortOrder" value="<?php
|
| 54 |
-
<pre><?php
|
| 55 |
<input id="img-title" value="<?php echo htmlentities($image->title) ?>">
|
| 56 |
</div>
|
| 57 |
</div>
|
| 4 |
$sizes = ModulaLiteTools::get_image_size_links($image->imageId);
|
| 5 |
$thumb = array_key_exists("150x150", $sizes) ? $sizes["150x150"] : $image->imagePath;
|
| 6 |
?>
|
| 7 |
+
<div class='item card' data-image-id="<?php echo absint($image->imageId) ?>" data-id="<?php echo absint($image->Id) ?>">
|
| 8 |
+
<input type="hidden" name="filter-list" value="<?php echo absint($image->imageId) ?>">
|
| 9 |
+
<div class="figure card-image" style="background-image: url('<?php echo esc_url($thumb) ?>');">
|
| 10 |
<img class="thumb" src="<?php echo plugins_url('../images/square.gif', __FILE__) ?>" />
|
| 11 |
|
| 12 |
<?php
|
| 13 |
if(!empty($image->filters))
|
| 14 |
{
|
| 15 |
+
echo "<ul class='filters'>";
|
| 16 |
|
| 17 |
foreach(explode('|', $image->filters) as $f)
|
| 18 |
{
|
| 19 |
if(in_array($f, $active_filters))
|
| 20 |
{
|
| 21 |
+
echo '<li>' . esc_html( $f ) . '</li>';
|
| 22 |
}
|
| 23 |
}
|
| 24 |
|
| 25 |
+
echo "</ul>";
|
| 26 |
|
| 27 |
+
echo '<input type="hidden" class ="current_image_filter" value=' . esc_attr($image->filters) . '>';
|
| 28 |
|
| 29 |
}
|
| 30 |
|
| 34 |
</div>
|
| 35 |
<div class="card-content">
|
| 36 |
<p class="truncate">
|
| 37 |
+
<?php echo (isset($image->title) && !empty($image->title)) ? esc_html($image->title) : esc_html($image->description) ?>
|
| 38 |
</p>
|
| 39 |
<div class="data">
|
| 40 |
+
<input class="copy" type="hidden" name="id" value="<?php echo absint($image->Id); ?>" />
|
| 41 |
+
<input class="copy" type="hidden" name="img_id" value="<?php echo absint($image->imageId); ?>" />
|
| 42 |
+
<input class="copy" type="hidden" name="sortOrder" value="<?php echo absint($image->sortOrder); ?>" />
|
| 43 |
+
<input class="copy" type="hidden" name="filters" value="<?php echo esc_attr($image->filters); ?>" />
|
| 44 |
<select name="img_url" class="select">
|
| 45 |
<?php foreach($sizes as $k => $v) : ?>
|
| 46 |
+
<option <?php echo $v == $image->imagePath ? "selected" : "" ?> value="<?php echo esc_attr($v) ?>"><?php echo esc_html($k) ?></option>
|
| 47 |
<?php endforeach ?>
|
| 48 |
</select>
|
| 49 |
+
<input type="hidden" name="link" value="<?php echo esc_attr($image->link) ?>" />
|
| 50 |
+
<input type="hidden" name="target" value="<?php echo esc_attr($image->target) ?>" />
|
| 51 |
+
<input type="hidden" name="valign" value="<?php echo esc_attr($image->valign) ?>" />
|
| 52 |
+
<input type="hidden" name="halign" value="<?php echo esc_attr($image->halign) ?>" />
|
| 53 |
+
<input type="hidden" name="sortOrder" value="<?php echo absint($image->sortOrder) ?>" />
|
| 54 |
+
<pre><?php echo wp_kses_post($image->description) ?></pre>
|
| 55 |
<input id="img-title" value="<?php echo htmlentities($image->title) ?>">
|
| 56 |
</div>
|
| 57 |
</div>
|
admin/include/tinymce-galleries.php
CHANGED
|
@@ -7,9 +7,9 @@
|
|
| 7 |
<script>
|
| 8 |
var wpColorPickerL10n = {"clear":"Clear","defaultString":"Default","pick":"Select Color","current":"Current Color"};
|
| 9 |
</script>
|
| 10 |
-
<script type="text/javascript" src="<?php
|
| 11 |
-
<link rel="stylesheet" href="<?php
|
| 12 |
-
<link rel="stylesheet" href="<?php
|
| 13 |
<script language="javascript" type="text/javascript" src="<?php echo includes_url( 'js/tinymce/tiny_mce_popup.js' ).'?ver='.$wp_version; ?>"></script>
|
| 14 |
<style type="text/css">
|
| 15 |
h1
|
|
@@ -63,10 +63,10 @@
|
|
| 63 |
<?php $gid = $gallery->Id; $gallery = json_decode($gallery->configuration); ?>
|
| 64 |
<tr>
|
| 65 |
<td>
|
| 66 |
-
<?php
|
| 67 |
</td>
|
| 68 |
<td>
|
| 69 |
-
<label id="<?php
|
| 70 |
</td>
|
| 71 |
</tr>
|
| 72 |
<?php endforeach ?>
|
| 7 |
<script>
|
| 8 |
var wpColorPickerL10n = {"clear":"Clear","defaultString":"Default","pick":"Select Color","current":"Current Color"};
|
| 9 |
</script>
|
| 10 |
+
<script type="text/javascript" src="<?php echo $admin_url ?>/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-draggable,jquery-ui-slider,jquery-tou&load%5B%5D=ch-punch,iris,wp-color-picker"></script>
|
| 11 |
+
<link rel="stylesheet" href="<?php echo admin_url( 'load-styles.php?c=1&dir=ltr&load=buttons,wp-admin,iris,wp-color-picker'); ?>" type="text/css" media="all">
|
| 12 |
+
<link rel="stylesheet" href="<?php echo $css_path ?>">
|
| 13 |
<script language="javascript" type="text/javascript" src="<?php echo includes_url( 'js/tinymce/tiny_mce_popup.js' ).'?ver='.$wp_version; ?>"></script>
|
| 14 |
<style type="text/css">
|
| 15 |
h1
|
| 63 |
<?php $gid = $gallery->Id; $gallery = json_decode($gallery->configuration); ?>
|
| 64 |
<tr>
|
| 65 |
<td>
|
| 66 |
+
<?php echo absint($gid) ?>
|
| 67 |
</td>
|
| 68 |
<td>
|
| 69 |
+
<label id="<?php echo 'gall_' . absint($gid) ?>"> <?php echo esc_html($gallery->name) ?> </label>
|
| 70 |
</td>
|
| 71 |
</tr>
|
| 72 |
<?php endforeach ?>
|
admin/welcome-screen/sections/comparison-table.php
CHANGED
|
@@ -8,47 +8,47 @@ if ( ! defined( 'WPINC' ) ) {
|
|
| 8 |
|
| 9 |
$features = array(
|
| 10 |
'post-formats' => array(
|
| 11 |
-
'label' =>
|
| 12 |
'modula' => '20',
|
| 13 |
-
'modula-pro' =>
|
| 14 |
),
|
| 15 |
'slider-layouts' => array(
|
| 16 |
-
'label' =>
|
| 17 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 18 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 19 |
),
|
| 20 |
'news-ticker' => array(
|
| 21 |
-
'label' =>
|
| 22 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 23 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 24 |
),
|
| 25 |
'banner-ads' => array(
|
| 26 |
-
'label' =>
|
| 27 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 28 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 29 |
),
|
| 30 |
'video-widgets' => array(
|
| 31 |
-
'label' =>
|
| 32 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 33 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 34 |
),
|
| 35 |
'color-schemes' => array(
|
| 36 |
-
'label' =>
|
| 37 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 38 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 39 |
),
|
| 40 |
'typography' => array(
|
| 41 |
-
'label' =>
|
| 42 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 43 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 44 |
),
|
| 45 |
'updates' => array(
|
| 46 |
-
'label' =>
|
| 47 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 48 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 49 |
),
|
| 50 |
'suppoprt' => array(
|
| 51 |
-
'label' =>
|
| 52 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 53 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 54 |
),
|
|
@@ -68,14 +68,14 @@ $features = array(
|
|
| 68 |
<tr>
|
| 69 |
<td class="feature">
|
| 70 |
<h3>
|
| 71 |
-
<?php echo $feature['label']; ?>
|
| 72 |
</h3>
|
| 73 |
</td>
|
| 74 |
<td class="modula-feature">
|
| 75 |
-
<?php echo $feature['modula']; ?>
|
| 76 |
</td>
|
| 77 |
<td class="modula-pro-feature">
|
| 78 |
-
<?php echo $feature['modula-pro']; ?>
|
| 79 |
</td>
|
| 80 |
</tr>
|
| 81 |
<?php endforeach; ?>
|
| 8 |
|
| 9 |
$features = array(
|
| 10 |
'post-formats' => array(
|
| 11 |
+
'label' => esc_html__( 'Images per gallery', 'modula-gallery' ),
|
| 12 |
'modula' => '20',
|
| 13 |
+
'modula-pro' => esc_html__( 'Unlimited', 'modula-gallery' ),
|
| 14 |
),
|
| 15 |
'slider-layouts' => array(
|
| 16 |
+
'label' => esc_html__( 'Filters', 'modula-gallery' ),
|
| 17 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 18 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 19 |
),
|
| 20 |
'news-ticker' => array(
|
| 21 |
+
'label' => esc_html__( 'Reload page on filter click', 'modula-gallery' ),
|
| 22 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 23 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 24 |
),
|
| 25 |
'banner-ads' => array(
|
| 26 |
+
'label' => esc_html__( 'Change Filter Text', 'modula-gallery' ),
|
| 27 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 28 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 29 |
),
|
| 30 |
'video-widgets' => array(
|
| 31 |
+
'label' => esc_html__( 'Multiple Included LightBox Scripts', 'modula-gallery' ),
|
| 32 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 33 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 34 |
),
|
| 35 |
'color-schemes' => array(
|
| 36 |
+
'label' => esc_html__( 'Image Loaded Effects', 'modula-gallery' ),
|
| 37 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 38 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 39 |
),
|
| 40 |
'typography' => array(
|
| 41 |
+
'label' => esc_html__( 'Image Hoever Effects', 'modula-gallery' ),
|
| 42 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 43 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 44 |
),
|
| 45 |
'updates' => array(
|
| 46 |
+
'label' => esc_html__( 'Feature & Security Updates', 'modula-gallery' ),
|
| 47 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 48 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 49 |
),
|
| 50 |
'suppoprt' => array(
|
| 51 |
+
'label' => esc_html__( 'Priority Support', 'modula-gallery' ),
|
| 52 |
'modula' => '<span class="dashicons dashicons-no-alt"></span>',
|
| 53 |
'modula-pro' => '<span class="dashicons dashicons-yes"></span>',
|
| 54 |
),
|
| 68 |
<tr>
|
| 69 |
<td class="feature">
|
| 70 |
<h3>
|
| 71 |
+
<?php echo esc_html($feature['label']); ?>
|
| 72 |
</h3>
|
| 73 |
</td>
|
| 74 |
<td class="modula-feature">
|
| 75 |
+
<?php echo wp_kses_post($feature['modula']); ?>
|
| 76 |
</td>
|
| 77 |
<td class="modula-pro-feature">
|
| 78 |
+
<?php echo wp_kses_post($feature['modula-pro']); ?>
|
| 79 |
</td>
|
| 80 |
</tr>
|
| 81 |
<?php endforeach; ?>
|
admin/welcome-screen/sections/getting-started.php
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
<div class="feature-section one-col">
|
| 2 |
<div class="col">
|
| 3 |
-
<h2 style="font-size: 2.5em;"><?php echo
|
| 4 |
-
<p class="lead-description"><?php echo __( 'Modula helps <u>casual users</u> create an image gallery in 30s or less.', 'modula-gallery' ); ?></p>
|
| 5 |
-
<p><?php echo
|
| 6 |
<div class="center">
|
| 7 |
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
| 8 |
-
<?php echo
|
| 9 |
</a>
|
| 10 |
</div>
|
| 11 |
</div>
|
|
@@ -17,38 +17,38 @@
|
|
| 17 |
|
| 18 |
<div class="feature-section three-col">
|
| 19 |
<div class="col">
|
| 20 |
-
<h3><?php echo
|
| 21 |
-
<p><?php echo
|
| 22 |
</div>
|
| 23 |
|
| 24 |
<div class="col">
|
| 25 |
-
<h3><?php echo
|
| 26 |
-
<p><?php echo __( 'Let visitors filter your gallery items with a single click. Create as many gallery filters as you want. These filters also <u>work in real-time</u> ⭐', 'modula-gallery' ); ?></p>
|
| 27 |
</div>
|
| 28 |
<div class="col">
|
| 29 |
-
<h3><?php echo
|
| 30 |
-
<p><?php echo
|
| 31 |
</div>
|
| 32 |
|
| 33 |
<div class="col">
|
| 34 |
-
<h3><?php echo
|
| 35 |
-
<p><?php echo
|
| 36 |
</div>
|
| 37 |
|
| 38 |
<div class="col">
|
| 39 |
-
<h3><?php echo
|
| 40 |
-
<p><?php echo __( 'Every gallery created with Modula is responsive, mobile ready & retina ready. <b>Your galleries will look beautiful on any device</b>, and any display.', 'modula-gallery' ); ?></p>
|
| 41 |
</div>
|
| 42 |
|
| 43 |
<div class="col">
|
| 44 |
-
<h3><?php echo
|
| 45 |
-
<p><?php echo
|
| 46 |
</div>
|
| 47 |
</div>
|
| 48 |
|
| 49 |
<div class="center">
|
| 50 |
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
| 51 |
-
<?php echo
|
| 52 |
</div>
|
| 53 |
|
| 54 |
<br/>
|
|
@@ -57,33 +57,33 @@
|
|
| 57 |
<div class="feature-section three-col">
|
| 58 |
|
| 59 |
<div class="col">
|
| 60 |
-
<h3><?php echo
|
| 61 |
-
<p><?php echo __( 'Modula <b>supports 6 different lightbox scripts</b>: <em>Lightgallery, Lightbox2, PrettyPhoto, Magnific Gallery, SwipeBox and FancyBox</em>. Showcase your image galleries with style.', 'modula-gallery' ); ?></p>
|
| 62 |
</div>
|
| 63 |
|
| 64 |
<div class="col">
|
| 65 |
-
<h3><?php echo
|
| 66 |
-
<p><?php echo __( 'Built-in social sharing buttons that will help you boost your page views. <b>Reach your audience faster and easier</b> with social tools built-in.', 'modula-gallery' ); ?></p>
|
| 67 |
</div>
|
| 68 |
|
| 69 |
<div class="col">
|
| 70 |
-
<h3><?php echo
|
| 71 |
-
<p><?php echo __( 'Choose from 12 different hover effects. Pick the ones that best represent your personality. Easily <u>showcase your images in style</u>.', 'modula-gallery' ); ?></p>
|
| 72 |
</div>
|
| 73 |
|
| 74 |
<div class="col">
|
| 75 |
-
<h3><?php echo
|
| 76 |
-
<p><?php echo
|
| 77 |
</div>
|
| 78 |
|
| 79 |
<div class="col">
|
| 80 |
-
<h3><?php echo
|
| 81 |
-
<p><?php echo
|
| 82 |
</div>
|
| 83 |
|
| 84 |
<div class="col">
|
| 85 |
-
<h3><?php echo
|
| 86 |
-
<p><?php echo
|
| 87 |
</div>
|
| 88 |
|
| 89 |
</div>
|
|
@@ -92,8 +92,8 @@
|
|
| 92 |
|
| 93 |
<div class="feature-section two-col">
|
| 94 |
<div class="col">
|
| 95 |
-
<h3><?php echo
|
| 96 |
-
<p><?php echo __( 'Modula is built entirely on Material Design principles. Starting with the code layout and finishing up with the smallest animation, Modula screams Material Design from it\'s every pore. <br \/><br \/> Based on the most popular front-end design framework of the century, we\'ve striven to create a modern, flexible and beautiful implementation of Material Design in Modula. <br \/><br \/> We believe you\'ll <b>enjoy it</b>!', 'modula-gallery' ); ?></p>
|
| 97 |
</div>
|
| 98 |
<div class="col">
|
| 99 |
<img src="<?php echo esc_url( MODULA_PLUGIN_DIR_URL ); ?>admin/images/material-design.gif" alt="Material Design GIF">
|
|
@@ -107,21 +107,21 @@
|
|
| 107 |
<div class="changelog">
|
| 108 |
<h2><?php
|
| 109 |
printf( /* translators: %s: smiling face with smiling eyes emoji */
|
| 110 |
-
|
| 111 |
?></h2>
|
| 112 |
|
| 113 |
<div class="under-the-hood three-col">
|
| 114 |
<div class="col">
|
| 115 |
-
<h3><?php echo
|
| 116 |
-
<p><?php echo
|
| 117 |
</div>
|
| 118 |
<div class="col">
|
| 119 |
-
<h3><?php echo
|
| 120 |
-
<p><?php echo
|
| 121 |
</div>
|
| 122 |
<div class="col">
|
| 123 |
-
<h3><?php echo
|
| 124 |
-
<p><?php echo
|
| 125 |
</div>
|
| 126 |
|
| 127 |
</div>
|
|
@@ -129,5 +129,5 @@
|
|
| 129 |
|
| 130 |
<div class="center">
|
| 131 |
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
| 132 |
-
<?php echo
|
| 133 |
</div><br/>
|
| 1 |
<div class="feature-section one-col">
|
| 2 |
<div class="col">
|
| 3 |
+
<h2 style="font-size: 2.5em;"><?php echo esc_html__( 'Powerful, Yet Simple, Image Gallery Plugin', 'modula-gallery' ); ?></h2>
|
| 4 |
+
<p class="lead-description"><?php echo wp_kses_post(__( 'Modula helps <u>casual users</u> create an image gallery in 30s or less.', 'modula-gallery' )); ?></p>
|
| 5 |
+
<p><?php echo esc_html__( 'Modula is a WordPress photo and image gallery plugin that makes it easy for users of all levels to build beautiful grid galleries. Modula’s <u>unique grid system</u> ensures your gallery avoids the boring square look found in many other plugins. Just give Modula a size and a list of images and it does all the work for you. If you’re a casual WordPress user, you can create a stylish gallery in seconds without digging into detailed settings pages. ', 'modula-gallery' ); ?></p>
|
| 6 |
<div class="center">
|
| 7 |
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
| 8 |
+
<?php echo esc_html__( 'Get Modula Pro', 'modula-gallery' ); ?>
|
| 9 |
</a>
|
| 10 |
</div>
|
| 11 |
</div>
|
| 17 |
|
| 18 |
<div class="feature-section three-col">
|
| 19 |
<div class="col">
|
| 20 |
+
<h3><?php echo esc_html__( 'Stylish & Complex Layouts', 'modula-gallery' ); ?></h3>
|
| 21 |
+
<p><?php echo esc_html__( 'Stylish grids that go beyond the boring squares. With Modula, creating a stylish and good looking image gallery this is no longer the case. ', 'modula-gallery' ); ?></p>
|
| 22 |
</div>
|
| 23 |
|
| 24 |
<div class="col">
|
| 25 |
+
<h3><?php echo esc_html__( 'Gallery Filters', 'modula-gallery' ); ?></h3>
|
| 26 |
+
<p><?php echo wp_kses_post(__( 'Let visitors filter your gallery items with a single click. Create as many gallery filters as you want. These filters also <u>work in real-time</u> ⭐', 'modula-gallery' )); ?></p>
|
| 27 |
</div>
|
| 28 |
<div class="col">
|
| 29 |
+
<h3><?php echo esc_html__( 'Multiple Gallery Support', 'modula-gallery' ); ?></h3>
|
| 30 |
+
<p><?php echo esc_html__( 'Modula allows you to add as many galleries as you want to the same page. Modula is very versatile & flexible. You should take it our for a spin. ', 'modula-gallery' ); ?></p>
|
| 31 |
</div>
|
| 32 |
|
| 33 |
<div class="col">
|
| 34 |
+
<h3><?php echo esc_html__( 'Widget Support', 'modula-gallery' ); ?></h3>
|
| 35 |
+
<p><?php echo esc_html__( 'Display your galleries inside WordPress widgets. This makes Modula really powerful. Display your image galleries where your heart desires.', 'modula-gallery' ); ?></p>
|
| 36 |
</div>
|
| 37 |
|
| 38 |
<div class="col">
|
| 39 |
+
<h3><?php echo esc_html__( 'Responsive & Retina-ready', 'modula-gallery' ); ?></h3>
|
| 40 |
+
<p><?php echo wp_kses_post( __( 'Every gallery created with Modula is responsive, mobile ready & retina ready. <b>Your galleries will look beautiful on any device</b>, and any display.', 'modula-gallery' ) ); ?></p>
|
| 41 |
</div>
|
| 42 |
|
| 43 |
<div class="col">
|
| 44 |
+
<h3><?php echo esc_html__( 'Custom Caption Support', 'modula-gallery' ); ?></h3>
|
| 45 |
+
<p><?php echo esc_html__( 'This feature deserves a parade down the center of town! Spruce up your image galleries with custom captions, animations & colors.', 'modula-gallery' ); ?></p>
|
| 46 |
</div>
|
| 47 |
</div>
|
| 48 |
|
| 49 |
<div class="center">
|
| 50 |
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
| 51 |
+
<?php echo esc_html__( 'Get Modula Pro!', 'modula-gallery' ); ?></a>
|
| 52 |
</div>
|
| 53 |
|
| 54 |
<br/>
|
| 57 |
<div class="feature-section three-col">
|
| 58 |
|
| 59 |
<div class="col">
|
| 60 |
+
<h3><?php echo esc_html__( 'Multiple LightBox Support', 'modula-gallery' ); ?></h3>
|
| 61 |
+
<p><?php echo wp_kses_post(__( 'Modula <b>supports 6 different lightbox scripts</b>: <em>Lightgallery, Lightbox2, PrettyPhoto, Magnific Gallery, SwipeBox and FancyBox</em>. Showcase your image galleries with style.', 'modula-gallery' )); ?></p>
|
| 62 |
</div>
|
| 63 |
|
| 64 |
<div class="col">
|
| 65 |
+
<h3><?php echo esc_html__( 'Social Sharing Friendly', 'modula-gallery' ); ?></h3>
|
| 66 |
+
<p><?php echo wp_kses_post(__( 'Built-in social sharing buttons that will help you boost your page views. <b>Reach your audience faster and easier</b> with social tools built-in.', 'modula-gallery' )); ?></p>
|
| 67 |
</div>
|
| 68 |
|
| 69 |
<div class="col">
|
| 70 |
+
<h3><?php echo esc_html__( 'Multiple Image Hover Effects', 'modula-gallery' ); ?></h3>
|
| 71 |
+
<p><?php echo wp_kses_post(__( 'Choose from 12 different hover effects. Pick the ones that best represent your personality. Easily <u>showcase your images in style</u>.', 'modula-gallery' )); ?></p>
|
| 72 |
</div>
|
| 73 |
|
| 74 |
<div class="col">
|
| 75 |
+
<h3><?php echo esc_html__( 'Make It Your Own', 'modula-gallery' ); ?></h3>
|
| 76 |
+
<p><?php echo esc_html__( 'Build your own effects for even more control. Complex, built-in, styles will help you personalize Modula to your own liking.', 'modula-gallery' ); ?></p>
|
| 77 |
</div>
|
| 78 |
|
| 79 |
<div class="col">
|
| 80 |
+
<h3><?php echo esc_html__( 'Security Updates', 'modula-gallery' ); ?></h3>
|
| 81 |
+
<p><?php echo esc_html__( 'Modula is constantly evolving. New features & security updates are first released for PRO users.', 'modula-gallery' ); ?></p>
|
| 82 |
</div>
|
| 83 |
|
| 84 |
<div class="col">
|
| 85 |
+
<h3><?php echo esc_html__( 'Premium & Priority Support', 'modula-gallery' ); ?></h3>
|
| 86 |
+
<p><?php echo esc_html__( 'If you need help just post a ticket and our tech guys will get back to you asap. We have a stellar support team ready to help you in no time.', 'modula-gallery' ); ?></p>
|
| 87 |
</div>
|
| 88 |
|
| 89 |
</div>
|
| 92 |
|
| 93 |
<div class="feature-section two-col">
|
| 94 |
<div class="col">
|
| 95 |
+
<h3><?php echo esc_html__( 'Built on Material Design', 'modula-gallery' ); ?></h3>
|
| 96 |
+
<p><?php echo wp_kses_post(__( 'Modula is built entirely on Material Design principles. Starting with the code layout and finishing up with the smallest animation, Modula screams Material Design from it\'s every pore. <br \/><br \/> Based on the most popular front-end design framework of the century, we\'ve striven to create a modern, flexible and beautiful implementation of Material Design in Modula. <br \/><br \/> We believe you\'ll <b>enjoy it</b>!', 'modula-gallery' )); ?></p>
|
| 97 |
</div>
|
| 98 |
<div class="col">
|
| 99 |
<img src="<?php echo esc_url( MODULA_PLUGIN_DIR_URL ); ?>admin/images/material-design.gif" alt="Material Design GIF">
|
| 107 |
<div class="changelog">
|
| 108 |
<h2><?php
|
| 109 |
printf( /* translators: %s: smiling face with smiling eyes emoji */
|
| 110 |
+
esc_html__( 'Even More Plugin Flexibility %s', 'modula-gallery' ), '😊' );
|
| 111 |
?></h2>
|
| 112 |
|
| 113 |
<div class="under-the-hood three-col">
|
| 114 |
<div class="col">
|
| 115 |
+
<h3><?php echo esc_html__( 'Drag & Drop Images', 'modula-gallery' ); ?></h3>
|
| 116 |
+
<p><?php echo esc_html__( 'Re-ordering couldn\'t be easier. Just drag & drop your images around until you find the perfect positioning. Be done in 30s or less.', 'modula-gallery' ); ?></p>
|
| 117 |
</div>
|
| 118 |
<div class="col">
|
| 119 |
+
<h3><?php echo esc_html__( 'Custom Scripts & CSS Support', 'modula-gallery' ); ?></h3></h3>
|
| 120 |
+
<p><?php echo esc_html__( 'Modula comes with built-in custom CSS support. Want to style one of your galleries in a particular way? Add some CSS. Want to include a custom tracking script in just one of your galleries? Add away. Simplicity, at it\'s best.', 'modula-gallery' ); ?></p>
|
| 121 |
</div>
|
| 122 |
<div class="col">
|
| 123 |
+
<h3><?php echo esc_html__( 'Developer Friendly' ); ?></h3>
|
| 124 |
+
<p><?php echo esc_html__( 'Modula\'s been built with both the user & the developer in mind. Friendly code, well documented so you can easily add your changes. Filters & Hooks, included with every purchase.', 'modula-gallery' ); ?></p>
|
| 125 |
</div>
|
| 126 |
|
| 127 |
</div>
|
| 129 |
|
| 130 |
<div class="center">
|
| 131 |
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
| 132 |
+
<?php echo esc_html__( 'Get Modula Pro!', 'modula-gallery' ); ?></a>
|
| 133 |
</div><br/>
|
admin/welcome-screen/sections/modula-v2.php
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
<div class="feature-section one-col">
|
| 2 |
<div class="col">
|
| 3 |
-
<h2 style="font-size: 2.5em;"><?php echo
|
| 4 |
-
<p class="lead-description"><?php echo
|
| 5 |
<div class="center">
|
| 6 |
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
| 7 |
-
<?php echo
|
| 8 |
</a>
|
| 9 |
</div>
|
| 10 |
</div>
|
| 1 |
<div class="feature-section one-col">
|
| 2 |
<div class="col">
|
| 3 |
+
<h2 style="font-size: 2.5em;"><?php echo esc_html__( 'New Admin Interface, Custom Grid!', 'modula-gallery' ); ?></h2>
|
| 4 |
+
<p class="lead-description"><?php echo esc_html__( 'Modula 2.0 bring new things like a new admin interface & a new type of gallery.', 'modula-gallery' ); ?></p>
|
| 5 |
<div class="center">
|
| 6 |
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
| 7 |
+
<?php echo esc_html__( 'Get Modula Pro', 'modula-gallery' ); ?>
|
| 8 |
</a>
|
| 9 |
</div>
|
| 10 |
</div>
|
lib/class-epsilon-plugin-request.php
DELETED
|
@@ -1,225 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Epsilon_Plugin_Request {
|
| 4 |
-
|
| 5 |
-
/**
|
| 6 |
-
* Url for the request
|
| 7 |
-
*
|
| 8 |
-
* @var string
|
| 9 |
-
*/
|
| 10 |
-
private $url = 'https://tamewp.com/';
|
| 11 |
-
/**
|
| 12 |
-
* Api endpoint
|
| 13 |
-
*
|
| 14 |
-
* @var string
|
| 15 |
-
*/
|
| 16 |
-
private $endpoint = 'wp-json/epsilon/v1/add-tracking-data';
|
| 17 |
-
/**
|
| 18 |
-
* Private data
|
| 19 |
-
*
|
| 20 |
-
* @var array
|
| 21 |
-
*/
|
| 22 |
-
private $data = array(
|
| 23 |
-
'server' => array(),
|
| 24 |
-
'user' => array(),
|
| 25 |
-
'wordpress' => array(
|
| 26 |
-
'deactivated_plugin' => array(),
|
| 27 |
-
),
|
| 28 |
-
);
|
| 29 |
-
/**
|
| 30 |
-
* Plugin file
|
| 31 |
-
*
|
| 32 |
-
* @var string
|
| 33 |
-
*/
|
| 34 |
-
private $plugin_file = '';
|
| 35 |
-
|
| 36 |
-
private $allow_tracking = 0;
|
| 37 |
-
|
| 38 |
-
public $request_successful = false;
|
| 39 |
-
|
| 40 |
-
function __construct( $_plugin_file, $args ) {
|
| 41 |
-
|
| 42 |
-
// Set variables
|
| 43 |
-
$this->allow_tracking = $args['tracking'];
|
| 44 |
-
$this->plugin_file = $_plugin_file;
|
| 45 |
-
$this->data['unique'] = md5( home_url() . get_bloginfo( 'admin_email' ) );
|
| 46 |
-
$this->data['wordpress']['deactivated_plugin']['uninstall_reason'] = $args['reason'];
|
| 47 |
-
$this->data['wordpress']['deactivated_plugin']['uninstall_details'] = $args['details'];
|
| 48 |
-
|
| 49 |
-
// Start collecting data
|
| 50 |
-
$this->_collect_data();
|
| 51 |
-
$this->_generate_url();
|
| 52 |
-
$this->request_successful = $this->_send_request();
|
| 53 |
-
}
|
| 54 |
-
|
| 55 |
-
/**
|
| 56 |
-
* Collect all data for the request.
|
| 57 |
-
*
|
| 58 |
-
*/
|
| 59 |
-
private function _collect_data() {
|
| 60 |
-
|
| 61 |
-
$current_plugin = get_plugin_data( $this->plugin_file );
|
| 62 |
-
|
| 63 |
-
// Plugin data
|
| 64 |
-
$this->data['wordpress']['deactivated_plugin']['slug'] = $current_plugin['TextDomain'];
|
| 65 |
-
$this->data['wordpress']['deactivated_plugin']['name'] = $current_plugin['Name'];
|
| 66 |
-
$this->data['wordpress']['deactivated_plugin']['version'] = $current_plugin['Version'];
|
| 67 |
-
$this->data['wordpress']['deactivated_plugin']['author'] = $current_plugin['AuthorName'];
|
| 68 |
-
|
| 69 |
-
if ( $this->allow_tracking ) {
|
| 70 |
-
$this->_collect_wordpress_data();
|
| 71 |
-
$this->_collect_server_data();
|
| 72 |
-
$this->_collect_user_data();
|
| 73 |
-
}
|
| 74 |
-
|
| 75 |
-
}
|
| 76 |
-
|
| 77 |
-
/**
|
| 78 |
-
* Collect WordPress data.
|
| 79 |
-
*
|
| 80 |
-
*/
|
| 81 |
-
private function _collect_wordpress_data() {
|
| 82 |
-
$this->data['wordpress']['locale'] = ( get_bloginfo( 'version' ) >= 4.7 ) ? get_user_locale() : get_locale();
|
| 83 |
-
$this->data['wordpress']['wp_version'] = get_bloginfo( 'version' );
|
| 84 |
-
$this->data['wordpress']['multisite'] = is_multisite();
|
| 85 |
-
|
| 86 |
-
$this->data['wordpress']['themes'] = $this->get_themes();
|
| 87 |
-
$this->data['wordpress']['plugins'] = $this->get_plugins();
|
| 88 |
-
}
|
| 89 |
-
|
| 90 |
-
/**
|
| 91 |
-
* Collect server data.
|
| 92 |
-
*
|
| 93 |
-
*/
|
| 94 |
-
private function _collect_server_data() {
|
| 95 |
-
$this->data['server']['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '';
|
| 96 |
-
$this->data['server']['php_version'] = phpversion();
|
| 97 |
-
$this->data['server']['url'] = home_url();
|
| 98 |
-
}
|
| 99 |
-
|
| 100 |
-
/**
|
| 101 |
-
* Collect user data.
|
| 102 |
-
*
|
| 103 |
-
*/
|
| 104 |
-
private function _collect_user_data() {
|
| 105 |
-
$admin = get_user_by( 'email', get_bloginfo( 'admin_email' ) );
|
| 106 |
-
if ( ! $admin ) {
|
| 107 |
-
$this->data['user']['email'] = '';
|
| 108 |
-
$this->data['user']['first_name'] = '';
|
| 109 |
-
$this->data['user']['last_name'] = '';
|
| 110 |
-
}else{
|
| 111 |
-
$this->data['user']['email'] = get_bloginfo( 'admin_email' );
|
| 112 |
-
$this->data['user']['first_name'] = $admin->first_name;
|
| 113 |
-
$this->data['user']['last_name'] = $admin->last_name;
|
| 114 |
-
}
|
| 115 |
-
}
|
| 116 |
-
|
| 117 |
-
/**
|
| 118 |
-
* Get current themes
|
| 119 |
-
*
|
| 120 |
-
* @return array
|
| 121 |
-
*/
|
| 122 |
-
private function get_themes() {
|
| 123 |
-
$theme = wp_get_theme();
|
| 124 |
-
|
| 125 |
-
return array(
|
| 126 |
-
'installed' => $this->_get_installed_themes(),
|
| 127 |
-
'active' => array(
|
| 128 |
-
'slug' => get_stylesheet(),
|
| 129 |
-
'name' => $theme->get( 'Name' ),
|
| 130 |
-
'version' => $theme->get( 'Version' ),
|
| 131 |
-
'author' => $theme->get( 'Author' ),
|
| 132 |
-
),
|
| 133 |
-
);
|
| 134 |
-
}
|
| 135 |
-
|
| 136 |
-
/**
|
| 137 |
-
* Get an array of installed themes
|
| 138 |
-
*/
|
| 139 |
-
private function _get_installed_themes() {
|
| 140 |
-
$installed = wp_get_themes();
|
| 141 |
-
$theme = get_stylesheet();
|
| 142 |
-
$arr = array();
|
| 143 |
-
|
| 144 |
-
foreach ( $installed as $slug => $info ) {
|
| 145 |
-
if ( $slug === $theme ) {
|
| 146 |
-
continue;
|
| 147 |
-
}
|
| 148 |
-
$arr[ $slug ] = array(
|
| 149 |
-
'slug' => $slug,
|
| 150 |
-
'name' => $info->get( 'Name' ),
|
| 151 |
-
'version' => $info->get( 'Version' ),
|
| 152 |
-
'author' => $info->get( 'Author' )
|
| 153 |
-
);
|
| 154 |
-
};
|
| 155 |
-
|
| 156 |
-
return $arr;
|
| 157 |
-
}
|
| 158 |
-
|
| 159 |
-
/**
|
| 160 |
-
* Get a list of installed plugins
|
| 161 |
-
*/
|
| 162 |
-
private function get_plugins() {
|
| 163 |
-
if ( ! function_exists( 'get_plugins' ) ) {
|
| 164 |
-
include ABSPATH . '/wp-admin/includes/plugin.php';
|
| 165 |
-
}
|
| 166 |
-
|
| 167 |
-
$plugins = get_plugins();
|
| 168 |
-
$option = get_option( 'active_plugins', array() );
|
| 169 |
-
$active = array();
|
| 170 |
-
$installed = array();
|
| 171 |
-
foreach ( $plugins as $id => $info ) {
|
| 172 |
-
if ( in_array( $id, $active ) ) {
|
| 173 |
-
continue;
|
| 174 |
-
}
|
| 175 |
-
|
| 176 |
-
$id = explode( '/', $id );
|
| 177 |
-
$id = ucwords( str_replace( '-', ' ', $id[0] ) );
|
| 178 |
-
|
| 179 |
-
$installed[] = $id;
|
| 180 |
-
}
|
| 181 |
-
|
| 182 |
-
foreach ( $option as $id ) {
|
| 183 |
-
$id = explode( '/', $id );
|
| 184 |
-
$id = ucwords( str_replace( '-', ' ', $id[0] ) );
|
| 185 |
-
|
| 186 |
-
$active[] = $id;
|
| 187 |
-
}
|
| 188 |
-
|
| 189 |
-
return array(
|
| 190 |
-
'installed' => $installed,
|
| 191 |
-
'active' => $active,
|
| 192 |
-
);
|
| 193 |
-
}
|
| 194 |
-
|
| 195 |
-
/**
|
| 196 |
-
* Generate the url
|
| 197 |
-
*/
|
| 198 |
-
protected function _generate_url() {
|
| 199 |
-
$this->url = $this->url . $this->endpoint;
|
| 200 |
-
}
|
| 201 |
-
|
| 202 |
-
/**
|
| 203 |
-
* Send dat to server.
|
| 204 |
-
*
|
| 205 |
-
*/
|
| 206 |
-
private function _send_request() {
|
| 207 |
-
|
| 208 |
-
$request = wp_remote_post( $this->url, array(
|
| 209 |
-
'method' => 'POST',
|
| 210 |
-
'timeout' => 20,
|
| 211 |
-
'redirection' => 5,
|
| 212 |
-
'httpversion' => '1.1',
|
| 213 |
-
'blocking' => true,
|
| 214 |
-
'body' => $this->data,
|
| 215 |
-
'user-agent' => 'MT/EPSILON-CUSTOMER-TRACKING/' . esc_url( home_url() )
|
| 216 |
-
) );
|
| 217 |
-
|
| 218 |
-
if ( is_wp_error( $request ) ) {
|
| 219 |
-
return false;
|
| 220 |
-
}
|
| 221 |
-
|
| 222 |
-
return true;
|
| 223 |
-
|
| 224 |
-
}
|
| 225 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/class-modula-feedback.php
DELETED
|
@@ -1,252 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Modula_Feedback {
|
| 4 |
-
|
| 5 |
-
private $plugin_file = '';
|
| 6 |
-
private $plugin_name = '';
|
| 7 |
-
|
| 8 |
-
function __construct( $_plugin_file ) {
|
| 9 |
-
|
| 10 |
-
$this->plugin_file = $_plugin_file;
|
| 11 |
-
$this->plugin_name = basename( $this->plugin_file, '.php' );
|
| 12 |
-
|
| 13 |
-
// Deactivation
|
| 14 |
-
add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array( $this, 'filter_action_links' ) );
|
| 15 |
-
add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) );
|
| 16 |
-
add_action( 'wp_ajax_epsilon_deactivate_plugin', array( $this, 'epsilon_deactivate_plugin_callback' ) );
|
| 17 |
-
|
| 18 |
-
}
|
| 19 |
-
|
| 20 |
-
/**
|
| 21 |
-
* Filter the deactivation link to allow us to present a form when the user deactivates the plugin
|
| 22 |
-
* @since 1.0.0
|
| 23 |
-
*/
|
| 24 |
-
public function filter_action_links( $links ) {
|
| 25 |
-
|
| 26 |
-
if( isset( $links['deactivate'] ) ) {
|
| 27 |
-
$deactivation_link = $links['deactivate'];
|
| 28 |
-
// Insert an onClick action to allow form before deactivating
|
| 29 |
-
$deactivation_link = str_replace( '<a ', '<div class="epsilon-deactivate-form-wrapper"><span class="epsilon-deactivate-form" id="epsilon-deactivate-form-' . esc_attr( $this->plugin_name ) . '"></span></div><a onclick="javascript:event.preventDefault();" id="epsilon-deactivate-link-' . esc_attr( $this->plugin_name ) . '" ', $deactivation_link );
|
| 30 |
-
$links['deactivate'] = $deactivation_link;
|
| 31 |
-
}
|
| 32 |
-
return $links;
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
/**
|
| 36 |
-
* Form text strings
|
| 37 |
-
* These can be filtered
|
| 38 |
-
* @since 1.0.0
|
| 39 |
-
*/
|
| 40 |
-
public function goodbye_ajax() {
|
| 41 |
-
// Get our strings for the form
|
| 42 |
-
$form = $this->get_form_info();
|
| 43 |
-
|
| 44 |
-
// Build the HTML to go in the form
|
| 45 |
-
$html = '<div class="epsilon-deactivate-form-head"><strong>' . esc_html( $form['heading'] ) . '</strong></div>';
|
| 46 |
-
$html .= '<div class="epsilon-deactivate-form-body"><p>' . esc_html( $form['body'] ) . '</p>';
|
| 47 |
-
if( is_array( $form['options'] ) ) {
|
| 48 |
-
$html .= '<div class="epsilon-deactivate-options"><p>';
|
| 49 |
-
foreach( $form['options'] as $key => $option ) {
|
| 50 |
-
if ( 'features' == $key ) {
|
| 51 |
-
$html .= '<input type="radio" name="epsilon-deactivate-reason" checked="checked" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
|
| 52 |
-
}else{
|
| 53 |
-
$html .= '<input type="radio" name="epsilon-deactivate-reason" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
|
| 54 |
-
}
|
| 55 |
-
}
|
| 56 |
-
$html .= '</p><label id="epsilon-deactivate-details-label" for="epsilon-deactivate-reasons"><strong>' . esc_html( $form['details'] ) .'</strong></label><textarea name="epsilon-deactivate-details" id="epsilon-deactivate-details" rows="2" style="width:100%"></textarea>';
|
| 57 |
-
$html .= '<input type="checkbox" name="epsilon-deactivate-tracking" checked="" id="allow-tracking" value="yes"> <label for="allow-tracking">' . esc_html__( 'Allow us to get more information in order to improve our plugin', 'modula-gallery' ) . '</label><br>';
|
| 58 |
-
$html .= '</div><!-- .epsilon-deactivate-options -->';
|
| 59 |
-
}
|
| 60 |
-
$html .= '</div><!-- .epsilon-deactivate-form-body -->';
|
| 61 |
-
$html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'modula-gallery' ) . '</p>';
|
| 62 |
-
$html .= '<div class="epsilon-deactivate-form-footer"><p><a id="epsilon-deactivate-plugin" href="#">' . __( 'Just Deactivate', 'modula-gallery' ) . '</a><a id="epsilon-deactivate-submit-form" class="button button-primary" href="#">' . __( 'Submit and Deactivate', 'modula-gallery' ) . '</a></p></div>'
|
| 63 |
-
?>
|
| 64 |
-
<div class="epsilon-deactivate-form-bg"></div>
|
| 65 |
-
<style type="text/css">
|
| 66 |
-
.epsilon-deactivate-form-active .epsilon-deactivate-form-bg {
|
| 67 |
-
background: rgba( 0, 0, 0, .5 );
|
| 68 |
-
position: fixed;
|
| 69 |
-
top: 0;
|
| 70 |
-
left: 0;
|
| 71 |
-
width: 100%;
|
| 72 |
-
height: 100%;
|
| 73 |
-
}
|
| 74 |
-
.epsilon-deactivate-form-wrapper {
|
| 75 |
-
position: relative;
|
| 76 |
-
z-index: 999;
|
| 77 |
-
display: none;
|
| 78 |
-
}
|
| 79 |
-
.epsilon-deactivate-form-active .epsilon-deactivate-form-wrapper {
|
| 80 |
-
display: block;
|
| 81 |
-
}
|
| 82 |
-
.epsilon-deactivate-form {
|
| 83 |
-
display: none;
|
| 84 |
-
}
|
| 85 |
-
.epsilon-deactivate-form-active .epsilon-deactivate-form {
|
| 86 |
-
position: absolute;
|
| 87 |
-
bottom: 30px;
|
| 88 |
-
left: 0;
|
| 89 |
-
max-width: 400px;
|
| 90 |
-
background: #fff;
|
| 91 |
-
white-space: normal;
|
| 92 |
-
}
|
| 93 |
-
.epsilon-deactivate-form-head {
|
| 94 |
-
background: #51AD31;
|
| 95 |
-
color: #fff;
|
| 96 |
-
padding: 8px 18px;
|
| 97 |
-
}
|
| 98 |
-
.epsilon-deactivate-form-body {
|
| 99 |
-
padding: 8px 18px;
|
| 100 |
-
color: #444;
|
| 101 |
-
}
|
| 102 |
-
.deactivating-spinner {
|
| 103 |
-
display: none;
|
| 104 |
-
}
|
| 105 |
-
.deactivating-spinner .spinner {
|
| 106 |
-
float: none;
|
| 107 |
-
margin: 4px 4px 0 18px;
|
| 108 |
-
vertical-align: bottom;
|
| 109 |
-
visibility: visible;
|
| 110 |
-
}
|
| 111 |
-
.epsilon-deactivate-form-footer {
|
| 112 |
-
padding: 8px 18px;
|
| 113 |
-
}
|
| 114 |
-
.epsilon-deactivate-form-footer p {
|
| 115 |
-
display: flex;
|
| 116 |
-
align-items: center;
|
| 117 |
-
justify-content: space-between;
|
| 118 |
-
}
|
| 119 |
-
.epsilon-deactivate-form.process-response .epsilon-deactivate-form-body,
|
| 120 |
-
.epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer {
|
| 121 |
-
position: relative;
|
| 122 |
-
}
|
| 123 |
-
.epsilon-deactivate-form.process-response .epsilon-deactivate-form-body:after,
|
| 124 |
-
.epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer:after {
|
| 125 |
-
content: "";
|
| 126 |
-
display: block;
|
| 127 |
-
position: absolute;
|
| 128 |
-
top: 0;
|
| 129 |
-
left: 0;
|
| 130 |
-
width: 100%;
|
| 131 |
-
height: 100%;
|
| 132 |
-
background-color: rgba( 255, 255, 255, .5 );
|
| 133 |
-
}
|
| 134 |
-
</style>
|
| 135 |
-
<script>
|
| 136 |
-
jQuery(document).ready(function($){
|
| 137 |
-
var deactivateURL = $("#epsilon-deactivate-link-<?php echo esc_attr( $this->plugin_name ); ?>"),
|
| 138 |
-
formContainer = $('#epsilon-deactivate-form-<?php echo esc_attr( $this->plugin_name ); ?>'),
|
| 139 |
-
detailsStrings = {
|
| 140 |
-
'setup' : '<?php echo __( 'What was the dificult part ?', 'modula-gallery' ) ?>',
|
| 141 |
-
'documentation' : '<?php echo __( 'What can we describe more ?', 'modula-gallery' ) ?>',
|
| 142 |
-
'features' : '<?php echo __( 'How could we improve ?', 'modula-gallery' ) ?>',
|
| 143 |
-
'better-plugin' : '<?php echo __( 'Can you mention it ?', 'modula-gallery' ) ?>',
|
| 144 |
-
'incompatibility' : '<?php echo __( 'With what plugin or theme is incompatible ?', 'modula-gallery' ) ?>',
|
| 145 |
-
};
|
| 146 |
-
|
| 147 |
-
$( deactivateURL ).on("click",function(){
|
| 148 |
-
// We'll send the user to this deactivation link when they've completed or dismissed the form
|
| 149 |
-
var url = deactivateURL.attr( 'href' );
|
| 150 |
-
$('body').toggleClass('epsilon-deactivate-form-active');
|
| 151 |
-
formContainer.fadeIn();
|
| 152 |
-
formContainer.html( '<?php echo $html; ?>');
|
| 153 |
-
|
| 154 |
-
formContainer.on( 'change', 'input[name="epsilon-deactivate-reason"]', function(){
|
| 155 |
-
var detailsLabel = formContainer.find( '#epsilon-deactivate-details-label strong' );
|
| 156 |
-
var value = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
|
| 157 |
-
detailsLabel.text( detailsStrings[ value ] );
|
| 158 |
-
});
|
| 159 |
-
|
| 160 |
-
formContainer.on('click', '#epsilon-deactivate-submit-form', function(e){
|
| 161 |
-
var data = {
|
| 162 |
-
'action': 'epsilon_deactivate_plugin',
|
| 163 |
-
'security': "<?php echo wp_create_nonce ( 'epsilon_deactivate_plugin' ); ?>",
|
| 164 |
-
'dataType': "json"
|
| 165 |
-
};
|
| 166 |
-
e.preventDefault();
|
| 167 |
-
// As soon as we click, the body of the form should disappear
|
| 168 |
-
formContainer.addClass( 'process-response' );
|
| 169 |
-
// Fade in spinner
|
| 170 |
-
formContainer.find(".deactivating-spinner").fadeIn();
|
| 171 |
-
|
| 172 |
-
data['reason'] = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
|
| 173 |
-
data['details'] = formContainer.find('#epsilon-deactivate-details').val();
|
| 174 |
-
data['tracking'] = formContainer.find( '#allow-tracking:checked' ).length;
|
| 175 |
-
|
| 176 |
-
$.post(
|
| 177 |
-
ajaxurl,
|
| 178 |
-
data,
|
| 179 |
-
function(response){
|
| 180 |
-
// Redirect to original deactivation URL
|
| 181 |
-
window.location.href = url;
|
| 182 |
-
}
|
| 183 |
-
);
|
| 184 |
-
});
|
| 185 |
-
|
| 186 |
-
formContainer.on('click', '#epsilon-deactivate-plugin', function(e){
|
| 187 |
-
e.preventDefault();
|
| 188 |
-
window.location.href = url;
|
| 189 |
-
});
|
| 190 |
-
|
| 191 |
-
// If we click outside the form, the form will close
|
| 192 |
-
$('.epsilon-deactivate-form-bg').on('click',function(){
|
| 193 |
-
formContainer.fadeOut();
|
| 194 |
-
$('body').removeClass('epsilon-deactivate-form-active');
|
| 195 |
-
});
|
| 196 |
-
});
|
| 197 |
-
});
|
| 198 |
-
</script>
|
| 199 |
-
<?php }
|
| 200 |
-
|
| 201 |
-
/*
|
| 202 |
-
* Form text strings
|
| 203 |
-
* These are non-filterable and used as fallback in case filtered strings aren't set correctly
|
| 204 |
-
* @since 1.0.0
|
| 205 |
-
*/
|
| 206 |
-
public function get_form_info() {
|
| 207 |
-
$form = array();
|
| 208 |
-
$form['heading'] = __( 'Sorry to see you go', 'modula-gallery' );
|
| 209 |
-
$form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'modula-gallery' );
|
| 210 |
-
$form['options'] = array(
|
| 211 |
-
'setup' => __( 'Set up is too difficult', 'modula-gallery' ),
|
| 212 |
-
'documentation' => __( 'Lack of documentation', 'modula-gallery' ),
|
| 213 |
-
'features' => __( 'Not the features I wanted', 'modula-gallery' ),
|
| 214 |
-
'better-plugin' => __( 'Found a better plugin', 'modula-gallery' ),
|
| 215 |
-
'incompatibility' => __( 'Incompatible with theme or plugin', 'modula-gallery' ),
|
| 216 |
-
);
|
| 217 |
-
$form['details'] = __( 'How could we improve ?', 'modula-gallery' );
|
| 218 |
-
return $form;
|
| 219 |
-
}
|
| 220 |
-
|
| 221 |
-
public function epsilon_deactivate_plugin_callback() {
|
| 222 |
-
|
| 223 |
-
check_ajax_referer( 'epsilon_deactivate_plugin', 'security' );
|
| 224 |
-
|
| 225 |
-
if ( isset($_POST['reason']) && isset($_POST['details']) && isset($_POST['tracking']) ) {
|
| 226 |
-
require_once 'class-epsilon-plugin-request.php';
|
| 227 |
-
$args = array(
|
| 228 |
-
'reason' => $_POST['reason'],
|
| 229 |
-
'details' => $_POST['details'],
|
| 230 |
-
'tracking' => $_POST['tracking'],
|
| 231 |
-
);
|
| 232 |
-
$request = new Epsilon_Plugin_Request( $this->plugin_file, $args );
|
| 233 |
-
if ( $request->request_successful ) {
|
| 234 |
-
echo json_encode( array(
|
| 235 |
-
'status' => 'ok',
|
| 236 |
-
) );
|
| 237 |
-
}else{
|
| 238 |
-
echo json_encode( array(
|
| 239 |
-
'status' => 'nok',
|
| 240 |
-
) );
|
| 241 |
-
}
|
| 242 |
-
}else{
|
| 243 |
-
echo json_encode( array(
|
| 244 |
-
'status' => 'ok',
|
| 245 |
-
) );
|
| 246 |
-
}
|
| 247 |
-
|
| 248 |
-
die();
|
| 249 |
-
|
| 250 |
-
}
|
| 251 |
-
|
| 252 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/class-modula-review.php
CHANGED
|
@@ -19,10 +19,10 @@ class Modula_Review {
|
|
| 19 |
$this->value = $this->value();
|
| 20 |
|
| 21 |
$this->messages = array(
|
| 22 |
-
'notice' =>
|
| 23 |
-
'rate' =>
|
| 24 |
-
'rated' =>
|
| 25 |
-
'no_rate' =>
|
| 26 |
);
|
| 27 |
|
| 28 |
if ( isset( $args['messages'] ) ) {
|
|
@@ -88,7 +88,7 @@ class Modula_Review {
|
|
| 88 |
global $wpdb;
|
| 89 |
$galleries = $wpdb->get_var( 'SELECT count(Id) FROM ' . $wpdb->ModulaGalleries );
|
| 90 |
|
| 91 |
-
set_transient( 'modula-galleries-review', $galleries, 6 * HOUR_IN_SECONDS );
|
| 92 |
|
| 93 |
return $galleries;
|
| 94 |
|
|
@@ -99,7 +99,7 @@ class Modula_Review {
|
|
| 99 |
$url = sprintf( $this->link, $this->slug );
|
| 100 |
|
| 101 |
?>
|
| 102 |
-
<div id="<?php echo $this->slug ?>-epsilon-review-notice" class="notice notice-success is-dismissible">
|
| 103 |
<p><?php echo sprintf( wp_kses_post( $this->messages['notice'] ), $this->value ) ; ?></p>
|
| 104 |
<p class="actions">
|
| 105 |
<a id="epsilon-rate" href="<?php echo esc_url( $url ) ?>" class="button button-primary epsilon-review-button"><?php echo esc_html( $this->messages['rate'] ); ?></a>
|
|
@@ -119,7 +119,7 @@ class Modula_Review {
|
|
| 119 |
if ( isset( $_POST['epsilon-review'] ) ) {
|
| 120 |
$options['givemereview'] = 'already-rated';
|
| 121 |
}else{
|
| 122 |
-
$options['givemereview'] = $this->value;
|
| 123 |
}
|
| 124 |
|
| 125 |
update_option( 'modula-checks', $options );
|
| 19 |
$this->value = $this->value();
|
| 20 |
|
| 21 |
$this->messages = array(
|
| 22 |
+
'notice' => esc_html__( "Hey, I noticed you have installed our plugin for %s day - that's awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.", 'modula-gallery' ),
|
| 23 |
+
'rate' => esc_html__( 'Ok, you deserve it', 'modula-gallery' ),
|
| 24 |
+
'rated' => esc_html__( 'I already did', 'modula-gallery' ),
|
| 25 |
+
'no_rate' => esc_html__( 'No, not good enough', 'modula-gallery' ),
|
| 26 |
);
|
| 27 |
|
| 28 |
if ( isset( $args['messages'] ) ) {
|
| 88 |
global $wpdb;
|
| 89 |
$galleries = $wpdb->get_var( 'SELECT count(Id) FROM ' . $wpdb->ModulaGalleries );
|
| 90 |
|
| 91 |
+
set_transient( 'modula-galleries-review', absint($galleries), 6 * HOUR_IN_SECONDS );
|
| 92 |
|
| 93 |
return $galleries;
|
| 94 |
|
| 99 |
$url = sprintf( $this->link, $this->slug );
|
| 100 |
|
| 101 |
?>
|
| 102 |
+
<div id="<?php echo esc_attr($this->slug) ?>-epsilon-review-notice" class="notice notice-success is-dismissible">
|
| 103 |
<p><?php echo sprintf( wp_kses_post( $this->messages['notice'] ), $this->value ) ; ?></p>
|
| 104 |
<p class="actions">
|
| 105 |
<a id="epsilon-rate" href="<?php echo esc_url( $url ) ?>" class="button button-primary epsilon-review-button"><?php echo esc_html( $this->messages['rate'] ); ?></a>
|
| 119 |
if ( isset( $_POST['epsilon-review'] ) ) {
|
| 120 |
$options['givemereview'] = 'already-rated';
|
| 121 |
}else{
|
| 122 |
+
$options['givemereview'] = absint($this->value);
|
| 123 |
}
|
| 124 |
|
| 125 |
update_option( 'modula-checks', $options );
|
lib/db-class.php
CHANGED
|
@@ -19,12 +19,131 @@ class ModulaLiteDB {
|
|
| 19 |
return "Test";
|
| 20 |
}
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
public function update_config( $id, $config ) {
|
| 23 |
global $wpdb;
|
| 24 |
|
| 25 |
unset( $config->Id );
|
| 26 |
|
| 27 |
-
$
|
|
|
|
| 28 |
|
| 29 |
}
|
| 30 |
|
|
@@ -41,7 +160,8 @@ class ModulaLiteDB {
|
|
| 41 |
|
| 42 |
unset( $data['Id'] );
|
| 43 |
|
| 44 |
-
$
|
|
|
|
| 45 |
|
| 46 |
$galleryAdded = $wpdb->insert( $wpdb->ModulaGalleries, $configuration );
|
| 47 |
|
|
@@ -57,16 +177,16 @@ class ModulaLiteDB {
|
|
| 57 |
public function deleteGallery( $gid ) {
|
| 58 |
global $wpdb;
|
| 59 |
|
| 60 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->ModulaImages WHERE gid = %d", $gid ) );
|
| 61 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->ModulaGalleries WHERE Id = %d", $gid ) );
|
| 62 |
}
|
| 63 |
|
| 64 |
public function editGallery( $gid, $data ) {
|
| 65 |
global $wpdb;
|
| 66 |
|
| 67 |
-
$
|
| 68 |
-
$
|
| 69 |
-
|
| 70 |
|
| 71 |
return $imageEdited;
|
| 72 |
}
|
|
@@ -74,7 +194,7 @@ class ModulaLiteDB {
|
|
| 74 |
public function getIDbyGUID( $guid ) {
|
| 75 |
global $wpdb;
|
| 76 |
|
| 77 |
-
return $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s", $guid ) );
|
| 78 |
}
|
| 79 |
|
| 80 |
public function getGalleryById( $id, $default = null ) {
|
|
@@ -111,8 +231,8 @@ class ModulaLiteDB {
|
|
| 111 |
public function addImage( $gid, $image ) {
|
| 112 |
global $wpdb;
|
| 113 |
$imageAdded = $wpdb->insert( $wpdb->ModulaImages, array(
|
| 114 |
-
'gid' => $gid,
|
| 115 |
-
'imagePath' => $image,
|
| 116 |
'title' => "",
|
| 117 |
'description' => "",
|
| 118 |
'sortOrder' => 0,
|
|
@@ -125,15 +245,15 @@ class ModulaLiteDB {
|
|
| 125 |
global $wpdb;
|
| 126 |
foreach ( $images as $image ) {
|
| 127 |
$imageAdded = $wpdb->insert( $wpdb->ModulaImages, array(
|
| 128 |
-
'gid' => $gid,
|
| 129 |
-
'imagePath' => $image->imagePath,
|
| 130 |
-
'description' => isset( $image->description ) ? $image->description : '',
|
| 131 |
-
'title' => isset( $image->title ) ? $image->title : '',
|
| 132 |
-
'imageId' => $image->imageId,
|
| 133 |
'sortOrder' => 0,
|
| 134 |
) );
|
| 135 |
$id = $wpdb->insert_id;
|
| 136 |
-
$wpdb->update( $wpdb->ModulaImages, array( 'sortOrder' => $id ), array( 'Id' => $id ) );
|
| 137 |
}
|
| 138 |
|
| 139 |
return true;
|
|
@@ -148,7 +268,7 @@ class ModulaLiteDB {
|
|
| 148 |
|
| 149 |
public function deleteImage( $id ) {
|
| 150 |
global $wpdb;
|
| 151 |
-
if ( $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->ModulaImages WHERE Id = %d", $id ) ) === false ) {
|
| 152 |
return false;
|
| 153 |
} else {
|
| 154 |
return true;
|
|
@@ -157,7 +277,7 @@ class ModulaLiteDB {
|
|
| 157 |
|
| 158 |
public function editImage( $id, $data ) {
|
| 159 |
global $wpdb;
|
| 160 |
-
$imageEdited = $wpdb->update( $wpdb->ModulaImages, $data, array( 'Id' => $id ) );
|
| 161 |
|
| 162 |
//print $wpdb->last_query;
|
| 163 |
return $imageEdited;
|
|
@@ -168,7 +288,7 @@ class ModulaLiteDB {
|
|
| 168 |
$index = 1;
|
| 169 |
foreach ( $ids as $id ) {
|
| 170 |
$data = array( 'sortOrder' => $index++ );
|
| 171 |
-
$wpdb->update( $wpdb->ModulaImages, $data, array( 'Id' => $id ) );
|
| 172 |
}
|
| 173 |
|
| 174 |
return true;
|
|
@@ -176,15 +296,15 @@ class ModulaLiteDB {
|
|
| 176 |
|
| 177 |
public function getImagesByGalleryId( $gid ) {
|
| 178 |
global $wpdb;
|
| 179 |
-
$e =
|
| 180 |
-
$imageResults = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->ModulaImages WHERE gid = %d ORDER BY sortOrder ASC LIMIT $e", $gid ) );
|
| 181 |
|
| 182 |
return $imageResults;
|
| 183 |
}
|
| 184 |
|
| 185 |
public function getGalleryByGalleryId( $gid ) {
|
| 186 |
global $wpdb;
|
| 187 |
-
$gallery = $wpdb->get_results( $wpdb->prepare( "SELECT $wpdb->ModulaGalleries.*, $wpdb->ModulaImages.* FROM $wpdb->ModulaGalleries INNER JOIN $wpdb->ModulaImages ON ($wpdb->ModulaGalleries.Id = $wpdb->ModulaImages.gid) WHERE $wpdb->ModulaGalleries.Id = %d ORDER BY sortOrder ASC", $
|
| 188 |
|
| 189 |
return $gallery;
|
| 190 |
}
|
| 19 |
return "Test";
|
| 20 |
}
|
| 21 |
|
| 22 |
+
public function sanitize_config( $config ) {
|
| 23 |
+
|
| 24 |
+
if ( ! is_array( $config ) ) {
|
| 25 |
+
$config = json_decode( $config );
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
$fields = array(
|
| 29 |
+
'name',
|
| 30 |
+
'description',
|
| 31 |
+
'width',
|
| 32 |
+
'height',
|
| 33 |
+
'img_size',
|
| 34 |
+
'margin',
|
| 35 |
+
'randomFactor',
|
| 36 |
+
'lightbox',
|
| 37 |
+
'shuffle',
|
| 38 |
+
'captionColor',
|
| 39 |
+
'wp_field_caption',
|
| 40 |
+
'wp_field_title',
|
| 41 |
+
'hide_title',
|
| 42 |
+
'hide_description',
|
| 43 |
+
'captionFontSize',
|
| 44 |
+
'titleFontSize',
|
| 45 |
+
'enableTwitter',
|
| 46 |
+
'enableFacebook',
|
| 47 |
+
'enableGplus',
|
| 48 |
+
'enablePinterest',
|
| 49 |
+
'socialIconColor',
|
| 50 |
+
'loadedScale',
|
| 51 |
+
'Effect',
|
| 52 |
+
'borderSize',
|
| 53 |
+
'borderRadius',
|
| 54 |
+
'borderColor',
|
| 55 |
+
'shadowSize',
|
| 56 |
+
'shadowColor',
|
| 57 |
+
'script',
|
| 58 |
+
'style'
|
| 59 |
+
);
|
| 60 |
+
|
| 61 |
+
$new_config = array();
|
| 62 |
+
$lightbox_values = array( '', 'direct', 'lightbox2' );
|
| 63 |
+
$checkboxes_values = array( 'T', 'F' );
|
| 64 |
+
$effect_values = array( 'none', 'pufrobo' );
|
| 65 |
+
foreach ( $fields as $field ) {
|
| 66 |
+
if ( isset( $config[ $field ] ) ) {
|
| 67 |
+
|
| 68 |
+
switch ( $field ) {
|
| 69 |
+
case 'description':
|
| 70 |
+
$new_config[ $field ] = wp_filter_post_kses( $config[ $field ] );
|
| 71 |
+
break;
|
| 72 |
+
|
| 73 |
+
case 'height':
|
| 74 |
+
case 'img_size':
|
| 75 |
+
case 'margin':
|
| 76 |
+
case 'randomFactor':
|
| 77 |
+
case 'captionFontSize':
|
| 78 |
+
case 'titleFontSize':
|
| 79 |
+
case 'loadedScale':
|
| 80 |
+
case 'borderSize':
|
| 81 |
+
case 'borderRadius':
|
| 82 |
+
case 'shadowSize':
|
| 83 |
+
$new_config[ $field ] = absint( $config[ $field ] );
|
| 84 |
+
break;
|
| 85 |
+
|
| 86 |
+
case 'lightbox' :
|
| 87 |
+
if ( in_array( $config[ $field ], $lightbox_values ) ) {
|
| 88 |
+
$new_config[ $field ] = $config[ $field ];
|
| 89 |
+
}else{
|
| 90 |
+
$new_config[ $field ] = 'lightbox2';
|
| 91 |
+
}
|
| 92 |
+
break;
|
| 93 |
+
|
| 94 |
+
case 'shuffle' :
|
| 95 |
+
if ( in_array( $config[ $field ], $checkboxes_values ) ) {
|
| 96 |
+
$new_config[ $field ] = $config[ $field ];
|
| 97 |
+
}else{
|
| 98 |
+
$new_config[ $field ] = 'F';
|
| 99 |
+
}
|
| 100 |
+
break;
|
| 101 |
+
|
| 102 |
+
case 'enableTwitter' :
|
| 103 |
+
case 'enableFacebook' :
|
| 104 |
+
case 'enableGplus' :
|
| 105 |
+
case 'enablePinterest' :
|
| 106 |
+
if ( in_array( $config[ $field ], $checkboxes_values) ) {
|
| 107 |
+
$new_config[ $field ] = $config[ $field ];
|
| 108 |
+
}else{
|
| 109 |
+
$new_config[ $field ] = 'T';
|
| 110 |
+
}
|
| 111 |
+
break;
|
| 112 |
+
|
| 113 |
+
case 'captionColor':
|
| 114 |
+
case 'socialIconColor':
|
| 115 |
+
case 'borderColor':
|
| 116 |
+
case 'shadowColor':
|
| 117 |
+
$new_config[ $field ] = sanitize_hex_color( $config[ $field ] );
|
| 118 |
+
break;
|
| 119 |
+
|
| 120 |
+
case 'Effect' :
|
| 121 |
+
if ( in_array( $config[ $field ], $effect_values ) ) {
|
| 122 |
+
$new_config[ $field ] = $config[ $field ];
|
| 123 |
+
}else{
|
| 124 |
+
$new_config[ $field ] = 'pufrobo';
|
| 125 |
+
}
|
| 126 |
+
break;
|
| 127 |
+
|
| 128 |
+
default:
|
| 129 |
+
$new_config[ $field ] = sanitize_text_field( $config[ $field ] );
|
| 130 |
+
break;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
return $new_config;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
public function update_config( $id, $config ) {
|
| 141 |
global $wpdb;
|
| 142 |
|
| 143 |
unset( $config->Id );
|
| 144 |
|
| 145 |
+
$config = $this->sanitize_config( $config );
|
| 146 |
+
$wpdb->update( $wpdb->ModulaGalleries, array( 'configuration' => $config ), array( 'Id' => absint($id) ) );
|
| 147 |
|
| 148 |
}
|
| 149 |
|
| 160 |
|
| 161 |
unset( $data['Id'] );
|
| 162 |
|
| 163 |
+
$config = $this->sanitize_config( $data );
|
| 164 |
+
$configuration = array( 'Id' => '', 'configuration' => json_encode( $config ) );
|
| 165 |
|
| 166 |
$galleryAdded = $wpdb->insert( $wpdb->ModulaGalleries, $configuration );
|
| 167 |
|
| 177 |
public function deleteGallery( $gid ) {
|
| 178 |
global $wpdb;
|
| 179 |
|
| 180 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->ModulaImages WHERE gid = %d", absint($gid) ) );
|
| 181 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->ModulaGalleries WHERE Id = %d", absint($gid) ) );
|
| 182 |
}
|
| 183 |
|
| 184 |
public function editGallery( $gid, $data ) {
|
| 185 |
global $wpdb;
|
| 186 |
|
| 187 |
+
$config = $this->sanitize_config( $data );
|
| 188 |
+
$config = json_encode( $config );
|
| 189 |
+
$imageEdited = $wpdb->update( $wpdb->ModulaGalleries, array( 'configuration' => $config ), array( 'Id' => absint($gid) ) );
|
| 190 |
|
| 191 |
return $imageEdited;
|
| 192 |
}
|
| 194 |
public function getIDbyGUID( $guid ) {
|
| 195 |
global $wpdb;
|
| 196 |
|
| 197 |
+
return $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s", ($guid) ) );
|
| 198 |
}
|
| 199 |
|
| 200 |
public function getGalleryById( $id, $default = null ) {
|
| 231 |
public function addImage( $gid, $image ) {
|
| 232 |
global $wpdb;
|
| 233 |
$imageAdded = $wpdb->insert( $wpdb->ModulaImages, array(
|
| 234 |
+
'gid' => absint($gid),
|
| 235 |
+
'imagePath' => esc_url_raw($image),
|
| 236 |
'title' => "",
|
| 237 |
'description' => "",
|
| 238 |
'sortOrder' => 0,
|
| 245 |
global $wpdb;
|
| 246 |
foreach ( $images as $image ) {
|
| 247 |
$imageAdded = $wpdb->insert( $wpdb->ModulaImages, array(
|
| 248 |
+
'gid' => absint( $gid ),
|
| 249 |
+
'imagePath' => esc_url_raw( $image->imagePath ),
|
| 250 |
+
'description' => isset( $image->description ) ? wp_filter_post_kses( $image->description ) : '',
|
| 251 |
+
'title' => isset( $image->title ) ? sanitize_text_field( $image->title ) : '',
|
| 252 |
+
'imageId' => absint( $image->imageId ),
|
| 253 |
'sortOrder' => 0,
|
| 254 |
) );
|
| 255 |
$id = $wpdb->insert_id;
|
| 256 |
+
$wpdb->update( $wpdb->ModulaImages, array( 'sortOrder' => absint( $id ) ), array( 'Id' => absint( $id ) ) );
|
| 257 |
}
|
| 258 |
|
| 259 |
return true;
|
| 268 |
|
| 269 |
public function deleteImage( $id ) {
|
| 270 |
global $wpdb;
|
| 271 |
+
if ( $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->ModulaImages WHERE Id = %d", absint($id) ) ) === false ) {
|
| 272 |
return false;
|
| 273 |
} else {
|
| 274 |
return true;
|
| 277 |
|
| 278 |
public function editImage( $id, $data ) {
|
| 279 |
global $wpdb;
|
| 280 |
+
$imageEdited = $wpdb->update( $wpdb->ModulaImages, $data, array( 'Id' => absint($id) ) );
|
| 281 |
|
| 282 |
//print $wpdb->last_query;
|
| 283 |
return $imageEdited;
|
| 288 |
$index = 1;
|
| 289 |
foreach ( $ids as $id ) {
|
| 290 |
$data = array( 'sortOrder' => $index++ );
|
| 291 |
+
$wpdb->update( $wpdb->ModulaImages, $data, array( 'Id' => absint($id) ) );
|
| 292 |
}
|
| 293 |
|
| 294 |
return true;
|
| 296 |
|
| 297 |
public function getImagesByGalleryId( $gid ) {
|
| 298 |
global $wpdb;
|
| 299 |
+
$e = 20;
|
| 300 |
+
$imageResults = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->ModulaImages WHERE gid = %d ORDER BY sortOrder ASC LIMIT $e", absint($gid) ) );
|
| 301 |
|
| 302 |
return $imageResults;
|
| 303 |
}
|
| 304 |
|
| 305 |
public function getGalleryByGalleryId( $gid ) {
|
| 306 |
global $wpdb;
|
| 307 |
+
$gallery = $wpdb->get_results( $wpdb->prepare( "SELECT $wpdb->ModulaGalleries.*, $wpdb->ModulaImages.* FROM $wpdb->ModulaGalleries INNER JOIN $wpdb->ModulaImages ON ($wpdb->ModulaGalleries.Id = $wpdb->ModulaImages.gid) WHERE $wpdb->ModulaGalleries.Id = %d ORDER BY sortOrder ASC", absint($id) ) );
|
| 308 |
|
| 309 |
return $gallery;
|
| 310 |
}
|
lib/gallery-class.php
CHANGED
|
@@ -136,7 +136,7 @@ if ( ! class_exists( "ModulaLiteFE" ) ) {
|
|
| 136 |
|
| 137 |
private function getLink( $image ) {
|
| 138 |
if ( ! empty( $image->link ) ) {
|
| 139 |
-
return "href='" . $image->link . "'";
|
| 140 |
}
|
| 141 |
|
| 142 |
if ( empty( $this->gallery->lightbox ) ) {
|
|
@@ -144,7 +144,7 @@ if ( ! class_exists( "ModulaLiteFE" ) ) {
|
|
| 144 |
}
|
| 145 |
|
| 146 |
if ( $this->gallery->lightbox == 'attachment-page' ) {
|
| 147 |
-
return "href='" . $image->url . "'";
|
| 148 |
}
|
| 149 |
|
| 150 |
return "href='" . wp_get_attachment_url( $image->imageId ) . "'";
|
|
@@ -152,7 +152,7 @@ if ( ! class_exists( "ModulaLiteFE" ) ) {
|
|
| 152 |
|
| 153 |
private function getTarget( $image ) {
|
| 154 |
if ( ! empty( $image->target ) ) {
|
| 155 |
-
return "target='" . $image->target . "'";
|
| 156 |
}
|
| 157 |
|
| 158 |
// if($this->gallery->blank == 'T')
|
|
@@ -234,43 +234,43 @@ if ( ! class_exists( "ModulaLiteFE" ) ) {
|
|
| 234 |
$html .= "<style>";
|
| 235 |
|
| 236 |
if ( $this->gallery->borderSize ) {
|
| 237 |
-
$html .= "#jtg-$this->id$rid .item { border: " . $this->gallery->borderSize . "px solid " . $this->gallery->borderColor . "; }";
|
| 238 |
}
|
| 239 |
|
| 240 |
if ( $this->gallery->borderRadius ) {
|
| 241 |
-
$html .= "#jtg-$this->id$rid .item { border-radius: " . $this->gallery->borderRadius . "px; }";
|
| 242 |
}
|
| 243 |
|
| 244 |
if ( $this->gallery->shadowSize ) {
|
| 245 |
-
$html .= "#jtg-$this->id$rid .item { box-shadow: " . $this->gallery->shadowColor . " 0px 0px " . $this->gallery->shadowSize . "px; }";
|
| 246 |
}
|
| 247 |
|
| 248 |
if ( $this->gallery->socialIconColor ) {
|
| 249 |
-
$html .= "#jtg-$this->id$rid .item .jtg-social a { color: " . $this->gallery->socialIconColor . " }";
|
| 250 |
}
|
| 251 |
|
| 252 |
-
$html .= "#jtg-$this->id$rid .item .caption { background-color: " . $this->gallery->captionColor . "; }";
|
| 253 |
|
| 254 |
-
$html .= "#jtg-$this->id$rid .item .figc { color: " . $this->gallery->captionColor . "; font-size: " . $this->gallery->captionFontSize . "px; }";
|
| 255 |
|
| 256 |
-
$html .= "#jtg-$this->id$rid .item .figc h2.jtg-title { font-size: " . $this->gallery->titleFontSize . "px; }";
|
| 257 |
|
| 258 |
-
$html .= "#jtg-$this->id$rid .item { transform: scale(" . $gallery->loadedScale / 100 . ") translate(" . $gallery->loadedHSlide . 'px,' . $gallery->loadedVSlide . "px) rotate(" . $gallery->loadedRotate . "deg); }";
|
| 259 |
|
| 260 |
-
$html .= "#jtg-$this->id$rid .items { width:" . $this->gallery->width . "; height:" . $this->gallery->height . "px; }";
|
| 261 |
|
| 262 |
-
$html .= "#jtg-$this->id$rid .items .figc p.description { color:" . $this->gallery->captionColor . "; }";
|
| 263 |
|
| 264 |
|
| 265 |
if ( strlen( $this->gallery->style ) ) {
|
| 266 |
-
$html .= $this->gallery->style;
|
| 267 |
}
|
| 268 |
|
| 269 |
$html .= "</style>\n";
|
| 270 |
|
| 271 |
$id = $this->id;
|
| 272 |
$html .= "<a name='$id'> </a>";
|
| 273 |
-
$html .=
|
| 274 |
|
| 275 |
$html .= "<div class='items'>";
|
| 276 |
|
|
@@ -282,7 +282,7 @@ if ( ! class_exists( "ModulaLiteFE" ) ) {
|
|
| 282 |
'swipebox',
|
| 283 |
'lightbox2'
|
| 284 |
) ) ? "title" : "data-title";
|
| 285 |
-
$rel = $this->gallery->lightbox == "prettyphoto" ?
|
| 286 |
|
| 287 |
$hoverEffect = $this->getHoverEffect( $this->gallery->hoverEffect );
|
| 288 |
|
|
@@ -298,18 +298,18 @@ if ( ! class_exists( "ModulaLiteFE" ) ) {
|
|
| 298 |
$imgUrl = $image->imagePath;
|
| 299 |
$image->alt = isset( $image->alt ) ? $image->alt : '';
|
| 300 |
|
| 301 |
-
$html .= "<div class=\"item " . $hasTitle . " effect-" . $hoverEffect->code . "\">";
|
| 302 |
-
$html .= "<a $title='$image->description' " . ( $this->gallery->lightbox == "lightbox2" && empty( $image->link ) ? "data-lightbox='$rel'" : "" ) . " rel='$rel' " . $this->getTarget( $image ) . " class='tile-inner " . ( $this->getLightboxClass( $image ) ) . "' " . $this->getLink( $image ) . "></a>";
|
| 303 |
$html .= "<img data-valign='$image->valign' alt='$image->alt' data-halign='$image->halign' class='pic' src='$imgUrl' data-src='$imgUrl' />";
|
| 304 |
$html .= "<div class=\"figc\">";
|
| 305 |
$html .= "<div class=\"figc-inner\">";
|
| 306 |
if ( $this->gallery->hoverEffect != 'none' && ! empty( $image->title ) && 'T' != $this->gallery->hide_title ) {
|
| 307 |
-
$html .= "<h2 class='jtg-title'>" . $image->title . "</h2>";
|
| 308 |
}
|
| 309 |
|
| 310 |
if ( ( $this->gallery->hoverEffect != 'none' && ! empty( $image->description ) ) && 'T' != $this->gallery->hide_description ) {
|
| 311 |
$html .= "<p class=\"description\">";
|
| 312 |
-
$html .= $image->description;
|
| 313 |
$html .= "</p>";
|
| 314 |
}
|
| 315 |
$html .= "</div>";
|
|
@@ -328,8 +328,8 @@ if ( ! class_exists( "ModulaLiteFE" ) ) {
|
|
| 328 |
$html .= "onComplete: function () { " . stripslashes( $this->gallery->script ) . "},";
|
| 329 |
}
|
| 330 |
|
| 331 |
-
$html .= "resizer: '" . plugins_url( '
|
| 332 |
-
$html .= "margin: " . $this->gallery->margin . ",";
|
| 333 |
// $html .= "\t\tkeepArea: " . ($this->gallery->keepArea == "T" ? "true" : "false") . ",\n";
|
| 334 |
$html .= "enableTwitter: " . ( $this->gallery->enableTwitter == "T" ? "true" : "false" ) . ",";
|
| 335 |
$html .= "enableFacebook: " . ( $this->gallery->enableFacebook == "T" ? "true" : "false" ) . ",";
|
| 136 |
|
| 137 |
private function getLink( $image ) {
|
| 138 |
if ( ! empty( $image->link ) ) {
|
| 139 |
+
return "href='" . esc_url($image->link) . "'";
|
| 140 |
}
|
| 141 |
|
| 142 |
if ( empty( $this->gallery->lightbox ) ) {
|
| 144 |
}
|
| 145 |
|
| 146 |
if ( $this->gallery->lightbox == 'attachment-page' ) {
|
| 147 |
+
return "href='" . esc_url($image->url) . "'";
|
| 148 |
}
|
| 149 |
|
| 150 |
return "href='" . wp_get_attachment_url( $image->imageId ) . "'";
|
| 152 |
|
| 153 |
private function getTarget( $image ) {
|
| 154 |
if ( ! empty( $image->target ) ) {
|
| 155 |
+
return "target='" . esc_attr($image->target) . "'";
|
| 156 |
}
|
| 157 |
|
| 158 |
// if($this->gallery->blank == 'T')
|
| 234 |
$html .= "<style>";
|
| 235 |
|
| 236 |
if ( $this->gallery->borderSize ) {
|
| 237 |
+
$html .= "#jtg-$this->id$rid .item { border: " . absint($this->gallery->borderSize) . "px solid " . sanitize_hex_color($this->gallery->borderColor) . "; }";
|
| 238 |
}
|
| 239 |
|
| 240 |
if ( $this->gallery->borderRadius ) {
|
| 241 |
+
$html .= "#jtg-$this->id$rid .item { border-radius: " . absint($this->gallery->borderRadius) . "px; }";
|
| 242 |
}
|
| 243 |
|
| 244 |
if ( $this->gallery->shadowSize ) {
|
| 245 |
+
$html .= "#jtg-$this->id$rid .item { box-shadow: " . absint($this->gallery->shadowColor) . " 0px 0px " . sanitize_hex_color($this->gallery->shadowSize) . "px; }";
|
| 246 |
}
|
| 247 |
|
| 248 |
if ( $this->gallery->socialIconColor ) {
|
| 249 |
+
$html .= "#jtg-$this->id$rid .item .jtg-social a { color: " . sanitize_hex_color($this->gallery->socialIconColor) . " }";
|
| 250 |
}
|
| 251 |
|
| 252 |
+
$html .= "#jtg-$this->id$rid .item .caption { background-color: " . sanitize_hex_color($this->gallery->captionColor) . "; }";
|
| 253 |
|
| 254 |
+
$html .= "#jtg-$this->id$rid .item .figc { color: " . sanitize_hex_color($this->gallery->captionColor) . "; font-size: " . $this->gallery->captionFontSize . "px; }";
|
| 255 |
|
| 256 |
+
$html .= "#jtg-$this->id$rid .item .figc h2.jtg-title { font-size: " . absint($this->gallery->titleFontSize) . "px; }";
|
| 257 |
|
| 258 |
+
$html .= "#jtg-$this->id$rid .item { transform: scale(" . absint($gallery->loadedScale) / 100 . ") translate(" . absint($gallery->loadedHSlide) . 'px,' . absint($gallery->loadedVSlide) . "px) rotate(" . absint($gallery->loadedRotate) . "deg); }";
|
| 259 |
|
| 260 |
+
$html .= "#jtg-$this->id$rid .items { width:" . esc_html($this->gallery->width) . "; height:" . absint($this->gallery->height) . "px; }";
|
| 261 |
|
| 262 |
+
$html .= "#jtg-$this->id$rid .items .figc p.description { color:" . sanitize_hex_color($this->gallery->captionColor) . "; }";
|
| 263 |
|
| 264 |
|
| 265 |
if ( strlen( $this->gallery->style ) ) {
|
| 266 |
+
$html .= esc_html($this->gallery->style);
|
| 267 |
}
|
| 268 |
|
| 269 |
$html .= "</style>\n";
|
| 270 |
|
| 271 |
$id = $this->id;
|
| 272 |
$html .= "<a name='$id'> </a>";
|
| 273 |
+
$html .= '<div class="modula" id="jtg-' . absint($this->id) . absint($rid) . '">';
|
| 274 |
|
| 275 |
$html .= "<div class='items'>";
|
| 276 |
|
| 282 |
'swipebox',
|
| 283 |
'lightbox2'
|
| 284 |
) ) ? "title" : "data-title";
|
| 285 |
+
$rel = $this->gallery->lightbox == "prettyphoto" ? 'prettyPhoto[jtg-' . esc_attr($this->id) . esc_attr($rid) . ']' : 'jtg-' . esc_attr($this->id) . esc_attr($rid);
|
| 286 |
|
| 287 |
$hoverEffect = $this->getHoverEffect( $this->gallery->hoverEffect );
|
| 288 |
|
| 298 |
$imgUrl = $image->imagePath;
|
| 299 |
$image->alt = isset( $image->alt ) ? $image->alt : '';
|
| 300 |
|
| 301 |
+
$html .= "<div class=\"item " . esc_attr($hasTitle) . " effect-" . esc_attr($hoverEffect->code) . "\">";
|
| 302 |
+
$html .= "<a $title='$image->description' " . ( $this->gallery->lightbox == "lightbox2" && empty( $image->link ) ? "data-lightbox='$rel'" : "" ) . " rel='$rel' " . $this->getTarget( $image ) . " class='tile-inner " . esc_attr( $this->getLightboxClass( $image ) ) . "' " . $this->getLink( $image ) . "></a>";
|
| 303 |
$html .= "<img data-valign='$image->valign' alt='$image->alt' data-halign='$image->halign' class='pic' src='$imgUrl' data-src='$imgUrl' />";
|
| 304 |
$html .= "<div class=\"figc\">";
|
| 305 |
$html .= "<div class=\"figc-inner\">";
|
| 306 |
if ( $this->gallery->hoverEffect != 'none' && ! empty( $image->title ) && 'T' != $this->gallery->hide_title ) {
|
| 307 |
+
$html .= "<h2 class='jtg-title'>" . esc_html($image->title) . "</h2>";
|
| 308 |
}
|
| 309 |
|
| 310 |
if ( ( $this->gallery->hoverEffect != 'none' && ! empty( $image->description ) ) && 'T' != $this->gallery->hide_description ) {
|
| 311 |
$html .= "<p class=\"description\">";
|
| 312 |
+
$html .= wp_kses_post($image->description);
|
| 313 |
$html .= "</p>";
|
| 314 |
}
|
| 315 |
$html .= "</div>";
|
| 328 |
$html .= "onComplete: function () { " . stripslashes( $this->gallery->script ) . "},";
|
| 329 |
}
|
| 330 |
|
| 331 |
+
$html .= "resizer: '" . plugins_url( 'image.php', dirname(__FILE__) ) . "',";
|
| 332 |
+
$html .= "margin: " . absint($this->gallery->margin) . ",";
|
| 333 |
// $html .= "\t\tkeepArea: " . ($this->gallery->keepArea == "T" ? "true" : "false") . ",\n";
|
| 334 |
$html .= "enableTwitter: " . ( $this->gallery->enableTwitter == "T" ? "true" : "false" ) . ",";
|
| 335 |
$html .= "enableFacebook: " . ( $this->gallery->enableFacebook == "T" ? "true" : "false" ) . ",";
|
