Aqua Page Builder - Version 1.1.4

Version Description

Download this release

Release Info

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

Code changes from version 1.1.2 to 1.1.4

aq-page-builder.php → aqua-page-builder.php RENAMED
@@ -1,17 +1,19 @@
1
  <?php
2
  /** بسم الله الرحمن الرحيم **
3
-
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.2
8
- Author: Syamil MJ
9
- Author URI: http://aquagraphite.com
10
-
11
- */
 
 
12
 
13
  /**
14
- * Copyright (c) 2013 Syamil MJ. All rights reserved.
15
  *
16
  * Released under the GPL license
17
  * http://www.opensource.org/licenses/gpl-license.php
@@ -33,16 +35,25 @@ Author URI: http://aquagraphite.com
33
  */
34
 
35
  //definitions
36
- if(!defined('AQPB_VERSION')) define( 'AQPB_VERSION', '1.1.2' );
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
 
 
 
 
 
 
 
 
 
 
 
 
40
  //required functions & classes
41
  require_once(AQPB_PATH . 'functions/aqpb_config.php');
42
  require_once(AQPB_PATH . 'functions/aqpb_blocks.php');
43
  require_once(AQPB_PATH . 'classes/class-aq-page-builder.php');
44
  require_once(AQPB_PATH . 'classes/class-aq-block.php');
45
- //require_once(AQPB_PATH . 'classes/class-aq-plugin-updater.php');
46
  require_once(AQPB_PATH . 'functions/aqpb_functions.php');
47
 
48
  //some default blocks
@@ -52,11 +63,11 @@ require_once(AQPB_PATH . 'blocks/aq-clear-block.php');
52
  require_once(AQPB_PATH . 'blocks/aq-widgets-block.php');
53
  require_once(AQPB_PATH . 'blocks/aq-alert-block.php');
54
  require_once(AQPB_PATH . 'blocks/aq-tabs-block.php');
55
- //require_once(AQPB_PATH . 'blocks/aq-richtext-block.php'); //buggy
56
 
57
  //register default blocks
58
  aq_register_block('AQ_Text_Block');
59
- //aq_register_block('AQ_Richtext_Block'); //buggy
60
  aq_register_block('AQ_Column_Block');
61
  aq_register_block('AQ_Clear_Block');
62
  aq_register_block('AQ_Widgets_Block');
@@ -67,14 +78,3 @@ aq_register_block('AQ_Tabs_Block');
67
  $aqpb_config = aq_page_builder_config();
68
  $aq_page_builder = new AQ_Page_Builder($aqpb_config);
69
  if(!is_network_admin()) $aq_page_builder->init();
70
-
71
-
72
- /** @legacy
73
- //set up & fire up plugin updater
74
- $aqpb_updater_config = array(
75
- 'api_url' => 'http://aquagraphite.com/api/',
76
- 'slug' => 'aqua-page-builder',
77
- 'filename' => 'aq-page-builder.php'
78
- );
79
- $aqpb_updater = new AQ_Plugin_Updater($aqpb_updater_config);
80
- */
1
  <?php
2
  /** بسم الله الرحمن الرحيم **
3
+ *
4
+ * Plugin Name: Aqua Page Builder
5
+ * Plugin URI: http://aquagraphite.com/page-builder
6
+ * Description: Fast, lightweight and intuitive drag-and-drop page builder.
7
+ * Version: 1.1.4
8
+ * Author: Syamil MJ
9
+ * Author URI: http://aquagraphite.com
10
+ * Domain Path: /languages/
11
+ * Text Domain: aqpb-l10n
12
+ *
13
+ */
14
 
15
  /**
16
+ * Copyright (c) 2014 Syamil MJ. All rights reserved.
17
  *
18
  * Released under the GPL license
19
  * http://www.opensource.org/licenses/gpl-license.php
35
  */
36
 
37
  //definitions
 
38
  if(!defined('AQPB_PATH')) define( 'AQPB_PATH', plugin_dir_path(__FILE__) );
39
  if(!defined('AQPB_DIR')) define( 'AQPB_DIR', plugin_dir_url(__FILE__) );
40
 
41
+ function aqpb_get_version() {
42
+ $plugin_data = get_plugin_data(__FILE__);
43
+ $version = $plugin_data['Version'];
44
+ return $version;
45
+ }
46
+
47
+ function aqpb_localisation() {
48
+ load_plugin_textdomain( 'aqpb-i10n', FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
49
+ }
50
+ add_action('init', 'aqpb_localisation');
51
+
52
  //required functions & classes
53
  require_once(AQPB_PATH . 'functions/aqpb_config.php');
54
  require_once(AQPB_PATH . 'functions/aqpb_blocks.php');
55
  require_once(AQPB_PATH . 'classes/class-aq-page-builder.php');
56
  require_once(AQPB_PATH . 'classes/class-aq-block.php');
 
57
  require_once(AQPB_PATH . 'functions/aqpb_functions.php');
58
 
59
  //some default blocks
63
  require_once(AQPB_PATH . 'blocks/aq-widgets-block.php');
64
  require_once(AQPB_PATH . 'blocks/aq-alert-block.php');
65
  require_once(AQPB_PATH . 'blocks/aq-tabs-block.php');
66
+ require_once(AQPB_PATH . 'blocks/aq-editor-block.php'); //buggy
67
 
68
  //register default blocks
69
  aq_register_block('AQ_Text_Block');
70
+ aq_register_block('AQ_Editor_Block'); //buggy
71
  aq_register_block('AQ_Column_Block');
72
  aq_register_block('AQ_Clear_Block');
73
  aq_register_block('AQ_Widgets_Block');
78
  $aqpb_config = aq_page_builder_config();
79
  $aq_page_builder = new AQ_Page_Builder($aqpb_config);
80
  if(!is_network_admin()) $aq_page_builder->init();
 
 
 
 
 
 
 
 
 
 
 
assets/images/arrows-dark.png CHANGED
Binary file
assets/images/arrows.png CHANGED
Binary file
assets/images/drop-bg.png CHANGED
Binary file
assets/images/tab-arrows.png CHANGED
Binary file
assets/{js → javascripts}/aqpb-fields.js RENAMED
@@ -153,6 +153,47 @@ jQuery(document).ready(function($){
153
  return false;
154
  });
155
 
156
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
  });
153
  return false;
154
  });
155
 
156
+ // Visual Editor Block
157
+ $('ul.blocks').bind('sortstart', function(event, ui) {
158
+ if( ui.item.hasClass('block-aq_editor_block') ) {
159
+ textareaID = $(ui.item).find('.wp-editor-area').attr('id');
160
+ try { tinyMCE.execCommand('mceRemoveEditor', false, textareaID); } catch(e){
161
+ console.log(e);
162
+ }
163
+ }
164
+ });
165
+
166
+ $('ul.blocks').bind('sortstop', function(event, ui) {
167
+ if( ui.item.hasClass('block-aq_editor_block') ) {
168
+ textareaID = $(ui.item).find('.wp-editor-area').attr('id');
169
+ try {
170
+ tinyMCE.execCommand('mceAddEditor', false, textareaID);
171
+ tinyMCE.execCommand('mceAddControls', false, textareaID);
172
+ } catch(e){
173
+ console.log(e);
174
+ }
175
+ }
176
+ });
177
+
178
+ $('ul.blocks .ui-resizable').bind('resizestart', function(event, ui) {
179
+ if( ui.element.hasClass('block-aq_editor_block') ) {
180
+ textareaID = $(ui.item).find('.wp-editor-area').attr('id');
181
+ try { tinyMCE.execCommand('mceRemoveEditor', false, textareaID); } catch(e){
182
+ console.log(e);
183
+ }
184
+ }
185
+ });
186
+
187
+ $('ul.blocks .ui-resizable').bind('resizestop', function(event, ui) {
188
+ if( ui.element.hasClass('block-aq_editor_block') ) {
189
+ textareaID = $(ui.item).find('.wp-editor-area').attr('id');
190
+ try {
191
+ tinyMCE.execCommand('mceAddEditor', false, textareaID);
192
+ tinyMCE.execCommand('mceAddControls', false, textareaID);
193
+ } catch(e){
194
+ console.log(e);
195
+ }
196
+ }
197
+ });
198
 
199
  });
assets/{js → javascripts}/aqpb-view.js RENAMED
File without changes
assets/{js → javascripts}/aqpb.js RENAMED
@@ -24,7 +24,11 @@ jQuery(document).ready(function($){
24
  maxWidth: 724,
25
  minWidth: 104,
26
  resize: function(event, ui) {
 
27
  ui.helper.css("height", "inherit");
 
 
 
28
  },
29
  stop: function(event, ui) {
30
  ui.helper.css('left', ui.originalPosition.left);
@@ -32,13 +36,9 @@ jQuery(document).ready(function($){
32
  return (css.match (/\bspan\S+/g) || []).join(' ');
33
  }).addClass(block_size( $(ui.helper).css('width') ));
34
  ui.helper.find('> div > .size').val(block_size( $(ui.helper).css('width') ));
 
35
  }
36
  },
37
- tabs_width = $('.aqpb-tabs').outerWidth(),
38
- mouseStilldown = false,
39
- max_marginLeft = 720 - Math.abs(tabs_width),
40
- activeTab_pos = $('.aqpb-tab-active').next().position(),
41
- act_mleft,
42
  $parent,
43
  $clicked;
44
 
@@ -150,42 +150,6 @@ jQuery(document).ready(function($){
150
  });
151
  }
152
 
153
- /** Menu functions **/
154
- function moveTabsLeft() {
155
- if(max_marginLeft < $('.aqpb-tabs').css('margin-left').replace("px", "") ) {
156
- $('.aqpb-tabs').animate({'marginLeft': ($('.aqpb-tabs').css('margin-left').replace("px", "") - 7) + 'px' },
157
- 1,
158
- function() {
159
- if(mouseStilldown) {
160
- moveTabsLeft();
161
- }
162
- });
163
- }
164
- }
165
-
166
- function moveTabsRight() {
167
- if($('.aqpb-tabs').css('margin-left').replace("px", "") < 0) {
168
- $('.aqpb-tabs').animate({'marginLeft': Math.abs($('.aqpb-tabs').css('margin-left').replace("px", ""))*(-1) + 7 + 'px' },
169
- 1,
170
- function() {
171
- if(mouseStilldown) {
172
- moveTabsRight();
173
- }
174
- });
175
- }
176
- }
177
-
178
- function centerActiveTab() {
179
- if($('.aqpb-tab-active').hasClass('aqpb-tab-add')) {
180
- act_mleft = 690 - $('.aqpb-tab-active').position().left - $('.aqpb-tab-active').width();
181
- $('.aqpb-tabs').css('margin-left' , act_mleft + 'px');
182
- } else
183
- if(720 < activeTab_pos.left) {
184
- act_mleft = 730 - activeTab_pos.left;
185
- $('.aqpb-tabs').css('margin-left' , act_mleft + 'px');
186
- }
187
- }
188
-
189
  /** Actions
190
  ------------------------------------------------------------------------------------**/
191
  /** Apply CSS float:left to blocks **/
@@ -372,51 +336,6 @@ jQuery(document).ready(function($){
372
  }
373
  });
374
 
375
- /** Nav tabs scrolling **/
376
- if(720 < tabs_width) {
377
- $('.aqpb-tabs-arrow').show();
378
- centerActiveTab();
379
- $('.aqpb-tabs-arrow-right a').mousedown(function() {
380
- mouseStilldown = true;
381
- moveTabsLeft();
382
- }).bind('mouseup mouseleave', function() {
383
- mouseStilldown = false;
384
- });
385
-
386
- $('.aqpb-tabs-arrow-left a').mousedown(function() {
387
- mouseStilldown = true;
388
- moveTabsRight();
389
- }).bind('mouseup mouseleave', function() {
390
- mouseStilldown = false;
391
- });
392
-
393
- }
394
-
395
- /** Sort nav order **/
396
- $('.aqpb-tabs').sortable({
397
- items: '.aqpb-tab-sortable',
398
- axis: 'x',
399
- });
400
-
401
- $('.aqpb-tabs').on('sortstop', function() {
402
-
403
- var data = {
404
- action: 'aq_page_builder_sort_templates',
405
- security: $('#aqpb-nonce').val(),
406
- templates: $(this).sortable('serialize')
407
- };
408
-
409
- $.post(ajaxurl, data, function(response) {
410
-
411
- if(response == '-1') { // check nonce
412
- alert('An unknown error has occurred');
413
- } else {
414
- // alert(response);
415
- }
416
-
417
- });
418
- });
419
-
420
  /** Apply CSS float:left to blocks **/
