Gantry 4 Framework - Version 4.1.13

Version Description

  • Fix regression in widget rendering on non-existing positions
  • PHP 7 compatibility fixes
Download this release

Release Info

Developer gantry
Plugin Icon 128x128 Gantry 4 Framework
Version 4.1.13
Comparing to
See all releases

Code changes from version 4.1.12 to 4.1.13

MD5SUMS CHANGED
@@ -23,7 +23,7 @@ admin/forms/groups/enabledgroup.php 574b7dd6859f828515f84a61d3aed86f
23
  admin/forms/groups/set.php 92ac32997332c6f5d30567ac3c6f2eb5
24
  admin/forms/groups/selectedset.php e936838ffeea2f0464a3bc5898f83898
25
  admin/forms/groups/innertabs.php 1105f67378892b36e6bc2e44bb577961
26
- admin/forms/groups/position.php 8ea18b18cb3331adfba0b8f838cb758d
27
  admin/forms/groups/index.html d41d8cd98f00b204e9800998ecf8427e
28
  admin/forms/groups/chain.php 37164259e94bac3a407f7bfd9c4b55f4
29
  admin/forms/fields/text.php f2f04e3a9e929d0105abdd9444656a8a
@@ -33,21 +33,21 @@ admin/forms/fields/ajaxbutton.php 424216d45459379f7290978cc6a860cb
33
  admin/forms/fields/overlays.php b6dafd51867e32e7ad4293a03657ed0c
34
  admin/forms/fields/list.php 5897d4aea8b9458c9a6f72e609fc9258
35
  admin/forms/fields/radio.php fc75d589a1c8dbaaba1b16b1c176d47e
36
- admin/forms/fields/imagepicker.php 91b15faf551b67a411657fff06cb1a3b
37
  admin/forms/fields/diagnostic.php c62bbbb9367694327db630b283004f99
38
  admin/forms/fields/selectbox.php b171e3b831aa9dc5654ea8e8716cc96f
39
  admin/forms/fields/slider.php 817b84ba04595320e764c722415a86f1
40
  admin/forms/fields/showmax.php 376d461787ae52de33f5f3ceb198c677
41
  admin/forms/fields/preset.php c309588457906f0a74e27e329b05af7c
42
  admin/forms/fields/gradient.php e4eae90839617d7687cabf53695769bd
43
- admin/forms/fields/updater.php c2d23608c943d13c1f1a27cfd13d96f2
44
  admin/forms/fields/html.php d71542f12c964fb0323a74343f38fc5e
45
  admin/forms/fields/imagelist.php 52e1d8ae003c498c0d15021d9f68d840
46
  admin/forms/fields/alias.php 2aacc555a0e309439e7b9ea467ecfafc
47
  admin/forms/fields/password.php 1ec7a40ead7d2514b272e4e34caba0b4
48
  admin/forms/fields/spacer.php e42d6de15d7f539d4fb835535448b3e1
49
  admin/forms/fields/integer.php aa3caba08c98654cfc54a10908b4214a
50
- admin/forms/fields/position.php e7aa42b31573c6ddc12086891a310de8
51
  admin/forms/fields/groupedlist.php 0317193b333409487996cc30aba9af29
52
  admin/forms/fields/index.html d41d8cd98f00b204e9800998ecf8427e
53
  admin/forms/fields/gantry.php 0cd2ac15bc27da4253b5da2db4ae8579
@@ -91,7 +91,7 @@ admin/widgets/colorchooser/images/moor_arrows.png 4edbf4fedcedde96754d74921e39d6
91
  admin/widgets/colorchooser/images/chooser-back.png f243df6677d7ea2a9cc8268b530f1ff9
92
  admin/widgets/colorchooser/images/moor_cursor.gif 031ecf9ba2ddbbf8b18f06a4aa15f79e
93
  admin/widgets/colorchooser/index.html d41d8cd98f00b204e9800998ecf8427e
94
- admin/widgets/colorchooser/css/mooRainbow-2.0.css 617e8be4afe01480ce310f822fe917cd
95
  admin/widgets/colorchooser/css/index.html d41d8cd98f00b204e9800998ecf8427e
96
  admin/widgets/colorchooser/css/mooRainbow.css 6fa2f91acbb0dc6bddc651efd1987a62
97
  admin/widgets/colorchooser/css/mooRainbow-2.0.less 73a8fa09c524c091892d5bcc0bf25597
@@ -413,24 +413,24 @@ core/config/gantryformfieldhelper.class.php fe96f17ae445bb87386ed0fd1351e802
413
  core/config/gantryparameters.class.php f2ea3eb4607193810b81e74d629f6ef1
414
  core/config/gantryformitem.class.php d82179063c2e26a3991a4360fd499241
415
  core/gantrybodylayout.class.php 42636cbecd49811943840120bf0130e7
416
- core/gantry.class.php 8806fbf058607f3e994fd9e37a20efca
417
  core/gantrycommentstempllayout.class.php af10a703f2ccde84403dba0fa0646a52
418
  core/gantrygizmo.class.php 8875b68927d9b9ab2257114949531ecd
419
  core/gantrygzipper.class.php 32cd05d1198786f5c7b74c722a46b772
420
  core/utilities/gantryxml.class.php 7b75e07708b907a37be839cb135cd34d
421
- core/utilities/gantrycache.class.php 1ba126b0aebf285fd5489bb13a65ca17
422
  core/utilities/gantrylesscompiler.class.php 82d9009ff946c9276cf072fdc76acc9c
423
  core/utilities/gantryregistry.class.php 5b8dc9df5b07d1039085c0b75684222b
424
  core/utilities/registry/index.html d41d8cd98f00b204e9800998ecf8427e
425
  core/utilities/registry/format/php.php 7de51a528756788cb76906f92bcd9dc3
426
  core/utilities/registry/format/index.html e33782263166ab59da260384f21fd4fb
427
  core/utilities/registry/format/xml.php 0e4418361f580dfaffe1098241332826
428
- core/utilities/registry/format/ini.php 2f458253d6d90baabac46178c3f84bb9
429
  core/utilities/registry/format/json.php c68eec90308a803b36f13ff01d3fa115
430
  core/utilities/registry/gantryregistryformat.class.php a678537bcf6e42be55995bbcce8c4c10
431
  core/utilities/gantryurl.class.php 132f6cdb97ac1a3ac8c301f2ea865b4a
432
  core/utilities/gantryarrayhelper.class.php d86f3308d2fc9ded15792dcb5b3bd807
433
- core/utilities/gantryfilterinput.class.php 07c080a54eb9b650a0d9686d63d3dc6f
434
  core/utilities/gantryfolder.class.php ea8b083244885bda951e2a4a0e618620
435
  core/utilities/index.html d41d8cd98f00b204e9800998ecf8427e
436
  core/utilities/gantryfile.class.php 573fde9e466cf8430f39943345deddbc
@@ -446,8 +446,8 @@ core/utilities/cache/cacheDriver.interface.php f85269b1435867c94c01cec73442c4da
446
  core/utilities/cache/fileCacheDriver.class.php 2449d36968ed9c4236db0712948f50c5
447
  core/gantryparams.class.php 4465944287490b7a16b1d6e66c895ebc
448
  core/gantrytemplate.class.php 303cf991aba454a696461cd281ac4593
449
- core/gantryjson.class.php a53550be49294132092f72c77539b3ac
450
- core/gantryini.class.php 81b0d5039cca445c1e13b79fbc927e52
451
  core/params/gantryparamprocessor.class.php 61609a69bf9b5b0e59a8229bda1e0312
452
  core/params/overrides/gantryurlparamoverride.class.php 6c91077f8d6984f9d1e7007fab8869b1
453
  core/params/overrides/gantryoverrideparamoverride.class.php 6968de732b67983244dc0c3cf505368a
@@ -486,7 +486,7 @@ core/renderers/gantrymainbodyrenderer.class.php 2d22b562abc09148a4834dd708dad152
486
  core/renderers/index.html d41d8cd98f00b204e9800998ecf8427e
487
  core/renderers/gantryorderedmainbodyrenderer.class.php 9dde3a14d51e03ea45258ef8b03505c3
488
  core/renderers/gantrycommentsrenderer.class.php 07b456dda4b32587c811ecdfab9fac98
489
- core/renderers/gantrywidgetsrenderer.class.php a95d9f043095b13c7f4b02a2135da3fa
490
  core/renderers/gantrydebugmainbodyrenderer.class.php b5158892c9bfdce72617f026a39581de
491
  core/gantrywidget.class.php efc08a520072ede87fc222d87b60a9e5
492
  core/gantrylayout.class.php b5611f845f2db4bd619bdf12fd9fb168
@@ -529,12 +529,12 @@ libs/google-code-prettify/lang-vhdl.js 1a5853df113e37f58cc5e2f2806c6b5b
529
  libs/google-code-prettify/lang-lisp.js 71ac79ad50ec3fed97fa82ea945f3551
530
  libs/google-code-prettify/lang-css.js 96ce256446c4669341f32da15f4787e4
531
  libs/google-code-prettify/lang-erlang.js 9e367311ee53e21158a8ae7522b35d18
532
- libs/phpQuery.php 5358b8aef52bc139d630d39b9e7097fa
533
- gantry.php 83c538d008bf59316391ae08e606eef9
534
  tmpl/index-iphone.php a6c699ab31f1858848a412ebb7a5684c
535
  tmpl/index.html d41d8cd98f00b204e9800998ecf8427e
536
  MD5SUMS d41d8cd98f00b204e9800998ecf8427e
537
- functions.php 83e0060a8b023e4891875e716d8268d6
538
  html/comments.php 7a9d141db65e95bfbfbf9178b15b42e1
539
  html/layouts/chrome_standard.php 785b6f2032cf267d68bc6887a712a42b
540
  html/layouts/doc_body.php 99fa2491b76d6f2a3ddffc4fd12c623d
@@ -572,18 +572,18 @@ widgets/recentposts.xml d60f230153a08bba049068ffba7ca15c
572
  widgets/loginform.xml 26fa1e26d597161f1f33668207926411
573
  widgets/overridesmap.xml d062edbe62fc8cd15c269d164da74dfc
574
  widgets/viewswitcher.xml d9158524afde20931b4e3b54417840f7
575
- widgets/loginform.php 8aa5e9b27c28682a7102413655066ba2
576
  widgets/copyright.php 5da4bf1f8067937fbbbb254d9077cd50
577
  widgets/resetsettings.php adae93737b215cf9836550fc44503e18
578
  widgets/meta.xml f77c2a19fa5fe6b95576704774959eec
579
  widgets/fontsizer.xml 77afbf9a3700b10ad9a83d262796cf7b
580
- widgets/breadcrumbs.php 26d8767322e28dec9663a7c92b812e69
581
  widgets/categories.xml 125aeda3d4d31f8d7cb4af4c914570c8
