diff --git a/.gitignore b/.gitignore index 57872d0f1e5f4..7d0c964c5373f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /vendor/ +.DS_Store +.sass-cache \ No newline at end of file diff --git a/.svnignore b/.svnignore new file mode 100644 index 0000000000000..5c764ee90941d --- /dev/null +++ b/.svnignore @@ -0,0 +1,8 @@ +.git/ +.gitignore +.travis.yml +readme.md +tests/ +_inc/lib/icalendar-reader.php +modules/shortcodes/upcoming-events.php +modules/widgets/upcoming-events.php diff --git a/.travis.yml b/.travis.yml index 7fcd8234b4870..948348dcf0e11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,38 +3,54 @@ # Tell Travis CI we're using PHP language: php -# Versions of PHP to test against +# PHP version used in first build configuration. php: - - "5.2" - - "5.3" - - "5.4" + - "5.5" -# Specify versions of WordPress to test against -# WP_VERSION = WordPress version number (use "master" for SVN trunk) -# WP_MULTISITE = whether to test multisite (use either "0" or "1") +# WordPress version used in first build configuration. env: - - WP_VERSION=master WP_MULTISITE=0 - - WP_VERSION=3.6 WP_MULTISITE=0 - - WP_VERSION=3.5.2 WP_MULTISITE=0 -# - WP_VERSION=3.4.2 WP_MULTISITE=0 -# - WP_VERSION=3.3.3 WP_MULTISITE=0 -# - WP_VERSION=3.2.1 WP_MULTISITE=0 - - WP_VERSION=master WP_MULTISITE=1 - - WP_VERSION=3.6 WP_MULTISITE=1 - - WP_VERSION=3.5.2 WP_MULTISITE=1 -# - WP_VERSION=3.4.2 WP_MULTISITE=1 -# - WP_VERSION=3.3.3 WP_MULTISITE=1 -# - WP_VERSION=3.2.1 WP_MULTISITE=1 - -# Grab the setup script and execute + - WP_VERSION=master + +# Next we define our matrix of additional build configurations to test against. +# The versions listed above will automatically create our first configuration, +# so it doesn't need to be re-defined below. + +# WP_VERSION specifies the tag to use. The way these tests are configured to run +# requires at least WordPress 3.8. Specify "master" to test against SVN trunk. + +# Note that Travis CI supports listing these above to automatically build a +# matrix of configurations, but we're being nice here by manually building a +# total of four configurations even though we're testing 4 versions of PHP +# along with 2 versions of WordPress (which would build 8 configs otherwise). +# This takes half as long to run while still providing adequate coverage. + +matrix: + include: +# - php: "5.3" +# env: WP_VERSION=master +# - php: "5.4" +# env: WP_VERSION=3.8 +# - php: "5.2" +# env: WP_VERSION=3.8 + +# Clones WordPress and configures our testing environment. before_script: - - wget https://raw.github.com/tierra/wordpress-plugin-tests/setup/setup.sh - - source setup.sh + - export PLUGIN_SLUG=$(basename $(pwd)) + - git clone https://github.com/tierra/wordpress.git /tmp/wordpress +# - git clone . "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG" + - cd .. + - mv $PLUGIN_SLUG "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG" + - cd /tmp/wordpress + - git checkout $WP_VERSION + - mysql -e "CREATE DATABASE wordpress_tests;" -uroot + - cp wp-tests-config-sample.php wp-tests-config.php + - sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php + - sed -i "s/yourusernamehere/travis/" wp-tests-config.php + - sed -i "s/yourpasswordhere//" wp-tests-config.php + - cd "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG" script: phpunit -# wordpress-plugin-tests specific config -# Tells Travis CI not to run unit tests against the setup branch -branches: - except: - - setup +notifications: + email: + - blobaugh@automattic.com diff --git a/3rd-party/3rd-party.php b/3rd-party/3rd-party.php new file mode 100644 index 0000000000000..1cf8bfb2efc27 --- /dev/null +++ b/3rd-party/3rd-party.php @@ -0,0 +1,8 @@ +Genericons Usage
+
@@ -252,6 +253,7 @@

Genericons Usage