421
  $('li.block').css('float', '');
422
 
24
  maxWidth: 724,
25
  minWidth: 104,
26
  resize: function(event, ui) {
27
+ ui.helper.css("position", "relative"); // bug
28
  ui.helper.css("height", "inherit");
29
+ ui.helper.css("top", "0"); // bug
30
+ ui.helper.css("left", "0"); // bug
31
+ ui.helper.css("margin-left", ui.position.left + 20 + "px");
32
  },
33
  stop: function(event, ui) {
34
  ui.helper.css('left', ui.originalPosition.left);
36
  return (css.match (/\bspan\S+/g) || []).join(' ');
37
  }).addClass(block_size( $(ui.helper).css('width') ));
38
  ui.helper.find('> div > .size').val(block_size( $(ui.helper).css('width') ));
39
+ ui.helper.css("margin-left", "");
40
  }
41
  },
 
 
 
 
 
42
  $parent,
43
  $clicked;
44
 
150
  });
151
  }
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  /** Actions
154
  ------------------------------------------------------------------------------------**/
155
  /** Apply CSS float:left to blocks **/
336
  }
337
  });
338
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  /** Apply CSS float:left to blocks **/
340
  $('li.block').css('float', '');
341
 
assets/{css → stylesheets}/aqpb-view.css RENAMED
File without changes
assets/{css → stylesheets}/aqpb.css RENAMED
@@ -17,17 +17,48 @@ DO NOT EDIT THIS
17
  * html .cf{height:1%;}
18
  a:hover, a:active, a:focus { color: #d54e21; }
19
  /*builder page*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  #page-builder-frame {
21
  margin-left: 300px;
22
  }
23
 
24
  #page-builder-archive {
25
- width: 270px;
26
  float: left;
27
- background: #fcfcfc;
28
  }
29
- #page-builder-archive.postbox .hndle { cursor: auto; }
 
 
 
 
 
 
 
 
30
  #page-builder-fixed {
 
31
  float: left;
32
  width: 746px;
33
  }
@@ -36,8 +67,6 @@ a:hover, a:active, a:focus { color: #d54e21; }
36
  margin-top: -3px;
37
  }
38
  .aqpbdiv {
39
- -webkit-border-radius: 3px;
40
- border-radius: 3px;
41
  border-width: 1px;
42
  border-style: solid;
43
  }
@@ -46,13 +75,7 @@ a:hover, a:active, a:focus { color: #d54e21; }
46
  }
47
 
48
  #aqpb-header, #aqpb-footer {
49
- background-color: #f1f1f1;
50
- background-image: -ms-linear-gradient(top,#f9f9f9,#ececec);
51
- background-image: -moz-linear-gradient(top,#f9f9f9,#ececec);
52
- background-image: -o-linear-gradient(top,#f9f9f9,#ececec);
53
- background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));
54
- background-image: -webkit-linear-gradient(top,#f9f9f9,#ececec);
55
- background-image: linear-gradient(top,#f9f9f9,#ececec);
56
  padding: 0 10px;
57
  }
58
  #aqpb-header {
@@ -64,9 +87,6 @@ a:hover, a:active, a:focus { color: #d54e21; }
64
  border-top: 1px solid #fff;
65
  padding: 0 10px;
66
  }
67
- #aqpb-footer {
68
- border-top: 1px solid #fff;
69
- }
70
 
71
 
72
  /*tabs nav*/
@@ -136,18 +156,32 @@ a:hover, a:active, a:focus { color: #d54e21; }
136
  /*header*/
137
  #page-builder .major-publishing-actions {
138
  clear: both;
139
- padding: 3px 0 5px;
140
  }
141
  #page-builder .major-publishing-actions .open-label {
142
  color: #666;
143
  display: block;
144
  float: left;
145
- margin-right: 15px;
 
146
  }
 
 
 
 
147
  #page-builder .major-publishing-actions .form-invalid {
148
  padding-left: 4px;
149
  margin-left: -4px;
150
  }
 
 
 
 
 
 
 
 
 
151
 
152
  #page-builder .publishing-action {
153
  text-align: right;
@@ -160,18 +194,32 @@ a:hover, a:active, a:focus { color: #d54e21; }
160
  text-align: left;
161
  float: left;
162
  padding-right: 15px;
163
- margin-top: 5px;
 
164
  }
165
  #page-builder .delete-action .submitdelete {
166
  display: block;
167
  float: left;
168
  margin: 4px 0;
169
  line-height: 15px;
 
170
  }
171
- #template-shortcode input {
172
- width: 120px;
173
- }
174
-
 
 
 
 
 
 
 
 
 
 
 
 
175
  /*blocks*/
176
  #page-builder .blocks {
177
  padding: 1em 0 2em;
@@ -193,33 +241,17 @@ a:hover, a:active, a:focus { color: #d54e21; }
193
  #page-builder .block-handle,
194
  #blocks-archive .block-handle {
195
  cursor: move;
196
- white-space:nowrap;
197
  text-overflow: hidden;
198
- -moz-box-shadow: inset 0 1px 0 #fff;
199
- -webkit-box-shadow: inset 0 1px 0 #fff;
200
- box-shadow: inset 0 1px 0 #fff;
201
  border: 1px solid #dfdfdf;
202
  position: relative;
203
- padding-left: 10px;
204
- height: 34px;
205
- line-height: 35px;
206
- text-shadow: 0 1px 0 #fff;
207
  overflow: hidden;
208
- background-color: #f1f1f1;
209
- background-image: -ms-linear-gradient(top,#f9f9f9,#ececec);
210
- background-image: -moz-linear-gradient(top,#f9f9f9,#ececec);
211
- background-image: -o-linear-gradient(top,#f9f9f9,#ececec);
212
- background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));
213
- background-image: -webkit-linear-gradient(top,#f9f9f9,#ececec);
214
- background-image: linear-gradient(top,#f9f9f9,#ececec);
215
- -webkit-border-radius: 3px;
216
- border-radius: 3px;
217
- }
218
- #page-builder .block-edit-active .block-handle {
219
- -webkit-border-bottom-right-radius: 0;
220
- -webkit-border-bottom-left-radius: 0;
221
- border-bottom-right-radius: 0;
222
- border-bottom-left-radius: 0;
223
  }
224
  #page-builder .block-title,
225
  #blocks-archive .block-title {
@@ -229,8 +261,7 @@ a:hover, a:active, a:focus { color: #d54e21; }
229
  margin-right: 20px;
230
  }
231
  #page-builder .block-title {overflow: hidden;}
232
- #blocks-archive .block-title {position: absolute;}
233
- .in-block-title { color: #606060; }
234
  #page-builder .block-controls {
235
  font-size: 12px;
236
  position: absolute;
@@ -242,41 +273,46 @@ a:hover, a:active, a:focus { color: #d54e21; }
242
  font-size: 12px;
243
  padding-right: 10px;
244
  }
245
- #page-builder .block-edit {
 
 
246
  position: absolute;
247
  right: -20px;
248
  top: 0;
249
  display: block;
250
  width: 30px;
251
- height: 36px;
 
 
 
 
252
  text-indent: -999em;
253
- border-bottom: 1px solid;
254
- -webkit-border-bottom-left-radius: 3px;
255
- border-bottom-left-radius: 3px;
256
- background: transparent url(../images/arrows.png) no-repeat 8px 10px;
257
- border-bottom-color: #eee;
258
- }
259
- #page-builder .block-edit:hover{ background-image: url(../images/arrows-dark.png); }
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  #page-builder .block-settings {
261
  display: none;
262
  border: solid;
263
  border-width: 0 1px 1px 1px;
264
  border-color: #dfdfdf;
265
  padding: 10px 12px;
266
- -webkit-border-bottom-right-radius: 3px;
267
- -webkit-border-bottom-left-radius: 3px;
268
- border-bottom-left-radius: 3px;
269
- border-bottom-right-radius: 3px;
270
- background-color: #f5f5f5;
271
- background-image: -ms-linear-gradient(top,#f9f9f9,#f5f5f5);
272
- background-image: -moz-linear-gradient(top,#f9f9f9,#f5f5f5);
273
- background-image: -o-linear-gradient(top,#f9f9f9,#f5f5f5);
274
- background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#f5f5f5));
275
- background-image: -webkit-linear-gradient(top,#f9f9f9,#f5f5f5);
276
- background-image: linear-gradient(top,#f9f9f9,#f5f5f5);
277
- -moz-box-shadow: inset 0 1px 0 #fff;
278
- -webkit-box-shadow: inset 0 1px 0 #fff;
279
- box-shadow: inset 0 1px 0 #fff;
280
  }
281
 
282
  #page-builder .empty-template {
@@ -284,14 +320,12 @@ a:hover, a:active, a:focus { color: #d54e21; }
284
  }
285
 
286
  /*blocks archive*/
287
- #blocks-archive {
288
- margin-right: -12px;
289
  padding: 10px 0 0;
290
  }
291
  #blocks-archive .block {
292
- margin: 0 10px 10px 0;
293
- width: 120px;
294
- float: left;
295
  }
296
  #blocks-archive .block-settings,
297
  #blocks-archive .block-controls,
@@ -300,22 +334,13 @@ a:hover, a:active, a:focus { color: #d54e21; }
300
  }
301
 
302
  #blocks-archive dl { margin: 0; }
303
- #blocks-archive .block-handle {
304
- background-color: #f5f5f5;
305
- background-image: -ms-linear-gradient(top,#f9f9f9,#f5f5f5);
306
- background-image: -moz-linear-gradient(top,#f9f9f9,#f5f5f5);
307
- background-image: -o-linear-gradient(top,#f9f9f9,#f5f5f5);
308
- background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#f5f5f5));
309
- background-image: -webkit-linear-gradient(top,#f9f9f9,#f5f5f5);
310
- background-image: linear-gradient(top,#f9f9f9,#f5f5f5);
311
- }
312
  .ui-draggable-dragging {
313
  z-index: 50;
314
  }
315
 
316
  /*staging column*/
317
  #page-builder-column.metabox-holder {
318
- padding-top: 24px;
319
  margin-left: -300px;
320
  float: left;
321
  }
@@ -372,10 +397,9 @@ margin-left: 20px;
372
  left: -10px;
373
  }
374
  #page-builder .placeholder {
375
- background: #f5f5f5;
376
  border: 1px dashed #bbb;
377
  float: left;
378
- height: 36px;
379
  margin: 13px 0 0 20px;
380
  width: 300px;
381
  -webkit-box-sizing: border-box;
@@ -388,4 +412,4 @@ margin-left: 20px;
388
  #message.error ul li {
389
  margin-left: 20px;
390
  list-style-type: disc;
391
- }
17
  * html .cf{height:1%;}
18
  a:hover, a:active, a:focus { color: #d54e21; }
19
  /*builder page*/
20
+
21
+ #manage-templates {
22
+ margin-top: 23px;
23
+ padding: 10px;
24
+ overflow: hidden;
25
+ background: #FBFBFB;
26
+ border: 1px solid #E5E5E5;
27
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
28
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
29
+ }
30
+ #manage-templates label,
31
+ #manage-templates .submit-btn,
32
+ #manage-templates .add-new-template-action {
33
+ float: left;
34
+ }
35
+
36
+ #manage-templates label {
37
+ padding-right: 5px;
38
+ }
39
+ #manage-templates .add-new-template-action {
40
+ margin: 6px 0 0 6px;
41
+ }
42
+
43
  #page-builder-frame {
44
  margin-left: 300px;
45
  }
46
 
47
  #page-builder-archive {
48
+ width: 274px;
49
  float: left;
 
50
  }
51
+ #page-builder-archive.postbox {
52
+ border: 1px solid #dfdfdf;
53
+ }
54
+ #page-builder-archive.postbox .hndle {
55
+ cursor: auto;
56
+ padding: 11px 10px 12px 14px;
57
+ background: #f5f5f5;
58
+ border-bottom: 1px solid #DFDFDF;
59
+ }
60
  #page-builder-fixed {
61
+ padding-top: 25px;
62
  float: left;
63
  width: 746px;
64
  }
67
  margin-top: -3px;
68
  }
