Fishpig_Wordpress_Integration - Version 4.2.1.0

Version Notes

For changes, please see http://fishpig.co.uk/magento/wordpress-integration/#changelog

Download this release

Release Info

Developer fishpig
Extension Fishpig_Wordpress_Integration
Version 4.2.1.0
Comparing to
See all releases


Code changes from version 4.2.0.27 to 4.2.1.0

Files changed (152) hide show
  1. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Abstract.php +22 -0
  2. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Abstract.php +399 -0
  3. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Category/Category.php +20 -0
  4. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Category/Post.php +20 -0
  5. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Cms/Page/Category.php +20 -0
  6. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Cms/Page/Post.php +20 -0
  7. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Product/Category.php +20 -0
  8. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Product/Post.php +20 -0
  9. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Extend.php +624 -0
  10. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Frontend/Autologin.php +42 -0
  11. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/System/Config/Form/Field/Route.php +89 -0
  12. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Update.php +59 -0
  13. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Ajax.php +117 -0
  14. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Archive/View.php +61 -0
  15. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Author/View.php +31 -0
  16. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Feed/Abstract.php +179 -0
  17. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Feed/Post.php +123 -0
  18. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Feed/Post/Comment.php +88 -0
  19. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Homepage.php +62 -0
  20. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Menu.php +175 -0
  21. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Page/View.php +12 -0
  22. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/Abstract.php +193 -0
  23. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/Associated.php +97 -0
  24. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/Associated/Products.php +49 -0
  25. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/List.php +172 -0
  26. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/List/Associated.php +81 -0
  27. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/List/Pager.php +65 -0
  28. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/List/Renderer.php +20 -0
  29. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/List/Wrapper/Abstract.php +86 -0
  30. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/Meta.php +105 -0
  31. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/View.php +60 -0
  32. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/View/Comment/Abstract.php +127 -0
  33. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/View/Comment/Form.php +85 -0
  34. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/View/Comment/Pager.php +92 -0
  35. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/View/Comment/Wrapper.php +46 -0
  36. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Post/View/Comments.php +47 -0
  37. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Search/Result.php +78 -0
  38. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Shortcode/Product.php +11 -0
  39. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar.php +324 -0
  40. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Abstract.php +225 -0
  41. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Archives.php +103 -0
  42. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Calendar.php +174 -0
  43. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Categories.php +99 -0
  44. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Comments.php +40 -0
  45. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Image.php +65 -0
  46. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Links.php +72 -0
  47. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Menu.php +40 -0
  48. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Meta.php +30 -0
  49. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Pages.php +82 -0
  50. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Posts.php +247 -0
  51. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Rss.php +43 -0
  52. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Rss/Abstract.php +152 -0
  53. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Search.php +56 -0
  54. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Tagcloud.php +100 -0
  55. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Taxonomy.php +161 -0
  56. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Text.php +28 -0
  57. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Sidebar/Widget/Yarpp.php +22 -0
  58. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/System/Config/Form/Field/Post/Type.php +23 -0
  59. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Template.php +11 -0
  60. app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Term/View.php +39 -0
  61. app/code/community/Fishpig/Wordpress/Controller app/code/community/Fishpig/Wordpress/Controller app/code/community/Fishpig/Wordpress/Controller/Abstract.php +476 -0
  62. app/code/community/Fishpig/Wordpress/Controller app/code/community/Fishpig/Wordpress/Controller app/code/community/Fishpig/Wordpress/Controller/Router.php +408 -0
  63. app/code/community/Fishpig/Wordpress/Exception.php app/code/community/Fishpig/Wordpress/Exception.php app/code/community/Fishpig/Wordpress/Exception.php +96 -0
  64. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Abstract.php +256 -0
  65. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/App.php +538 -0
  66. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Associations.php +549 -0
  67. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Catalog/Product.php +124 -0
  68. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Data.php +408 -0
  69. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Database.php +40 -0
  70. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Filter.php +260 -0
  71. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Plugin.php +115 -0
  72. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Plugin/Abstract.php +71 -0
  73. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Plugin/Seo/Abstract.php +223 -0
  74. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Router.php +294 -0
  75. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Abstract.php +324 -0
  76. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/AssociatedProducts.php +45 -0
  77. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Caption.php +51 -0
  78. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Code.php +47 -0
  79. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Dailymotion.php +69 -0
  80. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Gallery.php +82 -0
  81. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Gist.php +82 -0
  82. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Instagram.php +81 -0
  83. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Product.php +124 -0
  84. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Scribd.php +69 -0
  85. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Spotify.php +62 -0
  86. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Vimeo.php +88 -0
  87. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Shortcode/Youtube.php +99 -0
  88. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/Social.php +154 -0
  89. app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper app/code/community/Fishpig/Wordpress/Helper/System.php +533 -0
  90. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Abstract.php +324 -0
  91. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Archive.php +93 -0
  92. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Image.php +184 -0
  93. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Menu.php +120 -0
  94. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Menu/Item.php +201 -0
  95. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Observer.php +242 -0
  96. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Post.php +699 -0
  97. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Post/Attachment/Abstract.php +49 -0
  98. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Post/Comment.php +232 -0
  99. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Post/Type.php +335 -0
  100. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Abstract.php +110 -0
  101. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Collection/Abstract.php +145 -0
  102. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Image.php +27 -0
  103. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Image/Collection.php +30 -0
  104. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Menu.php +15 -0
  105. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Menu/Collection.php +30 -0
  106. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Menu/Item.php +15 -0
  107. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Menu/Item/Collection.php +61 -0
  108. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Post.php +451 -0
  109. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Post/Attachment/Abstract.php +12 -0
  110. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Post/Attachment/Collection/Abstract.php +55 -0
  111. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Post/Collection.php +469 -0
  112. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Post/Comment.php +15 -0
  113. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Post/Comment/Collection.php +101 -0
  114. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Setup.php +28 -0
  115. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Term.php +103 -0
  116. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/Term/Collection.php +213 -0
  117. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/User.php +112 -0
  118. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Resource/User/Collection.php +29 -0
  119. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Sitemap/Sitemap.php +23 -0
  120. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/System/Config/Backend/Autologin.php +132 -0
  121. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/System/Config/Backend/Encrypted.php +23 -0
  122. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/System/Config/Source/Menu.php +32 -0
  123. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/System/Config/Source/Social/Media/Service.php +31 -0
  124. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Term.php +222 -0
  125. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/Term/Taxonomy.php +132 -0
  126. app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model app/code/community/Fishpig/Wordpress/Model/User.php +267 -0
  127. app/code/community/Fishpig/Wordpress/Model/Post.php +18 -0
  128. app/code/community/Fishpig/Wordpress/Model/Post/Comment.php +4 -10
  129. app/code/community/Fishpig/Wordpress/change-log.txt +3 -0
  130. app/code/community/Fishpig/Wordpress/change-log.txt app/code/community/Fishpig/Wordpress/change-log.txt app/code/community/Fishpig/Wordpress/change-log.txt +256 -0
  131. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/Adminhtml/Wordpress/AssociationsController.php +244 -0
  132. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/Adminhtml/WordpressController.php +108 -0
  133. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/AjaxController.php +56 -0
  134. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/ArchiveController.php +79 -0
  135. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/AuthorController.php +89 -0
  136. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/IndexController.php +156 -0
  137. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/PostController.php +306 -0
  138. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/SearchController.php +58 -0
  139. app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers app/code/community/Fishpig/Wordpress/controllers/TermController.php +106 -0
  140. app/code/community/Fishpig/Wordpress/controllers/PostController.php +4 -0
  141. app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc/adminhtml.xml +56 -0
  142. app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc/config.xml +314 -0
  143. app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc/fishpig.xml +2 -0
  144. app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc/system.xml +367 -0
  145. app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc app/code/community/Fishpig/Wordpress/etc/widget.xml +40 -0
  146. app/code/community/Fishpig/Wordpress/etc/config.xml +1 -1
  147. app/code/community/Fishpig/Wordpress/etc/fishpig.xml +1 -1
  148. app/code/community/Fishpig/Wordpress/formatting.php +0 -5294
  149. app/code/community/Fishpig/Wordpress/sql app/code/community/Fishpig/Wordpress/sql app/code/community/Fishpig/Wordpress/sql/wordpress_setup/mysql4-install-0.1.0.php +10 -0
  150. app/code/community/Fishpig/Wordpress/sql app/code/community/Fishpig/Wordpress/sql app/code/community/Fishpig/Wordpress/sql/wordpress_setup/mysql4-upgrade-2.5.9.0-2.5.9.1.php +117 -0
  151. app/code/community/Fishpig/Wordpress/sql app/code/community/Fishpig/Wordpress/sql app/code/community/Fishpig/Wordpress/sql/wordpress_setup/mysql4-upgrade-3.2.0.0-3.2.0.1.php +28 -0
  152. package.xml +4 -4
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Abstract.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ abstract class Fishpig_Wordpress_Block_Abstract extends Mage_Core_Block_Template
10
+ {
11
+ /**
12
+ * Allows for legacy Magento
13
+ *
14
+ * @param string $data
15
+ * @param array $allowedTags = null
16
+ * @return string
17
+ */
18
+ public function escapeHtml($data, $allowedTags = null)
19
+ {
20
+ return Mage::helper('wordpress')->escapeHtml($data, $allowedTags);
21
+ }
22
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Abstract.php ADDED
@@ -0,0 +1,399 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ abstract class Fishpig_Wordpress_Block_Adminhtml_Associations_Abstract extends Mage_Adminhtml_Block_Widget_Grid
10
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
11
+ {
12
+ /**
13
+ * Retrieve the association type for the particular class
14
+ *
15
+ * @return string
16
+ */
17
+ abstract public function getAssociationType();
18
+
19
+ /**
20
+ * Setup the grid
21
+ */
22
+ public function __construct()
23
+ {
24
+ parent::__construct();
25
+
26
+ $this->setId($this->_getMagentoEntity() . $this->_getWpEntity());
27
+ $this->setDefaultSort($this->_getDefaultSort());
28
+ $this->setDefaultDir($this->_getDefaultDir());
29
+ $this->setSaveParametersInSession(false);
30
+ $this->setUseAjax(true);
31
+
32
+ if (is_object($this->_getObject())) {
33
+ $this->setDefaultFilter(array('is_associated' => 1));
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Returns an array of all of the object's associated WP ID's
39
+ *
40
+ * @return array
41
+ */
42
+ public function getSelectedWpItems()
43
+ {
44
+ return array_keys($this->getSelectedWpItemPositions());
45
+ }
46
+
47
+ /**
48
+ * Retrieves an array of associated WP ID's and their position
49
+ *
50
+ * @return array
51
+ */
52
+ public function getSelectedWpItemPositions()
53
+ {
54
+ if ($this->_getObject()) {
55
+ $wpObjectIds = Mage::helper('wordpress/associations')->getAssociations($this->getAssociationType(), $this->_getObject()->getId(), $this->getStoreId());
56
+
57
+ if ($wpObjectIds !== false) {
58
+ foreach($wpObjectIds as $wpObjectId => $position) {
59
+ $wpObjectIds[$wpObjectId] = array('associated_position' => $position);
60
+ }
61
+
62
+ return $wpObjectIds;
63
+ }
64
+ }
65
+
66
+ return array();
67
+ }
68
+
69
+ /**
70
+ * Add in the position field to the grid
71
+ *
72
+ */
73
+ protected function _prepareColumns()
74
+ {
75
+ $this->addColumn('is_associated', array(
76
+ 'header_css_class' => 'a-center',
77
+ 'type' => 'checkbox',
78
+ 'name' => 'is_associated',
79
+ 'align' => 'center',
80
+ 'index' => $this->_getWpPrimaryKey(),
81
+ 'values' => array_values($this->getSelectedWpItems()),
82
+ ));
83
+
84
+ if ($this->_getWpEntity() === 'post') {
85
+ $this->addColumn('post_title', array(
86
+ 'header'=> 'Post Title',
87
+ 'index' => 'post_title',
88
+ ));
89
+
90
+ $postTypes = array_keys(Mage::helper('wordpress/app')->getPostTypes());
91
+
92
+ $this->addColumn('post_type', array(
93
+ 'header'=> 'Type',
94
+ 'index' => 'post_type',
95
+ 'type' => 'options',
96
+ 'options' => array_combine($postTypes, $postTypes),
97
+ ));
98
+
99
+ $this->addColumn('post_date', array(
100
+ 'header'=> 'Post Date',
101
+ 'index' => 'post_date',
102
+ 'type' => 'date',
103
+ 'format' => 'd MMMM YYYY',
104
+ ));
105
+ }
106
+ else if ($this->_getWpEntity() === 'category') {
107
+ $this->addColumn('name', array(
108
+ 'header'=> 'Name',
109
+ 'index' => 'name',
110
+ ));
111
+
112
+ $this->addColumn('slug', array(
113
+ 'header'=> 'Slug',
114
+ 'index' => 'slug',
115
+ ));
116
+
117
+ $taxonomies = array_keys(Mage::helper('wordpress/app')->getTaxonomies());
118
+
119
+ $this->addColumn('taxonomy', array(
120
+ 'header'=> 'Type',
121
+ 'index' => 'taxonomy',
122
+ 'type' => 'options',
123
+ 'options' => array_combine($taxonomies, $taxonomies),
124
+ ));
125
+ }
126
+
127
+ $this->addColumn('associated_position', array(
128
+ 'header' => Mage::helper('catalog')->__('Position'),
129
+ 'name' => 'associated_position',
130
+ 'type' => 'number',
131
+ 'validate_class' => 'validate-number',
132
+ 'index' => 'associated_position',
133
+ 'width' => 100,
134
+ 'editable' => true,
135
+ 'filterable' => false,
136
+ 'sortable' => false,
137
+ ));
138
+
139
+ return parent::_prepareColumns();
140
+ }
141
+
142
+ protected function _prepareCollection()
143
+ {
144
+ if (!$this->getCollection()) {
145
+ if ($this->_getWpEntity() === 'post') {
146
+ $collection = Mage::getResourceModel('wordpress/post_collection')
147
+ ->addPostTypeFilter(array_keys(Mage::helper('wordpress/app')->getPostTypes()))
148
+ # ->removePermalinkFromSelect()
149
+ ->addIsViewableFilter();
150
+ }
151
+ else if ($this->_getWpEntity() === 'category') {
152
+ $collection = Mage::getResourceModel('wordpress/term_collection')->addTaxonomyFilter(
153
+ array_keys(Mage::helper('wordpress/app')->getTaxonomies())
154
+ );
155
+ }
156
+ else {
157
+ return false;
158
+ }
159
+
160
+ # Mage::dispatchEvent('wordpress_association_' . $this->_getWpEntity() . '_collection_load_before', array('collection' => $collection, 'grid' => $this));
161
+
162
+ Mage::helper('wordpress/associations')->addRelatedPositionToSelect($collection, $this->getAssociationType(), $this->_getObject()->getId(), $this->getStoreId());
163
+
164
+ $this->setCollection($collection);
165
+ }
166
+
167
+ try {
168
+ return parent::_prepareCollection();
169
+ }
170
+ catch (Exception $e) {
171
+ echo sprintf('<div><ul class="messages"><li class="error-msg"><ul><li><span>%s</span></li></ul></li></ul></div>', $e->getMessage());
172
+ echo '<p>Your WordPress database user does not have permission to access the association tables in the Magento database. To fix this, either grant SELECT permission for your WordPress database user to the Magento tables that start with wordpress_ or merge your WordPress and Magento databases.</p>';
173
+ echo '<p>If you are having trouble doing this or just want it handling quickly for you, FishPig offer a <a href="http://fishpig.co.uk/magento/wordpress-integration/services/merge-databases/?ref=errassoc" target="_blank">WordPress and Magento database merging</a> service.</p>';
174
+ exit;
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Add a custom filter for the in_product column
180
+ *
181
+ */
182
+ protected function _addColumnFilterToCollection($column)
183
+ {
184
+ if ($column->getId() === 'is_associated') {
185
+ $ids = $this->getSelectedWpItems();
186
+
187
+ if (empty($ids)) {
188
+ $ids = array(0);
189
+ }
190
+
191
+ $op = $column->getFilter()->getValue() ? 'in' : 'nin';
192
+
193
+ $this->getCollection()->addFieldToFilter("main_table." . $this->_getWpPrimaryKey(), array($op => $ids));
194
+ }
195
+ else {
196
+ parent::_addColumnFilterToCollection($column);
197
+ }
198
+
199
+ return $this;
200
+ }
201
+
202
+ /**
203
+ * Displays the tab if integration is valid
204
+ *
205
+ * @return true
206
+ */
207
+ public function canShowTab()
208
+ {
209
+ return $this->integrationIsEnabled() && (is_object($this->_getObject()) && $this->_getObject()->getId());
210
+ }
211
+
212
+ /**
213
+ * Determine whether integration is enabled
214
+ *
215
+ * @return bool
216
+ */
217
+ public function integrationIsEnabled()
218
+ {
219
+ return Mage::helper('wordpress/app')->getDbConnection() !== false;
220
+ }
221
+
222
+ /**
223
+ * Stops the tab being hidden
224
+ *
225
+ * @return bool
226
+ */
227
+ public function isHidden()
228
+ {
229
+ return false;
230
+ }
231
+
232
+ /**
233
+ * Retrieve the class name of the tab
234
+ *
235
+ * return string
236
+ */
237
+ public function getTabClass()
238
+ {
239
+ return 'ajax';
240
+ }
241
+
242
+ /**
243
+ * Determine whether to generate content on load or via AJAX
244
+ *
245
+ * @return bool
246
+ */
247
+ public function getSkipGenerateContent()
248
+ {
249
+ return true;
250
+ }
251
+
252
+ /**
253
+ * Retrieve the default sort
254
+ *
255
+ * @return string
256
+ */
257
+ protected function _getDefaultSort()
258
+ {
259
+ return 'assoc.position';
260
+ }
261
+
262
+ /**
263
+ * Retrieve the default sort direction
264
+ *
265
+ * @return string
266
+ */
267
+ protected function _getDefaultDir()
268
+ {
269
+ return 'asc';
270
+ }
271
+
272
+ /**
273
+ * Retrieve the parameters for the URL
274
+ *
275
+ * @return array
276
+ */
277
+ protected function _getUrlParams()
278
+ {
279
+ $params = array(
280
+ 'associations_type' => $this->getAssociationType(),
281
+ );
282
+
283
+ if ($this->_getObject()) {
284
+ $params['id'] = $this->_getObject()->getId();
285
+ }
286
+
287
+ if ($store = Mage::app()->getRequest()->getParam('store', false)) {
288
+ $params['store'] = $store;
289
+ }
290
+
291
+ return $params;
292
+ }
293
+
294
+ /**
295
+ * Retrieve the URL used to access the grid (AJAX)
296
+ *
297
+ * @return string
298
+ */
299
+ public function getCurrentUrl($params = array())
300
+ {
301
+ return $this->getUrl('adminhtml/wordpress_associations/gridRefresh', array('_query' => $this->_getUrlParams()));
302
+ }
303
+
304
+ /**
305
+ * Retrieve the URL used to load the tab content
306
+ *
307
+ * @return string
308
+ */
309
+ public function getTabUrl()
310
+ {
311
+ return $this->getUrl('adminhtml/wordpress_associations/grid', array('_query' => $this->_getUrlParams()));
312
+ }
313
+
314
+ /**
315
+ * Retrieve the Magento entity type
316
+ *
317
+ * @return string
318
+ */
319
+ protected function _getMagentoEntity()
320
+ {
321
+ return substr($this->getAssociationType(), 0, strpos($this->getAssociationType(), '/'));
322
+ }
323
+
324
+ /**
325
+ * Retrieve the WordPress entity type
326
+ *
327
+ * @return string
328
+ */
329
+ protected function _getWpEntity()
330
+ {
331
+ return substr($this->getAssociationType(), strpos($this->getAssociationType(), '/')+1);
332
+ }
333
+
334
+ /**
335
+ * Retrieve the WordPress entity primary key
336
+ *
337
+ * @return string
338
+ */
339
+ protected function _getWpPrimaryKey()
340
+ {
341
+ if ($this->_getWpEntity() === 'category') {
342
+ return 'term_id';
343
+ }
344
+
345
+ return 'ID';
346
+ }
347
+
348
+ /**
349
+ * Returns the current product model
350
+ *
351
+ * @return Mage_Catalog_Model_Product
352
+ */
353
+ protected function _getObject()
354
+ {
355
+ return Mage::registry($this->_getMagentoEntity());
356
+ }
357
+
358
+ /**
359
+ * Retrieve the label used for the tab relating to this block
360
+ *
361
+ * @return string
362
+ */
363
+ public function getTabLabel()
364
+ {
365
+ if ($this->_getWpEntity() === 'post') {
366
+ return $this->__('Associated Blog Posts');
367
+ }
368
+ else if ($this->_getWpEntity() === 'category') {
369
+ return $this->__('Associated Blog Categories');
370
+ }
371
+
372
+ return '';
373
+ }
374
+
375
+ /**
376
+ * Retrieve the title used by this tab
377
+ *
378
+ * @return string
379
+ */
380
+ public function getTabTitle()
381
+ {
382
+ return $this->getTabLabel();
383
+ }
384
+
385
+ /**
386
+ * Retrieve the store ID set in the controller
387
+ *
388
+ * @return int
389
+ */
390
+ public function getStoreId()
391
+ {
392
+ return Mage::app()->getFrontController()->getAction()->getStoreId();
393
+ }
394
+
395
+ public function getMultipleRows($item)
396
+ {
397
+ return false;
398
+ }
399
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Category/Category.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_Wordpress_Block_Adminhtml_Associations_Category_Category extends Fishpig_Wordpress_Block_Adminhtml_Associations_Abstract
10
+ {
11
+ /**
12
+ * Retrieve the association type for this grid
13
+ *
14
+ * @return string
15
+ */
16
+ public function getAssociationType()
17
+ {
18
+ return 'category/category';
19
+ }
20
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Category/Post.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_Wordpress_Block_Adminhtml_Associations_Category_Post extends Fishpig_Wordpress_Block_Adminhtml_Associations_Abstract
10
+ {
11
+ /**
12
+ * Retrieve the association type for this grid
13
+ *
14
+ * @return string
15
+ */
16
+ public function getAssociationType()
17
+ {
18
+ return 'category/post';
19
+ }
20
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Cms/Page/Category.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_Wordpress_Block_Adminhtml_Associations_Cms_Page_Category extends Fishpig_Wordpress_Block_Adminhtml_Associations_Abstract
10
+ {
11
+ /**
12
+ * Retrieve the association type for this grid
13
+ *
14
+ * @return string
15
+ */
16
+ public function getAssociationType()
17
+ {
18
+ return 'cms_page/category';
19
+ }
20
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Cms/Page/Post.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_Wordpress_Block_Adminhtml_Associations_Cms_Page_Post extends Fishpig_Wordpress_Block_Adminhtml_Associations_Abstract
10
+ {
11
+ /**
12
+ * Retrieve the association type for this grid
13
+ *
14
+ * @return string
15
+ */
16
+ public function getAssociationType()
17
+ {
18
+ return 'cms_page/post';
19
+ }
20
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Product/Category.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_Wordpress_Block_Adminhtml_Associations_Product_Category extends Fishpig_Wordpress_Block_Adminhtml_Associations_Abstract
10
+ {
11
+ /**
12
+ * Retrieve the association type for this grid
13
+ *
14
+ * @return string
15
+ */
16
+ public function getAssociationType()
17
+ {
18
+ return 'product/category';
19
+ }
20
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Associations/Product/Post.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_Wordpress_Block_Adminhtml_Associations_Product_Post extends Fishpig_Wordpress_Block_Adminhtml_Associations_Abstract
10
+ {
11
+ /**
12
+ * Retrieve the association type for this grid
13
+ *
14
+ * @return string
15
+ */
16
+ public function getAssociationType()
17
+ {
18
+ return 'product/post';
19
+ }
20
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Extend.php ADDED
@@ -0,0 +1,624 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @author Ben Tideswell <ben@fishpig.co.uk>
6
+ */
7
+
8
+ class Fishpig_Wordpress_Block_Adminhtml_Extend extends Mage_Core_Block_Text
9
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
10
+ {
11
+ /**
12
+ * Tracking string for GA
13
+ *
14
+ * @var const string
15
+ */
16
+ const TRACKING_STRING = '?utm_source=%s&utm_medium=%s&utm_term=%s&utm_campaign=Extend';
17
+
18
+ /**
19
+ * XML Data
20
+ *
21
+ * @var const string
22
+ */
23
+ const DATA = "<config><Fishpig_Bolt><url><![CDATA[magento/extensions/full-page-cache/]]></url><image>bolt.png</image><title>Bolt</title><subtitle>Full Page Cache</subtitle><short_definition>Add enterprise level caching to Magento community with Bolt, Magento's fastest Full Page Cache extension.</short_definition></Fishpig_Bolt><Fishpig_Opti><url><![CDATA[magento/extensions/minify/]]></url><image>opti.png</image><title>Opti</title><subtitle>Minify Magento</subtitle><short_definition>Opti automatically minifies your HTML, CSS and Javascript and works on any server.</short_definition></Fishpig_Opti><Fishpig_NoBots><url><![CDATA[magento/extensions/block-robots-stop-spam/]]></url><image>nobots.png</image><title>NoBots</title><subtitle>Stop Magento Spam Bots</subtitle><short_definition>NoBots automatically blocks spam bots from your website giving you less spam and a faster server.</short_definition></Fishpig_NoBots><Fishpig_CrossLink><url><![CDATA[magento/extensions/seo-internal-links/]]></url><image>crosslink.png</image><title>Crosslink</title><subtitle>SEO Internal Links</subtitle><short_definition>Automatically cross link your products, categories, splash pages, CMS pages, blog posts and categories using Crosslinks.</short_definition></Fishpig_CrossLink><Fishpig_AttributeSplashPro><url><![CDATA[magento/extensions/attribute-splash-pro/]]></url><image>splash-pro.png</image><title>AttributeSplash Pro</title><subtitle>SEO Landing Pages</subtitle><short_definition>Create SEO landing pages quickly and easily using AttributeSplash Pro. Decide which products you want to display based on multiple attribute filters, category filters and price filters.</short_definition></Fishpig_AttributeSplashPro><Fishpig_BasketShipping><url><![CDATA[magento/extensions/automatically-set-shipping-method/]]></url><image>basket-shipping.png</image><title>Basket Shipping</title><subtitle>Automatically set the Shipping Method</subtitle><short_definition>Automatically set the shipping method as soon as your customer hits your shopping cart.</short_definition></Fishpig_BasketShipping><Fishpig_Wordpress_Addon_Multisite><url><![CDATA[magento/wordpress-integration/multisite/]]></url><image>wordpress-multisite.png</image><title>Multisite Integration</title><subtitle>Add a blog to each store</subtitle><require_multistore>1</require_multistore><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_Multisite><Fishpig_Wordpress_Addon_Root><url><![CDATA[magento/wordpress-integration/root/]]></url><image>root.gif</image><title>Root</title><subtitle>Use WordPress to create CMS pages</subtitle><short_definition>Remove the blog sub-directory from your integrated blog URLs.</short_definition><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_Root><Fishpig_Wordpress_Addon_VisualComposer><url><![CDATA[magento/wordpress-integration/visual-composer/]]></url><image>visual-composer.png</image><title>Visual Composer</title><subtitle>Add sliders, image galleries and more</subtitle><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_VisualComposer><Fishpig_Wordpress_Addon_GravityForms><url><![CDATA[magento/wordpress-integration/gravity-forms/]]></url><image>gravity-forms.png</image><title>Gravity Forms</title><subtitle>Add awesome forms easily!</subtitle><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_GravityForms><Fishpig_Wordpress_Addon_Tablepress><url><![CDATA[magento/wordpress-integration/tablepress/]]></url><image>tablepress.png</image><title>TablePress</title><subtitle>Add tables from the WP Admin</subtitle><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_Tablepress><Fishpig_Wordpress_Addon_CPT><url><![CDATA[magento/wordpress-integration/post-types-taxonomies/]]></url><image>posttypes.png</image><title><![CDATA[Post Types &amp; Taxonomies]]></title><subtitle>Use post types and taxonomies</subtitle><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_CPT><Fishpig_Wordpress_Addon_ACF><url><![CDATA[magento/wordpress-integration/advanced-custom-fields/]]></url><image>advanced-custom-fields.png</image><title>Advanced Custom Fields</title><subtitle>Supports ACF Free and Pro</subtitle><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_ACF><Fishpig_Wordpress><url><![CDATA[magento/wordpress-integration/]]></url><image>wordpress.png</image><title>WordPress Integration</title><subtitle>WordPress blog integration</subtitle><short_definition>Manage multiple blogs from a single WordPress Admin and integrate each blog with a different Magento store view</short_definition><require_multistore>0</require_multistore></Fishpig_Wordpress><Fishpig_Wordpress_Addon_CS><url><![CDATA[magento/wordpress-integration/customer-synchronisation/]]></url><image>cs.png</image><title>Customer Synchronisation</title><subtitle>WordPress Single Sign-on</subtitle><short_definition>Synchronise WordPress users and Magento customers and provide a single login for your customers.</short_definition><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_CS><Fishpig_Wordpress_Addon_IntegratedSearch><url><![CDATA[magento/wordpress-integration/integrated-search/]]></url><image>integrated-search.png</image><title>Integrated Search</title><subtitle>Search products and posts</subtitle><short_definition>Integrate your Magento and WordPress search systems automatically and make searching your site easier for your customers.</short_definition><depends><Fishpig_Wordpress /></depends></Fishpig_Wordpress_Addon_IntegratedSearch><Fishpig_AttributeSplash_Addon_XmlSitemap><url><![CDATA[magento/extensions/attribute-splash-pages/xml-sitemap/]]></url><image>splash-pages.png</image><title>Attribute AttributeSplash</title><subtitle>XML Sitemap</subtitle><short_definition>Add an XML sitemap for your AttributeSplash Pages and AttributeSplash Group so search engines can index your pages.</short_definition><depends><Fishpig_AttributeSplash /></depends></Fishpig_AttributeSplash_Addon_XmlSitemap><Fishpig_AttributeSplash_Addon_QuickCreate><url><![CDATA[magento/extensions/attribute-splash-pages/quick-create/]]></url><image>splash-pages.png</image><title>Attribute AttributeSplash</title><subtitle>Quick Create</subtitle><short_definition>Quickly create AttributeSplash Pages for any attributes with this extension and save yourself from hours of manual work.</short_definition><depends><Fishpig_AttributeSplash /></depends></Fishpig_AttributeSplash_Addon_QuickCreate></config>";
24
+
25
+ /**
26
+ * Base URL for links
27
+ *
28
+ * @var const string
29
+ */
30
+ const BASE_URL = 'http://fishpig.co.uk/';
31
+
32
+ /**
33
+ * The URL for the S3 bucket for images
34
+ *
35
+ * @var const string
36
+ */
37
+ const S3_BUCKET_URL = 'https://s3.amazonaws.com/FishPig-Extend/image/';
38
+
39
+ /**
40
+ * Cache for all available extensions
41
+ *
42
+ * @var array
43
+ */
44
+ static protected $_extensions = null;
45
+
46
+ /**
47
+ *
48
+ * @return
49
+ */
50
+ protected function _construct()
51
+ {
52
+ $this->setTemplate('small.phtml');
53
+
54
+ return parent::_construct();
55
+ }
56
+
57
+ /**
58
+ *
59
+ * @return
60
+ */
61
+ protected function _beforeToHtml()
62
+ {
63
+ if ($this->getTemplate() === 'small.phtml') {
64
+ $this->_setTextForSmallTemplate();
65
+ }
66
+ else if ($this->getTemplate() === 'large.phtml') {
67
+ $this->_setTextForLargeTemplate();
68
+ }
69
+
70
+ return parent::_beforeToHtml();
71
+ }
72
+
73
+ /**
74
+ *
75
+ * @return
76
+ */
77
+ protected function _setTextForLargeTemplate()
78
+ {
79
+ if ($extensions = $this->getSelectedExtensions()) {
80
+ $html = '';
81
+
82
+ foreach($extensions as $extension) {
83
+ $innerHtml = $this->_createHtmlElement('a', array(
84
+ 'href' => $this->getTrackedUrl($extension, $this->getModule(), 'image'),
85
+ 'class' => 'image'
86
+ ),
87
+ $this->_createHtmlElement('img', array('src' => $this->getImageUrl($extension)))
88
+ )
89
+ . $this->_createHtmlElement('h2', array(),
90
+ $this->_createHtmlElement('a', $this->getTrackedUrl($extension, $this->getModule(), 'title'),
91
+ $this->_createHtmlElement('strong', null, $this->escapeHtml($this->getTitle($extension)))
92
+ . ' ' . $this->_createHtmlElement('span', null, $this->escapeHtml($this->getSubTitle($extension)))
93
+ ))
94
+ . $this->_createHtmlElement('p', null, $this->getShortDefinition($extension))
95
+ . $this->_createHtmlElement('div', null, $this->_createHtmlElement('a', $this->getTrackedUrl($extension, $this->getModule(), 'view-more'), 'View Add-On'));
96
+
97
+ $html .= $this->_createHtmlElement(
98
+ 'li',
99
+ array('class' => 'item' . ($this->isLast($extension) ? ' last' : '')),
100
+ $this->_createHtmlElement('div', array('class' => 'pad'), $innerHtml)
101
+ );
102
+ }
103
+
104
+ $html = $this->_createHtmlElement('div', array('id' => $this->getId()), $this->_createHtmlElement('ul', null, $html));
105
+
106
+ $html .= $this->_createHtmlElement(
107
+ 'style',
108
+ array('type' => 'text/css'),
109
+ str_replace("{{ID}}", $this->getId(), "#{{ID}} { max-width: 1600px; margin: 50px auto 0; }
110
+ #{{ID}} ul { /*height: 1%; overflow: hidden; */text-align: center; }
111
+ #{{ID}} li.item { display: inline-block; width: 24.5%; }
112
+ #{{ID}} li.item .pad { padding: 10% 8%; border-right: 1px solid #ccc; }
113
+ #{{ID}} li.item.last .pad { border-right: 0px none; }
114
+ #{{ID}} li.item .image { display: block; margin-bottom: 10px; }
115
+ #{{ID}} h2 a { color: #000; text-decoration: none; font-family: Tahoma, Verdana, Arial;, }
116
+ #{{ID}} h2 strong { display: block; text-transform: uppercase; line-height: 1em; }
117
+ #{{ID}} h2 span { font-size: 70%; font-family: Georgia, 'Times New Roman'; font-style: italic; }
118
+ #{{ID}} p { min-height: 80px; }"));
119
+
120
+ $this->setText($html);
121
+ }
122
+
123
+ return $this;
124
+ }
125
+
126
+ /**
127
+ *
128
+ * @return
129
+ */
130
+ protected function _setTextForSmallTemplate()
131
+ {
132
+ if ($extensions = $this->getSelectedExtensions()) {
133
+ $html = '';
134
+
135
+ foreach($extensions as $extension) {
136
+ $innerHtml = $this->_createHtmlElement('a', array(
137
+ 'href' => $this->getTrackedUrl($extension, $this->getModule(), 'image'),
138
+ ),
139
+ $this->_createHtmlElement('img', array('src' => $this->getImageUrl($extension)))
140
+ . $this->_createHtmlElement('span', null, $this->escapeHtml($this->getTitle($extension)))
141
+ )
142
+ .$this->_createHtmlElement('p', array(
143
+
144
+
145
+
146
+ ), $this->escapeHtml($this->getSubtitle($extension)));
147
+
148
+
149
+
150
+ $html .= $this->_createHtmlElement(
151
+ 'li',
152
+ array('class' => 'item' . ($this->isLast($extension) ? ' last' : '')),
153
+ $this->_createHtmlElement('div', array('class' => 'pad'), $innerHtml)
154
+ );
155
+ }
156
+
157
+ $html = $this->_createHtmlElement('div', array('id' => $this->getId()), $this->_createHtmlElement('ul', null, $html));
158
+ $html .= $this->_createHtmlElement('script', array('type' => 'text/javascript'), "decorateList($('" . $this->getId() . "').select('ul').first());");
159
+
160
+ $html .= $this->_createHtmlElement(
161
+ 'style',
162
+ array('type' => 'text/css'),
163
+ str_replace("{{ID}}", $this->getId(), "#{{ID}} { margin: 0; }
164
+ #{{ID}} ul { height: 1%; overflow: hidden; }
165
+ #{{ID}} li.item { margin: 0 0 10px; width: 16.5%; float: left; border-right:1px solid #ddd; }
166
+ #{{ID}} li.item.last { border-right: 0; }
167
+ #{{ID}} li.item .pad {padding: 10px; height: 1%; overflow: hidden; margin: 0 5px 0 0; }
168
+ #{{ID}} li.item.even .pad { margin: 0 0 0 5px; }
169
+ #{{ID}} li.item a { display: block; text-align: center; text-decoration: none; }
170
+ #{{ID}} li.item img { max-height: 60px; }
171
+ #{{ID}} li.item a span { font-size: 14px; font-family: Tahoma, Verdana, Arial; line-height: 1em; margin: 5px 0 2px; display: block;}
172
+ #{{ID}} li.item p { text-align: center; } "));
173
+
174
+ $this->setText($html);
175
+ }
176
+
177
+ return $this;
178
+ }
179
+
180
+ /**
181
+ * Retrieve extensions set via XML
182
+ *
183
+ * @return array
184
+ */
185
+ public function getSelectedExtensions()
186
+ {
187
+ return $this->getExtensions($this->getLimit(), $this->getPreferred() ? ($this->getPreferred()) : null);
188
+ }
189
+
190
+ /**
191
+ * Retrieve the available extensions taking into account $count and $pref
192
+ *
193
+ * @param int $count = 0
194
+ * @param array $pref = array()
195
+ * @return false|array
196
+ */
197
+ public function getExtensions($count = 0, array $pref = array(), $rand = false)
198
+ {
199
+ if (!isset($pref[0])) {
200
+ $pref = array_keys($pref);
201
+ }
202
+
203
+ if (($pool = $this->_getAllExtensions()) !== false) {
204
+ $winners = array();
205
+
206
+ foreach($pref as $code) {
207
+ if (isset($pool[$code])) {
208
+ $winners[$code] = $pool[$code];
209
+ unset($pool[$code]);
210
+ }
211
+
212
+ if (!$rand && $count > 0 && count($winners) >= $count) {
213
+ break;
214
+ }
215
+ }
216
+
217
+ if ($rand) {
218
+ $winners = $this->shuffleArray($winners);
219
+
220
+ if ($count > 0 && count($winners) > $count) {
221
+ $xcount = count($winners);
222
+
223
+ while($xcount-- > $count) {
224
+ array_pop($winners);
225
+ }
226
+ }
227
+ }
228
+
229
+ while(count($winners) < $count && count($pool) > 0) {
230
+ $code = key($pool);
231
+
232
+ $winners[$code] = $pool[$code];
233
+ unset($pool[$code]);
234
+ }
235
+
236
+ end($winners);
237
+
238
+ $winners[key($winners)]['last'] = true;
239
+
240
+ return $winners;
241
+ }
242
+
243
+ return false;
244
+ }
245
+
246
+ /**
247
+ * Retrieve all of the available extensions
248
+ *
249
+ * @return array
250
+ */
251
+ protected function _getAllExtensions()
252
+ {
253
+ if (!is_null(self::$_extensions)) {
254
+ return self::$_extensions;
255
+ }
256
+
257
+ $installedModules = array_keys((array)$this->_getConfig()->getNode('modules'));
258
+
259
+ $config = json_decode(json_encode(simplexml_load_string(self::DATA, null, LIBXML_NOCDATA)), true);
260
+ self::$_extensions = array();
261
+
262
+ foreach($config as $code => $extension) {
263
+ $extension['module'] = $code;
264
+ $reqMultistore = isset($extension['require_multistore']) ? (int)$extension['require_multistore'] : null;
265
+
266
+ if (in_array($code, $installedModules)) {
267
+ continue;
268
+ }
269
+ else if (!is_null($reqMultistore) && $reqMultistore === (int)Mage::app()->isSingleStoreMode()) {
270
+ continue;
271
+ }
272
+ else if (isset($extension['depends'])) {
273
+ $depends = array_keys((array)$extension['depends']);
274
+
275
+ if (count(array_diff($depends, $installedModules)) > 0) {
276
+ continue;
277
+ }
278
+ }
279
+
280
+ self::$_extensions[$code] = (array)$extension;
281
+ }
282
+
283
+ if (count(self::$_extensions) === 0) {
284
+ self::$_extensions = false;
285
+ }
286
+
287
+ return self::$_extensions;
288
+ }
289
+
290
+ /**
291
+ * Retrieve the title of the extension
292
+ *
293
+ * @param array $e
294
+ * @return string
295
+ */
296
+ public function getTitle(array $e = null)
297
+ {
298
+ // Being called as a tab
299
+ if (is_null($e)) {
300
+ return $this->_getData('title');
301
+ }
302
+
303
+ return $this->_getField($e, 'title');
304
+ }
305
+
306
+ /**
307
+ * Retrieve the subtitle of the extension
308
+ *
309
+ * @param array $e
310
+ * @return string
311
+ */
312
+ public function getSubTitle(array $e)
313
+ {
314
+ return $this->_getField($e, 'subtitle');
315
+ }
316
+
317
+ /**
318
+ * Rertrieve the URL for $e with the tracking code
319
+ *
320
+ * @param array $e
321
+ * @param string $campaign
322
+ * @param string $source
323
+ * @param string $medium
324
+ * @return string
325
+ */
326
+ public function getTrackedUrl(array $e, $source, $content = null)
327
+ {
328
+ $term = $this->_getField($e, 'module');
329
+
330
+ $trackedUrl = sprintf(self::BASE_URL . $this->_getField($e, 'url') . self::TRACKING_STRING, $source, $this->getMedium(), $term);
331
+
332
+ if (!is_null($content)) {
333
+ $trackedUrl .= '&utm_content=' . $content;
334
+ }
335
+
336
+ return $trackedUrl;
337
+ }
338
+
339
+ /**
340
+ * Retrieve the utm_medium parameter
341
+ *
342
+ * @return string
343
+ */
344
+ public function getMedium()
345
+ {
346
+ return $this->_getData('medium')
347
+ ? $this->_getData('medium')
348
+ : 'Magento Admin';
349
+ }
350
+
351
+ /**
352
+ * Retrieve the short definition of the extension
353
+ *
354
+ * @param array $e
355
+ * @return string
356
+ */
357
+ public function getShortDefinition(array $e)
358
+ {
359
+ return $this->_getField($e, 'short_definition');
360
+ }
361
+
362
+ /**
363
+ * Retrieve the image URL of the extension
364
+ *
365
+ * @param array $e
366
+ * @return string
367
+ */
368
+ public function getImageUrl(array $e)
369
+ {
370
+ return self::S3_BUCKET_URL . $this->_getField($e, 'image');
371
+ }
372
+
373
+ /**
374
+ * Retrieve a field from the extension
375
+ *
376
+ * @param array $e
377
+ * @param string $field
378
+ * @return string
379
+ */
380
+ protected function _getField(array $e, $field)
381
+ {
382
+ return $e && is_array($e) && isset($e[$field]) ? $e[$field] : '';
383
+ }
384
+
385
+ /**
386
+ * Determine wether $e is the last $e in the array
387
+ *
388
+ * @param array $e
389
+ * @return bool
390
+ */
391
+ public function isLast(array $e)
392
+ {
393
+ return $this->_getField($e, 'last') === true;
394
+ }
395
+
396
+ /**
397
+ * Retrieve the Magento config model
398
+ *
399
+ * @return Mage_Core_Model_Config
400
+ */
401
+ protected function _getConfig()
402
+ {
403
+ return Mage::app()->getConfig();
404
+ }
405
+
406
+ /**
407
+ * Retrieve the ID
408
+ *
409
+ * @return string
410
+ */
411
+ public function getId()
412
+ {
413
+ if (!$this->_getData('id')) {
414
+ $this->setId('fp-extend-' . rand(1111, 9999));
415
+ }
416
+
417
+ return $this->_getData('id');
418
+ }
419
+
420
+ /**
421
+ * Retrieve the full path to the template
422
+ *
423
+ * @return string
424
+ */
425
+ public function getTemplateFile()
426
+ {
427
+ if (($dir = $this->_getFPAdminDir()) !== false) {
428
+ return $dir . 'template' . DS . $this->getTemplate();
429
+ }
430
+ }
431
+
432
+ /**
433
+ * Set the template include path
434
+ *
435
+ * @param string $dir
436
+ * @return $this
437
+ */
438
+ public function setScriptPath($dir)
439
+ {
440
+ $this->_viewDir = '';
441
+
442
+ return $this;
443
+ }
444
+
445
+ /**
446
+ * Retrieve any available FPAdmin directory
447
+ *
448
+ * @return false|string
449
+ */
450
+ protected function _getFPAdminDir()
451
+ {
452
+ $candidates = array(
453
+ $this->getModule(),
454
+ 'Fishpig_Wordpress',
455
+ 'Fishpig_AttributeSplash',
456
+ 'Fishpig_iBanners'
457
+ );
458
+
459
+ foreach(array_unique($candidates) as $candidate) {
460
+ if (!$candidate) {
461
+ continue;
462
+ }
463
+
464
+ $dir = Mage::getModuleDir('', $candidate) . DS . 'FPAdmin' . DS;
465
+
466
+ if (is_dir($dir)) {
467
+ return $dir;
468
+ }
469
+ }
470
+
471
+ return false;
472
+ }
473
+
474
+ /**
475
+ * If tab, always show
476
+ *
477
+ * @return bool
478
+ */
479
+ public function canShowTab()
480
+ {
481
+ return true;
482
+ }
483
+
484
+ /**
485
+ * Don't hide if a tab
486
+ *
487
+ * @return bool
488
+ */
489
+ public function isHidden()
490
+ {
491
+ return false;
492
+ }
493
+
494
+ /**
495
+ * Retrieve the tab title
496
+ *
497
+ * @return string
498
+ */
499
+ public function getTabTitle()
500
+ {
501
+ return $this->getTabLabel();
502
+ }
503
+
504
+ /**
505
+ * Retrieve the tab label
506
+ *
507
+ * @return string
508
+ */
509
+ public function getTabLabel()
510
+ {
511
+ return $this->_getData('tab_label');
512
+ }
513
+
514
+ /**
515
+ * Determine whether to skip generate content
516
+ *
517
+ * @return bool
518
+ */
519
+ public function getSkipGenerateContent()
520
+ {
521
+ return true;
522
+ }
523
+
524
+ /**
525
+ * Retrieve the tab class name
526
+ *
527
+ * @return string
528
+ */
529
+ public function getTabClass()
530
+ {
531
+ if ($this->getSkipGenerateContent()) {
532
+ return 'ajax';
533
+ }
534
+
535
+ return parent::getTabClass();
536
+ }
537
+
538
+ /**
539
+ * Retrieve the URL used to load the tab content
540
+ *
541
+ * @return string
542
+ */
543
+ public function getTabUrl()
544
+ {
545
+ if ($tabUrl = $this->_getData('tab_url')) {
546
+ return $this->getUrl($tabUrl);
547
+ }
548
+
549
+ return '#';
550
+ }
551
+
552
+ /**
553
+ * Legacy fix that stops the HTML output from displaying
554
+ *
555
+ * @param string $fileName
556
+ * @return string
557
+ */
558
+ public function fetchView($fileName)
559
+ {
560
+ return is_file($fileName)
561
+ ? parent::fetchView($fileName)
562
+ : '';
563
+ }
564
+
565
+ /**
566
+ * Shuffle an array and preserve the keys
567
+ *
568
+ * @param array $a
569
+ * @return array
570
+ */
571
+ public function shuffleArray(array $a)
572
+ {
573
+ $keys = array_keys($a);
574
+
575
+ shuffle($keys);
576
+
577
+ $random = array();
578
+
579
+ foreach ($keys as $key) {
580
+ $random[$key] = $a[$key];
581
+ }
582
+
583
+ return $random;
584
+ }
585
+
586
+ /**
587
+ * Create a HTML element
588
+ *
589
+ * @param string $element
590
+ * @param string|array|null $params = array
591
+ * @param string $content = ''
592
+ * @return string
593
+ */
594
+ protected function _createHtmlElement($element, $params = array(), $content = '')
595
+ {
596
+ if (is_null($params)) {
597
+ $params = array();
598
+ }
599
+
600
+ if (!is_array($params)) {
601
+ if ($element === 'a') {
602
+ $params = array('href' => $params);
603
+ }
604
+ else if ($element === 'img') {
605
+ $params = array('img' => $params);
606
+ }
607
+ }
608
+
609
+ if ($element === 'a') {
610
+ $params = array_merge($params, array('target' => '_blank'));
611
+ }
612
+ else if ($element === 'img') {
613
+ $params = array_merge($params, array('alt' => ''));
614
+ }
615
+
616
+ foreach($params as $key => $value) {
617
+ $params[$key] = sprintf('%s="%s"', $key, $value);
618
+ }
619
+
620
+ $closer = in_array($element, array('img')) ? '' : '</' . $element . '>';
621
+
622
+ return sprintf('<%s%s>%s%s', $element, count($params) > 0 ? ' ' . implode(' ', $params) : '', $content, $closer);
623
+ }
624
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/Frontend/Autologin.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_Wordpress_Block_Adminhtml_Frontend_Autologin extends Mage_Adminhtml_Block_System_Config_Form_Field
10
+ {
11
+ /**
12
+ * Singleton flag
13
+ *
14
+ * @var bool
15
+ */
16
+ static $_singleton = false;
17
+
18
+ /**
19
+ * If cannot display fields, display error message
20
+ *
21
+ * @param Varien_Data_Form_Element_Abstract $element
22
+ * @return string|false
23
+ */
24
+ public function render(Varien_Data_Form_Element_Abstract $element)
25
+ {
26
+ $version = Mage::getVersion();
27
+
28
+ if (version_compare($version, '1.5.9.9', '<') && version_compare($version, '1.3.0.0', '>')) {
29
+ if (self::$_singleton === false) {
30
+ self::$_singleton = true;
31
+
32
+ return '<tr>
33
+ <td class="comment" colspan="3"><em>This feature is not supported with your version of Magento.</em></td>
34
+ </tr>';
35
+ }
36
+
37
+ return false;
38
+ }
39
+
40
+ return parent::render($element);
41
+ }
42
+ }
app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block app/code/community/Fishpig/Wordpress/Block/Adminhtml/System/Config/Form/Field/Route.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_Wordpress
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_Wordpress_Block_Adminhtml_System_Config_Form_Field_Route extends Mage_Adminhtml_Block_System_Config_Form_Field
10
+ {
11
+ /**
12
+ * Retrieve the HTML for the element
13
+ *
14
+ * @param Varien_Data_Form_Element_Abstract $element
15
+ * @return string
16
+ */
17
+