+
diff --git a/_inc/genericons/font/genericons-regular-webfont.eot b/_inc/genericons/font/genericons-regular-webfont.eot index 6e71567730e98..46574695ece5d 100644 Binary files a/_inc/genericons/font/genericons-regular-webfont.eot and b/_inc/genericons/font/genericons-regular-webfont.eot differ diff --git a/_inc/genericons/font/genericons-regular-webfont.svg b/_inc/genericons/font/genericons-regular-webfont.svg index d9f0c82ed3e85..ef236c102009d 100644 --- a/_inc/genericons/font/genericons-regular-webfont.svg +++ b/_inc/genericons/font/genericons-regular-webfont.svg @@ -6,128 +6,130 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/_inc/genericons/font/genericons-regular-webfont.ttf b/_inc/genericons/font/genericons-regular-webfont.ttf index 7be71af30997b..b6f125e7eec0d 100644 Binary files a/_inc/genericons/font/genericons-regular-webfont.ttf and b/_inc/genericons/font/genericons-regular-webfont.ttf differ diff --git a/_inc/genericons/font/genericons-regular-webfont.woff b/_inc/genericons/font/genericons-regular-webfont.woff index 4d72659cea710..da8be383d8282 100644 Binary files a/_inc/genericons/font/genericons-regular-webfont.woff and b/_inc/genericons/font/genericons-regular-webfont.woff differ diff --git a/_inc/genericons/genericons.css b/_inc/genericons/genericons.css index 5a36281ad056f..b10b86fcf873c 100644 --- a/_inc/genericons/genericons.css +++ b/_inc/genericons/genericons.css @@ -16,7 +16,7 @@ @font-face { font-family: 'Genericons'; - src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAACs4AA4AAAAARowAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABwAAAAcaW/Oz0dERUYAAAFgAAAAHQAAACAAqwAET1MvMgAAAYAAAABCAAAAYFFfaIVjbWFwAAABxAAAAJcAAAGyqWOQYWdhc3AAAAJcAAAACAAAAAgAAAAQZ2x5ZgAAAmQAACOsAAA47IE+VnJoZWFkAAAmEAAAACsAAAA2BFJrzGhoZWEAACY8AAAAHAAAACQQAwfdaG10eAAAJlgAAACGAAABBlHsRCBsb2NhA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Q/bzdy2iPb4UTB3rE02jqsOae7nirjEp27uNR0MG/+j+BD21Xh+y24Qf2tjvcQYjr7CUnPVStm09eYLPycKb/Em9Zoq755u2fk2Pd/QGe+3ARAAB42m3S1XIUURRG4VmDBHd3d5k+Z5/uBIdAcHd3CRI0OBRPyCshmRWu6Kqp/6brm9qrutVujTy/frZS63/Pjz8/Wm3ajGEs4xhPDxOYyCQmM4WpTGM6M5jJLGYzh7nMYz4LWMgiFrOEpSxjOStYySpWs4a1rGM9G9jIJjazha1sYzsdKhKZoFDT0EsfO9jJLnazh73sYz8H6OcghxjgMEc4yjGOc4KTnOI0ZzjLOc5zgYtc4jJXuMo1rnODm9ziNne4yz3u84CHPOIxTxjkKc94zguGeMkrXvOGt7xjmPd84COf+MwXvvKN7z3DQ4OpDPT/3YGq03ErN7nZDbe4tdu4vW7fyCa9pJf0kl7SS3pJL+klvTTqVXqVXqVX6VV6lV6lV+lVepVe0kt6SS/pJb3U9bL3ZO/J3pO9J3tP7oy+X7uN2/3/0Amd0Amd0Amd0Amd+Od07wi7hF3CLmGXsEvYJewSdgm7hF3CLmGXsEvYJewSdomkl/SSXtLLelkv62W9rJf1sl7Wy3pZL/RCL/RCL/RCL/RCL/RCr+gVvaJX9Ipe0St6Ra/oFb1ar9ar9Wq9Wq/Wq/VqvVqv1mv0Gr1Gr9Frul7xuyp+V8XvqnTyb1UoNRm4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFhZsBQrAAAAAVLP0T8AAA==) format('woff'), url('font/genericons-regular-webfont.ttf') format('truetype'), url('font/genericons-regular-webfont.svg#genericonsregular') format('svg'); font-weight: normal; @@ -33,6 +33,7 @@ width: 16px; height: 16px; -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; font-size: 16px; line-height: 1; font-family: 'Genericons'; @@ -94,6 +95,7 @@ .genericon-reddit:before { content: '\f222'; } .genericon-stumbleupon:before { content: '\f223'; } .genericon-pocket:before { content: '\f224'; } +.genericon-dropbox:before { content: '\f225'; } /* Meta icons */ .genericon-comment:before { content: '\f300'; } @@ -181,6 +183,7 @@ .genericon-bold:before { content: '\f471'; } .genericon-italic:before { content: '\f472'; } .genericon-picture:before { content: '\f473'; } +.genericon-fullscreen:before { content: '\f474'; } /* Generic shapes */ .genericon-uparrow:before { content: '\f500'; } diff --git a/_inc/genericons/rtl/genericons-rtl.css b/_inc/genericons/rtl/genericons-rtl.css index 87c3182250449..88a279719f340 100644 --- a/_inc/genericons/rtl/genericons-rtl.css +++ b/_inc/genericons/rtl/genericons-rtl.css @@ -1,4 +1,4 @@ -/* This file was automatically generated on Sep 03 2013 15:45:11 */ +/* This file was automatically generated on Jan 10 2014 16:12:59 */ /** @@ -18,7 +18,7 @@ @font-face { font-family: 'Genericons'; - src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAC98ABEAAAAATZgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABgAAAABwAAAAcaBk2X0dERUYAAAGcAAAAHQAAACAAjwAET1MvMgAAAbwAAABCAAAAYFFfaIFjbWFwAAACAAAAAIcAAAGayK6UdGN2dCAAAAKIAAAABgAAAAYAfwEJZnBnbQAAApAAAAGxAAACZVO0L6dnYXNwAAAERAAAAAgAAAAI//8AA2dseWYAAARMAAAmfwAAPpi5AaxsaGVhZAAAKswAAAArAAAANgMOxuZoaGVhAAAq+AAAABwAAAAkEAMH3WhtdHgAACsUAAAAcAAAAM5JOTFAbG9jYQAAK4QAAADGAAAAxk3HPlxtYXhwAAAsTAAAACAAAAAgAYoBJW5hbWUAACxsAAABZgAAAwhJCWWYcG9zdAAALdQAAAFwAAAD3pfLCKFwcmVwAAAvRAAAAC4AAAAusPIrFHdlYmYAAC90AAAABgAAAAYLT1HIAAAAAQAAAADMPaLPAAAAAM3t18IAAAAAze27zXjaY2BkYGDgA2IJBhBgYmAEwkQgZgHzGAAIdQCUAAAAeNpjYGZ/zziBgZWBhdWY5QwDA8NMC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PGcubEma/pKxm4P4zsqlNrdL5aq3Y36Jbf719ddP973/5+dAMGrGEt61jPGBvYyCY2s4WtbGM7O9jJLnazh72Ms4/9HOAghzjMEY5yjOOc4CSnOM0EZzjLOc5zgYtMcokpLtNTCCpJY5ohM8xyhatc4zo3mOMmt7jNHe4yzwL3uM8DHvKIxyzyhKc84zkveMkrXvOGt7zjPUt84COf+MwXvo79/PF9vu/7f7lQVrOYYVYzzWZOm0NzxpxdztALvdALvdALvdALvdCLFa/oFb2iV/SKXtErI6/ao9qj2qPao9qj2qP2K/8NzVGP1Emd1Emd1Emd1EmdXHVGe9I96Z50T7on3ZPuSfdk0St6RS90Qid0Qid0Qid0Qid0qr2qXtWrelWv6lW9qlf1ql7qpV7qpV7qpV7qpV7qpV7Ta3pNr+m1kde8V/NezXu1vv4BRRflZLgB/4WwAY0AS7AIUFixAQGOWbFGBitYIbAQWUuwFFJYIbCAWR2wBitcWFmwFCsAAAABUcgLTgAA) format('woff'), + src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAENIABEAAAAAatQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABgAAAABwAAAAcaii0EkdERUYAAAGcAAAAHQAAACAArQAET1MvMgAAAbwAAABCAAAAYJdbaIVjbWFwAAACAAAAAJgAAAGyqWnWY2N2dCAAAAKYAAAADgAAAA4BYgHJZnBnbQAAAqgAAAGxAAACZVO0L6dnYXNwAAAEXAAAAAgAAAAIAAAAEGdseWYAAARkAAA5fgAAWkD4H3YjaGVhZAAAPeQAAAArAAAANgUfUT9oaGVhAAA+EAAAABwAAAAkEAMH3WhtdHgAAD4sAAAAiAAAAQpVkUB7bG9jYQAAPrQAAAECAAABAoDMauhtYXhwAAA/uAAAACAAAAAgAagCQm5hbWUAAD/YAAABYgAAAthC114IcG9zdAAAQTwAAAHUAAAFCuMEJONwcmVwAABDEAAAAC4AAAAusPIrFHdlYmYAAENAAAAABgAAAAbRQFLPAAAAAQAAAADMPaLPAAAAAM71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WP/tTb5nTGw/Rq/LrW74K4QTVznr6KeOUYRVV0pVPd6By0KC89l7lI489prufu6Xe1mi5hJtGMbaKMnN+Q/bzdy2iPb4UTB3rE02jqsOae7nirjEp27uNR0MG/+j+BD21Xh+y24Qf2tjvcQYjr7CUnPVStm09eYLPycKb/Em9Zoq755u2fk2Pd/QGe+3ARAAB42m3S1XIUURRG4VmDBHd3d5k+Z5/uBIdAcHd3CRI0OBRPyCshmRWu6Kqp/6brm9qrutVujTy/frZS63/Pjz8/Wm3ajGEs4xhPDxOYyCQmM4WpTGM6M5jJLGYzh7nMYz4LWMgiFrOEpSxjOStYySpWs4a1rGM9G9jIJjazha1sYzsdKhKZoFDT0EsfO9jJLnazh73sYz8H6OcghxjgMEc4yjGOc4KTnOI0ZzjLOc5zgYtc4jJXuMo1rnODm9ziNne4yz3u84CHPOIxTxjkKc94zguGeMkrXvOGt7xjmPd84COf+MwXvvKN7z3DQ4OpDPT/3YGq03ErN7nZDbe4tdu4vW7fyCa9pJf0kl7SS3pJL+klvTTqVXqVXqVX6VV6lV6lV+lVepVe0kt6SS/pJb3U9bL3ZO/J3pO9J3tP7oy+X7uN2/3/0Amd0Amd0Amd0Amd+Od07wi7hF3CLmGXsEvYJewSdgm7hF3CLmGXsEvYJewSdomkl/SSXtLLelkv62W9rJf1sl7Wy3pZL/RCL/RCL/RCL/RCL/RCr+gVvaJX9Ipe0St6Ra/oFb1ar9ar9Wq9Wq/Wq/VqvVqv1mv0Gr1Gr9Frul7xuyp+V8XvqnTyb1UoNRm4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFhZsBQrAAAAAVLP0T8AAA==) format('woff'), url('../font/genericons-regular-webfont.ttf') format('truetype'), url('../font/genericons-regular-webfont.svg#genericonsregular') format('svg'); font-weight: normal; @@ -35,6 +35,7 @@ width: 16px; height: 16px; -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; font-size: 16px; line-height: 1; font-family: 'Genericons'; @@ -59,109 +60,138 @@ */ /* Post formats */ -.genericon-standard:before { content: '\f100'; } -.genericon-aside:before { content: '\f101'; } -.genericon-image:before { content: '\f102'; } -.genericon-gallery:before { content: '\f103'; } -.genericon-video:before { content: '\f104'; } -.genericon-status:before { content: '\f105'; } -.genericon-quote:before { content: '\f106'; } -.genericon-link:before { content: '\f107'; } -.genericon-chat:before { content: '\f108'; } -.genericon-audio:before { content: '\f109'; } +.genericon-standard:before { content: '\f100'; } +.genericon-aside:before { content: '\f101'; } +.genericon-image:before { content: '\f102'; } +.genericon-gallery:before { content: '\f103'; } +.genericon-video:before { content: '\f104'; } +.genericon-status:before { content: '\f105'; } +.genericon-quote:before { content: '\f106'; } +.genericon-link:before { content: '\f107'; } +.genericon-chat:before { content: '\f108'; } +.genericon-audio:before { content: '\f109'; } /* Social icons */ -.genericon-github:before { content: '\f200'; } -.genericon-dribbble:before { content: '\f201'; } -.genericon-twitter:before { content: '\f202'; } -.genericon-facebook:before { content: '\f203'; } -.genericon-facebook-alt:before { content: '\f204'; } -.genericon-wordpress:before { content: '\f205'; } -.genericon-googleplus:before { content: '\f206'; } -.genericon-linkedin:before { content: '\f207'; } -.genericon-linkedin-alt:before { content: '\f208'; } -.genericon-pinterest:before { content: '\f209'; } -.genericon-pinterest-alt:before { content: '\f210'; } -.genericon-flickr:before { content: '\f211'; } -.genericon-vimeo:before { content: '\f212'; } -.genericon-youtube:before { content: '\f213'; } -.genericon-tumblr:before { content: '\f214'; } -.genericon-instagram:before { content: '\f215'; } -.genericon-codepen:before { content: '\f216'; } +.genericon-github:before { content: '\f200'; } +.genericon-dribbble:before { content: '\f201'; } +.genericon-twitter:before { content: '\f202'; } +.genericon-facebook:before { content: '\f203'; } +.genericon-facebook-alt:before { content: '\f204'; } +.genericon-wordpress:before { content: '\f205'; } +.genericon-googleplus:before { content: '\f206'; } +.genericon-linkedin:before { content: '\f207'; } +.genericon-linkedin-alt:before { content: '\f208'; } +.genericon-pinterest:before { content: '\f209'; } +.genericon-pinterest-alt:before { content: '\f210'; } +.genericon-flickr:before { content: '\f211'; } +.genericon-vimeo:before { content: '\f212'; } +.genericon-youtube:before { content: '\f213'; } +.genericon-tumblr:before { content: '\f214'; } +.genericon-instagram:before { content: '\f215'; } +.genericon-codepen:before { content: '\f216'; } +.genericon-polldaddy:before { content: '\f217'; } +.genericon-googleplus-alt:before { content: '\f218'; } +.genericon-path:before { content: '\f219'; } +.genericon-skype:before { content: '\f220'; } +.genericon-digg:before { content: '\f221'; } +.genericon-reddit:before { content: '\f222'; } +.genericon-stumbleupon:before { content: '\f223'; } +.genericon-pocket:before { content: '\f224'; } +.genericon-dropbox:before { content: '\f225'; } /* Meta icons */ -.genericon-comment:before { content: '\f300'; } -.genericon-category:before { content: '\f301'; } -.genericon-tag:before { content: '\f302'; } -.genericon-time:before { content: '\f303'; } -.genericon-user:before { content: '\f304'; } -.genericon-day:before { content: '\f305'; } -.genericon-week:before { content: '\f306'; } -.genericon-month:before { content: '\f307'; } -.genericon-pinned:before { content: '\f308'; } +.genericon-comment:before { content: '\f300'; } +.genericon-category:before { content: '\f301'; } +.genericon-tag:before { content: '\f302'; } +.genericon-time:before { content: '\f303'; } +.genericon-user:before { content: '\f304'; } +.genericon-day:before { content: '\f305'; } +.genericon-week:before { content: '\f306'; } +.genericon-month:before { content: '\f307'; } +.genericon-pinned:before { content: '\f308'; } /* Other icons */ -.genericon-search:before { content: '\f400'; } -.genericon-unzoom:before { content: '\f401'; } -.genericon-zoom:before { content: '\f402'; } -.genericon-show:before { content: '\f403'; } -.genericon-hide:before { content: '\f404'; } -.genericon-close:before { content: '\f405'; } -.genericon-close-alt:before { content: '\f406'; } -.genericon-trash:before { content: '\f407'; } -.genericon-star:before { content: '\f408'; } -.genericon-home:before { content: '\f409'; } -.genericon-mail:before { content: '\f410'; } -.genericon-edit:before { content: '\f411'; } -.genericon-reply:before { content: '\f412'; } -.genericon-feed:before { content: '\f413'; } -.genericon-warning:before { content: '\f414'; } -.genericon-share:before { content: '\f415'; } -.genericon-attachment:before { content: '\f416'; } -.genericon-location:before { content: '\f417'; } -.genericon-checkmark:before { content: '\f418'; } -.genericon-menu:before { content: '\f419'; } -.genericon-top:before { content: '\f420'; } -.genericon-minimize:before { content: '\f421'; } -.genericon-maximize:before { content: '\f422'; } -.genericon-404:before { content: '\f423'; } -.genericon-spam:before { content: '\f424'; } -.genericon-summary:before { content: '\f425'; } -.genericon-cloud:before { content: '\f426'; } -.genericon-key:before { content: '\f427'; } -.genericon-dot:before { content: '\f428'; } -.genericon-next:before { content: '\f429'; } -.genericon-previous:before { content: '\f430'; } -.genericon-expand:before { content: '\f431'; } -.genericon-collapse:before { content: '\f432'; } -.genericon-dropdown:before { content: '\f433'; } -.genericon-dropdown-left:before { content: '\f434'; } -.genericon-top:before { content: '\f435'; } -.genericon-draggable:before { content: '\f436'; } -.genericon-phone:before { content: '\f437'; } -.genericon-send-to-phone:before { content: '\f438'; } -.genericon-plugin:before { content: '\f439'; } -.genericon-cloud-download:before { content: '\f440'; } -.genericon-cloud-upload:before { content: '\f441'; } -.genericon-external:before { content: '\f442'; } -.genericon-document:before { content: '\f443'; } -.genericon-book:before { content: '\f444'; } -.genericon-cog:before { content: '\f445'; } -.genericon-unapprove:before { content: '\f446'; } -.genericon-cart:before { content: '\f447'; } -.genericon-pause:before { content: '\f448'; } -.genericon-stop:before { content: '\f449'; } -.genericon-skip-back:before { content: '\f450'; } -.genericon-skip-ahead:before { content: '\f451'; } -.genericon-play:before { content: '\f452'; } -.genericon-tablet:before { content: '\f453'; } -.genericon-send-to-tablet:before { content: '\f454'; } +.genericon-search:before { content: '\f400'; } +.genericon-unzoom:before { content: '\f401'; } +.genericon-zoom:before { content: '\f402'; } +.genericon-show:before { content: '\f403'; } +.genericon-hide:before { content: '\f404'; } +.genericon-close:before { content: '\f405'; } +.genericon-close-alt:before { content: '\f406'; } +.genericon-trash:before { content: '\f407'; } +.genericon-star:before { content: '\f408'; } +.genericon-home:before { content: '\f409'; } +.genericon-mail:before { content: '\f410'; } +.genericon-edit:before { content: '\f411'; } +.genericon-reply:before { content: '\f412'; } +.genericon-feed:before { content: '\f413'; } +.genericon-warning:before { content: '\f414'; } +.genericon-share:before { content: '\f415'; } +.genericon-attachment:before { content: '\f416'; } +.genericon-location:before { content: '\f417'; } +.genericon-checkmark:before { content: '\f418'; } +.genericon-menu:before { content: '\f419'; } +.genericon-refresh:before { content: '\f420'; } +.genericon-minimize:before { content: '\f421'; } +.genericon-maximize:before { content: '\f422'; } +.genericon-404:before { content: '\f423'; } +.genericon-spam:before { content: '\f424'; } +.genericon-summary:before { content: '\f425'; } +.genericon-cloud:before { content: '\f426'; } +.genericon-key:before { content: '\f427'; } +.genericon-dot:before { content: '\f428'; } +.genericon-next:before { content: '\f429'; } +.genericon-previous:before { content: '\f430'; } +.genericon-expand:before { content: '\f431'; } +.genericon-collapse:before { content: '\f432'; } +.genericon-dropdown:before { content: '\f433'; } +.genericon-dropdown-left:before { content: '\f434'; } +.genericon-top:before { content: '\f435'; } +.genericon-draggable:before { content: '\f436'; } +.genericon-phone:before { content: '\f437'; } +.genericon-send-to-phone:before { content: '\f438'; } +.genericon-plugin:before { content: '\f439'; } +.genericon-cloud-download:before { content: '\f440'; } +.genericon-cloud-upload:before { content: '\f441'; } +.genericon-external:before { content: '\f442'; } +.genericon-document:before { content: '\f443'; } +.genericon-book:before { content: '\f444'; } +.genericon-cog:before { content: '\f445'; } +.genericon-unapprove:before { content: '\f446'; } +.genericon-cart:before { content: '\f447'; } +.genericon-pause:before { content: '\f448'; } +.genericon-stop:before { content: '\f449'; } +.genericon-skip-back:before { content: '\f450'; } +.genericon-skip-ahead:before { content: '\f451'; } +.genericon-play:before { content: '\f452'; } +.genericon-tablet:before { content: '\f453'; } +.genericon-send-to-tablet:before { content: '\f454'; } +.genericon-info:before { content: '\f455'; } +.genericon-notice:before { content: '\f456'; } +.genericon-help:before { content: '\f457'; } +.genericon-fastforward:before { content: '\f458'; } +.genericon-rewind:before { content: '\f459'; } +.genericon-portfolio:before { content: '\f460'; } +.genericon-heart:before { content: '\f461'; } +.genericon-code:before { content: '\f462'; } +.genericon-subscribe:before { content: '\f463'; } +.genericon-unsubscribe:before { content: '\f464'; } +.genericon-subscribed:before { content: '\f465'; } +.genericon-reply-alt:before { content: '\f466'; } +.genericon-reply-single:before { content: '\f467'; } +.genericon-flag:before { content: '\f468'; } +.genericon-print:before { content: '\f469'; } +.genericon-lock:before { content: '\f470'; } +.genericon-bold:before { content: '\f471'; } +.genericon-italic:before { content: '\f472'; } +.genericon-picture:before { content: '\f473'; } +.genericon-fullscreen:before { content: '\f474'; } /* Generic shapes */ -.genericon-uparrow:before { content: '\f500'; } -.genericon-rightarrow:before { content: '\f501'; } -.genericon-downarrow:before { content: '\f502'; } -.genericon-leftarrow:before { content: '\f503'; } +.genericon-uparrow:before { content: '\f500'; } +.genericon-rightarrow:before { content: '\f501'; } +.genericon-downarrow:before { content: '\f502'; } +.genericon-leftarrow:before { content: '\f503'; } diff --git a/_inc/images/module-icons-sprite-2x.png b/_inc/images/module-icons-sprite-2x.png index fa54e71922a1e..59791eae333dd 100644 Binary files a/_inc/images/module-icons-sprite-2x.png and b/_inc/images/module-icons-sprite-2x.png differ diff --git a/_inc/images/module-icons-sprite.png b/_inc/images/module-icons-sprite.png index de6fe64dfb4e6..29f7e7d49541a 100644 Binary files a/_inc/images/module-icons-sprite.png and b/_inc/images/module-icons-sprite.png differ diff --git a/_inc/images/rss/pink-small.png b/_inc/images/rss/pink-small.png index 7b959e3a186e5..c25376d0585e0 100644 Binary files a/_inc/images/rss/pink-small.png and b/_inc/images/rss/pink-small.png differ diff --git a/_inc/images/screenshots/google-plus.png b/_inc/images/screenshots/google-plus.png index 336001f7d4f88..8c7c81c76e739 100644 Binary files a/_inc/images/screenshots/google-plus.png and b/_inc/images/screenshots/google-plus.png differ diff --git a/_inc/images/screenshots/related-posts.png b/_inc/images/screenshots/related-posts.png new file mode 100644 index 0000000000000..6eafc3a85342c Binary files /dev/null and b/_inc/images/screenshots/related-posts.png differ diff --git a/_inc/jetpack.css b/_inc/jetpack.css index d67b08aa86585..a3ef18063dbf1 100644 --- a/_inc/jetpack.css +++ b/_inc/jetpack.css @@ -40,7 +40,9 @@ .toplevel_page_jetpack ul#adminmenu a.wp-has-current-submenu:after, .toplevel_page_jetpack ul#adminmenu > li.current > a.current:after, .jetpack-pagestyles ul#adminmenu a.wp-has-current-submenu:after, -.jetpack-pagestyles ul#adminmenu > li.current > a.current:after { +.jetpack-pagestyles ul#adminmenu > li.current > a.current:after, +.jetpack_page_jetpack-settings.network-admin ul#adminmenu a.wp-has-current-submenu:after, +.jetpack_page_jetpack-settings.network-admin ul#adminmenu > li.current > a.current:after { border-right-color:#8fad4b; } @@ -65,7 +67,9 @@ } .toplevel_page_jetpack.jetpack-connected #wpwrap, -.jetpack-pagestyles.jetpack-connected #wpwrap { +.jetpack-pagestyles.jetpack-connected #wpwrap, +.toplevel_page_jetpack.network-admin #wpwrap, +.jetpack_page_jetpack-settings.network-admin #wpwrap { background: url(images/header-clouds-small.png) 52px 0 repeat-x; } @@ -121,10 +125,18 @@ margin: 30px 0 -30px 0; } +.network-admin #jp-header { + margin-bottom: -50px; +} + #jp-header.small { margin: 20px 0 50px; } +.network-admin #jp-header.small { + margin-bottom: 30px; +} + #jp-header #jp-clouds { position: relative; padding-top: 110px; @@ -192,7 +204,9 @@ } .toplevel_page_jetpack.jetpack-connected #wpwrap, - .jetpack-pagestyles.jetpack-connected #wpwrap { + .jetpack-pagestyles.jetpack-connected #wpwrap, + .toplevel_page_jetpack.network-admin #wpwrap, + .jetpack_page_jetpack-settings.network-admin #wpwrap { background-image: url(images/header-clouds-small-2x.png); background-size: 980px 140px; } @@ -229,6 +243,13 @@ top: -35px; } +.network-admin #jp-header h3 { + background: transparent url(images/logo-small.png) top left no-repeat; + width: 150px; + height: 120px; + left: 18px; +} + /* Retina Logo */ @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), @@ -240,7 +261,8 @@ background-size: 250px 200px; } - #jp-header.small h3 { + #jp-header.small h3, + .network-admin #jp-header h3 { background-image: url(images/logo-small-2x.png); background-size: 150px 120px; } @@ -355,6 +377,11 @@ overflow: hidden; } +.jetpack-message h2 { + color: #fff; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); +} + .jetpack-message h4 { margin: 0 10px 10px 0; font-size: 18px; @@ -365,6 +392,10 @@ display: inline-block; } +.jetpack-message.jp-multisite h4 { + margin-bottom: 0; +} + .jetpack-message h5 { margin: 0; } @@ -666,8 +697,8 @@ p.jp-help { border-top-left-radius: 3px; border-bottom-left-radius: 3px; background-repeat: no-repeat; - background-image: url(images/module-icons-sprite.png?v2.6); - background-size: 3155px 50px; /* remember to update this every time a new module is added! */ + background-image: url(images/module-icons-sprite.png?v2.8); + background-size: 3315px 50px; /* remember to update this every time a new module is added! */ } @media only screen and (-moz-min-device-pixel-ratio: 1.5), @@ -676,7 +707,7 @@ p.jp-help { only screen and (min-device-pixel-ratio: 1.5) { .jetpack-module div.module-image { - background-image: url(images/module-icons-sprite-2x.png?v2.6); + background-image: url(images/module-icons-sprite-2x.png?v2.8); } } @@ -806,11 +837,18 @@ p.jp-help { background-position: -2980px 5px; } - #sso.jetpack-module div.module-image { background-position: -3070px 5px; } +#markdown.jetpack-module div.module-image { + background-position: -3161px 5px; +} + +#related-posts.jetpack-module div.module-image { + background-position: -3235px 5px; +} + .jetpack-module div.module-image p { background-color: #b4d278; color: #fff; @@ -1063,7 +1101,6 @@ p#news-sub { .error, .updated { position: relative; - z-index: 100; } .toplevel_page_jetpack .wrap { @@ -1092,6 +1129,10 @@ p#news-sub { margin: 10px 13px 40px 15px; } +.network-admin #jetpack-settings .wrap { + margin: 10px 18px 30px 18px; +} + .jp-survey h4 { margin: 0; font-size: 18px; @@ -1207,6 +1248,10 @@ p#news-sub { cursor: pointer; } +.network-admin .jetpack-install-container p a.button-connector { + bottom: 15px; +} + .jetpack-install-container p a.button-connector:hover, .jetpack-install-container p a.button-connector:active { background-color: #f0a000; diff --git a/_inc/jquery.jetpack-sync.js b/_inc/jquery.jetpack-sync.js new file mode 100644 index 0000000000000..35cb4a9139c0b --- /dev/null +++ b/_inc/jquery.jetpack-sync.js @@ -0,0 +1,59 @@ +jQuery( document ).ready( function($) { + var update = function( cooldown ) { + var self = $( '.jetpack_sync_reindex_control' ); + + self + .find( '.jetpack_sync_reindex_control_action' ) + .attr( 'disabled', true ); + + self + .find( '.jetpack_sync_reindex_control_status' ) + .html( '…' ); + + if ( 'DONE' == self.data( 'status' ) ) { + var data = { action:'jetpack-sync-reindex-trigger' }; + } else { + var data = { action:'jetpack-sync-reindex-status' }; + } + + $.getJSON( + ajaxurl, + data, + function( response ) { + var self = $( '.jetpack_sync_reindex_control' ); + var strings = self.data( 'strings' ); + var status = strings[response.status]['status']; + + if ( 'INDEXING' == response.status ) { + status += ' (' + Math.floor( 100 * response.posts.imported / response.posts.total ) + '%)'; + } + + self + .data( 'status', response.status ); + + self + .find( '.jetpack_sync_reindex_control_action' ) + .val( strings[response.status]['action'] ); + + self + .find( '.jetpack_sync_reindex_control_status' ) + .text( status ); + + setTimeout( function() { + $( '.jetpack_sync_reindex_control' ) + .find( '.jetpack_sync_reindex_control_action' ) + .attr( 'disabled', false ); + }, cooldown ); + } + ); + }; + + $( '.jetpack_sync_reindex_control' ) + .find( '.jetpack_sync_reindex_control_action' ) + .live( 'click', function( event ) { + event.preventDefault(); + update( 5000 ); + } ); + + update( 1000 ); +} ); diff --git a/lib/class.color.php b/_inc/lib/class.color.php similarity index 100% rename from lib/class.color.php rename to _inc/lib/class.color.php diff --git a/_inc/lib/icalendar-reader.php b/_inc/lib/icalendar-reader.php new file mode 100644 index 0000000000000..5daaf048be605 --- /dev/null +++ b/_inc/lib/icalendar-reader.php @@ -0,0 +1,771 @@ +timezone = $this->timezone_from_string( $vcal['TIMEZONE'] ); + + if ( isset( $vcal['VEVENT'] ) ) { + $vevent = $vcal['VEVENT']; + + if ( $count > 0 ) + $vevent = array_slice( $vevent, 0, $count ); + + $this->cal['VEVENT'] = $vevent; + + return $this->cal['VEVENT']; + } + } + + if ( ! $this->parse( $url ) ) + return false; + + $vcal = array(); + + if ( $this->timezone ) { + $vcal['TIMEZONE'] = $this->timezone->getName(); + } else { + $this->timezone = $this->timezone_from_string( '' ); + } + + if ( ! empty( $this->cal['VEVENT'] ) ) { + $vevent = $this->cal['VEVENT']; + + // check for recurring events + // $vevent = $this->add_recurring_events( $vevent ); + + // remove before caching - no sense in hanging onto the past + $vevent = $this->filter_past_and_recurring_events( $vevent ); + + // order by soonest start date + $vevent = $this->sort_by_recent( $vevent ); + + $vcal['VEVENT'] = $vevent; + } + + set_transient( $transient_id, $vcal, HOUR_IN_SECONDS ); + + if ( !isset( $vcal['VEVENT'] ) ) + return false; + + if ( $count > 0 ) + return array_slice( $vcal['VEVENT'], 0, $count ); + + return $vcal['VEVENT']; + } + + protected function filter_past_and_recurring_events( $events ) { + $upcoming = array(); + $set_recurring_events = array(); + $current = time(); + + foreach ( $events as $event ) { + + $date_from_ics = strtotime( $event['DTSTART'] ); + + if ( isset( $event['RRULE'] ) && $this->timezone->getName() && 8 != strlen( $event['DTSTART'] ) ) { + $adjusted_time = new DateTime( $event['DTSTART'], new DateTimeZone('UTC') ); + $adjusted_time->setTimeZone( new DateTimeZone( $this->timezone->getName() ) ); + $event['DTSTART'] = $adjusted_time->format('Ymd\THis'); + + $adjusted_time = new DateTime( $event['DTEND'], new DateTimeZone('UTC') ); + $adjusted_time->setTimeZone( new DateTimeZone( $this->timezone->getName() ) ); + $event['DTEND'] = $adjusted_time->format('Ymd\THis'); + } + + if ( ! isset( $event['DTSTART'] ) ) + continue; + + // use end time if it's there + $time = ( isset( $event['DTEND'] ) ) ? $event['DTEND'] : $event['DTSTART']; + $end = strtotime( $time ); + + // process events with RRULE before other events + + $rrule = isset( $event['RRULE'] ) ? $event['RRULE'] : false ; + $uid = $event['UID']; + + if ( $rrule && ! in_array( $uid, $set_recurring_events ) ) { + + // break down the RRULE into digestible chunks + $rrule_array = array(); + + foreach ( explode( ";", $event['RRULE'] ) as $rline ) { + list( $rkey, $rvalue ) = explode( "=", $rline, 2 ); + $rrule_array[$rkey] = $rvalue; + } + + switch ( $rrule_array['FREQ'] ) { + + case 'DAILY': + $frequency = 'day'; + if ( $date_from_ics >= $current ) { + $echo_limit = 10; + if ( 8 == strlen( $event['DTSTART'] ) ) { + $recurring_event_date_start = date( "Ymd", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd", strtotime( $event['DTEND'] ) ); + } else { + $recurring_event_date_start = date( "Ymd\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd\THis", strtotime( $event['DTEND'] ) ); + } + } else { + $echo_limit = 10; + $current_date = date( 'Ymd' ); + if ( 8 == strlen( $event['DTSTART'] ) ) { + $recurring_event_date_start = $current_date; + $recurring_event_date_end = $current_date; + } else { + $recurring_event_date_start = $current_date . date( "\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = $current_date . date( "\THis", strtotime( $event['DTEND'] ) ); + } + } + break; + + case 'WEEKLY': + $frequency = 'week'; + if ( $date_from_ics >= $current ) { + $echo_limit = 2; + if ( 8 == strlen( $event['DTSTART'] ) ) { + $recurring_event_date_start = date( "Ymd", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd", strtotime( $event['DTEND'] ) ); + } else { + $recurring_event_date_start = date( "Ymd\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd\THis", strtotime( $event['DTEND'] ) ); + } + } else { + $echo_limit = 3; + $current_date = date( 'Ym' ); + if ( 8 == strlen( $event['DTSTART'] ) ) { + $recurring_event_date_start = date( "d", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "d", strtotime( $event['DTEND'] ) ); + } else { + $recurring_event_date_start = $current_date . date( "d\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = $current_date . date( "d\THis", strtotime( $event['DTEND'] ) ); + } + } + + // Build list of days of week to add events + $weekdays = array( 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA' ); + $bydays = ( isset( $rrule_array['BYDAY'] ) && $rrule_array['BYDAY'] != '' ) ? explode( ',', $rrule_array['BYDAY'] ) : $weekdays; + break; + + case 'MONTHLY': + $frequency = 'month'; + if ( $date_from_ics >= $current ) { + $echo_limit = 1; + if ( 8 == strlen( $event['DTSTART'] ) ) { + $recurring_event_date_start = date( "Ymd", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd", strtotime( $event['DTEND'] ) ); + } else { + $recurring_event_date_start = date( "Ymd\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd\THis", strtotime( $event['DTEND'] ) ); + } + } else { + $echo_limit = 2; + $current_date = date( 'Ym' ); + if ( 8 == strlen( $event['DTSTART'] ) ) { + $recurring_event_date_start = date( "d", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "d", strtotime( $event['DTEND'] ) ); + } else { + $recurring_event_date_start = $current_date . date( "d\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = $current_date . date( "d\THis", strtotime( $event['DTEND'] ) ); + } + } + break; + + case 'YEARLY': + $frequency = 'year'; + if ( $date_from_ics >= $current ) { + $echo_limit = 1; + if ( 8 == strlen( $event['DTSTART'] ) ) { + $recurring_event_date_start = date( "Ymd", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd", strtotime( $event['DTEND'] ) ); + } else { + $recurring_event_date_start = date( "Ymd\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd\THis", strtotime( $event['DTEND'] ) ); + } + } else { + $echo_limit = 1; + $current_date = date( 'Y' ); + if ( 8 == strlen( $event['DTSTART'] ) ) { + $recurring_event_date_start = date( "md", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "md", strtotime( $event['DTEND'] ) ); + } else { + $recurring_event_date_start = $current_date . date( "md\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = $current_date . date( "md\THis", strtotime( $event['DTEND'] ) ); + } + } + break; + + default: + $frequency = false; + } + + if ( isset( $rrule_array['COUNT'] ) ) { + $rrule_count = $rrule_array['COUNT']; + $echo_limit = 50; + } + + if ( $frequency !== false ) { + + $interval = ( isset( $rrule_array['INTERVAL'] ) ) ? $rrule_array['INTERVAL'] : 1; + $count_counter = 1; + + for ( $i = 1; $i <= $echo_limit; $i++ ) { + if ( isset( $rrule_array['COUNT'] ) && $i === 1 ) { + $recurring_event_date_start = date( "Ymd\THis", strtotime( $event['DTSTART'] ) ); + $recurring_event_date_end = date( "Ymd\THis", strtotime( $event['DTEND'] ) ); + } elseif ( $i === 1 ) { + // variables set in switch above + $rrule_count = 10; + } else { + $recurring_event_date_start = date( "Ymd\THis", strtotime( $event['DTSTART'] . '+' . $interval . ' ' . $frequency . 's' ) ); + $recurring_event_date_end = date( "Ymd\THis", strtotime( $event['DTEND'] . '+' . $interval . ' ' . $frequency . 's' ) ); + } + $event_start = strtotime( $recurring_event_date_start ); + $event_end = strtotime( $recurring_event_date_end ); + $until = ( isset( $rrule_array['UNTIL'] ) ) ? strtotime( $rrule_array['UNTIL'] ) : strtotime( '+1 year' ); + $exdate = ( isset( $event['EXDATE;VALUE=DATE'] ) ) ? $event['EXDATE;VALUE=DATE'] : null; + + if ( isset( $rrule_array['BYDAY'] ) && $frequency === 'week' ) { + if ( $rrule_array['BYDAY'] === "SU" ) { + if ( 8 == strlen( $event['DTSTART'] ) ) { + $byday_event_date_start = date( "Ymd", strtotime( "last Sunday", strtotime( $recurring_event_date_start ) ) ); + $byday_event_date_end = date( "Ymd", strtotime( "last Sunday", strtotime( $recurring_event_date_start ) ) ); + } else { + $byday_event_date_start = date( "Ymd\T", strtotime( "last Sunday", strtotime( $recurring_event_date_start ) ) ) . date( "His", strtotime( $recurring_event_date_start) ); + $byday_event_date_end = date( "Ymd\T", strtotime( "last Sunday", strtotime( $recurring_event_date_end ) ) ) . date( "His", strtotime( $recurring_event_date_end) ); + } + } else { + if ( 8 == strlen( $event['DTSTART'] ) ) { + $byday_event_date_start = date( "Ymd", strtotime( "last Sunday", strtotime( $recurring_event_date_start ) ) ); + $byday_event_date_end = date( "Ymd", strtotime( "last Sunday", strtotime( $recurring_event_date_end ) ) ); + } else { + $byday_event_date_start = date( "Ymd\T", strtotime( "last Sunday", strtotime( $recurring_event_date_start ) ) ) . date( "His", strtotime( $recurring_event_date_start) ); + $byday_event_date_end = date( "Ymd\T", strtotime( "last Sunday", strtotime( $recurring_event_date_end ) ) ) . date( "His", strtotime( $recurring_event_date_end) ); + } + } + $byday_event_start = strtotime( $byday_event_date_start ); + $byday_event_end = strtotime( $byday_event_date_end ); + + foreach ( $weekdays as $day ) { + // Check if day should be added + if ( in_array( $day, $bydays ) && $byday_event_end >= $current && $byday_event_end <= $until && $count_counter <= $rrule_count && $byday_event_start >= $date_from_ics && $byday_event_date_start != $exdate ) { + + // Add event to day + $event['DTSTART'] = $byday_event_date_start; + $event['DTEND'] = $byday_event_date_end; + + if ( $this->timezone->getName() && 8 != strlen( $event['DTSTART'] ) ) { + $adjusted_time = new DateTime( $event['DTSTART'], new DateTimeZone( $this->timezone->getName() ) ); + $adjusted_time->setTimeZone( new DateTimeZone( 'UTC' ) ); + $event['DTSTART'] = $adjusted_time->format('Ymd\THis'); + + $adjusted_time = new DateTime( $event['DTEND'], new DateTimeZone( $this->timezone->getName() ) ); + $adjusted_time->setTimeZone( new DateTimeZone( 'UTC' ) ); + $event['DTEND'] = $adjusted_time->format('Ymd\THis'); + } + + $upcoming[] = $event; + $count_counter++; + } elseif ( in_array( $day, $bydays ) && $count_counter <= $rrule_count ) { + $count_counter++; + } else { + $event['DTSTART'] = $byday_event_date_start; + $event['DTEND'] = $byday_event_date_end; + } + // Move forward a day + if ( 8 == strlen( $event['DTSTART'] ) ) { + $byday_event_date_start = date( "Ymd", strtotime( $byday_event_date_start . '+1 day' ) ); + $byday_event_date_end = date( "Ymd", strtotime( $byday_event_date_end . '+1 day' ) ); + } else { + $byday_event_date_start = date( "Ymd\THis", strtotime( $byday_event_date_start . '+1 day' ) ); + $byday_event_date_end = date( "Ymd\THis", strtotime( $byday_event_date_end . '+1 day' ) ); + } + $byday_event_start = strtotime( $byday_event_date_start ); + $byday_event_end = strtotime( $byday_event_date_end ); + + } + + } elseif ( isset( $rrule_array['BYDAY'] ) && $frequency === 'month' ) { + $byday_monthly_date_start = strtotime( $recurring_event_date_start ); + $start_time = date( 'His', $byday_monthly_date_start ); + $day_number = substr( $rrule_array['BYDAY'], 0, 1 ); + $week_day = substr( $rrule_array['BYDAY'], 1 ); + $day_cardinals = array( 1 => 'first', 2 => 'second', 3 => 'third', 4 => 'fourth', 5 => 'fifth' ); + $weekdays = array( 'SU' => 'sunday', 'MO' => 'monday', 'TU' => 'tuesday', 'WE' => 'wednesday', 'TH' => 'thursday', 'FR' => 'friday', 'SA' => 'saturday' ); + $event_start_desc = "{$day_cardinals[$day_number]} {$weekdays[$week_day]} of " . date( 'F', $byday_monthly_date_start ) . " " . date( 'Y', $byday_monthly_date_start ) . " " . date( 'H:i:s', $byday_monthly_date_start ); + $event_start_timestamp = strtotime( $event_start_desc ); + $exdate_compare = date( "Ymd", strtotime( $event_start_desc ) ); + + if ( $event_start_timestamp > $current && $event_start_timestamp < $until && $count_counter <= $rrule_count && $event_start_timestamp >= $date_from_ics && $exdate_compare != $exdate ) { + if ( 8 == strlen( $event['DTSTART'] ) ) { + $event['DTSTART'] = date( 'Ymd', $event_start_timestamp ); + $event['DTEND'] = date( 'Ymd', strtotime( $event['DTEND'] ) . "+" . $interval . " " . $frequency . "s" ); + } else { + $event['DTSTART'] = date( 'Ymd\T', $event_start_timestamp ) . $start_time; + $event['DTEND'] = date( 'Ymd\THis', strtotime( $event['DTEND'] ) . "+" . $interval . " " . $frequency . "s" ); + } + if ( $this->timezone->getName() && 8 != strlen( $event['DTSTART'] ) ) { + $adjusted_time = new DateTime( $event['DTSTART'], new DateTimeZone( $this->timezone->getName() ) ); + $adjusted_time->setTimeZone( new DateTimeZone( 'UTC' ) ); + $event['DTSTART'] = $adjusted_time->format('Ymd\THis'); + + $adjusted_time = new DateTime( $event['DTEND'], new DateTimeZone( $this->timezone->getName() ) ); + $adjusted_time->setTimeZone( new DateTimeZone( 'UTC' ) ); + $event['DTEND'] = $adjusted_time->format('Ymd\THis'); + } + $upcoming[] = $event; + $count_counter++; + } else { + if ( 8 == strlen( $event['DTSTART'] ) ) { + $event['DTSTART'] = date( 'Ymd', $event_start_timestamp ); + $event['DTEND'] = date( 'Ymd', strtotime( $event['DTEND'] ) . "+" . $interval . " " . $frequency . "s" ); + } else { + $event['DTSTART'] = date( 'Ymd\T', $event_start_timestamp ) . $start_time; + $event['DTEND'] = date( 'Ymd\THis', strtotime( $event['DTEND'] ) . "+" . $interval . " " . $frequency . "s" ); + } + } + + } elseif ( $event_start >= $date_from_ics && $event_end >= $current && $event_end <= $until && $count_counter <= $rrule_count ) { + $event['DTSTART'] = $recurring_event_date_start; + $event['DTEND'] = $recurring_event_date_end; + + $exdate_compare = date( "Ymd", strtotime( $recurring_event_date_start ) ); + + if ( $this->timezone->getName() ) { + $adjusted_time = new DateTime( $event['DTSTART'], new DateTimeZone( $this->timezone->getName() ) ); + $adjusted_time->setTimeZone( new DateTimeZone( 'UTC' ) ); + $event['DTSTART'] = $adjusted_time->format('Ymd\THis'); + + $adjusted_time = new DateTime( $event['DTEND'], new DateTimeZone( $this->timezone->getName() ) ); + $adjusted_time->setTimeZone( new DateTimeZone( 'UTC' ) ); + $event['DTEND'] = $adjusted_time->format('Ymd\THis'); + } + if ( $exdate_compare != $exdate ) { + $upcoming[] = $event; + $count_counter++; + } + } else { + $event['DTSTART'] = $recurring_event_date_start; + $event['DTEND'] = $recurring_event_date_end; + $count_counter++; + } + } + $set_recurring_events[] = $uid; + + } + + } else { + // now process normal events + if ( $end >= $current ) + $upcoming[] = $event; + } + } + return $upcoming; + } + + /** + * Parse events from an iCalendar feed + * + * @param string $url (default: '') + * @return array | false on failure + */ + public function parse( $url = '' ) { + $cache_group = 'icalendar_reader_parse'; + $disable_get_key = 'disable:' . md5( $url ); + + // Check to see if previous attempts have failed + if ( false !== wp_cache_get( $disable_get_key, $cache_group ) ) + return false; + + // rewrite webcal: URI schem to HTTP + $url = preg_replace('/^webcal/', 'http', $url ); + // try to fetch + $r = wp_remote_get( $url, array( 'timeout' => 3, 'sslverify' => false ) ); + if ( 200 !== wp_remote_retrieve_response_code( $r ) ) { + // We were unable to fetch any content, so don't try again for another 60 seconds + wp_cache_set( $disable_get_key, 1, $cache_group, 60 ); + return false; + } + + $body = wp_remote_retrieve_body( $r ); + if ( empty( $body ) ) + return false; + + $body = str_replace( "\r\n", "\n", $body ); + $lines = preg_split( "/\n(?=[A-Z])/", $body ); + + if ( empty( $lines ) ) + return false; + + if ( false === stristr( $lines[0], 'BEGIN:VCALENDAR' ) ) + return false; + + foreach ( $lines as $line ) { + $add = $this->key_value_from_string( $line ); + if ( ! $add ) { + $this->add_component( $type, false, $line ); + continue; + } + list( $keyword, $value ) = $add; + + switch ( $keyword ) { + case 'BEGIN': + case 'END': + switch ( $line ) { + case 'BEGIN:VTODO': + $this->todo_count++; + $type = 'VTODO'; + break; + case 'BEGIN:VEVENT': + $this->event_count++; + $type = 'VEVENT'; + break; + case 'BEGIN:VCALENDAR': + case 'BEGIN:DAYLIGHT': + case 'BEGIN:VTIMEZONE': + case 'BEGIN:STANDARD': + $type = $value; + break; + case 'END:VTODO': + case 'END:VEVENT': + case 'END:VCALENDAR': + case 'END:DAYLIGHT': + case 'END:VTIMEZONE': + case 'END:STANDARD': + $type = 'VCALENDAR'; + break; + } + break; + case 'TZID': + if ( 'VTIMEZONE' == $type && ! $this->timezone ) + $this->timezone = $this->timezone_from_string( $value ); + break; + case 'X-WR-TIMEZONE': + if ( ! $this->timezone ) + $this->timezone = $this->timezone_from_string( $value ); + break; + default: + $this->add_component( $type, $keyword, $value ); + break; + } + } + return $this->cal; + } + + /** + * Parse key:value from a string + * + * @param string $text (default: '') + * @return array + */ + public function key_value_from_string( $text = '' ) { + preg_match( '/([^:]+)(;[^:]+)?[:]([\w\W]*)/', $text, $matches ); + + if ( 0 == count( $matches ) ) + return false; + + return array( $matches[1], $matches[3] ); + } + + /** + * Convert a timezone name into a timezone object. + * + * @param string $text Timezone name. Example: America/Chicago + * @return object|null A DateTimeZone object if the conversion was successful. + */ + private function timezone_from_string( $text ) { + try { + $timezone = new DateTimeZone( $text ); + } catch ( Exception $e ) { + $blog_timezone = get_option( 'timezone_string' ); + if ( ! $blog_timezone ) { + $blog_timezone = 'Etc/UTC'; + } + + $timezone = new DateTimeZone( $blog_timezone ); + } + + return $timezone; + } + + /** + * Add a component to the calendar array + * + * @param string $component (default: '') + * @param string $keyword (default: '') + * @param string $value (default: '') + * @return void + */ + public function add_component( $component = '', $keyword = '', $value = '' ) { + if ( false == $keyword ) { + $keyword = $this->last_keyword; + switch ( $component ) { + case 'VEVENT': + $value = $this->cal[ $component ][ $this->event_count - 1 ][ $keyword ] . $value; + break; + case 'VTODO' : + $value = $this->cal[ $component ][ $this->todo_count - 1 ][ $keyword ] . $value; + break; + } + } + + if ( stristr( $keyword, 'DTSTART' ) || stristr( $keyword, 'DTEND' ) ) { + $keyword = explode( ';', $keyword ); + + /* + * Some events have a specific timzeone set in their start/end date, + * and it may or may not be different than the calendar timzeone. + * I.e: "DTSTART;TZID=America/Los_Angeles:20130124T173000" + * Since we're already adjusting the timezone on presentation, let's normalize all times to default UTC now + */ + if ( strpos( $keyword[1], "TZID") !== false ) { + $tzid = explode( '=', $keyword[1] ); + $tzid = $this->timezone_from_string( $tzid[1] ); + if ( $tzid ) { + $adjusted_time = new DateTime( $value, $tzid ); + $adjusted_time->setTimeZone( new DateTimeZone( 'UTC' ) ); + $value = $adjusted_time->format('Ymd\THis'); + } + } + + $keyword = $keyword[0]; + } + + switch ($component) { + case 'VTODO': + $this->cal[ $component ][ $this->todo_count - 1 ][ $keyword ] = $value; + break; + case 'VEVENT': + $this->cal[ $component ][ $this->event_count - 1 ][ $keyword ] = $value; + break; + default: + $this->cal[ $component ][ $keyword ] = $value ; + break; + } + $this->last_keyword = $keyword; + } + + /** + * Escape strings with wp_kses, allow links + * + * @param string $string (default: '') + * @return string + */ + public function escape( $string = '' ) { + $allowed_html = array( + 'a' => array( + 'href' => array(), + 'title' => array() + ) + ); + + $allowed_tags = ''; + foreach ( array_keys( $allowed_html ) as $tag ) { + $allowed_tags .= "<{$tag}>"; + } + + // Running strip_tags() first with allowed tags to get rid of remaining gallery markup, etc + // because wp_kses() would only htmlentity'fy that. Then still runnning wp_kses(), for extra + // safety and good measure. + return wp_kses( strip_tags( $string, $allowed_tags ), $allowed_html ); + } + + /** + * Render the events + * + * @param string $url (default: '') + * @param string $context (default: 'widget') or 'shortcode' + * @return mixed bool|string false on failure, rendered HTML string on success. + */ + public function render( $url = '', $args = array() ) { + + $args = wp_parse_args( $args, array( + 'context' => 'widget', + 'number' => 5 + ) ); + + $events = $this->get_events( $url, $args['number'] ); + + if ( empty( $events ) ) + return false; + + ob_start(); + + if ( 'widget' == $args['context'] ) : ?> + + + + + + + + + + + + + + + + + + + + + +
LocationWhenSummaryDescription
escape( stripslashes( $event['LOCATION'] ) ); ?>formatted_date( $event ); ?>escape( stripslashes( $event['SUMMARY'] ) ); ?>escape( stripcslashes( $event['DESCRIPTION'] ) ) ); ?>
+ timezone ) { + try { + $start_time = new DateTime( $event['DTSTART'] ); + $timezone_offset = $this->timezone->getOffset( $start_time ); + $start += $timezone_offset; + + if ( $end ) { + $end += $timezone_offset; + } + } catch ( Exception $e ) { + // Invalid argument to DateTime + } + } + $single_day = $end ? ( $end - $start ) <= DAY_IN_SECONDS : true; + + /* Translators: Date and time */ + $date_with_time = __( '%1$s at %2$s' ); + /* Translators: Two dates with a separator */ + $two_dates = __( '%1$s – %2$s' ); + + // we'll always have the start date. Maybe with time + if ( $all_day ) + $date = date_i18n( $date_format, $start ); + else + $date = sprintf( $date_with_time, date_i18n( $date_format, $start ), date_i18n( $time_format, $start ) ); + + // single day, timed + if ( $single_day && ! $all_day && false !== $end ) + $date = sprintf( $two_dates, $date, date_i18n( $time_format, $end ) ); + + // multi-day + if ( ! $single_day ) { + + if ( $all_day ) + $end_date = date_i18n( $date_format, $end ); + else + $end_date = sprintf( $date_with_time, date_i18n( $date_format, $end ), date_i18n( $time_format, $end ) ); + + $date = sprintf( $two_dates, $date, $end_date ); + + } + + return $date; + } + + protected function sort_by_recent( $list ) { + $dates = $sorted_list = array(); + + foreach ( $list as $key => $row ) { + $date = $row['DTSTART']; + // pad some time onto an all day date + if ( 8 === strlen( $date ) ) + $date .= 'T000000Z'; + $dates[$key] = $date; + } + asort( $dates ); + foreach( $dates as $key => $value ) { + $sorted_list[$key] = $list[$key]; + } + unset($list); + return $sorted_list; + } + +} + + +/** + * Wrapper function for iCalendarReader->get_events() + * + * @param string $url (default: '') + * @return array + */ +function icalendar_get_events( $url = '', $count = 5 ) { + // Find your calendar's address http://support.google.com/calendar/bin/answer.py?hl=en&answer=37103 + $ical = new iCalendarReader(); + return $ical->get_events( $url, $count ); +} + +/** + * Wrapper function for iCalendarReader->render() + * + * @param string $url (default: '') + * @param string $context (default: 'widget') or 'shortcode' + * @return mixed bool|string false on failure, rendered HTML string on success. + */ +function icalendar_render_events( $url = '', $args = array() ) { + $ical = new iCalendarReader(); + return $ical->render( $url, $args ); +} diff --git a/_inc/lib/markdown/0-load.php b/_inc/lib/markdown/0-load.php new file mode 100644 index 0000000000000..bf5993e339799 --- /dev/null +++ b/_inc/lib/markdown/0-load.php @@ -0,0 +1,6 @@ + tags because that's what WordPress likes. + - See `WPCom_GHF_Markdown_Parser::__construct()` for how the above member variable defaults are set. + diff --git a/_inc/lib/markdown/extra.php b/_inc/lib/markdown/extra.php new file mode 100644 index 0000000000000..066a396ce0c6d --- /dev/null +++ b/_inc/lib/markdown/extra.php @@ -0,0 +1,3194 @@ + +# +# Original Markdown +# Copyright (c) 2004-2006 John Gruber +# +# +# Tweaked to remove WordPress interface + + +define( 'MARKDOWN_VERSION', "1.0.2" ); # 29 Nov 2013 +define( 'MARKDOWNEXTRA_VERSION', "1.2.8" ); # 29 Nov 2013 + + +# +# Global default settings: +# + +# Change to ">" for HTML output +@define( 'MARKDOWN_EMPTY_ELEMENT_SUFFIX', " />"); + +# Define the width of a tab for code blocks. +@define( 'MARKDOWN_TAB_WIDTH', 4 ); + +# Optional title attribute for footnote links and backlinks. +@define( 'MARKDOWN_FN_LINK_TITLE', "" ); +@define( 'MARKDOWN_FN_BACKLINK_TITLE', "" ); + +# Optional class attribute for footnote links and backlinks. +@define( 'MARKDOWN_FN_LINK_CLASS', "" ); +@define( 'MARKDOWN_FN_BACKLINK_CLASS', "" ); + +# Optional class prefix for fenced code block. +@define( 'MARKDOWN_CODE_CLASS_PREFIX', "" ); + +# Class attribute for code blocks goes on the `code` tag; +# setting this to true will put attributes on the `pre` tag instead. +@define( 'MARKDOWN_CODE_ATTR_ON_PRE', false ); + + + +### Standard Function Interface ### + +@define( 'MARKDOWN_PARSER_CLASS', 'MarkdownExtra_Parser' ); + +function Markdown($text) { +# +# Initialize the parser and return the result of its transform method. +# + # Setup static parser variable. + static $parser; + if (!isset($parser)) { + $parser_class = MARKDOWN_PARSER_CLASS; + $parser = new $parser_class; + } + + # Transform text using parser. + return $parser->transform($text); +} + +# +# Markdown Parser Class +# + +class Markdown_Parser { + + ### Configuration Variables ### + + # Change to ">" for HTML output. + var $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX; + var $tab_width = MARKDOWN_TAB_WIDTH; + + # Change to `true` to disallow markup or entities. + var $no_markup = false; + var $no_entities = false; + + # Predefined urls and titles for reference links and images. + var $predef_urls = array(); + var $predef_titles = array(); + + + ### Parser Implementation ### + + # Regex to match balanced [brackets]. + # Needed to insert a maximum bracked depth while converting to PHP. + var $nested_brackets_depth = 6; + var $nested_brackets_re; + + var $nested_url_parenthesis_depth = 4; + var $nested_url_parenthesis_re; + + # Table of hash values for escaped characters: + var $escape_chars = '\`*_{}[]()>#+-.!'; + var $escape_chars_re; + + + function Markdown_Parser() { + # + # Constructor function. Initialize appropriate member variables. + # + $this->_initDetab(); + $this->prepareItalicsAndBold(); + + $this->nested_brackets_re = + str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth). + str_repeat('\])*', $this->nested_brackets_depth); + + $this->nested_url_parenthesis_re = + str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth). + str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth); + + $this->escape_chars_re = '['.preg_quote($this->escape_chars).']'; + + # Sort document, block, and span gamut in ascendent priority order. + asort($this->document_gamut); + asort($this->block_gamut); + asort($this->span_gamut); + } + + + # Internal hashes used during transformation. + var $urls = array(); + var $titles = array(); + var $html_hashes = array(); + + # Status flag to avoid invalid nesting. + var $in_anchor = false; + + + function setup() { + # + # Called before the transformation process starts to setup parser + # states. + # + # Clear global hashes. + $this->urls = $this->predef_urls; + $this->titles = $this->predef_titles; + $this->html_hashes = array(); + + $this->in_anchor = false; + } + + function teardown() { + # + # Called after the transformation process to clear any variable + # which may be taking up memory unnecessarly. + # + $this->urls = array(); + $this->titles = array(); + $this->html_hashes = array(); + } + + + function transform($text) { + # + # Main function. Performs some preprocessing on the input text + # and pass it through the document gamut. + # + $this->setup(); + + # Remove UTF-8 BOM and marker character in input, if present. + $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text); + + # Standardize line endings: + # DOS to Unix and Mac to Unix + $text = preg_replace('{\r\n?}', "\n", $text); + + # Make sure $text ends with a couple of newlines: + $text .= "\n\n"; + + # Convert all tabs to spaces. + $text = $this->detab($text); + + # Turn block-level HTML blocks into hash entries + $text = $this->hashHTMLBlocks($text); + + # Strip any lines consisting only of spaces and tabs. + # This makes subsequent regexen easier to write, because we can + # match consecutive blank lines with /\n+/ instead of something + # contorted like /[ ]*\n+/ . + $text = preg_replace('/^[ ]+$/m', '', $text); + + # Run document gamut methods. + foreach ($this->document_gamut as $method => $priority) { + $text = $this->$method($text); + } + + $this->teardown(); + + return $text . "\n"; + } + + var $document_gamut = array( + # Strip link definitions, store in hashes. + "stripLinkDefinitions" => 20, + + "runBasicBlockGamut" => 30, + ); + + + function stripLinkDefinitions($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 + [ ]* + \n? # maybe *one* newline + [ ]* + (?: + <(.+?)> # url = $2 + | + (\S+?) # url = $3 + ) + [ ]* + \n? # maybe one newline + [ ]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.*?) # title = $4 + [")] + [ ]* + )? # title is optional + (?:\n+|\Z) + }xm', + array(&$this, '_stripLinkDefinitions_callback'), + $text); + return $text; + } + function _stripLinkDefinitions_callback($matches) { + $link_id = strtolower($matches[1]); + $url = $matches[2] == '' ? $matches[3] : $matches[2]; + $this->urls[$link_id] = $url; + $this->titles[$link_id] =& $matches[4]; + return ''; # String that will replace the block + } + + + function hashHTMLBlocks($text) { + if ($this->no_markup) return $text; + + $less_than_tab = $this->tab_width - 1; + + # Hashify HTML blocks: + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded: + # + # * List "a" is made of tags which can be both inline or block-level. + # These will be treated block-level when the start tag is alone on + # its line, otherwise they're not matched here and will be taken as + # inline later. + # * List "b" is made of tags which are always block-level; + # + $block_tags_a_re = 'ins|del'; + $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'. + 'script|noscript|form|fieldset|iframe|math|svg|'. + 'article|section|nav|aside|hgroup|header|footer|'. + 'figure'; + + # Regular expression for the content of a block tag. + $nested_tags_level = 4; + $attr = ' + (?> # optional tag attributes + \s # starts with whitespace + (?> + [^>"/]+ # text outside quotes + | + /+(?!>) # slash not followed by ">" + | + "[^"]*" # text inside double quotes (tolerate ">") + | + \'[^\']*\' # text inside single quotes (tolerate ">") + )* + )? + '; + $content = + str_repeat(' + (?> + [^<]+ # content without tag + | + <\2 # nested opening tag + '.$attr.' # attributes + (?> + /> + | + >', $nested_tags_level). # end of opening tag + '.*?'. # last level nested tag content + str_repeat(' + # closing nested tag + ) + | + <(?!/\2\s*> # other tags with a different name + ) + )*', + $nested_tags_level); + $content2 = str_replace('\2', '\3', $content); + + # First, look for nested blocks, e.g.: + #

+ #
+ # tags for inner block must be indented. + #
+ #
+ # + # The outermost tags must start at the left margin for this to match, and + # the inner nested divs must be indented. + # We need to do this before the next, more liberal match, because the next + # match will start at the first `
` and stop at the first `
`. + $text = preg_replace_callback('{(?> + (?> + (?<=\n\n) # Starting after a blank line + | # or + \A\n? # the beginning of the doc + ) + ( # save in $1 + + # Match from `\n` to `\n`, handling nested tags + # in between. + + [ ]{0,'.$less_than_tab.'} + <('.$block_tags_b_re.')# start tag = $2 + '.$attr.'> # attributes followed by > and \n + '.$content.' # content, support nesting + # the matching end tag + [ ]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + + | # Special version for tags of group a. + + [ ]{0,'.$less_than_tab.'} + <('.$block_tags_a_re.')# start tag = $3 + '.$attr.'>[ ]*\n # attributes followed by > + '.$content2.' # content, support nesting + # the matching end tag + [ ]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + + | # Special case just for
. It was easier to make a special + # case than to make the other regex more complicated. + + [ ]{0,'.$less_than_tab.'} + <(hr) # start tag = $2 + '.$attr.' # attributes + /?> # the matching end tag + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + | # Special case for standalone HTML comments: + + [ ]{0,'.$less_than_tab.'} + (?s: + + ) + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + | # PHP and ASP-style processor instructions ( + ) + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + ) + )}Sxmi', + array(&$this, '_hashHTMLBlocks_callback'), + $text); + + return $text; + } + function _hashHTMLBlocks_callback($matches) { + $text = $matches[1]; + $key = $this->hashBlock($text); + return "\n\n$key\n\n"; + } + + + function hashPart($text, $boundary = 'X') { + # + # Called whenever a tag must be hashed when a function insert an atomic + # element in the text stream. Passing $text to through this function gives + # a unique text-token which will be reverted back when calling unhash. + # + # The $boundary argument specify what character should be used to surround + # the token. By convension, "B" is used for block elements that needs not + # to be wrapped into paragraph tags at the end, ":" is used for elements + # that are word separators and "X" is used in the general case. + # + # Swap back any tag hash found in $text so we do not have to `unhash` + # multiple times at the end. + $text = $this->unhash($text); + + # Then hash the block. + static $i = 0; + $key = "$boundary\x1A" . ++$i . $boundary; + $this->html_hashes[$key] = $text; + return $key; # String that will replace the tag. + } + + + function hashBlock($text) { + # + # Shortcut function for hashPart with block-level boundaries. + # + return $this->hashPart($text, 'B'); + } + + + var $block_gamut = array( + # + # These are all the transformations that form block-level + # tags like paragraphs, headers, and list items. + # + "doHeaders" => 10, + "doHorizontalRules" => 20, + + "doLists" => 40, + "doCodeBlocks" => 50, + "doBlockQuotes" => 60, + ); + + function runBlockGamut($text) { + # + # Run block gamut tranformations. + # + # We need to escape raw HTML in Markdown source before doing anything + # else. This need to be done for each block, and not only at the + # begining in the Markdown function since hashed blocks can be part of + # list items and could have been indented. Indented blocks would have + # been seen as a code block in a previous pass of hashHTMLBlocks. + $text = $this->hashHTMLBlocks($text); + + return $this->runBasicBlockGamut($text); + } + + function runBasicBlockGamut($text) { + # + # Run block gamut tranformations, without hashing HTML blocks. This is + # useful when HTML blocks are known to be already hashed, like in the first + # whole-document pass. + # + foreach ($this->block_gamut as $method => $priority) { + $text = $this->$method($text); + } + + # Finally form paragraph and restore hashed blocks. + $text = $this->formParagraphs($text); + + return $text; + } + + + function doHorizontalRules($text) { + # Do Horizontal Rules: + return preg_replace( + '{ + ^[ ]{0,3} # Leading space + ([-*_]) # $1: First marker + (?> # Repeated marker group + [ ]{0,2} # Zero, one, or two spaces. + \1 # Marker character + ){2,} # Group repeated at least twice + [ ]* # Tailing spaces + $ # End of line. + }mx', + "\n".$this->hashBlock("empty_element_suffix")."\n", + $text); + } + + + var $span_gamut = array( + # + # These are all the transformations that occur *within* block-level + # tags like paragraphs, headers, and list items. + # + # Process character escapes, code spans, and inline HTML + # in one shot. + "parseSpan" => -30, + + # Process anchor and image tags. Images must come first, + # because ![foo][f] looks like an anchor. + "doImages" => 10, + "doAnchors" => 20, + + # Make links out of things like `` + # Must come after doAnchors, because you can use < and > + # delimiters in inline links like [this](). + "doAutoLinks" => 30, + "encodeAmpsAndAngles" => 40, + + "doItalicsAndBold" => 50, + "doHardBreaks" => 60, + ); + + function runSpanGamut($text) { + # + # Run span gamut tranformations. + # + foreach ($this->span_gamut as $method => $priority) { + $text = $this->$method($text); + } + + return $text; + } + + + function doHardBreaks($text) { + # Do hard breaks: + return preg_replace_callback('/ {2,}\n/', + array(&$this, '_doHardBreaks_callback'), $text); + } + function _doHardBreaks_callback($matches) { + return $this->hashPart("empty_element_suffix\n"); + } + + + function doAnchors($text) { + # + # Turn Markdown link shortcuts into XHTML tags. + # + if ($this->in_anchor) return $text; + $this->in_anchor = true; + + # + # First, handle reference-style links: [link text] [id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + # + # Next, inline-style links: [link text](url "optional title") + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + \( # literal paren + [ \n]* + (?: + <(.+?)> # href = $3 + | + ('.$this->nested_url_parenthesis_re.') # href = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # Title = $7 + \6 # matching quote + [ \n]* # ignore any spaces/tabs between closing quote and ) + )? # title is optional + \) + ) + }xs', + array(&$this, '_doAnchors_inline_callback'), $text); + + # + # Last, handle reference-style shortcuts: [link text] + # These must come last in case you've also got [link text][1] + # or [link text](/foo) + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ([^\[\]]+) # link text = $2; can\'t contain [ or ] + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + $this->in_anchor = false; + return $text; + } + function _doAnchors_reference_callback($matches) { + $whole_match = $matches[1]; + $link_text = $matches[2]; + $link_id =& $matches[3]; + + if ($link_id == "") { + # for shortcut links like [this][] or [this]. + $link_id = $link_text; + } + + # lower-case and turn embedded newlines into spaces + $link_id = strtolower($link_id); + $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); + + if (isset($this->urls[$link_id])) { + $url = $this->urls[$link_id]; + $url = $this->encodeAttribute($url); + + $result = "titles[$link_id] ) ) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + $result = $this->hashPart($result); + } + else { + $result = $whole_match; + } + return $result; + } + function _doAnchors_inline_callback($matches) { + $whole_match = $matches[1]; + $link_text = $this->runSpanGamut($matches[2]); + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + + $url = $this->encodeAttribute($url); + + $result = "encodeAttribute($title); + $result .= " title=\"$title\""; + } + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + + return $this->hashPart($result); + } + + + function doImages($text) { + # + # Turn Markdown image shortcuts into tags. + # + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }xs', + array(&$this, '_doImages_reference_callback'), $text); + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + \s? # One optional whitespace character + \( # literal paren + [ \n]* + (?: + <(\S*)> # src url = $3 + | + ('.$this->nested_url_parenthesis_re.') # src url = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # title = $7 + \6 # matching quote + [ \n]* + )? # title is optional + \) + ) + }xs', + array(&$this, '_doImages_inline_callback'), $text); + + return $text; + } + function _doImages_reference_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $link_id = strtolower($matches[3]); + + if ($link_id == "") { + $link_id = strtolower($alt_text); # for shortcut links like ![this][]. + } + + $alt_text = $this->encodeAttribute($alt_text); + if (isset($this->urls[$link_id])) { + $url = $this->encodeAttribute($this->urls[$link_id]); + $result = "\"$alt_text\"";titles[$link_id])) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + $result .= $this->empty_element_suffix; + $result = $this->hashPart($result); + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + return $result; + } + function _doImages_inline_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + + $alt_text = $this->encodeAttribute($alt_text); + $url = $this->encodeAttribute($url); + $result = "\"$alt_text\"";encodeAttribute($title); + $result .= " title=\"$title\""; # $title already quoted + } + $result .= $this->empty_element_suffix; + + return $this->hashPart($result); + } + + + function doHeaders($text) { + # Setext-style headers: + # Header 1 + # ======== + # + # Header 2 + # -------- + # + $text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx', + array(&$this, '_doHeaders_callback_setext'), $text); + + # atx-style headers: + # # Header 1 + # ## Header 2 + # ## Header 2 with closing hashes ## + # ... + # ###### Header 6 + # + $text = preg_replace_callback('{ + ^(\#{1,6}) # $1 = string of #\'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #\'s (not counted) + \n+ + }xm', + array(&$this, '_doHeaders_callback_atx'), $text); + + return $text; + } + function _doHeaders_callback_setext($matches) { + # Terrible hack to check we haven't found an empty list item. + if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) + return $matches[0]; + + $level = $matches[2]{0} == '=' ? 1 : 2; + $block = "".$this->runSpanGamut($matches[1]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + function _doHeaders_callback_atx($matches) { + $level = strlen($matches[1]); + $block = "".$this->runSpanGamut($matches[2]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + + + function doLists($text) { + # + # Form HTML ordered (numbered) and unordered (bulleted) lists. + # + $less_than_tab = $this->tab_width - 1; + + # Re-usable patterns to match list item bullets and number markers: + $marker_ul_re = '[*+-]'; + $marker_ol_re = '\d+[\.]'; + $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; + + $markers_relist = array( + $marker_ul_re => $marker_ol_re, + $marker_ol_re => $marker_ul_re, + ); + + foreach ($markers_relist as $marker_re => $other_marker_re) { + # Re-usable pattern to match any entirel ul or ol list: + $whole_list_re = ' + ( # $1 = whole list + ( # $2 + ([ ]{0,'.$less_than_tab.'}) # $3 = number of spaces + ('.$marker_re.') # $4 = first list item marker + [ ]+ + ) + (?s:.+?) + ( # $5 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another list item marker + [ ]* + '.$marker_re.'[ ]+ + ) + | + (?= # Lookahead for another kind of list + \n + \3 # Must have the same indentation + '.$other_marker_re.'[ ]+ + ) + ) + ) + '; // mx + + # We use a different prefix before nested lists than top-level lists. + # See extended comment in _ProcessListItems(). + + if ($this->list_level) { + $text = preg_replace_callback('{ + ^ + '.$whole_list_re.' + }mx', + array(&$this, '_doLists_callback'), $text); + } + else { + $text = preg_replace_callback('{ + (?:(?<=\n)\n|\A\n?) # Must eat the newline + '.$whole_list_re.' + }mx', + array(&$this, '_doLists_callback'), $text); + } + } + + return $text; + } + function _doLists_callback($matches) { + # Re-usable patterns to match list item bullets and number markers: + $marker_ul_re = '[*+-]'; + $marker_ol_re = '\d+[\.]'; + $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; + + $list = $matches[1]; + $list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol"; + + $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re ); + + $list .= "\n"; + $result = $this->processListItems($list, $marker_any_re); + + $result = $this->hashBlock("<$list_type>\n" . $result . ""); + return "\n". $result ."\n\n"; + } + + var $list_level = 0; + + function processListItems($list_str, $marker_any_re) { + # + # Process the contents of a single ordered or unordered list, splitting it + # into individual list items. + # + # The $this->list_level global keeps track of when we're inside a list. + # Each time we enter a list, we increment it; when we leave a list, + # we decrement. If it's zero, we're not in a list anymore. + # + # We do this because when we're not inside a list, we want to treat + # something like this: + # + # I recommend upgrading to version + # 8. Oops, now this line is treated + # as a sub-list. + # + # As a single paragraph, despite the fact that the second line starts + # with a digit-period-space sequence. + # + # Whereas when we're inside a list (or sub-list), that line will be + # treated as the start of a sub-list. What a kludge, huh? This is + # an aspect of Markdown's syntax that's hard to parse perfectly + # without resorting to mind-reading. Perhaps the solution is to + # change the syntax rules such that sub-lists must start with a + # starting cardinal number; e.g. "1." or "a.". + + $this->list_level++; + + # trim trailing blank lines: + $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); + + $list_str = preg_replace_callback('{ + (\n)? # leading line = $1 + (^[ ]*) # leading whitespace = $2 + ('.$marker_any_re.' # list marker and space = $3 + (?:[ ]+|(?=\n)) # space only required if item is not empty + ) + ((?s:.*?)) # list item text = $4 + (?:(\n+(?=\n))|\n) # tailing blank line = $5 + (?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n)))) + }xm', + array(&$this, '_processListItems_callback'), $list_str); + + $this->list_level--; + return $list_str; + } + function _processListItems_callback($matches) { + $item = $matches[4]; + $leading_line =& $matches[1]; + $leading_space =& $matches[2]; + $marker_space = $matches[3]; + $tailing_blank_line =& $matches[5]; + + if ($leading_line || $tailing_blank_line || + preg_match('/\n{2,}/', $item)) + { + # Replace marker with the appropriate whitespace indentation + $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item; + $item = $this->runBlockGamut($this->outdent($item)."\n"); + } + else { + # Recursion for sub-lists: + $item = $this->doLists($this->outdent($item)); + $item = preg_replace('/\n+$/', '', $item); + $item = $this->runSpanGamut($item); + } + + return "
  • " . $item . "
  • \n"; + } + + + function doCodeBlocks($text) { + # + # Process Markdown `
    ` blocks.
    +	#
    +		$text = preg_replace_callback('{
    +				(?:\n\n|\A\n?)
    +				(	            # $1 = the code block -- one or more lines, starting with a space/tab
    +				  (?>
    +					[ ]{'.$this->tab_width.'}  # Lines must start with a tab or a tab-width of spaces
    +					.*\n+
    +				  )+
    +				)
    +				((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z)	# Lookahead for non-space at line-start, or end of doc
    +			}xm',
    +			array(&$this, '_doCodeBlocks_callback'), $text);
    +
    +		return $text;
    +	}
    +	function _doCodeBlocks_callback($matches) {
    +		$codeblock = $matches[1];
    +
    +		$codeblock = $this->outdent($codeblock);
    +		$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
    +
    +		# trim leading newlines and trailing newlines
    +		$codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
    +
    +		$codeblock = "
    $codeblock\n
    "; + return "\n\n".$this->hashBlock($codeblock)."\n\n"; + } + + + function makeCodeSpan($code) { + # + # Create a code span markup for $code. Called from handleSpanToken. + # + $code = htmlspecialchars(trim($code), ENT_NOQUOTES); + return $this->hashPart("$code"); + } + + + var $em_relist = array( + '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(?em_relist as $em => $em_re) { + foreach ($this->strong_relist as $strong => $strong_re) { + # Construct list of allowed token expressions. + $token_relist = array(); + if (isset($this->em_strong_relist["$em$strong"])) { + $token_relist[] = $this->em_strong_relist["$em$strong"]; + } + $token_relist[] = $em_re; + $token_relist[] = $strong_re; + + # Construct master expression from list. + $token_re = '{('. implode('|', $token_relist) .')}'; + $this->em_strong_prepared_relist["$em$strong"] = $token_re; + } + } + } + + function doItalicsAndBold($text) { + $token_stack = array(''); + $text_stack = array(''); + $em = ''; + $strong = ''; + $tree_char_em = false; + + while (1) { + # + # Get prepared regular expression for seraching emphasis tokens + # in current context. + # + $token_re = $this->em_strong_prepared_relist["$em$strong"]; + + # + # Each loop iteration search for the next emphasis token. + # Each token is then passed to handleSpanToken. + # + $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); + $text_stack[0] .= $parts[0]; + $token =& $parts[1]; + $text =& $parts[2]; + + if (empty($token)) { + # Reached end of text span: empty stack without emitting. + # any more emphasis. + while ($token_stack[0]) { + $text_stack[1] .= array_shift($token_stack); + $text_stack[0] .= array_shift($text_stack); + } + break; + } + + $token_len = strlen($token); + if ($tree_char_em) { + # Reached closing marker while inside a three-char emphasis. + if ($token_len == 3) { + # Three-char closing marker, close em and strong. + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $em = ''; + $strong = ''; + } else { + # Other closing marker: close one em or strong and + # change current token state to match the other + $token_stack[0] = str_repeat($token{0}, 3-$token_len); + $tag = $token_len == 2 ? "strong" : "em"; + $span = $text_stack[0]; + $span = $this->runSpanGamut($span); + $span = "<$tag>$span"; + $text_stack[0] = $this->hashPart($span); + $$tag = ''; # $$tag stands for $em or $strong + } + $tree_char_em = false; + } else if ($token_len == 3) { + if ($em) { + # Reached closing marker for both em and strong. + # Closing strong marker: + for ($i = 0; $i < 2; ++$i) { + $shifted_token = array_shift($token_stack); + $tag = strlen($shifted_token) == 2 ? "strong" : "em"; + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "<$tag>$span"; + $text_stack[0] .= $this->hashPart($span); + $$tag = ''; # $$tag stands for $em or $strong + } + } else { + # Reached opening three-char emphasis marker. Push on token + # stack; will be handled by the special condition above. + $em = $token{0}; + $strong = "$em$em"; + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $tree_char_em = true; + } + } else if ($token_len == 2) { + if ($strong) { + # Unwind any dangling emphasis marker: + if (strlen($token_stack[0]) == 1) { + $text_stack[1] .= array_shift($token_stack); + $text_stack[0] .= array_shift($text_stack); + } + # Closing strong marker: + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $strong = ''; + } else { + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $strong = $token; + } + } else { + # Here $token_len == 1 + if ($em) { + if (strlen($token_stack[0]) == 1) { + # Closing emphasis marker: + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $em = ''; + } else { + $text_stack[0] .= $token; + } + } else { + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $em = $token; + } + } + } + return $text_stack[0]; + } + + + function doBlockQuotes($text) { + $text = preg_replace_callback('/ + ( # Wrap whole match in $1 + (?> + ^[ ]*>[ ]? # ">" at the start of a line + .+\n # rest of the first line + (.+\n)* # subsequent consecutive lines + \n* # blanks + )+ + ) + /xm', + array(&$this, '_doBlockQuotes_callback'), $text); + + return $text; + } + function _doBlockQuotes_callback($matches) { + $bq = $matches[1]; + # trim one level of quoting - trim whitespace-only lines + $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); + $bq = $this->runBlockGamut($bq); # recurse + + $bq = preg_replace('/^/m', " ", $bq); + # These leading spaces cause problem with
     content,
    +		# so we need to fix that:
    +		$bq = preg_replace_callback('{(\s*
    .+?
    )}sx', + array(&$this, '_doBlockQuotes_callback2'), $bq); + + return "\n". $this->hashBlock("
    \n$bq\n
    ")."\n\n"; + } + function _doBlockQuotes_callback2($matches) { + $pre = $matches[1]; + $pre = preg_replace('/^ /m', '', $pre); + return $pre; + } + + + function formParagraphs($text) { + # + # Params: + # $text - string to process with html

    tags + # + # Strip leading and trailing lines: + $text = preg_replace('/\A\n+|\n+\z/', '', $text); + + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); + + # + # Wrap

    tags and unhashify HTML blocks + # + foreach ($grafs as $key => $value) { + if (!preg_match('/^B\x1A[0-9]+B$/', $value)) { + # Is a paragraph. + $value = $this->runSpanGamut($value); + $value = preg_replace('/^([ ]*)/', "

    ", $value); + $value .= "

    "; + $grafs[$key] = $this->unhash($value); + } + else { + # Is a block. + # Modify elements of @grafs in-place... + $graf = $value; + $block = $this->html_hashes[$graf]; + $graf = $block; +// if (preg_match('{ +// \A +// ( # $1 =
    tag +//
    ]* +// \b +// markdown\s*=\s* ([\'"]) # $2 = attr quote char +// 1 +// \2 +// [^>]* +// > +// ) +// ( # $3 = contents +// .* +// ) +// (
    ) # $4 = closing tag +// \z +// }xs', $block, $matches)) +// { +// list(, $div_open, , $div_content, $div_close) = $matches; +// +// # We can't call Markdown(), because that resets the hash; +// # that initialization code should be pulled into its own sub, though. +// $div_content = $this->hashHTMLBlocks($div_content); +// +// # Run document gamut methods on the content. +// foreach ($this->document_gamut as $method => $priority) { +// $div_content = $this->$method($div_content); +// } +// +// $div_open = preg_replace( +// '{\smarkdown\s*=\s*([\'"]).+?\1}', '', $div_open); +// +// $graf = $div_open . "\n" . $div_content . "\n" . $div_close; +// } + $grafs[$key] = $graf; + } + } + + return implode("\n\n", $grafs); + } + + + function encodeAttribute($text) { + # + # Encode text for a double-quoted HTML attribute. This function + # is *not* suitable for attributes enclosed in single quotes. + # + $text = $this->encodeAmpsAndAngles($text); + $text = str_replace('"', '"', $text); + return $text; + } + + + function encodeAmpsAndAngles($text) { + # + # Smart processing for ampersands and angle brackets that need to + # be encoded. Valid character entities are left alone unless the + # no-entities mode is set. + # + if ($this->no_entities) { + $text = str_replace('&', '&', $text); + } else { + # Ampersand-encoding based entirely on Nat Irons's Amputator + # MT plugin: + $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/', + '&', $text);; + } + # Encode remaining <'s + $text = str_replace('<', '<', $text); + + return $text; + } + + + function doAutoLinks($text) { + $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i', + array(&$this, '_doAutoLinks_url_callback'), $text); + + # Email addresses: + $text = preg_replace_callback('{ + < + (?:mailto:)? + ( + (?: + [-!#$%&\'*+/=?^_`.{|}~\w\x80-\xFF]+ + | + ".*?" + ) + \@ + (?: + [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+ + | + \[[\d.a-fA-F:]+\] # IPv4 & IPv6 + ) + ) + > + }xi', + array(&$this, '_doAutoLinks_email_callback'), $text); + $text = preg_replace_callback('{<(tel:([^\'">\s]+))>}i',array(&$this, '_doAutoLinks_tel_callback'), $text); + + return $text; + } + function _doAutoLinks_tel_callback($matches) { + $url = $this->encodeAttribute($matches[1]); + $tel = $this->encodeAttribute($matches[2]); + $link = "$tel"; + return $this->hashPart($link); + } + function _doAutoLinks_url_callback($matches) { + $url = $this->encodeAttribute($matches[1]); + $link = "$url"; + return $this->hashPart($link); + } + function _doAutoLinks_email_callback($matches) { + $address = $matches[1]; + $link = $this->encodeEmailAddress($address); + return $this->hashPart($link); + } + + + function encodeEmailAddress($addr) { + # + # Input: an email address, e.g. "foo@example.com" + # + # Output: the email address as a mailto link, with each character + # of the address encoded as either a decimal or hex entity, in + # the hopes of foiling most address harvesting spam bots. E.g.: + # + #

    foo@exampl + # e.com

    + # + # Based by a filter by Matthew Wickline, posted to BBEdit-Talk. + # With some optimizations by Milian Wolff. + # + $addr = "mailto:" . $addr; + $chars = preg_split('/(? $char) { + $ord = ord($char); + # Ignore non-ascii chars. + if ($ord < 128) { + $r = ($seed * (1 + $key)) % 100; # Pseudo-random function. + # roughly 10% raw, 45% hex, 45% dec + # '@' *must* be encoded. I insist. + if ($r > 90 && $char != '@') /* do nothing */; + else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';'; + else $chars[$key] = '&#'.$ord.';'; + } + } + + $addr = implode('', $chars); + $text = implode('', array_slice($chars, 7)); # text without `mailto:` + $addr = "$text"; + + return $addr; + } + + + function parseSpan($str) { + # + # Take the string $str and parse it into tokens, hashing embeded HTML, + # escaped characters and handling code spans. + # + $output = ''; + + $span_re = '{ + ( + \\\\'.$this->escape_chars_re.' + | + (?no_markup ? '' : ' + | + # comment + | + <\?.*?\?> | <%.*?%> # processing instruction + | + <[!$]?[-a-zA-Z0-9:_]+ # regular tags + (?> + \s + (?>[^"\'>]+|"[^"]*"|\'[^\']*\')* + )? + > + | + <[-a-zA-Z0-9:_]+\s*/> # xml-style empty tag + | + # closing tag + ').' + ) + }xs'; + + while (1) { + # + # Each loop iteration seach for either the next tag, the next + # openning code span marker, or the next escaped character. + # Each token is then passed to handleSpanToken. + # + $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE); + + # Create token from text preceding tag. + if ($parts[0] != "") { + $output .= $parts[0]; + } + + # Check if we reach the end. + if (isset($parts[1])) { + $output .= $this->handleSpanToken($parts[1], $parts[2]); + $str = $parts[2]; + } + else { + break; + } + } + + return $output; + } + + + function handleSpanToken($token, &$str) { + # + # Handle $token provided by parseSpan by determining its nature and + # returning the corresponding value that should replace it. + # + switch ($token{0}) { + case "\\": + return $this->hashPart("&#". ord($token{1}). ";"); + case "`": + # Search for end marker in remaining text. + if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', + $str, $matches)) + { + $str = $matches[2]; + $codespan = $this->makeCodeSpan($matches[1]); + return $this->hashPart($codespan); + } + return $token; // return as text since no ending marker found. + default: + return $this->hashPart($token); + } + } + + + function outdent($text) { + # + # Remove one level of line-leading tabs or spaces + # + return preg_replace('/^(\t|[ ]{1,'.$this->tab_width.'})/m', '', $text); + } + + + # String length function for detab. `_initDetab` will create a function to + # hanlde UTF-8 if the default function does not exist. + var $utf8_strlen = 'mb_strlen'; + + function detab($text) { + # + # Replace tabs with the appropriate amount of space. + # + # For each line we separate the line in blocks delemited by + # tab characters. Then we reconstruct every line by adding the + # appropriate number of space between each blocks. + + $text = preg_replace_callback('/^.*\t.*$/m', + array(&$this, '_detab_callback'), $text); + + return $text; + } + function _detab_callback($matches) { + $line = $matches[0]; + $strlen = $this->utf8_strlen; # strlen function for UTF-8. + + # Split in blocks. + $blocks = explode("\t", $line); + # Add each blocks to the line. + $line = $blocks[0]; + unset($blocks[0]); # Do not add first block twice. + foreach ($blocks as $block) { + # Calculate amount of space, insert spaces, insert block. + $amount = $this->tab_width - + $strlen($line, 'UTF-8') % $this->tab_width; + $line .= str_repeat(" ", $amount) . $block; + } + return $line; + } + function _initDetab() { + # + # Check for the availability of the function in the `utf8_strlen` property + # (initially `mb_strlen`). If the function is not available, create a + # function that will loosely count the number of UTF-8 characters with a + # regular expression. + # + if (function_exists($this->utf8_strlen)) return; + $this->utf8_strlen = create_function('$text', 'return preg_match_all( + "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", + $text, $m);'); + } + + + function unhash($text) { + # + # Swap back in all the tags hashed by _HashHTMLBlocks. + # + return preg_replace_callback('/(.)\x1A[0-9]+\1/', + array(&$this, '_unhash_callback'), $text); + } + function _unhash_callback($matches) { + return $this->html_hashes[$matches[0]]; + } + +} + + +# +# Markdown Extra Parser Class +# + +class MarkdownExtra_Parser extends Markdown_Parser { + + ### Configuration Variables ### + + # Prefix for footnote ids. + var $fn_id_prefix = ""; + + # Optional title attribute for footnote links and backlinks. + var $fn_link_title = MARKDOWN_FN_LINK_TITLE; + var $fn_backlink_title = MARKDOWN_FN_BACKLINK_TITLE; + + # Optional class attribute for footnote links and backlinks. + var $fn_link_class = MARKDOWN_FN_LINK_CLASS; + var $fn_backlink_class = MARKDOWN_FN_BACKLINK_CLASS; + + # Optional class prefix for fenced code block. + var $code_class_prefix = MARKDOWN_CODE_CLASS_PREFIX; + # Class attribute for code blocks goes on the `code` tag; + # setting this to true will put attributes on the `pre` tag instead. + var $code_attr_on_pre = MARKDOWN_CODE_ATTR_ON_PRE; + + # Predefined abbreviations. + var $predef_abbr = array(); + + + ### Parser Implementation ### + + function MarkdownExtra_Parser() { + # + # Constructor function. Initialize the parser object. + # + # Add extra escapable characters before parent constructor + # initialize the table. + $this->escape_chars .= ':|'; + + # Insert extra document, block, and span transformations. + # Parent constructor will do the sorting. + $this->document_gamut += array( + "doFencedCodeBlocks" => 5, + "stripFootnotes" => 15, + "stripAbbreviations" => 25, + "appendFootnotes" => 50, + ); + $this->block_gamut += array( + "doFencedCodeBlocks" => 5, + "doTables" => 15, + "doDefLists" => 45, + ); + $this->span_gamut += array( + "doFootnotes" => 5, + "doAbbreviations" => 70, + ); + + parent::Markdown_Parser(); + } + + + # Extra variables used during extra transformations. + var $footnotes = array(); + var $footnotes_ordered = array(); + var $footnotes_ref_count = array(); + var $footnotes_numbers = array(); + var $abbr_desciptions = array(); + var $abbr_word_re = ''; + + # Give the current footnote number. + var $footnote_counter = 1; + + + function setup() { + # + # Setting up Extra-specific variables. + # + parent::setup(); + + $this->footnotes = array(); + $this->footnotes_ordered = array(); + $this->footnotes_ref_count = array(); + $this->footnotes_numbers = array(); + $this->abbr_desciptions = array(); + $this->abbr_word_re = ''; + $this->footnote_counter = 1; + + foreach ($this->predef_abbr as $abbr_word => $abbr_desc) { + if ($this->abbr_word_re) + $this->abbr_word_re .= '|'; + $this->abbr_word_re .= preg_quote($abbr_word); + $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); + } + } + + function teardown() { + # + # Clearing Extra-specific variables. + # + $this->footnotes = array(); + $this->footnotes_ordered = array(); + $this->footnotes_ref_count = array(); + $this->footnotes_numbers = array(); + $this->abbr_desciptions = array(); + $this->abbr_word_re = ''; + + parent::teardown(); + } + + + ### Extra Attribute Parser ### + + # Expression to use to catch attributes (includes the braces) + var $id_class_attr_catch_re = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){1,})[ ]*\}'; + # Expression to use when parsing in a context when no capture is desired + var $id_class_attr_nocatch_re = '\{(?:[ ]*[#.][-_:a-zA-Z0-9]+){1,}[ ]*\}'; + + function doExtraAttributes($tag_name, $attr) { + # + # Parse attributes caught by the $this->id_class_attr_catch_re expression + # and return the HTML-formatted list of attributes. + # + # Currently supported attributes are .class and #id. + # + if (empty($attr)) return ""; + + # Split on components + preg_match_all('/[#.][-_:a-zA-Z0-9]+/', $attr, $matches); + $elements = $matches[0]; + + # handle classes and ids (only first id taken into account) + $classes = array(); + $id = false; + foreach ($elements as $element) { + if ($element{0} == '.') { + $classes[] = substr($element, 1); + } else if ($element{0} == '#') { + if ($id === false) $id = substr($element, 1); + } + } + + # compose attributes as string + $attr_str = ""; + if (!empty($id)) { + $attr_str .= ' id="'.$id.'"'; + } + if (!empty($classes)) { + $attr_str .= ' class="'.implode(" ", $classes).'"'; + } + return $attr_str; + } + + + function stripLinkDefinitions($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 + [ ]* + \n? # maybe *one* newline + [ ]* + (?: + <(.+?)> # url = $2 + | + (\S+?) # url = $3 + ) + [ ]* + \n? # maybe one newline + [ ]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.*?) # title = $4 + [")] + [ ]* + )? # title is optional + (?:[ ]* '.$this->id_class_attr_catch_re.' )? # $5 = extra id & class attr + (?:\n+|\Z) + }xm', + array(&$this, '_stripLinkDefinitions_callback'), + $text); + return $text; + } + function _stripLinkDefinitions_callback($matches) { + $link_id = strtolower($matches[1]); + $url = $matches[2] == '' ? $matches[3] : $matches[2]; + $this->urls[$link_id] = $url; + $this->titles[$link_id] =& $matches[4]; + $this->ref_attr[$link_id] = $this->doExtraAttributes("", $dummy =& $matches[5]); + return ''; # String that will replace the block + } + + + ### HTML Block Parser ### + + # Tags that are always treated as block tags: + var $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption'; + + # Tags treated as block tags only if the opening tag is alone on its line: + var $context_block_tags_re = 'script|noscript|ins|del|iframe|object|source|track|param|math|svg|canvas|audio|video'; + + # Tags where markdown="1" default to span mode: + var $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address'; + + # Tags which must not have their contents modified, no matter where + # they appear: + var $clean_tags_re = 'script|math|svg'; + + # Tags that do not need to be closed. + var $auto_close_tags_re = 'hr|img|param|source|track'; + + + function hashHTMLBlocks($text) { + # + # Hashify HTML Blocks and "clean tags". + # + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

    s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded. + # + # This works by calling _HashHTMLBlocks_InMarkdown, which then calls + # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1" + # attribute is found within a tag, _HashHTMLBlocks_InHTML calls back + # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag. + # These two functions are calling each other. It's recursive! + # + if ($this->no_markup) return $text; + + # + # Call the HTML-in-Markdown hasher. + # + list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text); + + return $text; + } + function _hashHTMLBlocks_inMarkdown($text, $indent = 0, + $enclosing_tag_re = '', $span = false) + { + # + # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags. + # + # * $indent is the number of space to be ignored when checking for code + # blocks. This is important because if we don't take the indent into + # account, something like this (which looks right) won't work as expected: + # + #

    + #
    + # Hello World. <-- Is this a Markdown code block or text? + #
    <-- Is this a Markdown code block or a real tag? + #
    + # + # If you don't like this, just don't indent the tag on which + # you apply the markdown="1" attribute. + # + # * If $enclosing_tag_re is not empty, stops at the first unmatched closing + # tag with that name. Nested tags supported. + # + # * If $span is true, text inside must treated as span. So any double + # newline will be replaced by a single newline so that it does not create + # paragraphs. + # + # Returns an array of that form: ( processed text , remaining text ) + # + if ($text === '') return array('', ''); + + # Regex to check for the presense of newlines around a block tag. + $newline_before_re = '/(?:^\n?|\n\n)*$/'; + $newline_after_re = + '{ + ^ # Start of text following the tag. + (?>[ ]*)? # Optional comment. + [ ]*\n # Must be followed by newline. + }xs'; + + # Regex to match any tag. + $block_tag_re = + '{ + ( # $2: Capture whole tag. + # Tag name. + '.$this->block_tags_re.' | + '.$this->context_block_tags_re.' | + '.$this->clean_tags_re.' | + (?!\s)'.$enclosing_tag_re.' + ) + (?: + (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name. + (?> + ".*?" | # Double quotes (can contain `>`) + \'.*?\' | # Single quotes (can contain `>`) + .+? # Anything but quotes and `>`. + )*? + )? + > # End of tag. + | + # HTML Comment + | + <\?.*?\?> | <%.*?%> # Processing instruction + | + # CData Block + '. ( !$span ? ' # If not in span. + | + # Indented code block + (?: ^[ ]*\n | ^ | \n[ ]*\n ) + [ ]{'.($indent+4).'}[^\n]* \n + (?> + (?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n + )* + | + # Fenced code block marker + (?<= ^ | \n ) + [ ]{0,'.($indent+3).'}(?:~{3,}|`{3,}) + [ ]* + (?: + \.?[-_:a-zA-Z0-9]+ # standalone class name + | + '.$this->id_class_attr_nocatch_re.' # extra attributes + )? + [ ]* + (?= \n ) + ' : '' ). ' # End (if not is span). + | + # Code span marker + # Note, this regex needs to go after backtick fenced + # code blocks but it should also be kept outside of the + # "if not in span" condition adding backticks to the parser + `+ + ) + }xs'; + + + $depth = 0; # Current depth inside the tag tree. + $parsed = ""; # Parsed text that will be returned. + + # + # Loop through every tag until we find the closing tag of the parent + # or loop until reaching the end of text if no parent tag specified. + # + do { + # + # Split the text using the first $tag_match pattern found. + # Text before pattern will be first in the array, text after + # pattern will be at the end, and between will be any catches made + # by the pattern. + # + $parts = preg_split($block_tag_re, $text, 2, + PREG_SPLIT_DELIM_CAPTURE); + + # If in Markdown span mode, add a empty-string span-level hash + # after each newline to prevent triggering any block element. + if ($span) { + $void = $this->hashPart("", ':'); + $newline = "$void\n"; + $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; + } + + $parsed .= $parts[0]; # Text before current tag. + + # If end of $text has been reached. Stop loop. + if (count($parts) < 3) { + $text = ""; + break; + } + + $tag = $parts[1]; # Tag to handle. + $text = $parts[2]; # Remaining text after current tag. + $tag_re = preg_quote($tag); # For use in a regular expression. + + # + # Check for: Fenced code block marker. + # Note: need to recheck the whole tag to disambiguate backtick + # fences from code spans + # + if (preg_match('{^\n?([ ]{0,'.($indent+3).'})(~{3,}|`{3,})[ ]*(?:\.?[-_:a-zA-Z0-9]+|'.$this->id_class_attr_nocatch_re.')?[ ]*\n?$}', $tag, $capture)) { + # Fenced code block marker: find matching end marker. + $fence_indent = strlen($capture[1]); # use captured indent in re + $fence_re = $capture[2]; # use captured fence in re + if (preg_match('{^(?>.*\n)*?[ ]{'.($fence_indent).'}'.$fence_re.'[ ]*(?:\n|$)}', $text, + $matches)) + { + # End marker found: pass text unchanged until marker. + $parsed .= $tag . $matches[0]; + $text = substr($text, strlen($matches[0])); + } + else { + # No end marker: just skip it. + $parsed .= $tag; + } + } + # + # Check for: Indented code block. + # + else if ($tag{0} == "\n" || $tag{0} == " ") { + # Indented code block: pass it unchanged, will be handled + # later. + $parsed .= $tag; + } + # + # Check for: Code span marker + # Note: need to check this after backtick fenced code blocks + # + else if ($tag{0} == "`") { + # Find corresponding end marker. + $tag_re = preg_quote($tag); + if (preg_match('{^(?>.+?|\n(?!\n))*?(?block_tags_re.')\b}', $tag) || + ( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) && + preg_match($newline_before_re, $parsed) && + preg_match($newline_after_re, $text) ) + ) + { + # Need to parse tag and following text using the HTML parser. + list($block_text, $text) = + $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true); + + # Make sure it stays outside of any paragraph by adding newlines. + $parsed .= "\n\n$block_text\n\n"; + } + # + # Check for: Clean tag (like script, math) + # HTML Comments, processing instructions. + # + else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) || + $tag{1} == '!' || $tag{1} == '?') + { + # Need to parse tag and following text using the HTML parser. + # (don't check for markdown attribute) + list($block_text, $text) = + $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false); + + $parsed .= $block_text; + } + # + # Check for: Tag with same name as enclosing tag. + # + else if ($enclosing_tag_re !== '' && + # Same name as enclosing tag. + preg_match('{^= 0); + + return array($parsed, $text); + } + function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { + # + # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags. + # + # * Calls $hash_method to convert any blocks. + # * Stops when the first opening tag closes. + # * $md_attr indicate if the use of the `markdown="1"` attribute is allowed. + # (it is not inside clean tags) + # + # Returns an array of that form: ( processed text , remaining text ) + # + if ($text === '') return array('', ''); + + # Regex to match `markdown` attribute inside of a tag. + $markdown_attr_re = ' + { + \s* # Eat whitespace before the `markdown` attribute + markdown + \s*=\s* + (?> + (["\']) # $1: quote delimiter + (.*?) # $2: attribute value + \1 # matching delimiter + | + ([^\s>]*) # $3: unquoted attribute value + ) + () # $4: make $3 always defined (avoid warnings) + }xs'; + + # Regex to match any tag. + $tag_re = '{ + ( # $2: Capture whole tag. + + ".*?" | # Double quotes (can contain `>`) + \'.*?\' | # Single quotes (can contain `>`) + .+? # Anything but quotes and `>`. + )*? + )? + > # End of tag. + | + # HTML Comment + | + <\?.*?\?> | <%.*?%> # Processing instruction + | + # CData Block + ) + }xs'; + + $original_text = $text; # Save original text in case of faliure. + + $depth = 0; # Current depth inside the tag tree. + $block_text = ""; # Temporary text holder for current text. + $parsed = ""; # Parsed text that will be returned. + + # + # Get the name of the starting tag. + # (This pattern makes $base_tag_name_re safe without quoting.) + # + if (preg_match('/^<([\w:$]*)\b/', $text, $matches)) + $base_tag_name_re = $matches[1]; + + # + # Loop through every tag until we find the corresponding closing tag. + # + do { + # + # Split the text using the first $tag_match pattern found. + # Text before pattern will be first in the array, text after + # pattern will be at the end, and between will be any catches made + # by the pattern. + # + $parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); + + if (count($parts) < 3) { + # + # End of $text reached with unbalenced tag(s). + # In that case, we return original text unchanged and pass the + # first character as filtered to prevent an infinite loop in the + # parent function. + # + return array($original_text{0}, substr($original_text, 1)); + } + + $block_text .= $parts[0]; # Text before current tag. + $tag = $parts[1]; # Tag to handle. + $text = $parts[2]; # Remaining text after current tag. + + # + # Check for: Auto-close tag (like
    ) + # Comments and Processing Instructions. + # + if (preg_match('{^auto_close_tags_re.')\b}', $tag) || + $tag{1} == '!' || $tag{1} == '?') + { + # Just add the tag to the block as if it was text. + $block_text .= $tag; + } + else { + # + # Increase/decrease nested tag count. Only do so if + # the tag's name match base tag's. + # + if (preg_match('{^mode = $attr_m[2] . $attr_m[3]; + $span_mode = $this->mode == 'span' || $this->mode != 'block' && + preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag); + + # Calculate indent before tag. + if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) { + $strlen = $this->utf8_strlen; + $indent = $strlen($matches[1], 'UTF-8'); + } else { + $indent = 0; + } + + # End preceding block with this tag. + $block_text .= $tag; + $parsed .= $this->$hash_method($block_text); + + # Get enclosing tag name for the ParseMarkdown function. + # (This pattern makes $tag_name_re safe without quoting.) + preg_match('/^<([\w:$]*)\b/', $tag, $matches); + $tag_name_re = $matches[1]; + + # Parse the content using the HTML-in-Markdown parser. + list ($block_text, $text) + = $this->_hashHTMLBlocks_inMarkdown($text, $indent, + $tag_name_re, $span_mode); + + # Outdent markdown text. + if ($indent > 0) { + $block_text = preg_replace("/^[ ]{1,$indent}/m", "", + $block_text); + } + + # Append tag content to parsed text. + if (!$span_mode) $parsed .= "\n\n$block_text\n\n"; + else $parsed .= "$block_text"; + + # Start over with a new block. + $block_text = ""; + } + else $block_text .= $tag; + } + + } while ($depth > 0); + + # + # Hash last block text that wasn't processed inside the loop. + # + $parsed .= $this->$hash_method($block_text); + + return array($parsed, $text); + } + + + function hashClean($text) { + # + # Called whenever a tag must be hashed when a function inserts a "clean" tag + # in $text, it passes through this function and is automaticaly escaped, + # blocking invalid nested overlap. + # + return $this->hashPart($text, 'C'); + } + + + function doAnchors($text) { + # + # Turn Markdown link shortcuts into XHTML tags. + # + if ($this->in_anchor) return $text; + $this->in_anchor = true; + + # + # First, handle reference-style links: [link text] [id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + # + # Next, inline-style links: [link text](url "optional title") + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + \( # literal paren + [ \n]* + (?: + <(.+?)> # href = $3 + | + ('.$this->nested_url_parenthesis_re.') # href = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # Title = $7 + \6 # matching quote + [ \n]* # ignore any spaces/tabs between closing quote and ) + )? # title is optional + \) + (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes + ) + }xs', + array(&$this, '_doAnchors_inline_callback'), $text); + + # + # Last, handle reference-style shortcuts: [link text] + # These must come last in case you've also got [link text][1] + # or [link text](/foo) + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ([^\[\]]+) # link text = $2; can\'t contain [ or ] + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); + + $this->in_anchor = false; + return $text; + } + function _doAnchors_reference_callback($matches) { + $whole_match = $matches[1]; + $link_text = $matches[2]; + $link_id =& $matches[3]; + + if ($link_id == "") { + # for shortcut links like [this][] or [this]. + $link_id = $link_text; + } + + # lower-case and turn embedded newlines into spaces + $link_id = strtolower($link_id); + $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); + + if (isset($this->urls[$link_id])) { + $url = $this->urls[$link_id]; + $url = $this->encodeAttribute($url); + + $result = "titles[$link_id] ) ) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + if (isset($this->ref_attr[$link_id])) + $result .= $this->ref_attr[$link_id]; + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + $result = $this->hashPart($result); + } + else { + $result = $whole_match; + } + return $result; + } + function _doAnchors_inline_callback($matches) { + $whole_match = $matches[1]; + $link_text = $this->runSpanGamut($matches[2]); + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + $attr = $this->doExtraAttributes("a", $dummy =& $matches[8]); + + + $url = $this->encodeAttribute($url); + + $result = "encodeAttribute($title); + $result .= " title=\"$title\""; + } + $result .= $attr; + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + + return $this->hashPart($result); + } + + + function doImages($text) { + # + # Turn Markdown image shortcuts into tags. + # + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }xs', + array(&$this, '_doImages_reference_callback'), $text); + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + \s? # One optional whitespace character + \( # literal paren + [ \n]* + (?: + <(\S*)> # src url = $3 + | + ('.$this->nested_url_parenthesis_re.') # src url = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # title = $7 + \6 # matching quote + [ \n]* + )? # title is optional + \) + (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes + ) + }xs', + array(&$this, '_doImages_inline_callback'), $text); + + return $text; + } + function _doImages_reference_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $link_id = strtolower($matches[3]); + + if ($link_id == "") { + $link_id = strtolower($alt_text); # for shortcut links like ![this][]. + } + + $alt_text = $this->encodeAttribute($alt_text); + if (isset($this->urls[$link_id])) { + $url = $this->encodeAttribute($this->urls[$link_id]); + $result = "\"$alt_text\"";titles[$link_id])) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + if (isset($this->ref_attr[$link_id])) + $result .= $this->ref_attr[$link_id]; + $result .= $this->empty_element_suffix; + $result = $this->hashPart($result); + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + return $result; + } + function _doImages_inline_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + $attr = $this->doExtraAttributes("img", $dummy =& $matches[8]); + + $alt_text = $this->encodeAttribute($alt_text); + $url = $this->encodeAttribute($url); + $result = "\"$alt_text\"";encodeAttribute($title); + $result .= " title=\"$title\""; # $title already quoted + } + $result .= $attr; + $result .= $this->empty_element_suffix; + + return $this->hashPart($result); + } + + + function doHeaders($text) { + # + # Redefined to add id and class attribute support. + # + # Setext-style headers: + # Header 1 {#header1} + # ======== + # + # Header 2 {#header2 .class1 .class2} + # -------- + # + $text = preg_replace_callback( + '{ + (^.+?) # $1: Header text + (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes + [ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer + }mx', + array(&$this, '_doHeaders_callback_setext'), $text); + + # atx-style headers: + # # Header 1 {#header1} + # ## Header 2 {#header2} + # ## Header 2 with closing hashes ## {#header3.class1.class2} + # ... + # ###### Header 6 {.class2} + # + $text = preg_replace_callback('{ + ^(\#{1,6}) # $1 = string of #\'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #\'s (not counted) + (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes + [ ]* + \n+ + }xm', + array(&$this, '_doHeaders_callback_atx'), $text); + + return $text; + } + function _doHeaders_callback_setext($matches) { + if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) + return $matches[0]; + $level = $matches[3]{0} == '=' ? 1 : 2; + $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2]); + $block = "".$this->runSpanGamut($matches[1]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + function _doHeaders_callback_atx($matches) { + $level = strlen($matches[1]); + $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[3]); + $block = "".$this->runSpanGamut($matches[2]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + + + function doTables($text) { + # + # Form HTML tables. + # + $less_than_tab = $this->tab_width - 1; + # + # Find tables with leading pipe. + # + # | Header 1 | Header 2 + # | -------- | -------- + # | Cell 1 | Cell 2 + # | Cell 3 | Cell 4 + # + $text = preg_replace_callback(' + { + ^ # Start of a line + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + [|] # Optional leading pipe (present) + (.+) \n # $1: Header row (at least one pipe) + + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + [|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline + + ( # $3: Cells + (?> + [ ]* # Allowed whitespace. + [|] .* \n # Row content. + )* + ) + (?=\n|\Z) # Stop at final double newline. + }xm', + array(&$this, '_doTable_leadingPipe_callback'), $text); + + # + # Find tables without leading pipe. + # + # Header 1 | Header 2 + # -------- | -------- + # Cell 1 | Cell 2 + # Cell 3 | Cell 4 + # + $text = preg_replace_callback(' + { + ^ # Start of a line + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + (\S.*[|].*) \n # $1: Header row (at least one pipe) + + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + ([-:]+[ ]*[|][-| :]*) \n # $2: Header underline + + ( # $3: Cells + (?> + .* [|] .* \n # Row content + )* + ) + (?=\n|\Z) # Stop at final double newline. + }xm', + array(&$this, '_DoTable_callback'), $text); + + return $text; + } + function _doTable_leadingPipe_callback($matches) { + $head = $matches[1]; + $underline = $matches[2]; + $content = $matches[3]; + + # Remove leading pipe for each row. + $content = preg_replace('/^ *[|]/m', '', $content); + + return $this->_doTable_callback(array($matches[0], $head, $underline, $content)); + } + function _doTable_callback($matches) { + $head = $matches[1]; + $underline = $matches[2]; + $content = $matches[3]; + + # Remove any tailing pipes for each line. + $head = preg_replace('/[|] *$/m', '', $head); + $underline = preg_replace('/[|] *$/m', '', $underline); + $content = preg_replace('/[|] *$/m', '', $content); + + # Reading alignement from header underline. + $separators = preg_split('/ *[|] */', $underline); + foreach ($separators as $n => $s) { + if (preg_match('/^ *-+: *$/', $s)) $attr[$n] = ' align="right"'; + else if (preg_match('/^ *:-+: *$/', $s))$attr[$n] = ' align="center"'; + else if (preg_match('/^ *:-+ *$/', $s)) $attr[$n] = ' align="left"'; + else $attr[$n] = ''; + } + + # Parsing span elements, including code spans, character escapes, + # and inline HTML tags, so that pipes inside those gets ignored. + $head = $this->parseSpan($head); + $headers = preg_split('/ *[|] */', $head); + $col_count = count($headers); + $attr = array_pad($attr, $col_count, ''); + + # Write column headers. + $text = "\n"; + $text .= "\n"; + $text .= "\n"; + foreach ($headers as $n => $header) + $text .= " ".$this->runSpanGamut(trim($header))."\n"; + $text .= "\n"; + $text .= "\n"; + + # Split content by row. + $rows = explode("\n", trim($content, "\n")); + + $text .= "\n"; + foreach ($rows as $row) { + # Parsing span elements, including code spans, character escapes, + # and inline HTML tags, so that pipes inside those gets ignored. + $row = $this->parseSpan($row); + + # Split row by cell. + $row_cells = preg_split('/ *[|] */', $row, $col_count); + $row_cells = array_pad($row_cells, $col_count, ''); + + $text .= "\n"; + foreach ($row_cells as $n => $cell) + $text .= " ".$this->runSpanGamut(trim($cell))."\n"; + $text .= "\n"; + } + $text .= "\n"; + $text .= "
    "; + + return $this->hashBlock($text) . "\n"; + } + + + function doDefLists($text) { + # + # Form HTML definition lists. + # + $less_than_tab = $this->tab_width - 1; + + # Re-usable pattern to match any entire dl list: + $whole_list_re = '(?> + ( # $1 = whole list + ( # $2 + [ ]{0,'.$less_than_tab.'} + ((?>.*\S.*\n)+) # $3 = defined term + \n? + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + (?s:.+?) + ( # $4 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another term + [ ]{0,'.$less_than_tab.'} + (?: \S.*\n )+? # defined term + \n? + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + (?! # Negative lookahead for another definition + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + ) + ) + )'; // mx + + $text = preg_replace_callback('{ + (?>\A\n?|(?<=\n\n)) + '.$whole_list_re.' + }mx', + array(&$this, '_doDefLists_callback'), $text); + + return $text; + } + function _doDefLists_callback($matches) { + # Re-usable patterns to match list item bullets and number markers: + $list = $matches[1]; + + # Turn double returns into triple returns, so that we can make a + # paragraph for the last item in a list, if necessary: + $result = trim($this->processDefListItems($list)); + $result = "
    \n" . $result . "\n
    "; + return $this->hashBlock($result) . "\n\n"; + } + + + function processDefListItems($list_str) { + # + # Process the contents of a single definition list, splitting it + # into individual term and definition list items. + # + $less_than_tab = $this->tab_width - 1; + + # trim trailing blank lines: + $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); + + # Process definition terms. + $list_str = preg_replace_callback('{ + (?>\A\n?|\n\n+) # leading line + ( # definition terms = $1 + [ ]{0,'.$less_than_tab.'} # leading whitespace + (?!\:[ ]|[ ]) # negative lookahead for a definition + # mark (colon) or more whitespace. + (?> \S.* \n)+? # actual term (not whitespace). + ) + (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed + # with a definition mark. + }xm', + array(&$this, '_processDefListItems_callback_dt'), $list_str); + + # Process actual definitions. + $list_str = preg_replace_callback('{ + \n(\n+)? # leading line = $1 + ( # marker space = $2 + [ ]{0,'.$less_than_tab.'} # whitespace before colon + \:[ ]+ # definition mark (colon) + ) + ((?s:.+?)) # definition text = $3 + (?= \n+ # stop at next definition mark, + (?: # next term or end of text + [ ]{0,'.$less_than_tab.'} \:[ ] | +
    | \z + ) + ) + }xm', + array(&$this, '_processDefListItems_callback_dd'), $list_str); + + return $list_str; + } + function _processDefListItems_callback_dt($matches) { + $terms = explode("\n", trim($matches[1])); + $text = ''; + foreach ($terms as $term) { + $term = $this->runSpanGamut(trim($term)); + $text .= "\n
    " . $term . "
    "; + } + return $text . "\n"; + } + function _processDefListItems_callback_dd($matches) { + $leading_line = $matches[1]; + $marker_space = $matches[2]; + $def = $matches[3]; + + if ($leading_line || preg_match('/\n{2,}/', $def)) { + # Replace marker with the appropriate whitespace indentation + $def = str_repeat(' ', strlen($marker_space)) . $def; + $def = $this->runBlockGamut($this->outdent($def . "\n\n")); + $def = "\n". $def ."\n"; + } + else { + $def = rtrim($def); + $def = $this->runSpanGamut($this->outdent($def)); + } + + return "\n
    " . $def . "
    \n"; + } + + + function doFencedCodeBlocks($text) { + # + # Adding the fenced code block syntax to regular Markdown: + # + # ~~~ + # Code block + # ~~~ + # + $less_than_tab = $this->tab_width; + + $text = preg_replace_callback('{ + (?:\n|\A) + # 1: Opening marker + ( + (?:~{3,}|`{3,}) # 3 or more tildes/backticks. + ) + [ ]* + (?: + \.?([-_:a-zA-Z0-9]+) # 2: standalone class name + | + '.$this->id_class_attr_catch_re.' # 3: Extra attributes + )? + [ ]* \n # Whitespace and newline following marker. + + # 4: Content + ( + (?> + (?!\1 [ ]* \n) # Not a closing marker. + .*\n+ + )+ + ) + + # Closing marker. + \1 [ ]* (?= \n ) + }xm', + array(&$this, '_doFencedCodeBlocks_callback'), $text); + + return $text; + } + function _doFencedCodeBlocks_callback($matches) { + $classname =& $matches[2]; + $attrs =& $matches[3]; + $codeblock = $matches[4]; + $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); + $codeblock = preg_replace_callback('/^\n+/', + array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock); + + if ($classname != "") { + if ($classname{0} == '.') + $classname = substr($classname, 1); + $attr_str = ' class="'.$this->code_class_prefix.$classname.'"'; + } else { + $attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? "pre" : "code", $attrs); + } + $pre_attr_str = $this->code_attr_on_pre ? $attr_str : ''; + $code_attr_str = $this->code_attr_on_pre ? '' : $attr_str; + $codeblock = "$codeblock
    "; + + return "\n\n".$this->hashBlock($codeblock)."\n\n"; + } + function _doFencedCodeBlocks_newlines($matches) { + return str_repeat("empty_element_suffix", + strlen($matches[0])); + } + + + # + # Redefining emphasis markers so that emphasis by underscore does not + # work in the middle of a word. + # + var $em_relist = array( + '' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? tags + # + # Strip leading and trailing lines: + $text = preg_replace('/\A\n+|\n+\z/', '', $text); + + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); + + # + # Wrap

    tags and unhashify HTML blocks + # + foreach ($grafs as $key => $value) { + $value = trim($this->runSpanGamut($value)); + + # Check if this should be enclosed in a paragraph. + # Clean tag hashes & block tag hashes are left alone. + $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value); + + if ($is_p) { + $value = "

    $value

    "; + } + $grafs[$key] = $value; + } + + # Join grafs in one text, then unhash HTML tags. + $text = implode("\n\n", $grafs); + + # Finish by removing any tag hashes still present in $text. + $text = $this->unhash($text); + + return $text; + } + + + ### Footnotes + + function stripFootnotes($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: [^id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[\^(.+?)\][ ]?: # note_id = $1 + [ ]* + \n? # maybe *one* newline + ( # text = $2 (no blank lines allowed) + (?: + .+ # actual text + | + \n # newlines but + (?!\[\^.+?\]:\s)# negative lookahead for footnote marker. + (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed + # by non-indented content + )* + ) + }xm', + array(&$this, '_stripFootnotes_callback'), + $text); + return $text; + } + function _stripFootnotes_callback($matches) { + $note_id = $this->fn_id_prefix . $matches[1]; + $this->footnotes[$note_id] = $this->outdent($matches[2]); + return ''; # String that will replace the block + } + + + function doFootnotes($text) { + # + # Replace footnote references in $text [^id] with a special text-token + # which will be replaced by the actual footnote marker in appendFootnotes. + # + if (!$this->in_anchor) { + $text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text); + } + return $text; + } + + + function appendFootnotes($text) { + # + # Append footnote list to text. + # + $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + array(&$this, '_appendFootnotes_callback'), $text); + + if (!empty($this->footnotes_ordered)) { + $text .= "\n\n"; + $text .= "
    \n"; + $text .= "empty_element_suffix ."\n"; + $text .= "
      \n\n"; + + $attr = " rev=\"footnote\""; + if ($this->fn_backlink_class != "") { + $class = $this->fn_backlink_class; + $class = $this->encodeAttribute($class); + $attr .= " class=\"$class\""; + } + if ($this->fn_backlink_title != "") { + $title = $this->fn_backlink_title; + $title = $this->encodeAttribute($title); + $attr .= " title=\"$title\""; + } + $num = 0; + + while (!empty($this->footnotes_ordered)) { + $footnote = reset($this->footnotes_ordered); + $note_id = key($this->footnotes_ordered); + unset($this->footnotes_ordered[$note_id]); + $ref_count = $this->footnotes_ref_count[$note_id]; + unset($this->footnotes_ref_count[$note_id]); + unset($this->footnotes[$note_id]); + + $footnote .= "\n"; # Need to append newline before parsing. + $footnote = $this->runBlockGamut("$footnote\n"); + $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + array(&$this, '_appendFootnotes_callback'), $footnote); + + $attr = str_replace("%%", ++$num, $attr); + $note_id = $this->encodeAttribute($note_id); + + # Prepare backlink, multiple backlinks if multiple references + $backlink = ""; + for ($ref_num = 2; $ref_num <= $ref_count; ++$ref_num) { + $backlink .= " "; + } + # Add backlink to last paragraph; create new paragraph if needed. + if (preg_match('{

      $}', $footnote)) { + $footnote = substr($footnote, 0, -4) . " $backlink

      "; + } else { + $footnote .= "\n\n

      $backlink

      "; + } + + $text .= "
    1. \n"; + $text .= $footnote . "\n"; + $text .= "
    2. \n\n"; + } + + $text .= "
    \n"; + $text .= "
    "; + } + return $text; + } + function _appendFootnotes_callback($matches) { + $node_id = $this->fn_id_prefix . $matches[1]; + + # Create footnote marker only if it has a corresponding footnote *and* + # the footnote hasn't been used by another marker. + if (isset($this->footnotes[$node_id])) { + $num =& $this->footnotes_numbers[$node_id]; + if (!isset($num)) { + # Transfer footnote content to the ordered list and give it its + # number + $this->footnotes_ordered[$node_id] = $this->footnotes[$node_id]; + $this->footnotes_ref_count[$node_id] = 1; + $num = $this->footnote_counter++; + $ref_count_mark = ''; + } else { + $ref_count_mark = $this->footnotes_ref_count[$node_id] += 1; + } + + $attr = " rel=\"footnote\""; + if ($this->fn_link_class != "") { + $class = $this->fn_link_class; + $class = $this->encodeAttribute($class); + $attr .= " class=\"$class\""; + } + if ($this->fn_link_title != "") { + $title = $this->fn_link_title; + $title = $this->encodeAttribute($title); + $attr .= " title=\"$title\""; + } + + $attr = str_replace("%%", $num, $attr); + $node_id = $this->encodeAttribute($node_id); + + return + "". + "$num". + ""; + } + + return "[^".$matches[1]."]"; + } + + + ### Abbreviations ### + + function stripAbbreviations($text) { + # + # Strips abbreviations from text, stores titles in hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: [id]*: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1 + (.*) # text = $2 (no blank lines allowed) + }xm', + array(&$this, '_stripAbbreviations_callback'), + $text); + return $text; + } + function _stripAbbreviations_callback($matches) { + $abbr_word = $matches[1]; + $abbr_desc = $matches[2]; + if ($this->abbr_word_re) + $this->abbr_word_re .= '|'; + $this->abbr_word_re .= preg_quote($abbr_word); + $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); + return ''; # String that will replace the block + } + + + function doAbbreviations($text) { + # + # Find defined abbreviations in text and wrap them in elements. + # + if ($this->abbr_word_re) { + // cannot use the /x modifier because abbr_word_re may + // contain significant spaces: + $text = preg_replace_callback('{'. + '(?abbr_word_re.')'. + '(?![\w\x1A])'. + '}', + array(&$this, '_doAbbreviations_callback'), $text); + } + return $text; + } + function _doAbbreviations_callback($matches) { + $abbr = $matches[0]; + if (isset($this->abbr_desciptions[$abbr])) { + $desc = $this->abbr_desciptions[$abbr]; + if (empty($desc)) { + return $this->hashPart("$abbr"); + } else { + $desc = $this->encodeAttribute($desc); + return $this->hashPart("$abbr"); + } + } else { + return $matches[0]; + } + } + +} + + +/* + +PHP Markdown Extra +================== + +Description +----------- + +This is a PHP port of the original Markdown formatter written in Perl +by John Gruber. This special "Extra" version of PHP Markdown features +further enhancements to the syntax for making additional constructs +such as tables and definition list. + +Markdown is a text-to-HTML filter; it translates an easy-to-read / +easy-to-write structured text format into HTML. Markdown's text format +is mostly similar to that of plain text email, and supports features such +as headers, *emphasis*, code blocks, blockquotes, and links. + +Markdown's syntax is designed not as a generic markup language, but +specifically to serve as a front-end to (X)HTML. You can use span-level +HTML tags anywhere in a Markdown document, and you can use block level +HTML tags (like
    and as well). + +For more information about Markdown's syntax, see: + + + + +Bugs +---- + +To file bug reports please send email to: + + + +Please include with your report: (1) the example input; (2) the output you +expected; (3) the output Markdown actually produced. + + +Version History +--------------- + +See the readme file for detailed release notes for this version. + + +Copyright and License +--------------------- + +PHP Markdown & Extra +Copyright (c) 2004-2013 Michel Fortin + +All rights reserved. + +Based on Markdown +Copyright (c) 2003-2006 John Gruber + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. + +*/ +?> \ No newline at end of file diff --git a/_inc/lib/markdown/gfm.php b/_inc/lib/markdown/gfm.php new file mode 100644 index 0000000000000..4a9e0a24ad469 --- /dev/null +++ b/_inc/lib/markdown/gfm.php @@ -0,0 +1,321 @@ + + * @link https://github.com/evansolomon/wp-github-flavored-markdown-comments + * + * Add a few extras from GitHub's Markdown implementation. Must be used in a WordPress environment. + */ + +class WPCom_GHF_Markdown_Parser extends MarkdownExtra_Parser { + + /** + * Hooray somewhat arbitrary numbers that are fearful of 1.0.x. + */ + const WPCOM_GHF_MARDOWN_VERSION = '0.9.0'; + + /** + * Use a [code] shortcode when encountering a fenced code block + * @var boolean + */ + public $use_code_shortcode = true; + + /** + * Preserve shortcodes, untouched by Markdown. + * This requires use within a WordPress installation. + * @var boolean + */ + public $preserve_shortcodes = true; + + /** + * Preserve the legacy $latex your-latex-code-here$ style + * LaTeX markup + */ + public $preserve_latex = true; + + /** + * Strip paragraphs from the output. This is the right default for WordPress, + * which generally wants to create its own paragraphs with `wpautop` + * @var boolean + */ + public $strip_paras = true; + + // Will run through sprintf - you can supply your own syntax if you want + public $shortcode_start = '[code lang=%s]'; + public $shortcode_end = '[/code]'; + + // Stores shortcodes we remove and then replace + protected $preserve_text_hash = array(); + + /** + * Set environment defaults based on presence of key functions/classes. + */ + public function __construct() { + $this->use_code_shortcode = class_exists( 'SyntaxHighlighter' ); + $this->preserve_shortcodes = function_exists( 'get_shortcode_regex' ); + $this->preserve_latex = function_exists( 'latex_markup' ); + $this->strip_paras = function_exists( 'wpautop' ); + + parent::MarkdownExtra_Parser(); + } + + /** + * Overload to specify heading styles only if the hash has space(s) after it. This is actually in keeping with + * the documentation and eases the semantic overload of the hash character. + * #Will Not Produce a Heading 1 + * # This Will Produce a Heading 1 + * + * @param string $text Markdown text + * @return string HTML-transformed text + */ + public function transform( $text ) { + // Remove all shortcodes so their interiors are left intact + if ( $this->preserve_shortcodes ) { + $text = $this->shortcode_preserve( $text ); + } + // Remove legacy LaTeX so it's left intact + if ( $this->preserve_latex ) { + $text = $this->latex_preserve( $text ); + } + + // escape line-beginning # chars that do not have a space after them. + $text = preg_replace_callback( '|^#{1,6}( )?|um', array( $this, '_doEscapeForHashWithoutSpacing' ), $text ); + + // run through core Markdown + $text = parent::transform( $text ); + + // put start-of-line # chars back in place + $text = preg_replace( "/^(

    )?(#|\\\\#)/um", "$1#", $text ); + + // Restore shortcodes/LaTeX + $text = $this->shortcode_restore( $text ); + + // Strip paras if set + if ( $this->strip_paras ) { + $text = $this->unp( $text ); + } + + return $text; + } + + /** + * Preserve code block contents by HTML encoding them. Useful before getting to KSES stripping. + * @param string $text Markdown/HTML content + * @return string Markdown/HTML content with escaped code blocks + */ + public function codeblock_preserve( $text ) { + $text = preg_replace_callback( "/^(`{3})([^`\n]+)?\n([^`~]+)(`{3})/m", array( $this, 'do_codeblock_preserve' ), $text ); + $text = preg_replace_callback( "/^(~{3})([^~\n]+)?\n([^~~]+)(~{3})/m", array( $this, 'do_codeblock_preserve' ), $text ); + return $text; + } + + /** + * Regex callback for code block preservation. + * @param array $matches Regex matches + * @return string Codeblock with escaped interior + */ + public function do_codeblock_preserve( $matches ) { + $block = stripslashes( $matches[3] ); + $block = esc_html( $block ); + $open = $matches[1] . $matches[2] . "\n"; + return $open . $block . $matches[4]; + } + + /** + * Restore previously preserved (i.e. escaped) code block contents. + * @param string $text Markdown/HTML content with escaped code blocks + * @return string Markdown/HTML content + */ + public function codeblock_restore( $text ) { + $text = preg_replace_callback( "/^(`{3})([^`\n]+)?\n([^`~]+)(`{3})/m", array( $this, 'do_codeblock_restore' ), $text ); + $text = preg_replace_callback( "/^(~{3})([^~\n]+)?\n([^~~]+)(~{3})/m", array( $this, 'do_codeblock_restore' ), $text ); + return $text; + } + + /** + * Regex callback for code block restoration (unescaping). + * @param array $matches Regex matches + * @return string Codeblock with unescaped interior + */ + public function do_codeblock_restore( $matches ) { + $block = html_entity_decode( $matches[3] ); + $open = $matches[1] . $matches[2] . "\n"; + return $open . $block . $matches[4]; + } + + /** + * Called to preserve legacy LaTeX like $latex some-latex-text $ + * @param string $text Text in which to preserve LaTeX + * @return string Text with LaTeX replaced by a hash that will be restored later + */ + protected function latex_preserve( $text ) { + // regex from latex_remove() + $regex = '% + \$latex(?:=\s*|\s+) + ((?: + [^$]+ # Not a dollar + | + (?<=(?get_shortcode_regex(), array( $this, '_doRemoveText' ), $text ); + return $text; + } + + /** + * Restores any text preserved by $this->latex_preserve() or $this->shortcode_preserve() + * @param string $text Text that may have hashed preservation placeholders + * @return string Text with hashed preseravtion placeholders replaced by original text + */ + protected function shortcode_restore( $text ) { + foreach( $this->preserve_text_hash as $hash => $value ) { + $placeholder = $this->hash_maker( $hash ); + $text = str_replace( $placeholder, $value, $text ); + } + // reset the hash + $this->preserve_text_hash = array(); + return $text; + } + + /** + * Regex callback for text preservation + * @param array $m Regex $matches array + * @return string A placeholder that will later be replaced by the original text + */ + protected function _doRemoveText( $m ) { + $hash = md5( $m[0] ); + $this->preserve_text_hash[ $hash ] = $m[0]; + $placeholder = $this->hash_maker( $hash ); + return $placeholder; + } + + /** + * Less glamorous than the Keymaker + * @param string $hash An md5 hash + * @return string A placeholder hash + */ + protected function hash_maker( $hash ) { + return 'MARDOWN_HASH' . $hash . 'MARKDOWN_HASH'; + } + + /** + * Remove bare

    elements.

    s with attributes will be preserved. + * @param string $text HTML content + * @return string

    -less content + */ + public function unp( $text ) { + return preg_replace( "#

    (.*?)

    (\n|$)#ums", '$1$2', $text ); + } + + /** + * A regex of all shortcodes currently registered by the current + * WordPress installation + * @uses get_shortcode_regex() + * @return string A regex for grabbing shortcodes. + */ + protected function get_shortcode_regex() { + $pattern = get_shortcode_regex(); + return "/$pattern/s"; + } + + /** + * Overload to support ```-fenced code blocks for pre-Markdown Extra 1.2.8 + * https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks + */ + public function doFencedCodeBlocks( $text ) { + // If we're at least at 1.2.8, native fenced code blocks are in. + // Below is just copied from it in case we somehow got loaded on + // top of someone else's Markdown Extra + if ( version_compare( MARKDOWNEXTRA_VERSION, '1.2.8', '>=' ) ) + return parent::doFencedCodeBlocks( $text ); + + # + # Adding the fenced code block syntax to regular Markdown: + # + # ~~~ + # Code block + # ~~~ + # + $less_than_tab = $this->tab_width; + + $text = preg_replace_callback('{ + (?:\n|\A) + # 1: Opening marker + ( + (?:~{3,}|`{3,}) # 3 or more tildes/backticks. + ) + [ ]* + (?: + \.?([-_:a-zA-Z0-9]+) # 2: standalone class name + | + '.$this->id_class_attr_catch_re.' # 3: Extra attributes + )? + [ ]* \n # Whitespace and newline following marker. + + # 4: Content + ( + (?> + (?!\1 [ ]* \n) # Not a closing marker. + .*\n+ + )+ + ) + + # Closing marker. + \1 [ ]* (?= \n ) + }xm', + array($this, '_doFencedCodeBlocks_callback'), $text); + + return $text; + } + + /** + * Callback for pre-processing start of line hashes to slyly escape headings that don't + * have a leading space + * @param array $m preg_match matches + * @return string possibly escaped start of line hash + */ + public function _doEscapeForHashWithoutSpacing( $m ) { + if ( ! isset( $m[1] ) ) + $m[0] = '\\' . $m[0]; + return $m[0]; + } + + /** + * Overload to support Viper's [code] shortcode. Because awesome. + */ + public function _doFencedCodeBlocks_callback( $matches ) { + // just MarkdownExtra_Parser if we're not going ultra-deluxe + if ( ! $this->use_code_shortcode ) { + return parent::_doFencedCodeBlocks_callback( $matches ); + } + + // default to a "text" class if one wasn't passed. Helps with encoding issues later. + if ( empty( $matches[2] ) ) { + $matches[2] = 'text'; + } + + $classname =& $matches[2]; + $codeblock = preg_replace_callback('/^\n+/', array( $this, '_doFencedCodeBlocks_newlines' ), $matches[4] ); + + if ( $classname{0} == '.' ) + $classname = substr( $classname, 1 ); + + $codeblock = esc_html( $codeblock ); + $codeblock = sprintf( $this->shortcode_start, $classname ) . "\n{$codeblock}" . $this->shortcode_end; + return "\n\n" . $this->hashBlock( $codeblock ). "\n\n"; + } + +} diff --git a/_inc/lib/markdown/test.php b/_inc/lib/markdown/test.php new file mode 100644 index 0000000000000..8a0b08be321d5 --- /dev/null +++ b/_inc/lib/markdown/test.php @@ -0,0 +1,33 @@ + + +``` +'; +#echo $text; +echo $parser->transform( $text ); +echo "\n\n\n"; +#echo $parser->hashBlock( '
    foobar
    ' ); + + +$foo = <<translate_current_user_to_role(); - + if ( !$role ) { return new Jetpack_Error( 'role', __( 'An administrator for this blog must set up the Jetpack connection.', 'jetpack' ) ); } diff --git a/class.jetpack-debugger.php b/class.jetpack-debugger.php index dcc09984e503a..dc3c906da1096 100644 --- a/class.jetpack-debugger.php +++ b/class.jetpack-debugger.php @@ -15,7 +15,7 @@ private static function is_jetpack_support_open() { } public static function jetpack_increase_timeout($time) { - $time = 20; //seconds + $time = 30; //seconds return $time; } diff --git a/class.jetpack-network-sites-list-table.php b/class.jetpack-network-sites-list-table.php new file mode 100644 index 0000000000000..97bcf709a431c --- /dev/null +++ b/class.jetpack-network-sites-list-table.php @@ -0,0 +1,124 @@ + '', + 'blogname' => __( 'Site Name', 'jetpack' ), + 'blog_path' => __( 'Path', 'jetpack' ), + 'connected' => __( 'Connected', 'jetpack' ), + ); + + return $columns; + } + + public function prepare_items() { + $jpms = Jetpack_Network::init(); + + // Deal with bulk actions if any were requested by the user + $this->process_bulk_action(); + + $columns = $this->get_columns(); + $hidden = array(); + $sortable = array(); + $this->_column_headers = array( $columns, $hidden, $sortable ); + $this->items = $jpms->wp_get_sites();; + } + + public function column_blogname( $item ) { + // http://jpms/wp-admin/network/site-info.php?id=1 + switch_to_blog( $item->blog_id ); + $jp_url = admin_url( 'admin.php?page=jetpack' ); + restore_current_blog(); + + $actions = array( + 'edit' => '' . __( 'Edit', 'jetpack' ) . '', + 'dashboard' => 'Dashboard', + 'view' => 'View', + 'jetpack-' . $item->blog_id => 'Jetpack', + ); + + return sprintf('%1$s %2$s', '' . get_blog_option( $item->blog_id, 'blogname' ) . '', $this->row_actions($actions) ); + } + + public function column_blog_path( $item ) { + return + '' . + str_replace( array( 'http://', 'https://' ), '', get_site_url( $item->blog_id, '', 'admin' ) ) . + ''; + } + + public function column_connected( $item ) { + $jpms = Jetpack_Network::init(); + $jp = Jetpack::init(); + + switch_to_blog( $item->blog_id ); + if( $jp->is_active() ) { + // Build url for disconnecting + $url = $jpms->get_url( array( + 'name' => 'subsitedisconnect', + 'site_id' => $item->blog_id, + + ) ); + restore_current_blog(); + return 'Disconnect'; + } + restore_current_blog(); + + // Build URL for connecting + $url = $jpms->get_url( array( + 'name' => 'subsiteregister', + 'site_id' => $item->blog_id, + ) ); + return 'Connect'; + } + + public function get_bulk_actions() { + $actions = array( + 'connect' => 'Connect', + 'disconnect' => 'Disconnect' + ); + + return $actions; + } + + function column_cb($item) { + return sprintf( + '', $item->blog_id + ); + } + + /** + * @todo Ensure sites are not in/active before performing action + */ + public function process_bulk_action() { + if( !isset( $_POST['bulk'] ) || empty ( $_POST['bulk'] ) ) + return; // Thou shall not pass! There is nothing to do + + $jpms = Jetpack_Network::init(); + + $action = $this->current_action(); + switch ( $action ) { + + case 'connect': + foreach( $_POST['bulk'] AS $k => $site ) { + $jpms->do_subsiteregister( $site ); + } + break; + case 'disconnect': + foreach( $_POST['bulk'] AS $k => $site ) { + $jpms->do_subsitedisconnect( $site ); + } + break; + } + } +} // end h diff --git a/class.jetpack-network.php b/class.jetpack-network.php new file mode 100644 index 0000000000000..27286cb381785 --- /dev/null +++ b/class.jetpack-network.php @@ -0,0 +1,815 @@ + Settings page + * + * @since 2.5 + * @var array + */ + private $setting_defaults = array( + 'auto-connect' => 0, + 'sub-site-connection-override' => 0, + 'manage_auto_activated_modules' => 0, + ); + + /** + * Constructor + * + * @since 2.5 + */ + private function __construct() { + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); // For the is_plugin... check + /* + * Sanity check to ensure the install is Multisite and we + * are in Network Admin + */ + if (is_multisite() && is_network_admin()) { + add_action('network_admin_menu', array($this, 'add_network_admin_menu')); + add_action('network_admin_edit_jetpack-network-settings', array($this, 'save_network_settings_page'), 10, 0); + add_action( 'init', array ( $this, 'jetpack_sites_list' ) ); + add_filter( 'admin_body_class', array( $this, 'body_class' ) ); + add_filter( 'wpmu_blogs_columns', array( $this, 'add_jetpack_sites_column' ) ); + add_action( 'manage_sites_custom_column', array( $this, 'render_jetpack_sites_column' ), 10, 2 ); + add_action( 'manage_blogs_custom_column', array( $this, 'render_jetpack_sites_column' ), 10, 2 ); + } + + /* + * Things that should only run on multisite + */ + if( is_multisite() && is_plugin_active_for_network( 'jetpack/jetpack.php' ) ) { + add_action( 'wp_before_admin_bar_render', array( $this, 'add_to_menubar' ) ); + + + /* + * If admin wants to automagically register new sites set the hook here + * + * This is a hacky way because xmlrpc is not available on wpmu_new_blog + */ + if( $this->get_option( 'auto-connect' ) == 1 ) { + //add_action( 'admin_init', array( $this, 'do_automatically_add_new_site' ) ); + add_action( 'wpmu_new_blog', array( $this, 'do_automatically_add_new_site' ) ); + } + } + + add_filter( 'jetpack_get_default_modules', array( $this, 'set_auto_activated_modules' ) ); + } + + /** + * Sets which modules get activated by default on subsite connection. + * Modules can be set in Network Admin > Jetpack > Settings + * + * @since 2.5 + * @param array $modules + * @return array + **/ + public function set_auto_activated_modules( $modules ) { + if( 1 == $this->get_option( 'manage_auto_activated_modules' ) ) { + return (array) $this->get_option( 'modules' ); + } else { + return $modules; + } + } + + /** + * Displays the Jetpack connection status on the Network Admin > Sites + * page. + * + * @param string $column_name + * @param int $blog_id + **/ + public function render_jetpack_sites_column( $column_name, $blog_id ) { + $jp = Jetpack::init(); + + switch_to_blog( $blog_id ); + if( $jp->is_active() ) { + // Build url for disconnecting + $url = $this->get_url( array( + 'name' => 'subsitedisconnect', + 'site_id' => $blog_id, + + ) ); + restore_current_blog(); + echo 'Disconnect'; + return; + } + restore_current_blog(); + + // Build URL for connecting + $url = $this->get_url( array( + 'name' => 'subsiteregister', + 'site_id' => $blog_id, + ) ); + echo 'Connect'; + return; + } + + /** + * Add the column for Jetpack connection status to the + * Network Admin > Sites list + * + * @since 2.5 + * @param array $columns + * @return array + **/ + public function add_jetpack_sites_column( $columns ) { + $columns['jetpack_connection'] = __( 'Jetpack' ); + return $columns; + } + + /** + * Registers new sites upon creation + * + * @since 2.5 + * @uses wpmu_new_blog + * @param int $blog_id + **/ + public function do_automatically_add_new_site( $blog_id ) { + $this->do_subsiteregister( $blog_id ); + } + + /** + * Adds .network-admin class to the body tag + * Helps distiguish network admin JP styles from regular site JP styles + * + * @since 2.6 + */ + public function body_class( $classes ) { + return 'network-admin'; + } + + /** + * Provides access to an instance of Jetpack_Network + * + * This is how the Jetpack_Network object should *always* be accessed + * + * @since 2.5 + * @return Jetpack_Network + */ + public static function init() { + if (!self::$instance || !is_a(self::$instance, 'Jetpack_Network')) { + self::$instance = new Jetpack_Network; + } + + return self::$instance; + } + + /** + * Registers the Multisite admin bar menu item shortcut. + * This shortcut helps users quickly and easily navigate to the Jetpack Network Admin + * menu from anywhere in their network. + * + * @since 2.5 + */ + public function register_menubar() { + add_action( 'wp_before_admin_bar_render', array( $this, 'add_to_menubar' ) ); + } + + /** + * Runs when Jetpack is deactivated from the network admin plugins menu. + * Each individual site will need to have Jetpack::disconnect called on it. + * Site that had Jetpack individually enabled will not be disconnected as + * on Multisite individually activated plugins are still activated when + * a plugin is deactivated network wide. + * + * @since 2.5 + **/ + public function deactivate() { + if( !is_network_admin() ) return; // Only fire if in network admin + + $sites = $this->wp_get_sites(); + + foreach( $sites AS $s ) { + switch_to_blog( $s->blog_id ); + $plugins = get_option( 'active_plugins' ); + + /* + * If this plugin was activated in the subsite individually + * we do not want to call disconnect. Plugins activated + * individually (before network activation) stay activated + * when the network deactivation occurs + */ + if( !in_array( 'jetpack/jetpack.php', $plugins ) ) { + Jetpack::disconnect(); + } + } + restore_current_blog(); + } + + /** + * Adds a link to the Jetpack Network Admin page in the netowrk admin menu bar. + * + * @since 2.6 + **/ + public function add_to_menubar () { + global $wp_admin_bar; + // Don't show for logged out users or single site mode. + if ( ! is_user_logged_in() || ! is_multisite() ) + return; + + $wp_admin_bar->add_node( array( + 'parent' => 'network-admin', + 'id' => 'network-admin-jetpack', + 'title' => __( 'Jetpack' ), + 'href' => $this->get_url( 'network_admin_page' ), + ) ); + } + + /** + * Returns various URL strings. Factory like + * + * $args can be a string or an array. + * If $args is an array there must be an element called name for the switch statement + * + * Currently supports: + * - subsiteregister: Pass array( 'name' => 'subsiteregister', 'site_id' => SITE_ID ) + * - network_admin_page: Provides link to /wp-admin/network/JETPACK + * - subsitedisconnect: Pass array( 'name' => 'subsitedisconnect', 'site_id' => SITE_ID ) + * + * @since 2.5 + * @param Mixed $args + * @return String + **/ + public function get_url( $args ) { + $url = null; // Default url value + + if( is_string( $args ) ) + $name = $args; + else + $name = $args['name']; + + + switch( $name ) { + case 'subsiteregister': + if( !isset( $args['site_id'] ) ) { + break; // If there is not a site id present we cannot go further + } + $url = network_admin_url( + 'admin.php?page=jetpack&action=subsiteregister&site_id=' + . $args['site_id'] ); + break; + + case 'network_admin_page': + $url = network_admin_url( 'admin.php?page=jetpack' ); + break; + case 'subsitedisconnect': + if( !isset( $args['site_id'] ) ) { + break; // If there is not a site id present we cannot go further + } + $url = network_admin_url( + 'admin.php?page=jetpack&action=subsitedisconnect&site_id=' + . $args['site_id'] ); + break; + } + return $url; + } + + /** + * Adds the Jetpack menu item to the Network Admin area + * + * @since 2.5 + */ + public function add_network_admin_menu() { + add_action( 'admin_print_styles', array( $this, 'network_admin_styles' ) ); + + add_menu_page(__('Jetpack', 'jetpack'), __('Jetpack', 'jetpack'), 'read', 'jetpack', array($this, 'network_admin_page'), 'div', 3); + add_submenu_page('jetpack', 'Jetpack Sites', 'Sites', 'manage_options', 'jetpack', array($this, 'network_admin_page')); + add_submenu_page('jetpack', __('Settings', 'jetpack'), __('Settings', 'jetpack'), 'read', 'jetpack-settings', array($this, 'render_network_admin_settings_page')); + + /** + * As jetpack_register_genericons is by default fired off a hook, + * the hook may have already fired by this point. + * So, let's just trigger it manually. + */ + require_once( JETPACK__PLUGIN_DIR . '_inc/genericons.php' ); + jetpack_register_genericons(); + + if ( ! wp_style_is( 'jetpack-icons', 'registered' ) ) + wp_register_style( 'jetpack-icons', plugins_url( '_inc/jetpack-icons/jetpack-icons.css', __FILE__ ), false, JETPACK__VERSION ); + + add_action( 'admin_enqueue_scripts', array( $this, 'admin_menu_css' ) ); + } + + /** + * Adds JP menu icon + * + * @since 2.6 + **/ + function admin_menu_css() { + // Make sure we're working off a clean version. + include( ABSPATH . WPINC . '/version.php' ); + if ( version_compare( $wp_version, '3.8-alpha', '>=' ) ) { + wp_enqueue_style( 'jetpack-icons' ); + $css = " + #toplevel_page_jetpack .wp-menu-image:before { + font-family: 'Jetpack' !important; + content: '\\e600'; + } + #menu-posts-feedback .wp-menu-image:before { + font-family: dashicons !important; + content: '\\f175'; + } + #adminmenu #menu-posts-feedback div.wp-menu-image { + background: none !important; + background-repeat: no-repeat; + }"; + } else { + $css = " + #toplevel_page_jetpack .wp-menu-image { + background: url( " . plugins_url( '_inc/images/menuicon-sprite.png', __FILE__ ) . " ) 0 90% no-repeat; + } + /* Retina Jetpack Menu Icon */ + @media only screen and (-moz-min-device-pixel-ratio: 1.5), + only screen and (-o-min-device-pixel-ratio: 3/2), + only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + #toplevel_page_jetpack .wp-menu-image { + background: url( " . plugins_url( '_inc/images/menuicon-sprite-2x.png', __FILE__ ) . " ) 0 90% no-repeat; + background-size:30px 64px; + } + } + #toplevel_page_jetpack.current .wp-menu-image, + #toplevel_page_jetpack.wp-has-current-submenu .wp-menu-image, + #toplevel_page_jetpack:hover .wp-menu-image { + background-position: top left; + }"; + } + wp_add_inline_style( 'wp-admin', $css ); + } + + /** + * Provides functionality for the Jetpack > Sites page. + * Does not does the display! + * + * @since 2.5 + */ + public function jetpack_sites_list() { + $jp = Jetpack::init(); + + if( isset( $_GET['action'] ) ) { + switch( $_GET['action'] ) { + case 'subsiteregister': + /* + * @todo check_admin_referer( 'jetpack-subsite-register' ); + */ + Jetpack::log( 'subsiteregister' ); + + // If !$_GET['site_id'] stop registration and error + if( !isset( $_GET['site_id'] ) || empty( $_GET['site_id'] ) ) { + // Log error to state cookie for display later + /** + * @todo Make state messages show on Jetpack NA pages + **/ + Jetpack::state( 'missing_site_id', 'Site ID must be provided to register a sub-site' ); + break; + } + + // Send data to register endpoint and retrieve shadow blog details + $result = $this->do_subsiteregister(); + $url = $this->get_url( 'network_admin_page' ); + if( is_wp_error( $result ) ) { + $url = add_query_arg( 'action', 'connection_failed', $url ); + } else { + $url = add_query_arg( 'action', 'connected', $url ); + } + + wp_safe_redirect( $url ); + break; + case 'subsitedisconnect': + Jetpack::log( 'subsitedisconnect' ); + + if( !isset( $_GET['site_id'] ) || empty( $_GET['site_id'] ) ) { + Jetpack::state( 'missing_site_id', 'Site ID must be provided to disconnect a sub-site' ); + break; + } + + $this->do_subsitedisconnect(); + break; + case 'connected': + case 'connection_failed': + add_action( 'jetpack_notices', array( $this, 'show_jetpack_notice' ) ); + break; + } + } + } + + public function show_jetpack_notice() { + + if( isset( $_GET['action'] ) && 'connected' == $_GET['action'] ) { + $notice = 'Blog successfully connected'; + } else if( isset( $_GET['action'] ) && 'connection_failed' == $_GET['action'] ) { + $notice = 'Blog connection failed'; + } + + require_once( 'views/admin/network-admin-alert.php' ); + } + + /** + * Disconnect functionality for an individual site + * + * @since 2.5 + * @see Jetpack_Network::jetpack_sites_list() + */ + public function do_subsitedisconnect( $site_id = null ) { + $site_id = ( is_null( $site_id ) ) ? $_GET['site_id']: $site_id; + switch_to_blog( $site_id ); + Jetpack::disconnect(); + restore_current_blog(); + } + + /** + * Registers a subsite with the Jetpack servers + * + * @since 2.5 + * @todo Break apart into easier to manage chunks that can be unit tested + * @see Jetpack_Network::jetpack_sites_list(); + */ + public function do_subsiteregister( $site_id = null ) { + $jp = Jetpack::init(); + + // Figure out what site we are working on + $site_id = ( is_null( $site_id ) ) ? $_GET['site_id']: $site_id; + + // Build secrets to sent to wpcom for verification + $secrets = $jp->generate_secrets(); + + // Remote query timeout limit + $timeout = $jp->get_remote_query_timeout_limit(); + + // Get proof the wpcom server can trust you adding this site + $network_admin_token = ''; + + // The blog id on WordPress.com of the primary network site + $network_wpcom_blog_id = Jetpack_Options::get_option( 'id' ); + + /* + * Here we need to switch to the subsite + * For the registration process we really only hijack how it + * works for an idividual site and pass in some extra data here + */ + switch_to_blog( $site_id ); + + // Soooooo..... This does not work. Jetpack thinks it is already active.... + // Make sure site is not already registered + //if( Jetpack::is_active() ) + // return + + // Save the secrets in the subsite so when the wpcom server does a pingback it + // will be able to validate the connection + Jetpack_Options::update_option( 'register', + $secrets[0] . ':' .$secrets[1]. ':' . $secrets[2] + ); + + // Gra info for gmt offset + $gmt_offset = get_option( 'gmt_offset' ); + if ( ! $gmt_offset ) { + $gmt_offset = 0; + } + + /* + * Get the stats_option option from the db. + * It looks like the server strips this out so maybe it is not necessary? + * Does it match the Jetpack site with the old stats plugin id? + * + * @todo Find out if sending the stats_id is necessary + */ + $stat_options = get_option( 'stats_options' ); + $stat_id = $stat_options = isset($stats_options['blog_id']) ? $stats_options['blog_id'] : null; + $args = array( + 'method' => 'POST', + 'body' => array( + 'network_url' => $this->get_url( 'network_admin_page' ), + 'network_wpcom_blog_id' => $network_wpcom_blog_id, + 'siteurl' => site_url(), + 'home' => home_url(), + 'gmt_offset' => $gmt_offset, + 'timezone_string' => (string) get_option( 'timezone_string' ), + 'site_name' => (string) get_option( 'blogname' ), + 'secret_1' => $secrets[0], + 'secret_2' => $secrets[1], + 'site_lang' => get_locale(), + 'timeout' => $timeout, + 'stats_id' => $stat_id, // Is this still required? + 'user_id' => get_current_user_id(), + ), + 'headers' => array( + 'Accept' => 'application/json', + ), + 'timeout' => $timeout, + ); + + // Attempt to retrieve shadow blog details + $response = Jetpack_Client::_wp_remote_request( + Jetpack::fix_url_for_bad_hosts( Jetpack::api_url( 'subsiteregister' ) ), $args, true + ); + + /* + * $response should either be invalid or contain: + * - jetpack_id => id + * - jetpack_secret => blog_token + * - jetpack_public + * + * Store the wpcom site details + */ + $valid_response = $jp->validate_remote_register_response( $response ); + + if( is_wp_error( $valid_response ) || !$valid_response ) { + return $valid_response; + } + + // Grab the response values to work with + $code = wp_remote_retrieve_response_code( $response ); + $entity = wp_remote_retrieve_body( $response ); + if ( $entity ) + $json = json_decode( $entity ); + else + $json = false; + + if ( empty( $json->jetpack_secret ) || ! is_string( $json->jetpack_secret ) ) + return new Jetpack_Error( 'jetpack_secret', '', $code ); + + if ( isset( $json->jetpack_public ) ) { + $jetpack_public = (int) $json->jetpack_public; + } else { + $jetpack_public = false; + } + + Jetpack_Options::update_options( + array( + 'id' => (int) $json->jetpack_id, + 'blog_token' => (string) $json->jetpack_secret, + 'public' => $jetpack_public, + ) + ); + + /* + * Update the subsiteregister method on wpcom so that it also sends back the + * token in this same request + */ + $is_master_user = ! Jetpack::is_active(); + Jetpack::update_user_token( + get_current_user_id(), + sprintf( + '%s.%d', + $json->token->secret, + get_current_user_id() + ), + $is_master_user + ); + + Jetpack::activate_default_modules(); + + restore_current_blog(); + } + + /** + * Add css styles needed for the Network Admin area + **/ + function network_admin_styles() { + global $wp_styles; + wp_enqueue_style( 'jetpack', plugins_url( '_inc/jetpack.css', __FILE__ ), false, JETPACK__VERSION . '-20121016' ); + $wp_styles->add_data( 'jetpack', 'rtl', true ); + } + + /** + * Handles the displaying of all sites on the network that are + * dis/connected to Jetpack + * + * @since 2.5 + * @see Jetpack_Network::jetpack_sites_list() + */ + function network_admin_page() { + $this->network_admin_page_header(); + + $jp = Jetpack::init(); + + // We should be, but ensure we are on the main blog + switch_to_blog(1); + $main_active = $jp->is_active(); + restore_current_blog(); + + /* + * Ensure the main blog is connected as all other subsite blog + * connections will feed off this one + */ + if( !$main_active ) { + $url = $this->get_url( array( + 'name' => 'subsiteregister', + 'site_id' => 1, + ) ); + $url = $jp->build_connect_url(); + require_once( 'views/admin/must-connect-main-blog.php' ); + return; + } + + require_once( 'class.jetpack-network-sites-list-table.php' ); + $myListTable = new Jetpack_Network_Sites_List_Table(); + echo '

    ' . __('Sites', 'jetpack') . '

    '; + echo '
    '; + $myListTable->prepare_items(); + $myListTable->display(); + echo '
    '; + + $this->network_admin_page_footer(); + } + + /** + * Stylized JP header formatting + * + * @since 2.6 + */ + function network_admin_page_header() { + global $current_user; + + $is_connected = Jetpack::is_active(); + $user_token = Jetpack_Data::get_access_token( $current_user->ID ); + $is_user_connected = $user_token && ! is_wp_error( $user_token ); + $is_master_user = $current_user->ID == Jetpack_Options::get_option( 'master_user' ); + + require_once( 'views/admin/network-admin-header.php' ); + } + + /** + * Stylized JP footer formatting + * + * @since 2.6 + */ + function network_admin_page_footer() { + require_once( 'views/admin/network-admin-footer.php' ); + } + + /** + * Fires when the Jetpack > Settings page is saved. + * + * @since 2.5 + */ + public function save_network_settings_page() { + + /* + * Fields + * + * auto-connect - Checkbox for global Jetpack connection + * sub-site-connection-override - Allow sub-site admins to (dis)reconnect with their own Jetpack account + */ + $auto_connect = 0; + if( isset( $_POST['auto-connect'] ) ) + $auto_connect = 1; + + + $sub_site_connection_override = 0; + if( isset( $_POST['sub-site-connection-override'] ) ) + $sub_site_connection_override = 1; + + $manage_auto_activated_modules = 0; + if( isset( $_POST['manage_auto_activated_modules'] ) ) + $manage_auto_activated_modules = 1; + + $modules = array(); + if( isset( $_POST['modules'] ) ) + $modules = $_POST['modules']; + + $data = array( + 'auto-connect' => $auto_connect, + 'sub-site-connection-override' => $sub_site_connection_override, + 'manage_auto_activated_modules' => $manage_auto_activated_modules, + 'modules' => $modules, + ); + + update_site_option( $this->settings_name, $data ); + wp_redirect(add_query_arg(array('page' => 'jetpack-settings', 'updated' => 'true'), network_admin_url('admin.php'))); + exit(); + } + + public function render_network_admin_settings_page() { + $this->network_admin_page_header(); + $options = wp_parse_args( get_site_option( $this->settings_name ), $this->setting_defaults ); + + $modules = array(); + $module_slugs = Jetpack::get_available_modules(); + foreach ( $module_slugs as $slug ) { + $module = Jetpack::get_module( $slug ); + $module['module'] = $slug; + $modules[] = $module; + } + + usort( $modules, array( 'Jetpack', 'sort_modules' ) ); + + if( !isset( $options['modules'] ) ) { + $options['modules'] = $modules; + } + + require( 'views/admin/network-settings.php' ); + $this->network_admin_page_footer(); + } + + /** + * Updates a site wide option + * + * @since 2.5 + * @param string $key + * @param mixed $value + * @return boolean + **/ + public function update_option( $key, $value ) { + $options = get_site_option( $this->settings_name ); + $options[$key] = $value; + return update_site_option( $this->settings_name, $options ); + } + + /** + * Retrieves a site wide option + * + * @since 2.5 + * @param string $name - Name of the option in the database + **/ + public function get_option( $name ) { + $options = get_site_option( $this->settings_name ); + if( !isset( $options[$name] ) ) + $options[$name] = null; + + return $options[$name]; + } + + /** + * Return an array of sites on the specified network. If no network is specified, + * return all sites, regardless of network. + * + * + * @todo REMOVE THIS FUNCTION! This function is moving to core. Use that one in favor of this. WordPress::wp_get_sites(). http://codex.wordpress.org/Function_Reference/wp_get_sites NOTE, This returns an array instead of stdClass. Be sure to update class.network-sites-list-table.php + * @since 2.4.5 + * @deprecated 2.4.5 + * @param array|string $args Optional. Specify the status of the sites to return. + * @return array An array of site data + */ + public function wp_get_sites($args = array()) { + global $wpdb; + + if (wp_is_large_network()) + return; + + $defaults = array('network_id' => $wpdb->siteid); + + $args = wp_parse_args($args, $defaults); + + $query = "SELECT * FROM $wpdb->blogs WHERE 1=1 "; + + if (isset($args['network_id']) && ( is_array($args['network_id']) || is_numeric($args['network_id']) )) { + $network_ids = array_map('intval', (array) $args['network_id']); + $network_ids = implode(',', $network_ids); + $query .= "AND site_id IN ($network_ids) "; + } + + if (isset($args['public'])) + $query .= $wpdb->prepare("AND public = %s ", $args['public']); + + if (isset($args['archived'])) + $query .= $wpdb->prepare("AND archived = %s ", $args['archived']); + + if (isset($args['mature'])) + $query .= $wpdb->prepare("AND mature = %s ", $args['mature']); + + if (isset($args['spam'])) + $query .= $wpdb->prepare("AND spam = %s ", $args['spam']); + + if (isset($args['deleted'])) + $query .= $wpdb->prepare("AND deleted = %s ", $args['deleted']); + + $key = 'wp_get_sites:' . md5($query); + + if (!$site_results = wp_cache_get($key, 'site-id-cache')) { + $site_results = (array) $wpdb->get_results($query); + wp_cache_set($key, $site_results, 'site-id-cache'); + } + + return $site_results; + } +} + +// end class diff --git a/class.jetpack-options.php b/class.jetpack-options.php index 9ca2fe62517e6..f563d60bf459e 100644 --- a/class.jetpack-options.php +++ b/class.jetpack-options.php @@ -13,8 +13,10 @@ public static function get_option_names( $type = 'compact' ) { 'do_activate', 'log', 'publicize', + 'slideshow_background_color', 'widget_twitter', 'wpcc_options', + 'relatedposts', ); } @@ -36,6 +38,7 @@ public static function get_option_names( $type = 'compact' ) { 'identity_crisis_whitelist', // (array) An array of options, each having an array of the values whitelisted for it. 'gplus_authors', // (array) The Google+ authorship information for connected users. 'last_heartbeat', // (int) The timestamp of the last heartbeat that fired. + 'sync_bulk_reindexing', // (bool) If a bulk reindex is currently underway. ); } diff --git a/class.jetpack-post-images.php b/class.jetpack-post-images.php index 5829fcc611690..6586c430b7a0c 100644 --- a/class.jetpack-post-images.php +++ b/class.jetpack-post-images.php @@ -272,7 +272,7 @@ static function from_html( $html_or_id ) { if ( !$html ) return $images; - preg_match_all( '!!iUs', $html, $matches ); + preg_match_all( '!!iUs', $html, $matches ); if ( !empty( $matches[1] ) ) { foreach ( $matches[1] as $match ) { if ( stristr( $match, '/smilies/' ) ) @@ -449,4 +449,35 @@ static function get_images( $post_id, $args = array() ) { return apply_filters( 'jetpack_images_get_images', $media, $post_id, $args ); } + + /** + * Takes an image URL and a pixel dimensions and returns a URL for the + * squared up image if possible. + * + * @param string $src + * @param int $dimension + * @return string Transformed image URL + */ + static function square_image_url( $src, $dimension ) { + $dimension = (int) $dimension; + + // Umm... + if ( $dimension < 1 ) { + return $src; + } + + // If WPCOM hosted image use native transformations + $img_host = parse_url( $src, PHP_URL_HOST ); + if ( '.files.wordpress.com' == substr( $img_host, -20 ) ) { + return add_query_arg( array( 'w' => $dimension, 'h' => $dimension, 'crop' => 1 ), $src ); + } + + // Use Photon magic + if( function_exists( 'jetpack_photon_url' ) ) { + return jetpack_photon_url( $src, array( 'resize' => "$dimension,$dimension" ) ); + } + + // Arg... no way to resize image using WordPress.com infrastructure! + return $src; + } } diff --git a/class.jetpack-sync.php b/class.jetpack-sync.php index 9dce69cebfdf2..c3f30afca3dcc 100644 --- a/class.jetpack-sync.php +++ b/class.jetpack-sync.php @@ -32,6 +32,7 @@ function __construct() { * post_stati => array( post_status slugs ): The post stati to sync. Default: publish */ static function sync_posts( $file, array $settings = null ) { + if( is_network_admin() ) return; $jetpack = Jetpack::init(); $args = func_get_args(); return call_user_func_array( array( $jetpack->sync, 'posts' ), $args ); @@ -46,6 +47,7 @@ static function sync_posts( $file, array $settings = null ) { * comment_stati => array( comment_status slugs ): The comment stati to sync. Default: approved */ static function sync_comments( $file, array $settings = null ) { + if( is_network_admin() ) return; $jetpack = Jetpack::init(); $args = func_get_args(); return call_user_func_array( array( $jetpack->sync, 'comments' ), $args ); @@ -57,6 +59,7 @@ static function sync_comments( $file, array $settings = null ) { * @param string $option ... */ static function sync_options( $file, $option /*, $option, ... */ ) { + if( is_network_admin() ) return; $jetpack = Jetpack::init(); $args = func_get_args(); return call_user_func_array( array( $jetpack->sync, 'options' ), $args ); @@ -74,7 +77,9 @@ static function sync_options( $file, $option /*, $option, ... */ ) { function register( $object, $id = false, array $settings = null ) { // Since we've registered something for sync, hook it up to execute on shutdown if we haven't already if ( !$this->sync ) { - ignore_user_abort( true ); + if ( function_exists( 'ignore_user_abort' ) ) { + ignore_user_abort( true ); + } add_action( 'shutdown', array( $this, 'sync' ), 9 ); // Right before async XML-RPC } @@ -467,6 +472,7 @@ function get_post( $id ) { $post['permalink'] = get_permalink( $post_obj->ID ); $post['shortlink'] = wp_get_shortlink( $post_obj->ID ); + $post['module_custom_data'] = apply_filters( 'jetpack_sync_post_module_custom_data', array(), $post_obj ); return $post; } @@ -710,4 +716,88 @@ function sync_all_registered_options( $options = array() ) { wp_schedule_single_event( time(), 'jetpack_sync_all_registered_options', array( $this->sync_options ) ); } } + + public function reindex_trigger() { + $response = array( 'status' => 'ERROR' ); + + Jetpack::load_xml_rpc_client(); + $client = new Jetpack_IXR_Client( array( + 'user_id' => JETPACK_MASTER_USER, + ) ); + + $client->query( 'jetpack.reindexTrigger' ); + + if ( !$client->isError() ) { + $response = $client->getResponse(); + Jetpack_Options::update_option( 'sync_bulk_reindexing', true ); + } + + return $response; + } + + public function reindex_status() { + $response = array( 'status' => 'ERROR' ); + + // Assume reindexing is done if it was not triggered in the first place + if ( false === Jetpack_Options::get_option( 'sync_bulk_reindexing' ) ) { + return array( 'status' => 'DONE' ); + } + + Jetpack::load_xml_rpc_client(); + $client = new Jetpack_IXR_Client( array( + 'user_id' => JETPACK_MASTER_USER, + ) ); + + $client->query( 'jetpack.reindexStatus' ); + + if ( !$client->isError() ) { + $response = $client->getResponse(); + if ( 'DONE' == $response['status'] ) { + Jetpack_Options::delete_option( 'sync_bulk_reindexing' ); + } + } + + return $response; + } + + public function reindex_ui() { + $strings = json_encode( array( + 'WAITING' => array( + 'action' => __( 'Refresh Status', 'jetpack' ), + 'status' => __( 'Indexing posts…', 'jetpack' ), + ), + 'INDEXING' => array( + 'action' => __( 'Refresh Status', 'jetpack' ), + 'status' => __( 'Indexing posts', 'jetpack' ), + ), + 'DONE' => array( + 'action' => __( 'Reindex Posts', 'jetpack' ), + 'status' => __( 'Posts indexed.', 'jetpack' ), + ), + 'ERROR' => array( + 'action' => __( 'Refresh Status', 'jetpack' ), + 'status' => __( 'Status unknown.', 'jetpack' ), + ), + ) ); + + wp_enqueue_script( + 'jetpack_sync_reindex_control', + plugins_url( '_inc/jquery.jetpack-sync.js', __FILE__ ), + array( 'jquery' ), + JETPACK__VERSION + ); + + $template = << + + +

    +EOT; + + return sprintf( + $template, + esc_attr( $strings ), + esc_attr__( 'Refresh Status', 'jetpack' ) + ); + } } diff --git a/class.jetpack-xmlrpc-server.php b/class.jetpack-xmlrpc-server.php index e539b25f5c179..3f26945e1ad44 100644 --- a/class.jetpack-xmlrpc-server.php +++ b/class.jetpack-xmlrpc-server.php @@ -108,6 +108,7 @@ function verify_action( $params ) { * @return WP_User|IXR_Error */ function login() { + Jetpack::init()->require_jetpack_authentication(); $user = wp_authenticate( 'username', 'password' ); if ( is_wp_error( $user ) ) { if ( 'authentication_failed' == $user->get_error_code() ) { // Generic error could mean most anything. diff --git a/class.jetpack.php b/class.jetpack.php index 27fe58ef81b11..f5811e2770ca0 100644 --- a/class.jetpack.php +++ b/class.jetpack.php @@ -219,6 +219,23 @@ function plugin_upgrade() { * Constructor. Initializes WordPress hooks */ private function Jetpack() { + + /* + * Load things that should only be in Network Admin. + * + * For now blow away everything else until a more full + * understanding of what is needed at the network level is + * available + */ + if( is_multisite() ) { + $jpms = Jetpack_Network::init(); + + if( is_network_admin() ) + return; // End here to prevent single site actions from firing + } + + + $this->sync = new Jetpack_Sync; // Modules should do Jetpack_Sync::sync_options( __FILE__, $option, ... ); instead @@ -282,6 +299,9 @@ private function Jetpack() { add_action( 'wp_ajax_jetpack-check-news-subscription', array( $this, 'check_news_subscription' ) ); add_action( 'wp_ajax_jetpack-subscribe-to-news', array( $this, 'subscribe_to_news' ) ); + add_action( 'wp_ajax_jetpack-sync-reindex-trigger', array( $this, 'sync_reindex_trigger' ) ); + add_action( 'wp_ajax_jetpack-sync-reindex-status', array( $this, 'sync_reindex_status' ) ); + add_action( 'wp_loaded', array( $this, 'register_assets' ) ); add_action( 'wp_enqueue_scripts', array( $this, 'devicepx' ) ); add_action( 'customize_controls_enqueue_scripts', array( $this, 'devicepx' ) ); @@ -299,7 +319,7 @@ private function Jetpack() { * These actions run checks to load additional files. * They check for external files or plugins, so they need to run as late as possible. */ - add_action( 'plugins_loaded', array( $this, 'check_open_graph' ), 999 ); + add_action( 'wp_head', array( $this, 'check_open_graph' ), 1 ); add_action( 'plugins_loaded', array( $this, 'check_twitter_tags' ), 999 ); add_action( 'plugins_loaded', array( $this, 'check_rest_api_compat' ), 1000 ); @@ -333,6 +353,13 @@ function require_jetpack_authentication() { $_COOKIE = array(); remove_all_filters( 'authenticate' ); + /** + * For the moment, remove Limit Login Attempts if its xmlrpc for Jetpack. + * If Limit Login Attempts is installed as a mu-plugin, it can occasionally + * generate false-positives. + */ + remove_filter( 'wp_login_failed', 'limit_login_failed' ); + if ( Jetpack::is_active() ) { // Allow Jetpack authentication add_filter( 'authenticate', array( $this, 'authenticate_jetpack' ), 10, 3 ); @@ -390,7 +417,7 @@ function devicepx() { * @filter require_lib_dir */ function require_lib_dir( $lib_dir ) { - return JETPACK__PLUGIN_DIR . 'lib'; + return JETPACK__PLUGIN_DIR . '_inc/lib'; } /** @@ -427,6 +454,21 @@ public static function is_user_connected( $user_id = false ) { } return (bool) Jetpack_Data::get_access_token( $user_id ); } + + /** + * Get the wpcom email of the current connected user. + */ + public static function get_connected_user_email() { + Jetpack::load_xml_rpc_client(); + $xml = new Jetpack_IXR_Client( array( + 'user_id' => get_current_user_id() + ) ); + $xml->query( 'wpcom.getUserEmail' ); + if ( ! $xml->isError() ) { + return $xml->getResponse(); + } + return false; + } function current_user_is_connection_owner() { $user_token = Jetpack_Data::get_access_token( JETPACK_MASTER_USER ); @@ -551,7 +593,8 @@ public static function load_modules() { do_action( 'jetpack_modules_loaded' ); // Load module-specific code that is needed even when a module isn't active. Loaded here because code contained therein may need actions such as setup_theme. - require_once( JETPACK__PLUGIN_DIR . 'modules/module-extras.php' ); + if ( Jetpack::is_active() || Jetpack::is_development_mode() ) + require_once( JETPACK__PLUGIN_DIR . 'modules/module-extras.php' ); } /** @@ -623,6 +666,9 @@ public function check_open_graph() { 'easy-facebook-share-thumbnails/esft.php', // Easy Facebook Share Thumbnail '2-click-socialmedia-buttons/2-click-socialmedia-buttons.php', // 2 Click Social Media Buttons 'facebook-thumb-fixer/_facebook-thumb-fixer.php', // Facebook Thumb Fixer + 'zoltonorg-social-plugin/zosp.php', // Zolton.org Social Plugin + 'wp-caregiver/wp-caregiver.php', // WP Caregiver + 'facebook-revised-open-graph-meta-tag/index.php', // Facebook Revised Open Graph Meta Tag ); foreach ( $conflicting_plugins as $plugin ) { @@ -1421,9 +1467,13 @@ public static function plugin_initialize() { * @static */ public static function plugin_deactivation( ) { + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); + if( is_plugin_active_for_network( 'jetpack/jetpack.php' ) ) { + Jetpack_Network::init()->deactivate(); + } else { Jetpack::disconnect( false ); - - Jetpack_Heartbeat::init()->deactivate(); + //Jetpack_Heartbeat::init()->deactivate(); + } } /** @@ -1454,6 +1504,9 @@ public static function disconnect( $update_activated_state = true ) { if ( $update_activated_state ) { Jetpack_Options::update_option( 'activated', 4 ); } + + // Disable the Heartbeat cron + Jetpack_Heartbeat::init()->deactivate(); } /** @@ -2721,6 +2774,47 @@ function sign_role( $role ) { function build_connect_url( $raw = false, $redirect = false ) { if ( ! Jetpack_Options::get_option( 'blog_token' ) ) { $url = $this->nonce_url_no_esc( $this->admin_url( 'action=register' ), 'jetpack-register' ); + if( is_network_admin() ) { + $url = add_query_arg( 'is_multisite', network_admin_url( + 'admin.php?page=jetpack-settings' ), $url ); + } + } else if( is_network_admin() ) { +/*********** +This does not actually work. +Need to add a $_GET var to the above if is_network_admin() +Then in check below (not this one) add the is_network=network_admin +************/ + $role = $this->translate_current_user_to_role(); + $signed_role = $this->sign_role( $role ); + + $user = wp_get_current_user(); + + $redirect = $redirect ? esc_url_raw( $redirect ) : ''; + + $args = urlencode_deep( + array( + 'response_type' => 'code', + 'client_id' => Jetpack_Options::get_option( 'id' ), + 'redirect_uri' => add_query_arg( + array( + 'action' => 'authorize', + '_wpnonce' => wp_create_nonce( "jetpack-authorize_{$role}_{$redirect}" ), + 'redirect' => $redirect ? urlencode( $redirect ) : false, + ), + menu_page_url( 'jetpack', false ) + ), + 'state' => $user->ID, + 'scope' => $signed_role, + 'user_email' => $user->user_email, + 'user_login' => $user->user_login, + 'is_active' => Jetpack::is_active(), + 'is_network' => 1, + ) + ); + + $url = add_query_arg( $args, Jetpack::api_url( 'authorize' ) ); + + } else { $role = $this->translate_current_user_to_role(); $signed_role = $this->sign_role( $role ); @@ -2789,12 +2883,22 @@ function admin_page() { $user_token = Jetpack_Data::get_access_token( $current_user->ID ); $is_user_connected = $user_token && ! is_wp_error( $user_token ); $is_master_user = $current_user->ID == Jetpack_Options::get_option( 'master_user' ); + + $can_reconnect_jpms = true; + if( is_plugin_active_for_network( 'jetpack/jetpack.php' ) ) { + $jpms = Jetpack_Network::init(); + $can_reconnect_jpms = ( $jpms->get_option( 'sub-site-connection-override' ) )? 1: 0; + } + + + + ?>
    class="small">
    - +
    Jetpack_Options::get_option( 'id' ), + 'post_id' => get_the_ID(), + ) ); + } else { + wp_send_json_error( array( + 'message' => 'Not Singular', + ) ); + } + } +} diff --git a/modules/gplus-authorship.php b/modules/gplus-authorship.php index 4281a2bb6475f..039e7ba5d1575 100644 --- a/modules/gplus-authorship.php +++ b/modules/gplus-authorship.php @@ -89,7 +89,7 @@ function save_profile_data() { if ( !is_numeric( $_POST['id'] ) ) return; $connections = get_option( 'gplus_authors', array() ); - $connections[ $current_user->ID ]['name'] = $_POST['name']; + $connections[ $current_user->ID ]['name'] = stripslashes( $_POST['name'] ); $connections[ $current_user->ID ]['id'] = $_POST['id']; $connections[ $current_user->ID ]['url'] = esc_url_raw( $_POST['url'] ); $connections[ $current_user->ID ]['profile_image'] = esc_url_raw( $_POST['profile_image'] ); diff --git a/modules/infinite-scroll/infinity.js b/modules/infinite-scroll/infinity.js index d893a62d504ef..35a27cbd7c79a 100644 --- a/modules/infinite-scroll/infinity.js +++ b/modules/infinite-scroll/infinity.js @@ -26,6 +26,7 @@ Scroller = function( settings ) { this.disabled = false; this.page = 1; this.offset = settings.offset; + this.currentday = settings.currentday; this.order = settings.order; this.throttle = false; this.handle = '
    ' + text.replace( '\\', '' ) + '
    '; @@ -108,6 +109,7 @@ Scroller.prototype.render = function( response ) { Scroller.prototype.query = function() { return { page : this.page, + currentday : this.currentday, order : this.order, scripts : window.infiniteScroll.settings.scripts, styles : window.infiniteScroll.settings.styles, @@ -285,6 +287,10 @@ Scroller.prototype.refresh = function() { if ( type == 'click' && !response.lastbatch ) self.element.append( self.handle ); + // Update currentday to the latest value returned from the server + if (response.currentday) + self.currentday = response.currentday; + // Fire Google Analytics pageview if ( self.google_analytics && 'object' == typeof _gaq ) _gaq.push(['_trackPageview', self.history.path.replace( /%d/, self.page ) ]); diff --git a/modules/infinite-scroll/infinity.php b/modules/infinite-scroll/infinity.php index 2e3fa2a6686f9..8e7438e4036e8 100644 --- a/modules/infinite-scroll/infinity.php +++ b/modules/infinite-scroll/infinity.php @@ -514,6 +514,7 @@ function action_wp_head() { */ function action_wp_footer_settings() { global $wp_rewrite; + global $currentday; // Base JS settings $js_settings = array( @@ -525,6 +526,7 @@ function action_wp_footer_settings() { 'footer' => is_string( self::get_settings()->footer ) ? esc_js( self::get_settings()->footer ) : self::get_settings()->footer, 'text' => esc_js( __( 'Older posts', 'jetpack' ) ), 'totop' => esc_js( __( 'Scroll back to top', 'jetpack' ) ), + 'currentday' => $currentday, 'order' => 'DESC', 'scripts' => array(), 'styles' => array(), @@ -815,6 +817,12 @@ function query() { $page = (int) $_GET['page']; + // Sanitize and set $previousday. Expected format: dd.mm.yy + if ( preg_match( '/^\d{2}\.\d{2}\.\d{2}$/', $_GET['currentday'] ) ) { + global $previousday; + $previousday = $_GET['currentday']; + } + $sticky = get_option( 'sticky_posts' ); $post__not_in = self::wp_query()->get( 'post__not_in' ); if ( ! empty( $post__not_in ) ) @@ -892,7 +900,9 @@ function query() { ob_end_clean(); if ( 'success' == $results['type'] ) { + global $currentday; $results['lastbatch'] = self::is_last_batch(); + $results['currentday'] = $currentday; } // Loop through posts to capture sharing data for new posts loaded via Infinite Scroll @@ -1116,4 +1126,4 @@ function the_neverending_home_page_theme_support() { */ if ( The_Neverending_Home_Page::got_infinity() ) { show_admin_bar( false ); -} \ No newline at end of file +} diff --git a/modules/likes.php b/modules/likes.php index 34cd27fa91a2b..f9a645560ff9c 100644 --- a/modules/likes.php +++ b/modules/likes.php @@ -9,7 +9,7 @@ * Module Tags: Social */ class Jetpack_Likes { - var $version = '20131201'; + var $version = '20140110'; public static function init() { static $instance = NULL; @@ -71,6 +71,7 @@ function __construct() { add_action( 'admin_bar_menu', array( $this, 'admin_bar_likes' ), 60 ); add_action( 'save_post', array( $this, 'meta_box_save' ) ); + add_action( 'edit_attachment', array( $this, 'meta_box_save' ) ); add_action( 'sharing_global_options', array( $this, 'admin_settings_init' ), 20 ); add_action( 'sharing_admin_update', array( $this, 'admin_settings_callback' ), 20 ); } @@ -133,7 +134,7 @@ function meta_box_save( $post_id ) { // Record sharing disable. Only needs to be done for WPCOM if ( ! $this->in_jetpack ) { - if ( isset( $_POST['post_type'] ) && ( 'post' == $_POST['post_type'] || 'page' == $_POST['post_type'] ) ) { + if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], get_post_types( array( 'public' => true ) ) ) ) { if ( isset( $_POST['wpl_sharing_status_hidden'] ) && !isset( $_POST['wpl_enable_post_sharing'] ) ) { update_post_meta( $post_id, 'sharing_disabled', 1 ); } else { @@ -694,7 +695,7 @@ function admin_bar_likes() { } add_filter( 'wp_footer', array( $this, 'likes_master' ) ); - + $src = sprintf( '%1$s://widgets.wp.com/likes/#blog_id=%2$d&post_id=%3$d&origin=%1$s://%4$s', $protocol, $blog_id, $post->ID, $domain ); $html = ""; @@ -802,7 +803,8 @@ function JetpackLikesMessageListener( event ) { JetpackLikespostMessage( { event: 'adminBarEnabled' }, window.frames[ 'likes-master' ] ); stylesData.adminBarStyles = { - background: jQuery( '#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a' ).css( 'background' ) + background: jQuery( '#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a' ).css( 'background' ), + isRtl: ( 'rtl' == jQuery( '#wpadminbar' ).css( 'direction' ) ) }; } diff --git a/modules/markdown.php b/modules/markdown.php new file mode 100644 index 0000000000000..f051956c87672 --- /dev/null +++ b/modules/markdown.php @@ -0,0 +1,25 @@ + .footnotes, +.entrytext > .footnotes, +.hentry .footnotes > ol { + margin-top: 4em; +} + +.entry-content > .footnotes > hr, +.entrytext > .footnotes > hr, +.hentry .footnotes > hr { + margin-right: 50%; +} + +.entry-content > .footnotes > ol, +.hentry .footnotes > ol { + font-size: 87.5%; +} \ No newline at end of file diff --git a/modules/markdown/easy-markdown.php b/modules/markdown/easy-markdown.php new file mode 100644 index 0000000000000..12f3dae39d501 --- /dev/null +++ b/modules/markdown/easy-markdown.php @@ -0,0 +1,693 @@ + array(), 'parent' => array() ); + + + /** + * Yay singletons! + * @return object WPCom_Markdown instance + */ + public static function get_instance() { + if ( ! self::$instance ) + self::$instance = new self(); + return self::$instance; + } + + /** + * Kicks things off on `init` action + * @return null + */ + public function load() { + $this->add_default_post_type_support(); + $this->maybe_load_actions_and_filters(); + add_action( 'switch_blog', array( $this, 'maybe_load_actions_and_filters' ) ); + add_action( 'admin_init', array( $this, 'register_setting' ) ); + if ( current_theme_supports( 'o2' ) || class_exists( 'P2' ) ) { + $this->add_o2_helpers(); + } + } + + /** + * Called on init and fires on blog_switch to decide if our actions and filters + * should be running. + * @return null + */ + public function maybe_load_actions_and_filters() { + if ( $this->is_posting_enabled() ) + $this->load_markdown_for_posts(); + else + $this->unload_markdown_for_posts(); + + if ( $this->is_commenting_enabled() ) + $this->load_markdown_for_comments(); + else + $this->unload_markdown_for_comments(); + } + + /** + * Set up hooks for enabling Markdown conversion on posts + * @return null + */ + public function load_markdown_for_posts() { + add_action( 'wp_insert_post', array( $this, 'wp_insert_post' ) ); + add_filter( 'wp_insert_post_data', array( $this, 'wp_insert_post_data' ), 10, 2 ); + add_filter( 'edit_post_content', array( $this, 'edit_post_content' ), 10, 2 ); + add_filter( 'edit_post_content_filtered', array( $this, 'edit_post_content_filtered' ), 10, 2 ); + add_action( 'wp_restore_post_revision', array( $this, 'wp_restore_post_revision' ), 10, 2 ); + add_filter( '_wp_post_revision_fields', array( $this, '_wp_post_revision_fields' ) ); + add_action( 'xmlrpc_call', array( $this, 'xmlrpc_actions' ) ); + add_filter( 'content_save_pre', array( $this, 'preserve_code_blocks' ), 1 ); + if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { + $this->check_for_mwgetpost(); + } + } + + /** + * Removes hooks to disable Markdown conversion on posts + * @return null + */ + public function unload_markdown_for_posts() { + remove_action( 'wp_insert_post', array( $this, 'wp_insert_post' ) ); + remove_filter( 'wp_insert_post_data', array( $this, 'wp_insert_post_data' ), 10, 2 ); + remove_filter( 'edit_post_content', array( $this, 'edit_post_content' ), 10, 2 ); + remove_filter( 'edit_post_content_filtered', array( $this, 'edit_post_content_filtered' ), 10, 2 ); + remove_action( 'wp_restore_post_revision', array( $this, 'wp_restore_post_revision' ), 10, 2 ); + remove_filter( '_wp_post_revision_fields', array( $this, '_wp_post_revision_fields' ) ); + remove_action( 'xmlrpc_call', array( $this, 'xmlrpc_actions' ) ); + remove_filter( 'content_save_pre', array( $this, 'preserve_code_blocks' ), 1 ); + } + + /** + * Set up hooks for enabling Markdown conversion on comments + * @return null + */ + protected function load_markdown_for_comments() { + add_filter( 'preprocess_comment', array( $this, 'preprocess_comment' ) ); + add_filter( 'comment_save_pre', array( $this, 'comment_save_pre' ) ); + } + + /** + * Removes hooks to disable Markdown conversion + * @return null + */ + protected function unload_markdown_for_comments() { + remove_filter( 'preprocess_comment', array( $this, 'preprocess_comment' ) ); + remove_filter( 'comment_save_pre', array( $this, 'comment_save_pre' ) ); + } + + /** + * o2 does some of what we do. Let's take precedence. + * @return null + */ + public function add_o2_helpers() { + if ( $this->is_posting_enabled() ) { + add_filter( 'content_save_pre', array( $this, 'o2_escape_lists' ), 1 ); + } + + add_filter( 'o2_preview_post', array( $this, 'o2_preview_post' ) ); + add_filter( 'o2_preview_comment', array( $this, 'o2_preview_comment' ) ); + + add_filter( 'wpcom_markdown_transform_pre', array( $this, 'o2_unescape_lists' ) ); + add_filter( 'wpcom_untransformed_content', array( $this, 'o2_unescape_lists' ) ); + } + + /** + * If Markdown is enabled for posts on this blog, filter the text for o2 previews + * @param string $text Post text + * @return string Post text transformed through the magic of Markdown + */ + public function o2_preview_post( $text ) { + if ( $this->is_posting_enabled() ) { + $text = $this->transform( $text, array( 'unslash' => false ) ); + } + return $text; + } + + /** + * If Markdown is enabled for comments on this blog, filter the text for o2 previews + * @param string $text Comment text + * @return string Comment text transformed through the magic of Markdown + */ + public function o2_preview_comment( $text ) { + if ( $this->is_commenting_enabled() ) { + $text = $this->transform( $text, array( 'unslash' => false ) ); + } + return $text; + } + + /** + * Escapes lists so that o2 doesn't trounce them + * @param string $text Post/comment text + * @return string Text escaped with HTML entity for asterisk + */ + public function o2_escape_lists( $text ) { + return preg_replace( '/^\\* /um', '* ', $text ); + } + + /** + * Unescapes the token we inserted on o2_escape_lists + * @param string $text Post/comment text with HTML entities for asterisks + * @return string Text with the HTML entity removed + */ + public function o2_unescape_lists( $text ) { + return preg_replace( '/^[&]\#042; /um', '* ', $text ); + } + + /** + * Preserve code blocks from being munged by KSES before they have a chance + * @param string $text post content + * @return string post content with code blocks escaped + */ + public function preserve_code_blocks( $text ) { + return $this->get_parser()->codeblock_preserve( $text ); + } + + /** + * Remove KSES if it's there. Store the result to manually invoke later if needed. + * @return null + */ + public function maybe_remove_kses() { + // Filters return true if they existed before you removed them + if ( $this->is_posting_enabled() ) + $this->kses = remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' ) && remove_filter( 'content_save_pre', 'wp_filter_post_kses' ); + } + + /** + * Add our Writing and Discussion settings. + * @return null + */ + public function register_setting() { + add_settings_field( self::POST_OPTION, __( 'Markdown', 'jetpack' ), array( $this, 'post_field' ), 'writing' ); + register_setting( 'writing', self::POST_OPTION, array( $this, 'sanitize_setting') ); + add_settings_field( self::COMMENT_OPTION, __( 'Markdown', 'jetpack' ), array( $this, 'comment_field' ), 'discussion' ); + register_setting( 'discussion', self::COMMENT_OPTION, array( $this, 'sanitize_setting') ); + } + + /** + * Sanitize setting. Don't really want to store "on" value, so we'll store "1" instead! + * @param string $input Value received by settings API via $_POST + * @return bool Cast to boolean. + */ + public function sanitize_setting( $input ) { + return (bool) $input; + } + + /** + * Prints HTML for the Writing setting + * @return null + */ + public function post_field() { + printf( + '

    %s

    ', + self::POST_OPTION, + self::POST_OPTION, + checked( $this->is_posting_enabled(), true, false ), + esc_html__( 'Use Markdown for posts and pages.', 'jetpack' ), + sprintf( '%s', esc_url( $this->get_support_url() ), esc_html__( 'Learn more about Markdown.', 'jetpack' ) ) + ); + } + + /** + * Prints HTML for the Discussion setting + * @return null + */ + public function comment_field() { + printf( + '

    %s

    ', + self::COMMENT_OPTION, + self::COMMENT_OPTION, + checked( $this->is_commenting_enabled(), true, false ), + esc_html__( 'Use Markdown for comments.', 'jetpack' ), + sprintf( '%s', esc_url( $this->get_support_url() ), esc_html__( 'Learn more about Markdown.', 'jetpack' ) ) + ); + } + + /** + * Get the support url for Markdown + * @uses apply_filters + * @return string support url + */ + protected function get_support_url() { + return apply_filters( 'easy_markdown_support_url', 'http://en.support.wordpress.com/markdown-quick-reference/' ); + } + + /** + * Is Mardown conversion for posts enabled? + * @return boolean + */ + public function is_posting_enabled() { + return (bool) get_option( self::POST_OPTION, '' ); + } + + /** + * Is Markdown conversion for comments enabled? + * @return boolean + */ + public function is_commenting_enabled() { + return (bool) get_option( self::COMMENT_OPTION, '' ); + } + + /** + * Check if a $post_id has Markdown enabled + * @param int $post_id A post ID. + * @return boolean + */ + public function is_markdown( $post_id ) { + return get_metadata( 'post', $post_id, self::IS_MD_META, true ); + } + + /** + * Set Markdown as enabled on a post_id. We skip over update_postmeta so we + * can sneakily set metadata on post revisions, which we need. + * @param int $post_id A post ID. + * @return bool The metadata was successfully set. + */ + protected function set_as_markdown( $post_id ) { + return update_metadata( 'post', $post_id, self::IS_MD_META, true ); + } + + /** + * Get our Markdown parser object, optionally requiring all of our needed classes and + * instantiating our parser. + * @return object WPCom_GHF_Markdown_Parser instance. + */ + protected function get_parser() { + + if ( ! self::$parser ) { + jetpack_require_lib( 'markdown' ); + self::$parser = new WPCom_GHF_Markdown_Parser; + } + + return self::$parser; + } + + /** + * We don't want Markdown conversion all over the place. + * @return null + */ + public function add_default_post_type_support() { + add_post_type_support( 'post', self::POST_TYPE_SUPPORT ); + add_post_type_support( 'page', self::POST_TYPE_SUPPORT ); + add_post_type_support( 'revision', self::POST_TYPE_SUPPORT ); + } + + /** + * Figure out the post type of the post screen we're on + * @return string Current post_type + */ + protected function get_post_screen_post_type() { + global $pagenow; + if ( 'post-new.php' === $pagenow ) + return ( isset( $_GET['post_type'] ) ) ? $_GET['post_type'] : 'post'; + if ( isset( $_GET['post'] ) ) { + $post = get_post( (int) $_GET['post'] ); + if ( is_object( $post ) && isset( $post->post_type ) ) + return $post->post_type; + } + return 'post'; + } + + /** + * Swap post_content and post_content_filtered for editing + * @param string $content Post content + * @param int $id post ID + * @return string Swapped content + */ + public function edit_post_content( $content, $id ) { + if ( $this->is_markdown( $id ) ) { + $post = get_post( $id ); + if ( $post && ! empty( $post->post_content_filtered ) ) { + $post = $this->swap_for_editing( $post ); + return $post->post_content; + } + } + return $content; + } + + /** + * Swap post_content_filtered and post_content for editing + * @param string $content Post content_filtered + * @param int $id post ID + * @return string Swapped content + */ + public function edit_post_content_filtered( $content, $id ) { + // if markdown was disabled, let's turn this off + if ( ! $this->is_posting_enabled() && $this->is_markdown( $id ) ) { + $post = get_post( $id ); + if ( $post && ! empty( $post->post_content_filtered ) ) + $content = ''; + } + return $content; + } + + /** + * Magic happens here. Markdown is converted and stored on post_content. Original Markdown is stored + * in post_content_filtered so that we can continue editing as Markdown. + * @param array $post_data The post data that will be inserted into the DB. Slashed. + * @param array $postarr All the stuff that was in $_POST. + * @return array $post_data with post_content and post_content_filtered modified + */ + public function wp_insert_post_data( $post_data, $postarr ) { + // $post_data array is slashed! + $post_id = isset( $postarr['ID'] ) ? $postarr['ID'] : false; + // bail early if markdown is disabled or this post type is unsupported. + if ( ! $this->is_posting_enabled() || ! post_type_supports( $post_data['post_type'], self::POST_TYPE_SUPPORT ) ) { + // it's disabled, but maybe this *was* a markdown post before. + if ( $this->is_markdown( $post_id ) && ! empty( $post_data['post_content_filtered'] ) ) { + $post_data['post_content_filtered'] = ''; + } + return $post_data; + } + // rejigger post_content and post_content_filtered + // revisions are already in the right place, except when we're restoring, but that's taken care of elsewhere + if ( 'revision' !== $post_data['post_type'] ) { + $post_data['post_content_filtered'] = apply_filters( 'wpcom_untransformed_content', $post_data['post_content'] ); + $post_data['post_content'] = $this->transform( $post_data['post_content'], array( 'id' => $post_id ) ); + $post_data['post_content'] = apply_filters( 'content_save_pre', $post_data['post_content'] ); + } elseif ( 0 === strpos( $post_data['post_name'], $post_data['post_parent'] . '-autosave' ) ) { + // autosaves for previews are weird + $post_data['post_content'] = $this->transform( $post_data['post_content'], array( 'id' => $post_data['post_parent'] ) ); + $post_data['post_content'] = apply_filters( 'content_save_pre', $post_data['post_content'] ); + } + + // set as markdown on the wp_insert_post hook later + if ( $post_id ) + $this->monitoring['post'][ $post_id ] = true; + else + $this->monitoring['content'] = wp_unslash( $post_data['post_content'] ); + if ( 'revision' === $postarr['post_type'] && $this->is_markdown( $postarr['post_parent'] ) ) + $this->monitoring['parent'][ $postarr['post_parent'] ] = true; + + return $post_data; + } + + /** + * Calls on wp_insert_post action, after wp_insert_post_data. This way we can + * still set postmeta on our revisions after it's all been deleted. + * @param int $post_id The post ID that has just been added/updated + * @return null + */ + public function wp_insert_post( $post_id ) { + $post_parent = get_post_field( 'post_parent', $post_id ); + // this didn't have an ID yet. Compare the content that was just saved. + if ( isset( $this->monitoring['content'] ) && $this->monitoring['content'] === get_post_field( 'post_content', $post_id ) ) { + unset( $this->monitoring['content'] ); + $this->set_as_markdown( $post_id ); + } + if ( isset( $this->monitoring['post'][$post_id] ) ) { + unset( $this->monitoring['post'][$post_id] ); + $this->set_as_markdown( $post_id ); + } elseif ( isset( $this->monitoring['parent'][$post_parent] ) ) { + unset( $this->monitoring['parent'][$post_parent] ); + $this->set_as_markdown( $post_id ); + } + } + + /** + * Run a comment through Markdown. Easy peasy. + * @param string $comment_data A comment. + * @return string A comment, processed by Markdown. + */ + public function preprocess_comment( $comment_data ) { + $comment_data['comment_content'] = $this->transform( $comment_data['comment_content'], array( + 'id' => $this->comment_hash( $comment_data['comment_content'] ) + ) ); + return $comment_data; + } + + public function comment_save_pre( $content ) { + return $this->transform( $content, array( + 'id' => $this->comment_hash( $content ), + 'unslash' => false + ) ); + } + + protected function comment_hash( $content ) { + return 'c-' . substr( md5( $content ), 0, 8 ); + } + + /** + * Markdown conversion. Some DRYness for repetitive tasks. + * @param string $text Content to be run through Markdown + * @param array $args Arguments, with keys: + * id: provide a string to prefix footnotes with a unique identifier + * unslash: when true, expects and returns slashed data + * decode_code_blocks: when true, assume that text in fenced code blocks is already + * HTML encoded and should be decoded before being passed to Markdown, which does + * its own encoding. + * @return string Markdown-processed content + */ + public function transform( $text, $args = array() ) { + $args = wp_parse_args( $args, array( + 'id' => false, + 'unslash' => true, + 'decode_code_blocks' => ! $this->get_parser()->use_code_shortcode + ) ); + // probably need to unslash + if ( $args['unslash'] ) + $text = wp_unslash( $text ); + + $text = apply_filters( 'wpcom_markdown_transform_pre', $text, $args ); + // ensure our paragraphs are separated + $text = str_replace( array( '

    ', "

    \n

    " ), "

    \n\n

    ", $text ); + // visual editor likes to add

    s. Buh-bye. + $text = $this->get_parser()->unp( $text ); + // sometimes we get an encoded > at start of line, breaking blockquotes + $text = preg_replace( '/^>/m', '>', $text ); + // prefixes are because we need to namespace footnotes by post_id + $this->get_parser()->fn_id_prefix = $args['id'] ? $args['id'] . '-' : ''; + // If we're not using the code shortcode, prevent over-encoding. + if ( $args['decode_code_blocks'] ) { + $text = $this->get_parser()->codeblock_restore( $text ); + } + // Transform it! + $text = $this->get_parser()->transform( $text ); + // Fix footnotes - kses doesn't like the : IDs it supplies + $text = preg_replace( '/((id|href)="#?fn(ref)?):/', "$1-", $text ); + // Markdown inserts extra spaces to make itself work. Buh-bye. + $text = rtrim( $text ); + $text = apply_filters( 'wpcom_markdown_transform_post', $text, $args ); + + // probably need to re-slash + if ( $args['unslash'] ) + $text = wp_slash( $text ); + + return $text; + } + + /** + * Shows Markdown in the Revisions screen, and ensures that post_content_filtered + * is maintained on revisions + * @param array $fields Post fields pertinent to revisions + * @return array Modified array to include post_content_filtered + */ + public function _wp_post_revision_fields( $fields ) { + $fields['post_content_filtered'] = __( 'Markdown content', 'jetpack' ); + return $fields; + } + + /** + * Do some song and dance to keep all post_content and post_content_filtered content + * in the expected place when a post revision is restored. + * @param int $post_id The post ID have a restore done to it + * @param int $revision_id The revision ID being restored + * @return null + */ + public function wp_restore_post_revision( $post_id, $revision_id ) { + if ( $this->is_markdown( $revision_id ) ) { + $revision = get_post( $revision_id, ARRAY_A ); + $post = get_post( $post_id, ARRAY_A ); + $post['post_content'] = $revision['post_content_filtered']; // Yes, we put it in post_content, because our wp_insert_post_data() expects that + // set this flag so we can restore the post_content_filtered on the last revision later + $this->monitoring['restore'] = true; + // let's not make a revision of our fixing update + add_filter( 'wp_revisions_to_keep', '__return_false', 99 ); + wp_update_post( $post ); + $this->fix_latest_revision_on_restore( $post_id ); + remove_filter( 'wp_revisions_to_keep', '__return_false', 99 ); + } + } + + /** + * We need to ensure the last revision has Markdown, not HTML in its post_content_filtered + * column after a restore. + * @param int $post_id The post ID that was just restored. + * @return null + */ + protected function fix_latest_revision_on_restore( $post_id ) { + global $wpdb; + $post = get_post( $post_id ); + $last_revision = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'revision' AND post_parent = %d ORDER BY ID DESC", $post->ID ) ); + $last_revision->post_content_filtered = $post->post_content_filtered; + wp_insert_post( (array) $last_revision ); + } + + /** + * Kicks off magic for an XML-RPC session. We want to keep editing Markdown + * and publishing HTML. + * @param string $xmlrpc_method The current XML-RPC method + * @return null + */ + public function xmlrpc_actions( $xmlrpc_method ) { + switch ( $xmlrpc_method ) { + case 'metaWeblog.getRecentPosts': + case 'wp.getPosts': + add_action( 'parse_query', array( $this, 'make_filterable' ), 10, 1 ); + break; + case 'wp.getPost': + $this->prime_post_cache(); + break; + } + } + + /** + * The metaWeblog.getPost xmlrpc_call action fires *after* get_post() is called. + * So, we have to detect that method and prime the post cache early. + * @return null + */ + protected function check_for_mwgetpost() { + global $HTTP_RAW_POST_DATA; + if ( false === strpos( $HTTP_RAW_POST_DATA, 'metaWeblog.getPost') ) { + return; + } + include_once( ABSPATH . WPINC . '/class-IXR.php' ); + $message = new IXR_Message( $HTTP_RAW_POST_DATA ); + $message->parse(); + $this->prime_post_cache( $message->params[0] ); + } + + /** + * Prime the post cache with swapped post_content. This is a sneaky way of getting around + * the fact that there are no good hooks to call on the *.getPost xmlrpc methods. + * + * @return null + */ + private function prime_post_cache( $post_id = false ) { + global $wp_xmlrpc_server; + if ( ! $post_id ) { + $post_id = $wp_xmlrpc_server->message->params[0]; + } + + // prime the post cache + if ( $this->is_markdown( $post_id ) ) { + $post = get_post( $post_id ); + if ( ! empty( $post->post_content_filtered ) ) { + wp_cache_delete( $post->ID, 'posts' ); + $post = $this->swap_for_editing( $post ); + wp_cache_add( $post->ID, $post, 'posts' ); + $this->posts_to_uncache[] = $post_id; + } + } + // uncache munged posts if using a persistent object cache + if ( wp_using_ext_object_cache() ) { + add_action( 'shutdown', array( $this, 'uncache_munged_posts' ) ); + } + } + + /** + * Swaps `post_content_filtered` back to `post_content` for editing purposes. + * @param object $post WP_Post object + * @return object WP_Post object with swapped `post_content_filtered` and `post_content` + */ + protected function swap_for_editing( $post ) { + $markdown = $post->post_content_filtered; + // unencode encoded code blocks + $markdown = $this->get_parser()->codeblock_restore( $markdown ); + // restore beginning of line blockquotes + $markdown = preg_replace( '/^> /m', '> ', $markdown ); + $post->post_content_filtered = $post->post_content; + $post->post_content = $markdown; + return $post; + } + + + /** + * We munge the post cache to serve proper markdown content to XML-RPC clients. + * Uncache these after the XML-RPC session ends. + * @return null + */ + public function uncache_munged_posts() { + // $this context gets lost in testing sometimes. Weird. + foreach( WPCom_Markdown::get_instance()->posts_to_uncache as $post_id ) { + wp_cache_delete( $post_id, 'posts' ); + } + } + + /** + * Since *.(get)?[Rr]ecentPosts calls get_posts with suppress filters on, we need to + * turn them back on so that we can swap things for editing. + * @param object $wp_query WP_Query object + * @return null + */ + public function make_filterable( $wp_query ) { + $wp_query->set( 'suppress_filters', false ); + add_action( 'the_posts', array( $this, 'the_posts' ), 10, 2 ); + } + + /** + * Swaps post_content and post_content_filtered for editing. + * @param array $posts Posts returned by the just-completed query + * @param object $wp_query Current WP_Query object + * @return array Modified $posts + */ + public function the_posts( $posts, $wp_query ) { + foreach ( $posts as $key => $post ) { + if ( $this->is_markdown( $post->ID ) && ! empty( $posts[ $key ]->post_content_filtered ) ) { + $markdown = $posts[ $key ]->post_content_filtered; + $posts[ $key ]->post_content_filtered = $posts[ $key ]->post_content; + $posts[ $key ]->post_content = $markdown; + } + } + return $posts; + } + + /** + * Singleton silence is golden + */ + private function __construct() {} +} + +add_action( 'init', array( WPCom_Markdown::get_instance(), 'load' ) ); diff --git a/modules/minileven/images/wp-app-devices.png b/modules/minileven/images/wp-app-devices.png index 4b5f4be966246..34e0b495049ea 100644 Binary files a/modules/minileven/images/wp-app-devices.png and b/modules/minileven/images/wp-app-devices.png differ diff --git a/modules/minileven/theme/pub/minileven/functions.php b/modules/minileven/theme/pub/minileven/functions.php index 88b74bb8b2c95..254d4838ca085 100644 --- a/modules/minileven/theme/pub/minileven/functions.php +++ b/modules/minileven/theme/pub/minileven/functions.php @@ -93,13 +93,13 @@ function minileven_fonts() { /* translators: If there are characters in your language that are not supported by Open Sans, translate this to 'off'. Do not translate into your own language. */ - if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'minileven' ) ) { + if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'minileven' , 'jetpack' ) ) { $opensans_subsets = 'latin,latin-ext'; /* translators: To add an additional Open Sans character subset specific to your language, translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */ - $opensans_subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'minileven' ); + $opensans_subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'minileven' , 'jetpack' ); if ( 'cyrillic' == $opensans_subset ) $opensans_subsets .= ',cyrillic,cyrillic-ext'; @@ -223,4 +223,4 @@ function minileven_get_gallery_images() { } return $images; -} \ No newline at end of file +} diff --git a/modules/minileven/theme/pub/minileven/image.php b/modules/minileven/theme/pub/minileven/image.php index 30f57195b626c..13ca38d8c0532 100644 --- a/modules/minileven/theme/pub/minileven/image.php +++ b/modules/minileven/theme/pub/minileven/image.php @@ -84,7 +84,7 @@

    @@ -95,4 +95,4 @@ - \ No newline at end of file + diff --git a/modules/minileven/theme/pub/minileven/screenshot.png b/modules/minileven/theme/pub/minileven/screenshot.png index 348e94c0b7d0e..46e63995320af 100644 Binary files a/modules/minileven/theme/pub/minileven/screenshot.png and b/modules/minileven/theme/pub/minileven/screenshot.png differ diff --git a/modules/minileven/theme/pub/minileven/style.css b/modules/minileven/theme/pub/minileven/style.css index 24ac14b44398e..8d32c77e07116 100644 --- a/modules/minileven/theme/pub/minileven/style.css +++ b/modules/minileven/theme/pub/minileven/style.css @@ -7,7 +7,7 @@ Description: The Minileven theme is a clean, lightweight mobile experience for y Version: 2.0-wpcom License: GNU General Public License License URI: license.txt -Tags: dark, light, white, black, gray, one-column, flexible-width, responsive-width, custom-background, custom-header, custom-menu, full-width-template, infinite-scroll, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, blog, bright, clean, contemporary, elegant, minimal, modern, photography, simple, tumblelog +Tags: dark, light, white, black, gray, one-column, fluid-layout, responsive-layout, custom-background, custom-header, custom-menu, full-width-template, infinite-scroll, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, blog, bright, clean, contemporary, elegant, minimal, modern, photography, simple, tumblelog */ .image-attachment .entry-caption p { @@ -374,6 +374,9 @@ header img { width: 100%; z-index: 99999; } +.admin-bar #access ul.nav-menu { + top: 6.6em; +} .main-small-navigation .menu { background: #f9f9f9; border: 1px solid #e9e9e9; diff --git a/modules/module-info.php b/modules/module-info.php index 0689ffc0c0b9c..5ca264255749a 100644 --- a/modules/module-info.php +++ b/modules/module-info.php @@ -110,15 +110,25 @@ function jetpack_shortcodes_more_info_connected() { ?> 'http://support.wordpress.com/archives-shortcode/', 'audio' => 'http://support.wordpress.com/audio/', + 'bandcamp' => 'http://en.support.wordpress.com/audio/bandcamp/', 'blip.tv' => 'http://support.wordpress.com/videos/bliptv/', 'dailymotion' => 'http://support.wordpress.com/videos/dailymotion/', + 'facebook' => 'http://en.support.wordpress.com/facebook-integration/facebook-embeds/', 'flickr' => 'http://support.wordpress.com/videos/flickr-video/', + 'googlemaps' => 'http://support.wordpress.com/google-maps/', + 'jetpack_subscription_form' => 'http://jetpack.me/support/subscriptions/#display', + 'polldaddy' => 'http://support.polldaddy.com/wordpress-shortcodes/', + 'presentation' => 'http://en.support.wordpress.com/presentations/', 'scribd' => 'http://support.wordpress.com/scribd/', 'slideshare' => 'http://support.wordpress.com/slideshows/slideshare/', + 'slideshow' => 'http://en.support.wordpress.com/slideshows/', 'soundcloud' => 'http://support.wordpress.com/audio/soundcloud-audio-player/', + 'ted' => 'http://en.support.wordpress.com/videos/ted-talks/', + 'twitter-timeline' => 'http://en.support.wordpress.com/widgets/twitter-timeline-widget/#embedding-with-a-shortcode', + 'upcomingevents' => 'http://en.support.wordpress.com/widgets/upcoming-events/#events-list-shortcode', 'vimeo' => 'http://support.wordpress.com/videos/vimeo/', + 'vine' => 'http://en.support.wordpress.com/videos/vine/', 'youtube' => 'http://support.wordpress.com/videos/youtube/', - 'polldaddy' => 'http://support.polldaddy.com/wordpress-shortcodes/', ); $codes['wpvideo (VideoPress)'] = 'http://en.support.wordpress.com/videopress/'; @@ -407,6 +417,11 @@ function jetpack_widgets_more_info_connected() { ?>

    +

    +

    +

    +

    +

    Widgets. Drag them into one of your sidebars and configure away.', 'jetpack' ), admin_url( 'widgets.php' ) ); ?>

    + + + + + +

    %s

    +

    %s

    +

    %s

    +
    +

    %s

    + %s +EOT; + printf( + $template, + plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/_inc/images/screenshots/related-posts.png' ), + esc_attr__( 'Related Posts', 'jetpack' ), + esc_html__( 'Related Posts', 'jetpack' ), + esc_html__( '"Related Posts" shows additional relevant links from your site under your posts. If the feature is enabled, links appear underneath your Sharing Buttons and WordPress.com Likes (if you’ve turned these on).', 'jetpack' ), + esc_html__( 'More information on using Related Posts.', 'jetpack' ), + esc_html__( 'This feature uses the WordPress.com infrastructure and requires that your public content be mirrored there. If you see intermittent issues only effecting certain posts, request a reindex of your posts.', 'jetpack' ), + Jetpack::init()->sync->reindex_ui() + ); +} +add_action( 'jetpack_module_more_info_related-posts', 'jetpack_related_posts_more_info' ); + +function jetpack_related_posts_more_button() { + echo '' . __( 'Learn More', 'jetpack' ) . ''; +} +add_action( 'jetpack_learn_more_button_related-posts', 'jetpack_related_posts_more_button' ); +// Related Posts: STOP + +// Markdown: START +function jetpack_markdown_more_info() { ?> +

    + +

    + +' . esc_html__( 'Learn More', 'jetpack' ) . ''; +} +add_action( 'jetpack_learn_more_button_markdown', 'jetpack_markdown_more_link' ); +// Markdown: STOP + diff --git a/modules/monitor.php b/modules/monitor.php index 3d9cd00c79826..78fdbd0e38536 100644 --- a/modules/monitor.php +++ b/modules/monitor.php @@ -11,17 +11,6 @@ function jetpack_monitor_toggle() { $jetpack = Jetpack::init(); - if ( ! $jetpack->current_user_is_connection_owner() ) { - Jetpack::state( 'module', 'monitor' ); - Jetpack::state( 'error', 'master_user_required' ); - - // Technically this call to `wp_safe_redirect` is not required because - // `Jetpack::activate_module` already sets up a redirect. However, this - // might not stay the case forever so it's clearer to do it here as well. - wp_safe_redirect( Jetpack::admin_url( 'page=jetpack' ) ); - die; - } - $jetpack->sync->register( 'noop' ); if ( false !== strpos( current_filter(), 'jetpack_activate_module_' ) ) { @@ -32,3 +21,143 @@ function jetpack_monitor_toggle() { add_action( 'jetpack_activate_module_monitor', 'jetpack_monitor_toggle' ); add_action( 'jetpack_deactivate_module_monitor', 'jetpack_monitor_toggle' ); +class Jetpack_Monitor { + + public $module = 'monitor'; + + function __construct() { + add_action( 'jetpack_modules_loaded', array( $this, 'jetpack_modules_loaded' ) ); + add_action( 'jetpack_activate_module_monitor', array( $this, 'activate_module' ) ); + } + + public function activate_module() { + if ( Jetpack::is_user_connected() ) { + self::update_option_receive_jetpack_monitor_notification( true ); + } + } + + public function jetpack_modules_loaded() { + Jetpack::enable_module_configurable( $this->module ); + Jetpack::module_configuration_load( $this->module, array( $this, 'jetpack_configuration_load' ) ); + Jetpack::module_configuration_screen( $this->module, array( $this, 'jetpack_configuration_screen' ) ); + } + + public function jetpack_configuration_load() { + if ( Jetpack::is_user_connected() && ! self::is_active() ) { + Jetpack::deactivate_module( $this->module ); + Jetpack::state( 'message', 'module_deactivated' ); + wp_safe_redirect( Jetpack::admin_url( 'page=jetpack' ) ); + die(); + } + if ( ! empty( $_POST['action'] ) && $_POST['action'] == 'monitor-save' ) { + check_admin_referer( 'monitor-settings' ); + $this->update_option_receive_jetpack_monitor_notification( isset( $_POST['receive_jetpack_monitor_notification'] ) ); + Jetpack::state( 'message', 'module_configured' ); + wp_safe_redirect( Jetpack::module_configuration_url( $this->module ) ); + } + } + + public function jetpack_configuration_screen() { + ?> +

    +

    +
    + + +
    + + + +
    - +
    - +
    + + + + + + + + +

    + +
    + get_current_user_id() + ) ); + $xml->query( 'jetpack.monitor.isActive' ); + if ( $xml->isError() ) { + wp_die( sprintf( '%s: %s', $xml->getErrorCode(), $xml->getErrorMessage() ) ); + } + return $xml->getResponse(); + } + + public function update_option_receive_jetpack_monitor_notification( $value ) { + Jetpack::load_xml_rpc_client(); + $xml = new Jetpack_IXR_Client( array( + 'user_id' => get_current_user_id() + ) ); + $xml->query( 'jetpack.monitor.setNotifications', (bool) $value ); + + if ( $xml->isError() ) { + wp_die( sprintf( '%s: %s', $xml->getErrorCode(), $xml->getErrorMessage() ) ); + } + return true; + } + + public function user_receives_notifications() { + Jetpack::load_xml_rpc_client(); + $xml = new Jetpack_IXR_Client( array( + 'user_id' => get_current_user_id() + ) ); + $xml->query( 'jetpack.monitor.isUserInNotifications' ); + + if ( $xml->isError() ) { + wp_die( sprintf( '%s: %s', $xml->getErrorCode(), $xml->getErrorMessage() ) ); + } + return $xml->getResponse(); + } + + public function activate_monitor() { + Jetpack::load_xml_rpc_client(); + $xml = new Jetpack_IXR_Client( array( + 'user_id' => get_current_user_id() + ) ); + + $xml->query( 'jetpack.monitor.activate' ); + + if ( $xml->isError() ) { + wp_die( sprintf( '%s: %s', $xml->getErrorCode(), $xml->getErrorMessage() ) ); + } + return true; + } + + public function deactivate_monitor() { + Jetpack::load_xml_rpc_client(); + $xml = new Jetpack_IXR_Client( array( + 'user_id' => get_current_user_id() + ) ); + + $xml->query( 'jetpack.monitor.deactivate' ); + + if ( $xml->isError() ) { + wp_die( sprintf( '%s: %s', $xml->getErrorCode(), $xml->getErrorMessage() ) ); + } + return true; + } + +} + +new Jetpack_Monitor; + diff --git a/modules/publicize.php b/modules/publicize.php index 6d8ce871e755a..8ddf35c76eb16 100644 --- a/modules/publicize.php +++ b/modules/publicize.php @@ -21,7 +21,7 @@ function __construct() { if ( $this->in_jetpack && method_exists( 'Jetpack', 'module_configuration_load' ) ) { Jetpack::enable_module_configurable( __FILE__ ); Jetpack::module_configuration_load( __FILE__, array( $this, 'jetpack_configuration_load' ) ); - Jetpack_Sync::sync_posts( __FILE__ ); + add_action( 'init', array( $this, 'sync_posts_init' ), 999 ); } require_once dirname( __FILE__ ) . '/publicize/publicize.php'; @@ -41,7 +41,7 @@ function __construct() { if ( $this->in_jetpack) { add_action( 'jetpack_activate_module_publicize', array( $this, 'module_state_toggle' ) ); add_action( 'jetpack_deactivate_module_publicize', array( $this, 'module_state_toggle' ) ); - + add_filter( 'jetpack_sync_post_module_custom_data', array( $this, 'sync_post_module_custom_data' ), 10, 2 ); // if sharedaddy isn't active, the sharing menu hasn't been added yet $active = Jetpack::get_active_modules(); if ( in_array( 'publicize', $active ) && !in_array( 'sharedaddy', $active ) ) @@ -49,6 +49,27 @@ function __construct() { } } + function sync_posts_init() { + $post_types = array( 'post', 'page' ); + $all_post_types = get_post_types(); + foreach ( $all_post_types as $post_type ) { + // sync Custom Post Types that support publicize + if ( post_type_supports( $post_type, 'publicize' ) ) { + $post_types[] = $post_type; + } + } + Jetpack_Sync::sync_posts( __FILE__, array( + 'post_types' => $post_types, + ) ); + } + + function sync_post_module_custom_data( $custom_data, $post ) { + if ( post_type_supports( get_post_type( $post ), 'publicize' ) ) { + $custom_data['cpt_publicizeable'] = true; + } + return $custom_data; + } + function module_state_toggle() { // extra check that we are on the JP blog, just incase if ( class_exists( 'Jetpack' ) && $this->in_jetpack ) { diff --git a/modules/publicize/assets/path-logo.png b/modules/publicize/assets/path-logo.png index 7e9bba25eb759..0ccbfcffcd93a 100644 Binary files a/modules/publicize/assets/path-logo.png and b/modules/publicize/assets/path-logo.png differ diff --git a/modules/publicize/assets/publicize-fb-2x.png b/modules/publicize/assets/publicize-fb-2x.png index 4d6a9fb75fc1f..9e679f4ea1187 100644 Binary files a/modules/publicize/assets/publicize-fb-2x.png and b/modules/publicize/assets/publicize-fb-2x.png differ diff --git a/modules/publicize/assets/publicize-google-2x.png b/modules/publicize/assets/publicize-google-2x.png index a63fe145366f2..f87ec18a11b22 100644 Binary files a/modules/publicize/assets/publicize-google-2x.png and b/modules/publicize/assets/publicize-google-2x.png differ diff --git a/modules/publicize/assets/publicize-linkedin-2x.png b/modules/publicize/assets/publicize-linkedin-2x.png index a2ea24125a642..5418abffe0032 100644 Binary files a/modules/publicize/assets/publicize-linkedin-2x.png and b/modules/publicize/assets/publicize-linkedin-2x.png differ diff --git a/modules/publicize/assets/publicize-path-2x.png b/modules/publicize/assets/publicize-path-2x.png index 7f69d2a40dd9f..dbf831163be0f 100644 Binary files a/modules/publicize/assets/publicize-path-2x.png and b/modules/publicize/assets/publicize-path-2x.png differ diff --git a/modules/publicize/assets/publicize-tumblr-2x.png b/modules/publicize/assets/publicize-tumblr-2x.png index e966ebb05f969..d7befda2a0370 100644 Binary files a/modules/publicize/assets/publicize-tumblr-2x.png and b/modules/publicize/assets/publicize-tumblr-2x.png differ diff --git a/modules/publicize/assets/publicize-twitter-2x.png b/modules/publicize/assets/publicize-twitter-2x.png index 918d39cb0acb9..37cc6fceed63f 100644 Binary files a/modules/publicize/assets/publicize-twitter-2x.png and b/modules/publicize/assets/publicize-twitter-2x.png differ diff --git a/modules/publicize/assets/twitter-logo.png b/modules/publicize/assets/twitter-logo.png index 6c7b89b33c586..4083e83da692b 100644 Binary files a/modules/publicize/assets/twitter-logo.png and b/modules/publicize/assets/twitter-logo.png differ diff --git a/modules/publicize/enhanced-open-graph.php b/modules/publicize/enhanced-open-graph.php index 3f117b6b02e8b..ff656317dae11 100644 --- a/modules/publicize/enhanced-open-graph.php +++ b/modules/publicize/enhanced-open-graph.php @@ -6,7 +6,7 @@ * Better OG Image Tags for Image Post Formats */ function enhanced_og_image( $tags ) { - if ( !is_singular() ) + if ( !is_singular() || post_password_required() ) return $tags; global $post; @@ -31,7 +31,7 @@ function enhanced_og_image( $tags ) { * Better OG Image Tags for Gallery Post Formats */ function enhanced_og_gallery( $tags ) { - if ( !is_singular() ) + if ( !is_singular() || post_password_required() ) return $tags; global $post; @@ -62,7 +62,7 @@ function enhanced_og_gallery( $tags ) { * Allows VideoPress, YouTube, and Vimeo videos to play inline on Facebook */ function enhanced_og_video( $tags ) { - if ( !is_singular() ) + if ( !is_singular() || post_password_required() ) return $tags; global $post; diff --git a/modules/related-posts.php b/modules/related-posts.php new file mode 100644 index 0000000000000..ead4fee81ea6d --- /dev/null +++ b/modules/related-posts.php @@ -0,0 +1,120 @@ +_get_post_count_local() != $this->_get_post_count_cloud() ) { + Jetpack::init()->sync->reindex_trigger(); + } + } + + /** + * This action triggers if the module is in an active state, load related posts and options. + * + * @uses Jetpack_RelatedPosts::init, is_admin, Jetpack::enable_module_configurable, Jetpack::module_configuration_load, Jetpack_Sync::sync_posts + * @return null + */ + public function action_on_load() { + require_once 'related-posts/jetpack-related-posts.php'; + Jetpack_RelatedPosts::init(); + + if ( is_admin() ) { + // Enable "Configure" button on module card + Jetpack::enable_module_configurable( __FILE__ ); + Jetpack::module_configuration_load( __FILE__, array( $this, 'module_configuration_load' ) ); + + // Sync new posts + Jetpack_Sync::sync_posts( __FILE__ ); + } + } + + /** + * Redirect configure button to Settings > Reading + * + * @uses wp_safe_redirect, admin_url + * @return null + */ + public function module_configuration_load() { + wp_safe_redirect( admin_url( 'options-reading.php#jetpack_relatedposts' ) ); + exit; + } + + private function _get_post_count_local() { + global $wpdb; + return (int) $wpdb->get_var( + "SELECT count(*) + FROM {$wpdb->posts} + WHERE post_type = 'post' AND post_status = 'publish' AND post_password = ''" + ); + } + + private function _get_post_count_cloud() { + $blog_id = Jetpack::init()->get_option( 'id' ); + + $body = array( + 'size' => 1, + ); + + $response = wp_remote_post( + "https://public-api.wordpress.com/rest/v1/sites/$blog_id/search", + array( + 'timeout' => 10, + 'user-agent' => 'jetpack_related_posts', + 'sslverify' => true, + 'body' => $body, + ) + ); + + if ( is_wp_error( $response ) ) { + return 0; + } + + $results = json_decode( wp_remote_retrieve_body( $response ), true ); + + return (int) $results['results']['total']; + } +} + +// Do it. +Jetpack_RelatedPosts_Module::instance(); diff --git a/modules/related-posts/jetpack-related-posts.php b/modules/related-posts/jetpack-related-posts.php new file mode 100644 index 0000000000000..583bb22a0d953 --- /dev/null +++ b/modules/related-posts/jetpack-related-posts.php @@ -0,0 +1,887 @@ +_blog_id = $blog_id; + $this->_blog_charset = get_option( 'blog_charset' ); + $this->_convert_charset = ( function_exists( 'iconv' ) && ! preg_match( '/^utf\-?8$/i', $this->_blog_charset ) ); + + add_action( 'admin_init', array( $this, 'action_admin_init' ) ); + add_action( 'wp', array( $this, 'action_frontend_init' ) ); + } + + /** + * ================= + * ACTIONS & FILTERS + * ================= + */ + + /** + * Add a checkbox field to Settings > Reading for enabling related posts. + * + * @action admin_init + * @uses add_settings_field, __, register_setting, add_action + * @return null + */ + public function action_admin_init() { + if ( ! $this->_show_config_in_admin( $this->_blog_id ) ) + return; + + // Add the setting field [jetpack_relatedposts] and place it in Settings > Reading + add_settings_field( 'jetpack_relatedposts', '' . __( 'Related posts', 'jetpack' ) . '', array( $this, 'print_setting_html' ), 'reading' ); + register_setting( 'reading', 'jetpack_relatedposts', array( $this, 'parse_options' ) ); + add_action('admin_head', array( $this, 'print_setting_head' ) ); + + // Enqueue style for live preview + $this->_enqueue_assets( false, true ); + } + + /** + * Load related posts assets if it's a elegiable frontend page or execute search and return JSON if it's an endpoint request. + * + * @global $_GET + * @action wp + * @returns null + */ + public function action_frontend_init() { + if ( ! $this->_enabled_for_request( $this->_blog_id ) ) + return; + + if ( isset( $_GET['relatedposts_exclude'] ) ) + $exclude_id = (int)$_GET['relatedposts_exclude']; + else + $exclude_id = 0; + + if ( isset( $_GET['relatedposts_to'] ) ) + $this->_action_frontend_redirect( $_GET['relatedposts_to'], $_GET['relatedposts_order'] ); + elseif ( isset( $_GET['relatedposts'] ) ) + $this->_action_frontend_init_ajax( $exclude_id ); + else + $this->_action_frontend_init_page(); + + } + + /** + * Adds a target to the post content to load related posts into. + * + * @filter the_content + * @param string $content + * @uses esc_html__, apply_filters + * @returns string + */ + public function filter_add_target_to_dom( $content ) { + $options = $this->get_options(); + + if ( $options['show_headline'] ) { + $headline = sprintf( + '', + esc_html__( 'Related', 'jetpack' ) + ); + } else { + $headline = ''; + } + + $headline = apply_filters( 'jetpack_relatedposts_filter_headline', $headline ); + + return <<