69
  .aqpbdiv {
 
 
70
  border-width: 1px;
71
  border-style: solid;
72
  }
75
  }
76
 
77
  #aqpb-header, #aqpb-footer {
78
+ background-color: #f5f5f5;
 
 
 
 
 
 
79
  padding: 0 10px;
80
  }
81
  #aqpb-header {
87
  border-top: 1px solid #fff;
88
  padding: 0 10px;
89
  }
 
 
 
90
 
91
 
92
  /*tabs nav*/
156
  /*header*/
157
  #page-builder .major-publishing-actions {
158
  clear: both;
159
+ padding: 3px 0 6px;
160
  }
161
  #page-builder .major-publishing-actions .open-label {
162
  color: #666;
163
  display: block;
164
  float: left;
165
+ margin-right: 5px;
166
+ margin-top: 4px;
167
  }
168
+ #page-builder .major-publishing-actions .open-label input {
169
+ width: 270px;
170
+ height: 2em;
171
+ }
172
  #page-builder .major-publishing-actions .form-invalid {
173
  padding-left: 4px;
174
  margin-left: -4px;
175
  }
176
+ #template-shortcode {
177
+ margin-top: 4px;
178
+ float: left;
179
+ }
180
+ #template-shortcode input {
181
+ width: 120px;
182
+ height: 2em;
183
+ }
184
+
185
 
186
  #page-builder .publishing-action {
187
  text-align: right;
194
  text-align: left;
195
  float: left;
196
  padding-right: 15px;
197
+ margin-top: 6px;
198
+
199
  }
200
  #page-builder .delete-action .submitdelete {
201
  display: block;
202
  float: left;
203
  margin: 4px 0;
204
  line-height: 15px;
205
+ color: #A00;
206
  }
207
+ #page-builder .delete-action .submitdelete:hover {
208
+ color: #F00;
209
+ text-decoration: none;
210
+ }
211
+ #page-builder .clone-action{
212
+ margin-top: 6px;
213
+ float: left;
214
+ }
215
+ #page-builder .clone-action .submitclone{
216
+ display: block;
217
+ float: left;
218
+ margin: 4px 0;
219
+ line-height: 15px;
220
+ text-decoration: none;
221
+ }
222
+
223
  /*blocks*/
224
  #page-builder .blocks {
225
  padding: 1em 0 2em;
241
  #page-builder .block-handle,
242
  #blocks-archive .block-handle {
243
  cursor: move;
244
+ white-space: nowrap;
245
  text-overflow: hidden;
 
 
 
246
  border: 1px solid #dfdfdf;
247
  position: relative;
248
+ padding: 11px 15px;
 
 
 
249
  overflow: hidden;
250
+ background-color: #fafafa;
251
+ }
252
+ #page-builder .block-handle:hover,
253
+ #blocks-archive .block-handle:hover {
254
+ border: 1px solid #999;
 
 
 
 
 
 
 
 
 
 
255
  }
256
  #page-builder .block-title,
257
  #blocks-archive .block-title {
261
  margin-right: 20px;
262
  }
263
  #page-builder .block-title {overflow: hidden;}
264
+ .in-block-title { color: #666; }
 
265
  #page-builder .block-controls {
266
  font-size: 12px;
267
  position: absolute;
273
  font-size: 12px;
274
  padding-right: 10px;
275
  }
276
+ #page-builder .block-edit {
277
+ color: #AAA;
278
+ text-decoration: none;
279
  position: absolute;
280
  right: -20px;
281
  top: 0;
282
  display: block;
283
  width: 30px;
284
+ height: 43px;
285
+ margin-right: 0!important;
286
+ outline: 0;
287
+ overflow: hidden;
288
+ white-space: nowrap;
289
  text-indent: -999em;
290
+ line-height: 2.1;
291
+ }
292
+ #page-builder .block-edit::before {
293
+ right: 0;
294
+ content: '\f140';
295
+ border: 0;
296
+ background: 0 0;
297
+ font: 400 20px/1 dashicons;
298
+ speak: none;
299
+ display: block;
300
+ padding: 0;
301
+ text-indent: 0;
302
+ text-align: center;
303
+ position: relative;
304
+ -webkit-font-smoothing: antialiased;
305
+ -moz-osx-font-smoothing: grayscale;
306
+ text-decoration: none!important;
307
+ line-height: 2.1;
308
+ }
309
+ #page-builder .block-edit:hover{ color: #777; }
310
  #page-builder .block-settings {
311
  display: none;
312
  border: solid;
313
  border-width: 0 1px 1px 1px;
314
  border-color: #dfdfdf;
315
  padding: 10px 12px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  }
317
 
318
  #page-builder .empty-template {
320
  }
321
 
322
  /*blocks archive*/
323
+ #blocks-archive {
 
324
  padding: 10px 0 0;
325
  }
326
  #blocks-archive .block {
327
+ margin: 0 0 10px;
328
+ width: 100%;
 
329
  }
330
  #blocks-archive .block-settings,
331
  #blocks-archive .block-controls,
334
  }
335
 
336
  #blocks-archive dl { margin: 0; }
 
 
 
 
 
 
 
 
 
337
  .ui-draggable-dragging {
338
  z-index: 50;
339
  }
340
 
341
  /*staging column*/
342
  #page-builder-column.metabox-holder {
343
+ padding-top: 23px;
344
  margin-left: -300px;
345
  float: left;
346
  }
397
  left: -10px;
398
  }
399
  #page-builder .placeholder {
 
400
  border: 1px dashed #bbb;
401
  float: left;
402
+ height: 43px;
403
  margin: 13px 0 0 20px;
404
  width: 300px;
405
  -webkit-box-sizing: border-box;
412
  #message.error ul li {
413
  margin-left: 20px;
414
  list-style-type: disc;
415
+ }
assets/{css → stylesheets}/aqpb_blocks.css RENAMED
@@ -97,9 +97,8 @@ DO NOT EDIT THIS
97
  /* Columns */
98
  #blocks-to-edit .block-container {
99
  padding: 4px;
100
- background: #FCFCFC;
101
  margin: 8px -5px -5px 15px;
102
- border: 1px dotted #E3E3E3;
103
  max-width: 734px;
104
  }
105
  #blocks-to-edit .block-container ul.blocks {
97
  /* Columns */
98
  #blocks-to-edit .block-container {
99
  padding: 4px;
 
100
  margin: 8px -5px -5px 15px;
101
+ border: 1px dashed #dfdfdf;
102
  max-width: 734px;
103
  }
104
  #blocks-to-edit .block-container ul.blocks {
