Version Description
- Bug fix
Download this release
Release Info
Developer | GreenTreeLabs |
Plugin | Gallery – Photo Gallery – Image Gallery |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- Modula.php +168 -167
- README.txt +4 -1
- admin/edit-gallery.php +0 -1
- admin/overview.php +1 -1
- lib/gallery-class.php +4 -4
- scripts/modula.css +3 -1
Modula.php
CHANGED
@@ -4,19 +4,19 @@ Plugin Name: Gallery A WordPress Modula Grid
|
|
4 |
Plugin URI: http://modula.greentreelabs.net
|
5 |
Description: The Best Wordpress Gallery.
|
6 |
Author: GreenTreeLabs
|
7 |
-
Version: 1.1.
|
8 |
Author URI: http://modula.greentreelabs.net
|
9 |
*/
|
10 |
|
11 |
-
function modula_lite_create_db_tables()
|
12 |
{
|
13 |
-
include_once (WP_PLUGIN_DIR . '/modula-best-grid-gallery/lib/install-db.php');
|
14 |
modula_lite_install_db();
|
15 |
}
|
16 |
|
17 |
-
if (!class_exists("ModulaLite"))
|
18 |
{
|
19 |
-
class ModulaLite
|
20 |
{
|
21 |
private $loadedData;
|
22 |
|
@@ -50,34 +50,34 @@ if (!class_exists("ModulaLite"))
|
|
50 |
'shadowSize' => 0,
|
51 |
'shadowColor' => '#ffffff',
|
52 |
'style' => '',
|
53 |
-
'script' => '',
|
54 |
'randomFactor' => 50,
|
55 |
'hoverColor' => '#000000',
|
56 |
'hoverOpacity' => '50',
|
57 |
'hoverEffect' => 'pufrobo',
|
58 |
'hasResizedImages' => false,
|
59 |
-
|
60 |
);
|
61 |
-
|
62 |
-
public function __construct()
|
63 |
{
|
64 |
$this->plugin_name = plugin_basename(__FILE__);
|
65 |
$this->plugin_url = plugins_url('', __FILE__);
|
66 |
$this->define_constants();
|
67 |
$this->define_db_tables();
|
68 |
$this->define_hover_effects();
|
69 |
-
$this->ModulaDB = $this->create_db_conn();
|
70 |
-
|
71 |
-
add_filter('widget_text', 'do_shortcode');
|
72 |
add_filter('mce_buttons', array($this, 'editor_button'));
|
73 |
add_filter('mce_external_plugins', array($this, 'register_editor_plugin'));
|
74 |
|
75 |
-
add_action('init', array($this, 'create_textdomain'));
|
76 |
|
77 |
add_action('wp_enqueue_scripts', array($this, 'add_gallery_scripts'));
|
78 |
-
|
79 |
add_action( 'admin_menu', array($this, 'add_gallery_admin_menu') );
|
80 |
-
|
81 |
add_shortcode( 'Modula', array($this, 'gallery_shortcode_handler') );
|
82 |
|
83 |
add_action('wp_ajax_modula_save_gallery', array($this,'save_gallery'));
|
@@ -86,11 +86,11 @@ if (!class_exists("ModulaLite"))
|
|
86 |
add_action('wp_ajax_modula_list_images', array($this,'list_images'));
|
87 |
add_action('wp_ajax_modula_sort_images', array($this,'sort_images'));
|
88 |
add_action('wp_ajax_modula_delete_image', array($this,'delete_image'));
|
89 |
-
add_action('wp_ajax_modula_resize_images', array($this,'resize_images'));
|
90 |
add_action('wp_ajax_modula_delete_gallery', array($this,'delete_gallery'));
|
91 |
add_action('wp_ajax_modula_clone_gallery', array($this,'clone_gallery'));
|
92 |
add_action('wp_ajax_modula_create_gallery', array($this,'create_gallery'));
|
93 |
-
add_action('wp_ajax_mtg_shortcode_editor', array($this, 'mtg_shortcode_editor'));
|
94 |
add_action('wp_ajax_modula_get_config', array($this, 'get_config'));
|
95 |
add_action('wp_ajax_modula_update_config', array($this, 'update_config'));
|
96 |
add_action('wp_ajax_modula_get_ext_galleries', array($this,'get_ext_galleries'));
|
@@ -98,14 +98,14 @@ if (!class_exists("ModulaLite"))
|
|
98 |
|
99 |
add_filter( 'plugin_row_meta',array( $this, 'register_links' ),10,2);
|
100 |
}
|
101 |
-
|
102 |
//Define textdomain
|
103 |
-
public function create_textdomain()
|
104 |
{
|
105 |
$plugin_dir = basename(dirname(__FILE__));
|
106 |
load_plugin_textdomain( 'modula-gallery', false, $plugin_dir.'/lib/languages' );
|
107 |
-
}
|
108 |
-
|
109 |
function define_hover_effects()
|
110 |
{
|
111 |
$this->hoverEffects = array();
|
@@ -286,7 +286,7 @@ if (!class_exists("ModulaLite"))
|
|
286 |
$id= intval($_POST['gid']);
|
287 |
$this->ModulaDB->deleteGallery($id);
|
288 |
}
|
289 |
-
|
290 |
die();
|
291 |
}
|
292 |
|
@@ -296,13 +296,13 @@ if (!class_exists("ModulaLite"))
|
|
296 |
{
|
297 |
$id = $_POST['id'];
|
298 |
$config = stripslashes($_POST['config']);
|
299 |
-
|
300 |
$this->ModulaDB->update_config($id, $config);
|
301 |
}
|
302 |
-
|
303 |
die();
|
304 |
}
|
305 |
-
|
306 |
public function get_config()
|
307 |
{
|
308 |
if(check_admin_referer("Modula","Modula"))
|
@@ -314,7 +314,7 @@ if (!class_exists("ModulaLite"))
|
|
314 |
print json_encode($data);
|
315 |
|
316 |
}
|
317 |
-
|
318 |
die();
|
319 |
}
|
320 |
|
@@ -342,7 +342,7 @@ if (!class_exists("ModulaLite"))
|
|
342 |
ModulaLiteTools::check_and_resize( $images, $data['img_size'] );
|
343 |
$result = $this->ModulaDB->addImages($id, $images);
|
344 |
}
|
345 |
-
print $id;
|
346 |
}
|
347 |
die;
|
348 |
}
|
@@ -354,7 +354,7 @@ if (!class_exists("ModulaLite"))
|
|
354 |
{
|
355 |
$sourceId = intval($_POST['gid']);
|
356 |
$g = $this->ModulaDB->getGalleryById($sourceId, $this->defaultValues);
|
357 |
-
$g->name .="(copy)";
|
358 |
$this->ModulaDB->addGallery($g);
|
359 |
$id = $this->ModulaDB->getNewGalleryId();
|
360 |
$images = $this->ModulaDB->getImagesByGalleryId($sourceId);
|
@@ -367,45 +367,45 @@ if (!class_exists("ModulaLite"))
|
|
367 |
|
368 |
$this->ModulaDB->addImages($id, $images);
|
369 |
}
|
370 |
-
|
371 |
die();
|
372 |
}
|
373 |
|
374 |
|
375 |
//Define constants
|
376 |
-
public function define_constants()
|
377 |
{
|
378 |
if ( ! defined( 'Modula_PLUGIN_BASENAME' ) )
|
379 |
define( 'Modula_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
380 |
-
|
381 |
if ( ! defined( 'Modula_PLUGIN_NAME' ) )
|
382 |
define( 'Modula_PLUGIN_NAME', trim( dirname( Modula_PLUGIN_BASENAME ), '/' ) );
|
383 |
-
|
384 |
if ( ! defined( 'Modula_PLUGIN_DIR' ) )
|
385 |
define( 'Modula_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . Modula_PLUGIN_NAME );
|
386 |
}
|
387 |
-
|
388 |
//delete Gallery
|
389 |
|
390 |
|
391 |
|
392 |
//Define DB tables
|
393 |
-
public function define_db_tables()
|
394 |
{
|
395 |
global $wpdb;
|
396 |
-
|
397 |
$wpdb->ModulaGalleries = $wpdb->prefix . 'modula';
|
398 |
$wpdb->ModulaImages = $wpdb->prefix . 'modula_images';
|
399 |
}
|
400 |
-
|
401 |
-
|
402 |
-
public function create_db_conn()
|
403 |
{
|
404 |
require('lib/db-class.php');
|
405 |
$ModulaDB = ModulaLiteDB::getInstance();
|
406 |
return $ModulaDB;
|
407 |
}
|
408 |
-
|
409 |
public function editor_button($buttons)
|
410 |
{
|
411 |
array_push($buttons, 'separator', 'mtg_shortcode_editor');
|
@@ -422,34 +422,34 @@ if (!class_exists("ModulaLite"))
|
|
422 |
{
|
423 |
$css_path = plugins_url( 'assets/css/admin.css', __FILE__ );
|
424 |
$admin_url = admin_url();
|
425 |
-
|
426 |
$galleries = $this->ModulaDB->getGalleries(); //load all galleries
|
427 |
|
428 |
include 'admin/include/tinymce-galleries.php';
|
429 |
die();
|
430 |
}
|
431 |
-
|
432 |
//Add gallery scripts
|
433 |
-
public function add_gallery_scripts()
|
434 |
{
|
435 |
wp_enqueue_script('jquery');
|
436 |
|
437 |
wp_register_script('modula', WP_PLUGIN_URL.'/modula-best-grid-gallery/scripts/jquery.modula.js', array('jquery'));
|
438 |
wp_enqueue_script('modula');
|
439 |
-
|
440 |
-
|
441 |
-
wp_register_style('modula_stylesheet', WP_PLUGIN_URL.'/modula-best-grid-gallery/scripts/modula.css');
|
442 |
wp_enqueue_style('modula_stylesheet');
|
443 |
|
444 |
-
wp_register_style('effects_stylesheet', WP_PLUGIN_URL.'/modula-best-grid-gallery/scripts/effects.css');
|
445 |
wp_enqueue_style('effects_stylesheet');
|
446 |
|
447 |
wp_register_script('lightbox2_script', WP_PLUGIN_URL.'/modula-best-grid-gallery/lightbox/lightbox2/js/script.js', array('jquery'));
|
448 |
-
wp_register_style('lightbox2_stylesheet', WP_PLUGIN_URL.'/modula-best-grid-gallery/lightbox/lightbox2/css/style.css');
|
449 |
}
|
450 |
-
|
451 |
//Admin Section - register scripts and styles
|
452 |
-
public function gallery_admin_init()
|
453 |
{
|
454 |
if(function_exists( 'wp_enqueue_media' ))
|
455 |
{
|
@@ -457,21 +457,21 @@ if (!class_exists("ModulaLite"))
|
|
457 |
}
|
458 |
|
459 |
wp_enqueue_script('jquery');
|
460 |
-
|
461 |
wp_enqueue_script( 'wp-color-picker' );
|
462 |
wp_enqueue_style( 'wp-color-picker' );
|
463 |
|
464 |
wp_enqueue_script('media-upload');
|
465 |
wp_enqueue_script('thickbox');
|
466 |
-
|
467 |
wp_register_style('materialize', WP_PLUGIN_URL.'/modula-best-grid-gallery/admin/css/materialize.css');
|
468 |
-
wp_enqueue_style('materialize');
|
469 |
|
470 |
wp_register_style('styles', WP_PLUGIN_URL.'/modula-best-grid-gallery/admin/css/style.css');
|
471 |
-
wp_enqueue_style('styles');
|
472 |
|
473 |
wp_register_style('effects', WP_PLUGIN_URL.'/modula-best-grid-gallery/scripts/effects.css');
|
474 |
-
wp_enqueue_style('effects');
|
475 |
|
476 |
wp_register_script('modula', WP_PLUGIN_URL.'/modula-best-grid-gallery/admin/scripts/modula-admin.js', array('jquery','media-upload','thickbox'));
|
477 |
wp_enqueue_script('modula');
|
@@ -483,7 +483,7 @@ if (!class_exists("ModulaLite"))
|
|
483 |
wp_enqueue_style('materialdesign-icons');
|
484 |
|
485 |
wp_enqueue_style('thickbox');
|
486 |
-
|
487 |
$tg_db_version = '1.0';
|
488 |
$installed_ver = get_option( "Modula_db_version" );
|
489 |
|
@@ -493,11 +493,11 @@ if (!class_exists("ModulaLite"))
|
|
493 |
update_option( "Modula_db_version", $tg_db_version );
|
494 |
}
|
495 |
}
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
//Create Admin Menu
|
500 |
-
public function add_gallery_admin_menu()
|
501 |
{
|
502 |
$overview = add_menu_page('Modula', 'Modula', 'edit_posts', 'ModulaLite-admin', array($this, 'add_overview'), WP_PLUGIN_URL.'/modula-best-grid-gallery/admin/icon.png');
|
503 |
$tutorial = add_submenu_page('ModulaLite-admin', __('Modula >> Tutorial','Modula'), __('Tutorial','Modula'), 'edit_posts', 'modula-lite-tutorial', array($this, 'tutorial'));
|
@@ -506,7 +506,7 @@ if (!class_exists("ModulaLite"))
|
|
506 |
$plugins = add_submenu_page('ModulaLite-admin', __('Modula >> Other galleries','Modula'), __('Other galleries','Modula'), 'edit_posts', 'modula-lite-gallery-others', array($this, 'other_galleries'));
|
507 |
$import = add_submenu_page('ModulaLite-admin', __('Modula >> Import','Modula'), __('Import galleries','Modula'), 'edit_posts', 'modula-lite-gallery-import', array($this, 'import_galleries'));
|
508 |
$upgrade = add_submenu_page('ModulaLite-admin', __('Modula >> Upgrade','Modula'), __('Upgrade','Modula'), 'edit_posts', 'modula-lite-gallery-upgrade', array($this, 'upgrade'));
|
509 |
-
|
510 |
add_action('load-'.$tutorial, array($this, 'gallery_admin_init'));
|
511 |
add_action('load-'.$overview, array($this, 'gallery_admin_init'));
|
512 |
add_action('load-'.$add_gallery, array($this, 'gallery_admin_init'));
|
@@ -515,31 +515,31 @@ if (!class_exists("ModulaLite"))
|
|
515 |
add_action('load-'.$import, array($this, 'gallery_admin_init'));
|
516 |
add_action('load-'.$plugins, array($this, 'gallery_admin_init'));
|
517 |
}
|
518 |
-
|
519 |
//Create Admin Pages
|
520 |
-
public function add_overview()
|
521 |
{
|
522 |
include("admin/overview.php");
|
523 |
}
|
524 |
-
|
525 |
public function other_galleries()
|
526 |
{
|
527 |
include("admin/galleries.php");
|
528 |
}
|
529 |
-
|
530 |
-
public function tutorial()
|
531 |
-
{
|
532 |
include("admin/tutorial.php");
|
533 |
}
|
534 |
-
|
535 |
-
public function upgrade()
|
536 |
-
{
|
537 |
include("admin/upgrade.php");
|
538 |
}
|
539 |
-
|
540 |
-
public function add_gallery()
|
541 |
-
{
|
542 |
-
include("admin/add-gallery.php");
|
543 |
}
|
544 |
|
545 |
public function import_galleries()
|
@@ -549,69 +549,69 @@ if (!class_exists("ModulaLite"))
|
|
549 |
|
550 |
public function delete_image()
|
551 |
{
|
552 |
-
if(check_admin_referer('Modula','Modula'))
|
553 |
{
|
554 |
foreach (explode(",", $_POST["id"]) as $id) {
|
555 |
$this->ModulaDB->deleteImage(intval($id));
|
556 |
-
}
|
557 |
}
|
558 |
die();
|
559 |
}
|
560 |
|
561 |
public function add_image()
|
562 |
{
|
563 |
-
if(check_admin_referer('Modula','Modula'))
|
564 |
-
{
|
565 |
$gid = intval($_POST['galleryId']);
|
566 |
$this->loadedData = $this->ModulaDB->getGalleryById($gid, $this->defaultValues);
|
567 |
$prev = $this->ModulaDB->getImagesByGalleryId($gid);
|
568 |
-
|
569 |
$enc_images = stripslashes($_POST["enc_images"]);
|
570 |
$images = json_decode($enc_images);
|
571 |
-
|
572 |
$d = 18 + log10(100);
|
573 |
$images = array_slice($images, 0, $d - count($prev));
|
574 |
$images = ModulaLiteTools::check_and_resize( $images, $this->loadedData->img_size );
|
575 |
$result = $this->ModulaDB->addImages($gid, $images);
|
576 |
-
|
577 |
header("Content-type: application/json");
|
578 |
-
if($result === false)
|
579 |
-
{
|
580 |
print "{\"success\":false}";
|
581 |
}
|
582 |
else
|
583 |
{
|
584 |
print "{\"success\":true}";
|
585 |
}
|
586 |
-
}
|
587 |
die();
|
588 |
}
|
589 |
|
590 |
public function sort_images()
|
591 |
{
|
592 |
-
if(check_admin_referer('Modula','Modula'))
|
593 |
-
{
|
594 |
$result = $this->ModulaDB->sortImages(explode(',', $_POST['ids']));
|
595 |
-
|
596 |
header("Content-type: application/json");
|
597 |
-
if($result === false)
|
598 |
-
{
|
599 |
print "{\"success\":false}";
|
600 |
}
|
601 |
else
|
602 |
{
|
603 |
print "{\"success\":true}";
|
604 |
}
|
605 |
-
}
|
606 |
die();
|
607 |
}
|
608 |
|
609 |
public function save_image()
|
610 |
{
|
611 |
-
if(check_admin_referer('Modula','Modula'))
|
612 |
-
{
|
613 |
$result = false;
|
614 |
-
// $type = $_POST['type'];
|
615 |
$imageUrl = stripslashes($_POST['img_url']);
|
616 |
$imageCaption = stripslashes($_POST['description']);
|
617 |
$title = $_POST['title'];
|
@@ -621,7 +621,7 @@ if (!class_exists("ModulaLite"))
|
|
621 |
$sortOrder = intval($_POST['sortOrder']);
|
622 |
$halign = $_POST['halign'];
|
623 |
$valign = $_POST['valign'];
|
624 |
-
|
625 |
$data = array("target" => $target,
|
626 |
"link" => $link,
|
627 |
"imageId" => $imageId,
|
@@ -630,7 +630,7 @@ if (!class_exists("ModulaLite"))
|
|
630 |
"halign" => $halign,
|
631 |
"valign" => $valign,
|
632 |
"sortOrder" => $sortOrder);
|
633 |
-
|
634 |
if(!empty($_POST['id']))
|
635 |
{
|
636 |
$imageId = intval($_POST['id']);
|
@@ -644,8 +644,8 @@ if (!class_exists("ModulaLite"))
|
|
644 |
|
645 |
header("Content-type: application/json");
|
646 |
|
647 |
-
if($result === false)
|
648 |
-
{
|
649 |
print "{\"success\":false}";
|
650 |
}
|
651 |
else
|
@@ -659,13 +659,13 @@ if (!class_exists("ModulaLite"))
|
|
659 |
|
660 |
public function list_images()
|
661 |
{
|
662 |
-
if(check_admin_referer('Modula','Modula'))
|
663 |
{
|
664 |
$gid = intval($_POST["gid"]);
|
665 |
$gallery = $this->ModulaDB->getGalleryById($gid, $this->defaultValues);
|
666 |
|
667 |
$imageResults = $this->ModulaDB->getImagesByGalleryId($gid);
|
668 |
-
|
669 |
include('admin/include/image-list.php');
|
670 |
}
|
671 |
die();
|
@@ -676,16 +676,16 @@ if (!class_exists("ModulaLite"))
|
|
676 |
if(isset($_POST[$field]))
|
677 |
//return 'checked';
|
678 |
return 'T';
|
679 |
-
//return '';
|
680 |
return 'F';
|
681 |
}
|
682 |
|
683 |
public function save_gallery()
|
684 |
{
|
685 |
-
if(check_admin_referer('Modula','Modula'))
|
686 |
{
|
687 |
$galleryName = stripslashes($_POST['tg_name']);
|
688 |
-
$galleryDescription = stripslashes($_POST['tg_description']);
|
689 |
$slug = strtolower(str_replace(" ", "", $galleryName));
|
690 |
$margin = intval($_POST['tg_margin']);
|
691 |
$shuffle = $this->checkboxVal('tg_shuffle');
|
@@ -717,41 +717,42 @@ if (!class_exists("ModulaLite"))
|
|
717 |
|
718 |
$id = isset($_POST['ftg_gallery_edit']) ? intval($_POST['ftg_gallery_edit']) : 0;
|
719 |
|
720 |
-
$data = array(
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
|
|
755 |
header("Content-type: application/json");
|
756 |
if($id > 0)
|
757 |
{
|
@@ -771,11 +772,11 @@ if (!class_exists("ModulaLite"))
|
|
771 |
}
|
772 |
else
|
773 |
{
|
774 |
-
$result = $this->ModulaDB->addGallery($data);
|
775 |
$id = $this->ModulaDB->getNewGalleryId();
|
776 |
}
|
777 |
|
778 |
-
if($result)
|
779 |
print "{\"success\":true,\"id\":" . $id ."}";
|
780 |
else
|
781 |
print "{\"success\":false}";
|
@@ -783,15 +784,15 @@ if (!class_exists("ModulaLite"))
|
|
783 |
die();
|
784 |
}
|
785 |
|
786 |
-
public function edit_gallery()
|
787 |
{
|
788 |
$this->loadedData = $this->ModulaDB->getGalleryById(intval($_GET['galleryId']), $this->defaultValues);
|
789 |
$modula_fields = $this->fields;
|
790 |
$modula_parent_page = "dashboard";
|
791 |
|
792 |
-
include("admin/edit-gallery.php");
|
793 |
}
|
794 |
-
|
795 |
public function list_thumbnail_sizes()
|
796 |
{
|
797 |
global $_wp_additional_image_sizes;
|
@@ -814,10 +815,10 @@ if (!class_exists("ModulaLite"))
|
|
814 |
|
815 |
return $sizes;
|
816 |
}
|
817 |
-
|
818 |
-
public function gallery_shortcode_handler($atts)
|
819 |
-
{
|
820 |
-
require_once('lib/gallery-class.php');
|
821 |
global $Modula;
|
822 |
|
823 |
if (class_exists( 'ModulaLiteFE' ))
|
@@ -831,12 +832,12 @@ if (!class_exists("ModulaLite"))
|
|
831 |
wp_enqueue_style('lightbox2_stylesheet');
|
832 |
wp_enqueue_script('lightbox2_script');
|
833 |
break;
|
834 |
-
}
|
835 |
return $Modula->render();
|
836 |
}
|
837 |
else
|
838 |
{
|
839 |
-
return "Gallery not found.";
|
840 |
}
|
841 |
}
|
842 |
|
@@ -844,7 +845,7 @@ if (!class_exists("ModulaLite"))
|
|
844 |
|
845 |
"General" => array(
|
846 |
"icon" => "mdi mdi-settings",
|
847 |
-
"fields" => array(
|
848 |
"name" => array(
|
849 |
"name" => "Name",
|
850 |
"type" => "text",
|
@@ -868,7 +869,7 @@ if (!class_exists("ModulaLite"))
|
|
868 |
"name" => "Height",
|
869 |
"type" => "number",
|
870 |
"description" => "Height of the gallery in pixels",
|
871 |
-
"mu" => "px",
|
872 |
"excludeFrom" => array()
|
873 |
),
|
874 |
"img_size" => array(
|
@@ -882,9 +883,9 @@ if (!class_exists("ModulaLite"))
|
|
882 |
"name" => "Margin",
|
883 |
"type" => "number",
|
884 |
"description" => "Margin between images",
|
885 |
-
"mu" => "px",
|
886 |
"excludeFrom" => array()
|
887 |
-
),
|
888 |
"randomFactor" => array(
|
889 |
"name" => "Random factor",
|
890 |
"type" => "slider",
|
@@ -894,7 +895,7 @@ if (!class_exists("ModulaLite"))
|
|
894 |
"mu" => "%",
|
895 |
"default"=>20,
|
896 |
"excludeFrom" => array()
|
897 |
-
),
|
898 |
"filters" => array(
|
899 |
"name" => "Filters",
|
900 |
"type" => "PRO_FEATURE",
|
@@ -906,14 +907,14 @@ if (!class_exists("ModulaLite"))
|
|
906 |
"type" => "PRO_FEATURE",
|
907 |
"description" => "Turn this feature ON if you want to use filters with most lightboxes",
|
908 |
"excludeFrom" => array()
|
909 |
-
),
|
910 |
"allFilterLabel" => array(
|
911 |
"name" => "Text for 'All' filter",
|
912 |
"type" => "PRO_FEATURE",
|
913 |
"description" => "Write here the label for the 'All' filter",
|
914 |
"default"=>"All",
|
915 |
"excludeFrom" => array()
|
916 |
-
),
|
917 |
"lightbox" => array(
|
918 |
"name" => "Lightbox & Links",
|
919 |
"type" => "select",
|
@@ -926,7 +927,7 @@ if (!class_exists("ModulaLite"))
|
|
926 |
"Lightboxes with PRO license" => array("magnific|Magnific popup", "prettyphoto|PrettyPhoto", "fancybox|FancyBox", "swipebox|SwipeBox", "lightbox2|Lightbox")
|
927 |
),
|
928 |
"excludeFrom" => array()
|
929 |
-
),
|
930 |
"shuffle" => array(
|
931 |
"name" => "Shuffle images",
|
932 |
"type" => "toggle",
|
@@ -935,17 +936,17 @@ if (!class_exists("ModulaLite"))
|
|
935 |
"excludeFrom" => array()
|
936 |
)
|
937 |
)
|
938 |
-
),
|
939 |
"Captions" => array(
|
940 |
"icon" => "mdi mdi-comment-text-outline",
|
941 |
-
"fields" => array(
|
942 |
"captionColor" => array(
|
943 |
"name" => "Caption color",
|
944 |
"type" => "color",
|
945 |
"description" => "Color of the caption.",
|
946 |
"default" => "#ffffff",
|
947 |
"excludeFrom" => array()
|
948 |
-
),
|
949 |
"wp_field_caption" => array(
|
950 |
"name" => "WordPress caption field",
|
951 |
"type" => "select",
|
@@ -963,7 +964,7 @@ if (!class_exists("ModulaLite"))
|
|
963 |
"Field" => array("none|Don't use titles", "title|Title", "description|Description")
|
964 |
),
|
965 |
"excludeFrom" => array("shortcode")
|
966 |
-
),
|
967 |
"captionFontSize" => array(
|
968 |
"name" => "Caption Font Size",
|
969 |
"type" => "number",
|
@@ -978,7 +979,7 @@ if (!class_exists("ModulaLite"))
|
|
978 |
"mu" => "px",
|
979 |
"excludeFrom" => array()
|
980 |
),
|
981 |
-
)
|
982 |
|
983 |
),
|
984 |
"Social" => array(
|
@@ -1019,7 +1020,7 @@ if (!class_exists("ModulaLite"))
|
|
1019 |
"default" => "#ffffff",
|
1020 |
"excludeFrom" => array()
|
1021 |
)
|
1022 |
-
)
|
1023 |
|
1024 |
),
|
1025 |
"Image loaded effects" => array(
|
@@ -1063,7 +1064,7 @@ if (!class_exists("ModulaLite"))
|
|
1063 |
"max" => 100,
|
1064 |
"mu" => "px",
|
1065 |
"default" => 0,
|
1066 |
-
"excludeFrom" => array()
|
1067 |
)
|
1068 |
|
1069 |
)
|
@@ -1126,7 +1127,7 @@ if (!class_exists("ModulaLite"))
|
|
1126 |
"default" => "#ffffff",
|
1127 |
"excludeFrom" => array()
|
1128 |
),
|
1129 |
-
|
1130 |
)
|
1131 |
),
|
1132 |
"Customizations" => array(
|
@@ -1152,7 +1153,7 @@ if (!class_exists("ModulaLite"))
|
|
1152 |
|
1153 |
);
|
1154 |
}
|
1155 |
-
|
1156 |
class ModulaLiteHoverEffect
|
1157 |
{
|
1158 |
var $name;
|
@@ -1160,7 +1161,7 @@ if (!class_exists("ModulaLite"))
|
|
1160 |
var $allowTitle;
|
1161 |
var $allowSubtitle;
|
1162 |
var $maxSocial;
|
1163 |
-
|
1164 |
public function __construct($name, $code, $allowTitle, $allowSubtitle, $maxSocial)
|
1165 |
{
|
1166 |
$this->name = $name;
|
@@ -1246,9 +1247,9 @@ class ModulaLiteTools
|
|
1246 |
}
|
1247 |
}
|
1248 |
|
1249 |
-
if (class_exists("ModulaLite"))
|
1250 |
{
|
1251 |
global $ob_ModulaLite;
|
1252 |
$ob_ModulaLite = new ModulaLite();
|
1253 |
}
|
1254 |
-
?>
|
4 |
Plugin URI: http://modula.greentreelabs.net
|
5 |
Description: The Best Wordpress Gallery.
|
6 |
Author: GreenTreeLabs
|
7 |
+
Version: 1.1.1
|
8 |
Author URI: http://modula.greentreelabs.net
|
9 |
*/
|
10 |
|
11 |
+
function modula_lite_create_db_tables()
|
12 |
{
|
13 |
+
include_once (WP_PLUGIN_DIR . '/modula-best-grid-gallery/lib/install-db.php');
|
14 |
modula_lite_install_db();
|
15 |
}
|
16 |
|
17 |
+
if (!class_exists("ModulaLite"))
|
18 |
{
|
19 |
+
class ModulaLite
|
20 |
{
|
21 |
private $loadedData;
|
22 |
|
50 |
'shadowSize' => 0,
|
51 |
'shadowColor' => '#ffffff',
|
52 |
'style' => '',
|
53 |
+
'script' => '',
|
54 |
'randomFactor' => 50,
|
55 |
'hoverColor' => '#000000',
|
56 |
'hoverOpacity' => '50',
|
57 |
'hoverEffect' => 'pufrobo',
|
58 |
'hasResizedImages' => false,
|
59 |
+
'importedFrom' => ''
|
60 |
);
|
61 |
+
|
62 |
+
public function __construct()
|
63 |
{
|
64 |
$this->plugin_name = plugin_basename(__FILE__);
|
65 |
$this->plugin_url = plugins_url('', __FILE__);
|
66 |
$this->define_constants();
|
67 |
$this->define_db_tables();
|
68 |
$this->define_hover_effects();
|
69 |
+
$this->ModulaDB = $this->create_db_conn();
|
70 |
+
|
71 |
+
add_filter('widget_text', 'do_shortcode');
|
72 |
add_filter('mce_buttons', array($this, 'editor_button'));
|
73 |
add_filter('mce_external_plugins', array($this, 'register_editor_plugin'));
|
74 |
|
75 |
+
add_action('init', array($this, 'create_textdomain'));
|
76 |
|
77 |
add_action('wp_enqueue_scripts', array($this, 'add_gallery_scripts'));
|
78 |
+
|
79 |
add_action( 'admin_menu', array($this, 'add_gallery_admin_menu') );
|
80 |
+
|
81 |
add_shortcode( 'Modula', array($this, 'gallery_shortcode_handler') );
|
82 |
|
83 |
add_action('wp_ajax_modula_save_gallery', array($this,'save_gallery'));
|
86 |
add_action('wp_ajax_modula_list_images', array($this,'list_images'));
|
87 |
add_action('wp_ajax_modula_sort_images', array($this,'sort_images'));
|
88 |
add_action('wp_ajax_modula_delete_image', array($this,'delete_image'));
|
89 |
+
add_action('wp_ajax_modula_resize_images', array($this,'resize_images'));
|
90 |
add_action('wp_ajax_modula_delete_gallery', array($this,'delete_gallery'));
|
91 |
add_action('wp_ajax_modula_clone_gallery', array($this,'clone_gallery'));
|
92 |
add_action('wp_ajax_modula_create_gallery', array($this,'create_gallery'));
|
93 |
+
add_action('wp_ajax_mtg_shortcode_editor', array($this, 'mtg_shortcode_editor'));
|
94 |
add_action('wp_ajax_modula_get_config', array($this, 'get_config'));
|
95 |
add_action('wp_ajax_modula_update_config', array($this, 'update_config'));
|
96 |
add_action('wp_ajax_modula_get_ext_galleries', array($this,'get_ext_galleries'));
|
98 |
|
99 |
add_filter( 'plugin_row_meta',array( $this, 'register_links' ),10,2);
|
100 |
}
|
101 |
+
|
102 |
//Define textdomain
|
103 |
+
public function create_textdomain()
|
104 |
{
|
105 |
$plugin_dir = basename(dirname(__FILE__));
|
106 |
load_plugin_textdomain( 'modula-gallery', false, $plugin_dir.'/lib/languages' );
|
107 |
+
}
|
108 |
+
|
109 |
function define_hover_effects()
|
110 |
{
|
111 |
$this->hoverEffects = array();
|
286 |
$id= intval($_POST['gid']);
|
287 |
$this->ModulaDB->deleteGallery($id);
|
288 |
}
|
289 |
+
|
290 |
die();
|
291 |
}
|
292 |
|
296 |
{
|
297 |
$id = $_POST['id'];
|
298 |
$config = stripslashes($_POST['config']);
|
299 |
+
|
300 |
$this->ModulaDB->update_config($id, $config);
|
301 |
}
|
302 |
+
|
303 |
die();
|
304 |
}
|
305 |
+
|
306 |
public function get_config()
|
307 |
{
|
308 |
if(check_admin_referer("Modula","Modula"))
|
314 |
print json_encode($data);
|
315 |
|
316 |
}
|
317 |
+
|
318 |
die();
|
319 |
}
|
320 |
|
342 |
ModulaLiteTools::check_and_resize( $images, $data['img_size'] );
|
343 |
$result = $this->ModulaDB->addImages($id, $images);
|
344 |
}
|
345 |
+
print $id;
|
346 |
}
|
347 |
die;
|
348 |
}
|
354 |
{
|
355 |
$sourceId = intval($_POST['gid']);
|
356 |
$g = $this->ModulaDB->getGalleryById($sourceId, $this->defaultValues);
|
357 |
+
$g->name .="(copy)";
|
358 |
$this->ModulaDB->addGallery($g);
|
359 |
$id = $this->ModulaDB->getNewGalleryId();
|
360 |
$images = $this->ModulaDB->getImagesByGalleryId($sourceId);
|
367 |
|
368 |
$this->ModulaDB->addImages($id, $images);
|
369 |
}
|
370 |
+
|
371 |
die();
|
372 |
}
|
373 |
|
374 |
|
375 |
//Define constants
|
376 |
+
public function define_constants()
|
377 |
{
|
378 |
if ( ! defined( 'Modula_PLUGIN_BASENAME' ) )
|
379 |
define( 'Modula_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
380 |
+
|
381 |
if ( ! defined( 'Modula_PLUGIN_NAME' ) )
|
382 |
define( 'Modula_PLUGIN_NAME', trim( dirname( Modula_PLUGIN_BASENAME ), '/' ) );
|
383 |
+
|
384 |
if ( ! defined( 'Modula_PLUGIN_DIR' ) )
|
385 |
define( 'Modula_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . Modula_PLUGIN_NAME );
|
386 |
}
|
387 |
+
|
388 |
//delete Gallery
|
389 |
|
390 |
|
391 |
|
392 |
//Define DB tables
|
393 |
+
public function define_db_tables()
|
394 |
{
|
395 |
global $wpdb;
|
396 |
+
|
397 |
$wpdb->ModulaGalleries = $wpdb->prefix . 'modula';
|
398 |
$wpdb->ModulaImages = $wpdb->prefix . 'modula_images';
|
399 |
}
|
400 |
+
|
401 |
+
|
402 |
+
public function create_db_conn()
|
403 |
{
|
404 |
require('lib/db-class.php');
|
405 |
$ModulaDB = ModulaLiteDB::getInstance();
|
406 |
return $ModulaDB;
|
407 |
}
|
408 |
+
|
409 |
public function editor_button($buttons)
|
410 |
{
|
411 |
array_push($buttons, 'separator', 'mtg_shortcode_editor');
|
422 |
{
|
423 |
$css_path = plugins_url( 'assets/css/admin.css', __FILE__ );
|
424 |
$admin_url = admin_url();
|
425 |
+
|
426 |
$galleries = $this->ModulaDB->getGalleries(); //load all galleries
|
427 |
|
428 |
include 'admin/include/tinymce-galleries.php';
|
429 |
die();
|
430 |
}
|
431 |
+
|
432 |
//Add gallery scripts
|
433 |
+
public function add_gallery_scripts()
|
434 |
{
|
435 |
wp_enqueue_script('jquery');
|
436 |
|
437 |
wp_register_script('modula', WP_PLUGIN_URL.'/modula-best-grid-gallery/scripts/jquery.modula.js', array('jquery'));
|
438 |
wp_enqueue_script('modula');
|
439 |
+
|
440 |
+
|
441 |
+
wp_register_style('modula_stylesheet', WP_PLUGIN_URL.'/modula-best-grid-gallery/scripts/modula.css');
|
442 |
wp_enqueue_style('modula_stylesheet');
|
443 |
|
444 |
+
wp_register_style('effects_stylesheet', WP_PLUGIN_URL.'/modula-best-grid-gallery/scripts/effects.css');
|
445 |
wp_enqueue_style('effects_stylesheet');
|
446 |
|
447 |
wp_register_script('lightbox2_script', WP_PLUGIN_URL.'/modula-best-grid-gallery/lightbox/lightbox2/js/script.js', array('jquery'));
|
448 |
+
wp_register_style('lightbox2_stylesheet', WP_PLUGIN_URL.'/modula-best-grid-gallery/lightbox/lightbox2/css/style.css');
|
449 |
}
|
450 |
+
|
451 |
//Admin Section - register scripts and styles
|
452 |
+
public function gallery_admin_init()
|
453 |
{
|
454 |
if(function_exists( 'wp_enqueue_media' ))
|
455 |
{
|
457 |
}
|
458 |
|
459 |
wp_enqueue_script('jquery');
|
460 |
+
|
461 |
wp_enqueue_script( 'wp-color-picker' );
|
462 |
wp_enqueue_style( 'wp-color-picker' );
|
463 |
|
464 |
wp_enqueue_script('media-upload');
|
465 |
wp_enqueue_script('thickbox');
|
466 |
+
|
467 |
wp_register_style('materialize', WP_PLUGIN_URL.'/modula-best-grid-gallery/admin/css/materialize.css');
|
468 |
+
wp_enqueue_style('materialize');
|
469 |
|
470 |
wp_register_style('styles', WP_PLUGIN_URL.'/modula-best-grid-gallery/admin/css/style.css');
|
471 |
+
wp_enqueue_style('styles');
|
472 |
|
473 |
wp_register_style('effects', WP_PLUGIN_URL.'/modula-best-grid-gallery/scripts/effects.css');
|
474 |
+
wp_enqueue_style('effects');
|
475 |
|
476 |
wp_register_script('modula', WP_PLUGIN_URL.'/modula-best-grid-gallery/admin/scripts/modula-admin.js', array('jquery','media-upload','thickbox'));
|
477 |
wp_enqueue_script('modula');
|
483 |
wp_enqueue_style('materialdesign-icons');
|
484 |
|
485 |
wp_enqueue_style('thickbox');
|
486 |
+
|
487 |
$tg_db_version = '1.0';
|
488 |
$installed_ver = get_option( "Modula_db_version" );
|
489 |
|
493 |
update_option( "Modula_db_version", $tg_db_version );
|
494 |
}
|
495 |
}
|
496 |
+
|
497 |
+
|
498 |
+
|
499 |
//Create Admin Menu
|
500 |
+
public function add_gallery_admin_menu()
|
501 |
{
|
502 |
$overview = add_menu_page('Modula', 'Modula', 'edit_posts', 'ModulaLite-admin', array($this, 'add_overview'), WP_PLUGIN_URL.'/modula-best-grid-gallery/admin/icon.png');
|
503 |
$tutorial = add_submenu_page('ModulaLite-admin', __('Modula >> Tutorial','Modula'), __('Tutorial','Modula'), 'edit_posts', 'modula-lite-tutorial', array($this, 'tutorial'));
|
506 |
$plugins = add_submenu_page('ModulaLite-admin', __('Modula >> Other galleries','Modula'), __('Other galleries','Modula'), 'edit_posts', 'modula-lite-gallery-others', array($this, 'other_galleries'));
|
507 |
$import = add_submenu_page('ModulaLite-admin', __('Modula >> Import','Modula'), __('Import galleries','Modula'), 'edit_posts', 'modula-lite-gallery-import', array($this, 'import_galleries'));
|
508 |
$upgrade = add_submenu_page('ModulaLite-admin', __('Modula >> Upgrade','Modula'), __('Upgrade','Modula'), 'edit_posts', 'modula-lite-gallery-upgrade', array($this, 'upgrade'));
|
509 |
+
|
510 |
add_action('load-'.$tutorial, array($this, 'gallery_admin_init'));
|
511 |
add_action('load-'.$overview, array($this, 'gallery_admin_init'));
|
512 |
add_action('load-'.$add_gallery, array($this, 'gallery_admin_init'));
|
515 |
add_action('load-'.$import, array($this, 'gallery_admin_init'));
|
516 |
add_action('load-'.$plugins, array($this, 'gallery_admin_init'));
|
517 |
}
|
518 |
+
|
519 |
//Create Admin Pages
|
520 |
+
public function add_overview()
|
521 |
{
|
522 |
include("admin/overview.php");
|
523 |
}
|
524 |
+
|
525 |
public function other_galleries()
|
526 |
{
|
527 |
include("admin/galleries.php");
|
528 |
}
|
529 |
+
|
530 |
+
public function tutorial()
|
531 |
+
{
|
532 |
include("admin/tutorial.php");
|
533 |
}
|
534 |
+
|
535 |
+
public function upgrade()
|
536 |
+
{
|
537 |
include("admin/upgrade.php");
|
538 |
}
|
539 |
+
|
540 |
+
public function add_gallery()
|
541 |
+
{
|
542 |
+
include("admin/add-gallery.php");
|
543 |
}
|
544 |
|
545 |
public function import_galleries()
|
549 |
|
550 |
public function delete_image()
|
551 |
{
|
552 |
+
if(check_admin_referer('Modula','Modula'))
|
553 |
{
|
554 |
foreach (explode(",", $_POST["id"]) as $id) {
|
555 |
$this->ModulaDB->deleteImage(intval($id));
|
556 |
+
}
|
557 |
}
|
558 |
die();
|
559 |
}
|
560 |
|
561 |
public function add_image()
|
562 |
{
|
563 |
+
if(check_admin_referer('Modula','Modula'))
|
564 |
+
{
|
565 |
$gid = intval($_POST['galleryId']);
|
566 |
$this->loadedData = $this->ModulaDB->getGalleryById($gid, $this->defaultValues);
|
567 |
$prev = $this->ModulaDB->getImagesByGalleryId($gid);
|
568 |
+
|
569 |
$enc_images = stripslashes($_POST["enc_images"]);
|
570 |
$images = json_decode($enc_images);
|
571 |
+
|
572 |
$d = 18 + log10(100);
|
573 |
$images = array_slice($images, 0, $d - count($prev));
|
574 |
$images = ModulaLiteTools::check_and_resize( $images, $this->loadedData->img_size );
|
575 |
$result = $this->ModulaDB->addImages($gid, $images);
|
576 |
+
|
577 |
header("Content-type: application/json");
|
578 |
+
if($result === false)
|
579 |
+
{
|
580 |
print "{\"success\":false}";
|
581 |
}
|
582 |
else
|
583 |
{
|
584 |
print "{\"success\":true}";
|
585 |
}
|
586 |
+
}
|
587 |
die();
|
588 |
}
|
589 |
|
590 |
public function sort_images()
|
591 |
{
|
592 |
+
if(check_admin_referer('Modula','Modula'))
|
593 |
+
{
|
594 |
$result = $this->ModulaDB->sortImages(explode(',', $_POST['ids']));
|
595 |
+
|
596 |
header("Content-type: application/json");
|
597 |
+
if($result === false)
|
598 |
+
{
|
599 |
print "{\"success\":false}";
|
600 |
}
|
601 |
else
|
602 |
{
|
603 |
print "{\"success\":true}";
|
604 |
}
|
605 |
+
}
|
606 |
die();
|
607 |
}
|
608 |
|
609 |
public function save_image()
|
610 |
{
|
611 |
+
if(check_admin_referer('Modula','Modula'))
|
612 |
+
{
|
613 |
$result = false;
|
614 |
+
// $type = $_POST['type'];
|
615 |
$imageUrl = stripslashes($_POST['img_url']);
|
616 |
$imageCaption = stripslashes($_POST['description']);
|
617 |
$title = $_POST['title'];
|
621 |
$sortOrder = intval($_POST['sortOrder']);
|
622 |
$halign = $_POST['halign'];
|
623 |
$valign = $_POST['valign'];
|
624 |
+
|
625 |
$data = array("target" => $target,
|
626 |
"link" => $link,
|
627 |
"imageId" => $imageId,
|
630 |
"halign" => $halign,
|
631 |
"valign" => $valign,
|
632 |
"sortOrder" => $sortOrder);
|
633 |
+
|
634 |
if(!empty($_POST['id']))
|
635 |
{
|
636 |
$imageId = intval($_POST['id']);
|
644 |
|
645 |
header("Content-type: application/json");
|
646 |
|
647 |
+
if($result === false)
|
648 |
+
{
|
649 |
print "{\"success\":false}";
|
650 |
}
|
651 |
else
|
659 |
|
660 |
public function list_images()
|
661 |
{
|
662 |
+
if(check_admin_referer('Modula','Modula'))
|
663 |
{
|
664 |
$gid = intval($_POST["gid"]);
|
665 |
$gallery = $this->ModulaDB->getGalleryById($gid, $this->defaultValues);
|
666 |
|
667 |
$imageResults = $this->ModulaDB->getImagesByGalleryId($gid);
|
668 |
+
|
669 |
include('admin/include/image-list.php');
|
670 |
}
|
671 |
die();
|
676 |
if(isset($_POST[$field]))
|
677 |
//return 'checked';
|
678 |
return 'T';
|
679 |
+
//return '';
|
680 |
return 'F';
|
681 |
}
|
682 |
|
683 |
public function save_gallery()
|
684 |
{
|
685 |
+
if(check_admin_referer('Modula','Modula'))
|
686 |
{
|
687 |
$galleryName = stripslashes($_POST['tg_name']);
|
688 |
+
$galleryDescription = stripslashes($_POST['tg_description']);
|
689 |
$slug = strtolower(str_replace(" ", "", $galleryName));
|
690 |
$margin = intval($_POST['tg_margin']);
|
691 |
$shuffle = $this->checkboxVal('tg_shuffle');
|
717 |
|
718 |
$id = isset($_POST['ftg_gallery_edit']) ? intval($_POST['ftg_gallery_edit']) : 0;
|
719 |
|
720 |
+
$data = array(
|
721 |
+
'name' => $galleryName,
|
722 |
+
'slug' => $slug,
|
723 |
+
'description' => $galleryDescription,
|
724 |
+
'lightbox' => $lightbox,
|
725 |
+
'img_size' => intval($_POST['tg_img_size']),
|
726 |
+
'hasResizedImages' => true,
|
727 |
+
'wp_field_caption' => $wp_field_caption,
|
728 |
+
'wp_field_title' => $wp_field_title,
|
729 |
+
'margin' => $margin,
|
730 |
+
'randomFactor' => $_POST['tg_randomFactor'],
|
731 |
+
'shuffle' => $shuffle,
|
732 |
+
'enableTwitter' => $enableTwitter,
|
733 |
+
'enableFacebook' => $enableFacebook,
|
734 |
+
'enableGplus' => $enableGplus,
|
735 |
+
'enablePinterest' => $enablePinterest,
|
736 |
+
'captionColor' => $captionColor,
|
737 |
+
'hoverEffect' => $hoverEffect,
|
738 |
+
'borderSize' => $borderSize,
|
739 |
+
'loadedScale' => $loadedScale,
|
740 |
+
'loadedHSlide' => $loadedHSlide,
|
741 |
+
'loadedVSlide' => $loadedVSlide,
|
742 |
+
'loadedRotate' => $loadedRotate,
|
743 |
+
'socialIconColor' => $socialIconColor,
|
744 |
+
'captionFontSize' => $captionFontSize,
|
745 |
+
'titleFontSize' => $titleFontSize,
|
746 |
+
'borderColor' => $borderColor,
|
747 |
+
'borderRadius' => $borderRadius,
|
748 |
+
'shadowSize' => $shadowSize,
|
749 |
+
'shadowColor' => $shadowColor,
|
750 |
+
'width' => $width,
|
751 |
+
'height' => $height,
|
752 |
+
'style' => $style,
|
753 |
+
'script' => $script
|
754 |
+
);
|
755 |
+
|
756 |
header("Content-type: application/json");
|
757 |
if($id > 0)
|
758 |
{
|
772 |
}
|
773 |
else
|
774 |
{
|
775 |
+
$result = $this->ModulaDB->addGallery($data);
|
776 |
$id = $this->ModulaDB->getNewGalleryId();
|
777 |
}
|
778 |
|
779 |
+
if($result)
|
780 |
print "{\"success\":true,\"id\":" . $id ."}";
|
781 |
else
|
782 |
print "{\"success\":false}";
|
784 |
die();
|
785 |
}
|
786 |
|
787 |
+
public function edit_gallery()
|
788 |
{
|
789 |
$this->loadedData = $this->ModulaDB->getGalleryById(intval($_GET['galleryId']), $this->defaultValues);
|
790 |
$modula_fields = $this->fields;
|
791 |
$modula_parent_page = "dashboard";
|
792 |
|
793 |
+
include("admin/edit-gallery.php");
|
794 |
}
|
795 |
+
|
796 |
public function list_thumbnail_sizes()
|
797 |
{
|
798 |
global $_wp_additional_image_sizes;
|
815 |
|
816 |
return $sizes;
|
817 |
}
|
818 |
+
|
819 |
+
public function gallery_shortcode_handler($atts)
|
820 |
+
{
|
821 |
+
require_once('lib/gallery-class.php');
|
822 |
global $Modula;
|
823 |
|
824 |
if (class_exists( 'ModulaLiteFE' ))
|
832 |
wp_enqueue_style('lightbox2_stylesheet');
|
833 |
wp_enqueue_script('lightbox2_script');
|
834 |
break;
|
835 |
+
}
|
836 |
return $Modula->render();
|
837 |
}
|
838 |
else
|
839 |
{
|
840 |
+
return "Gallery not found.";
|
841 |
}
|
842 |
}
|
843 |
|
845 |
|
846 |
"General" => array(
|
847 |
"icon" => "mdi mdi-settings",
|
848 |
+
"fields" => array(
|
849 |
"name" => array(
|
850 |
"name" => "Name",
|
851 |
"type" => "text",
|
869 |
"name" => "Height",
|
870 |
"type" => "number",
|
871 |
"description" => "Height of the gallery in pixels",
|
872 |
+
"mu" => "px",
|
873 |
"excludeFrom" => array()
|
874 |
),
|
875 |
"img_size" => array(
|
883 |
"name" => "Margin",
|
884 |
"type" => "number",
|
885 |
"description" => "Margin between images",
|
886 |
+
"mu" => "px",
|
887 |
"excludeFrom" => array()
|
888 |
+
),
|
889 |
"randomFactor" => array(
|
890 |
"name" => "Random factor",
|
891 |
"type" => "slider",
|
895 |
"mu" => "%",
|
896 |
"default"=>20,
|
897 |
"excludeFrom" => array()
|
898 |
+
),
|
899 |
"filters" => array(
|
900 |
"name" => "Filters",
|
901 |
"type" => "PRO_FEATURE",
|
907 |
"type" => "PRO_FEATURE",
|
908 |
"description" => "Turn this feature ON if you want to use filters with most lightboxes",
|
909 |
"excludeFrom" => array()
|
910 |
+
),
|
911 |
"allFilterLabel" => array(
|
912 |
"name" => "Text for 'All' filter",
|
913 |
"type" => "PRO_FEATURE",
|
914 |
"description" => "Write here the label for the 'All' filter",
|
915 |
"default"=>"All",
|
916 |
"excludeFrom" => array()
|
917 |
+
),
|
918 |
"lightbox" => array(
|
919 |
"name" => "Lightbox & Links",
|
920 |
"type" => "select",
|
927 |
"Lightboxes with PRO license" => array("magnific|Magnific popup", "prettyphoto|PrettyPhoto", "fancybox|FancyBox", "swipebox|SwipeBox", "lightbox2|Lightbox")
|
928 |
),
|
929 |
"excludeFrom" => array()
|
930 |
+
),
|
931 |
"shuffle" => array(
|
932 |
"name" => "Shuffle images",
|
933 |
"type" => "toggle",
|
936 |
"excludeFrom" => array()
|
937 |
)
|
938 |
)
|
939 |
+
),
|
940 |
"Captions" => array(
|
941 |
"icon" => "mdi mdi-comment-text-outline",
|
942 |
+
"fields" => array(
|
943 |
"captionColor" => array(
|
944 |
"name" => "Caption color",
|
945 |
"type" => "color",
|
946 |
"description" => "Color of the caption.",
|
947 |
"default" => "#ffffff",
|
948 |
"excludeFrom" => array()
|
949 |
+
),
|
950 |
"wp_field_caption" => array(
|
951 |
"name" => "WordPress caption field",
|
952 |
"type" => "select",
|
964 |
"Field" => array("none|Don't use titles", "title|Title", "description|Description")
|
965 |
),
|
966 |
"excludeFrom" => array("shortcode")
|
967 |
+
),
|
968 |
"captionFontSize" => array(
|
969 |
"name" => "Caption Font Size",
|
970 |
"type" => "number",
|
979 |
"mu" => "px",
|
980 |
"excludeFrom" => array()
|
981 |
),
|
982 |
+
)
|
983 |
|
984 |
),
|
985 |
"Social" => array(
|
1020 |
"default" => "#ffffff",
|
1021 |
"excludeFrom" => array()
|
1022 |
)
|
1023 |
+
)
|
1024 |
|
1025 |
),
|
1026 |
"Image loaded effects" => array(
|
1064 |
"max" => 100,
|
1065 |
"mu" => "px",
|
1066 |
"default" => 0,
|
1067 |
+
"excludeFrom" => array()
|
1068 |
)
|
1069 |
|
1070 |
)
|
1127 |
"default" => "#ffffff",
|
1128 |
"excludeFrom" => array()
|
1129 |
),
|
1130 |
+
|
1131 |
)
|
1132 |
),
|
1133 |
"Customizations" => array(
|
1153 |
|
1154 |
);
|
1155 |
}
|
1156 |
+
|
1157 |
class ModulaLiteHoverEffect
|
1158 |
{
|
1159 |
var $name;
|
1161 |
var $allowTitle;
|
1162 |
var $allowSubtitle;
|
1163 |
var $maxSocial;
|
1164 |
+
|
1165 |
public function __construct($name, $code, $allowTitle, $allowSubtitle, $maxSocial)
|
1166 |
{
|
1167 |
$this->name = $name;
|
1247 |
}
|
1248 |
}
|
1249 |
|
1250 |
+
if (class_exists("ModulaLite"))
|
1251 |
{
|
1252 |
global $ob_ModulaLite;
|
1253 |
$ob_ModulaLite = new ModulaLite();
|
1254 |
}
|
1255 |
+
?>
|
README.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: GreenTreeLabs
|
3 |
Tags: best gallery, best gallery plugin, best responsive gallery, best responsive wordpress gallery, best wordpress gallery, best wordpress gallery plugin, best wp gallery, design portfolio, fullscreen, gallery, Gallery Plugin, image gallery, image gallery plugin, Image Rotator, javascript gallery, javascript rotator, jquery gallery, jquery rotator, media uploader, photo gallery, photo rotator, Picture Gallery, portfolio, responsive, responsive galleries, responsive gallery, responsive gallery plugin, responsive image gallery, responsive image gallery plugin, responsive rotator, responsive slideshow, responsive slideshow plugin, rotator, shortcode, slideshow, slideshow plugin, template tag, wordpress galleries, wordpress gallery, wordpress gallery plugin
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 4.5.
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -83,6 +83,9 @@ The simplest way to install is to click on \'Plugins\' then \'Add\' and type \'M
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
86 |
= 1.1.0 =
|
87 |
* New image management
|
88 |
* Import tool for Envira galleries
|
2 |
Contributors: GreenTreeLabs
|
3 |
Tags: best gallery, best gallery plugin, best responsive gallery, best responsive wordpress gallery, best wordpress gallery, best wordpress gallery plugin, best wp gallery, design portfolio, fullscreen, gallery, Gallery Plugin, image gallery, image gallery plugin, Image Rotator, javascript gallery, javascript rotator, jquery gallery, jquery rotator, media uploader, photo gallery, photo rotator, Picture Gallery, portfolio, responsive, responsive galleries, responsive gallery, responsive gallery plugin, responsive image gallery, responsive image gallery plugin, responsive rotator, responsive slideshow, responsive slideshow plugin, rotator, shortcode, slideshow, slideshow plugin, template tag, wordpress galleries, wordpress gallery, wordpress gallery plugin
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 4.5.3
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
83 |
|
84 |
== Changelog ==
|
85 |
|
86 |
+
= 1.1.1 =
|
87 |
+
* Bug fix
|
88 |
+
|
89 |
= 1.1.0 =
|
90 |
* New image management
|
91 |
* Import tool for Envira galleries
|
admin/edit-gallery.php
CHANGED
@@ -276,7 +276,6 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die(_e('Y
|
|
276 |
<a class="btn button-bg waves-effect waves-light" href="#" data-action="select"><?php _e('Select all','modula-gallery')?></a>
|
277 |
<a class="btn button-bg waves-effect waves-light" href="#" data-action="deselect"><?php _e('Deselect all','modula-gallery')?></a>
|
278 |
<a class="btn button-bg waves-effect waves-light" href="#" data-action="toggle"><?php _e('Toggle selection','modula-gallery')?></a>
|
279 |
-
<a class="btn button-bg waves-effect waves-light" href="#" data-action="resize"><?php _e('Resize','modula-gallery')?></a>
|
280 |
<a class="btn button-bg waves-effect waves-light" href="#" data-action="remove"><?php _e('Remove','modula-gallery')?></a>
|
281 |
</div>
|
282 |
<div class="panel">
|
276 |
<a class="btn button-bg waves-effect waves-light" href="#" data-action="select"><?php _e('Select all','modula-gallery')?></a>
|
277 |
<a class="btn button-bg waves-effect waves-light" href="#" data-action="deselect"><?php _e('Deselect all','modula-gallery')?></a>
|
278 |
<a class="btn button-bg waves-effect waves-light" href="#" data-action="toggle"><?php _e('Toggle selection','modula-gallery')?></a>
|
|
|
279 |
<a class="btn button-bg waves-effect waves-light" href="#" data-action="remove"><?php _e('Remove','modula-gallery')?></a>
|
280 |
</div>
|
281 |
<div class="panel">
|
admin/overview.php
CHANGED
@@ -67,7 +67,7 @@
|
|
67 |
</div>
|
68 |
<?php endif ?>
|
69 |
<div class="fixed-action-btn" style="bottom: 15px; right: 24px;">
|
70 |
-
<a href="?page=add-modula" class="btn-floating btn-large green">
|
71 |
<i class="large mdi mdi-plus"></i>
|
72 |
</a>
|
73 |
</div>
|
67 |
</div>
|
68 |
<?php endif ?>
|
69 |
<div class="fixed-action-btn" style="bottom: 15px; right: 24px;">
|
70 |
+
<a href="?page=add-modula-lite" class="btn-floating btn-large green">
|
71 |
<i class="large mdi mdi-plus"></i>
|
72 |
</a>
|
73 |
</div>
|
lib/gallery-class.php
CHANGED
@@ -38,15 +38,15 @@ if (!class_exists( "ModulaLiteFE" )) {
|
|
38 |
print "\n-->\n";
|
39 |
}
|
40 |
|
41 |
-
if(! $this->gallery->hasResizedImages)
|
42 |
-
|
43 |
$images = $this->db->getImagesByGalleryId( $this->id );
|
44 |
$images = ModulaLiteTools::check_and_resize( $images, $this->gallery->img_size );
|
45 |
foreach($images as $img) {
|
46 |
$this->db->editImage( $img->Id, (array)$img );
|
47 |
}
|
48 |
$this->gallery->hasResizedImages = true;
|
49 |
-
$this->db->editGallery($this->id, (array)$this->gallery);
|
50 |
}
|
51 |
|
52 |
$this->images = $this->loadModulaImages();
|
@@ -299,7 +299,7 @@ if (!class_exists( "ModulaLiteFE" )) {
|
|
299 |
|
300 |
$hasTitle = empty($image->title) ? 'notitle' : '';
|
301 |
|
302 |
-
$imgUrl =
|
303 |
|
304 |
$html .= "\t<div class=\"item " . $hasTitle . " effect-". $hoverEffect->code ."\">\n";
|
305 |
$html .= "<a $title='$image->description' ". ($this->gallery->lightbox == "lightbox2" ? "data-lightbox='gallery'" : "") ." rel='$rel' " . $this->getTarget($image) . " class='tile-inner " . ($this->getLightboxClass($image)) . "' " . $this->getLink($image) . ">\n";
|
38 |
print "\n-->\n";
|
39 |
}
|
40 |
|
41 |
+
if(! $this->gallery->hasResizedImages)
|
42 |
+
{
|
43 |
$images = $this->db->getImagesByGalleryId( $this->id );
|
44 |
$images = ModulaLiteTools::check_and_resize( $images, $this->gallery->img_size );
|
45 |
foreach($images as $img) {
|
46 |
$this->db->editImage( $img->Id, (array)$img );
|
47 |
}
|
48 |
$this->gallery->hasResizedImages = true;
|
49 |
+
$this->db->editGallery($this->id, (array)$this->gallery);
|
50 |
}
|
51 |
|
52 |
$this->images = $this->loadModulaImages();
|
299 |
|
300 |
$hasTitle = empty($image->title) ? 'notitle' : '';
|
301 |
|
302 |
+
$imgUrl = $image->imagePath;
|
303 |
|
304 |
$html .= "\t<div class=\"item " . $hasTitle . " effect-". $hoverEffect->code ."\">\n";
|
305 |
$html .= "<a $title='$image->description' ". ($this->gallery->lightbox == "lightbox2" ? "data-lightbox='gallery'" : "") ." rel='$rel' " . $this->getTarget($image) . " class='tile-inner " . ($this->getLightboxClass($image)) . "' " . $this->getLink($image) . ">\n";
|
scripts/modula.css
CHANGED
@@ -138,7 +138,9 @@
|
|
138 |
.modula .filters a.selected {
|
139 |
border-bottom-color: #333;
|
140 |
}
|
141 |
-
|
|
|
|
|
142 |
|
143 |
@font-face {
|
144 |
font-weight: normal;
|
138 |
.modula .filters a.selected {
|
139 |
border-bottom-color: #333;
|
140 |
}
|
141 |
+
.modula .jtg-social a {
|
142 |
+
box-shadow: none;
|
143 |
+
}
|
144 |
|
145 |
@font-face {
|
146 |
font-weight: normal;
|