Aqua Page Builder - Version 1.1.1

Version Description

Download this release

Release Info

Developer syamilmj
Plugin Icon wp plugin Aqua Page Builder
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1.0 to 1.1.1

aq-page-builder.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Aqua Page Builder
5
  Plugin URI: http://aquagraphite.com/page-builder
6
  Description: Easily create custom page templates with intuitive drag-and-drop interface. Requires PHP5 and WP3.5
7
- Version: 1.1.0
8
  Author: Syamil MJ
9
  Author URI: http://aquagraphite.com
10
 
@@ -33,7 +33,7 @@ Author URI: http://aquagraphite.com
33
  */
34
 
35
  //definitions
36
- if(!defined('AQPB_VERSION')) define( 'AQPB_VERSION', '1.1.0' );
37
  if(!defined('AQPB_PATH')) define( 'AQPB_PATH', plugin_dir_path(__FILE__) );
38
  if(!defined('AQPB_DIR')) define( 'AQPB_DIR', plugin_dir_url(__FILE__) );
39
 
4
  Plugin Name: Aqua Page Builder
5
  Plugin URI: http://aquagraphite.com/page-builder
6
  Description: Easily create custom page templates with intuitive drag-and-drop interface. Requires PHP5 and WP3.5
7
+ Version: 1.1.1
8
  Author: Syamil MJ
9
  Author URI: http://aquagraphite.com
10
 
33
  */
34
 
35
  //definitions
36
+ if(!defined('AQPB_VERSION')) define( 'AQPB_VERSION', '1.1.1' );
37
  if(!defined('AQPB_PATH')) define( 'AQPB_PATH', plugin_dir_path(__FILE__) );
38
  if(!defined('AQPB_DIR')) define( 'AQPB_DIR', plugin_dir_url(__FILE__) );
39
 
assets/css/aqpb.css CHANGED
@@ -94,7 +94,7 @@ a:hover, a:active, a:focus { color: #d54e21; }
94
  #page-builder .aqpb-tabs {
95
  float: left;
96
  margin-left: 0;
97
- margin-right: -4000px;
98
  padding-right: 10px;
99
  }
100
  .aqpb-tab {
94
  #page-builder .aqpb-tabs {
95
  float: left;
96
  margin-left: 0;
97
+ margin-right: -9999px;
98
  padding-right: 10px;
99
  }
100
  .aqpb-tab {
assets/js/aqpb.js CHANGED
@@ -397,6 +397,25 @@ jQuery(document).ready(function($){
397
  axis: 'x',
398
  });
399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
  /** Apply CSS float:left to blocks **/
401
  $('li.block').css('float', '');
402
 
397
  axis: 'x',
398
  });
399
 
400
+ $('.aqpb-tabs').on('sortstop', function() {
401
+
402
+ var data = {
403
+ action: 'aq_page_builder_sort_templates',
404
+ security: $('#aqpb-nonce').val(),
405
+ templates: $(this).sortable('serialize')
406
+ };
407
+
408
+ $.post(ajaxurl, data, function(response) {
409
+
410
+ if(response == '-1') { // check nonce
411
+ alert('An unknown error has occurred');
412
+ } else {
413
+ // alert(response);
414
+ }
415
+
416
+ });
417
+ });
418
+
419
  /** Apply CSS float:left to blocks **/
420
  $('li.block').css('float', '');
421
 
classes/class-aq-page-builder.php CHANGED
@@ -54,6 +54,9 @@ if(!class_exists('AQ_Page_Builder')) {
54
  add_filter('media_buttons_context', array(&$this, 'add_media_button') );
55
  add_action('admin_footer', array(&$this, 'add_media_display') );
56
 
 
 
 
57
  }
58
 
59
  /**
@@ -301,7 +304,7 @@ if(!class_exists('AQ_Page_Builder')) {
301
  'nopaging' => true,
302
  'post_type' => 'template',
303
  'status' => 'publish',
304
- 'orderby' => 'title',
305
  'order' => 'ASC',
306
  );
307
 
@@ -386,6 +389,9 @@ if(!class_exists('AQ_Page_Builder')) {
386
  $new_instance = $block->update($new_instance, $old_instance);
387
  }
388
 
 
 
 
389
  //update block
390
  update_post_meta($template_id, $new_key, $new_instance);
391
 
@@ -726,6 +732,37 @@ if(!class_exists('AQ_Page_Builder')) {
726
 
727
  }
728
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
729
 
730
  }
731
  }
54
  add_filter('media_buttons_context', array(&$this, 'add_media_button') );
55
  add_action('admin_footer', array(&$this, 'add_media_display') );
56
 
57
+ /** AJAX Sort templates */
58
+ if(is_admin()) add_action('wp_ajax_aq_page_builder_sort_templates', array($this, 'sort_templates'));
59
+
60
  }
61
 
62
  /**
304
  'nopaging' => true,
305
  'post_type' => 'template',
306
  'status' => 'publish',
307
+ 'orderby' => 'menu_order',
308
  'order' => 'ASC',
309
  );
310
 
389
  $new_instance = $block->update($new_instance, $old_instance);
390
  }
391
 
392
+ // sanitize from all occurrences of "\r\n" - see bit.ly/Ajav2a
393
+ $new_instance = str_replace("\r\n", "\n", $new_instance);
394
+
395
  //update block
396
  update_post_meta($template_id, $new_key, $new_instance);
397
 
732
 
733
  }
734
 
735
+ /**
736
+ * AJAX Sort Templates by "menu_order"
737
+ *
738
+ * @since 1.1.1
739
+ */
740
+ function sort_templates(){
741
+
742
+ $nonce = $_POST['security'];
743
+ if (! wp_verify_nonce($nonce, 'aqpb-settings-page-nonce') ) die('-1');
744
+
745
+ $templates = $_POST['templates'];
746
+ $templates = wp_parse_args($templates);
747
+ $templates = $templates['template'];
748
+
749
+ foreach($templates as $key => $template_id) {
750
+
751
+ // check if page exists
752
+ if($this->is_template($template_id)) {
753
+
754
+ wp_update_post(array(
755
+ 'ID' => $template_id,
756
+ 'menu_order' => $key + 1
757
+ ));
758
+
759
+ }
760
+
761
+ }
762
+
763
+ exit();
764
+
765
+ }
766
 