582
  widgets/logo.php cb76749e0fd1950337e0b7764bb8c81a
583
  widgets/totop.xml ce222afe1834fb12e6340143ede72bb2
584
  widgets/date.php 5753ef220912518bb3df4e11766b0748
585
  widgets/recentcomments.xml 9560a0123f311b0ea6fb281ca638af44
586
- widgets/loginbutton.php 1768ac18e3150b8687aec89c482cf3a3
587
  widgets/pages.php 778c3427151550b227cff03686601123
588
  widgets/resetsettings.xml 300de5950affc376a9fb46d242478ee6
589
  widgets/date.xml 47cc13a501097b9d3a002c0929c6b71d
@@ -650,7 +650,7 @@ widgets/menu.php 3fbb9e719137e904b73fdde9f34cc6e9
650
  widgets/breadcrumbs.xml 25a46c0a7b1c1c129c91d34cc44be439
651
  widgets/divider.php 56fcd2b4bb795c235f4ae5b6ad424e64
652
  widgets/loginbutton.xml 6747ca3b33dc84874e5cfb560753e554
653
- readme.txt 1137325141955c67219bc455ea3b9183
654
  plugin-updater/.gitkeep d41d8cd98f00b204e9800998ecf8427e
655
  CHANGELOG.php 22a3b7590d705f7aa2778c433baa00bd
656
  bugfixes.php d8b02eee01734d82e245a63ea05db714
23
  admin/forms/groups/set.php 92ac32997332c6f5d30567ac3c6f2eb5
24
  admin/forms/groups/selectedset.php e936838ffeea2f0464a3bc5898f83898
25
  admin/forms/groups/innertabs.php 1105f67378892b36e6bc2e44bb577961
26
+ admin/forms/groups/position.php 59a8231ec05735821aaf96c2532d114d
27
  admin/forms/groups/index.html d41d8cd98f00b204e9800998ecf8427e
28
  admin/forms/groups/chain.php 37164259e94bac3a407f7bfd9c4b55f4
29
  admin/forms/fields/text.php f2f04e3a9e929d0105abdd9444656a8a
33
  admin/forms/fields/overlays.php b6dafd51867e32e7ad4293a03657ed0c
34
  admin/forms/fields/list.php 5897d4aea8b9458c9a6f72e609fc9258
35
  admin/forms/fields/radio.php fc75d589a1c8dbaaba1b16b1c176d47e
36
+ admin/forms/fields/imagepicker.php e589429b75154a11c2248a3d2296b8a5
37
  admin/forms/fields/diagnostic.php c62bbbb9367694327db630b283004f99
38
  admin/forms/fields/selectbox.php b171e3b831aa9dc5654ea8e8716cc96f
39
  admin/forms/fields/slider.php 817b84ba04595320e764c722415a86f1
40
  admin/forms/fields/showmax.php 376d461787ae52de33f5f3ceb198c677
41
  admin/forms/fields/preset.php c309588457906f0a74e27e329b05af7c
42
  admin/forms/fields/gradient.php e4eae90839617d7687cabf53695769bd
43
+ admin/forms/fields/updater.php f24e8d767c9bb24e43b4c55b9460bfaf
44
  admin/forms/fields/html.php d71542f12c964fb0323a74343f38fc5e
45
  admin/forms/fields/imagelist.php 52e1d8ae003c498c0d15021d9f68d840
46
  admin/forms/fields/alias.php 2aacc555a0e309439e7b9ea467ecfafc
47
  admin/forms/fields/password.php 1ec7a40ead7d2514b272e4e34caba0b4
48
  admin/forms/fields/spacer.php e42d6de15d7f539d4fb835535448b3e1
49
  admin/forms/fields/integer.php aa3caba08c98654cfc54a10908b4214a
50
+ admin/forms/fields/position.php 48966e0a374a23ab17d4227fcf8f26d2
51
  admin/forms/fields/groupedlist.php 0317193b333409487996cc30aba9af29
52
  admin/forms/fields/index.html d41d8cd98f00b204e9800998ecf8427e
53
  admin/forms/fields/gantry.php 0cd2ac15bc27da4253b5da2db4ae8579
91
  admin/widgets/colorchooser/images/chooser-back.png f243df6677d7ea2a9cc8268b530f1ff9
92
  admin/widgets/colorchooser/images/moor_cursor.gif 031ecf9ba2ddbbf8b18f06a4aa15f79e
93
  admin/widgets/colorchooser/index.html d41d8cd98f00b204e9800998ecf8427e
94
+ admin/widgets/colorchooser/css/mooRainbow-2.0.css 90b03412d5b15671fbd76de56a2370a9
95
  admin/widgets/colorchooser/css/index.html d41d8cd98f00b204e9800998ecf8427e
96
  admin/widgets/colorchooser/css/mooRainbow.css 6fa2f91acbb0dc6bddc651efd1987a62
97
  admin/widgets/colorchooser/css/mooRainbow-2.0.less 73a8fa09c524c091892d5bcc0bf25597
413
  core/config/gantryparameters.class.php f2ea3eb4607193810b81e74d629f6ef1
414
  core/config/gantryformitem.class.php d82179063c2e26a3991a4360fd499241
415
  core/gantrybodylayout.class.php 42636cbecd49811943840120bf0130e7
416
+ core/gantry.class.php 43a5c0a1b0c469c130f6f2034a94500c
417
  core/gantrycommentstempllayout.class.php af10a703f2ccde84403dba0fa0646a52
418
  core/gantrygizmo.class.php 8875b68927d9b9ab2257114949531ecd
419
  core/gantrygzipper.class.php 32cd05d1198786f5c7b74c722a46b772
420
  core/utilities/gantryxml.class.php 7b75e07708b907a37be839cb135cd34d
421
+ core/utilities/gantrycache.class.php a154cf9e8f84cbd5fb55dd9ded4433c0
422
  core/utilities/gantrylesscompiler.class.php 82d9009ff946c9276cf072fdc76acc9c
423
  core/utilities/gantryregistry.class.php 5b8dc9df5b07d1039085c0b75684222b
424
  core/utilities/registry/index.html d41d8cd98f00b204e9800998ecf8427e
425
  core/utilities/registry/format/php.php 7de51a528756788cb76906f92bcd9dc3
426
  core/utilities/registry/format/index.html e33782263166ab59da260384f21fd4fb
427
  core/utilities/registry/format/xml.php 0e4418361f580dfaffe1098241332826
428
+ core/utilities/registry/format/ini.php d81ec9b797b1e06fef9e2f39c43523c0
429
  core/utilities/registry/format/json.php c68eec90308a803b36f13ff01d3fa115
430
  core/utilities/registry/gantryregistryformat.class.php a678537bcf6e42be55995bbcce8c4c10
431
  core/utilities/gantryurl.class.php 132f6cdb97ac1a3ac8c301f2ea865b4a
432
  core/utilities/gantryarrayhelper.class.php d86f3308d2fc9ded15792dcb5b3bd807
433
+ core/utilities/gantryfilterinput.class.php e9e1e262ed482b4bbaca16ae59dd734b
434
  core/utilities/gantryfolder.class.php ea8b083244885bda951e2a4a0e618620
435
  core/utilities/index.html d41d8cd98f00b204e9800998ecf8427e
436
  core/utilities/gantryfile.class.php 573fde9e466cf8430f39943345deddbc
446
  core/utilities/cache/fileCacheDriver.class.php 2449d36968ed9c4236db0712948f50c5
447
  core/gantryparams.class.php 4465944287490b7a16b1d6e66c895ebc
448
  core/gantrytemplate.class.php 303cf991aba454a696461cd281ac4593
449
+ core/gantryjson.class.php 98938258b3e3c36c60a255feb48e2f97
450
+ core/gantryini.class.php 2b3abc6e72ce8fb6d448bf94a6a2364b
451
  core/params/gantryparamprocessor.class.php 61609a69bf9b5b0e59a8229bda1e0312
452
  core/params/overrides/gantryurlparamoverride.class.php 6c91077f8d6984f9d1e7007fab8869b1
453
  core/params/overrides/gantryoverrideparamoverride.class.php 6968de732b67983244dc0c3cf505368a
486
  core/renderers/index.html d41d8cd98f00b204e9800998ecf8427e
487
  core/renderers/gantryorderedmainbodyrenderer.class.php 9dde3a14d51e03ea45258ef8b03505c3
488
  core/renderers/gantrycommentsrenderer.class.php 07b456dda4b32587c811ecdfab9fac98
489
+ core/renderers/gantrywidgetsrenderer.class.php e6d16a8159940be515aee5a6e43fde7f
490
  core/renderers/gantrydebugmainbodyrenderer.class.php b5158892c9bfdce72617f026a39581de
491
  core/gantrywidget.class.php efc08a520072ede87fc222d87b60a9e5
492
  core/gantrylayout.class.php b5611f845f2db4bd619bdf12fd9fb168
529
  libs/google-code-prettify/lang-lisp.js 71ac79ad50ec3fed97fa82ea945f3551
530
  libs/google-code-prettify/lang-css.js 96ce256446c4669341f32da15f4787e4
531
  libs/google-code-prettify/lang-erlang.js 9e367311ee53e21158a8ae7522b35d18
532
+ libs/phpQuery.php b695114cb978209633afb889171c0d3b
533
+ gantry.php eafc887a7c1cfdd2c36da1dc12fc2a25
534
  tmpl/index-iphone.php a6c699ab31f1858848a412ebb7a5684c
535
  tmpl/index.html d41d8cd98f00b204e9800998ecf8427e
536
  MD5SUMS d41d8cd98f00b204e9800998ecf8427e
537
+ functions.php ec16d074dbcf3cbc1b8c66ef455f064e
538
  html/comments.php 7a9d141db65e95bfbfbf9178b15b42e1
539
  html/layouts/chrome_standard.php 785b6f2032cf267d68bc6887a712a42b
540
  html/layouts/doc_body.php 99fa2491b76d6f2a3ddffc4fd12c623d
572
  widgets/loginform.xml 26fa1e26d597161f1f33668207926411
573
  widgets/overridesmap.xml d062edbe62fc8cd15c269d164da74dfc
574
  widgets/viewswitcher.xml d9158524afde20931b4e3b54417840f7
575
+ widgets/loginform.php b988b70350a7ff324e41f11f81fe1c42
576
  widgets/copyright.php 5da4bf1f8067937fbbbb254d9077cd50
577
  widgets/resetsettings.php adae93737b215cf9836550fc44503e18
578
  widgets/meta.xml f77c2a19fa5fe6b95576704774959eec
579
  widgets/fontsizer.xml 77afbf9a3700b10ad9a83d262796cf7b
580
+ widgets/breadcrumbs.php 44442e3157a94003e7249c43e5a0a201
581
  widgets/categories.xml 125aeda3d4d31f8d7cb4af4c914570c8
582
  widgets/logo.php cb76749e0fd1950337e0b7764bb8c81a
