simicart_0116 - Version 4.0.0

Version Notes

4.0 Stable Version

Download this release

Release Info

Developer Hải Tạ Hoàng
Extension simicart_0116
Version 4.0.0
Comparing to
See all releases


Version 4.0.0

Files changed (245) hide show
  1. app/code/local/Simi/Simiconnector/.DS_Store +0 -0
  2. app/code/local/Simi/Simiconnector/Block/.DS_Store +0 -0
  3. app/code/local/Simi/Simiconnector/Block/Adminhtml/.DS_Store +0 -0
  4. app/code/local/Simi/Simiconnector/Block/Adminhtml/Appreport.php +30 -0
  5. app/code/local/Simi/Simiconnector/Block/Adminhtml/Appreport/Grid.php +159 -0
  6. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner.php +38 -0
  7. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit.php +100 -0
  8. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Form.php +45 -0
  9. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tab/Categories.php +106 -0
  10. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tab/Form.php +271 -0
  11. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tab/Products.php +166 -0
  12. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tab/Renderer/Sku.php +53 -0
  13. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tabs.php +44 -0
  14. app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Grid.php +173 -0
  15. app/code/local/Simi/Simiconnector/Block/Adminhtml/Cms.php +15 -0
  16. app/code/local/Simi/Simiconnector/Block/Adminhtml/Cms/Edit.php +74 -0
  17. app/code/local/Simi/Simiconnector/Block/Adminhtml/Cms/Edit/Form.php +45 -0
  18. app/code/local/Simi/Simiconnector/Block/Adminhtml/Cms/Edit/Tab/Form.php +172 -0
  19. app/code/local/Simi/Simiconnector/Block/Adminhtml/Cms/Edit/Tabs.php +44 -0
  20. app/code/local/Simi/Simiconnector/Block/Adminhtml/Cms/Grid.php +101 -0
  21. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device.php +15 -0
  22. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Edit.php +42 -0
  23. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Edit/.DS_Store +0 -0
  24. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Edit/Form.php +24 -0
  25. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Edit/Renderer/Datetime.php +28 -0
  26. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Edit/Renderer/Selectname.php +31 -0
  27. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Edit/Tab/.DS_Store +0 -0
  28. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Edit/Tab/Form.php +92 -0
  29. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Edit/Tabs.php +27 -0
  30. app/code/local/Simi/Simiconnector/Block/Adminhtml/Device/Grid.php +181 -0
  31. app/code/local/Simi/Simiconnector/Block/Adminhtml/Grid/Renderer/Date.php +12 -0
  32. app/code/local/Simi/Simiconnector/Block/Adminhtml/Grid/Renderer/Device.php +9 -0
  33. app/code/local/Simi/Simiconnector/Block/Adminhtml/Grid/Renderer/Edit.php +11 -0
  34. app/code/local/Simi/Simiconnector/Block/Adminhtml/Grid/Renderer/Osystem.php +18 -0
  35. app/code/local/Simi/Simiconnector/Block/Adminhtml/Grid/Renderer/Website.php +9 -0
  36. app/code/local/Simi/Simiconnector/Block/Adminhtml/History.php +16 -0
  37. app/code/local/Simi/Simiconnector/Block/Adminhtml/History/Edit.php +78 -0
  38. app/code/local/Simi/Simiconnector/Block/Adminhtml/History/Edit/Form.php +24 -0
  39. app/code/local/Simi/Simiconnector/Block/Adminhtml/History/Edit/Tab/Form.php +124 -0
  40. app/code/local/Simi/Simiconnector/Block/Adminhtml/History/Edit/Tabs.php +24 -0
  41. app/code/local/Simi/Simiconnector/Block/Adminhtml/History/Grid.php +161 -0
  42. app/code/local/Simi/Simiconnector/Block/Adminhtml/Productlist.php +19 -0
  43. app/code/local/Simi/Simiconnector/Block/Adminhtml/Productlist/Edit.php +76 -0
  44. app/code/local/Simi/Simiconnector/Block/Adminhtml/Productlist/Edit/Form.php +28 -0
  45. app/code/local/Simi/Simiconnector/Block/Adminhtml/Productlist/Edit/Tab/Form.php +302 -0
  46. app/code/local/Simi/Simiconnector/Block/Adminhtml/Productlist/Edit/Tab/Products.php +138 -0
  47. app/code/local/Simi/Simiconnector/Block/Adminhtml/Productlist/Edit/Tab/Renderer/Sku.php +53 -0
  48. app/code/local/Simi/Simiconnector/Block/Adminhtml/Productlist/Edit/Tabs.php +44 -0
  49. app/code/local/Simi/Simiconnector/Block/Adminhtml/Productlist/Grid.php +101 -0
  50. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode.php +13 -0
  51. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit.php +59 -0
  52. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/.DS_Store +0 -0
  53. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Form.php +20 -0
  54. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Renderer/.DS_Store +0 -0
  55. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Renderer/Barcodecustom.php +43 -0
  56. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Renderer/Datetime.php +31 -0
  57. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Renderer/Qrcodecustom.php +43 -0
  58. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Renderer/Select.php +46 -0
  59. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Tab/Form.php +75 -0
  60. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Tab/Products.php +245 -0
  61. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Edit/Tabs.php +32 -0
  62. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simibarcode/Grid.php +128 -0
  63. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simicategory.php +19 -0
  64. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simicategory/Edit.php +42 -0
  65. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simicategory/Edit/Form.php +19 -0
  66. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simicategory/Edit/Tab/Form.php +198 -0
  67. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simicategory/Edit/Tabs.php +21 -0
  68. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simicategory/Grid.php +108 -0
  69. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification.php +14 -0
  70. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/.DS_Store +0 -0
  71. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit.php +102 -0
  72. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Form.php +24 -0
  73. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Tab/.DS_Store +0 -0
  74. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Tab/Categories.php +75 -0
  75. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Tab/Devices.php +187 -0
  76. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Tab/Form.php +388 -0
  77. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Tab/Products.php +134 -0
  78. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Tab/Renderer/Devices.php +23 -0
  79. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Tab/Renderer/Sku.php +21 -0
  80. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Edit/Tabs.php +21 -0
  81. app/code/local/Simi/Simiconnector/Block/Adminhtml/Siminotification/Grid.php +135 -0
  82. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simiproductlabel.php +12 -0
  83. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simiproductlabel/Edit.php +45 -0
  84. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simiproductlabel/Edit/Form.php +20 -0
  85. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simiproductlabel/Edit/Tab/Form.php +191 -0
  86. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simiproductlabel/Edit/Tab/Products.php +132 -0
  87. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simiproductlabel/Edit/Tab/Render.php +18 -0
  88. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simiproductlabel/Edit/Tabs.php +26 -0
  89. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simiproductlabel/Grid.php +107 -0
  90. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simivideo.php +12 -0
  91. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simivideo/Edit.php +45 -0
  92. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simivideo/Edit/Form.php +20 -0
  93. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simivideo/Edit/Tab/Form.php +140 -0
  94. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simivideo/Edit/Tab/Products.php +132 -0
  95. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simivideo/Edit/Tab/Render.php +18 -0
  96. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simivideo/Edit/Tabs.php +26 -0
  97. app/code/local/Simi/Simiconnector/Block/Adminhtml/Simivideo/Grid.php +115 -0
  98. app/code/local/Simi/Simiconnector/Block/Adminhtml/System/Config/Category/Categories.php +61 -0
  99. app/code/local/Simi/Simiconnector/Block/Adminhtml/System/Config/Category/Categorytree.php +10 -0
  100. app/code/local/Simi/Simiconnector/Block/Adminhtml/System/Config/Form/Field/Separator.php +28 -0
  101. app/code/local/Simi/Simiconnector/Block/Adminhtml/Web/Switcher.php +258 -0
  102. app/code/local/Simi/Simiconnector/Block/Catalog/Bundle.php +148 -0
  103. app/code/local/Simi/Simiconnector/Block/Simicategory.php +8 -0
  104. app/code/local/Simi/Simiconnector/Controller/Action.php +99 -0
  105. app/code/local/Simi/Simiconnector/Helper/.DS_Store +0 -0
  106. app/code/local/Simi/Simiconnector/Helper/Address.php +284 -0
  107. app/code/local/Simi/Simiconnector/Helper/Bundle/Price.php +423 -0
  108. app/code/local/Simi/Simiconnector/Helper/Bundle/Tierprice.php +24 -0
  109. app/code/local/Simi/Simiconnector/Helper/Checkout.php +204 -0
  110. app/code/local/Simi/Simiconnector/Helper/Checkout/Payment.php +216 -0
  111. app/code/local/Simi/Simiconnector/Helper/Checkout/Shipping.php +70 -0
  112. app/code/local/Simi/Simiconnector/Helper/Cloud.php +53 -0
  113. app/code/local/Simi/Simiconnector/Helper/Coupon.php +32 -0
  114. app/code/local/Simi/Simiconnector/Helper/Customer.php +72 -0
  115. app/code/local/Simi/Simiconnector/Helper/Data.php +83 -0
  116. app/code/local/Simi/Simiconnector/Helper/Options.php +40 -0
  117. app/code/local/Simi/Simiconnector/Helper/Options/Bundle.php +20 -0
  118. app/code/local/Simi/Simiconnector/Helper/Options/Configurable.php +23 -0
  119. app/code/local/Simi/Simiconnector/Helper/Options/Download.php +93 -0
  120. app/code/local/Simi/Simiconnector/Helper/Options/Grouped.php +73 -0
  121. app/code/local/Simi/Simiconnector/Helper/Options/Simple.php +84 -0
  122. app/code/local/Simi/Simiconnector/Helper/Orders.php +131 -0
  123. app/code/local/Simi/Simiconnector/Helper/Plugins/Instantcontact.php +52 -0
  124. app/code/local/Simi/Simiconnector/Helper/Price.php +399 -0
  125. app/code/local/Simi/Simiconnector/Helper/Productlabel.php +61 -0
  126. app/code/local/Simi/Simiconnector/Helper/Productlist.php +286 -0
  127. app/code/local/Simi/Simiconnector/Helper/Products.php +338 -0
  128. app/code/local/Simi/Simiconnector/Helper/Review.php +190 -0
  129. app/code/local/Simi/Simiconnector/Helper/Simibarcode.php +216 -0
  130. app/code/local/Simi/Simiconnector/Helper/Siminotification.php +312 -0
  131. app/code/local/Simi/Simiconnector/Helper/Simivideo.php +26 -0
  132. app/code/local/Simi/Simiconnector/Helper/Tierprice.php +303 -0
  133. app/code/local/Simi/Simiconnector/Helper/Total.php +189 -0
  134. app/code/local/Simi/Simiconnector/Helper/Wishlist.php +218 -0
  135. app/code/local/Simi/Simiconnector/Model/.DS_Store +0 -0
  136. app/code/local/Simi/Simiconnector/Model/Address.php +79 -0
  137. app/code/local/Simi/Simiconnector/Model/Api/Abstract.php +306 -0
  138. app/code/local/Simi/Simiconnector/Model/Api/Addresses.php +146 -0
  139. app/code/local/Simi/Simiconnector/Model/Api/Categories.php +81 -0
  140. app/code/local/Simi/Simiconnector/Model/Api/Cmspages.php +21 -0
  141. app/code/local/Simi/Simiconnector/Model/Api/Customers.php +92 -0
  142. app/code/local/Simi/Simiconnector/Model/Api/Devices.php +30 -0
  143. app/code/local/Simi/Simiconnector/Model/Api/Downloadableproducts.php +92 -0
  144. app/code/local/Simi/Simiconnector/Model/Api/Homebanners.php +62 -0
  145. app/code/local/Simi/Simiconnector/Model/Api/Homecategories.php +98 -0
  146. app/code/local/Simi/Simiconnector/Model/Api/Homeproductlists.php +80 -0
  147. app/code/local/Simi/Simiconnector/Model/Api/Homes.php +61 -0
  148. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Abstract.php +81 -0
  149. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Categories.php +41 -0
  150. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Categorytrees.php +33 -0
  151. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Customers.php +13 -0
  152. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Orders.php +13 -0
  153. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Packages.php +48 -0
  154. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Products.php +14 -0
  155. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Stores.php +13 -0
  156. app/code/local/Simi/Simiconnector/Model/Api/Migrate/Storeviews.php +13 -0
  157. app/code/local/Simi/Simiconnector/Model/Api/Notifications.php +73 -0
  158. app/code/local/Simi/Simiconnector/Model/Api/Orders.php +309 -0
  159. app/code/local/Simi/Simiconnector/Model/Api/Products.php +285 -0
  160. app/code/local/Simi/Simiconnector/Model/Api/Quoteitems.php +275 -0
  161. app/code/local/Simi/Simiconnector/Model/Api/Reviews.php +196 -0
  162. app/code/local/Simi/Simiconnector/Model/Api/Simibarcodes.php +20 -0
  163. app/code/local/Simi/Simiconnector/Model/Api/Simivideos.php +23 -0
  164. app/code/local/Simi/Simiconnector/Model/Api/Stores.php +34 -0
  165. app/code/local/Simi/Simiconnector/Model/Api/Storeviews.php +296 -0
  166. app/code/local/Simi/Simiconnector/Model/Api/Wishlistitems.php +175 -0
  167. app/code/local/Simi/Simiconnector/Model/Appreport.php +10 -0
  168. app/code/local/Simi/Simiconnector/Model/Banner.php +84 -0
  169. app/code/local/Simi/Simiconnector/Model/Cms.php +74 -0
  170. app/code/local/Simi/Simiconnector/Model/Config/Source/Addressrequiretype.php +21 -0
  171. app/code/local/Simi/Simiconnector/Model/Config/Source/Productsviewtype.php +17 -0
  172. app/code/local/Simi/Simiconnector/Model/Config/Source/Qrcodetypes.php +40 -0
  173. app/code/local/Simi/Simiconnector/Model/Config/Source/Showandhideoption.php +59 -0
  174. app/code/local/Simi/Simiconnector/Model/Customer.php +240 -0
  175. app/code/local/Simi/Simiconnector/Model/Device.php +69 -0
  176. app/code/local/Simi/Simiconnector/Model/History.php +18 -0
  177. app/code/local/Simi/Simiconnector/Model/Mysql4/Appreport.php +26 -0
  178. app/code/local/Simi/Simiconnector/Model/Mysql4/Appreport/Collection.php +10 -0
  179. app/code/local/Simi/Simiconnector/Model/Mysql4/Banner.php +27 -0
  180. app/code/local/Simi/Simiconnector/Model/Mysql4/Banner/Collection.php +30 -0
  181. app/code/local/Simi/Simiconnector/Model/Mysql4/Cms.php +12 -0
  182. app/code/local/Simi/Simiconnector/Model/Mysql4/Cms/Collection.php +13 -0
  183. app/code/local/Simi/Simiconnector/Model/Mysql4/Device.php +12 -0
  184. app/code/local/Simi/Simiconnector/Model/Mysql4/Device/Collection.php +13 -0
  185. app/code/local/Simi/Simiconnector/Model/Mysql4/History.php +11 -0
  186. app/code/local/Simi/Simiconnector/Model/Mysql4/History/Collection.php +14 -0
  187. app/code/local/Simi/Simiconnector/Model/Mysql4/Productlist.php +12 -0
  188. app/code/local/Simi/Simiconnector/Model/Mysql4/Productlist/Collection.php +13 -0
  189. app/code/local/Simi/Simiconnector/Model/Mysql4/Simibarcode.php +9 -0
  190. app/code/local/Simi/Simiconnector/Model/Mysql4/Simibarcode/Collection.php +10 -0
  191. app/code/local/Simi/Simiconnector/Model/Mysql4/Simicategory.php +8 -0
  192. app/code/local/Simi/Simiconnector/Model/Mysql4/Simicategory/Collection.php +10 -0
  193. app/code/local/Simi/Simiconnector/Model/Mysql4/Siminotification.php +13 -0
  194. app/code/local/Simi/Simiconnector/Model/Mysql4/Siminotification/Collection.php +13 -0
  195. app/code/local/Simi/Simiconnector/Model/Mysql4/Simiproductlabel.php +9 -0
  196. app/code/local/Simi/Simiconnector/Model/Mysql4/Simiproductlabel/Collection.php +10 -0
  197. app/code/local/Simi/Simiconnector/Model/Mysql4/Simivideo.php +9 -0
  198. app/code/local/Simi/Simiconnector/Model/Mysql4/Simivideo/Collection.php +10 -0
  199. app/code/local/Simi/Simiconnector/Model/Mysql4/Visibility.php +27 -0
  200. app/code/local/Simi/Simiconnector/Model/Mysql4/Visibility/Collection.php +30 -0
  201. app/code/local/Simi/Simiconnector/Model/Observer.php +188 -0
  202. app/code/local/Simi/Simiconnector/Model/Platform.php +39 -0
  203. app/code/local/Simi/Simiconnector/Model/Productlist.php +24 -0
  204. app/code/local/Simi/Simiconnector/Model/Server.php +125 -0
  205. app/code/local/Simi/Simiconnector/Model/Simibarcode.php +46 -0
  206. app/code/local/Simi/Simiconnector/Model/Simicategory.php +48 -0
  207. app/code/local/Simi/Simiconnector/Model/Simiconnector.php +10 -0
  208. app/code/local/Simi/Simiconnector/Model/Siminotification.php +23 -0
  209. app/code/local/Simi/Simiconnector/Model/Simiproductlabel.php +10 -0
  210. app/code/local/Simi/Simiconnector/Model/Simivideo.php +10 -0
  211. app/code/local/Simi/Simiconnector/Model/Status.php +41 -0
  212. app/code/local/Simi/Simiconnector/Model/Visibility.php +28 -0
  213. app/code/local/Simi/Simiconnector/controllers/.DS_Store +0 -0
  214. app/code/local/Simi/Simiconnector/controllers/Adminhtml/.DS_Store +0 -0
  215. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/AppreportController.php +61 -0
  216. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/BannerController.php +354 -0
  217. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/CmsController.php +213 -0
  218. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/ConfigController.php +35 -0
  219. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/DeviceController.php +96 -0
  220. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/HistoryController.php +96 -0
  221. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/ProductlistController.php +255 -0
  222. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/SimibarcodeController.php +465 -0
  223. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/SimicategoryController.php +244 -0
  224. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/SiminotificationController.php +288 -0
  225. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/SimiproductlabelController.php +213 -0
  226. app/code/local/Simi/Simiconnector/controllers/Adminhtml/Simiconnector/SimivideoController.php +199 -0
  227. app/code/local/Simi/Simiconnector/controllers/IndexController.php +65 -0
  228. app/code/local/Simi/Simiconnector/controllers/RestController.php +42 -0
  229. app/code/local/Simi/Simiconnector/etc/adminhtml.xml +238 -0
  230. app/code/local/Simi/Simiconnector/etc/config.xml +254 -0
  231. app/code/local/Simi/Simiconnector/etc/system.xml +1114 -0
  232. app/code/local/Simi/Simiconnector/sql/.DS_Store +0 -0
  233. app/code/local/Simi/Simiconnector/sql/simiconnector_setup/mysql4-install-0.1.0.php +256 -0
  234. app/design/adminhtml/default/default/layout/simiconnector.xml +157 -0
  235. app/design/adminhtml/default/default/template/simiconnector/banner/categories.phtml +198 -0
  236. app/design/adminhtml/default/default/template/simiconnector/banner/grid.phtml +226 -0
  237. app/design/adminhtml/default/default/template/simiconnector/categories.phtml +174 -0
  238. app/design/adminhtml/default/default/template/simiconnector/productlist/grid.phtml +215 -0
  239. app/design/adminhtml/default/default/template/simiconnector/render/category.phtml +25 -0
  240. app/design/adminhtml/default/default/template/simiconnector/siminotification/categories.phtml +198 -0
  241. app/design/adminhtml/default/default/template/simiconnector/siminotification/devicegrid.phtml +231 -0
  242. app/design/adminhtml/default/default/template/simiconnector/siminotification/grid.phtml +226 -0
  243. app/design/adminhtml/default/default/template/simiconnector/siminotification/guide.phtml +23 -0
  244. app/design/adminhtml/default/default/template/simiconnector/simiproductlabel/grid.phtml +215 -0
  245. app/design/adminhtml/default/default/template/simiconnector/simivideo/grid.phtml +163 -0