767
  }
768
  }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: page builder, aquagraphite, syamil mj
6
  Requires at least: 3.3
7
  Tested up to: 3.6
8
 
9
- Stable Tag: 1.1.0
10
  License: GNU Version 2 or Any Later Version
11
 
12
 
@@ -18,8 +18,6 @@ Aqua Page Builder is a powerful WordPress plugin that allows you to create an un
18
 
19
  Similar to the Widgets & Menus, Aqua Page Builder features the drag and drop interaction to build its templates.
20
 
21
- **Follow this plugin on [GitHub](https://github.com/sy4mil/Aqua-Page-Builder)**
22
-
23
  Features of the plugin include:
24
 
25
  * Highly intuitive, drag-and-drop user interface
@@ -29,6 +27,9 @@ Features of the plugin include:
29
  * Highly extensible
30
  * Developer friendly with dozens of actions and filters
31
 
 
 
 
32
  More information at [Aquagraphite.com](http://aquagraphite.com/2012/10/aqua-page-builder/).
33
 
34
  == Installation ==
@@ -39,18 +40,25 @@ More information at [Aquagraphite.com](http://aquagraphite.com/2012/10/aqua-page
39
 
40
  == Frequently Asked Questions ==
41
 
 
 
 
42
  = How do I Add My Own Custom Blocks? =
43
 
44
  Please see our [Wiki](https://github.com/sy4mil/Aqua-Page-Builder/wiki) section on how to develop your own custom blocks.
45
 
46
  == Screenshots ==
47
 
48
- 1. Screenshot 1
49
- 2. Screenshot 2
50
- 3. Screenshot 3
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
54
  = 1.1.0: April =
55
 
56
  * First offical release!
6
  Requires at least: 3.3
7
  Tested up to: 3.6
8
 
9
+ Stable Tag: 1.1.1
10
  License: GNU Version 2 or Any Later Version
11
 
12
 
18
 
19
  Similar to the Widgets & Menus, Aqua Page Builder features the drag and drop interaction to build its templates.
20
 
 
 
21
  Features of the plugin include:
22
 
23
  * Highly intuitive, drag-and-drop user interface
27
  * Highly extensible
28
  * Developer friendly with dozens of actions and filters
29
 
30
+ **See our list of [Supported Themes](http://aquagraphite.com/api/documentation/aqua-page-builder#supported-themes)**
31
+ **Follow this plugin on [GitHub](https://github.com/sy4mil/Aqua-Page-Builder)**
32
+
33
  More information at [Aquagraphite.com](http://aquagraphite.com/2012/10/aqua-page-builder/).
34
 
35
  == Installation ==
40
 
41
  == Frequently Asked Questions ==
42
 
43
+ = Why do I see only 6 blocks? =
44
+ These are default blocks provided with this plugin. Please see the list of [supported themes](http://aquagraphite.com/api/documentation/aqua-page-builder#supported-themes) that includes more blocks, or learn how to create your own from our [Wiki](https://github.com/sy4mil/Aqua-Page-Builder/wiki).
45
+
46
  = How do I Add My Own Custom Blocks? =
47
 
48
  Please see our [Wiki](https://github.com/sy4mil/Aqua-Page-Builder/wiki) section on how to develop your own custom blocks.
49
 
50
  == Screenshots ==
51
 
52
+ 1. Building panel
53
+ 2. Template shortcode inserter
 
54
 
55
  == Changelog ==
56
 
57
+ = 1.1.1: June 8, 2013 =
58
+
59
+ * FIX - Fixed issue with some blocks not exporting
60
+ * ADD - Navbar is sortable & will keep this order
61
+
62
  = 1.1.0: April =
63
 
64
  * First offical release!
view/view-builder-page.php CHANGED
@@ -146,9 +146,9 @@ $disabled = $selected_template_id === 0 ? 'metabox-holder-disabled' : '';
146
  <?php
147
  foreach ( (array) $templates as $template ) {
148
  if($selected_template_id == $template->ID) {
149
- echo '<span class="aqpb-tab aqpb-tab-active aqpb-tab-sortable">'. htmlspecialchars($template->post_title) .'</span>';
150
  } else {
151
- echo '<a class="aqpb-tab aqpb-tab-sortable" data-template_id="'.$template->ID.'" href="' . esc_url(add_query_arg(
152
  array(
153
  'page' => $this->args['page_slug'],
154
  'action' => 'edit',
146
  <?php
147
  foreach ( (array) $templates as $template ) {
148
  if($selected_template_id == $template->ID) {
149
+ echo '<span id="template_'.$template->ID.'" class="aqpb-tab aqpb-tab-active aqpb-tab-sortable">'. htmlspecialchars($template->post_title) .'</span>';
150
  } else {
151
+ echo '<a id="template_'.$template->ID.'" class="aqpb-tab aqpb-tab-sortable" href="' . esc_url(add_query_arg(
152
  array(
153
  'page' => $this->args['page_slug'],
154
  'action' => 'edit',