583
  widgets/totop.xml ce222afe1834fb12e6340143ede72bb2
584
  widgets/date.php 5753ef220912518bb3df4e11766b0748
585
  widgets/recentcomments.xml 9560a0123f311b0ea6fb281ca638af44
586
+ widgets/loginbutton.php 257a1113f1d2c854285065e86b94ca63
587
  widgets/pages.php 778c3427151550b227cff03686601123
588
  widgets/resetsettings.xml 300de5950affc376a9fb46d242478ee6
589
  widgets/date.xml 47cc13a501097b9d3a002c0929c6b71d
650
  widgets/breadcrumbs.xml 25a46c0a7b1c1c129c91d34cc44be439
651
  widgets/divider.php 56fcd2b4bb795c235f4ae5b6ad424e64
652
  widgets/loginbutton.xml 6747ca3b33dc84874e5cfb560753e554
653
+ readme.txt d8f83a0ecc78b060dbd5e97537abf280
654
  plugin-updater/.gitkeep d41d8cd98f00b204e9800998ecf8427e
655
  CHANGELOG.php 22a3b7590d705f7aa2778c433baa00bd
656
  bugfixes.php d8b02eee01734d82e245a63ea05db714
admin/forms/fields/imagepicker.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version 4.1.12 June 29, 2017
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  <?php
2
  /**
3
+ * @version 4.1.13 July 5, 2017
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
admin/forms/fields/position.php CHANGED
@@ -43,10 +43,7 @@ class GantryFormFieldPosition extends GantryFormFieldSelectBox
43
  $options = array();
44
  foreach ($positions as $position) {
45
  $positionInfo = $gantry->getPositionInfo($position);
46
- if (!$positionInfo) {
47
- continue;
48
- }
49
- if ($hide_mobile && $positionInfo->mobile) {
50
  continue;
51
  }
52
 
43
  $options = array();
44
  foreach ($positions as $position) {
45
  $positionInfo = $gantry->getPositionInfo($position);
46
+ if ($hide_mobile && $positionInfo && $positionInfo->mobile) {
 
 
 
47
  continue;
48
  }
49
 
admin/forms/fields/updater.php CHANGED
@@ -27,7 +27,7 @@ class GantryFormFieldUpdater extends GantryFormField
27
 
28
  $currentVersion = GANTRY_VERSION;
29
 
30
- if ($currentVersion == "\4.1.12") $currentVersion = "[DEV]";
31
 
32
  // curl check
33
  if (!function_exists('curl_version')) {
27
 
28
  $currentVersion = GANTRY_VERSION;
29
 
30
+ if ($currentVersion == "\4.1.13") $currentVersion = "[DEV]";
31
 
32
  // curl check
33
  if (!function_exists('curl_version')) {
admin/forms/groups/position.php CHANGED
@@ -22,9 +22,6 @@ class GantryFormGroupPosition extends GantryFormGroup
22
  global $gantry;
23
  $clean_name = (string)$this->element['name'];
24
  $position_info = $gantry->getPositionInfo($clean_name);
25
- if (!$position_info) {
26
- return '';
27
- }
28
 
29
  $buffer = "<div class='wrapper'>\n";
30
  foreach ($this->fields as $field) {
22
  global $gantry;
23
  $clean_name = (string)$this->element['name'];
24
  $position_info = $gantry->getPositionInfo($clean_name);
 
 
 
25
 
26
  $buffer = "<div class='wrapper'>\n";
27
  foreach ($this->fields as $field) {
admin/widgets/colorchooser/css/mooRainbow-2.0.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * @version 4.1.12 June 29, 2017
3
  * @author RocketTheme http://www.rockettheme.com
4
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
5
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  /**
2
+ * @version 4.1.13 July 5, 2017
3
  * @author RocketTheme http://www.rockettheme.com
4
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
5
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
core/gantry.class.php CHANGED
@@ -1056,7 +1056,7 @@ class Gantry
1056
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1057
  }
1058
  $filename = strtolower(basename($path, '.css')) . rand(0, 1000);
1059
- wp_enqueue_style($filename, $path, array(), '4.1.12');
1060
  $deps[] = $path;
1061
  }
1062
  }
@@ -1069,11 +1069,11 @@ class Gantry
1069
  if ($this->baseUrl != "/") {
1070
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1071
  }
1072
- wp_enqueue_script($path, $path, $deps, '4.1.12');
1073
  $deps[] = $path;
1074
  }
1075
  foreach ($this->_header_full_scripts as $strSrc) {
1076
- wp_enqueue_script($strSrc, $strSrc, $deps, '4.1.12');
1077
  $deps[] = $strSrc;
1078
  }
1079
 
@@ -1113,11 +1113,11 @@ class Gantry
1113
  if ($this->baseUrl != "/") {
1114
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1115
  }
1116
- wp_enqueue_script($path, $path, $deps, '4.1.12', true);
1117
  $deps[] = $path;
1118
  }
1119
  foreach ($this->_footer_full_scripts as $strSrc) {
1120
- wp_enqueue_script($strSrc, $strSrc, $deps, '4.1.12', true);
1121
  $deps[] = $strSrc;
1122
  }
1123
 
@@ -1765,7 +1765,7 @@ class Gantry
1765
  if (!defined('GANTRY_FINALIZED')) {
1766
  $this->_styles[$priority][] = $link;
1767
  } else {
1768
- wp_enqueue_style($link->getUrl(), $link->getUrl(), array(), '4.1.12');
1769
  }
1770
  }
1771
  }
@@ -1879,7 +1879,7 @@ class Gantry
1879
  $this->_footerscripts[$full_path] = $check_url_path . $query_string;
1880
  }
1881
  } else {
1882
- wp_enqueue_script($check_url_path, $check_url_path, array(), '4.1.12', $in_footer);
1883
  }
1884
  break;
1885
  }
@@ -1917,7 +1917,7 @@ class Gantry
1917
  $this->_footerscripts[$check_path] = $check_url_path . $query_string;
1918
  }
1919
  } else {
1920
- wp_enqueue_script($check_url_path, $check_url_path, array(), '4.1.12', $in_footer);
1921
  }
1922
  break(2);
1923
  }
1056
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1057
  }
1058
  $filename = strtolower(basename($path, '.css')) . rand(0, 1000);
1059
+ wp_enqueue_style($filename, $path, array(), '4.1.13');
1060
  $deps[] = $path;
1061
  }
1062
  }
1069
  if ($this->baseUrl != "/") {
1070
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1071
  }
1072
+ wp_enqueue_script($path, $path, $deps, '4.1.13');
1073
  $deps[] = $path;
1074
  }
1075
  foreach ($this->_header_full_scripts as $strSrc) {
1076
+ wp_enqueue_script($strSrc, $strSrc, $deps, '4.1.13');
1077
  $deps[] = $strSrc;
1078
  }
1079
 
1113
  if ($this->baseUrl != "/") {
1114
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1115
  }
1116
+ wp_enqueue_script($path, $path, $deps, '4.1.13', true);
1117
  $deps[] = $path;
1118
  }
1119
  foreach ($this->_footer_full_scripts as $strSrc) {
1120
+ wp_enqueue_script($strSrc, $strSrc, $deps, '4.1.13', true);
1121
  $deps[] = $strSrc;
1122
  }
1123
 
1765
  if (!defined('GANTRY_FINALIZED')) {
1766
  $this->_styles[$priority][] = $link;
1767
  } else {
1768
+ wp_enqueue_style($link->getUrl(), $link->getUrl(), array(), '4.1.13');
1769
  }
1770
  }
1771
  }
1879
  $this->_footerscripts[$full_path] = $check_url_path . $query_string;
1880
  }
1881
  } else {
1882
+ wp_enqueue_script($check_url_path, $check_url_path, array(), '4.1.13', $in_footer);
1883
  }
1884
  break;
1885
  }
1917
  $this->_footerscripts[$check_path] = $check_url_path . $query_string;
1918
  }
1919
  } else {
1920
+ wp_enqueue_script($check_url_path, $check_url_path, array(), '4.1.13', $in_footer);
1921
  }
1922
  break(2);
1923
  }
core/gantryini.class.php CHANGED
@@ -285,7 +285,7 @@ class GantryINI
285
  }
286
  }
287
 
288
- $inistocache[$hash] = clone($obj);
289
  return $obj;
290
  }
291
 
285
  }
286
  }
287
 
288
+ $inistocache[$hash] = clone $obj;
289
  return $obj;
290
  }
291
 
core/gantryjson.class.php CHANGED
@@ -321,8 +321,8 @@ class GantryJSON
321
  break;
322
  default :
323
  $result = null;
324
- $tmp = '';
325
- preg_replace('/^(\-)?([0-9]+)(\.[0-9]+)?([eE]\+[0-9]+)?/e', '$tmp = "\\1\\2\\3\\4"', substr($encode, $pos));
326
  if ($tmp !== '') {
327
  $pos += strlen($tmp);
328
  $nint = intval($tmp);
321
  break;
322
  default :
323
  $result = null;
324
+ $tmp = preg_replace('/^(\-)?([0-9]+)(\.[0-9]+)?([eE]\+[0-9]+)?/', '\\1\\2\\3\\4', substr($encode, $pos));
325
+
326
  if ($tmp !== '') {
327
  $pos += strlen($tmp);
328
  $nint = intval($tmp);
core/renderers/gantrywidgetsrenderer.class.php CHANGED
@@ -30,11 +30,7 @@ class GantryWidgetsRenderer
30
  global $wp_registered_sidebars, $wp_registered_widgets;
31
 
32
  $position_info = $gantry->getPositionInfo($positionStub);
33
- if (!$position_info) {
34
- return "";
35
- }
36
-
37
- $max_positions = $position_info->max_positions;
38
 
39
  $output = '';
40
  $index = 0;
@@ -205,8 +201,7 @@ class GantryWidgetsRenderer
205
  foreach ($sidebars_widgets as $sidebar => $widgets) {
206
  if ($sidebar == "wp_inactive_widgets" || strpos($sidebar,'orphaned_widgets_') === 0) continue;
207
  $position_info = $gantry->getPositionInfo($sidebar);
208
- if (!$position_info) continue;
209
- $max_positions = $position_info->max_positions;
210
  $position_count = 1;
211
  if (count($widgets) > 0) {
212
  $showAllParam = $gantry->get($sidebar . '-showall');
30
  global $wp_registered_sidebars, $wp_registered_widgets;
31
 
32
  $position_info = $gantry->getPositionInfo($positionStub);
33
+ $max_positions = $position_info ? $position_info->max_positions : null;
 
 
 
 
34
 
35
  $output = '';
36
  $index = 0;
201
  foreach ($sidebars_widgets as $sidebar => $widgets) {
202
  if ($sidebar == "wp_inactive_widgets" || strpos($sidebar,'orphaned_widgets_') === 0) continue;
203
  $position_info = $gantry->getPositionInfo($sidebar);
204
+ $max_positions = $position_info ? $position_info->max_positions : null;
 
205
  $position_count = 1;
206
  if (count($widgets) > 0) {
207
  $showAllParam = $gantry->get($sidebar . '-showall');
core/utilities/gantrycache.class.php CHANGED
@@ -26,7 +26,7 @@ class GantryCache
26
  /**
27
  *
28
  */