blocks/aq-alert-block.php CHANGED
@@ -7,7 +7,7 @@ if(!class_exists('AQ_Alert_Block')) {
7
  //set and create block
8
  function __construct() {
9
  $block_options = array(
10
- 'name' => 'Alerts',
11
  'size' => 'span6',
12
  );
13
 
7
  //set and create block
8
  function __construct() {
9
  $block_options = array(
10
+ 'name' => __('Alerts', 'aqpb-l10n'),
11
  'size' => 'span6',
12
  );
13
 
blocks/aq-clear-block.php CHANGED
@@ -9,7 +9,7 @@ class AQ_Clear_Block extends AQ_Block {
9
  //set and create block
10
  function __construct() {
11
  $block_options = array(
12
- 'name' => 'Clear',
13
  'size' => 'span12',
14
  );
15
 
@@ -40,7 +40,7 @@ class AQ_Clear_Block extends AQ_Block {
40
 
41
  ?>
42
  <p class="description note">
43
- <?php _e('Use this block to clear the floats between two or more separate blocks vertically.', 'framework') ?>
44
  </p>
45
  <p class="description fourth">
46
  <label for="<?php echo $this->get_field_id('line_color') ?>">
9
  //set and create block
10
  function __construct() {
11
  $block_options = array(
12
+ 'name' => __('Clear', 'aqpb-l10n'),
13
  'size' => 'span12',
14
  );
15
 
40
 
41
  ?>
42
  <p class="description note">
43
+ <?php _e('Use this block to clear the floats between two or more separate blocks vertically.', 'aqpb-l10n') ?>
44
  </p>
45
  <p class="description fourth">
46
  <label for="<?php echo $this->get_field_id('line_color') ?>">
blocks/aq-column-block.php CHANGED
@@ -6,7 +6,7 @@ class AQ_Column_Block extends AQ_Block {
6
  function __construct() {
7
 
8
  $block_options = array(
9
- 'name' => 'Column',
10
  'size' => 'span6',
11
  );
12
 
@@ -40,7 +40,7 @@ class AQ_Column_Block extends AQ_Block {
40
 
41
  function form($instance) {
42
  echo '<p class="empty-column">',
43
- __('Drag block items into this column box', 'framework'),
44
  '</p>';
45
  echo '<ul class="blocks column-blocks cf"></ul>';
46
  }
@@ -61,7 +61,7 @@ class AQ_Column_Block extends AQ_Block {
61
  echo '<li id="template-block-'.$number.'" class="block block-container block-aq_column_block '.$size.'">',
62
  '<div class="block-settings-column cf" id="block-settings-'.$number.'">',
63
  '<p class="empty-column">',
64
- __('Drag block items into this column box', 'framework'),
65
  '</p>',
66
  '<ul class="blocks column-blocks cf">';
67
 
6
  function __construct() {
7
 
8
  $block_options = array(
9
+ 'name' => __('Column', 'aqpb-l10n'),
10
  'size' => 'span6',
11
  );
12
 
40
 
41
  function form($instance) {
42
  echo '<p class="empty-column">',
43
+ __('Drag block items into this column box', 'aqpb-l10n'),
44
  '</p>';
45
  echo '<ul class="blocks column-blocks cf"></ul>';
46
  }
61
  echo '<li id="template-block-'.$number.'" class="block block-container block-aq_column_block '.$size.'">',
62
  '<div class="block-settings-column cf" id="block-settings-'.$number.'">',
63
  '<p class="empty-column">',
64
+ __('Drag block items into this column box', 'aqpb-l10n'),
65
  '</p>',
66
  '<ul class="blocks column-blocks cf">';
67
 
blocks/{aq-richtext-block.php → aq-editor-block.php} RENAMED
@@ -1,16 +1,16 @@
1
  <?php
2
  /** A simple rich textarea block **/
3
- class AQ_Richtext_Block extends AQ_Block {
4
 
5
  //set and create block
6
  function __construct() {
7
  $block_options = array(
8
- 'name' => 'Rich Text',
9
  'size' => 'span6',
10
  );
11
 
12
  //create the block
13
- parent::__construct('aq_richtext_block', $block_options);
14
  }
15
 
16
  function form($instance) {
@@ -34,10 +34,11 @@ class AQ_Richtext_Block extends AQ_Block {
34
  Content
35
  <?php
36
  $args = array (
37
- // 'tinymce' => false,
38
- 'quicktags' => true,
 
39
  );
40
- wp_editor( htmlspecialchars_decode($text), 'aq_blocks['.$block_id.'][text]', $args );
41
  ?>
42
  </label>
43
  </p>
@@ -48,7 +49,7 @@ class AQ_Richtext_Block extends AQ_Block {
48
  function block($instance) {
49
  extract($instance);
50
 
51
- if($title) echo '<h4 class="aq-block-title">'.strip_tags($title).'</h4>';
52
  echo wpautop(do_shortcode(htmlspecialchars_decode($text)));
53
  }
54
 
1
  <?php
2
  /** A simple rich textarea block **/
3
+ class AQ_Editor_Block extends AQ_Block {
4
 
5
  //set and create block
6
  function __construct() {
7
  $block_options = array(
8
+ 'name' => __('Visual Editor', 'aqpb-l10n'),
9
  'size' => 'span6',
10
  );
11
 
12
  //create the block
13
+ parent::__construct('aq_editor_block', $block_options);
14
  }
15
 
16
  function form($instance) {
34
  Content
35
  <?php
36
  $args = array (
37
+ 'tinymce' => true,
38
+ 'quicktags' => true,
39
+ 'textarea_name' => $this->get_field_name('text')
40
  );
41
+ wp_editor( htmlspecialchars_decode($text), $this->get_field_id('text'), $args );
42
  ?>
43
  </label>
44
  </p>
49
  function block($instance) {
50
  extract($instance);
51
 
52
+ //if($title) echo '<h4 class="aq-block-title">'.strip_tags($title).'</h4>';
53
  echo wpautop(do_shortcode(htmlspecialchars_decode($text)));
54
  }
55
 
blocks/aq-tabs-block.php CHANGED
@@ -5,7 +5,7 @@ if(!class_exists('AQ_Tabs_Block')) {
5
 
6
  function __construct() {
7
  $block_options = array(
8
- 'name' => 'Tabs &amp; Toggles',
9
  'size' => 'span6',
10
  );
11
 
5
 
6
  function __construct() {
7
  $block_options = array(
8
+ 'name' => __('Tabs &amp; Toggles', 'aqpb-l10n'),
9
  'size' => 'span6',
10
  );
11
 
blocks/aq-text-block.php CHANGED
@@ -5,7 +5,7 @@ class AQ_Text_Block extends AQ_Block {
5
  //set and create block
6
  function __construct() {
7
  $block_options = array(
8
- 'name' => 'Text',
9
  'size' => 'span6',
10
  );
11
 
@@ -16,8 +16,8 @@ class AQ_Text_Block extends AQ_Block {
16
  function form($instance) {
17
 
18
  $defaults = array(
19
- 'text' => '',
20
- 'wp_autop' => 0
21
  );
22
  $instance = wp_parse_args($instance, $defaults);
23
  extract($instance);
@@ -35,11 +35,11 @@ class AQ_Text_Block extends AQ_Block {
35
  Content
36
  <?php echo aq_field_textarea('text', $block_id, $text, $size = 'full') ?>
37
  </label>
38
- <label for="<?php echo $this->get_field_id('wp_autop') ?>">
39
- <?php echo aq_field_checkbox('wp_autop', $block_id, $wp_autop) ?>
40
- Do not create the paragraphs automatically. <code>"wpautop"</code> disable.
41
  </label>
42
- </p>
43
 
44
  <?php
45
  }
5
  //set and create block
6
  function __construct() {
7
  $block_options = array(
8
+ 'name' => __('Text', 'aqpb-l10n'),
9
  'size' => 'span6',
10
  );
11
 
16
  function form($instance) {
17
 
18
  $defaults = array(
19
+ 'text' => '',
20
+ 'filter' => 0
21
  );
22
  $instance = wp_parse_args($instance, $defaults);
23
  extract($instance);
35
  Content
36
  <?php echo aq_field_textarea('text', $block_id, $text, $size = 'full') ?>
37
  </label>
38
+ <label for="<?php echo $this->get_field_id('filter') ?>">
39
+ <?php echo aq_field_checkbox('filter', $block_id, $filter) ?>
40
+ <?php _e('Automatically add paragraphs', 'aqpb-l10n') ?>
41
  </label>
42
+ </p>
43
 
44
  <?php
45
  }
blocks/aq-upload-block.php CHANGED
@@ -8,7 +8,7 @@ if(!class_exists('AQ_Upload_Block')) {
8
 
9
  function __construct() {
10
  $block_options = array(
11
- 'name' => 'Media',
12
  'size' => 'span6',
13
  );
14
 
8
 
9
  function __construct() {
10
  $block_options = array(
11
+ 'name' => __('Media', 'aqpb-l10n'),
12
  'size' => 'span6',
13
  );
14
 
blocks/aq-widgets-block.php CHANGED
@@ -4,7 +4,7 @@ class AQ_Widgets_Block extends AQ_Block {
4
 
5
  function __construct() {
6
  $block_options = array(
7
- 'name' => 'Widgets',
8
  'size' => 'span4',
9
  );
10
 
4
 
5
  function __construct() {
6
  $block_options = array(
7
+ 'name' => __('Widgets', 'aqpb-l10n'),
8
  'size' => 'span4',
9
  );
10
 
classes/class-aq-block.php CHANGED
@@ -33,7 +33,7 @@ if(!class_exists('AQ_Block')) {
33
  */
34
  function block($instance) {
35
  extract($instance);
36
- echo __('function AQ_Block::block should not be accessed directly. Output generated by the ', 'framework') . strtoupper($id_base). ' Class';
37
  }
38
 
39
  /**
@@ -54,7 +54,7 @@ if(!class_exists('AQ_Block')) {
54
  * its own block forms
55
  */
56
  function form($instance) {
57
- echo '<p class="no-options-block">' . __('There are no options for this block.', 'framework') . '</p>';
58
  return 'noform';
59
  }
60
 
@@ -133,7 +133,7 @@ if(!class_exists('AQ_Block')) {
133
  $name , $title,
134
  '</div>',
135
  '<span class="block-controls">',
136
- '<a class="block-edit" id="edit-'.$number.'" title="Edit Block" href="#block-settings-'.$number.'">Edit Block</a>',
137
  '</span>',
138
  '</dt>',
139
  '</dl>',
@@ -146,7 +146,7 @@ if(!class_exists('AQ_Block')) {
146
 
147
  $block_saving_id = 'aq_blocks[aq_block_'.$number.']';
148
 
149
- echo '<div class="block-control-actions clearfix"><a href="#" class="delete">Delete</a> | <a href="#" class="close">Close</a></div>';
150
  echo '<input type="hidden" class="id_base" name="'.$this->get_field_name('id_base').'" value="'.$id_base.'" />';
151
  echo '<input type="hidden" class="name" name="'.$this->get_field_name('name').'" value="'.$name.'" />';
152
  echo '<input type="hidden" class="order" name="'.$this->get_field_name('order').'" value="'.$order.'" />';
33
  */
34
  function block($instance) {
35
  extract($instance);
36
+ echo __('function AQ_Block::block should not be accessed directly. Output generated by the ', 'aqpb-l10n') . strtoupper($id_base). ' Class';
37
  }
38
 
39
  /**
54
  * its own block forms
55
  */
56
  function form($instance) {
57
+ echo '<p class="no-options-block">' . __('There are no options for this block.', 'aqpb-l10n') . '</p>';
58
  return 'noform';
59
  }
60
 
133
  $name , $title,
134
  '</div>',
135
  '<span class="block-controls">',
136
+ '<a class="block-edit" id="edit-'.$number.'" title="'. __('Edit Block', 'aqpb-l10n') .'" href="#block-settings-'.$number.'">'. __('Edit Block', 'aqpb-l10n') .'</a>',
137
  '</span>',
138
  '</dt>',
139
  '</dl>',
146
 
147
  $block_saving_id = 'aq_blocks[aq_block_'.$number.']';
148
 
149
+ echo '<div class="block-control-actions clearfix"><a href="#" class="delete">'. __('Delete', 'aqpb-l10n') .'</a> | <a href="#" class="close">'. __('Close', 'aqpb-l10n') .'</a></div>';
150
  echo '<input type="hidden" class="id_base" name="'.$this->get_field_name('id_base').'" value="'.$id_base.'" />';
151
  echo '<input type="hidden" class="name" name="'.$this->get_field_name('name').'" value="'.$name.'" />';
152
  echo '<input type="hidden" class="order" name="'.$this->get_field_name('order').'" value="'.$order.'" />';
classes/class-aq-page-builder.php CHANGED
@@ -14,6 +14,7 @@ if(!class_exists('AQ_Page_Builder')) {
14
 
15
  public $url = AQPB_DIR;
16
  public $config = array();
 
17
  private $admin_notices;
18
 
19
  /**
@@ -21,9 +22,9 @@ if(!class_exists('AQ_Page_Builder')) {
21
  */
22
  function __construct( $config = array()) {
23
 
24
- $defaults['menu_title'] = __('Page Builder', 'framework');
25
- $defaults['page_title'] = __('Page Builder', 'framework');
26
- $defaults['page_slug'] = __('aq-page-builder', 'framework');
27
  $defaults['debug'] = false;
28
 
29
  $this->args = wp_parse_args($config, $defaults);
@@ -32,9 +33,20 @@ if(!class_exists('AQ_Page_Builder')) {
32
  array('page' => $this->args['page_slug']),
33
  admin_url( 'themes.php' )
34
  ));
 
 
35
 
36
  }
37
 
 
 
 
 
 
 
 
 
 
38
  /**
39
  * Initialise Page Builder page and its settings
40
  *
@@ -58,7 +70,7 @@ if(!class_exists('AQ_Page_Builder')) {
58
  if(is_admin()) add_action('wp_ajax_aq_page_builder_sort_templates', array($this, 'sort_templates'));
59
 
60
  }
61
-
62
  /**
63
  * Create Admin Pages
64
  *
@@ -80,7 +92,7 @@ if(!class_exists('AQ_Page_Builder')) {
80
  */
81
  function add_admin_bar(){
82
  global $wp_admin_bar;
83
- $wp_admin_bar->add_menu( array( 'id' => 'aq-page-builder', 'parent' => 'appearance', 'title' => 'Page Builder', 'href' => admin_url('themes.php?page='.$this->args['page_slug']) ) );
84
 
85
  }
86
 
@@ -93,10 +105,10 @@ if(!class_exists('AQ_Page_Builder')) {
93
  function admin_enqueue() {
94
 
95
  // Register 'em
96
- wp_register_style( 'aqpb-css', $this->url.'assets/css/aqpb.css', array(), time(), 'all');
97
- wp_register_style( 'aqpb-blocks-css', $this->url.'assets/css/aqpb_blocks.css', array(), time(), 'all');
98
- wp_register_script('aqpb-js', $this->url . 'assets/js/aqpb.js', array('jquery'), time(), true);
99
- wp_register_script('aqpb-fields-js', $this->url . 'assets/js/aqpb-fields.js', array('jquery'), time(), true);
100
 
101
  // Enqueue 'em
102
  wp_enqueue_style('aqpb-css');
@@ -132,11 +144,11 @@ if(!class_exists('AQ_Page_Builder')) {
132
  function view_enqueue() {
133
 
134
  // front-end css
135
- wp_register_style( 'aqpb-view-css', $this->url.'assets/css/aqpb-view.css', array(), time(), 'all');
136
  wp_enqueue_style('aqpb-view-css');
137
 
138
  // front-end js
139
- wp_register_script('aqpb-view-js', $this->url . 'assets/js/aqpb-view.js', array('jquery'), time(), true);
140
  wp_enqueue_script('aqpb-view-js');
141
 
142
  //hook to register custom styles/scripts
@@ -177,7 +189,7 @@ if(!class_exists('AQ_Page_Builder')) {
177
  register_post_type( 'template', $template_args);
178
 
179
  } else {
180
- add_action('admin_notices', create_function('', "echo '<div id=\"message\" class=\"error\"><p><strong>Aqua Page Builder notice: </strong>'. __('The \"template\" post type already exists, possibly added by the theme or other plugins. Please consult with theme author to consult with this issue', 'framework') .'</p></div>';"));
181
  }
182
 
183
  }
@@ -265,7 +277,7 @@ if(!class_exists('AQ_Page_Builder')) {
265
  //return early if no blocks
266
  if(empty($blocks)) {
267
  echo '<p class="empty-template">';
268
- echo __('Drag block items from the left into this area to begin building your template.', 'framework');
269
  echo '</p>';
270
  return;
271
 
@@ -344,7 +356,61 @@ if(!class_exists('AQ_Page_Builder')) {
344
  return $template_id;
345
 
346
  }
347
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  /**
349
  * Function to update templates
350
  *
@@ -353,7 +419,7 @@ if(!class_exists('AQ_Page_Builder')) {
353
  function update_template($template_id, $blocks, $title) {
354
 
355
  //first let's check if template id is valid
356
- if(!$this->is_template($template_id)) wp_die('Error : Template id is not valid');
357
 
358
  //wp security layer
359
  check_admin_referer( 'update-template', 'update-template-nonce' );
@@ -497,7 +563,7 @@ if(!class_exists('AQ_Page_Builder')) {
497
  if(empty($blocks)) {
498
 
499
  echo '<p class="empty-template">';
500
- echo __('This template is empty', 'framework');
501
  echo '</p>';
502
 
503
  } else {
@@ -561,7 +627,7 @@ if(!class_exists('AQ_Page_Builder')) {
561
  if ( !array_key_exists( 'template', $shortcode_tags ) ) {
562
  add_shortcode( 'template', array(&$this, 'do_shortcode') );
563
  } else {
564
- add_action('admin_notices', create_function('', "echo '<div id=\"message\" class=\"error\"><p><strong>Aqua Page Builder notice: </strong>'. __('The \"[template]\" shortcode already exists, possibly added by the theme or other plugins. Please consult with the theme author to consult with this issue', 'framework') .'</p></div>';"));
565
  }
566
 
567
  }
@@ -601,11 +667,11 @@ if(!class_exists('AQ_Page_Builder')) {
601
  if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) ) {
602
 
603
  if ( version_compare( $wp_version, '3.5', '<' ) ) {
604
- $img = '<img src="' . AQPB_DIR . '/assets/images/aqua-media-button.png" width="16px" height="16px" alt="' . esc_attr__( 'Add Page Template', 'framework' ) . '" />';
605
- $output = '<a href="#TB_inline?width=640&inlineId=aqpb-iframe-container" class="thickbox" title="' . esc_attr__( 'Add Page Template', 'framework' ) . '">' . $img . '</a>';
606
  } else {
607
- $img = '<span class="wp-media-buttons-icon" style="background-image: url(' . AQPB_DIR . '/assets/images/aqua-media-button.png ); margin-top: -1px;"></span>';
608
- $output = '<a href="#TB_inline?width=640&inlineId=aqpb-iframe-container" class="thickbox button" title="' . esc_attr__( 'Add Page Template', 'framework' ) . '" style="padding-left: .4em;">' . $img . ' ' . esc_attr__( 'Add Template', 'framework' ) . '</a>';
609
  }
610
 
611
  }
@@ -642,7 +708,7 @@ if(!class_exists('AQ_Page_Builder')) {
642
 
643
  /** Alert user if there is no template selected */
644
  if ( '' == id ) {
645
- alert("<?php echo esc_js( __( 'Please select your template first!', 'framework' ) ); ?>");
646
  return;
647
  }
648
 
@@ -659,21 +725,21 @@ if(!class_exists('AQ_Page_Builder')) {
659
  <?php
660
  /** If there is no template created yet */
661
  if ( empty( $templates ) ) {
662
- echo sprintf( __( 'You don\'t have any template yet. Let\'s %s create %s one!', 'framework' ), '<a href="' .admin_url().'themes.php?page=aq-page-builder">', '</a>' );
663
- return;
664
- }
665
- ?>
666
 
667
- <h3><?php _e( 'Choose Your Page Template', 'framework' ); ?></h3><br />
668
- <select id="select-aqpb-template" style="clear: both; min-width:200px; display: inline-block; margin-right: 3em;">
669
- <?php
670
- foreach ( $templates as $template )
671
- echo '<option value="' . absint( $template->ID ) . '">' . esc_attr( $template->post_title ) . '</option>';
672
- ?>
673
- </select>
674
 
675
- <input type="button" id="aqpb-insert-template" class="button-primary" value="<?php echo esc_attr__( 'Insert Template', 'framework' ); ?>" onclick="insertTemplate();" />
676
- <a id="aqpb-cancel-template" class="button-secondary" onclick="tb_remove();" title="<?php echo esc_attr__( 'Cancel', 'framework' ); ?>"><?php echo esc_attr__( 'Cancel', 'framework' ); ?></a>
 
 
677
 
678
  <?php do_action( 'aqpb_after_iframe_display', $templates ); ?>
679
 
@@ -700,7 +766,7 @@ if(!class_exists('AQ_Page_Builder')) {
700
  $screen->set_help_sidebar(
701
  '<p><strong>' . __('For more information:') . '</strong></p>' .
702
  '<p>' . __('<a href="http://aquagraphite.com/api/documentation/aqua-page-builder" target="_blank">Documentation</a>') . '</p>' .
703
- '<p>' . __('<a href="http://aquagraphite.com/api/changelog/aqua-page-builder" target="_blank">Changelog</a>') . '</p>'
704
  );
705
 
706
  // Main overview tab
@@ -766,4 +832,4 @@ if(!class_exists('AQ_Page_Builder')) {
766
 
767
  }
768
  }
769
- // not much to say when you're high above the mucky-muck
14
 
15
  public $url = AQPB_DIR;
16
  public $config = array();
17
+ protected $version;
18
  private $admin_notices;
19
 
20
  /**
22
  */
23
  function __construct( $config = array()) {
24
 
25
+ $defaults['menu_title'] = __('Page Builder', 'aqpb-l10n');
26
+ $defaults['page_title'] = __('Page Builder', 'aqpb-l10n');
27
+ $defaults['page_slug'] = __('aqua-page-builder', 'aqpb-l10n');
28
  $defaults['debug'] = false;
29
 
30
  $this->args = wp_parse_args($config, $defaults);
33
  array('page' => $this->args['page_slug']),
34
  admin_url( 'themes.php' )
35
  ));
36
+
37
+ add_action('admin_init', array($this, 'get_version'));
38
 
39
  }
40
 
41
+ /**
42
+ * Get plugin version
43
+ *
44
+ * @since 1.1.4
45
+ */
46
+ function get_version() {
47
+ if(!defined('AQPB_VERSION')) define( 'AQPB_VERSION', aqpb_get_version() );
48
+ }
49
+
50
  /**
51
  * Initialise Page Builder page and its settings
52
  *
70
  if(is_admin()) add_action('wp_ajax_aq_page_builder_sort_templates', array($this, 'sort_templates'));
71
 
72
  }
73
+
74
  /**
75
  * Create Admin Pages
76
  *
92
  */
93
  function add_admin_bar(){
94
  global $wp_admin_bar;
95
+ $wp_admin_bar->add_menu( array( 'id' => $this->args['page_slug'], 'parent' => 'appearance', 'title' => 'Page Builder', 'href' => admin_url('themes.php?page='.$this->args['page_slug']) ) );
96
 
97
  }
98
 
105
  function admin_enqueue() {
106
 
107
  // Register 'em
108
+ wp_register_style( 'aqpb-css', $this->url.'assets/stylesheets/aqpb.css', array(), time(), 'all');
109
+ wp_register_style( 'aqpb-blocks-css', $this->url.'assets/stylesheets/aqpb_blocks.css', array(), time(), 'all');
110
+ wp_register_script('aqpb-js', $this->url . 'assets/javascripts/aqpb.js', array('jquery'), time(), true);
111
+ wp_register_script('aqpb-fields-js', $this->url . 'assets/javascripts/aqpb-fields.js', array('jquery'), time(), true);
112
 
113
  // Enqueue 'em
114
  wp_enqueue_style('aqpb-css');
144
  function view_enqueue() {
145
 
146
  // front-end css
147
+ wp_register_style( 'aqpb-view-css', $this->url.'assets/stylesheets/aqpb-view.css', array(), time(), 'all');
148
  wp_enqueue_style('aqpb-view-css');
149
 
150
  // front-end js
151
+ wp_register_script('aqpb-view-js', $this->url . 'assets/javascripts/aqpb-view.js', array('jquery'), time(), true);
152
  wp_enqueue_script('aqpb-view-js');
153
 
154
  //hook to register custom styles/scripts
189
  register_post_type( 'template', $template_args);
190
 
191
  } else {
192
+ add_action('admin_notices', create_function('', "echo '<div id=\"message\" class=\"error\"><p><strong>Aqua Page Builder notice: </strong>'. __('The \"template\" post type already exists, possibly added by the theme or other plugins. Please consult with theme author to resolve this issue', 'aqpb-l10n') .'</p></div>';"));
193
  }
194
 
195
  }
277
  //return early if no blocks
278
  if(empty($blocks)) {
279
  echo '<p class="empty-template">';
280
+ echo __('Drag block items from the left into this area to begin building your template.', 'aqpb-l10n');
281
  echo '</p>';
282
  return;
283
 
356
  return $template_id;
357
 
358
  }
359
+
360
+ /**
361
+ * Creates a new template by cloning another template
362
+ *
363
+ * @since
364
+ */
365
+ function clone_template( $template_id, $count = 1 ){
366
+
367
+ //verify template
368
+ if( !$template_id ) return;
369
+ if( !$this->is_template($template_id) ) return;
370
+
371
+ //wp security layer
372
+ check_admin_referer( 'clone-template', '_wpnonce' );
373
+
374
+ $post = get_post( $template_id );
375
+
376
+ //set up template name
377
+ $template_name = "{$post->post_title} Copy {$count}";
378
+
379
+ //create new template only if title don't yet exist
380
+ if( !get_page_by_title( $template_name, 'OBJECT', 'template' ) ) {
381
+
382
+ $arg = array(
383
+ 'post_title' => wp_strip_all_tags( $template_name ),
384
+ 'post_type' => $post->post_type,
385
+ 'post_status' => $post->post_status,
386
+ );
387
+
388
+ //create the template and get its ID
389
+ $new_template_id = wp_insert_post( $arg );
390
+
391
+ //copy post meta data
392
+ $post_meta_keys = get_post_custom_keys( $post->ID );
393
+ if( !empty($post_meta_keys) ){
394
+
395
+ foreach( $post_meta_keys as $meta_key ){
396
+ $meta_values = get_post_custom_values( $meta_key, $post->ID );
397
+ foreach( $meta_values as $meta_value ){
398
+ $meta_value = maybe_unserialize( $meta_value );
399
+ add_post_meta( $new_template_id, $meta_key, $meta_value );
400
+ }
401
+ }
402
+
403
+ }
404
+
405
+ } else {
406
+ return $this->clone_template( $template_id, $count+1 );
407
+ }
408
+
409
+ //return the new template ID
410
+ return $new_template_id;
411
+
412
+ }
413
+
414
  /**
415
  * Function to update templates
416
  *
419
  function update_template($template_id, $blocks, $title) {
420
 
421
  //first let's check if template id is valid
422
+ if(!$this->is_template($template_id)) wp_die( __('Error : Template id is not valid', 'aqpb-l10n') );
423
 
424
  //wp security layer
425
  check_admin_referer( 'update-template', 'update-template-nonce' );
563
  if(empty($blocks)) {
564
 
565
  echo '<p class="empty-template">';
566
+ echo __('This template is empty', 'aqpb-l10n');
567
  echo '</p>';
568
 
569
  } else {
627
  if ( !array_key_exists( 'template', $shortcode_tags ) ) {
628
  add_shortcode( 'template', array(&$this, 'do_shortcode') );
629
  } else {
630
+ add_action('admin_notices', create_function('', "echo '<div id=\"message\" class=\"error\"><p><strong>Aqua Page Builder notice: </strong>'. __('The \"[template]\" shortcode already exists, possibly added by the theme or other plugins. Please consult with the theme author to consult with this issue', 'aqpb-l10n') .'</p></div>';"));
631
  }
632
 
633
  }
667
  if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) ) {
668
 
669
  if ( version_compare( $wp_version, '3.5', '<' ) ) {
670
+ $img = '<img src="' . AQPB_DIR . '/assets/images/aqua-media-button.png" width="16px" height="16px" alt="' . esc_attr__( 'Add Page Template', 'aqpb-l10n' ) . '" />';
671
+ $output = '<a href="#TB_inline?width=640&inlineId=aqpb-iframe-container" class="thickbox" title="' . esc_attr__( 'Add Page Template', 'aqpb-l10n' ) . '">' . $img . '</a>';
672
  } else {
673
+ $img = '<span class="wp-media-buttons-icon" style="background-image: url(' . AQPB_DIR . '/assets/images/aqua-media-button.png ); background-repeat: no-repeat; margin-top: 1px;"></span>';
674
+ $output = '<a href="#TB_inline?width=640&inlineId=aqpb-iframe-container" class="thickbox button" title="' . esc_attr__( 'Add Page Template', 'aqpb-l10n' ) . '" style="padding-left: .4em;">' . $img . ' ' . esc_attr__( 'Add Template', 'aqpb-l10n' ) . '</a>';
675
  }
676
 
677
  }
708
 
709
  /** Alert user if there is no template selected */
710
  if ( '' == id ) {
711
+ alert("<?php echo esc_js( __( 'Please select your template first!', 'aqpb-l10n' ) ); ?>");
712
  return;
713
  }
714
 
725
  <?php
726
  /** If there is no template created yet */
727
  if ( empty( $templates ) ) {
728
+ echo sprintf( __( 'You don\'t have any template yet. Let\'s %s create %s one!', 'aqpb-l10n' ), '<a href="' .admin_url().'themes.php?page=aqua-page-builder">', '</a>' );
729
+ } else { ?>
 
 
730
 
731
+ <h3><?php _e( 'Choose Your Page Template', 'aqpb-l10n' ); ?></h3><br />
732
+ <select id="select-aqpb-template" style="clear: both; min-width:200px; display: inline-block; margin-right: 3em;">
733
+ <?php
734
+ foreach ( $templates as $template )
735
+ echo '<option value="' . absint( $template->ID ) . '">' . esc_attr( $template->post_title ) . '</option>';
736
+ ?>
737
+ </select>
738
 
739
+ <input type="button" id="aqpb-insert-template" class="button-primary" value="<?php echo esc_attr__( 'Insert Template', 'aqpb-l10n' ); ?>" onclick="insertTemplate();" />
740
+ <a id="aqpb-cancel-template" class="button-secondary" onclick="tb_remove();" title="<?php echo esc_attr__( 'Cancel', 'aqpb-l10n' ); ?>"><?php echo esc_attr__( 'Cancel', 'aqpb-l10n' ); ?></a>
741
+
742
+ <?php } ?>
743
 
744
  <?php do_action( 'aqpb_after_iframe_display', $templates ); ?>
745
 
766
  $screen->set_help_sidebar(
767
  '<p><strong>' . __('For more information:') . '</strong></p>' .
768
  '<p>' . __('<a href="http://aquagraphite.com/api/documentation/aqua-page-builder" target="_blank">Documentation</a>') . '</p>' .
769
+ '<p>' . __('<a href="https://wordpress.org/plugins/aqua-page-builder/changelog/" target="_blank">Changelog</a>') . '</p>'
770
  );
771
 
772
  // Main overview tab
832
 
833
  }
834
  }
835
+ // not much to say when you're high above the mucky-muck
classes/class-aq-plugin-updater.php DELETED
@@ -1,138 +0,0 @@
1
- <?php
2
- /**
3
- * @legacy
4
- * AQ_Plugin_Updater Class
5
- *
6
- * Request for any later version of the plugin available
7
- * on Github. Downloads it if user chose to update
8
- *
9
- * @author Syamil MJ <http://aquagraphite.com>
10
- */
11
-
12
- // Take over the update check
13
- if(!class_exists('AQ_Plugin_Updater')) {
14
- class AQ_Plugin_Updater {
15
- function __construct($config = array()) {
16
-
17
- $defaults = array(
18
- 'api_url' => 'http://aquagraphite.com/api/',
19
- 'slug' => '',
20
- 'filename' => ''
21
- );
22
-
23
- $this->args = wp_parse_args($config, $defaults);
24
-
25
- if(empty($this->args['slug']) || empty($this->args['filename'])) return false;
26
-
27
- //hook filters
28
- add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
29
- add_filter('plugins_api', array($this, 'plugin_api_call'), 10, 3);
30
- add_filter('upgrader_post_install', array($this, 'upgrader_post_install'), 10, 3 );
31
-
32
- }
33
-
34
- function check_update($checked_data) {
35
- global $wp_version;
36
-
37
- if (empty($checked_data->checked)) {
38
- return $checked_data;//Comment out this line during testing.
39
- }
40
-
41
- $args = array(
42
- 'slug' => $this->args['slug'],
43
- 'version' => $checked_data->checked[$this->args['slug'] .'/'. $this->args['filename']],
44
- );
45
-
46
- $request_string = array(
47
- 'body' => array(
48
- 'action' => 'basic_check',
49
- 'request' => json_encode($args),
50
- 'site-url' => site_url()
51
- ),
52
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . site_url(),
53
- 'timeout' => 30,
54
- 'redirection' => 0
55
- );
56
-
57
- // Start checking for an update
58
- $raw_response = wp_remote_post($this->args['api_url'], $request_string);
59
-
60
- // Process update data
61
- if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200))
62
- $response = json_decode($raw_response['body']);
63
-
64
- // Feed the update data into WP updater
65
- if (isset($response) && is_object($response) && !empty($response))
66
- $checked_data->response[$this->args['slug'] .'/'. $this->args['filename']] = $response;
67
-
68
- return $checked_data;
69
- }
70
-
71
- /**
72
- * API Call
73
- *
74
- * Handles the Plugin API Call
75
- */
76
- function plugin_api_call($defaults, $action, $args) {
77
- global $wp_version;
78
-
79
- if (!isset($args->slug) || $args->slug != $this->args['slug'])
80
- return false;
81
-
82
- // Get the current version
83
- $plugin_info = get_site_transient('update_plugins');
84
- $current_version = $plugin_info->checked[$this->args['slug'] .'/'. $this->args['filename']];
85
- $args->version = $current_version;
86
-
87
- $request_string = array(
88
- 'body' => array(
89
- 'action' => $action,
90
- 'request' => json_encode($args),
91
- 'site-url' => site_url()
92
- ),
93
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . site_url(),
94
- 'timeout' => 30,
95
- 'redirection' => 0
96
- );
97
-
98
- $request = wp_remote_post($this->args['api_url'], $request_string);
99
-
100
- if (is_wp_error($request)) {
101
- $result = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>', 'framework'), $request->get_error_message());
102
- } else {
103
- $result = unserialize($request['body']);
104
- if ($result === false) {
105
- $result = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']);
106
- }
107
- }
108
- return $result;
109
- }
110
-
111
- /**
112
- * Hook that move, rename & install the unzipped plugin
113
- */
114
- function upgrader_post_install( $true, $hook_extra, $result ) {
115
- global $wp_filesystem;
116
-
117
- if( isset($hook_extra['plugin']) && stristr($hook_extra['plugin'], $this->args['slug']) ) {
118
-
119
- echo '<p>' . __('Correcting plugin folder name & activating plugin...', 'framework') .'</p>';
120
-
121
- // Move & Activate
122
- $proper_destination = WP_PLUGIN_DIR.'/'.$this->args['slug'] .'/';
123
- $wp_filesystem->move( $result['destination'], $proper_destination );
124
- $result['destination'] = $proper_destination;
125
- $activate = activate_plugin( $proper_destination .$this->args['filename'] );
126
-
127
- // Output the update message
128
- $fail = __('The plugin has been updated, but could not be reactivated. Please reactivate it manually.', 'framework');
129
- $success = __('Plugin reactivated successfully.', 'framework');
130
- echo is_wp_error( $activate ) ? $fail : $success;
131
-
132
- }
133
-
134
- return $result;
135
-
136
- }
137
- }
138
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
functions/aqpb_blocks.php CHANGED
@@ -219,7 +219,7 @@ function aq_block_widgets($block) {
219
 
220
  function aq_block_column($block) {
221
  echo '<p class="empty-column">',
222
- __('Drag block items into this box', 'framework'),
223
  '</p>';
224
  echo '<ul class="blocks column-blocks cf"></ul>';
225
  }
219
 
220
  function aq_block_column($block) {
221
  echo '<p class="empty-column">',
222
+ __('Drag block items into this box', 'aqpb-l10n'),
223
  '</p>';
224
  echo '<ul class="blocks column-blocks cf"></ul>';
225
  }
functions/aqpb_config.php CHANGED
@@ -11,16 +11,16 @@ function aq_page_builder_config() {
11
  $config = array(); //initialise array
12
 
13
  /* Page Config */
14
- $config['menu_title'] = __('Page Builder', 'framework');
15
- $config['page_title'] = __('Page Builder', 'framework');
16
- $config['page_slug'] = __('aq-page-builder', 'framework');
17
 
18
  /* This holds the contextual help text - the more info, the better.
19
  * HTML is of course allowed in all of its glory! */
20
  $config['contextual_help'] =
21
- '<p>' . __('The page builder allows you to create custom page templates which you can later use for your pages.', 'framework') . '<p>' .
22
- '<p>' . __('To use the page builder, start by adding a new template. You can drag and drop the blocks on the left into the building area on the right of the screen. Each block has its own unique configuration which you can manually configure to suit your needs', 'framework') . '<p>' .
23
- '<p>' . __('Please refer to the', 'framework') . '<a href="http://aquagraphite.com/api/documentation/aqua-page-builder" target="_blank" alt="Aqua Page Builder Documentation">'. __(' documentation page ', 'framework') . '</a>'. __('for more information on how to use this feature.', 'framework') . '<p>';
24
 
25
  /* Debugging */
26
  $config['debug'] = false;
11
  $config = array(); //initialise array
12
 
13
  /* Page Config */
14
+ $config['menu_title'] = __('Page Builder', 'aqpb-l10n');
15
+ $config['page_title'] = __('Page Builder', 'aqpb-l10n');
16
+ $config['page_slug'] = __('aqua-page-builder', 'aqpb-l10n');
17
 
18
  /* This holds the contextual help text - the more info, the better.
19
  * HTML is of course allowed in all of its glory! */
20
  $config['contextual_help'] =
21
+ '<p>' . __('The page builder allows you to create custom page templates which you can later use for your pages.', 'aqpb-l10n') . '<p>' .
22
+ '<p>' . __('To use the page builder, start by adding a new template. You can drag and drop the blocks on the left into the building area on the right of the screen. Each block has its own unique configuration which you can manually configure to suit your needs', 'aqpb-l10n') . '<p>' .
23
+ '<p>' . __('Please refer to the', 'aqpb-l10n') . '<a href="http://aquagraphite.com/api/documentation/aqua-page-builder" target="_blank" alt="Aqua Page Builder Documentation">'. __(' documentation page ', 'aqpb-l10n') . '</a>'. __('for more information on how to use this feature.', 'aqpb-l10n') . '<p>';
24
 
25
  /* Debugging */
26
  $config['debug'] = false;
languages/default.mo ADDED
Binary file
languages/default.po ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Aqua Page Builder\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-07-21 04:00+0730\n"
6
+ "PO-Revision-Date: 2014-07-21 04:00+0730\n"
7
+ "Last-Translator: Syamil MJ <sy4mil@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.4\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-KeywordsList: __;_e;_x\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+ "X-Poedit-SearchPath-1: .\n"
18
+
19
+ #: ../blocks/aq-clear-block.php:43
20
+ msgid "Use this block to clear the floats between two or more separate blocks vertically."
21
+ msgstr ""
22
+
23
+ #: ../blocks/aq-column-block.php:43
24
+ #: ../blocks/aq-column-block.php:64
25
+ msgid "Drag block items into this column box"
26
+ msgstr ""
27
+
28
+ #: ../blocks/aq-text-block.php:40
29
+ msgid "Automatically add paragraphs"
30
+ msgstr ""
31
+
32
+ #: ../classes/class-aq-block.php:36
33
+ msgid "function AQ_Block::block should not be accessed directly. Output generated by the "
34
+ msgstr ""
35
+
36
+ #: ../classes/class-aq-block.php:57
37
+ msgid "There are no options for this block."
38
+ msgstr ""
39
+
40
+ #: ../classes/class-aq-page-builder.php:25
41
+ #: ../classes/class-aq-page-builder.php:26
42
+ #: ../functions/aqpb_config.php:14
43
+ #: ../functions/aqpb_config.php:15
44
+ msgid "Page Builder"
45
+ msgstr ""
46
+
47
+ #: ../classes/class-aq-page-builder.php:27
48
+ #: ../functions/aqpb_config.php:16
49
+ msgid "aqua-page-builder"
50
+ msgstr ""
51
+
52
+ #: ../classes/class-aq-page-builder.php:280
53
+ msgid "Drag block items from the left into this area to begin building your template."
54
+ msgstr ""
55
+
56
+ #: ../classes/class-aq-page-builder.php:566
57
+ msgid "This template is empty"
58
+ msgstr ""
59
+
60
+ #: ../classes/class-aq-page-builder.php:711
61
+ msgid "Please select your template first!"
62
+ msgstr ""
63
+
64
+ #: ../classes/class-aq-page-builder.php:728
65
+ #, php-format
66
+ msgid "You don't have any template yet. Let's %s create %s one!"
67
+ msgstr ""
68
+
69
+ #: ../classes/class-aq-page-builder.php:731
70
+ msgid "Choose Your Page Template"
71
+ msgstr ""
72
+
73
+ #: ../classes/class-aq-page-builder.php:767
74
+ msgid "For more information:"
75
+ msgstr ""
76
+
77
+ #: ../classes/class-aq-page-builder.php:768
78
+ msgid "<a href=\"http://aquagraphite.com/api/documentation/aqua-page-builder\" target=\"_blank\">Documentation</a>"
79
+ msgstr ""
80
+
81
+ #: ../classes/class-aq-page-builder.php:769
82
+ msgid "<a href=\"https://wordpress.org/plugins/aqua-page-builder/changelog/\" target=\"_blank\">Changelog</a>"
83
+ msgstr ""
84
+
85
+ #: ../classes/class-aq-page-builder.php:775
86
+ msgid "Overview"
87
+ msgstr ""
88
+
89
+ #: ../functions/aqpb_blocks.php:222
90
+ msgid "Drag block items into this box"
91
+ msgstr ""
92
+
93
+ #: ../functions/aqpb_config.php:21
94
+ msgid "The page builder allows you to create custom page templates which you can later use for your pages."
95
+ msgstr ""
96
+
97
+ #: ../functions/aqpb_config.php:22
98
+ msgid "To use the page builder, start by adding a new template. You can drag and drop the blocks on the left into the building area on the right of the screen. Each block has its own unique configuration which you can manually configure to suit your needs"
99
+ msgstr ""
100
+
101
+ #: ../functions/aqpb_config.php:23
102
+ msgid "Please refer to the"
103
+ msgstr ""
104
+
105
+ #: ../functions/aqpb_config.php:23
106
+ msgid " documentation page "
107
+ msgstr ""
108
+
109
+ #: ../functions/aqpb_config.php:23
110
+ msgid "for more information on how to use this feature."
111
+ msgstr ""
112
+
113
+ #: ../view/view-builder-page.php:19
114
+ msgid "Cheatin&#8217; uh?"
115
+ msgstr ""
116
+
117
+ #: ../view/view-builder-page.php:67
118
+ #: ../view/view-builder-page.php:91
119
+ #: ../view/view-builder-page.php:114
120
+ msgid "The "
121
+ msgstr ""
122
+
123
+ #: ../view/view-builder-page.php:67
124
+ msgid " page template has been successfully created"
125
+ msgstr ""
126
+
127
+ #: ../view/view-builder-page.php:75
128
+ #: ../view/view-builder-page.php:99
129
+ msgid "Sorry, the operation was unsuccessful for the following reason(s): "
130
+ msgstr ""
131
+
132
+ #: ../view/view-builder-page.php:91
133
+ msgid " template has been successfully cloned"
134
+ msgstr ""
135
+
136
+ #: ../view/view-builder-page.php:114
137
+ msgid " page template has been updated"
138
+ msgstr ""
139
+
140
+ #: ../view/view-builder-page.php:126
141
+ msgid "The template has been successfully deleted"
142
+ msgstr ""
143
+
144
+ #: ../view/view-builder-page.php:155
145
+ msgid "Select a template to edit:"
146
+ msgstr ""
147
+
148
+ #: ../view/view-builder-page.php:160
149
+ msgid "-- Select --"
150
+ msgstr ""
151
+
152
+ #: ../view/view-builder-page.php:179
153
+ msgid "or"
154
+ msgstr ""
155
+
156
+ #: ../view/view-builder-page.php:192
157
+ msgid "Create a new template"
158
+ msgstr ""
159
+
160
+ #: ../view/view-builder-page.php:199
161
+ msgid "Create your new template below"
162
+ msgstr ""
163
+
164
+ #: ../view/view-builder-page.php:209
165
+ msgid "Available Blocks"
166
+ msgstr ""
167
+
168
+ #: ../view/view-builder-page.php:209
169
+ msgid "Deleting"
170
+ msgstr ""
171
+
172
+ #: ../view/view-builder-page.php:232
173
+ msgid "Template Name"
174
+ msgstr ""
175
+
176
+ #: ../view/view-builder-page.php:233
177
+ msgid "Enter template name here"
178
+ msgstr ""
179
+
180
+ #: ../view/view-builder-page.php:241
181
+ msgid "Create Template"
182
+ msgstr ""
183
+
184
+ #: ../view/view-builder-page.php:241
185
+ #: ../view/view-builder-page.php:320
186
+ msgid "Save Template"
187
+ msgstr ""
188
+
189
+ #: ../view/view-builder-page.php:266
190
+ msgid ""
191
+ "To create a custom page template, give it a name above and click Create Template. Then choose blocks like text, widgets or tabs &amp; toggles from the left column to add to this template.\n"
192
+ "\t\t\t\t\t\t\t\t\t<br/><br/>\n"
193
+ "\t\t\t\t\t\t\t\t\tYou can drag and drop the blocks to put them in the order you want. Click on the small arrow at the corner of each block to reveal additional configuration options. You can also resize each block by clicking on either side of the block (Note that some blocks are not resizable)\n"
194
+ "\t\t\t\t\t\t\t\t\t<br/><br/>\n"
195
+ "\t\t\t\t\t\t\t\t\tWhen you have finished building your custom page template, make sure you click the Save Template button."
196
+ msgstr ""
197
+
198
+ #: ../view/view-builder-page.php:297
199
+ msgid "Delete Template"
200
+ msgstr ""
201
+
202
+ #: ../view/view-builder-page.php:312
203
+ msgid "Clone Template"
204
+ msgstr ""
205
+
readme.txt CHANGED
@@ -4,9 +4,9 @@ Plugin URI: http://aquagraphite.com/2012/10/aqua-page-builder/
4
  Contributors: syamilmj
5
  Tags: page builder, aquagraphite, syamil mj
6
  Requires at least: 3.3
7
- Tested up to: 3.6
8
 
9
- Stable Tag: 1.1.2
10
  License: GNU Version 2 or Any Later Version
11
 
12
 
@@ -41,7 +41,7 @@ More information at [Aquagraphite.com](http://aquagraphite.com/2012/10/aqua-page
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
 
@@ -49,12 +49,25 @@ Please see our [Wiki](https://github.com/sy4mil/Aqua-Page-Builder/wiki) section
49
 
50
  == Screenshots ==
51
 
52
- 1. Screenshot 1
53
- 2. Screenshot 2
54
- 3. Screenshot 3
55
 
56
  == Changelog ==
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  = 1.1.2: August 5, 2013 =
59
 
60
  * DEL - Removed unused legacy files
4
  Contributors: syamilmj
5
  Tags: page builder, aquagraphite, syamil mj
6
  Requires at least: 3.3
7
+ Tested up to: 3.9.1
8
 
9
+ Stable Tag: 1.1.4
10
  License: GNU Version 2 or Any Later Version
11
 
12
 
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](https://github.com/syamilmj/Aqua-Page-Builder/wiki/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
 
49
 
50
  == Screenshots ==
51
 
52
+ 1. Main page builder panel
53
+ 2. Available blocks. You can easily extend these to include your own
54
+ 3. Simple button to insert page templates shortcode inside the post editor
55
 
56
  == Changelog ==
57
 
58
+ = 1.1.4: July 21, 2014
59
+
60
+ * NEW - Visual editor
61
+ * NEW - Template Manager
62
+ * NEW - Clone template
63
+ * IMP - UI/UX Minor revamps
64
+ * NEW - Localization
65
+
66
+ = 1.1.3: June 2014
67
+
68
+ * FIX - Various bug & CSS Fixes
69
+ * FIX - Compatibility with WP 3.8+
70
+
71
  = 1.1.2: August 5, 2013 =
72
 
73
  * DEL - Removed unused legacy files
view/view-builder-page.php CHANGED
@@ -64,7 +64,7 @@ switch($action) {
64
  $templates = $this->get_templates();
65
  $selected_template_object = get_post($selected_template_id);
66
 
67
- $messages[] = '<div id="message" class="updated"><p>' . __('The ', 'framework') . '<strong>' . $template_name . '</strong>' . __(' page template has been successfully created', 'framework') . '</p></div>';
68
  } else {
69
  $errors = '<ul>';
70
  foreach( $new_id->get_error_messages() as $error ) {
@@ -72,11 +72,35 @@ switch($action) {
72
  }
73
  $errors .= '</ul>';
74
 
75
- $messages[] = '<div id="message" class="error"><p>' . __('Sorry, the operation was unsuccessful for the following reason(s): ', 'framework') . '</p>' . $errors . '</div>';
76
  }
77
 
78
  break;
 
 
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  case 'update' :
81
 
82
  $blocks = isset($_REQUEST['aq_blocks']) ? $_REQUEST['aq_blocks'] : '';
@@ -87,7 +111,7 @@ switch($action) {
87
  $templates = $this->get_templates();
88
  $selected_template_object = get_post($selected_template_id);
89
 
90
- $messages[] = '<div id="message" class="updated"><p>' . __('The ', 'framework') . '<strong>' . $template_name . '</strong>' . __(' page template has been updated', 'framework') . '</p></div>';
91
  break;
92
 
93
  case 'delete' :
@@ -99,7 +123,7 @@ switch($action) {
99
  $selected_template_id = !empty($templates) ? $templates[0]->ID : 0;
100
  $selected_template_object = get_post($selected_template_id);
101
 
102
- $messages[] = '<div id="message" class="updated"><p>' . __('The template has been successfully deleted', 'framework') . '</p></div>';
103
  break;
104
  }
105
 
@@ -117,85 +141,96 @@ $disabled = $selected_template_id === 0 ? 'metabox-holder-disabled' : '';
117
  <div class="wrap">
118
  <div id="icon-themes" class="icon32"><br/></div>
119
  <h2><?php echo $this->args['page_title'] ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
 
121
  <div id="page-builder-frame">
122
 
123
  <div id="page-builder-column" class="metabox-holder <?php echo $disabled ?>">
124
  <div id="page-builder-archive" class="postbox">
125
- <h3 class="hndle"><span><?php _e('Available Blocks', 'framework') ?></span><span id="removing-block"><?php _e('Deleting', 'framework') ?></span></h3>
126
  <div class="inside">
127
  <ul id="blocks-archive" class="cf">
128
  <?php $this->blocks_archive() ?>
129
  </ul>
130
- <p><?php _e('Need help? Use the Help tab in the upper right of your screen.', 'framework') ?></p>
131
  </div>
132
  </div>
133
- </div>
134
 
135
  <div id="page-builder-fixed">
 
136
  <div id="page-builder">
137
- <div class="aqpb-tabs-nav">
138
 
139
- <div class="aqpb-tabs-arrow aqpb-tabs-arrow-left">
140
- <a>&laquo;</a>
141
- </div>
142
-
143
- <div class="aqpb-tabs-wrapper">
144
- <div class="aqpb-tabs">
145
-
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',
155
- 'template' => $template->ID,
156
- ),
157
- admin_url( 'themes.php' )
158
- )) . '">'. htmlspecialchars($template->post_title) .'</a>';
159
- }
160
- }
161
- ?>
162
-
163
- <!--add new template button-->
164
- <?php if($selected_template_id == 0) { ?>
165
- <span class="aqpb-tab aqpb-tab-add aqpb-tab-active"><abbr title="Add Template">+</abbr></span>
166
- <?php } else { ?>
167
- <a class="aqpb-tab aqpb-tab-add" href="<?php
168
- echo esc_url(add_query_arg(
169
- array(
170
- 'page' => $this->args['page_slug'],
171
- 'action' => 'edit',
172
- 'template' => 0,
173
- ),
174
- admin_url( 'themes.php' )
175
- ));
176
- ?>">
177
- <abbr title="Add Template">+</abbr>
178
- </a>
179
- <?php } ?>
180
-
181
- </div>
182
- </div>
183
-
184
- <div class="aqpb-tabs-arrow aqpb-tabs-arrow-right">
185
- <a>&raquo;</a>
186
- </div>
187
-
188
- </div>
189
  <div class="aqpb-wrap aqpbdiv">
 
190
  <form id="update-page-template" action="<?php echo $this->args['page_url'] ?>" method="post" enctype="multipart/form-data">
 
191
  <div id="aqpb-header">
192
 
193
  <div id="submitpost" class="submitbox">
194
  <div class="major-publishing-actions cf">
195
 
196
- <label class="open-label" for="template-name">
197
- <span><?php _e('Template Name', 'framework') ?></span>
198
- <input name="template-name" id="template-name" type="text" class="template-name regular-text" title="Enter template name here" placeholder="Enter template name here" value="<?php echo is_object($selected_template_object) ? $selected_template_object->post_title : ''; ?>">
199
  </label>
200
 
201
  <div id="template-shortcode">
@@ -203,25 +238,9 @@ $disabled = $selected_template_id === 0 ? 'metabox-holder-disabled' : '';
203
  </div>
204
 
205
  <div class="publishing-action">
206
- <?php submit_button( empty( $selected_template_id ) ? __( 'Create Template', 'framework' ) : __( 'Save Template', 'framework' ), 'button-primary ', 'save_template', false, array( 'id' => 'save_template_header' ) ); ?>
207
  </div><!-- END .publishing-action -->
208
 
209
- <?php if(!empty($selected_template_id)) { ?>
210
- <div class="delete-action">
211
- <?php
212
- echo '<a class="submitdelete deletion template-delete" href="' . esc_url(add_query_arg(
213
- array(
214
- 'page' => $this->args['page_slug'],
215
- 'action' => 'delete',
216
- 'template' => $selected_template_id,
217
- '_wpnonce' => wp_create_nonce('delete-template'),
218
- ),
219
- admin_url( 'themes.php' )
220
- )) . '">'. __('Delete Template', 'framework') .'</a>';
221
- ?>
222
- </div><!-- END .delete-action -->
223
- <?php } ?>
224
-
225
  </div><!-- END .major-publishing-actions -->
226
  </div><!-- END #submitpost .submitbox -->
227
 
@@ -248,7 +267,7 @@ $disabled = $selected_template_id === 0 ? 'metabox-holder-disabled' : '';
248
  <br/><br/>
249
  You can drag and drop the blocks to put them in the order you want. Click on the small arrow at the corner of each block to reveal additional configuration options. You can also resize each block by clicking on either side of the block (Note that some blocks are not resizable)
250
  <br/><br/>
251
- When you have finished building your custom page template, make sure you click the Save Template button.', 'framework');
252
  echo '</p>';
253
 
254
 
@@ -258,26 +277,64 @@ $disabled = $selected_template_id === 0 ? 'metabox-holder-disabled' : '';
258
  ?>
259
  </ul>
260
 
261
- </div>
262
 
263
  <div id="aqpb-footer">
 
264
  <div class="major-publishing-actions cf">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  <div class="publishing-action">
266
  <?php if(!empty($selected_template_id)) {
267
  submit_button( __( 'Save Template' ), 'button-primary ', 'save_template', false, array( 'id' => 'save_template_footer' ) );
268
  } ?>
269
  </div><!-- END .publishing-action -->
270
  </div><!-- END .major-publishing-actions -->
271
- </div>
272
-
273
- </div>
274
- </form>
 
 
 
275
  </div>
276
- <p style="float:left"><small>Aqua Page Builder &copy; 2012 by <a href="http://aquagraphite.com">Syamil MJ</a></small></p>
 
277
  <p style="float:right"><small>Version <?php echo AQPB_VERSION ?></small></p>
278
 
279
  </div>
280
 
281
 
282
  </div>
283
- </div>
64
  $templates = $this->get_templates();
65
  $selected_template_object = get_post($selected_template_id);
66
 
67
+ $messages[] = '<div id="message" class="updated"><p>' . __('The ', 'aqpb-l10n') . '<strong>' . $template_name . '</strong>' . __(' page template has been successfully created', 'aqpb-l10n') . '</p></div>';
68
  } else {
69
  $errors = '<ul>';
70
  foreach( $new_id->get_error_messages() as $error ) {
72
  }
73
  $errors .= '</ul>';
74
 
75
+ $messages[] = '<div id="message" class="error"><p>' . __('Sorry, the operation was unsuccessful for the following reason(s): ', 'aqpb-l10n') . '</p>' . $errors . '</div>';
76
  }
77
 
78
  break;
79
+
80
+ case 'clone' :
81
 
82
+ $new_id = $this->clone_template( $selected_template_id );
83
+
84
+ if(!is_wp_error($new_id)) {
85
+ $selected_template_id = $new_id;
86
+
87
+ //refresh templates var
88
+ $templates = $this->get_templates();
89
+ $selected_template_object = get_post($selected_template_id);
90
+
91
+ $messages[] = '<div id="message" class="updated"><p>' . __('The ', 'aqpb-l10n') . '<strong>' . $template_name . '</strong>' . __(' template has been successfully cloned', 'aqpb-l10n') . '</p></div>';
92
+ } else {
93
+ $errors = '<ul>';
94
+ foreach( $new_id->get_error_messages() as $error ) {
95
+ $errors .= '<li><strong>'. $error . '</strong></li>';
96
+ }
97
+ $errors .= '</ul>';
98
+
99
+ $messages[] = '<div id="message" class="error"><p>' . __('Sorry, the operation was unsuccessful for the following reason(s): ', 'aqpb-l10n') . '</p>' . $errors . '</div>';
100
+ }
101
+
102
+ break;
103
+
104
  case 'update' :
105
 
106
  $blocks = isset($_REQUEST['aq_blocks']) ? $_REQUEST['aq_blocks'] : '';
111
  $templates = $this->get_templates();
112
  $selected_template_object = get_post($selected_template_id);
113
 
114
+ $messages[] = '<div id="message" class="updated"><p>' . __('The ', 'aqpb-l10n') . '<strong>' . $template_name . '</strong>' . __(' page template has been updated', 'aqpb-l10n') . '</p></div>';
115
  break;
116
 
117
  case 'delete' :
123
  $selected_template_id = !empty($templates) ? $templates[0]->ID : 0;
124
  $selected_template_object = get_post($selected_template_id);
125
 
126
+ $messages[] = '<div id="message" class="updated"><p>' . __('The template has been successfully deleted', 'aqpb-l10n') . '</p></div>';
127
  break;
128
  }
129
 
141
  <div class="wrap">
142
  <div id="icon-themes" class="icon32"><br/></div>
143
  <h2><?php echo $this->args['page_title'] ?></h2>
144
+
145
+ <div id="manage-templates" class="manage-templates">
146
+
147
+ <?php if($templates) { ?>
148
+
149
+ <form method="get" action="<?php echo admin_url('themes.php') ?>" >
150
+
151
+ <input type="hidden" name="page" value="<?php echo $this->args['page_slug'] ?>">
152
+ <input type="hidden" name="action" value="edit">
153
+
154
+ <label for="template">
155
+ <?php _e('Select a template to edit:', 'aqpb-l10n') ?>
156
+
157
+ <select name="template" id="">
158
+
159
+ <?php if($selected_template_id === 0) { ?>
160
+ <option value="0" selected="selected"><?php _e('-- Select --', 'aqpb-l10n') ?></option>
161
+ <?php } ?>
162
+
163
+ <?php
164
+ foreach ( (array) $templates as $template ) {
165
+ $selected = selected( $selected_template_id, $template->ID, false );
166
+
167
+ echo '<option value="'. $template->ID .'" '. $selected .'>'. htmlspecialchars($template->post_title) .'</option>';
168
+ }
169
+ ?>
170
+ </select>
171
+
172
+ </label>
173
+
174
+ <span class="submit-btn">
175
+ <input type="submit" class="button-secondary" value="select">
176
+ </span>
177
+
178
+ <span class="add-new-template-action">
179
+ <?php _e('or', 'aqpb-l10n') ?>
180
+
181
+ <a href="
182
+ <?php
183
+ echo esc_url(add_query_arg(
184
+ array(
185
+ 'page' => $this->args['page_slug'],
186
+ 'action' => 'edit',
187
+ 'template' => 0,
188
+ ),
189
+ admin_url( 'themes.php' )
190
+ ));
191
+ ?>
192
+ "><?php _e('Create a new template', 'aqpb-l10n') ?></a>
193
+ </span>
194
+
195
+ </form>
196
+
197
+ <?php } else { ?>
198
+ <span class="add-new-template-action">
199
+ <?php _e('Create your new template below', 'aqpb-l10n') ?>
200
+ </span>
201
+ <?php } ?>
202
+
203
+ </div>
204
 
205
  <div id="page-builder-frame">
206
 
207
  <div id="page-builder-column" class="metabox-holder <?php echo $disabled ?>">
208
  <div id="page-builder-archive" class="postbox">
209
+ <h3 class="hndle"><span><?php _e('Available Blocks', 'aqpb-l10n') ?></span><span id="removing-block"><?php _e('Deleting', 'aqpb-l10n') ?></span></h3>
210
  <div class="inside">
211
  <ul id="blocks-archive" class="cf">
212
  <?php $this->blocks_archive() ?>
213
  </ul>
 
214
  </div>
215
  </div>
216
+ </div><!-- END #page-builder-column -->
217
 
218
  <div id="page-builder-fixed">
219
+
220
  <div id="page-builder">
 
221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  <div class="aqpb-wrap aqpbdiv">
223
+
224
  <form id="update-page-template" action="<?php echo $this->args['page_url'] ?>" method="post" enctype="multipart/form-data">
225
+
226
  <div id="aqpb-header">
227
 
228
  <div id="submitpost" class="submitbox">
229
  <div class="major-publishing-actions cf">
230
 
231
+ <label class="open-label howto" for="template-name">
232
+ <span><?php _e('Template Name', 'aqpb-l10n') ?></span>
233
+ <input name="template-name" id="template-name" type="text" class="template-name regular-text" title="Enter template name here" placeholder="<?php _e('Enter template name here', 'aqpb-l10n') ?>" value="<?php echo is_object($selected_template_object) ? $selected_template_object->post_title : ''; ?>">
234
  </label>
235
 
236
  <div id="template-shortcode">
238
  </div>
239
 
240
  <div class="publishing-action">
241
+ <?php submit_button( empty( $selected_template_id ) ? __( 'Create Template', 'aqpb-l10n' ) : __( 'Save Template', 'aqpb-l10n' ), 'button-primary ', 'save_template', false, array( 'id' => 'save_template_header' ) ); ?>
242
  </div><!-- END .publishing-action -->
243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  </div><!-- END .major-publishing-actions -->
245
  </div><!-- END #submitpost .submitbox -->
246
 
267
  <br/><br/>
268
  You can drag and drop the blocks to put them in the order you want. Click on the small arrow at the corner of each block to reveal additional configuration options. You can also resize each block by clicking on either side of the block (Note that some blocks are not resizable)
269
  <br/><br/>
270
+ When you have finished building your custom page template, make sure you click the Save Template button.', 'aqpb-l10n');
271
  echo '</p>';
272
 
273
 
277
  ?>
278
  </ul>
279
 
280
+ </div><!-- END #aqpb-body -->
281
 
282
  <div id="aqpb-footer">
283
+
284
  <div class="major-publishing-actions cf">
285
+
286
+ <?php if(!empty($selected_template_id)) { ?>
287
+ <div class="delete-action">
288
+ <?php
289
+ echo '<a class="submitdelete deletion template-delete" href="' . esc_url(add_query_arg(
290
+ array(
291
+ 'page' => $this->args['page_slug'],
292
+ 'action' => 'delete',
293
+ 'template' => $selected_template_id,
294
+ '_wpnonce' => wp_create_nonce('delete-template'),
295
+ ),
296
+ admin_url( 'themes.php' )
297
+ )) . '">'. __('Delete Template', 'aqpb-l10n') .'</a>';
298
+ ?>
299
+ </div><!-- END .delete-action -->
300
+
301
+ <div class="clone-action">
302
+ <?php
303
+ echo '<a class="submitclone cloning template-clone" href="' . esc_url(add_query_arg(
304
+ array(
305
+ 'page' => $this->args['page_slug'],
306
+ 'action' => 'clone',
307
+ 'template' => $selected_template_id,
308
+ 'template-name' => is_object($selected_template_object) ? urlencode($selected_template_object->post_title) : '',
309
+ '_wpnonce' => wp_create_nonce('clone-template'),
310
+ ),
311
+ admin_url( 'themes.php' )
312
+ )) . '">'. __('Clone Template', 'aqpb-l10n') .'</a>';
313
+ ?>
314
+ </div><!-- END .clone-action -->
315
+
316
+ <?php } ?>
317
+
318
  <div class="publishing-action">
319
  <?php if(!empty($selected_template_id)) {
320
  submit_button( __( 'Save Template' ), 'button-primary ', 'save_template', false, array( 'id' => 'save_template_footer' ) );
321
  } ?>
322
  </div><!-- END .publishing-action -->
323
  </div><!-- END .major-publishing-actions -->
324
+
325
+ </div><!-- END #aqpb-footer -->
326
+
327
+ </form>
328
+
329
+ </div>
330
+
331
  </div>
332
+
333
+ <p style="float:left"><small>Aqua Page Builder &copy; <?php echo date("Y") ?> by <a href="http://aquagraphite.com">Syamil MJ</a></small></p>
334
  <p style="float:right"><small>Version <?php echo AQPB_VERSION ?></small></p>
335
 
336
  </div>
337
 
338
 
339
  </div>
340
+ </div>