app/code/local/Simi/Simiconnector/.DS_Store ADDED
Binary file
app/code/local/Simi/Simiconnector/Block/.DS_Store ADDED
Binary file
app/code/local/Simi/Simiconnector/Block/Adminhtml/.DS_Store ADDED
Binary file
app/code/local/Simi/Simiconnector/Block/Adminhtml/Appreport.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
5
+ * version in the future.
6
+ *
7
+ * @category
8
+ * @package Appreport
9
+ * @copyright Copyright (c) 2012
10
+ * @license
11
+ */
12
+
13
+ /**
14
+ * Appreport Adminhtml Block
15
+ *
16
+ * @category
17
+ * @package Appreport
18
+ * @author Developer
19
+ */
20
+ class Simi_Simiconnector_Block_Adminhtml_Appreport extends Mage_Adminhtml_Block_Widget_Grid_Container
21
+ {
22
+ public function __construct()
23
+ {
24
+ $this->_controller = 'adminhtml_appreport';
25
+ $this->_blockGroup = 'simiconnector';
26
+ $this->_headerText = Mage::helper('simiconnector')->__('App Transactions');
27
+ parent::__construct();
28
+ $this->removeButton("add");
29
+ }
30
+ }
app/code/local/Simi/Simiconnector/Block/Adminhtml/Appreport/Grid.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Simi_Simiconnector_Block_Adminhtml_Appreport_Grid extends Mage_Adminhtml_Block_Widget_Grid {
4
+
5
+ public function __construct() {
6
+ parent::__construct();
7
+ $this->setId('sales_order_grid');
8
+ $this->setUseAjax(true);
9
+ $this->setDefaultSort('created_at');
10
+ $this->setDefaultDir('DESC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ /**
15
+ * Retrieve collection class
16
+ *
17
+ * @return string
18
+ */
19
+ protected function _getCollectionClass() {
20
+ return 'sales/order_grid_collection';
21
+ }
22
+
23
+ protected function _prepareCollection() {
24
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
25
+ $appreport_table = Mage::getSingleton('core/resource')->getTableName('simiconnector/appreport');
26
+ $collection->getSelect()->join(array('transaction' => $appreport_table), 'transaction.order_id = main_table.entity_id');
27
+
28
+ $this->setCollection($collection);
29
+ return parent::_prepareCollection();
30
+ }
31
+
32
+ protected function _prepareColumns() {
33
+
34
+ $this->addColumn('real_order_id', array(
35
+ 'header' => Mage::helper('sales')->__('Order #'),
36
+ 'width' => '80px',
37
+ 'type' => 'text',
38
+ 'index' => 'increment_id',
39
+ ));
40
+
41
+ if (!Mage::app()->isSingleStoreMode()) {
42
+ $this->addColumn('store_id', array(
43
+ 'header' => Mage::helper('sales')->__('Purchased From (Store)'),
44
+ 'index' => 'store_id',
45
+ 'type' => 'store',
46
+ 'store_view' => true,
47
+ 'display_deleted' => true,
48
+ ));
49
+ }
50
+
51
+ $this->addColumn('created_at', array(
52
+ 'header' => Mage::helper('sales')->__('Purchased On'),
53
+ 'index' => 'created_at',
54
+ 'type' => 'datetime',
55
+ 'width' => '100px',
56
+ ));
57
+
58
+ $this->addColumn('billing_name', array(
59
+ 'header' => Mage::helper('sales')->__('Bill to Name'),
60
+ 'index' => 'billing_name',
61
+ ));
62
+
63
+ $this->addColumn('shipping_name', array(
64
+ 'header' => Mage::helper('sales')->__('Ship to Name'),
65
+ 'index' => 'shipping_name',
66
+ ));
67
+
68
+ $this->addColumn('base_grand_total', array(
69
+ 'header' => Mage::helper('sales')->__('G.T. (Base)'),
70
+ 'index' => 'base_grand_total',
71
+ 'type' => 'currency',
72
+ 'currency' => 'base_currency_code',
73
+ ));
74
+
75
+ $this->addColumn('grand_total', array(
76
+ 'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
77
+ 'index' => 'grand_total',
78
+ 'type' => 'currency',
79
+ 'currency' => 'order_currency_code',
80
+ ));
81
+
82
+ $this->addColumn('status', array(
83
+ 'header' => Mage::helper('sales')->__('Status'),
84
+ 'index' => 'status',
85
+ 'type' => 'options',
86
+ 'width' => '70px',
87
+ 'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
88
+ ));
89
+
90
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
91
+ $this->addColumn('action', array(
92
+ 'header' => Mage::helper('sales')->__('Action'),
93
+ 'width' => '50px',
94
+ 'type' => 'action',
95
+ 'getter' => 'getId',
96
+ 'actions' => array(
97
+ array(
98
+ 'caption' => Mage::helper('sales')->__('View'),
99
+ 'url' => array('base' => 'adminhtml/sales_order/view'),
100
+ 'field' => 'order_id'
101
+ )
102
+ ),
103
+ 'filter' => false,
104
+ 'sortable' => false,
105
+ 'index' => 'stores',
106
+ 'is_system' => true,
107
+ ));
108
+ }
109
+ $this->addExportType('*/*/exportCsv', Mage::helper('simiconnector')->__('CSV'));
110
+ $this->addExportType('*/*/exportXml', Mage::helper('simiconnector')->__('XML'));
111
+
112
+ return parent::_prepareColumns();
113
+ }
114
+
115
+ protected function _prepareMassaction() {
116
+ $this->setMassactionIdField('entity_id');
117
+ $this->getMassactionBlock()->setFormFieldName('order_ids');
118
+ $this->getMassactionBlock()->setUseSelectAll(false);
119
+
120
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel')) {
121
+ $this->getMassactionBlock()->addItem('cancel_order', array(
122
+ 'label' => Mage::helper('sales')->__('Cancel'),
123
+ 'url' => $this->getUrl('adminhtml/sales_order/massCancel'),
124
+ ));
125
+ }
126
+
127
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/hold')) {
128
+ $this->getMassactionBlock()->addItem('hold_order', array(
129
+ 'label' => Mage::helper('sales')->__('Hold'),
130
+ 'url' => $this->getUrl('adminhtml/sales_order/massHold'),
131
+ ));
132
+ }
133
+
134
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/unhold')) {
135
+ $this->getMassactionBlock()->addItem('unhold_order', array(
136
+ 'label' => Mage::helper('sales')->__('Unhold'),
137
+ 'url' => $this->getUrl('adminhtml/sales_order/massUnhold'),
138
+ ));
139
+ }
140
+ return $this;
141
+ }
142
+
143
+ public function getRowUrl($row) {
144
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
145
+ return $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getId()));
146
+ }
147
+ return false;
148
+ }
149
+
150
+ /**
151
+ * get url for using ajax reloading
152
+ *
153
+ * @return string
154
+ */
155
+ public function getGridUrl() {
156
+ return $this->getUrl('*/*/grid', array('_current' => true));
157
+ }
158
+
159
+ }
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * DISCLAIMER
5
+ *
6
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
7
+ * version in the future.
8
+ *
9
+ * @category
10
+ * @package Connector
11
+ * @copyright Copyright (c) 2012
12
+ * @license
13
+ */
14
+
15
+ /**
16
+ * Connector Adminhtml Block
17
+ *
18
+ * @category
19
+ * @package Connector
20
+ * @author Developer
21
+ */
22
+ class Simi_Simiconnector_Block_Adminhtml_Banner extends Mage_Adminhtml_Block_Widget_Grid_Container {
23
+
24
+ protected $_theme;
25
+
26
+ public function __construct() {
27
+ $this->_theme = Mage::helper('simiconnector/cloud')->getThemeLayout();
28
+ $this->_controller = 'adminhtml_banner';
29
+ $this->_blockGroup = 'simiconnector';
30
+ $this->_headerText = Mage::helper('simiconnector')->__('Banner Manager on ' .$this->_theme.' theme');
31
+ $this->_addButtonLabel = Mage::helper('simiconnector')->__('Add Banner');
32
+ parent::__construct();
33
+ }
34
+
35
+ public function getTheme(){
36
+ return $this->_theme;
37
+ }
38
+ }
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * DISCLAIMER
5
+ *
6
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
7
+ * version in the future.
8
+ *
9
+ * @category
10
+ * @package Connector
11
+ * @copyright Copyright (c) 2012
12
+ * @license
13
+ */
14
+
15
+ /**
16
+ * Connector Edit Block
17
+ *
18
+ * @category
19
+ * @package Connector
20
+ * @author Developer
21
+ */
22
+ class Simi_Simiconnector_Block_Adminhtml_Banner_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
23
+
24
+ public function __construct() {
25
+ parent::__construct();
26
+
27
+ $this->_objectId = 'id';
28
+ $this->_blockGroup = 'simiconnector';
29
+ $this->_controller = 'adminhtml_banner';
30
+
31
+ $this->_updateButton('save', 'label', Mage::helper('simiconnector')->__('Save Banner'));
32
+ $this->_updateButton('delete', 'label', Mage::helper('simiconnector')->__('Delete Banner'));
33
+
34
+ $this->_addButton('saveandcontinue', array(
35
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
36
+ 'onclick' => 'saveAndContinueEdit()',
37
+ 'class' => 'save',
38
+ ), -100);
39
+
40
+ $this->_formScripts[] = "
41
+ function toggleEditor() {
42
+ if (tinyMCE.getInstanceById('madapter_content') == null)
43
+ tinyMCE.execCommand('mceAddControl', false, 'madapter_content');
44
+ else
45
+ tinyMCE.execCommand('mceRemoveControl', false, 'madapter_content');
46
+ }
47
+
48
+ function saveAndContinueEdit(){
49
+ editForm.submit($('edit_form').action+'back/edit/');
50
+ }
51
+
52
+ function onchangeNoticeType(type){
53
+ switch (type) {
54
+ case '1':
55
+ $('product_id').up('tr').show();
56
+ $('product_id').className = 'required-entry input-text';
57
+ $('category_id').up('tr').hide();
58
+ $('category_id').className = 'input-text';
59
+ $('banner_url').up('tr').hide();
60
+ $('banner_url').className = 'input-text';
61
+ break;
62
+ case '2':
63
+ $('category_id').up('tr').show();
64
+ $('category_id').className = 'required-entry input-text';
65
+ $('product_id').up('tr').hide();
66
+ $('product_id').className = 'input-text';
67
+ $('banner_url').up('tr').hide();
68
+ $('banner_url').className = 'input-text';
69
+ break;
70
+ case '3':
71
+ $('banner_url').up('tr').show();
72
+ $('product_id').up('tr').hide();
73
+ $('product_id').className = 'input-text';
74
+ $('category_id').up('tr').hide();
75
+ $('category_id').className = 'input-text';
76
+ break;
77
+ default:
78
+ $('product_id').up('tr').show();
79
+ $('product_id').className = 'required-entry input-text';
80
+ $('category_id').up('tr').hide();
81
+ $('category_id').className = 'input-text';
82
+ $('banner_url').up('tr').hide();
83
+ $('banner_url').className = 'input-text';
84
+ }
85
+ }
86
+ ";
87
+ }
88
+
89
+ /**
90
+ * get text to show in header when edit an item
91
+ *
92
+ * @return string
93
+ */
94
+ public function getHeaderText() {
95
+ if (Mage::registry('banner_data') && Mage::registry('banner_data')->getId())
96
+ return Mage::helper('simiconnector')->__("Edit Banner '%s'", $this->htmlEscape(Mage::registry('banner_data')->getBannerTitle()));
97
+ return Mage::helper('simiconnector')->__('Add Banner');
98
+ }
99
+
100
+ }
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Form.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * DISCLAIMER
6
+ *
7
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
8
+ * version in the future.
9
+ *
10
+ * @category
11
+ * @package Connector
12
+ * @copyright Copyright (c) 2012
13
+ * @license
14
+ */
15
+
16
+ /**
17
+ * Connector Edit Form Block
18
+ *
19
+ * @category
20
+ * @package Connector
21
+ * @author Developer
22
+ */
23
+ class Simi_Simiconnector_Block_Adminhtml_Banner_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
24
+
25
+ /**
26
+ * prepare form's information for block
27
+ *
28
+ * @return Simi_Connector_Block_Adminhtml_Banner_Edit_Form
29
+ */
30
+ protected function _prepareForm() {
31
+ $form = new Varien_Data_Form(array(
32
+ 'id' => 'edit_form',
33
+ 'action' => $this->getUrl('*/*/save', array(
34
+ 'id' => $this->getRequest()->getParam('id'),
35
+ )),
36
+ 'method' => 'post',
37
+ 'enctype' => 'multipart/form-data'
38
+ ));
39
+
40
+ $form->setUseContainer(true);
41
+ $this->setForm($form);
42
+ return parent::_prepareForm();
43
+ }
44
+
45
+ }
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tab/Categories.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Category chooser for Wysiwyg CMS widget
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Simi_Simiconnector_Block_Adminhtml_Banner_Edit_Tab_Categories extends Mage_Adminhtml_Block_Catalog_Category_Tree
35
+ {
36
+ protected $_selectedIds = array();
37
+
38
+ protected function _prepareLayout()
39
+ {
40
+ $this->setTemplate('simiconnector/banner/categories.phtml');
41
+ }
42
+ public function getCategoryIds()
43
+ {
44
+ return $this->_selectedIds;
45
+ }
46
+
47
+ public function setCategoryIds($id)
48
+ {
49
+ if (!$id) {
50
+ $ids = array();
51
+ }
52
+ elseif ($id) {
53
+ $ids[] = $id;
54
+ }
55
+ $this->_selectedIds = $ids;
56
+ return $this;
57
+ }
58
+
59
+ /**
60
+ * Get JSON of a tree node or an associative array
61
+ *
62
+ * @param Varien_Data_Tree_Node|array $node
63
+ * @param int $level
64
+ * @return string
65
+ */
66
+ protected function _getNodeJson($node, $level = 1)
67
+ {
68
+ $item = array();
69
+ $item['text']= $this->htmlEscape($node->getName());
70
+
71
+ if ($this->_withProductCount) {
72
+ $item['text'].= ' ('.$node->getProductCount().')';
73
+ }
74
+ $item['id'] = $node->getId();
75
+ $item['path'] = $node->getData('path');
76
+ $item['cls'] = 'folder ' . ($node->getIsActive() ? 'active-category' : 'no-active-category');
77
+ $item['allowDrop'] = false;
78
+ $item['allowDrag'] = false;
79
+
80
+ if ($node->hasChildren()) {
81
+ $item['children'] = array();
82
+ foreach ($node->getChildren() as $child) {
83
+ $item['children'][] = $this->_getNodeJson($child, $level + 1);
84
+ }
85
+ }
86
+
87
+ if (empty($item['children']) && (int)$node->getChildrenCount() > 0) {
88
+ $item['children'] = array();
89
+ }
90
+
91
+ if (!empty($item['children'])) {
92
+ $item['expanded'] = true;
93
+ }
94
+
95
+ if (in_array($node->getId(), $this->getCategoryIds())) {
96
+ $item['checked'] = true;
97
+ }
98
+
99
+ return $item;
100
+ }
101
+
102
+ public function getRoot($parentNodeCategory=null, $recursionLevel=3)
103
+ {
104
+ return $this->getRootByIds($this->getCategoryIds());
105
+ }
106
+ }
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tab/Form.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * DISCLAIMER
6
+ *
7
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
8
+ * version in the future.
9
+ *
10
+ * @category
11
+ * @package Connector
12
+ * @copyright Copyright (c) 2012
13
+ * @license
14
+ */
15
+
16
+ /**
17
+ * Simi Edit Form Content Tab Block
18
+ *
19
+ * @category
20
+ * @package Connector
21
+ * @author Developer
22
+ */
23
+ class Simi_Simiconnector_Block_Adminhtml_Banner_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
24
+
25
+ /**
26
+ * prepare tab form's information
27
+ *
28
+ * @return Simi_Connector_Block_Adminhtml_Banner_Edit_Tab_Form
29
+ */
30
+ protected function _prepareForm() {
31
+ $form = new Varien_Data_Form();
32
+ $this->setForm($form);
33
+
34
+ if (Mage::getSingleton('adminhtml/session')->getConnectorData()) {
35
+ $data = Mage::getSingleton('adminhtml/session')->getConnectorData();
36
+ Mage::getSingleton('adminhtml/session')->setConnectorData(null);
37
+ } elseif (Mage::registry('banner_data'))
38
+ $data = Mage::registry('banner_data')->getData();
39
+ if ($data['banner_id']) {
40
+ $typeID = Mage::helper('simiconnector')->getVisibilityTypeId('banner');
41
+ $visibleStoreViews = Mage::getModel('simiconnector/visibility')->getCollection()
42
+ ->addFieldToFilter('content_type', $typeID)
43
+ ->addFieldToFilter('item_id', $data['banner_id']);
44
+ $storeIdArray = array();
45
+ foreach ($visibleStoreViews as $visibilityItem) {
46
+ $storeIdArray[] = $visibilityItem->getData('store_view_id');
47
+ }
48
+ $data['storeview_id'] = implode(',', $storeIdArray);
49
+ }
50
+ else {
51
+ $storeIdArray = array();
52
+ foreach (Mage::getModel('core/store')->getCollection() as $storeModel)
53
+ $storeIdArray[] = $storeModel->getId();
54
+ $data['storeview_id'] = implode(',', $storeIdArray);
55
+ }
56
+
57
+ $fieldset = $form->addFieldset('simiconnector_form', array('legend' => Mage::helper('simiconnector')->__('Banner information')));
58
+ /*
59
+ $fieldset->addField('website_id', 'select', array(
60
+ 'label' => Mage::helper('simiconnector')->__('Choose website'),
61
+ 'name' => 'website_id',
62
+ 'values' => Mage::getSingleton('simiconnector/status')->getWebsite(),
63
+ ));
64
+ */
65
+
66
+ $field = $fieldset->addField('storeview_id', 'multiselect', array(
67
+ 'name' => 'storeview_id[]',
68
+ 'label' => Mage::helper('simiconnector')->__('Store View'),
69
+ 'title' => Mage::helper('simiconnector')->__('Store View'),
70
+ 'required' => true,
71
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false),
72
+ ));
73
+ $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
74
+ $field->setRenderer($renderer);
75
+
76
+
77
+ $fieldset->addField('banner_title', 'text', array(
78
+ 'label' => Mage::helper('simiconnector')->__('Title'),
79
+ 'class' => 'required-entry',
80
+ 'required' => true,
81
+ 'name' => 'banner_title',
82
+ ));
83
+
84
+ $fieldset->addField('banner_name', 'image', array(
85
+ 'label' => Mage::helper('simiconnector')->__('Image (width:640px, height:340px)'),
86
+ 'required' => FALSE,
87
+ 'name' => 'banner_name_co',
88
+ ));
89
+
90
+ $fieldset->addField('banner_name_tablet', 'image', array(
91
+ 'label' => Mage::helper('simiconnector')->__('Tablet Image (width:640px, height:340px)'),
92
+ 'required' => FALSE,
93
+ 'name' => 'banner_name_tablet_co',
94
+ ));
95
+
96
+ $fieldset->addField('type', 'select', array(
97
+ 'label' => Mage::helper('simiconnector')->__('Direct viewers to'),
98
+ 'class' => 'required-entry',
99
+ 'required' => true,
100
+ 'name' => 'type',
101
+ 'values' => Mage::getModel('simiconnector/banner')->toOptionArray(),
102
+ 'onchange' => 'onchangeNoticeType(this.value)',
103
+ 'after_element_html' => '<script> Event.observe(window, "load", function(){onchangeNoticeType(\'' . $data['type'] . '\');});</script>',
104
+ ));
105
+
106
+ $productIds = implode(", ", Mage::getResourceModel('catalog/product_collection')->getAllIds());
107
+ $fieldset->addField('product_id', 'text', array(
108
+ 'name' => 'product_id',
109
+ 'class' => 'required-entry',
110
+ 'required' => true,
111
+ 'label' => Mage::helper('simiconnector')->__('Product ID'),
112
+ 'note' => Mage::helper('simiconnector')->__('Choose a product'),
113
+ 'after_element_html' => '<a id="product_link" href="javascript:void(0)" onclick="toggleMainProducts()"><img src="' . $this->getSkinUrl('images/rule_chooser_trigger.gif') . '" alt="" class="v-middle rule-chooser-trigger" title="Select Products"></a><input type="hidden" value="' . $productIds . '" id="product_all_ids"/><div id="main_products_select" style="display:none;width:640px"></div>
114
+ <script type="text/javascript">
115
+ function toggleMainProducts(){
116
+ if($("main_products_select").style.display == "none"){
117
+ var url = "' . $this->getUrl('adminhtml/simiconnector_banner/chooserMainProducts') . '";
118
+ var params = $("product_id").value.split(", ");
119
+ var parameters = {"form_key": FORM_KEY,"selected[]":params };
120
+ var request = new Ajax.Request(url,
121
+ {
122
+ evalScripts: true,
123
+ parameters: parameters,
124
+ onComplete:function(transport){
125
+ $("main_products_select").update(transport.responseText);
126
+ $("main_products_select").style.display = "block";
127
+ }
128
+ });
129
+ }else{
130
+ $("main_products_select").style.display = "none";
131
+ }
132
+ };
133
+ var grid;
134
+
135
+ function constructData(div){
136
+ grid = window[div.id+"JsObject"];
137
+ if(!grid.reloadParams){
138
+ grid.reloadParams = {};
139
+ grid.reloadParams["selected[]"] = $("product_id").value.split(", ");
140
+ }
141
+ }
142
+ function toogleCheckAllProduct(el){
143
+ if(el.checked == true){
144
+ $$("#main_products_select input[type=checkbox][class=checkbox]").each(function(e){
145
+ if(e.name != "check_all"){
146
+ if(!e.checked){
147
+ if($("product_id").value == "")
148
+ $("product_id").value = e.value;
149
+ else
150
+ $("product_id").value = $("product_id").value + ", "+e.value;
151
+ e.checked = true;
152
+ grid.reloadParams["selected[]"] = $("product_id").value.split(", ");
153
+ }
154
+ }
155
+ });
156
+ }else{
157
+ $$("#main_products_select input[type=checkbox][class=checkbox]").each(function(e){
158
+ if(e.name != "check_all"){
159
+ if(e.checked){
160
+ var vl = e.value;
161
+ if($("product_id").value.search(vl) == 0){
162
+ if($("product_id").value == vl) $("product_id").value = "";
163
+ $("product_id").value = $("product_id").value.replace(vl+", ","");
164
+ }else{
165
+ $("product_id").value = $("product_id").value.replace(", "+ vl,"");
166
+ }
167
+ e.checked = false;
168
+ grid.reloadParams["selected[]"] = $("product_id").value.split(", ");
169
+ }
170
+ }
171
+ });
172
+
173
+ }
174
+ }
175
+ function selectProduct(e) {
176
+ if(e.checked == true){
177
+ if(e.id == "main_on"){
178
+ $("product_id").value = $("product_all_ids").value;
179
+ }else{
180
+ if($("product_id").value == "")
181
+ $("product_id").value = e.value;
182
+ else
183
+ $("product_id").value = e.value;
184
+ grid.reloadParams["selected[]"] = $("product_id").value;
185
+ }
186
+ }else{
187
+ if(e.id == "main_on"){
188
+ $("product_id").value = "";
189
+ }else{
190
+ var vl = e.value;
191
+ if($("product_id").value.search(vl) == 0){
192
+ $("product_id").value = $("product_id").value.replace(vl+", ","");
193
+ }else{
194
+ $("product_id").value = $("product_id").value.replace(", "+ vl,"");
195
+ }
196
+ }
197
+ }
198
+
199
+ }
200
+ </script>'
201
+ ));
202
+
203
+ $fieldset->addField('category_id', 'text', array(
204
+ 'name' => 'category_id',
205
+ 'class' => 'required-entry',
206
+ 'required' => true,
207
+ 'label' => Mage::helper('simiconnector')->__('Category ID'),
208
+ 'note' => Mage::helper('simiconnector')->__('Choose a category'),
209
+ 'after_element_html' => '<a id="category_link" href="javascript:void(0)" onclick="toggleMainCategories()"><img src="' . $this->getSkinUrl('images/rule_chooser_trigger.gif') . '" alt="" class="v-middle rule-chooser-trigger" title="Select Category"></a>
210
+ <div id="main_categories_select" style="display:none"></div>
211
+ <script type="text/javascript">
212
+ function toggleMainCategories(check){
213
+ var cate = $("main_categories_select");
214
+ if($("main_categories_select").style.display == "none" || (check ==1) || (check == 2)){
215
+ var url = "' . $this->getUrl('adminhtml/simiconnector_banner/chooserMainCategories') . '";
216
+ if(check == 1){
217
+ $("category_id").value = $("category_all_ids").value;
218
+ }else if(check == 2){
219
+ $("category_id").value = "";
220
+ }
221
+ var params = $("category_id").value.split(", ");
222
+ var parameters = {"form_key": FORM_KEY,"selected[]":params };
223
+ var request = new Ajax.Request(url,
224
+ {
225
+ evalScripts: true,
226
+ parameters: parameters,
227
+ onComplete:function(transport){
228
+ $("main_categories_select").update(transport.responseText);
229
+ $("main_categories_select").style.display = "block";
230
+ }
231
+ });
232
+ if(cate.style.display == "none"){
233
+ cate.style.display = "";
234
+ }else{
235
+ cate.style.display = "none";
236
+ }
237
+ }else{
238
+ cate.style.display = "none";
239
+ }
240
+ };
241
+ </script>
242
+ '
243
+ ));
244
+
245
+ $fieldset->addField('banner_url', 'editor', array(
246
+ 'name' => 'banner_url',
247
+ 'label' => Mage::helper('simiconnector')->__('Url'),
248
+ 'title' => Mage::helper('simiconnector')->__('Url'),
249
+ 'required' => false,
250
+ ));
251
+
252
+ if (!isset($data['sort_order']))
253
+ $data['sort_order'] = 1;
254
+ $fieldset->addField('sort_order', 'text', array(
255
+ 'label' => Mage::helper('simiconnector')->__('Sort Order'),
256
+ 'required' => false,
257
+ 'class' => 'validate-not-negative-number',
258
+ 'name' => 'sort_order',
259
+ ));
260
+
261
+ $fieldset->addField('status', 'select', array(
262
+ 'label' => Mage::helper('simiconnector')->__('Status'),
263
+ 'name' => 'status',
264
+ 'values' => Mage::getSingleton('simiconnector/status')->getOptionHash(),
265
+ ));
266
+
267
+ $form->setValues($data);
268
+ return parent::_prepareForm();
269
+ }
270
+
271
+ }
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tab/Products.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Adminhtml
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ /**
29
+ * Adminhtml sales order create search products block
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Adminhtml
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Simi_Simiconnector_Block_Adminhtml_Banner_Edit_Tab_Products extends Mage_Adminhtml_Block_Widget_Grid {
36
+
37
+
38
+ public function __construct($arguments = array()) {
39
+ parent::__construct($arguments);
40
+ if ($this->getRequest()->getParam('current_grid_id')) {
41
+ $this->setId($this->getRequest()->getParam('current_grid_id'));
42
+ } else {
43
+ $this->setId('skuChooserGrid_' . $this->getId());
44
+ }
45
+
46
+ $form = $this->getJsFormObject();
47
+ $gridId = $this->getId();
48
+ $this->setCheckboxCheckCallback("constructData($gridId)");
49
+ $this->setDefaultSort('sku');
50
+ $this->setUseAjax(true);
51
+ if ($this->getRequest()->getParam('collapse')) {
52
+ $this->setIsCollapsed(true);
53
+ }
54
+ $this->setTemplate('simiconnector/banner/grid.phtml');
55
+ }
56
+
57
+ /**
58
+ * Retrieve quote store object
59
+ * @return Mage_Core_Model_Store
60
+ */
61
+ public function getStore() {
62
+ return Mage::app()->getStore();
63
+ }
64
+
65
+ protected function _addColumnFilterToCollection($column) {
66
+ // Set custom filter for in product flag
67
+ if ($column->getId() == 'in_products') {
68
+ $selected = $this->_getSelectedProducts();
69
+ if (empty($selected)) {
70
+ $selected = '';
71
+ }
72
+ if ($column->getFilter()->getValue()) {
73
+ $this->getCollection()->addFieldToFilter('sku', array('in' => $selected));
74
+ } else {
75
+ $this->getCollection()->addFieldToFilter('sku', array('nin' => $selected));
76
+ }
77
+ } else {
78
+ parent::_addColumnFilterToCollection($column);
79
+ }
80
+ return $this;
81
+ }
82
+
83
+ /**
84
+ * Prepare Catalog Product Collection for attribute SKU in Promo Conditions SKU chooser
85
+ *
86
+ * @return Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku
87
+ */
88
+ protected function _prepareCollection() {
89
+ $collection = Mage::getResourceModel('catalog/product_collection')
90
+ ->setStoreId(0)
91
+ ->addAttributeToSelect('name', 'type_id', 'attribute_set_id')
92
+ ->addFieldToFilter('visibility', array('neq' => '1'))
93
+ ->addFieldToFilter('status', '1')
94
+ ;
95
+ $this->setCollection($collection);
96
+
97
+ return parent::_prepareCollection();
98
+ }
99
+
100
+ /**
101
+ * Define Cooser Grid Columns and filters
102
+ *
103
+ * @return Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku
104
+ */
105
+ protected function _prepareColumns() {
106
+ $this->addColumn('in_products', array(
107
+ 'header_css_class' => 'a-center',
108
+ 'type' => 'checkbox',
109
+ 'name' => 'in_products',
110
+ 'values' => $this->_getSelectedProducts(),
111
+ 'align' => 'center',
112
+ 'index' => 'sku',
113
+ 'use_index' => true,
114
+ 'width' => '50px',
115
+ 'renderer' => 'simiconnector/adminhtml_banner_edit_tab_renderer_sku'
116
+ ));
117
+
118
+ $this->addColumn('entity_id', array(
119
+ 'header' => Mage::helper('sales')->__('ID'),
120
+ 'sortable' => true,
121
+ 'width' => '60px',
122
+ 'index' => 'entity_id'
123
+ ));
124
+
125
+ $this->addColumn('chooser_name', array(
126
+ 'header' => Mage::helper('sales')->__('Product Name'),
127
+ 'name' => 'chooser_name',
128
+ 'index' => 'name',
129
+ 'width' => '400px'
130
+ ));
131
+
132
+ $this->addColumn('type', array(
133
+ 'header' => Mage::helper('catalog')->__('Type'),
134
+ 'width' => '60px',
135
+ 'index' => 'type_id',
136
+ 'type' => 'options',
137
+ 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
138
+ ));
139
+
140
+ $this->addColumn('chooser_sku', array(
141
+ 'header' => Mage::helper('sales')->__('SKU'),
142
+ 'name' => 'chooser_sku',
143
+ 'width' => '80px',
144
+ 'index' => 'sku',
145
+ ));
146
+
147
+
148
+ return parent::_prepareColumns();
149
+ }
150
+
151
+ public function getGridUrl() {
152
+ return $this->getUrl('*/*/chooserMainProducts', array(
153
+ '_current' => true,
154
+ 'current_grid_id' => $this->getId(),
155
+ 'collapse' => null
156
+ ));
157
+ }
158
+
159
+ protected function _getSelectedProducts() {
160
+ $products = $this->getRequest()->getPost('selected', array());
161
+ return $products;
162
+ }
163
+
164
+
165
+ }
166
+
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tab/Renderer/Sku.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Adminhtml sales order create search products block
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Simi_Simiconnector_Block_Adminhtml_Banner_Edit_Tab_Renderer_Sku extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
35
+ {
36
+
37
+ public function render(Varien_Object $row)
38
+ {
39
+ $checked = '';
40
+ if(in_array($row->getId(), $this->_getSelectedProducts()))
41
+ $checked = 'checked';
42
+ $html = '<input type="radio" '.$checked.' name="selected" value="'.$row->getId().'" class="checkbox" onclick="selectProduct(this)">';
43
+ return sprintf('%s', $html);
44
+ }
45
+
46
+ protected function _getSelectedProducts()
47
+ {
48
+ $products = $this->getRequest()->getPost('selected', array());
49
+ return $products;
50
+ }
51
+
52
+ }
53
+
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Edit/Tabs.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * DISCLAIMER
5
+ *
6
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
7
+ * version in the future.
8
+ *
9
+ * @category
10
+ * @package Connector
11
+ * @copyright Copyright (c) 2012
12
+ * @license
13
+ */
14
+
15
+ /**
16
+ * Connector Edit Tabs Block
17
+ *
18
+ * @category
19
+ * @package Connector
20
+ * @author Developer
21
+ */
22
+ class Simi_Simiconnector_Block_Adminhtml_Banner_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
23
+ {
24
+ public function __construct(){
25
+ parent::__construct();
26
+ $this->setId('banner_tabs');
27
+ $this->setDestElementId('edit_form');
28
+ $this->setTitle(Mage::helper('simiconnector')->__('Banner Information'));
29
+ }
30
+
31
+ /**
32
+ * prepare before render block to html
33
+ *
34
+ * @return Magestore_Madapter_Block_Adminhtml_Madapter_Edit_Tabs
35
+ */
36
+ protected function _beforeToHtml(){
37
+ $this->addTab('form_section', array(
38
+ 'label' => Mage::helper('simiconnector')->__('Banner Information'),
39
+ 'title' => Mage::helper('simiconnector')->__('Banner Information'),
40
+ 'content' => $this->getLayout()->createBlock('simiconnector/adminhtml_banner_edit_tab_form')->toHtml(),
41
+ ));
42
+ return parent::_beforeToHtml();
43
+ }
44
+ }
app/code/local/Simi/Simiconnector/Block/Adminhtml/Banner/Grid.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * DISCLAIMER
6
+ *
7
+ * Do not edit or add to this file if you wish to upgrade this extension to newer
8
+ * version in the future.
9
+ *
10
+ * @category
11
+ * @package Connector
12
+ * @copyright Copyright (c) 2012
13
+ * @license
14
+ */
15
+
16
+ /**
17
+ * Connector Grid Block
18
+ *
19
+ * @category
20
+ * @package Connector
21
+ * @author Developer
22
+ */
23
+ class Simi_Simiconnector_Block_Adminhtml_Banner_Grid extends Mage_Adminhtml_Block_Widget_Grid {
24
+
25
+ public function __construct() {
26
+ parent::__construct();
27
+ $this->setId('bannerGrid');
28
+ $this->setDefaultSort('banner_id');
29
+ $this->setDefaultDir('ASC');
30
+ $this->setSaveParametersInSession(true);
31
+ }
32
+
33
+ /**
34
+ * prepare collection for block to display
35
+ *
36
+ * @return Simi_Connector_Block_Adminhtml_Banner_Grid
37
+ */
38
+ protected function _prepareCollection() {
39
+ $webId = 0;
40
+ $collection = Mage::getModel('simiconnector/banner')->getCollection();
41
+ if ($this->getRequest()->getParam('website')) {
42
+ $webId = $this->getRequest()->getParam('website');
43
+ $collection->addFieldToFilter('website_id', array('eq' => $webId));
44
+ }
45
+ $this->setCollection($collection);
46
+ return parent::_prepareCollection();
47
+ }
48
+
49
+ /**
50
+ * prepare columns for this grid
51
+ *
52
+ * @return Simi_Connector_Block_Adminhtml_Banner_Grid
53
+ */
54
+ protected function _prepareColumns() {
55
+ $this->addColumn('banner_id', array(
56
+ 'header' => Mage::helper('simiconnector')->__('ID'),
57
+ 'align' => 'right',
58
+ 'width' => '50px',
59
+ 'index' => 'banner_id',
60
+ ));
61
+
62
+ $this->addColumn('banner_title', array(
63
+ 'header' => Mage::helper('simiconnector')->__('Title'),
64
+ 'align' => 'left',
65
+ 'index' => 'banner_title',
66
+ ));