29
- const ADMIN_GROUP_NAME = 'GantryAdmin-4.1.12';
30
 
31
  const ADMIN_LIFETIME = 86400;
32
 
@@ -122,7 +122,7 @@ class GantryCache
122
  $this->cache->addDriver('frontend', new WpTransientCacheDriver($this->group, $this->lifetime));
123
  } elseif (is_admin()) {
124
  // TODO get lifetime for backend cache
125
- $this->group = self::ADMIN_GROUP_NAME . '-4.1.12';
126
  $this->cache->addDriver('admin', new WpTransientCacheDriver($this->group, self::ADMIN_LIFETIME));
127
  }
128
  }
26
  /**
27
  *
28
  */
29
+ const ADMIN_GROUP_NAME = 'GantryAdmin-4.1.13';
30
 
31
  const ADMIN_LIFETIME = 86400;
32
 
122
  $this->cache->addDriver('frontend', new WpTransientCacheDriver($this->group, $this->lifetime));
123
  } elseif (is_admin()) {
124
  // TODO get lifetime for backend cache
125
+ $this->group = self::ADMIN_GROUP_NAME . '-4.1.13';
126
  $this->cache->addDriver('admin', new WpTransientCacheDriver($this->group, self::ADMIN_LIFETIME));
127
  }
128
  }
core/utilities/gantryfilterinput.class.php CHANGED
@@ -521,9 +521,17 @@ class GantryFilterInput
521
  }
522
  $source = strtr($source, $ttr);
523
  // convert decimal
524
- $source = preg_replace('/&#(\d+);/me', "utf8_encode(chr(\\1))", $source); // decimal notation
 
 
 
 
525
  // convert hex
526
- $source = preg_replace('/&#x([a-f0-9]+);/mei', "utf8_encode(chr(0x\\1))", $source); // hex notation
 
 
 
 
527
  return $source;
528
  }
529
  }
521
  }
522
  $source = strtr($source, $ttr);
523
  // convert decimal
524
+ $source = preg_replace_callback(
525
+ '/&#(\d+);/m',
526
+ function($m) { return utf8_encode(chr($m[1])); },
527
+ $source
528
+ ); // decimal notation
529
  // convert hex
530
+ $source = preg_replace_callback(
531
+ '/&#x([a-f0-9]+);/mi',
532
+ function($m) { return utf8_encode(chr(hexdec('0x' . $m[1]))); },
533
+ $source
534
+ ); // hex notation
535
  return $source;
536
  }
537
  }
core/utilities/registry/format/ini.php CHANGED
@@ -171,7 +171,7 @@ class GantryRegistryFormatINI extends GantryRegistryFormat
171
  }
172
 
173
  // Cache the string to save cpu cycles -- thus the world :)
174
- self::$cache[$hash] = clone($obj);
175
 
176
  return $obj;
177
  }
171
  }
172
 
173
  // Cache the string to save cpu cycles -- thus the world :)
174
+ self::$cache[$hash] = clone $obj;
175
 
176
  return $obj;
177
  }
functions.php CHANGED
@@ -168,7 +168,7 @@ function gantry_construct()
168
  /**
169
  * @name GANTRY_VERSION
170
  */
171
- define('GANTRY_VERSION', '4.1.12');
172
 
173
 
174
  if (!defined('DS')) {
@@ -192,7 +192,7 @@ function gantry_construct()
192
 
193
  // Fix stuff on 4.4
194
  if(!get_option('gantry_4_1_10_execute_scripts') && $wp_version >= '4.4') {
195
- $cache_groups = array('gantry', 'Gantry', 'GantryAdmin-4.1.12', 'GantryLess', 'GantryAdminLess');
196
  foreach($cache_groups as $group) {
197
  $cache_handler = GantryCache::getCache( $group, 0, true );
198
  $cache_handler->clearGroupCache();
168
  /**
169
  * @name GANTRY_VERSION
170
  */
171
+ define('GANTRY_VERSION', '4.1.13');
172
 
173
 
174
  if (!defined('DS')) {
192
 
193
  // Fix stuff on 4.4
194
  if(!get_option('gantry_4_1_10_execute_scripts') && $wp_version >= '4.4') {
195
+ $cache_groups = array('gantry', 'Gantry', 'GantryAdmin-4.1.13', 'GantryLess', 'GantryAdminLess');
196
  foreach($cache_groups as $group) {
197
  $cache_handler = GantryCache::getCache( $group, 0, true );
198
  $cache_handler->clearGroupCache();
gantry.php CHANGED
@@ -10,7 +10,7 @@
10
  Plugin Name: Gantry 4 Framework
11
  Plugin URI: http://www.gantry.org/
12
  Description: This is a Framework to support easily modifiable themes that are very extensible.
13
- Version: 4.1.12
14
  Author: RocketTheme
15
  Author URI: http://www.rockettheme.com/wordpress
16
  License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
10
  Plugin Name: Gantry 4 Framework
11
  Plugin URI: http://www.gantry.org/
12
  Description: This is a Framework to support easily modifiable themes that are very extensible.
13
+ Version: 4.1.13
14
  Author: RocketTheme
15
  Author URI: http://www.rockettheme.com/wordpress
16
  License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
libs/phpQuery.php CHANGED
@@ -216,12 +216,12 @@ class DOMDocumentWrapper {
216
  case 'text/html':
217
  phpQuery::debug("Loading HTML, content type '{$this->contentType}'");
218
  $loaded = $this->loadMarkupHTML($markup, $charset);
219
- break;
220
  case 'text/xml':
221
  case 'application/xhtml+xml':
222
  phpQuery::debug("Loading XML, content type '{$this->contentType}'");
223
  $loaded = $this->loadMarkupXML($markup, $charset);
224
- break;
225
  default:
226
  // for feeds or anything that sometimes doesn't use text/xml
227
  if (strpos('xml', $this->contentType) !== false) {
@@ -384,14 +384,14 @@ class DOMDocumentWrapper {
384
  } else {
385
  // FIXME ???
386
  if ($isContentTypeXHTML && ! $isMarkupXHTML)
387
- if (! $documentCharset) {
388
- phpQuery::debug("Full markup load (XML), appending charset '$charset'");
389
- $markup = $this->charsetAppendToXML($markup, $charset);
390
- }
391
  // see http://pl2.php.net/manual/en/book.dom.php#78929
392
  // LIBXML_DTDLOAD (>= PHP 5.1)
393
  // does XML ctalogues works with LIBXML_NONET
394
- // $this->document->resolveExternals = true;
395
  // TODO test LIBXML_COMPACT for performance improvement
396
  // create document
397
  $this->documentCreate($charset);
@@ -687,8 +687,8 @@ class DOMDocumentWrapper {
687
  $markup = substr($markup, strpos($markup, '<fake>')+6);
688
  }
689
  } else {
690
- $markup = substr($markup, strpos($markup, '<body>')+6);
691
- $markup = substr($markup, 0, strrpos($markup, '</body>'));
692
  }
693
  $fragment->isDocumentFragment = $tmp;
694
  if (phpQuery::$debug)
@@ -711,11 +711,11 @@ class DOMDocumentWrapper {
711
  if ($this->isDocumentFragment && ! $innerMarkup)
712
  foreach($nodes as $i => $node)
713
  if ($node->isSameNode($this->root)) {
714
- // var_dump($node);
715
  $nodes = array_slice($nodes, 0, $i)
716
  + phpQuery::DOMNodeListToArray($node->childNodes)
717
  + array_slice($nodes, $i+1);
718
- }
719
  if ($this->isXML && ! $innerMarkup) {
720
  self::debug("Getting outerXML with charset '{$this->charset}'");
721
  // we need outerXML, so we can benefit from
@@ -788,19 +788,19 @@ class DOMDocumentWrapper {
788
  * @link http://php.net/manual/en/domdocument.savehtml.php#81256
789
  */
790
  public static function expandEmptyTag($tag, $xml){
791
- $indice = 0;
792
- while ($indice< strlen($xml)){
793
- $pos = strpos($xml, "<$tag ", $indice);
794
- if ($pos){
795
- $posCierre = strpos($xml, ">", $pos);
796
- if ($xml[$posCierre-1] == "/"){
797
- $xml = substr_replace($xml, "></$tag>", $posCierre-1, 2);
798
- }
799
- $indice = $posCierre;
800
- }
801
- else break;
802
- }
803
- return $xml;
804
  }
805
  }
806
 
@@ -952,7 +952,7 @@ abstract class phpQueryEvents {
952
  protected static function setNode($documentID, $node) {
953
  phpQuery::$documents[$documentID]->eventsNodes[] = $node;
954
  return phpQuery::$documents[$documentID]->eventsNodes[
955
- count(phpQuery::$documents[$documentID]->eventsNodes)-1
956
  ];
957
  }
958
  protected static function issetGlobal($documentID, $type) {
@@ -996,7 +996,7 @@ class Callback
996
  public $params = null;
997
  protected $name;
998
  public function __construct($callback, $param1 = null, $param2 = null,
999
- $param3 = null) {
1000
  $params = func_get_args();
1001
  $params = array_slice($params, 1);
1002
  if ($callback instanceof Callback) {
@@ -1029,7 +1029,7 @@ class Callback
1029
  */
1030
  class CallbackBody extends Callback {
1031
  public function __construct($paramList, $code, $param1 = null, $param2 = null,
1032
- $param3 = null) {
1033
  $params = func_get_args();
1034
  $params = array_slice($params, 2);
1035
  $this->callback = create_function($paramList, $code);
@@ -1230,7 +1230,7 @@ class phpQueryObject
1230
  // FIXME doesnt work at all ?
1231
  case 'length':
1232
  return $this->size();
1233
- break;
1234
  default:
1235
  return $this->{$attr};
1236
  }
@@ -1252,8 +1252,8 @@ class phpQueryObject
1252
  return $this->documentFragment;
1253
  }
1254
  /**
1255
- * @access private
1256
- * @TODO documentWrapper
1257
  */
1258
  protected function isRoot( $node) {
1259
  // return $node instanceof DOMDOCUMENT || $node->tagName == 'html';
@@ -1262,7 +1262,7 @@ class phpQueryObject
1262
  || $this->root->isSameNode($node);
1263
  }
1264
  /**
1265
- * @access private
1266
  */
1267
  protected function stackIsRoot() {
1268
  return $this->size() == 1 && $this->isRoot($this->elements[0]);
@@ -1285,8 +1285,8 @@ class phpQueryObject
1285
  * <code>
1286
  * $myDocumentId;
1287
  * phpQuery::newDocument('<div/>')
1288
- * ->getDocumentIDRef($myDocumentId)
1289
- * ->find('div')->...
1290
  * </code>
1291
  *
1292
  * @param unknown_type $domId
@@ -1462,7 +1462,7 @@ class phpQueryObject
1462
  $i++;
1463
  }
1464
  $return[] = $tmp;
1465
- // IDs
1466
  } else if ( $c == '#') {
1467
  $i++;
1468
  while( isset($query[$i]) && ($this->isChar($query[$i]) || $query[$i] == '-')) {
@@ -1470,33 +1470,33 @@ class phpQueryObject
1470
  $i++;
1471
  }
1472
  $return[] = '#'.$tmp;
1473
- // SPECIAL CHARS
1474
  } else if (in_array($c, $specialChars)) {
1475
  $return[] = $c;
1476
  $i++;
1477
- // MAPPED SPECIAL MULTICHARS
1478
  // } else if ( $c.$query[$i+1] == '//') {
1479
  // $return[] = ' ';
1480
  // $i = $i+2;
1481
- // MAPPED SPECIAL CHARS
1482
  } else if ( isset($specialCharsMapping[$c])) {
1483
  $return[] = $specialCharsMapping[$c];
1484
  $i++;
1485
- // COMMA
1486
  } else if ( $c == ',') {
1487
  $queries[] = array();
1488
  $return =& $queries[ count($queries)-1 ];
1489
  $i++;
1490
  while( isset($query[$i]) && $query[$i] == ' ')
1491
  $i++;
1492
- // CLASSES
1493
  } else if ($c == '.') {
1494
  while( isset($query[$i]) && ($this->isChar($query[$i]) || in_array($query[$i], $classChars))) {
1495
  $tmp .= $query[$i];
1496
  $i++;
1497
  }
1498
  $return[] = $tmp;
1499
- // ~ General Sibling Selector
1500
  } else if ($c == '~') {
1501
  $spaceAllowed = true;
1502
  $tmp .= $query[$i++];
@@ -1512,7 +1512,7 @@ class phpQueryObject
1512
  $i++;
1513
  }
1514
  $return[] = $tmp;
1515
- // + Adjacent sibling selectors
1516
  } else if ($c == '+') {
1517
  $spaceAllowed = true;
1518
  $tmp .= $query[$i++];
@@ -1528,7 +1528,7 @@ class phpQueryObject
1528
  $i++;
1529
  }
1530
  $return[] = $tmp;
1531
- // ATTRS
1532
  } else if ($c == '[') {
1533
  $stack = 1;
1534
  $tmp .= $c;
@@ -1544,7 +1544,7 @@ class phpQueryObject
1544
  }
1545
  $return[] = $tmp;
1546
  $i++;
1547
- // PSEUDO CLASSES
1548
  } else if ($c == ':') {
1549
  $stack = 1;
1550
  $tmp .= $query[$i++];
@@ -1715,10 +1715,10 @@ class phpQueryObject
1715
  );
1716
  if (! $diff )
1717
  return true;
1718
- // single-class
1719
  } else {
1720
  return in_array(
1721
- // strip leading dot from class name
1722
  substr($class, 1),
1723
  // get classes for element as array
1724
  explode(' ', $node->getAttribute('class') )
@@ -1848,12 +1848,12 @@ class phpQueryObject
1848
  } else {
1849
  $XQuery .= $s;
1850
  }
1851
- // ID
1852
  } else if ($s[0] == '#') {
1853
  if ($delimiterBefore)
1854
  $XQuery .= '*';
1855
  $XQuery .= "[@id='".substr($s, 1)."']";
1856
- // ATTRIBUTES
1857
  } else if ($s[0] == '[') {
1858
  if ($delimiterBefore)
1859
  $XQuery .= '*';
@@ -1873,7 +1873,7 @@ class phpQueryObject
1873
  } else {
1874
  $XQuery .= "[@{$attr}='{$value}']";
1875
  }
1876
- // attr without specified value
1877
  } else {
1878
  $XQuery .= "[@{$attr}]";
1879
  }
@@ -1883,7 +1883,7 @@ class phpQueryObject
1883
  if (! $this->length())
1884
  break;
1885
  }
1886
- // CLASSES
1887
  } else if ($s[0] == '.') {
1888
  // TODO use return $this->find("./self::*[contains(concat(\" \",@class,\" \"), \" $class \")]");
1889
  // thx wizDom ;)
@@ -1894,7 +1894,7 @@ class phpQueryObject
1894
  $XQuery = '';
1895
  if (! $this->length() )
1896
  break;
1897
- // ~ General Sibling Selector
1898
  } else if ($s[0] == '~') {
1899
  $this->runQuery($XQuery);
1900
  $XQuery = '';
@@ -1904,7 +1904,7 @@ class phpQueryObject
1904
  )->elements;
1905
  if (! $this->length() )
1906
  break;
1907
- // + Adjacent sibling selectors
1908
  } else if ($s[0] == '+') {
1909
  // TODO /following-sibling::
1910
  $this->runQuery($XQuery);
@@ -1922,7 +1922,7 @@ class phpQueryObject
1922
  }
1923
  if (! $this->length() )
1924
  break;
1925
- // PSEUDO CLASSES
1926
  } else if ($s[0] == ':') {
1927
  // TODO optimization for :first :last
1928
  if ($XQuery) {
@@ -1934,15 +1934,15 @@ class phpQueryObject
1934
  $this->pseudoClasses($s);
1935
  if (! $this->length())
1936
  break;
1937
- // DIRECT DESCENDANDS
1938
  } else if ($s == '>') {
1939
  $XQuery .= '/';
1940
  $delimiterBefore = 2;
1941
- // ALL DESCENDANDS
1942
  } else if ($s == ' ') {
1943
  $XQuery .= '//';
1944
  $delimiterBefore = 2;
1945
- // ERRORS
1946
  } else {
1947
  phpQuery::debug("Unrecognized token '$s'");
1948
  }
@@ -2058,7 +2058,7 @@ class phpQueryObject
2058
  "button[type=$class]", new CallbackParam()
2059
  )
2060
  );
2061
- break;
2062
  // $stack = array();
2063
  // foreach($this->elements as $node)
2064
  // if ($node->is('input[type=submit]') || $node->is('button[type=submit]'))
@@ -2069,7 +2069,7 @@ class phpQueryObject
2069
  array($this, 'is'),
2070
  'input', new CallbackParam()
2071
  )->elements;
2072
- break;
2073
  case 'password':
2074
  case 'checkbox':
2075
  case 'radio':
@@ -2080,21 +2080,21 @@ class phpQueryObject
2080
  array($this, 'is'),
2081
  "input[type=$class]", new CallbackParam()
2082
  )->elements;
2083
- break;
2084
  case 'parent':
2085
  $this->elements = $this->map(
2086
  create_function('$node', '
2087
  return $node instanceof DOMELEMENT && $node->childNodes->length
2088
  ? $node : null;')
2089
  )->elements;
2090
- break;
2091
  case 'empty':
2092
  $this->elements = $this->map(
2093
  create_function('$node', '
2094
  return $node instanceof DOMELEMENT && $node->childNodes->length
2095
  ? null : $node;')
2096
  )->elements;
2097
- break;
2098
  case 'disabled':
2099
  case 'selected':
2100
  case 'checked':
@@ -2102,13 +2102,13 @@ class phpQueryObject
2102
  array($this, 'is'),
2103
  "[$class]", new CallbackParam()
2104
  )->elements;
2105
- break;
2106
  case 'enabled':
2107
  $this->elements = $this->map(
2108
  create_function('$node', '
2109
  return pq($node)->not(":disabled") ? $node : null;')
2110
  )->elements;
2111
- break;
2112
  case 'header':
2113
  $this->elements = $this->map(
2114
  create_function('$node',
@@ -2131,28 +2131,28 @@ class phpQueryObject
2131
  // ? $node
2132
  // : null;')
2133
  // )->elements;
2134
- break;
2135
  case 'only-child':
2136
  $this->elements = $this->map(
2137
  create_function('$node',
2138
  'return pq($node)->siblings()->size() == 0 ? $node : null;')
2139
  )->elements;
2140
- break;
2141
  case 'first-child':
2142
  $this->elements = $this->map(
2143
  create_function('$node', 'return pq($node)->prevAll()->size() == 0 ? $node : null;')
2144
  )->elements;
2145
- break;
2146
  case 'last-child':
2147
  $this->elements = $this->map(
2148
  create_function('$node', 'return pq($node)->nextAll()->size() == 0 ? $node : null;')
2149
  )->elements;
2150
- break;
2151
  case 'nth-child':
2152
  $param = trim($args, "\"'");
2153
  if (! $param)
2154
  break;
2155
- // nth-child(n+b) to nth-child(1n+b)
2156
  if ($param{0} == 'n')
2157
  $param = '1'.$param;
2158
  // :nth-child(index/even/odd/equation)
@@ -2222,7 +2222,7 @@ class phpQueryObject
2222
  new CallbackParam(), $param
2223
  );
2224
  $this->elements = $mapped->elements;
2225
- break;
2226
  default:
2227
  $this->debug("Unknown pseudoclass '{$class}', skipping...");
2228
  }
@@ -2327,11 +2327,11 @@ class phpQueryObject
2327
  if ( $s[0] == '#') {
2328
  if ( $node->getAttribute('id') != substr($s, 1) )
2329
  $break = true;
2330
- // CLASSES
2331
  } else if ( $s[0] == '.') {
2332
  if (! $this->matchClasses( $s, $node ) )
2333
  $break = true;
2334
- // ATTRS
2335
  } else if ( $s[0] == '[') {
2336
  // strip side brackets
2337
  $attr = trim($s, '[]');
@@ -2370,10 +2370,10 @@ class phpQueryObject
2370
  $break = true;
2371
  } else if (! $node->hasAttribute($attr))
2372
  $break = true;
2373
- // PSEUDO CLASSES
2374
  } else if ( $s[0] == ':') {
2375
  // skip
2376
- // TAG
2377
  } else if (trim($s)) {
2378
  if ($s != '*') {
2379
  // TODO namespaces
@@ -2383,7 +2383,7 @@ class phpQueryObject
2383
  } else if ($s == 'html' && ! $this->isRoot($node))
2384
  $break = true;
2385
  }
2386
- // AVOID NON-SIMPLE SELECTORS
2387
  } else if (in_array($s, $notSimpleSelector)) {
2388
  $break = true;
2389
  $this->debug(array('Skipping non simple selector', $selector));
@@ -2624,12 +2624,12 @@ class phpQueryObject
2624
  ->map(array($this, '___wrapAllCallback'))
2625
  ->append($this);
2626
  }
2627
- /**
2628
- *
2629
  * @param $node
2630
  * @return unknown_type
2631
  * @access private
2632
- */
2633
  public function ___wrapAllCallback($node) {
2634
  $deepest = $node;
2635
  while($deepest->firstChild && $deepest->firstChild instanceof DOMELEMENT)
@@ -2646,10 +2646,10 @@ class phpQueryObject
2646
  public function wrapAllPHP($codeBefore, $codeAfter) {
2647
  return $this
2648
  ->slice(0, 1)
2649
- ->beforePHP($codeBefore)
2650
  ->end()
2651
  ->slice(-1)
2652
- ->afterPHP($codeAfter)
2653
  ->end();
2654
  }
2655
  /**
@@ -3168,7 +3168,7 @@ class phpQueryObject
3168
  if (phpQuery::isMarkup($target)) {
3169
  // $target is new markup, import it
3170
  $insertTo = $this->documentWrapper->import($target);
3171
- // insert into selected element
3172
  } else {
3173
  // $tagret is a selector
3174
  $thisStack = $this->elements;
@@ -3213,7 +3213,7 @@ class phpQueryObject
3213
  ? $loop
3214
  : $this->documentWrapper->import($loop);
3215
  }
3216
- // DOMNODE
3217
  } elseif ($target instanceof DOMNODE) {
3218
  // import node if needed
3219
  // if ( $target->ownerDocument != $this->DOM )
@@ -3680,7 +3680,7 @@ class phpQueryObject
3680
  in_array($node->getAttribute('type'),
3681
  array('text', 'password', 'hidden'))
3682
  || !$node->getAttribute('type')
3683
- );
3684
  $isRadio = $node->tagName == 'input'
3685
  && $node->getAttribute('type') == 'radio';
3686
  $isCheckbox = $node->tagName == 'input'
@@ -3812,22 +3812,22 @@ class phpQueryObject
3812
  public function val($val = null) {
3813
  if (! isset($val)) {
3814
  if ($this->eq(0)->is('select')) {
3815
- $selected = $this->eq(0)->find('option[selected=selected]');
3816
- if ($selected->is('[value]'))
3817
- return $selected->attr('value');
3818
- else
3819
- return $selected->text();
3820
- } else if ($this->eq(0)->is('textarea'))
3821
- return $this->eq(0)->markup();
3822
  else
3823
- return $this->eq(0)->attr('value');
 
 
 
 
3824
  } else {
3825
  $_val = null;
3826
  foreach($this->stack(1) as $node) {
3827
  $node = pq($node, $this->getDocumentID());
3828
  if (is_array($val) && in_array($node->attr('type'), array('checkbox', 'radio'))) {
3829
  $isChecked = in_array($node->attr('value'), $val)
3830
- || in_array($node->attr('name'), $val);
3831
  if ($isChecked)
3832
  $node->attr('checked', 'checked');
3833
  else
@@ -3904,11 +3904,11 @@ class phpQueryObject
3904
  */
3905
  public function addClassPHP( $className) {
3906
  foreach($this->stack(1) as $node) {
3907
- $classes = $node->getAttribute('class');
3908
- $newValue = $classes
3909
- ? $classes.' <'.'?php '.$className.' ?'.'>'
3910
- : '<'.'?php '.$className.' ?'.'>';
3911
- $node->setAttribute('class', $newValue);
3912
  }
3913
  return $this;
3914
  }
@@ -4063,7 +4063,7 @@ class phpQueryObject
4063
 
4064
  // ITERATOR INTERFACE
4065
  /**
4066
- * @access private
4067
  */
4068
  public function rewind(){
4069
  $this->debug('iterating foreach');
@@ -4078,13 +4078,13 @@ class phpQueryObject
4078
  $this->current = 0;
4079
  }
4080
  /**
4081
- * @access private
4082
  */
4083
  public function current(){
4084
  return $this->elementsInterator[ $this->current ];
4085
  }
4086
  /**
4087
- * @access private
4088
  */
4089
  public function key(){
4090
  return $this->current;
@@ -4115,7 +4115,7 @@ class phpQueryObject
4115
  }
4116
  }
4117
  /**
4118
- * @access private
4119
  */
4120
  public function valid(){
4121
  return $this->valid;
@@ -4123,26 +4123,26 @@ class phpQueryObject
4123
  // ITERATOR INTERFACE END
4124
  // ARRAYACCESS INTERFACE
4125
  /**
4126
- * @access private
4127
  */
4128
  public function offsetExists($offset) {
4129
  return $this->find($offset)->size() > 0;
4130
  }
4131
  /**
4132
- * @access private
4133
  */
4134
  public function offsetGet($offset) {
4135
  return $this->find($offset);
4136
  }
4137
  /**
4138
- * @access private
4139
  */
4140
  public function offsetSet($offset, $value) {
4141
  // $this->find($offset)->replaceWith($value);
4142
  $this->find($offset)->html($value);
4143
  }
4144
  /**
4145
- * @access private
4146
  */
4147
  public function offsetUnset($offset) {
4148
  // empty
@@ -4206,7 +4206,7 @@ class phpQueryObject
4206
  .($node->getAttribute('id')
4207
  ? '#'.$node->getAttribute('id'):'')
4208
  .($node->getAttribute('class')
4209
- ? '.'.join('.', split(' ', $node->getAttribute('class'))):'')
4210
  .($node->getAttribute('name')
4211
  ? '[name="'.$node->getAttribute('name').'"]':'')
4212
  .($node->getAttribute('value') && strpos($node->getAttribute('value'), '<'.'?php') === false
@@ -4497,7 +4497,7 @@ abstract class phpQuery {
4497
  * @param string|phpQueryObject|DOMNode $context DOM ID from $pq->getDocumentID(), phpQuery object (determines also query root) or DOMNode (determines also query root)
4498
  *
4499
  * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery|false
4500
- * phpQuery object or false in case of error.
4501
  */
4502
  public static function pq($arg1, $context = null) {
4503
  if ($arg1 instanceof DOMNODE && ! isset($context)) {
@@ -4926,7 +4926,7 @@ abstract class phpQuery {
4926
  $realClass = 'phpQueryPlugin_'.$class;
4927
  $vars = get_class_vars($realClass);
4928
  $loop = isset($vars['phpQueryMethods'])
4929
- && ! is_null($vars['phpQueryMethods'])
4930
  ? $vars['phpQueryMethods']
4931
  : get_class_methods($realClass);
4932
  foreach($loop as $method) {
@@ -4947,7 +4947,7 @@ abstract class phpQuery {
4947
  $realClass = 'phpQueryObjectPlugin_'.$class;
4948
  $vars = get_class_vars($realClass);
4949
  $loop = isset($vars['phpQueryMethods'])
4950
- && ! is_null($vars['phpQueryMethods'])
4951
  ? $vars['phpQueryMethods']
4952
  : get_class_methods($realClass);
4953
  foreach($loop as $method) {
@@ -5051,7 +5051,7 @@ abstract class phpQuery {
5051
  }
5052
  if (isset($options['timeout']))
5053
  $client->setConfig(array(
5054
- 'timeout' => $options['timeout'],
5055
  ));
5056
  // 'maxredirects' => 0,
5057
  foreach(self::$ajaxAllowedHosts as $k => $host)
@@ -5112,12 +5112,12 @@ abstract class phpQuery {
5112
  $client->setHeaders(array(
5113
  // 'content-type' => $options['contentType'],
5114
  'User-Agent' => 'Mozilla/5.0 (X11; U; Linux x86; en-US; rv:1.9.0.5) Gecko'
5115
- .'/2008122010 Firefox/3.0.5',
5116
- // TODO custom charset
5117
  'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
5118
  // 'Connection' => 'keep-alive',
5119
  // 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
5120
- 'Accept-Language' => 'en-us,en;q=0.5',
5121
  ));
5122
  if ($options['username'])
5123
  $client->setAuth($options['username'], $options['password']);
@@ -5633,9 +5633,7 @@ abstract class phpQuery {
5633
  if ($name) {
5634
  if (isset($document->data[$id][$name]))
5635
  unset($document->data[$id][$name]);
5636
- $name = null;
5637
- foreach($document->data[$id] as $name)
5638
- break;
5639
  if (! $name)
5640
  self::removeData($node, $name, $documentID);
5641
  } else {
@@ -5690,8 +5688,8 @@ function pq($arg1, $context = null) {
5690
  // add plugins dir and Zend framework to include path
5691
  set_include_path(
5692
  get_include_path()
5693
- .PATH_SEPARATOR.dirname(__FILE__).'/phpQuery/'
5694
- .PATH_SEPARATOR.dirname(__FILE__).'/phpQuery/plugins/'
5695
  );
5696
  // why ? no __call nor __get for statics in php...
5697
  // XXX __callStatic will be available in PHP 5.3
216
  case 'text/html':
217
  phpQuery::debug("Loading HTML, content type '{$this->contentType}'");
218
  $loaded = $this->loadMarkupHTML($markup, $charset);
219
+ break;
220
  case 'text/xml':
221
  case 'application/xhtml+xml':
222
  phpQuery::debug("Loading XML, content type '{$this->contentType}'");
223
  $loaded = $this->loadMarkupXML($markup, $charset);
224
+ break;
225
  default:
226
  // for feeds or anything that sometimes doesn't use text/xml
227
  if (strpos('xml', $this->contentType) !== false) {
384
  } else {
385
  // FIXME ???
386
  if ($isContentTypeXHTML && ! $isMarkupXHTML)
387
+ if (! $documentCharset) {
388
+ phpQuery::debug("Full markup load (XML), appending charset '$charset'");
389
+ $markup = $this->charsetAppendToXML($markup, $charset);
390
+ }
391
  // see http://pl2.php.net/manual/en/book.dom.php#78929
392
  // LIBXML_DTDLOAD (>= PHP 5.1)
393
  // does XML ctalogues works with LIBXML_NONET
394
+ // $this->document->resolveExternals = true;
395
  // TODO test LIBXML_COMPACT for performance improvement
396
  // create document
397
  $this->documentCreate($charset);
687
  $markup = substr($markup, strpos($markup, '<fake>')+6);
688
  }
689
  } else {
690
+ $markup = substr($markup, strpos($markup, '<body>')+6);
691
+ $markup = substr($markup, 0, strrpos($markup, '</body>'));
692
  }
693
  $fragment->isDocumentFragment = $tmp;
694
  if (phpQuery::$debug)
711
  if ($this->isDocumentFragment && ! $innerMarkup)
712
  foreach($nodes as $i => $node)
713
  if ($node->isSameNode($this->root)) {
714
+ // var_dump($node);
715
  $nodes = array_slice($nodes, 0, $i)
716
  + phpQuery::DOMNodeListToArray($node->childNodes)
717
  + array_slice($nodes, $i+1);
718
+ }
719
  if ($this->isXML && ! $innerMarkup) {
720
  self::debug("Getting outerXML with charset '{$this->charset}'");
721
  // we need outerXML, so we can benefit from
788
  * @link http://php.net/manual/en/domdocument.savehtml.php#81256
789
  */
790
  public static function expandEmptyTag($tag, $xml){
791
+ $indice = 0;
792
+ while ($indice< strlen($xml)){
793
+ $pos = strpos($xml, "<$tag ", $indice);
794
+ if ($pos){
795
+ $posCierre = strpos($xml, ">", $pos);
796
+ if ($xml[$posCierre-1] == "/"){
797
+ $xml = substr_replace($xml, "></$tag>", $posCierre-1, 2);
798
+ }
799
+ $indice = $posCierre;
800
+ }
801
+ else break;
802
+ }
803
+ return $xml;
804
  }
805
  }
806
 
952
  protected static function setNode($documentID, $node) {
953
  phpQuery::$documents[$documentID]->eventsNodes[] = $node;
954
  return phpQuery::$documents[$documentID]->eventsNodes[
955
+ count(phpQuery::$documents[$documentID]->eventsNodes)-1
956
  ];
957
  }
958
  protected static function issetGlobal($documentID, $type) {
996
  public $params = null;
997
  protected $name;
998
  public function __construct($callback, $param1 = null, $param2 = null,
999
+ $param3 = null) {
1000
  $params = func_get_args();
1001
  $params = array_slice($params, 1);
1002
  if ($callback instanceof Callback) {
1029
  */
1030
  class CallbackBody extends Callback {
1031
  public function __construct($paramList, $code, $param1 = null, $param2 = null,
1032
+ $param3 = null) {
1033
  $params = func_get_args();
1034
  $params = array_slice($params, 2);
1035
  $this->callback = create_function($paramList, $code);
1230
  // FIXME doesnt work at all ?
1231
  case 'length':
1232
  return $this->size();
1233
+ break;
1234
  default:
1235
  return $this->{$attr};
1236
  }
1252
  return $this->documentFragment;
1253
  }
1254
  /**
1255
+ * @access private
1256
+ * @TODO documentWrapper
1257
  */
1258
  protected function isRoot( $node) {
1259
  // return $node instanceof DOMDOCUMENT || $node->tagName == 'html';
1262
  || $this->root->isSameNode($node);
1263
  }
1264
  /**
1265
+ * @access private
1266
  */
1267
  protected function stackIsRoot() {
1268
  return $this->size() == 1 && $this->isRoot($this->elements[0]);
1285
  * <code>
1286
  * $myDocumentId;
1287
  * phpQuery::newDocument('<div/>')
1288
+ * ->getDocumentIDRef($myDocumentId)
1289
+ * ->find('div')->...
1290
  * </code>
1291
  *
1292
  * @param unknown_type $domId
1462
  $i++;
1463
  }
1464
  $return[] = $tmp;
1465
+ // IDs
1466
  } else if ( $c == '#') {
1467
  $i++;
1468
  while( isset($query[$i]) && ($this->isChar($query[$i]) || $query[$i] == '-')) {
1470
  $i++;
1471
  }
1472
  $return[] = '#'.$tmp;
1473
+ // SPECIAL CHARS
1474
  } else if (in_array($c, $specialChars)) {
1475
  $return[] = $c;
1476
  $i++;
1477
+ // MAPPED SPECIAL MULTICHARS
1478
  // } else if ( $c.$query[$i+1] == '//') {
1479
  // $return[] = ' ';
1480
  // $i = $i+2;
1481
+ // MAPPED SPECIAL CHARS
1482
  } else if ( isset($specialCharsMapping[$c])) {
1483
  $return[] = $specialCharsMapping[$c];
1484
  $i++;
1485
+ // COMMA
1486
  } else if ( $c == ',') {
1487
  $queries[] = array();
1488
  $return =& $queries[ count($queries)-1 ];
1489
  $i++;
1490
  while( isset($query[$i]) && $query[$i] == ' ')
1491
  $i++;
1492
+ // CLASSES
1493
  } else if ($c == '.') {
1494
  while( isset($query[$i]) && ($this->isChar($query[$i]) || in_array($query[$i], $classChars))) {
1495
  $tmp .= $query[$i];
1496
  $i++;
1497
  }
1498
  $return[] = $tmp;
1499
+ // ~ General Sibling Selector
1500
  } else if ($c == '~') {
1501
  $spaceAllowed = true;
1502
  $tmp .= $query[$i++];
1512
  $i++;
1513
  }
1514
  $return[] = $tmp;
1515
+ // + Adjacent sibling selectors
1516
  } else if ($c == '+') {
1517
  $spaceAllowed = true;
1518
  $tmp .= $query[$i++];
1528
  $i++;
1529
  }
1530
  $return[] = $tmp;
1531
+ // ATTRS
1532
  } else if ($c == '[') {
1533
  $stack = 1;
1534
  $tmp .= $c;
1544
  }
1545
  $return[] = $tmp;
1546
  $i++;
1547
+ // PSEUDO CLASSES
1548
  } else if ($c == ':') {
1549
  $stack = 1;
1550
  $tmp .= $query[$i++];
1715
  );
1716
  if (! $diff )
1717
  return true;
1718
+ // single-class
1719
  } else {
1720
  return in_array(
1721
+ // strip leading dot from class name
1722
  substr($class, 1),
1723
  // get classes for element as array
1724
  explode(' ', $node->getAttribute('class') )
1848
  } else {
1849
  $XQuery .= $s;
1850
  }
1851
+ // ID
1852
  } else if ($s[0] == '#') {
1853
  if ($delimiterBefore)
1854
  $XQuery .= '*';
1855
  $XQuery .= "[@id='".substr($s, 1)."']";
1856
+ // ATTRIBUTES
1857
  } else if ($s[0] == '[') {
1858
  if ($delimiterBefore)
1859
  $XQuery .= '*';
1873
  } else {
1874
  $XQuery .= "[@{$attr}='{$value}']";
1875
  }
1876
+ // attr without specified value
1877
  } else {
1878
  $XQuery .= "[@{$attr}]";
1879
  }
1883
  if (! $this->length())
1884
  break;
1885
  }
1886
+ // CLASSES
1887
  } else if ($s[0] == '.') {
1888
  // TODO use return $this->find("./self::*[contains(concat(\" \",@class,\" \"), \" $class \")]");
1889
  // thx wizDom ;)
1894
  $XQuery = '';
1895
  if (! $this->length() )
1896
  break;
1897
+ // ~ General Sibling Selector
1898
  } else if ($s[0] == '~') {
1899
  $this->runQuery($XQuery);
1900
  $XQuery = '';
1904
  )->elements;
1905
  if (! $this->length() )
1906
  break;
1907
+ // + Adjacent sibling selectors
1908
  } else if ($s[0] == '+') {
1909
  // TODO /following-sibling::
1910
  $this->runQuery($XQuery);
1922
  }
1923
  if (! $this->length() )
1924
  break;
1925
+ // PSEUDO CLASSES
1926
  } else if ($s[0] == ':') {
1927
  // TODO optimization for :first :last
1928
  if ($XQuery) {
1934
  $this->pseudoClasses($s);
1935
  if (! $this->length())
1936
  break;
1937
+ // DIRECT DESCENDANDS
1938
  } else if ($s == '>') {
1939
  $XQuery .= '/';
1940
  $delimiterBefore = 2;
1941
+ // ALL DESCENDANDS
1942
  } else if ($s == ' ') {
1943
  $XQuery .= '//';
1944
  $delimiterBefore = 2;
1945
+ // ERRORS
1946
  } else {
1947
  phpQuery::debug("Unrecognized token '$s'");
1948
  }
2058
  "button[type=$class]", new CallbackParam()
2059
  )
2060
  );
2061
+ break;
2062
  // $stack = array();
2063
  // foreach($this->elements as $node)
2064
  // if ($node->is('input[type=submit]') || $node->is('button[type=submit]'))
2069
  array($this, 'is'),
2070
  'input', new CallbackParam()
2071
  )->elements;
2072
+ break;
2073
  case 'password':
2074
  case 'checkbox':
2075
  case 'radio':
2080
  array($this, 'is'),
2081
  "input[type=$class]", new CallbackParam()
2082
  )->elements;
2083
+ break;
2084
  case 'parent':
2085
  $this->elements = $this->map(
2086
  create_function('$node', '
2087
  return $node instanceof DOMELEMENT && $node->childNodes->length
2088
  ? $node : null;')
2089
  )->elements;
2090
+ break;
2091
  case 'empty':
2092
  $this->elements = $this->map(
2093
  create_function('$node', '
2094
  return $node instanceof DOMELEMENT && $node->childNodes->length
2095
  ? null : $node;')
2096
  )->elements;
2097
+ break;
2098
  case 'disabled':
2099
  case 'selected':
2100
  case 'checked':
2102
  array($this, 'is'),
2103
  "[$class]", new CallbackParam()
2104
  )->elements;
2105
+ break;
2106
  case 'enabled':
2107
  $this->elements = $this->map(
2108
  create_function('$node', '
2109
  return pq($node)->not(":disabled") ? $node : null;')
2110
  )->elements;
2111
+ break;
2112
  case 'header':
2113
  $this->elements = $this->map(
2114
  create_function('$node',
2131
  // ? $node
2132
  // : null;')
2133
  // )->elements;
2134
+ break;
2135
  case 'only-child':
2136
  $this->elements = $this->map(
2137
  create_function('$node',
2138
  'return pq($node)->siblings()->size() == 0 ? $node : null;')
2139
  )->elements;
2140
+ break;
2141
  case 'first-child':
2142
  $this->elements = $this->map(
2143
  create_function('$node', 'return pq($node)->prevAll()->size() == 0 ? $node : null;')
2144
  )->elements;
2145
+ break;
2146
  case 'last-child':
2147
  $this->elements = $this->map(
2148
  create_function('$node', 'return pq($node)->nextAll()->size() == 0 ? $node : null;')
2149
  )->elements;
2150
+ break;
2151
  case 'nth-child':
2152
  $param = trim($args, "\"'");
2153
  if (! $param)
2154
  break;
2155
+ // nth-child(n+b) to nth-child(1n+b)
2156
  if ($param{0} == 'n')
2157
  $param = '1'.$param;
2158
  // :nth-child(index/even/odd/equation)
2222
  new CallbackParam(), $param
2223
  );
2224
  $this->elements = $mapped->elements;
2225
+ break;
2226
  default:
2227
  $this->debug("Unknown pseudoclass '{$class}', skipping...");
2228
  }
2327
  if ( $s[0] == '#') {
2328
  if ( $node->getAttribute('id') != substr($s, 1) )
2329
  $break = true;
2330
+ // CLASSES
2331
  } else if ( $s[0] == '.') {
2332
  if (! $this->matchClasses( $s, $node ) )
2333
  $break = true;
2334
+ // ATTRS
2335
  } else if ( $s[0] == '[') {
2336
  // strip side brackets
2337
  $attr = trim($s, '[]');
2370
  $break = true;
2371
  } else if (! $node->hasAttribute($attr))
2372
  $break = true;
2373
+ // PSEUDO CLASSES
2374
  } else if ( $s[0] == ':') {
2375
  // skip
2376
+ // TAG
2377
  } else if (trim($s)) {
2378
  if ($s != '*') {
2379
  // TODO namespaces
2383
  } else if ($s == 'html' && ! $this->isRoot($node))
2384
  $break = true;
2385
  }
2386
+ // AVOID NON-SIMPLE SELECTORS
2387
  } else if (in_array($s, $notSimpleSelector)) {
2388
  $break = true;
2389
  $this->debug(array('Skipping non simple selector', $selector));
2624
  ->map(array($this, '___wrapAllCallback'))
2625
  ->append($this);
2626
  }
2627
+ /**
2628
+ *
2629
  * @param $node
2630
  * @return unknown_type
2631
  * @access private
2632
+ */
2633
  public function ___wrapAllCallback($node) {
2634
  $deepest = $node;
2635
  while($deepest->firstChild && $deepest->firstChild instanceof DOMELEMENT)
2646
  public function wrapAllPHP($codeBefore, $codeAfter) {
2647
  return $this
2648
  ->slice(0, 1)
2649
+ ->beforePHP($codeBefore)
2650
  ->end()
2651
  ->slice(-1)
2652
+ ->afterPHP($codeAfter)
2653
  ->end();
2654
  }
2655
  /**
3168
  if (phpQuery::isMarkup($target)) {
3169
  // $target is new markup, import it
3170
  $insertTo = $this->documentWrapper->import($target);
3171
+ // insert into selected element
3172
  } else {
3173
  // $tagret is a selector
3174
  $thisStack = $this->elements;
3213
  ? $loop
3214
  : $this->documentWrapper->import($loop);
3215
  }
3216
+ // DOMNODE
3217
  } elseif ($target instanceof DOMNODE) {
3218
  // import node if needed
3219
  // if ( $target->ownerDocument != $this->DOM )
3680
  in_array($node->getAttribute('type'),
3681
  array('text', 'password', 'hidden'))
3682
  || !$node->getAttribute('type')
3683
+ );
3684
  $isRadio = $node->tagName == 'input'
3685
  && $node->getAttribute('type') == 'radio';
3686
  $isCheckbox = $node->tagName == 'input'
3812
  public function val($val = null) {
3813
  if (! isset($val)) {
3814
  if ($this->eq(0)->is('select')) {
3815
+ $selected = $this->eq(0)->find('option[selected=selected]');
3816
+ if ($selected->is('[value]'))
3817
+ return $selected->attr('value');
 
 
 
 
3818
  else
3819
+ return $selected->text();
3820
+ } else if ($this->eq(0)->is('textarea'))
3821
+ return $this->eq(0)->markup();
3822
+ else
3823
+ return $this->eq(0)->attr('value');
3824
  } else {
3825
  $_val = null;
3826
  foreach($this->stack(1) as $node) {
3827
  $node = pq($node, $this->getDocumentID());
3828
  if (is_array($val) && in_array($node->attr('type'), array('checkbox', 'radio'))) {
3829
  $isChecked = in_array($node->attr('value'), $val)
3830
+ || in_array($node->attr('name'), $val);
3831
  if ($isChecked)
3832
  $node->attr('checked', 'checked');
3833
  else
3904
  */
3905
  public function addClassPHP( $className) {
3906
  foreach($this->stack(1) as $node) {
3907
+ $classes = $node->getAttribute('class');
3908
+ $newValue = $classes
3909
+ ? $classes.' <'.'?php '.$className.' ?'.'>'
3910
+ : '<'.'?php '.$className.' ?'.'>';
3911
+ $node->setAttribute('class', $newValue);
3912
  }
3913
  return $this;
3914
  }
4063
 
4064
  // ITERATOR INTERFACE
4065
  /**
4066
+ * @access private
4067
  */
4068
  public function rewind(){
4069
  $this->debug('iterating foreach');
4078
  $this->current = 0;
4079
  }
4080
  /**
4081
+ * @access private
4082
  */
4083
  public function current(){
4084
  return $this->elementsInterator[ $this->current ];
4085
  }
4086
  /**
4087
+ * @access private
4088
  */
4089
  public function key(){
4090
  return $this->current;
4115
  }
4116
  }
4117
  /**
4118
+ * @access private
4119
  */
4120
  public function valid(){
4121
  return $this->valid;
4123
  // ITERATOR INTERFACE END
4124
  // ARRAYACCESS INTERFACE
4125
  /**
4126
+ * @access private
4127
  */
4128
  public function offsetExists($offset) {
4129
  return $this->find($offset)->size() > 0;
4130
  }
4131
  /**
4132
+ * @access private
4133
  */
4134
  public function offsetGet($offset) {
4135
  return $this->find($offset);
4136
  }
4137
  /**
4138
+ * @access private
4139
  */
4140
  public function offsetSet($offset, $value) {
4141
  // $this->find($offset)->replaceWith($value);
4142
  $this->find($offset)->html($value);
4143
  }
4144
  /**
4145
+ * @access private
4146
  */
4147
  public function offsetUnset($offset) {
4148
  // empty
4206
  .($node->getAttribute('id')
4207
  ? '#'.$node->getAttribute('id'):'')
4208
  .($node->getAttribute('class')
4209
+ ? '.'.join('.', explode(' ', $node->getAttribute('class'))):'')
4210
  .($node->getAttribute('name')
4211
  ? '[name="'.$node->getAttribute('name').'"]':'')
4212
  .($node->getAttribute('value') && strpos($node->getAttribute('value'), '<'.'?php') === false
4497
  * @param string|phpQueryObject|DOMNode $context DOM ID from $pq->getDocumentID(), phpQuery object (determines also query root) or DOMNode (determines also query root)
4498
  *
4499
  * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery|false
4500
+ * phpQuery object or false in case of error.
4501
  */
4502
  public static function pq($arg1, $context = null) {
4503
  if ($arg1 instanceof DOMNODE && ! isset($context)) {
4926
  $realClass = 'phpQueryPlugin_'.$class;
4927
  $vars = get_class_vars($realClass);
4928
  $loop = isset($vars['phpQueryMethods'])
4929
+ && ! is_null($vars['phpQueryMethods'])
4930
  ? $vars['phpQueryMethods']
4931
  : get_class_methods($realClass);
4932
  foreach($loop as $method) {
4947
  $realClass = 'phpQueryObjectPlugin_'.$class;
4948
  $vars = get_class_vars($realClass);
4949
  $loop = isset($vars['phpQueryMethods'])
4950
+ && ! is_null($vars['phpQueryMethods'])
4951
  ? $vars['phpQueryMethods']
4952
  : get_class_methods($realClass);
4953
  foreach($loop as $method) {
5051
  }
5052
  if (isset($options['timeout']))
5053
  $client->setConfig(array(
5054
+ 'timeout' => $options['timeout'],
5055
  ));
5056
  // 'maxredirects' => 0,
5057
  foreach(self::$ajaxAllowedHosts as $k => $host)
5112
  $client->setHeaders(array(
5113
  // 'content-type' => $options['contentType'],
5114
  'User-Agent' => 'Mozilla/5.0 (X11; U; Linux x86; en-US; rv:1.9.0.5) Gecko'
5115
+ .'/2008122010 Firefox/3.0.5',
5116
+ // TODO custom charset
5117
  'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
5118
  // 'Connection' => 'keep-alive',
5119
  // 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
5120
+ 'Accept-Language' => 'en-us,en;q=0.5',
5121
  ));
5122
  if ($options['username'])
5123
  $client->setAuth($options['username'], $options['password']);
5633
  if ($name) {
5634
  if (isset($document->data[$id][$name]))
5635
  unset($document->data[$id][$name]);
5636
+ $name = reset($document->data[$id]);
 
 
5637
  if (! $name)
5638
  self::removeData($node, $name, $documentID);
5639
  } else {
5688
  // add plugins dir and Zend framework to include path
5689
  set_include_path(
5690
  get_include_path()
5691
+ .PATH_SEPARATOR.dirname(__FILE__).'/phpQuery/'
5692
+ .PATH_SEPARATOR.dirname(__FILE__).'/phpQuery/plugins/'
5693
  );
5694
  // why ? no __call nor __get for statics in php...
5695
  // XXX __callStatic will be available in PHP 5.3
readme.txt CHANGED
@@ -4,7 +4,7 @@ Author URI: http://gantry.org
4
  Tags: gantry, framework, template, theme, widgets, flexible, extensible, configurable, 960px, grid, columns, powerful, buddypress
5
  Requires at least: 3.2
6
  Tested up to: 4.8
7
- Stable tag: 4.1.12
8
 
9
  Gantry is a comprehensive set of building blocks to enable the rapid development and realization of a design into a flexible and powerful web platform
10
 
@@ -89,6 +89,10 @@ Once you downloaded and installed Gantry 4 Framework plugin, please download als
89
 
90
  == Changelog ==
91
 
 
 
 
 
92
  = 4.1.12 =
93
  * PHP 7 compatibility fixes
94
 
@@ -437,6 +441,9 @@ Once you downloaded and installed Gantry 4 Framework plugin, please download als
437
 
438
  == Upgrade Notice ==
439
 
 
 
 
440
  = 4.1.12 =
441
  Please remember to create a full site backup (files + database) before performing update.
442
 
4
  Tags: gantry, framework, template, theme, widgets, flexible, extensible, configurable, 960px, grid, columns, powerful, buddypress
5
  Requires at least: 3.2
6
  Tested up to: 4.8
7
+ Stable tag: 4.1.13
8
 
9
  Gantry is a comprehensive set of building blocks to enable the rapid development and realization of a design into a flexible and powerful web platform
10
 
89
 
90
  == Changelog ==
91
 
92
+ = 4.1.13 =
93
+ * Fix regression in widget rendering on non-existing positions
94
+ * PHP 7 compatibility fixes
95
+
96
  = 4.1.12 =
97
  * PHP 7 compatibility fixes
98
 
441
 
442
  == Upgrade Notice ==
443
 
444
+ = 4.1.13 =
445
+ Please remember to create a full site backup (files + database) before performing update.
446
+
447
  = 4.1.12 =
448
  Please remember to create a full site backup (files + database) before performing update.
449
 
widgets/breadcrumbs.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version 4.1.12 June 29, 2017
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  <?php
2
  /**
3
+ * @version 4.1.13 July 5, 2017
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
widgets/loginbutton.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version 4.1.12 June 29, 2017
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  <?php
2
  /**
3
+ * @version 4.1.13 July 5, 2017
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
widgets/loginform.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version 4.1.12 June 29, 2017
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  <?php
2
  /**
3
+ * @version 4.1.13 July 5, 2017
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only