Ultimate_ModuleCreator - Version 1.0.0

Version Notes

- Added entity relations
- Added possibility for direct install
- Added expand/collapse

Download this release

Release Info

Developer Marius
Extension Ultimate_ModuleCreator
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (258) hide show
  1. LICENSE_UMC.txt +7 -0
  2. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator.php +38 -0
  3. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit.php +178 -0
  4. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Form.php +38 -0
  5. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities.php +118 -0
  6. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities/Entity.php +87 -0
  7. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities/Entity/Attribute.php +91 -0
  8. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Help.php +72 -0
  9. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Relation.php +146 -0
  10. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Settings.php +180 -0
  11. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tabs.php +37 -0
  12. app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Grid.php +115 -0
  13. app/code/community/Ultimate/ModuleCreator/Exception.php +26 -0
  14. app/code/community/Ultimate/ModuleCreator/Helper/Adminhtml.php +51 -0
  15. app/code/community/Ultimate/ModuleCreator/Helper/Data.php +331 -0
  16. app/code/community/Ultimate/ModuleCreator/Model/Abstract.php +34 -0
  17. app/code/community/Ultimate/ModuleCreator/Model/Adminhtml/System/Config/Source/Codepool.php +55 -0
  18. app/code/community/Ultimate/ModuleCreator/Model/Adminhtml/System/Config/Source/Install.php +55 -0
  19. app/code/community/Ultimate/ModuleCreator/Model/Adminhtml/System/Config/Source/Layout.php +60 -0
  20. app/code/community/Ultimate/ModuleCreator/Model/Attribute.php +203 -0
  21. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Abstract.php +166 -0
  22. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Decimal.php +34 -0
  23. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/File.php +89 -0
  24. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Image.php +85 -0
  25. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Int.php +34 -0
  26. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Text.php +26 -0
  27. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Textarea.php +79 -0
  28. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Timestamp.php +77 -0
  29. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Website.php +93 -0
  30. app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Yesno.php +105 -0
  31. app/code/community/Ultimate/ModuleCreator/Model/Entity.php +684 -0
  32. app/code/community/Ultimate/ModuleCreator/Model/Module.php +900 -0
  33. app/code/community/Ultimate/ModuleCreator/Model/Module/Collection.php +95 -0
  34. app/code/community/Ultimate/ModuleCreator/Model/Relation.php +133 -0
  35. app/code/community/Ultimate/ModuleCreator/Model/Writer.php +82 -0
  36. app/code/community/Ultimate/ModuleCreator/controllers/Adminhtml/ModulecreatorController.php +370 -0
  37. app/code/community/Ultimate/ModuleCreator/etc/adminhtml.xml +62 -0
  38. app/code/community/Ultimate/ModuleCreator/etc/config.xml +120 -0
  39. app/code/community/Ultimate/ModuleCreator/etc/modulecreator.xml +1644 -0
  40. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Catalog/Product/Edit/Tab/Entity/01_content.php +176 -0
  41. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/01_content.php +24 -0
  42. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/01_content.php +48 -0
  43. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Form/01_content.php +29 -0
  44. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/01_top.php +21 -0
  45. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/02_image.php +1 -0
  46. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/03_file.php +1 -0
  47. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/04_wysiwyg.php +1 -0
  48. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/05_parents.php +8 -0
  49. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/06_attributes.php +5 -0
  50. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/07_status.php +14 -0
  51. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/08_rss.php +14 -0
  52. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/09_seo.php +12 -0
  53. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/10_footer.php +10 -0
  54. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Product/01_content.php +192 -0
  55. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Sibling/01_content.php +175 -0
  56. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/01_top.php +34 -0
  57. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/02_relations_tabs.php +5 -0
  58. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/03_product_relation.php +5 -0
  59. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/04_footer.php +3 -0
  60. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/01_top.php +35 -0
  61. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/02_columns_top.php +12 -0
  62. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/03_parents.php +7 -0
  63. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/04_grid_attributes.php +5 -0
  64. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/05_grid_status.php +9 -0
  65. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/06_created_at.php +6 -0
  66. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/07_updated_at.php +6 -0
  67. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/08_grid_actions.php +17 -0
  68. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/09_grid_export.php +3 -0
  69. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/10_columns_footer.php +2 -0
  70. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/11_mass_action_top.php +14 -0
  71. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/12_mass_action_status.php +16 -0
  72. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/13_mass_action_flags.php +16 -0
  73. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/14_mass_action_parents.php +17 -0
  74. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/15_footer.php +22 -0
  75. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Helper/File/01_content.php +87 -0
  76. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Helper/Image/01_content.php +25 -0
  77. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/01_top.php +22 -0
  78. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/02_top_status.php +1 -0
  79. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/03_content.php +78 -0
  80. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/04_status.php +9 -0
  81. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/05_footer.php +14 -0
  82. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Catalog/Product/List/Entity/01_top.php +20 -0
  83. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Catalog/Product/List/Entity/02_status.php +1 -0
  84. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Catalog/Product/List/Entity/03_footer.php +7 -0
  85. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Catalog/Product/List/01_content.php +34 -0
  86. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Child/List/01_content.php +42 -0
  87. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/List/01_top.php +19 -0
  88. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/List/02_status.php +1 -0
  89. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/List/03_footer.php +28 -0
  90. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/01_top.php +47 -0
  91. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/02_status.php +1 -0
  92. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/03_content_top.php +5 -0
  93. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/04_content.php +1 -0
  94. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/05_footer.php +11 -0
  95. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Sibling/List/01_content.php +42 -0
  96. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/View/01_content.php +20 -0
  97. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/Link/01_content.php +12 -0
  98. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/01_top.php +22 -0
  99. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/02_status.php +2 -0
  100. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/03_template.php +3 -0
  101. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/04_status.php +1 -0
  102. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/05_footer.php +4 -0
  103. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Rss/01_content.php +38 -0
  104. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Controller/Adminhtml/Module/01_content.php +46 -0
  105. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Data/01_top.php +10 -0
  106. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Data/02_entity.php +9 -0
  107. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Data/03_footer.php +1 -0
  108. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/01_top.php +19 -0
  109. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/02_rss.php +18 -0
  110. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/03_file.php +18 -0
  111. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/04_footer.php +1 -0
  112. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/Image/01_content.php +157 -0
  113. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Product/01_top.php +10 -0
  114. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Product/02_content.php +28 -0
  115. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Product/03_footer.php +1 -0
  116. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Adminhtml/Observer/01_top.php +10 -0
  117. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Adminhtml/Observer/02_entity.php +35 -0
  118. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Adminhtml/Observer/03_footer.php +1 -0
  119. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/01_top.php +10 -0
  120. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/02_var_sibling.php +1 -0
  121. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/03_var_product_relation.php +1 -0
  122. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/04_construct.php +25 -0
  123. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/05_url.php +9 -0
  124. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/06_editors.php +13 -0
  125. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/07_after_save_top.php +7 -0
  126. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/08_after_save_product.php +1 -0
  127. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/09_after_save_sibling.php +1 -0
  128. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/10_after_save_footer.php +2 -0
  129. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/11_product_relation.php +38 -0
  130. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/12_sibling_relation.php +38 -0
  131. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/13_footer.php +1 -0
  132. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/Product/01_content.php +46 -0
  133. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/Sibling/01_content.php +46 -0
  134. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/01_content.php +20 -0
  135. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/01_top.php +44 -0
  136. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/02_product_relation.php +22 -0
  137. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/03_sibling_relation.php +22 -0
  138. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/04_footer.php +1 -0
  139. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Product/01_content.php +69 -0
  140. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Product/Collection/01_content.php +50 -0
  141. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Sibling/01_content.php +45 -0
  142. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Sibling/Collection/01_content.php +50 -0
  143. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Setup/01_content.php +12 -0
  144. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/Entity/Catalog/ProductController/01_content.php +48 -0
  145. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/Entity/WidgetController/01_content.php +24 -0
  146. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/01_top.php +87 -0
  147. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/02_upload_image.php +2 -0
  148. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/03_upload_files.php +2 -0
  149. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/04_save_product_relation.php +4 -0
  150. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/05_save_sibling_relation.php +4 -0
  151. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/06_save.php +11 -0
  152. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/07_exception_upload.php +3 -0
  153. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/08_exception.php +6 -0
  154. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/09_center.php +65 -0
  155. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/10_mass_status.php +30 -0
  156. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/11_mass_update.php +30 -0
  157. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/12_mass_parents.php +30 -0
  158. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/13_product_relation_actions.php +26 -0
  159. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/14_sibling_actions.php +26 -0
  160. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/15_footer.php +34 -0
  161. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/01_top.php +10 -0
  162. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/02_list.php +22 -0
  163. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/03_list_seo.php +6 -0
  164. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/04_list_footer.php +2 -0
  165. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/05_view.php +12 -0
  166. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/06_view_status.php +3 -0
  167. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/07_view2.php +13 -0
  168. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/08_breadcrumbs.php +5 -0
  169. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/09_breadcrumbs_footer.php +7 -0
  170. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/10_view_seo.php +11 -0
  171. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/11_view_footer.php +3 -0
  172. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/12_rss.php +18 -0
  173. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/13_footer.php +1 -0
  174. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/01_top.xml +21 -0
  175. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/02_entity_acl.xml +3 -0
  176. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/03_center.xml +14 -0
  177. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/04_entity_menu.xml +5 -0
  178. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/05_footer.xml +4 -0
  179. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/01_top.xml +35 -0
  180. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/02_tables.xml +3 -0
  181. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/03_siblings_table.xml +6 -0
  182. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/04_relation_table.xml +3 -0
  183. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/05_global.xml +21 -0
  184. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/06_relation_product.xml +20 -0
  185. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/07_admin.xml +12 -0
  186. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/08_frontend.xml +27 -0
  187. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/09_default_top.xml +2 -0
  188. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/10_default.xml +4 -0
  189. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/11_default_footer.xml +3 -0
  190. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/system/01_top.xml +20 -0
  191. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/system/02_entity.xml +20 -0
  192. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/system/03_footer.xml +4 -0
  193. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/widget/01_top.xml +3 -0
  194. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/widget/02_entity.xml +44 -0
  195. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/widget/03_footer.xml +1 -0
  196. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/01_top.php +10 -0
  197. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/02_entity.php +9 -0
  198. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/03_product_relation.php +14 -0
  199. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/04_sibling_relation.php +13 -0
  200. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/05_footer.php +1 -0
  201. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/01_top.xml +3 -0
  202. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/02_entity.xml +30 -0
  203. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/03_relation_product.xml +46 -0
  204. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/04_relation_sibling.xml +23 -0
  205. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/05_footer.xml +1 -0
  206. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/01_top.xml +3 -0
  207. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/02_default_top.xml +2 -0
  208. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/03_default.xml +8 -0
  209. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/04_default_footer.xml +2 -0
  210. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/05_list.xml +9 -0
  211. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/06_view.xml +9 -0
  212. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/07_entity_rss.xml +4 -0
  213. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/08_rss_top.xml +3 -0
  214. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/09_rss.xml +4 -0
  215. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/10_rss_footer.xml +3 -0
  216. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/11_relation_product.xml +8 -0
  217. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/12_footer.xml +1 -0
  218. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/01_top.phtml +15 -0
  219. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/02_link_top.phtml +1 -0
  220. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/03_name.phtml +1 -0
  221. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/04_link_footer.phtml +1 -0
  222. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/05_footer.phtml +4 -0
  223. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/catalog/product/list/01_content.phtml +23 -0
  224. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/list/01_top.phtml +13 -0
  225. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/list/02_rss_link.phtml +3 -0
  226. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/list/03_footer.phtml +15 -0
  227. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/sibling/child/list/01_content.phtml +23 -0
  228. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/sibling/list/01_content.phtml +23 -0
  229. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/view/01_content.phtml +18 -0
  230. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/widget/link/01_content.phtml +16 -0
  231. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/widget/view/01_content.phtml +19 -0
  232. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/rss/01_content.phtml +29 -0
  233. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/etc/modules/Namespace_Module/01_content.xml +13 -0
  234. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/01_global.csv +13 -0
  235. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/02_entity.csv +19 -0
  236. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/03_attribute.csv +2 -0
  237. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/04_global_status.csv +4 -0
  238. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/05_global_rss.csv +1 -0
  239. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/06_global_seo.csv +3 -0
  240. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/07_attribute_yesno.csv +1 -0
  241. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/08_global_file.csv +1 -0
  242. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/09_product_relation.csv +2 -0
  243. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/10_relations.csv +2 -0
  244. app/code/community/Ultimate/ModuleCreator/etc/modulecreator/skin/frontend/base/default/images/placeholder/entity.jpg +0 -0
  245. app/code/community/Ultimate/ModuleCreator/etc/system.xml +226 -0
  246. app/design/adminhtml/default/default/layout/ultimate_modulecreator.xml +63 -0
  247. app/design/adminhtml/default/default/template/ultimate_modulecreator/edit.phtml +234 -0
  248. app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities.phtml +92 -0
  249. app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities/entity.phtml +323 -0
  250. app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities/entity/attribute.phtml +199 -0
  251. app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/help.phtml +414 -0
  252. app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/relation.phtml +108 -0
  253. app/design/adminhtml/default/default/template/ultimate_modulecreator/tooltip.phtml +27 -0
  254. app/etc/modules/Ultimate_ModuleCreator.xml +35 -0
  255. app/locale/en_US/Ultimate_ModuleCreator.csv +323 -0
  256. package.xml +20 -0
  257. readme_UMC.txt +25 -0
  258. skin/adminhtml/default/default/ultimate_modulecreator.css +43 -0
LICENSE_UMC.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ Copyright (c) 2012 Marius Strajeru
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * main admin block - grid container.
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator extends Mage_Adminhtml_Block_Widget_Grid_Container{
25
+ /**
26
+ * constructor
27
+ * @access protected
28
+ * @return void
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function __construct() {
32
+ $this->_controller = 'adminhtml_modulecreator';
33
+ $this->_blockGroup = 'modulecreator';
34
+ $this->_headerText = Mage::helper('modulecreator')->__('Manage modules');
35
+ parent::__construct();
36
+ $this->_updateButton('add', 'label', Mage::helper('modulecreator')->__('Create new module'));
37
+ }
38
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * admin edit block.
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit extends Mage_Adminhtml_Block_Widget_Form_Container{
25
+ /**
26
+ * construct
27
+ * @access public
28
+ * @return void
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function __construct(){
32
+ parent::__construct();
33
+ $this->_blockGroup = 'adminhtml';
34
+ $this->_controller = 'modulecreator';
35
+ $this->setTemplate('ultimate_modulecreator/edit.phtml');
36
+ }
37
+ /**
38
+ * get header text
39
+ * @access public
40
+ * @return string
41
+ * @see Mage_Adminhtml_Block_Widget_Container::getHeaderText()
42
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
43
+ */
44
+ public function getHeaderText(){
45
+ $data = Mage::registry('current_module');
46
+ if ($data){
47
+ return Mage::helper('modulecreator')->__('Edit "%s" module', $data->extension);
48
+ }
49
+ return Mage::helper('modulecreator')->__('Create Module');
50
+ }
51
+ /**
52
+ * prepare the layout
53
+ * @access protected
54
+ * @return Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit
55
+ * @see Mage_Adminhtml_Block_Widget_Form_Container::_prepareLayout()
56
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
57
+ */
58
+ protected function _prepareLayout(){
59
+ $this->setChild('back_button',
60
+ $this->getLayout()
61
+ ->createBlock('adminhtml/widget_button')
62
+ ->setData(array(
63
+ 'label' => Mage::helper('modulecreator')->__('Back'),
64
+ 'onclick' => 'setLocation(\''.$this->getUrl('*/*/').'\')',
65
+ 'class' => 'back'
66
+ ))
67
+ );
68
+ $this->setChild('reset_button',
69
+ $this->getLayout()
70
+ ->createBlock('adminhtml/widget_button')
71
+ ->setData(array(
72
+ 'label' => Mage::helper('modulecreator')->__('Reset'),
73
+ 'onclick' => 'setLocation(\''.$this->getUrl('*/*/*', array('_current'=>true)).'\')'
74
+ ))
75
+ );
76
+ if (!$this->isReadonly()){
77
+ $this->setChild('save_button',
78
+ $this->getLayout()
79
+ ->createBlock('adminhtml/widget_button')
80
+ ->setData(array(
81
+ 'label' => Mage::helper('modulecreator')->__('Save'),
82
+ 'onclick' => 'moduleForm.submit()',
83
+ 'class' => 'save'
84
+ ))
85
+ );
86
+ $this->setChild('save_and_edit_button',
87
+ $this->getLayout()
88
+ ->createBlock('adminhtml/widget_button')
89
+ ->setData(array(
90
+ 'label' => Mage::helper('modulecreator')->__('Save and Continue Edit'),
91
+ 'onclick' => 'saveAndContinueEdit(\''.$this->getSaveAndContinueUrl().'\')',
92
+ 'class' => 'save'
93
+ ))
94
+ );
95
+ }
96
+ return $this;
97
+ }
98
+ /**
99
+ * get the back button html
100
+ * @access public
101
+ * @return string
102
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
103
+ */
104
+ public function getBackButtonHtml(){
105
+ return $this->getChildHtml('back_button');
106
+ }
107
+ /**
108
+ * get the cancel button html
109
+ * @access public
110
+ * @return string
111
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
112
+ */
113
+ public function getCancelButtonHtml(){
114
+ return $this->getChildHtml('reset_button');
115
+ }
116
+ /**
117
+ * get the save button html
118
+ * @access public
119
+ * @return string
120
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
121
+ */
122
+ public function getSaveButtonHtml(){
123
+ return $this->getChildHtml('save_button');
124
+ }
125
+ /**
126
+ * get the save and continue edit button html
127
+ * @access public
128
+ * @return string
129
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
130
+ */
131
+ public function getSaveAndEditButtonHtml(){
132
+ return $this->getChildHtml('save_and_edit_button');
133
+ }
134
+ /**
135
+ * get the save and continue edit url
136
+ * @access public
137
+ * @return string
138
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
139
+ */
140
+ public function getSaveAndContinueUrl(){
141
+ return $this->getUrl('*/*/save', array(
142
+ '_current' => true,
143
+ 'back' => 'edit',
144
+ 'tab'=> '{{tab_id}}',
145
+ 'active_tab' => null
146
+ ));
147
+ }
148
+ /**
149
+ * get the validation url
150
+ * @access public
151
+ * @return string
152
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
153
+ */
154
+ public function getValidationUrl(){
155
+ return $this->getUrl('*/*/validate', array('_current'=>true));
156
+ }
157
+ /**
158
+ * check if edit mode is read only
159
+ * @access public
160
+ * @return bool
161
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
162
+ */
163
+ public function isReadonly(){
164
+ if (Mage::registry('module_read_only')){
165
+ return true;
166
+ }
167
+ if ($module = Mage::registry('current_module')){
168
+ $installedModules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
169
+ foreach ($installedModules as $installed){
170
+ if ($installed == $module->extension){
171
+ Mage::register('module_read_only', true);
172
+ return true;
173
+ }
174
+ }
175
+ }
176
+ return false;
177
+ }
178
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Form.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * admin form block
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Form extends Mage_Adminhtml_Block_Widget_Form{
25
+ /**
26
+ * prepare form
27
+ * @access protected
28
+ * @return Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit_Form
29
+ * @see Mage_Adminhtml_Block_Widget_Form::_prepareForm()
30
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
31
+ */
32
+ protected function _prepareForm() {
33
+ $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/modulecreator/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post'));
34
+ $form->setUseContainer(true);
35
+ $this->setForm($form);
36
+ return parent::_prepareForm();
37
+ }
38
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * entities tab
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface{
25
+ /**
26
+ * constructor
27
+ * @access public
28
+ * @return void
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function __construct(){
32
+ parent::__construct();
33
+ $this->setTemplate('ultimate_modulecreator/edit/tab/entities.phtml');
34
+ }
35
+ /**
36
+ * Return Tab label
37
+ * @access public
38
+ * @return string
39
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
40
+ */
41
+ public function getTabLabel(){
42
+ return Mage::helper('modulecreator')->__('Entities');
43
+ }
44
+ /**
45
+ * Return Tab title
46
+ * @access public
47
+ * @return string
48
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
49
+ */
50
+ public function getTabTitle(){
51
+ return Mage::helper('modulecreator')->__('Entities');
52
+ }
53
+ /**
54
+ * Can show tab in tabs
55
+ * @access public
56
+ * @return boolean
57
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
58
+ */
59
+ public function canShowTab(){
60
+ return true;
61
+ }
62
+
63
+ /**
64
+ * Tab is hidden
65
+ * @access public
66
+ * @return boolean
67
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
68
+ */
69
+ public function isHidden(){
70
+ return false;
71
+ }
72
+ /**
73
+ * get the "add entity" button html
74
+ * @access public
75
+ * @return string
76
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
77
+ */
78
+ public function getAddButtonHtml($suffix = ""){
79
+ if (Mage::registry('module_read_only')){
80
+ return '';
81
+ }
82
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
83
+ 'label' => Mage::helper('modulecreator')->__('Add entity'),
84
+ 'onclick' => 'addEntity();',
85
+ 'class' => 'add',
86
+ 'id' => 'add_entity_button'.$suffix
87
+ ));
88
+ return $button->toHtml();
89
+ }
90
+ /**
91
+ * get the url for adding an entity
92
+ * @access public
93
+ * @return string
94
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
95
+ */
96
+ public function getAddEntityUrl(){
97
+ return $this->getUrl('adminhtml/modulecreator/addEntity');
98
+ }
99
+ /**
100
+ * get the url for adding an attribute
101
+ * @access public
102
+ * @return string
103
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
104
+ */
105
+ public function getAddAttributeUrl(){
106
+ return $this->getUrl('adminhtml/modulecreator/addAttribute');
107
+ }
108
+ /**
109
+ * get the list of entities
110
+ * @access public
111
+ * @return array()
112
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
113
+ */
114
+ public function getEntities(){
115
+ $data = Mage::registry('current_module');
116
+ return Mage::helper('modulecreator')->getXmlEntities($data);
117
+ }
118
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities/Entity.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * entity block
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity extends Mage_Adminhtml_Block_Abstract{
25
+ /**
26
+ * get the field id
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getFieldId(){
32
+ return 'entity';
33
+ }
34
+ /**
35
+ * get a yes/no select
36
+ * @param string $id
37
+ * @param string $name
38
+ * @param int $selected
39
+ * @access public
40
+ * @return string
41
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
42
+ */
43
+ public function getYesNoSelect($id, $name, $selected){
44
+ $options[(int)($selected == 1)] = array('selected'=>'selected');
45
+ $options[1 - (int)($selected == 1)] = array();
46
+ $select = $this->getLayout()->createBlock('adminhtml/html_select')
47
+ ->setData(array(
48
+ 'class' => 'select required-entry',
49
+ 'id' => $id,
50
+ 'name' => $name
51
+ ))
52
+ ->addOption(1, Mage::helper('modulecreator')->__('Yes'), $options[1])
53
+ ->addOption(0, Mage::helper('modulecreator')->__('No'), $options[0]);
54
+ return $select->getHtml();
55
+ }
56
+ /**
57
+ * get a page template select
58
+ * @param string $id
59
+ * @param string $name
60
+ * @param string $selected
61
+ * @access public
62
+ * @return string
63
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
64
+ */
65
+ public function getTemplateSelect($id, $name, $selected){
66
+ $options = array();
67
+ $layouts = Mage::getSingleton('page/config')->getPageLayouts();
68
+ foreach ($layouts as $layout){
69
+ if ($selected == $layout->getTemplate()){
70
+ $options[$layout->getTemplate()] = array('selected'=>'selected');
71
+ }
72
+ else {
73
+ $options[$layout->getTemplate()] = array();
74
+ }
75
+ }
76
+ $select = $this->getLayout()->createBlock('adminhtml/html_select')
77
+ ->setData(array(
78
+ 'class' => 'select required-entry',
79
+ 'id' => $id,
80
+ 'name' => $name
81
+ ));
82
+ foreach ($layouts as $layout){
83
+ $select->addOption($layout->getTemplate(), $layout->getLabel(), $options[$layout->getTemplate()]);
84
+ }
85
+ return $select->toHtml();
86
+ }
87
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities/Entity/Attribute.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute block
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity_Attribute extends Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity{
25
+ /**
26
+ * get the field id
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getFieldId(){
32
+ return 'attribute';
33
+ }
34
+ /**
35
+ * get the select with the attribute types
36
+ * @param string $id
37
+ * @param string $name
38
+ * @param string $selected
39
+ * @access public
40
+ * @return string
41
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
42
+ */
43
+ public function getAttributeTypeSelect($id, $name, $selected){
44
+ $types = Mage::helper('modulecreator')->getAttributeTypes();
45
+ $select = $this->getLayout()->createBlock('adminhtml/html_select')
46
+ ->setData(array(
47
+ 'class' => 'select required-entry',
48
+ 'id' => $id,
49
+ 'name' => $name
50
+ ));
51
+ foreach ($types as $key=>$type){
52
+ if ($key === $selected){
53
+ $options = array('selected'=>'selected');
54
+ }
55
+ else{
56
+ $options = array();
57
+ }
58
+ $select->addOption($key, $type, $options);
59
+ }
60
+ return $select->getHtml();
61
+ }
62
+ /**
63
+ * get the select for the attribute scope
64
+ * not used yet... maybe used in the future for EAV entities
65
+ * @param string $id
66
+ * @param string $name
67
+ * @param string $selected
68
+ * @access public
69
+ * @return string
70
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
71
+ */
72
+ public function getScopeSelect($id, $name, $selected){
73
+ $scopes = Mage::helper('modulecreator')->getScopes();
74
+ $select = $this->getLayout()->createBlock('adminhtml/html_select')
75
+ ->setData(array(
76
+ 'class' => 'select required-entry',
77
+ 'id' => $id,
78
+ 'name' => $name
79
+ ));
80
+ foreach ($scopes as $key=>$scope){
81
+ if ($key === $selected){
82
+ $options = array('selected'=>'selected');
83
+ }
84
+ else{
85
+ $options = array();
86
+ }
87
+ $select->addOption($key, $scope, $options);
88
+ }
89
+ return $select->getHtml();
90
+ }
91
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Help.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * help tab block
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface{
25
+ /**
26
+ * constructor
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function __construct(){
32
+ parent::__construct();
33
+ $this->setTemplate('ultimate_modulecreator/edit/tab/help.phtml');
34
+ }
35
+ /**
36
+ * Return Tab label
37
+ * @access public
38
+ * @return string
39
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
40
+ */
41
+ public function getTabLabel(){
42
+ return Mage::helper('modulecreator')->__('Help');
43
+ }
44
+ /**
45
+ * Return Tab title
46
+ * @access public
47
+ * @return string
48
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
49
+ */
50
+ public function getTabTitle(){
51
+ return Mage::helper('modulecreator')->__('Help');
52
+ }
53
+ /**
54
+ * Can show tab in tabs
55
+ * @access public
56
+ * @return boolean
57
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
58
+ */
59
+ public function canShowTab(){
60
+ return true;
61
+ }
62
+
63
+ /**
64
+ * Tab is hidden
65
+ * @access public
66
+ * @return boolean
67
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
68
+ */
69
+ public function isHidden(){
70
+ return false;
71
+ }
72
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Relation.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * relations tab block
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Relation extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface{
25
+ /**
26
+ * constructor
27
+ * @access public
28
+ * @return void
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function __construct(){
32
+ parent::__construct();
33
+ $this->setTemplate('ultimate_modulecreator/edit/tab/relation.phtml');
34
+ }
35
+ /**
36
+ * Return Tab label
37
+ * @access public
38
+ * @return string
39
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
40
+ */
41
+ public function getTabLabel(){
42
+ return Mage::helper('modulecreator')->__('Entity Relations');
43
+ }
44
+ /**
45
+ * Return Tab title
46
+ * @access public
47
+ * @return string
48
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
49
+ */
50
+ public function getTabTitle(){
51
+ return Mage::helper('modulecreator')->__('Entity Relations');
52
+ }
53
+ /**
54
+ * Can show tab in tabs
55
+ * @access public
56
+ * @return boolean
57
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
58
+ */
59
+ public function canShowTab(){
60
+ return true;
61
+ }
62
+
63
+ /**
64
+ * Tab is hidden
65
+ * @access public
66
+ * @return boolean
67
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
68
+ */
69
+ public function isHidden(){
70
+ return count($this->getRelations()) > 0;
71
+ }
72
+ /**
73
+ * select with relations
74
+ * @access public
75
+ * @return string
76
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
77
+ */
78
+ public function getRelationSelect($id, $name, $selected){
79
+ $options = array();
80
+ $relations = Mage::helper('modulecreator')->getAvailableRelations();
81
+ foreach ($relations as $key=>$relation){
82
+ if ($selected == $key){
83
+ $options[$key] = array('selected'=>'selected');
84
+ }
85
+ else {
86
+ $options[$key] = array();
87
+ }
88
+ }
89
+ $select = $this->getLayout()->createBlock('adminhtml/html_select')
90
+ ->setData(array(
91
+ 'class' => 'select',
92
+ 'id' => $id,
93
+ 'name' => $name
94
+ ));
95
+ foreach ($relations as $key=>$relation){
96
+ $select->addOption($key, $relation, $options[$key]);
97
+ }
98
+ return $select->toHtml();
99
+ }
100
+ /**
101
+ * get the list of relations
102
+ * @access public
103
+ * @return array()
104
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
105
+ */
106
+ public function getRelations(){
107
+ if (!$this->hasData('relations')){
108
+ $data = Mage::registry('current_module');
109
+ $entities = Mage::helper('modulecreator')->getXmlEntities($data);
110
+ $relations = array();
111
+ if ($data){
112
+ $xmlRelations = $data->descend('relations');
113
+ if ($xmlRelations){
114
+ foreach ($xmlRelations->children() as $key =>$xmlRelation){
115
+ foreach ($xmlRelation->asArray() as $key=>$value){
116
+ $parts = explode('_', $key);
117
+ if (count($parts) != 2){
118
+ continue;
119
+ }
120
+ $found0 = -1;
121
+ $found1 = -1;
122
+ $title0 = '';
123
+ $title1 = '';
124
+ foreach ($entities as $ek=>$entity){
125
+ if ($entity->getNameSingular() == $parts[0]){
126
+ $found0 = $ek;
127
+ $title0 = $entity->getLabelSingular();
128
+ }
129
+ if ($entity->getNameSingular() == $parts[1]){
130
+ $found1 = $ek;
131
+ $title1 = $entity->getLabelSingular();
132
+ }
133
+ }
134
+ if ($found0 != -1 && $found1 != -1){
135
+ $val = array('t0'=>$title0, 't1'=>$title1, 'val'=>(string)$value);
136
+ $relations[$found0][$found1] = new Varien_Object($val);
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ $this->setData('relations', $relations);
143
+ }
144
+ return $this->getData('relations');
145
+ }
146
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Settings.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * settings tab block
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Settings extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface{
25
+ /**
26
+ * Return Tab label
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getTabLabel(){
32
+ return Mage::helper('modulecreator')->__('General Settings');
33
+ }
34
+ /**
35
+ * Return Tab title
36
+ * @access public
37
+ * @return string
38
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
39
+ */
40
+ public function getTabTitle(){
41
+ return Mage::helper('modulecreator')->__('General Settings');
42
+ }
43
+ /**
44
+ * Can show tab in tabs
45
+ * @access public
46
+ * @return boolean
47
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
48
+ */
49
+ public function canShowTab(){
50
+ return true;
51
+ }
52
+
53
+ /**
54
+ * Tab is hidden
55
+ * @access public
56
+ * @return boolean
57
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
58
+ */
59
+ public function isHidden(){
60
+ return false;
61
+ }
62
+ /**
63
+ * prepare the form
64
+ * @access public
65
+ * @return Ultimate_ModuleCreator_Block_Adminhtml_Edit_Tab_Settings
66
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
67
+ */
68
+ protected function _prepareForm(){
69
+ $form = new Varien_Data_Form();
70
+ $form->setHtmlIdPrefix('settings_');
71
+ $fieldWidth = '255';
72
+ $fieldset = $form->addFieldset('settings_fieldset', array('legend'=>Mage::helper('modulecreator')->__('General Information')));
73
+ $data = Mage::registry('current_module');
74
+ if ($data){
75
+ $values = new Varien_Object($data->asArray());
76
+ }
77
+ else{
78
+ $values = new Varien_Object(Mage::getStoreConfig('modulecreator/settings'));
79
+ }
80
+ $fieldset->addField('current_extension', 'hidden', array(
81
+ 'name' => 'current_extension',
82
+ 'value' => $values->getExtension()
83
+ ));
84
+ $fieldset->addField('namespace', 'text', array(
85
+ 'name' => 'namespace',
86
+ 'label' => Mage::helper('modulecreator')->__('Namespace'),
87
+ 'title' => Mage::helper('modulecreator')->__('Namespace'),
88
+ 'required' => true,
89
+ 'style' => 'width:'.$fieldWidth.'px',
90
+ 'value' => $values->getNamespace(),
91
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Namespace'), Mage::helper('modulecreator')->__('This is the folder name of your new extension. Your company name could go here. Use only letters and numbers. Start with a capital letter.'))
92
+ ));
93
+ $fieldset->addField('module_name', 'text', array(
94
+ 'name' => 'module_name',
95
+ 'label' => Mage::helper('modulecreator')->__('Module name'),
96
+ 'title' => Mage::helper('modulecreator')->__('Module name'),
97
+ 'required' => true,
98
+ 'value' => $values->getModuleName(),
99
+ 'style' => 'width:'.$fieldWidth.'px',
100
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Module name'), Mage::helper('modulecreator')->__('This is your extension name. You cannot name your extension with an existing name, not even under a different namespace.'))
101
+ ));
102
+ $fieldset->addField('codepool', 'select', array(
103
+ 'name' => 'codepool',
104
+ 'label' => Mage::helper('modulecreator')->__('Code pool'),
105
+ 'title' => Mage::helper('modulecreator')->__('Code pool'),
106
+ 'options' => Mage::getModel('modulecreator/adminhtml_system_config_source_codepool')->getAllOptions(),
107
+ 'required' => true,
108
+ 'value' => $values->getCodepool(),
109
+ 'style' => 'width:'.$fieldWidth.'px',
110
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Code pool'), Mage::helper('modulecreator')->__('This is the code folder in which your extension will be installed. If you don\'t know what goes here, choose "local"'))
111
+ ));
112
+ $installOptions = array(
113
+ 'name' => 'install',
114
+ 'label' => Mage::helper('modulecreator')->__('Action'),
115
+ 'title' => Mage::helper('modulecreator')->__('Action'),
116
+ 'options' => Mage::getModel('modulecreator/adminhtml_system_config_source_install')->getAllOptions(),
117
+ 'required' => true,
118
+ 'value' => $values->getInstall(),
119
+ 'style' => 'width:'.$fieldWidth.'px',
120
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Action'), Mage::helper('modulecreator')->__('This allows you to create an archive with your extension located in var/modulecreator folder of your current instance so you can edit it later or install it later manually by copying the "app" folder in the archive over the "app" folder of your instance and the "skin" folder in the archive over the "skin" folder of your instance. If you choose to install it directly please backup first. If you choose to install it you won\'t be able to edit it later.' ))
121
+ );
122
+ if (!Mage::helper('modulecreator')->canInstall()){
123
+ $installOptions['disabled'] = 'disabled';
124
+ $installOptions['value'] = 0;
125
+ }
126
+ $fieldset->addField('install', 'select', $installOptions);
127
+ $fieldsetDesign = $form->addFieldset('settings_design_fieldset', array('legend'=>Mage::helper('modulecreator')->__('Design')));
128
+ $fieldsetDesign->addField('front_package', 'text', array(
129
+ 'name' => 'front_package',
130
+ 'label' => Mage::helper('modulecreator')->__('Frontend package'),
131
+ 'title' => Mage::helper('modulecreator')->__('Frontend package'),
132
+ 'required' => true,
133
+ 'value' => ($values->getFrontPackage()) ? $values->getFrontPackage() : Mage_Core_Model_Design_Package::BASE_PACKAGE,
134
+ 'style' => 'width:'.$fieldWidth.'px',
135
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Frontend package'), Mage::helper('modulecreator')->__('This is the name of the design interface (package) of your mangento instance. If you don\'t know what goes here put "base".' ))
136
+ ));
137
+ $fieldsetDesign->addField('front_templates', 'text', array(
138
+ 'name' => 'front_templates',
139
+ 'label' => Mage::helper('modulecreator')->__('Frontend theme - templates'),
140
+ 'title' => Mage::helper('modulecreator')->__('Frontend theme - templates'),
141
+ 'required' => true,
142
+ 'value' => ($values->getFrontTemplates()) ? $values->getFrontTemplates() : Mage_Core_Model_Design_Package::DEFAULT_THEME,
143
+ 'style' => 'width:'.$fieldWidth.'px',
144
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Frontend theme - templates'), Mage::helper('modulecreator')->__('This is the name of the theme of your mangento instance for the template files. If you don\'t know what goes here put "default".' ))
145
+ ));
146
+ $fieldsetDesign->addField('front_layout', 'text', array(
147
+ 'name' => 'front_layout',
148
+ 'label' => Mage::helper('modulecreator')->__('Frontend theme - layout'),
149
+ 'title' => Mage::helper('modulecreator')->__('Frontend theme - layout'),
150
+ 'required' => true,
151
+ 'value' => ($values->getFrontLayout()) ? $values->getFrontLayout() : Mage_Core_Model_Design_Package::DEFAULT_THEME,
152
+ 'style' => 'width:'.$fieldWidth.'px',
153
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Frontend theme - layout'), Mage::helper('modulecreator')->__('This is the name of the theme of your mangento instance for the layout files. If you don\'t know what goes here put "default".' ))
154
+ ));
155
+
156
+ $fieldsetDesign = $form->addFieldset('settings_additional_fieldset', array('legend'=>Mage::helper('modulecreator')->__('Additional')));
157
+ $fieldsetDesign->addField('license', 'textarea', array(
158
+ 'name' => 'license',
159
+ 'label' => Mage::helper('modulecreator')->__('License'),
160
+ 'title' => Mage::helper('modulecreator')->__('License'),
161
+ 'required' => true,
162
+ 'value' => $values->getLicense(),
163
+ 'style' => 'width:'.$fieldWidth.'px',
164
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('License'), Mage::helper('modulecreator')->__('Added at the top of every generated file.').'<br />'.Mage::helper('modulecreator')->__('Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} for current year.'))
165
+ ));
166
+ $fieldsetDesign->addField('sort_order', 'text', array(
167
+ 'name' => 'sort_order',
168
+ 'label' => Mage::helper('modulecreator')->__('Menu sort order'),
169
+ 'title' => Mage::helper('modulecreator')->__('Menu sort order'),
170
+ 'required' => true,
171
+ 'value' => $values->getSortOrder(),
172
+ 'note' => Mage::helper('modulecreator')->__('See current menus sort order <a href="#" onclick="%s">here</a>', 'showMenuOrder(1);return false;'),
173
+ 'style' => 'width:'.$fieldWidth.'px',
174
+ 'after_element_html'=> Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Menu sort order'), Mage::helper('modulecreator')->__('This sets the position of your extension menu in the entire admin menu.'))
175
+ ));
176
+ $this->setForm($form);
177
+ $form->addFieldNameSuffix('settings');
178
+ return parent::_prepareForm();
179
+ }
180
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tabs.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * admin tabs block
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs{
25
+ /**
26
+ * construct
27
+ * @access public
28
+ * @return void
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function __construct() {
32
+ parent::__construct();
33
+ $this->setId('modulecreator_info_tabs');
34
+ $this->setDestElementId('edit_form');
35
+ $this->setTitle(Mage::helper('modulecreator')->__('Module information'));
36
+ }
37
+ }
app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Grid.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * main admin block - grid container.
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Grid extends Mage_Adminhtml_Block_Widget_Grid{
25
+ /**
26
+ * Initialize Grid block
27
+ * @access public
28
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
29
+ */
30
+ public function __construct(){
31
+ parent::__construct();
32
+ $this->_defaultLimit = 200;
33
+ $this->setId('ModuleCreator_grid');
34
+ $this->setUseAjax(true);
35
+ }
36
+
37
+ /**
38
+ * Creates extension collection if it has not been created yet
39
+ * @access public
40
+ * @return Ultimate_ModuleCreator_Model_Module_Collection
41
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
42
+ */
43
+ public function getCollection(){
44
+ if (!$this->_collection) {
45
+ $this->_collection = Mage::getModel('modulecreator/module_collection');
46
+ }
47
+ return $this->_collection;
48
+ }
49
+ /**
50
+ * Prepare Collection for Grid
51
+ * @access protected
52
+ * @return Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Grid
53
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
54
+ */
55
+ protected function _prepareCollection(){
56
+ $this->setCollection($this->getCollection());
57
+ return parent::_prepareCollection();
58
+ }
59
+
60
+ /**
61
+ * Prepare grid columns
62
+ * @access protected
63
+ * @return Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Grid
64
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
65
+ */
66
+ protected function _prepareColumns(){
67
+ $this->addColumn('filename_id', array(
68
+ 'header' => Mage::helper('modulecreator')->__('Module'),
69
+ 'index' => 'filename_id',
70
+ ));
71
+ $this->addColumn('action',
72
+ array(
73
+ 'header'=> Mage::helper('modulecreator')->__('Download'),
74
+ 'width' => '100',
75
+ 'type' => 'action',
76
+ 'getter'=> 'getSafeId',
77
+ 'actions' => array(
78
+ array(
79
+ 'caption' => Mage::helper('modulecreator')->__('Download'),
80
+ 'url' => array('base'=> '*/*/download'),
81
+ 'field' => 'id'
82
+ )
83
+ ),
84
+ 'filter'=> false,
85
+ 'is_system' => true,
86
+ 'sortable' => false,
87
+ ));
88
+
89
+ return parent::_prepareColumns();
90
+ }
91
+
92
+ /**
93
+ * Self URL getter
94
+ * @access public
95
+ * @param array() $params
96
+ * @return string
97
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
98
+ */
99
+ public function getCurrentUrl($params = array()){
100
+ if (!isset($params['_current'])) {
101
+ $params['_current'] = true;
102
+ }
103
+ return $this->getUrl('*/*/grid', $params);
104
+ }
105
+ /**
106
+ * Row URL getter
107
+ * @access public
108
+ * @param Ultimate_ModuleCreator_Model_Module
109
+ * @return string
110
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
111
+ */
112
+ public function getRowUrl($row){
113
+ return $this->getUrl('*/*/edit', array('id' => strtr(base64_encode($row->getFilenameId()), '+/=', '-_,')));
114
+ }
115
+ }
app/code/community/Ultimate/ModuleCreator/Exception.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Exception
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Exception extends Mage_Core_Exception{
25
+
26
+ }
app/code/community/Ultimate/ModuleCreator/Helper/Adminhtml.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * @category Ultimate
19
+ * @package Ultimate_ModuleCreator
20
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
21
+ */
22
+ class Ultimate_ModuleCreator_Helper_Adminhtml extends Mage_Core_Helper_Abstract{
23
+ /**
24
+ * tooltip block
25
+ * @var Mage_Adminhtml_Block_Template
26
+ */
27
+ protected $_tooltipBlock = null;
28
+ /**
29
+ * get the tooltip html
30
+ * @access public
31
+ * @param string $title
32
+ * @param string $text
33
+ * @return string
34
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
35
+ */
36
+ public function getTooltipHtml($title, $text){
37
+ return $this->getTooltipBlock()->setTitle($title)->setMessage($text)->toHtml();
38
+ }
39
+ /**
40
+ * get the tooltip block for help messages
41
+ * @access public
42
+ * @return Mage_Adminhtml_Block_Template
43
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
44
+ */
45
+ public function getTooltipBlock(){
46
+ if (is_null($this->_tooltipBlock)){
47
+ $this->_tooltipBlock = Mage::app()->getLayout()->createBlock('adminhtml/template')->setTemplate('ultimate_modulecreator/tooltip.phtml');
48
+ }
49
+ return $this->_tooltipBlock;
50
+ }
51
+ }
app/code/community/Ultimate/ModuleCreator/Helper/Data.php ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * @category Ultimate
19
+ * @package Ultimate_ModuleCreator
20
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
21
+ */
22
+ class Ultimate_ModuleCreator_Helper_Data extends Mage_Core_Helper_Data{
23
+ const RELATION_TYPE_NONE = 0;
24
+ const RELATION_TYPE_PARENT = 1;
25
+ const RELATION_TYPE_CHILD = 2;
26
+ const RELATION_TYPE_SIBLING = 3;
27
+ /**
28
+ * restricted module names
29
+ * @var array()
30
+ */
31
+ public static $_restrictedModuleNames = array();
32
+ /**
33
+ * restricted entity names
34
+ * @var array()
35
+ */
36
+ public static $_restrictedEntityNames = array(
37
+ 'resource', 'setup', 'attribute', 'system', 'flat', 'data', 'collection', 'adminhtml', 'widget', 'observer'
38
+ );
39
+ /**
40
+ * get a list with "special attribute" names and error messages
41
+ * @access public
42
+ * @return array()
43
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
44
+ */
45
+ public function getSpecialAttributeNames(){
46
+ $names = array();
47
+ $names['created_at'] = $this->__('An attribute named "created_at" will be added by default to your entity');
48
+ $names['updated_at'] = $this->__('An attribute named "updated_at" will be added by default to your entity');
49
+ $names['status'] = $this->__('"status" is a reserved attribute name. If you want to add it set "Add Status field" to "Yes"');
50
+ $names['in_rss'] = $this->__('"in_rss" is a reserved attribute name. If you want to add it set "Create RSS feed" to "Yes"');
51
+ $names['meta_title'] = $this->__('"meta_title" is a reserved attribute name. If you want to add it set "Add SEO Attributes" to "Yes"');
52
+ $names['meta_description'] = $this->__('"meta_description" is a reserved attribute name. If you want to add it set "Add SEO Attributes" to "Yes"');
53
+ $names['meta_keywords'] = $this->__('"meta_keywords" is a reserved attribute name. If you want to add it set "Add SEO Attributes" to "Yes"');
54
+ return $names;
55
+ }
56
+ /**
57
+ * get local extension packages path
58
+ * @access public
59
+ * @return string
60
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
61
+ */
62
+ public function getLocalPackagesPath(){
63
+ return $this->getLocalModulesDir().'package'.DS;
64
+ }
65
+ /**
66
+ * get local extension path
67
+ * @access public
68
+ * @return string
69
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
70
+ */
71
+ public function getLocalModulesDir(){
72
+ return Mage::getBaseDir('var').DS.'modulecreator'.DS;
73
+ }
74
+ /**
75
+ * get a list of attribute types
76
+ * @access public
77
+ * @param bool $withEmpty
78
+ * @return array
79
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
80
+ */
81
+ public function getAttributeTypes($withEmpty = true){
82
+ $options = array();
83
+ if ($withEmpty){
84
+ $options[''] = Mage::helper('modulecreator')->__('Select type');
85
+ }
86
+ $options['text'] = Mage::helper('modulecreator')->__('Text');
87
+ $options['int'] = Mage::helper('modulecreator')->__('Integer');
88
+ $options['decimal'] = Mage::helper('modulecreator')->__('Decimal');
89
+ $options['textarea'] = Mage::helper('modulecreator')->__('Textarea');
90
+ $options['yesno'] = Mage::helper('modulecreator')->__('Yes/No');
91
+ $options['timestamp'] = Mage::helper('modulecreator')->__('Timestamp');
92
+ $options['file'] = Mage::helper('modulecreator')->__('File');
93
+ $options['image'] = Mage::helper('modulecreator')->__('Image');
94
+ $options['website'] = Mage::helper('modulecreator')->__('Website');
95
+ return $options;
96
+ }
97
+ /**
98
+ * get a list of attribute scopes
99
+ * not used yet - maybe for EAV entities
100
+ * @access public
101
+ * @param bool $withEmpty
102
+ * @return string
103
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
104
+ */
105
+ public function getScopes($withEmpty = true){
106
+ $options = array();
107
+ if ($withEmpty){
108
+ $options[''] = Mage::helper('modulecreator')->__('Select scope');
109
+ }
110
+ $options[Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE] = Mage::helper('modulecreator')->__('Store View');
111
+ $options[Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE] = Mage::helper('modulecreator')->__('Website');
112
+ $options[Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL] = Mage::helper('modulecreator')->__('Global');
113
+ return $options;
114
+ }
115
+ /**
116
+ * load a module
117
+ * @access public
118
+ * @param string $module
119
+ * @return mixed (Varien_Simplexml_Element|bool)
120
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
121
+ */
122
+ public function loadModule($module){
123
+ $path = $this->getLocalPackagesPath();
124
+ $xmlFile = $path . $module . '.xml';
125
+ if (file_exists($xmlFile) && is_readable($xmlFile)) {
126
+ $xml = simplexml_load_file($xmlFile, 'Varien_Simplexml_Element');
127
+ if (!empty($xml)) {
128
+ return $xml;
129
+ }
130
+ }
131
+ return false;
132
+ }
133
+ /**
134
+ * check if module can be installed directly
135
+ * @access public
136
+ * @return bool
137
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
138
+ */
139
+ public function canInstall(){
140
+ return !$this->isBetaRelease();
141
+ }
142
+ /**
143
+ * check if is beta release
144
+ * @access public
145
+ * @return bool
146
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
147
+ */
148
+ public function isBetaRelease(){
149
+ return Mage::getStoreConfigFlag('modulecreator/release/beta');
150
+ }
151
+ /**
152
+ * validate a sting for module name
153
+ * @access public
154
+ * @param string $string
155
+ * @param string $replacer
156
+ * @return string
157
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
158
+ */
159
+ public function getValidLowerString($string, $replacer = "_"){
160
+ if (strlen($string) == 0){
161
+ return '';
162
+ }
163
+ if (is_numeric($string[0])){
164
+ return '';
165
+ }
166
+ $string = str_replace(' ', $replacer, $string);
167
+ $string = strtolower($string);
168
+ $string = trim($string, "$replacer ");
169
+ return $string;
170
+ }
171
+ /**
172
+ * validate a module name
173
+ * @access public
174
+ * @param string $module
175
+ * @param string $currentExtension
176
+ * @return bool
177
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
178
+ */
179
+ public function validateModuleName($module, $currentExtension){
180
+ if ($this->isBetaRelease()){
181
+ $currentExtension = null;
182
+ }
183
+ $_module = $this->getValidLowerString($module, '');
184
+ if (in_array($_module, self::$_restrictedModuleNames)){
185
+ return $this->__('A module cannot be named %s', $module);
186
+ }
187
+ $parts = explode('_', $currentExtension);
188
+ if (isset($parts[1])){
189
+ if (strtolower($parts[1]) == $_module){
190
+ return true;
191
+ }
192
+ }
193
+ $config = Mage::getConfig()->getNode('global/models/'.$_module);
194
+ if ($config){
195
+ return $this->__('A module cannot be named %s', $module);
196
+ }
197
+ return true;
198
+ }
199
+ /**
200
+ * validate extension name
201
+ * @access public
202
+ * @param string $namespace
203
+ * @param string $module
204
+ * @param string $currentExtension
205
+ * @return bool
206
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
207
+ */
208
+ public function validateExtensionName($namespace, $module, $currentExtension){
209
+ if ($this->isBetaRelease()){
210
+ $currentExtension = null;
211
+ }
212
+ $namespace = ucfirst($this->getValidLowerString($namespace, ''));
213
+ $module = ucfirst($this->getValidLowerString($module, ''));
214
+ $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
215
+ $extensionName = $namespace.'_'.$module;
216
+ if ($extensionName == '_'){
217
+ return $this->__('Extension name can not be empty.');
218
+ }
219
+ if ($extensionName == $currentExtension){
220
+ return true;
221
+ }
222
+ foreach ($modules as $_module){
223
+ if ($_module == $extensionName){
224
+ return $this->__('Extension %s already exists', $extensionName);
225
+ }
226
+ }
227
+ return true;
228
+ }
229
+ /**
230
+ * validate an entity name
231
+ * @access public
232
+ * @param string $module
233
+ * @param string $entity
234
+ * @param string $currentExtension
235
+ * @return bool
236
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
237
+ */
238
+ public function validateEntityName($module, $entity, $currentExtension){
239
+ $module = $this->getValidLowerString($module, '');
240
+ $entity = $this->getValidLowerString($entity, '');
241
+ if (in_array($entity, self::$_restrictedEntityNames)){
242
+ return $this->__('An entity cannot be named %s', $entity);
243
+ }
244
+ try{
245
+ $model = Mage::getModel($module.'/'.$entity);
246
+ $class = get_class($model);
247
+ if ($class != ''){
248
+ if (!empty($currentExtension) && substr($class, 0, strlen($currentExtension)) != $currentExtension){
249
+ return $this->__('An entity cannot be named %s inside the module %s', $entity, $module);
250
+ }
251
+ }
252
+ }
253
+ catch (Exception $e){
254
+ return true;
255
+ }
256
+ return true;
257
+ }
258
+ /**
259
+ * validate an attribute name
260
+ * @access public
261
+ * @param string $attribute
262
+ * @return mixed (bool|string)
263
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
264
+ */
265
+ public function validateAttributeName($attribute){
266
+ $origAttribute = $attribute;
267
+ $methods = get_class_methods('Mage_Catalog_Model_Abstract');
268
+ $start = array('get', 'set', 'has', 'uns');
269
+ $attribute = $this->getValidLowerString($attribute);
270
+ foreach ($methods as $method){
271
+ if (in_array(substr($method, 0, 3), $start)){
272
+ $key = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", substr($method,3)));
273
+ if ($key == $attribute){
274
+ return $this->__('An attribute cannot be named %s.', $origAttribute);
275
+ }
276
+ }
277
+ }
278
+ $specialNames = $this->getSpecialAttributeNames();
279
+ foreach ($specialNames as $name=>$message){
280
+ if ($name == $attribute){
281
+ return $message;
282
+ }
283
+ }
284
+ return true;
285
+ }
286
+ /**
287
+ * get available relation types
288
+ * @access public
289
+ * @return array
290
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
291
+ */
292
+ public function getAvailableRelations(){
293
+ return array(
294
+ self::RELATION_TYPE_NONE => $this->__('--None--'),
295
+ self::RELATION_TYPE_PARENT => $this->__('Is parent for'),
296
+ self::RELATION_TYPE_CHILD => $this->__('Is child of'),
297
+ self::RELATION_TYPE_SIBLING => $this->__('Is siblig with')
298
+ );
299
+ }
300
+ /**
301
+ * parse xml to get entities
302
+ * @access public
303
+ * @param string $data
304
+ * @return array
305
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
306
+ */
307
+ public function getXmlEntities($data){
308
+ $entities = array();
309
+ if ($data){
310
+ $xmlEntities = $data->descend('entities/entity');
311
+ if ($xmlEntities){
312
+ foreach ($xmlEntities as $xmlEntity){
313
+ $entity = new Varien_Object();
314
+ foreach ($xmlEntity as $tag=>$value){
315
+ if ($tag != 'attributes'){
316
+ $entity->setData($tag, (string)$value);
317
+ }
318
+ $attributes = array();
319
+ foreach ($xmlEntity->descend('attributes/attribute') as $xmlAttribute){
320
+ $attribute = $xmlAttribute->asArray();
321
+ $attributes[] = $attribute;
322
+ }
323
+ $entity->setAttributes($attributes);
324
+ }
325
+ $entities[] = $entity;
326
+ }
327
+ }
328
+ }
329
+ return $entities;
330
+ }
331
+ }
app/code/community/Ultimate/ModuleCreator/Model/Abstract.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ class Ultimate_ModuleCreator_Model_Abstract extends Varien_Object{
18
+ /**
19
+ * to array
20
+ * @access public
21
+ * @return array()
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ public function __toArray(array $arrAttributes = array()){
25
+ if (empty($arrAttributes)) {
26
+ $arrAttributes = array_keys($this->_data);
27
+ }
28
+ $arrRes = array();
29
+ foreach ($arrAttributes as $attribute) {
30
+ $arrRes[$attribute] = $this->getDataUsingMethod($attribute);
31
+ }
32
+ return $arrRes;
33
+ }
34
+ }
app/code/community/Ultimate/ModuleCreator/Model/Adminhtml/System/Config/Source/Codepool.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * codepool source model
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Adminhtml_System_Config_Source_Codepool{
25
+ /**
26
+ * get the list of available codepools - intentionally not translated
27
+ * @access public
28
+ * @param bool $withEmpty
29
+ * @return array
30
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
31
+ */
32
+ public function toOptionArray($withEmpty = false){
33
+ $options = array();
34
+ if ($withEmpty){
35
+ $options[] = array('value'=>'', 'label'=>Mage::helper('modulecreator')->__('Select a codepool'));
36
+ }
37
+ $options[] = array('value' => 'local', 'label'=>'local');
38
+ $options[] = array('value' => 'community', 'label'=>'community');
39
+ return $options;
40
+ }
41
+ /**
42
+ * get options as an array
43
+ * @access public
44
+ * @params bool $withEmpty
45
+ * @return array
46
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
47
+ */
48
+ public function getAllOptions($withEmpty = true){
49
+ $options = array();
50
+ foreach ($this->toOptionArray($withEmpty) as $key=>$option){
51
+ $options[$option['value']] = $option['label'];
52
+ }
53
+ return $options;
54
+ }
55
+ }
app/code/community/Ultimate/ModuleCreator/Model/Adminhtml/System/Config/Source/Install.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * install source model
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Adminhtml_System_Config_Source_Install{
25
+ /**
26
+ * get the list of available install actions
27
+ * @access public
28
+ * @param bool $withEmpty
29
+ * @return array
30
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
31
+ */
32
+ public function toOptionArray($withEmpty = false){
33
+ $options = array();
34
+ if ($withEmpty){
35
+ $options[] = array('value'=>'', 'label'=>Mage::helper('modulecreator')->__('Select action'));
36
+ }
37
+ $options[] = array('value' => '1', 'label'=>Mage::helper('modulecreator')->__('Install new extension on the current instance.'));
38
+ $options[] = array('value' => '0', 'label'=>Mage::helper('modulecreator')->__('Create archive. I will install it later'));
39
+ return $options;
40
+ }
41
+ /**
42
+ * get options as an array
43
+ * @access public
44
+ * @params bool $withEmpty
45
+ * @return array
46
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
47
+ */
48
+ public function getAllOptions($withEmpty = true){
49
+ $options = array();
50
+ foreach ($this->toOptionArray($withEmpty) as $key=>$option){
51
+ $options[$option['value']] = $option['label'];
52
+ }
53
+ return $options;
54
+ }
55
+ }
app/code/community/Ultimate/ModuleCreator/Model/Adminhtml/System/Config/Source/Layout.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * layout source model
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+
25
+ class Ultimate_ModuleCreator_Model_Adminhtml_System_Config_Source_Layout{
26
+ /**
27
+ * get the list of available layouts
28
+ * @access public
29
+ * @return array
30
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
31
+ */
32
+ public function toOptionArray(){
33
+ $options = array();
34
+ $layouts = Mage::getSingleton('page/config')->getPageLayouts();
35
+ foreach ($layouts as $layout){
36
+ $options[] = array(
37
+ 'value'=>$layout->getTemplate(),
38
+ 'label'=>$layout->getLabel()
39
+ );
40
+ }
41
+ return $options;
42
+ }
43
+ /**
44
+ * get options as an array
45
+ * @access public
46
+ * @param bool $includeEmpty
47
+ * @return array
48
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
49
+ */
50
+ public function getAllOptions($includeEmpty = true){
51
+ $options = array();
52
+ foreach ($this->toOptionArray() as $key=>$option){
53
+ if (!$includeEmpty && $key == 0){
54
+ continue;
55
+ }
56
+ $options[$option['value']] = $option['label'];
57
+ }
58
+ return $options;
59
+ }
60
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute.php ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * entity model
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute extends Ultimate_ModuleCreator_Model_Abstract{
25
+ /**
26
+ * entity object
27
+ * @var mixed(null|Ultimate_ModuleCreator_Model_Entity)
28
+ */
29
+ protected $_entity = null;
30
+ /**
31
+ * attribyte type instance
32
+ * @var mixed(null|Ultimate_ModuleCreator_Model_Attribute_Type_Abstract)
33
+ */
34
+ protected $_typeInstance = null;
35
+ /**
36
+ * set the model entity
37
+ * @access public
38
+ * @param Ultimate_ModuleCreator_Model_Entity $entity
39
+ * @return Ultimate_ModuleCreator_Model_Attribute
40
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
41
+ */
42
+ public function setEntity(Ultimate_ModuleCreator_Model_Entity $entity){
43
+ $this->_entity = $entity;
44
+ return $this;
45
+ }
46
+ /**
47
+ * get the attribute entity
48
+ * @access public
49
+ * @return mixed (Ultimate_ModuleCreator_Model_Entity|null)
50
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
51
+ */
52
+ public function getEntity(){
53
+ return $this->_entity;
54
+ }
55
+ /**
56
+ * get placeholders
57
+ * @access publoc
58
+ * @return array
59
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
60
+ */
61
+ public function getPlaceholders(){
62
+ $placeholders['{{attributeLabel}}'] = $this->getLabel();
63
+ $placeholders['{{AttributeMagicCode}}'] = $this->getMagicMethodCode();
64
+ $placeholders['{{attributeCode}}'] = $this->getCode();
65
+ $placeholders['{{attributeColumnOptions}}'] = $this->getColumnOptions();
66
+ $placeholders['{{attributeFormType}}'] = $this->getFormType();
67
+ $placeholders['{{attributeFormOptions}}'] = $this->getFormOptions();
68
+ $placeholders['{{attributePreElementText}}']= $this->getPreElementText();
69
+ $placeholders['{{attributeRssText}}'] = $this->getRssText();
70
+ $placeholders['{{attributeNote}}'] = $this->getNote();
71
+ return $placeholders;
72
+ }
73
+ /**
74
+ * get the magic function code for attribute
75
+ * @access public
76
+ * @return string
77
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
78
+ */
79
+ public function getMagicMethodCode(){
80
+ $code = $this->getCode();
81
+ return $this->_camelize($code);
82
+ }
83
+ /**
84
+ * get attribute the type instance
85
+ * @access public
86
+ * @return Ultimate_ModuleCreator_Model_Attribute_Type_Abstract
87
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
88
+ */
89
+ public function getTypeInstance(){
90
+ if (!$this->_typeInstance){
91
+ if (!$this->getType()){
92
+ $type = 'abstract';
93
+ }
94
+ else{
95
+ $type = $this->getType();
96
+ }
97
+ try{
98
+ $this->_typeInstance = Mage::getModel('modulecreator/attribute_type_'.$type);
99
+ $this->_typeInstance->setAttribute($this);
100
+ }
101
+ catch (Exception $e){
102
+ throw new Ultimate_ModuleCreator_Exception("Invalid attribute type: ". $type);
103
+ }
104
+ }
105
+ return $this->_typeInstance;
106
+ }
107
+ /**
108
+ * get the admin grid column options
109
+ * @access public
110
+ * @return string
111
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
112
+ */
113
+ public function getColumnOptions(){
114
+ return $this->getTypeInstance()->getColumnOptions();
115
+ }
116
+ /**
117
+ * check if an attribute is in the admin grid
118
+ * @access public
119
+ * @return bool
120
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
121
+ */
122
+ public function getAdminGrid(){
123
+ if ($this->getIsName()){
124
+ return true;
125
+ }
126
+ return $this->getTypeInstance()->getAdminGrid();
127
+ }
128
+ /**
129
+ * check if an attribute can use an editor
130
+ * @access public
131
+ * @return bool
132
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
133
+ */
134
+ public function getEditor(){
135
+ return $this->getTypeInstance()->getEditor();
136
+ }
137
+ /**
138
+ * get the type for the form
139
+ * @access public
140
+ * @return string
141
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
142
+ */
143
+ public function getFormType(){
144
+ return $this->getTypeInstance()->getFormType();
145
+ }
146
+ /**
147
+ * get the additional data for the form
148
+ * @access public
149
+ * @return string
150
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
151
+ */
152
+ public function getFormOptions(){
153
+ return $this->getTypeInstance()->getFormOptions();
154
+ }
155
+ /**
156
+ * get the sql column
157
+ * @access public
158
+ * @return string
159
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
160
+ */
161
+ public function getSqlColumn(){
162
+ return $this->getTypeInstance()->getSqlColumn();
163
+ }
164
+ /**
165
+ * get the frontend html
166
+ * @access public
167
+ * @return string
168
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
169
+ */
170
+ public function getFrontendHtml(){
171
+ return $this->getTypeInstance()->getFrontendHtml();
172
+ }
173
+ /**
174
+ * get text before the element in the admin grid
175
+ * @access public
176
+ * @return string
177
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
178
+ */
179
+ public function getPreElementText(){
180
+ return $this->getTypeInstance()->getPreElementText();
181
+ }
182
+ /**
183
+ * get RSS feed text
184
+ * @access public
185
+ * @return string
186
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
187
+ */
188
+ public function getRssText(){
189
+ return $this->getTypeInstance()->getRssText();
190
+ }
191
+ /**
192
+ * gcheck if attribute is required
193
+ * @access public
194
+ * @return string
195
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
196
+ */
197
+ public function getRequired(){
198
+ if ($this->getIsName()){
199
+ return true;
200
+ }
201
+ return $this->getTypeInstance()->getRequired();
202
+ }
203
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Abstract.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type abstract
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Abstract extends Varien_Object{
25
+ /**
26
+ * separator for options
27
+ * @var string
28
+ */
29
+ const OPTION_SEPARATOR = "\t\t\t";
30
+ /**
31
+ * attribute memebr
32
+ * @var mixed(null|Ultimate_ModuleCreator_Model_Attribute)
33
+ */
34
+ protected $_attribute = null;
35
+ /**
36
+ * set attribute
37
+ * @access public
38
+ * @param Ultimate_ModuleCreator_Model_Attribute $attribute
39
+ * @return Ultimate_ModuleCreator_Model_Attribute_Type_Abstract
40
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
41
+ */
42
+ public function setAttribute(Ultimate_ModuleCreator_Model_Attribute $attribute){
43
+ $this->_attribute = $attribute;
44
+ return $this;
45
+ }
46
+ /**
47
+ * get the attribute
48
+ * @access public
49
+ * @return mixed(null|Ultimate_ModuleCreator_Model_Attribute)
50
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
51
+ */
52
+ public function getAttribute(){
53
+ return $this->_attribute;
54
+ }
55
+ /**
56
+ * get the grid column options
57
+ * @access public
58
+ * @return string
59
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
60
+ */
61
+ public function getColumnOptions(){
62
+ return "'type' => 'text',"."\n";
63
+ }
64
+ /**
65
+ * check if an attribute is in the admin grid
66
+ * @access public
67
+ * @return bool
68
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
69
+ */
70
+ public function getAdminGrid(){
71
+ return $this->getAttribute()->getData('admin_grid');
72
+ }
73
+ /**
74
+ * check if an attribute uses an editor
75
+ * @access public
76
+ * @return bool
77
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
78
+ */
79
+ public function getEditor(){
80
+ return false;
81
+ }
82
+ /**
83
+ * check if an attribute is required
84
+ * @access public
85
+ * @return bool
86
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
87
+ */
88
+ public function getRequired(){
89
+ return $this->getAttribute()->getData('required');
90
+ }
91
+ /**
92
+ * get the type for the form
93
+ * @access public
94
+ * @return string
95
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
96
+ */
97
+ public function getFormType(){
98
+ return 'text';
99
+ }
100
+ /**
101
+ * get the options for form input
102
+ * @access public
103
+ * @return string
104
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
105
+ */
106
+ public function getFormOptions(){
107
+ $options = '';
108
+ $note = $this->getAttribute()->getNote();
109
+ if ($note){
110
+ $options .= self::OPTION_SEPARATOR."'note' => $"."this->__('".$note."'),"."\n";
111
+ }
112
+ if ($this->getRequired()){
113
+ $options .= self::OPTION_SEPARATOR."'required' => true,"."\n";
114
+ $options .= self::OPTION_SEPARATOR."'class' => 'required-entry',"."\n";
115
+ }
116
+ return $options."\n";
117
+ }
118
+ /**
119
+ * get the text before the element in the admin form
120
+ * @access public
121
+ * @return string
122
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
123
+ */
124
+ public function getPreElementText(){
125
+ return '';
126
+ }
127
+ /**
128
+ * get the sql column
129
+ * @access public
130
+ * @return string
131
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
132
+ */
133
+ public function getSqlColumn(){
134
+ return '`'.$this->getAttribute()->getCode().'` varchar(255) '.$this->getNullSql().' default \'\',';
135
+ }
136
+ /**
137
+ * check if sql column can be null
138
+ * @access public
139
+ * @return string
140
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
141
+ */
142
+ public function getNullSql(){
143
+ if ($this->getAttribute()->getRequired()){
144
+ return 'NOT NULL';
145
+ }
146
+ return 'NULL';
147
+ }
148
+ /**
149
+ * get the html for frontend
150
+ * @access public
151
+ * @return string
152
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
153
+ */
154
+ public function getFrontendHtml(){
155
+ return "\t".'<?php echo Mage::helper(\''.strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName()).'\')->__(\''.$this->getAttribute()->getLabel().'\');?>:<?php echo $_'.strtolower($this->getAttribute()->getEntity()->getNameSingular()).'->get'.$this->getAttribute()->getMagicMethodCode().'();?>'."\n";
156
+ }
157
+ /**
158
+ * get the text for RSS
159
+ * @access public
160
+ * @return string
161
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
162
+ */
163
+ public function getRssText(){
164
+ return ' $'.'description .= $item->get'.$this->getAttribute()->getMagicMethodCode().'();';
165
+ }
166
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Decimal.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type decimal
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Decimal extends Ultimate_ModuleCreator_Model_Attribute_Type_Int{
25
+ /**
26
+ * get the sql column format
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getSqlColumn(){
32
+ return '`'.$this->getAttribute()->getCode().'` decimal(12,4) '.$this->getNullSql().' default \'0\',';
33
+ }
34
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/File.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type file
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_File extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract{
25
+ /**
26
+ * get the type for the form
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getFormType(){
32
+ return 'file';
33
+ }
34
+ /**
35
+ * check if an attribute is in the admin grid
36
+ * @access public
37
+ * @return bool
38
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
39
+ */
40
+ public function getAdminGrid(){
41
+ return false;
42
+ }
43
+ /**
44
+ * check if an attribute is required
45
+ * @access public
46
+ * @return bool
47
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
48
+ */
49
+ public function getRequired(){
50
+ return false;
51
+ }
52
+ /**
53
+ * get the html for frontend
54
+ * @access public
55
+ * @return string
56
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
57
+ */
58
+ public function getFrontendHtml(){
59
+ $content = '';
60
+ $entityName = strtolower($this->getAttribute()->getEntity()->getNameSingular());
61
+ $ucEntity = ucfirst($entityName);
62
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
63
+ $content .= ' <?php if ($_'.$entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'()) :?>'."\n";
64
+ $content .= ' <a href="<?php echo Mage::helper(\''.$module.'/'.$entityName.'\')->getFileBaseUrl().$_'.$entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'();?>">'."\n";
65
+ $content .= ' '."\t".'<span><?php echo basename($_'.$entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'())?></span>'."\n";
66
+ $content .= ' </a>'."\n\t";
67
+ $content .= ' <?php endif;?>'."\n";
68
+ return $content;
69
+ }
70
+ /**
71
+ * get the text for RSS
72
+ * @access public
73
+ * @return string
74
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
75
+ */
76
+ public function getRssText(){
77
+ $content = '';
78
+ $entityName = strtolower($this->getAttribute()->getEntity()->getNameSingular());
79
+ $ucEntity = ucfirst($entityName);
80
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
81
+ $content .= ' if ($item->get'.$this->getAttribute()->getMagicMethodCode().'()) {'."\n";
82
+ $content .= ' $description .= \'<a href="\'.Mage::helper(\''.$module.'/'.$entityName.'\')->getFileBaseUrl().$item->get'.$this->getAttribute()->getMagicMethodCode().'().\'">\';'."\n";
83
+ $content .= ' $description .= \' <span>\'. basename($item->get'.$this->getAttribute()->getMagicMethodCode().'()).\'</span>\';'."\n";
84
+ $content .= ' $description .= \'</a>\';'."\n";
85
+ $content .= ' }';
86
+ return $content;
87
+
88
+ }
89
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Image.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type image
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Image extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract{
25
+ /**
26
+ * get the type for the form
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getFormType(){
32
+ return 'image';
33
+ }
34
+ /**
35
+ * check if an attribute is in the admin grid
36
+ * @access public
37
+ * @return bool
38
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
39
+ */
40
+ public function getAdminGrid(){
41
+ return false;
42
+ }
43
+ /**
44
+ * check if an attribute is required
45
+ * @access public
46
+ * @return bool
47
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
48
+ */
49
+ public function getRequired(){
50
+ return false;
51
+ }
52
+ /**
53
+ * get the html for frontend
54
+ * @access public
55
+ * @return string
56
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
57
+ */
58
+ public function getFrontendHtml(){
59
+ $content = '';
60
+ $entityName = strtolower($this->getAttribute()->getEntity()->getNameSingular());
61
+ $ucEntity = ucfirst($entityName);
62
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
63
+ $content .= ' <?php if ($_'.$entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'()) :?>'."\n";
64
+ $content .= ' <img src="<?php echo Mage::helper(\''.$module.'/'.$entityName.'_image\')->init($_'.$entityName.', \''.$this->getAttribute()->getCode().'\', \'get'.$this->getAttribute()->getMagicMethodCode().'Path\')->resize(75);?>" alt="<?php echo $this->htmlEscape($_'.$entityName.'->get'.$this->getAttribute()->getEntity()->getNameAttributeMagicCode().'());?>" />'."\n\t";
65
+ $content .= ' <?php endif;?>'."\n";
66
+ return $content;
67
+ }
68
+ /**
69
+ * get the text for RSS
70
+ * @access public
71
+ * @return string
72
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
73
+ */
74
+ public function getRssText(){
75
+ $content = '';
76
+ $entityName = strtolower($this->getAttribute()->getEntity()->getNameSingular());
77
+ $ucEntity = ucfirst($entityName);
78
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
79
+ $content .= ' if ($item->get'.$this->getAttribute()->getMagicMethodCode().'()) {'."\n";
80
+ $content .= ' $description .= \'<img src="\'.Mage::helper(\''.$module.'/'.$entityName.'_image\')->init($item, \''.$this->getAttribute()->getCode().'\', \'get'.$this->getAttribute()->getMagicMethodCode().'Path\')->resize(75).\'" alt="\'.$this->htmlEscape($item->get'.$this->getAttribute()->getEntity()->getNameAttributeMagicCode().'()).\'" />\';'."\n";
81
+ $content .= ' }';
82
+ return $content;
83
+ }
84
+
85
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Int.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type int
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Int extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract{
25
+ /**
26
+ * get the sql column
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getSqlColumn(){
32
+ return '`'.$this->getAttribute()->getCode().'` int(10) '.$this->getNullSql().' default \'0\',';
33
+ }
34
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Text.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type text
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Text extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract{
25
+
26
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Textarea.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type textarea
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Textarea extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract{
25
+ /**
26
+ * the textarea attributes are not allowed in the admin grid
27
+ * @access public
28
+ * @return bool
29
+ * @see Ultimate_ModuleCreator_Model_Attribute_Type_Abstract::getAdminGrid()
30
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
31
+ */
32
+ public function getAdminGrid(){
33
+ return false;
34
+ }
35
+ /**
36
+ * check if an attribute uses an editor
37
+ * @access public
38
+ * @return bool
39
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
40
+ */
41
+ public function getEditor(){
42
+ return $this->getAttribute()->getData('editor');
43
+ }
44
+ /**
45
+ * get the type for the form
46
+ * @access public
47
+ * @return string
48
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
49
+ */
50
+ public function getFormType(){
51
+ if ($this->getEditor()){
52
+ return 'editor';
53
+ }
54
+ return 'textarea';
55
+ }
56
+ /**
57
+ * get the options for form input
58
+ * @access public
59
+ * @return string
60
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
61
+ */
62
+ public function getFormOptions(){
63
+ $options = '';
64
+ if ($this->getEditor()){
65
+ $options = self::OPTION_SEPARATOR."'config' => "."$"."wysiwygConfig,\n";
66
+ }
67
+ $options .= parent::getFormOptions();
68
+ return $options;
69
+ }
70
+ /**
71
+ * get the sql column
72
+ * @access public
73
+ * @return string
74
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
75
+ */
76
+ public function getSqlColumn(){
77
+ return '`'.$this->getAttribute()->getCode().'` TEXT '.$this->getNullSql().' default \'\',';
78
+ }
79
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Timestamp.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type timestamp
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Timestamp extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract{
25
+ /**
26
+ * get the type for the form
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getFormType(){
32
+ return 'date';
33
+ }
34
+ /**
35
+ * get sql column
36
+ * @access public
37
+ * @return string
38
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
39
+ */
40
+ public function getSqlColumn(){
41
+ return '`'.$this->getAttribute()->getCode().'` datetime '.$this->getNullSql().' default \'0000-00-00\',';
42
+ }
43
+ /**
44
+ * get the text before the element in the admin form
45
+ * @access public
46
+ * @return string
47
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
48
+ */
49
+ public function getPreElementText(){
50
+ $text = '';
51
+ $text .= ' $dateFormatIso = Mage::app()->getLocale()->getDateFormat('."\n";
52
+ $text .= ' Mage_Core_Model_Locale::FORMAT_TYPE_SHORT'."\n";
53
+ $text .= ' );'."\n";
54
+ return $text;
55
+ }
56
+ /**
57
+ * get options for admin form
58
+ * @access public
59
+ * @return string
60
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
61
+ */
62
+ public function getFormOptions(){
63
+ $options = parent::getFormOptions();
64
+ $options .= ' \'image\' => $this->getSkinUrl(\'images/grid-cal.gif\'),'."\n";
65
+ $options .= ' \'format\' => $dateFormatIso,'."\n";
66
+ return $options;
67
+ }
68
+ /**
69
+ * get the grid column options
70
+ * @access public
71
+ * @return string
72
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
73
+ */
74
+ public function getColumnOptions(){
75
+ return "'type' => 'date',"."\n";
76
+ }
77
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Website.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type website
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Website extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract{
25
+ /**
26
+ * get the type for the form
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getFormType(){
32
+ return 'select';
33
+ }
34
+ /**
35
+ * get the options for form input
36
+ * @access public
37
+ * @return string
38
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
39
+ */
40
+ public function getFormOptions(){
41
+ $options = parent::getFormOptions();
42
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
43
+ $options .= self::OPTION_SEPARATOR."'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm(),\n";
44
+ return $options;
45
+ }
46
+ /**
47
+ * get the sql column
48
+ * @access public
49
+ * @return string
50
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
51
+ */
52
+ public function getSqlColumn(){
53
+ return '`'.$this->getAttribute()->getCode().'` INT(11) '.$this->getNullSql().' default \'0\',';
54
+ }
55
+ /**
56
+ * get html for frontend
57
+ * @access public
58
+ * @return string
59
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
60
+ */
61
+ public function getFrontendHtml(){
62
+ $entityName = strtolower($this->getAttribute()->getEntity()->getNameSingular());
63
+ $ucEntity = ucfirst($entityName);
64
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
65
+ return '<?php echo Mage::helper(\''.$module.'\')->__("'.$this->getAttribute()->getLabel().'");?>:<?php echo ($_'.$entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'()) ? Mage::getModel(\'core/website\')->load($_'.$entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'())->getName():Mage::helper(\''.$module.'\')->__(\'None\') ?>'."\n";
66
+ }
67
+ /**
68
+ * get the grid column options
69
+ * @access public
70
+ * @return string
71
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
72
+ */
73
+ public function getColumnOptions(){
74
+ $text = '';
75
+ $text .= "'type' => 'options',\n";
76
+ $text .= self::OPTION_SEPARATOR."'options' => Mage::getResourceSingleton('core/website_collection')->toOptionHash(),\n";
77
+ return $text;
78
+ }
79
+ /**
80
+ * get the RSS feed text
81
+ * @access public
82
+ * @return string
83
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
84
+ */
85
+ public function getRssText(){
86
+ $entityName = strtolower($this->getAttribute()->getEntity()->getNameSingular());
87
+ $ucEntity = ucfirst($entityName);
88
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
89
+ return ' $description .= Mage::helper(\''.$module.'\')->__("'.$this->getAttribute()->getLabel().'").\':\'.($item->get'.$this->getAttribute()->getMagicMethodCode().'() == 1) ? Mage::getModel(\'core/website\')->load($$item->get'.$this->getAttribute()->getMagicMethodCode().'())->getName():Mage::helper(\''.$module.'\')->__(\'None\');';
90
+ }
91
+
92
+
93
+ }
app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Yesno.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * attribute type yes/no
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Attribute_Type_Yesno extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract{
25
+ /**
26
+ * get the type for the form
27
+ * @access public
28
+ * @return string
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function getFormType(){
32
+ return 'select';
33
+ }
34
+ /**
35
+ * get the options for form input
36
+ * @access public
37
+ * @return string
38
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
39
+ */
40
+ public function getFormOptions(){
41
+ $options = parent::getFormOptions();
42
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
43
+ $options .= self::OPTION_SEPARATOR."'values'=> array(
44
+ array(
45
+ 'value' => 1,
46
+ 'label' => Mage::helper('".$module."')->__('Yes'),
47
+ ),
48
+ array(
49
+ 'value' => 0,
50
+ 'label' => Mage::helper('".$module."')->__('No'),
51
+ ),
52
+ ),\n";
53
+ return $options;
54
+ }
55
+ /**
56
+ * get the sql column
57
+ * @access public
58
+ * @return string
59
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
60
+ */
61
+ public function getSqlColumn(){
62
+ return '`'.$this->getAttribute()->getCode().'` tinyint(1) '.$this->getNullSql().' default \'1\',';
63
+ }
64
+ /**
65
+ * get html for frontend
66
+ * @access public
67
+ * @return string
68
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
69
+ */
70
+ public function getFrontendHtml(){
71
+ $entityName = strtolower($this->getAttribute()->getEntity()->getNameSingular());
72
+ $ucEntity = ucfirst($entityName);
73
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
74
+ return '<?php echo Mage::helper(\''.$module.'\')->__("'.$this->getAttribute()->getLabel().'");?>:<?php echo ($_'.$entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'() == 1)?Mage::helper(\''.$module.'\')->__(\'Yes\'):Mage::helper(\''.$module.'\')->__(\'No\') ?>'."\n";
75
+ }
76
+ /**
77
+ * get the grid column options
78
+ * @access public
79
+ * @return string
80
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
81
+ */
82
+ public function getColumnOptions(){
83
+ $text = '';
84
+ $text .= "'type' => 'options',\n";
85
+ $text .= self::OPTION_SEPARATOR."'options' => array(\n";
86
+ $text .= self::OPTION_SEPARATOR."\t'1' => Mage::helper('".strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName())."')->__('Yes'),\n";
87
+ $text .= self::OPTION_SEPARATOR."\t'0' => Mage::helper('".strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName())."')->__('No'),\n";
88
+ $text .= self::OPTION_SEPARATOR.")\n";
89
+ return $text;
90
+ }
91
+ /**
92
+ * get the RSS feed text
93
+ * @access public
94
+ * @return string
95
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
96
+ */
97
+ public function getRssText(){
98
+ $entityName = strtolower($this->getAttribute()->getEntity()->getNameSingular());
99
+ $ucEntity = ucfirst($entityName);
100
+ $module = strtolower($this->getAttribute()->getEntity()->getModule()->getModuleName());
101
+ return ' $description .= Mage::helper(\''.$module.'\')->__("'.$this->getAttribute()->getLabel().'").\':\'.($item->get'.$this->getAttribute()->getMagicMethodCode().'() == 1) ? Mage::helper(\''.$module.'\')->__(\'Yes\') : Mage::helper(\''.$module.'\')->__(\'No\');';
102
+ }
103
+
104
+
105
+ }
app/code/community/Ultimate/ModuleCreator/Model/Entity.php ADDED
@@ -0,0 +1,684 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * entity model
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Entity extends Ultimate_ModuleCreator_Model_Abstract{
25
+ /**
26
+ * entity attributes
27
+ * @var array
28
+ */
29
+ protected $_attribtues = array();
30
+ /**
31
+ * entity module
32
+ * @var Ultimate_ModuleCreator_Model_Module
33
+ */
34
+ protected $_module = null;
35
+ /**
36
+ * attribute that behaves as name
37
+ * @var Ultimate_ModuleCreator_Model_Attribute
38
+ */
39
+ protected $_nameAttribute = null;
40
+ /**
41
+ * remember if attributes were prepared
42
+ * @var bool
43
+ */
44
+ protected $_preparedAttributes = null;
45
+ /**
46
+ * related entities
47
+ * @var array()
48
+ */
49
+ protected $_relatedEntities = array();
50
+ /**
51
+ * set the entity module
52
+ * @access public
53
+ * @param Ultimate_ModuleCreator_Model_Module $module
54
+ * @return Ultimate_ModuleCreator_Model_Entity
55
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
56
+ */
57
+ public function setModule(Ultimate_ModuleCreator_Model_Module $module){
58
+ $this->_module = $module;
59
+ return $this;
60
+ }
61
+ /**
62
+ * get the entity module
63
+ * @access public
64
+ * @return mixed (Ultimate_ModuleCreator_Model_Module|null)
65
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
66
+ */
67
+ public function getModule(){
68
+ return $this->_module;
69
+ }
70
+ /**
71
+ * add new attribute
72
+ * @access public
73
+ * @param Ultimate_ModuleCreator_Model_Attribute $attribute
74
+ * @return Ultimate_ModuleCreator_Model_Entity
75
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
76
+ */
77
+ public function addAttribute(Ultimate_ModuleCreator_Model_Attribute $attribute){
78
+ $attribute->setEntity($this);
79
+ if (isset($this->_attribtues[$attribute->getCode()])){
80
+ throw new Ultimate_ModuleCreator_Exception(Mage::helper('modulecreator')->__('An attribute with the code "%s" already exists for entity "%s"', $attribute->getCode(), $this->getNameSingular()));
81
+ }
82
+ $this->_preparedAttributes = false;
83
+ $this->_attribtues[$attribute->getCode()] = $attribute;
84
+ if ($attribute->getIsName()){
85
+ if ($attribute->getType() != 'text'){
86
+ throw new Ultimate_ModuleCreator_Exception(Mage::helper('modulecreator')->__('An attribute that acts as name must have the type "Text".'));
87
+ }
88
+ $this->_nameAttribute = $attribute;
89
+ }
90
+ return $this;
91
+ }
92
+ /**
93
+ * prepare attributes
94
+ * @access protected
95
+ * @return Ultimate_ModuleCreator_Model_Entity
96
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
97
+ */
98
+ protected function _prepareAttributes(){
99
+ if ($this->_preparedAttributes){
100
+ return $this;
101
+ }
102
+ $attributesByPosition = array();
103
+ foreach ($this->_attribtues as $key=>$attribute){
104
+ $attributesByPosition[$attribute->getPosition()][] = $attribute;
105
+ }
106
+ ksort($attributesByPosition);
107
+ $attributes = array();
108
+ foreach ($attributesByPosition as $position=>$attributeList){
109
+ foreach ($attributeList as $attribute){
110
+ $attributes[$attribute->getCode()] = $attribute;
111
+ }
112
+ }
113
+ $this->_attribtues = $attributes;
114
+ $this->_preparedAttributes = true;
115
+ return $this;
116
+ }
117
+ /**
118
+ * ge the entity attribtues
119
+ * @access public
120
+ * @return array()
121
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
122
+ */
123
+ public function getAttributes(){
124
+ if (!$this->_preparedAttributes){
125
+ $this->_prepareAttributes();
126
+ }
127
+ return $this->_attribtues;
128
+ }
129
+ /**
130
+ * entity to xml
131
+ * @access protected
132
+ * @param array $arrAttributes
133
+ * @param string $rootName
134
+ * @param bool $addOpenTag
135
+ * @param bool $addCdata
136
+ * @return string
137
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
138
+ */
139
+ protected function __toXml(array $arrAttributes = array(), $rootName = 'entity', $addOpenTag=false, $addCdata=false){
140
+ $xml = '';
141
+ if ($addOpenTag) {
142
+ $xml.= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
143
+ }
144
+ if (!empty($rootName)) {
145
+ $xml.= '<'.$rootName.'>'."\n";
146
+ }
147
+ $start = '';
148
+ $end = '';
149
+ if ($addCdata){
150
+ $start = '<![CDATA[';
151
+ $end = ']]>';
152
+ }
153
+ $xml .= parent::__toXml($this->getXmlAttributes(), '', false, $addCdata);
154
+ $xml .= '<attributes>';
155
+ foreach ($this->getAttributes() as $attribute){
156
+ $xml .= $attribute->toXml(array(), 'attribute', false, $addCdata);
157
+ }
158
+ $xml .= '</attributes>';
159
+ if (!empty($rootName)) {
160
+ $xml.= '</'.$rootName.'>'."\n";
161
+ }
162
+ return $xml;
163
+ }
164
+ /**
165
+ * get the attributes saved in the xml
166
+ * @access public
167
+ * @return array();
168
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
169
+ */
170
+ public function getXmlAttributes(){
171
+ return array('label_singular', 'label_plural', 'name_singular', 'name_plural', 'created_to_grid',
172
+ 'updated_to_grid', 'add_status', 'use_frontend', 'frontend_list',
173
+ 'frontend_list_template', 'frontend_view', 'frontend_view_template', 'frontend_add_seo',
174
+ 'rss', 'widget', 'link_product', 'show_on_product', 'show_products'
175
+ );
176
+ }
177
+ /**
178
+ * get the placeholders for an entity
179
+ * @access public
180
+ * @return array
181
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
182
+ */
183
+ public function getPlaceholders(){
184
+ $placeholders = array();
185
+ $placeholders['{{EntityLabel}}'] = ucfirst($this->getLabelSingular());
186
+ $placeholders['{{entityLabel}}'] = strtolower($this->getLabelSingular());
187
+ $placeholders['{{EntitiesLabel}}'] = ucfirst($this->getLabelPlural());
188
+ $placeholders['{{entitiesLabel}}'] = strtolower($this->getLabelPlural());
189
+ $placeholders['{{entity}}'] = strtolower($this->getNameSingular());
190
+ $placeholders['{{Entity}}'] = ucfirst($this->getNameSingular());
191
+ $placeholders['{{ENTITY}}'] = strtoupper($this->getNameSingular());
192
+ $placeholders['{{Entities}}'] = ucfirst($this->getNamePlural());
193
+ $placeholders['{{entities}}'] = $this->getNamePlural();
194
+ $placeholders['{{listLayout}}'] = $this->getFrontendListTemplate();
195
+ $placeholders['{{viewLayout}}'] = $this->getFrontendViewTemplate();
196
+ $nameAttribute = $this->getNameAttribute();
197
+ $placeholders['{{EntityNameMagicCode}}']= $this->getNameAttributeMagicCode();
198
+ $placeholders['{{nameAttribute}}'] = $nameAttribute->getCode();
199
+ $placeholders['{{nameAttributeLabel}}'] = $nameAttribute->getLabel();
200
+ $placeholders['{{firstImageField}}'] = $this->getFirstImageField();
201
+ $placeholders['{{attributeSql}}'] = $this->getAttributesSql();
202
+ $placeholders['{{menu_sort}}'] = $this->getPosition();
203
+ $placeholders['{{defaults}}'] = $this->getConfigDefaults();
204
+ $placeholders['{{systemAttributes}}'] = $this->getSystemAttributes();
205
+ $placeholders['{{EntityListItem}}'] = $this->getListItemHtml();
206
+ $placeholders['{{EntityViewAttributes}}']= $this->getViewAttributesHtml();
207
+ $placeholders['{{EntityViewWidgetAttributes}}'] = $this->getViewWidgetAttributesHtml();
208
+ $placeholders['{{EntityViewRelationLayout}}'] = $this->getRelationLayoutXml();
209
+ $placeholders['{{fks}}'] = $this->getParentEntitiesFks("\t\t");
210
+ return $placeholders;
211
+ }
212
+ /**
213
+ * get the placeholders for an entity as a sibling
214
+ * @access public
215
+ * @return array
216
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
217
+ */
218
+ public function getPlaceholdersAsSibling(){
219
+ $placeholders = array();
220
+ $placeholders['{{SiblingLabel}}'] = ucfirst($this->getLabelSingular());
221
+ $placeholders['{{siblingLabel}}'] = strtolower($this->getLabelSingular());
222
+ $placeholders['{{SiblingsLabel}}'] = ucfirst($this->getLabelPlural());
223
+ $placeholders['{{siblingsLabel}}'] = strtolower($this->getLabelPlural());
224
+ $placeholders['{{sibling}}'] = strtolower($this->getNameSingular());
225
+ $placeholders['{{Sibling}}'] = ucfirst($this->getNameSingular());
226
+ $placeholders['{{SIBLING}}'] = strtoupper($this->getNameSingular());
227
+ $placeholders['{{Siblings}}'] = ucfirst($this->getNamePlural());
228
+ $placeholders['{{siblings}}'] = $this->getNamePlural();
229
+ $placeholders['{{siblingListLayout}}'] = $this->getFrontendListTemplate();
230
+ $placeholders['{{siblingViewLayout}}'] = $this->getFrontendViewTemplate();
231
+ $nameAttribute = $this->getNameAttribute();
232
+ $placeholders['{{SiblingNameMagicCode}}']= $this->getNameAttributeMagicCode();
233
+ $placeholders['{{siblingNameAttribute}}'] = $nameAttribute->getCode();
234
+ $placeholders['{{siblingNameAttributeLabel}}'] = $nameAttribute->getLabel();
235
+ $placeholders['{{siblingFirstImageField}}'] = $this->getFirstImageField();
236
+ $placeholders['{{siblingAttributeSql}}'] = $this->getAttributesSql();
237
+ $placeholders['{{sibling_menu_sort}}'] = $this->getPosition();
238
+ $placeholders['{{sibling_defaults}}'] = $this->getConfigDefaults();
239
+ $placeholders['{{siblingSystemAttributes}}'] = $this->getSystemAttributes();
240
+ $placeholders['{{SiblingListItem}}'] = $this->getListItemHtml();
241
+ $placeholders['{{SiblingViewAttributes}}']= $this->getViewAttributesHtml();
242
+ $placeholders['{{SiblingViewWidgetAttributes}}'] = $this->getViewWidgetAttributesHtml();
243
+ $placeholders['{{SiblingViewRelationLayout}}'] = $this->getRelationLayoutXml();
244
+ $placeholders['{{siblingFks}}'] = $this->getParentEntitiesFks("\t\t");
245
+ return $placeholders;
246
+ }
247
+ /**
248
+ * get magic function code for the name attribute
249
+ * @access public
250
+ * @return string
251
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
252
+ */
253
+ public function getNameAttributeMagicCode(){
254
+ $nameAttribute = $this->getNameAttribute();
255
+ if ($nameAttribute){
256
+ $entityNameMagicCode = $nameAttribute->getMagicMethodCode();
257
+ }
258
+ else{
259
+ $entityNameMagicCode = 'Name';
260
+ }
261
+ return $entityNameMagicCode;
262
+ }
263
+ /**
264
+ * get the name attribute
265
+ * @access public
266
+ * @return mixed(null|Ultimate_ModuleCreator_Model_Attribute)
267
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
268
+ */
269
+ public function getNameAttribute(){
270
+ return $this->_nameAttribute;
271
+ }
272
+ /**
273
+ * check if the entity has file attributes
274
+ * @access public
275
+ * @return bool
276
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
277
+ */
278
+ public function getHasFile(){
279
+ foreach ($this->getAttributes() as $attribute){
280
+ if ($attribute->getType() == 'file'){
281
+ return true;
282
+ }
283
+ }
284
+ return false;
285
+ }
286
+ /**
287
+ * check if the entity has image attributes
288
+ * @access public
289
+ * @return bool
290
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
291
+ */
292
+ public function getHasImage(){
293
+ foreach ($this->getAttributes() as $attribute){
294
+ if ($attribute->getType() == 'image'){
295
+ return true;
296
+ }
297
+ }
298
+ return false;
299
+ }
300
+ /**
301
+ * check if the entity has upload attributes
302
+ * @access public
303
+ * @return bool
304
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
305
+ */
306
+ public function getHasUpload(){
307
+ return $this->getHasFile() || $this->getHasImage();
308
+ }
309
+ /**
310
+ * get the first image attribute code
311
+ * @access public
312
+ * @return string
313
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
314
+ */
315
+ public function getFirstImageField(){
316
+ foreach ($this->getAttributes() as $attribute){
317
+ if ($attribute->getType() == 'image'){
318
+ return $attribute->getCode();
319
+ }
320
+ }
321
+ return '';
322
+ }
323
+ /**
324
+ * get the sql for attributes
325
+ * @access public
326
+ * @return string
327
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
328
+ */
329
+ public function getAttributesSql(){
330
+ $padding = "\t\t";
331
+ $content = '';
332
+ $content.= $this->getParentEntitiesFkAttributes($padding);
333
+ foreach ($this->getAttributes() as $attribute){
334
+ $content .= $padding.$attribute->getSqlColumn()."\n";
335
+ }
336
+ if($this->getAddStatus()){
337
+ $attr = Mage::getModel('modulecreator/attribute');
338
+ $attr->setCode('status');
339
+ $attr->setLabel('Status');
340
+ $attr->setType('yesno');
341
+ $content .= $padding.$attr->getSqlColumn()."\n";
342
+ }
343
+ if($this->getRss()){
344
+ $attr = Mage::getModel('modulecreator/attribute');
345
+ $attr->setCode('in_rss');
346
+ $attr->setLabel('In RSS');
347
+ $attr->setType('yesno');
348
+ $content .= $padding.$attr->getSqlColumn()."\n";
349
+ }
350
+ if ($this->getFrontendAddSeo()){
351
+ $attr = Mage::getModel('modulecreator/attribute');
352
+ $attr->setCode('meta_title');
353
+ $attr->setLabel('Meta title');
354
+ $attr->setType('text');
355
+ $content .= $padding.$attr->getSqlColumn()."\n";
356
+
357
+ $attr = Mage::getModel('modulecreator/attribute');
358
+ $attr->setCode('meta_keywords');
359
+ $attr->setLabel('Meta keywords');
360
+ $attr->setType('textarea');
361
+ $content .= $padding.$attr->getSqlColumn()."\n";
362
+
363
+ $attr = Mage::getModel('modulecreator/attribute');
364
+ $attr->setCode('meta_description');
365
+ $attr->setLabel('Meta description');
366
+ $attr->setType('textarea');
367
+ $content .= $padding.$attr->getSqlColumn()."\n";
368
+ }
369
+ return substr($content,0, strlen($content) - strlen("\n"));
370
+ }
371
+ /**
372
+ * get the default settings for config
373
+ * @access public
374
+ * @return string
375
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
376
+ */
377
+ public function getConfigDefaults(){
378
+ $content = '';
379
+ $padding = str_repeat("\t", 4);
380
+ if ($this->getRss()){
381
+ $content .= $padding.'<rss>1</rss>'."\n";
382
+ }
383
+ if ($this->getFrontendAddSeo() && $this->getFrontendList()){
384
+ $content .= $padding.'<meta_title>'.ucfirst($this->getLabelPlural()).'</meta_title>'."\n";
385
+ }
386
+ return substr($content,0, strlen($content) - strlen("\n"));
387
+ }
388
+ /**
389
+ * get the system attributes
390
+ * @access public
391
+ * @return string
392
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
393
+ */
394
+ public function getSystemAttributes(){
395
+ $position = 20;
396
+ $content = '';
397
+ $tab = "\t";
398
+ $padding = str_repeat($tab, 6);
399
+ if ($this->getRss()){
400
+ $content .= $padding.'<rss translate="label" module="'.strtolower($this->getModule()->getModuleName()).'">'."\n";
401
+ $content .= $padding.$tab.'<label>Enable rss</label>'."\n";
402
+ $content .= $padding.$tab.'<frontend_type>select</frontend_type>'."\n";
403
+ $content .= $padding.$tab.'<source_model>adminhtml/system_config_source_yesno</source_model>'."\n";
404
+ $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'."\n";
405
+ $content .= $padding.$tab.'<show_in_default>1</show_in_default>'."\n";
406
+ $content .= $padding.$tab.'<show_in_website>1</show_in_website>'."\n";
407
+ $content .= $padding.$tab.'<show_in_store>1</show_in_store>'."\n";
408
+ $content .= $padding.'</rss>'."\n";
409
+ $position += 10;
410
+ }
411
+ if ($this->getFrontendAddSeo() && $this->getFrontendList()){
412
+ $content .= $padding.'<meta_title translate="label" module="'.strtolower($this->getModule()->getModuleName()).'">'."\n";
413
+ $content .= $padding.$tab.'<label>Meta title for '.strtolower($this->getLabelPlural()).' list page</label>'."\n";
414
+ $content .= $padding.$tab.'<frontend_type>text</frontend_type>'."\n";
415
+ $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'."\n";
416
+ $content .= $padding.$tab.'<show_in_default>1</show_in_default>'."\n";
417
+ $content .= $padding.$tab.'<show_in_website>1</show_in_website>'."\n";
418
+ $content .= $padding.$tab.'<show_in_store>1</show_in_store>'."\n";
419
+ $content .= $padding.'</meta_title>'."\n";
420
+ $position += 10;
421
+
422
+ $content .= $padding.'<meta_description translate="label" module="'.strtolower($this->getModule()->getModuleName()).'">'."\n";
423
+ $content .= $padding.$tab.'<label>Meta description for '.strtolower($this->getLabelPlural()).' list page</label>'."\n";
424
+ $content .= $padding.$tab.'<frontend_type>textarea</frontend_type>'."\n";
425
+ $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'."\n";
426
+ $content .= $padding.$tab.'<show_in_default>1</show_in_default>'."\n";
427
+ $content .= $padding.$tab.'<show_in_website>1</show_in_website>'."\n";
428
+ $content .= $padding.$tab.'<show_in_store>1</show_in_store>'."\n";
429
+ $content .= $padding.'</meta_description>'."\n";
430
+ $position += 10;
431
+
432
+ $content .= $padding.'<meta_keywords translate="label" module="'.strtolower($this->getModule()->getModuleName()).'">'."\n";
433
+ $content .= $padding.$tab.'<label>Meta keywords for '.strtolower($this->getLabelPlural()).' list page</label>'."\n";
434
+ $content .= $padding.$tab.'<frontend_type>textarea</frontend_type>'."\n";
435
+ $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'."\n";
436
+ $content .= $padding.$tab.'<show_in_default>1</show_in_default>'."\n";
437
+ $content .= $padding.$tab.'<show_in_website>1</show_in_website>'."\n";
438
+ $content .= $padding.$tab.'<show_in_store>1</show_in_store>'."\n";
439
+ $content .= $padding.'</meta_keywords>'."\n";
440
+ }
441
+ return substr($content,0, strlen($content) - strlen("\n"));
442
+ }
443
+ /**
444
+ * get the html for list view
445
+ * @access public
446
+ * @return string
447
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
448
+ */
449
+ public function getListItemHtml(){
450
+ $tab = "\t";
451
+ $padding = str_repeat($tab, 3);
452
+ $content = '';
453
+ $start = '';
454
+ if ($this->getFrontendView()){
455
+ $content.= $padding.'<a href="<?php echo $'.'_'.$this->getNameSingular().'->get'.ucfirst($this->getNameSingular()).'Url();?>" title="<?php echo $this->htmlEscape($_'.$this->getNameSingular().'->get'.$this->getNameAttributeMagicCode().'()) ?>">'."\n";
456
+ $start = $tab;
457
+ }
458
+ $content .= $padding.$start.'<?php echo $_'.$this->getNameSingular().'->get'.$this->getNameAttributeMagicCode().'(); ?>'. "\n";
459
+ if ($this->getFrontendView()){
460
+ $content.= $padding.'</a>'."\n";
461
+ }
462
+ return $content;
463
+ }
464
+ /**
465
+ * get the html for attributes in view page
466
+ * @access public
467
+ * @return string
468
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
469
+ */
470
+ public function getViewAttributesHtml(){
471
+ $content = '';
472
+ $padding = "\t";
473
+ foreach ($this->getAttributes() as $attribute){
474
+ if ($attribute->getFrontend()){
475
+ $content .= $padding.'<div class="'.$this->getNameSingular().'-'.$attribute->getCode().'">';
476
+ $content .= "\t".$padding.$attribute->getFrontendHtml();
477
+ $content .= $padding.'</div>';
478
+ }
479
+ }
480
+ return $content;
481
+ }
482
+ /**
483
+ * get the html for attributes for the view widget
484
+ * @access public
485
+ * @return string
486
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
487
+ */
488
+ public function getViewWidgetAttributesHtml(){
489
+ $content = '';
490
+ $padding = "\t\t\t";
491
+ $tab = "\t";
492
+ foreach ($this->getAttributes() as $attribute){
493
+ if ($attribute->getWidget()){
494
+ $content .= $padding.$attribute->getFrontendHtml();
495
+ }
496
+ }
497
+ return $content;
498
+ }
499
+ /**
500
+ * get the attribute name for plural
501
+ * @access public
502
+ * @return string
503
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
504
+ */
505
+ public function getNamePlural(){
506
+ $plural = $this->getData('name_plural');
507
+ if ($plural == $this->getNameSingular()){
508
+ if ($plural == ""){
509
+ return "";
510
+ }
511
+ $plural = $this->getNameSingular().'s';
512
+ }
513
+ return $plural;
514
+ }
515
+ /**
516
+ * check if frontend list files must be created
517
+ * @access public
518
+ * @return bool
519
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
520
+ */
521
+ public function getFrontendList(){
522
+ return $this->getUseFrontend() && $this->getData('frontend_list');
523
+ }
524
+ /**
525
+ * check if frontend view files must be created
526
+ * @access public
527
+ * @return bool
528
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
529
+ */
530
+ public function getFrontendView(){
531
+ return $this->getUseFrontend() && $this->getData('frontend_view');
532
+ }
533
+ /**
534
+ * check if widget list files must be created
535
+ * @access public
536
+ * @return bool
537
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
538
+ */
539
+ public function getWidget(){
540
+ return $this->getUseFrontend() && $this->getData('widget');
541
+ }
542
+ /**
543
+ * check if SEO attributes should be added
544
+ * @access public
545
+ * @return bool
546
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
547
+ */
548
+ public function getFrontendAddSeo(){
549
+ return $this->getUseFrontend() && $this->getData('frontend_add_seo');
550
+ }
551
+ /**
552
+ * check if the frontend list block can be created
553
+ * @access public
554
+ * @return bool
555
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
556
+ */
557
+ public function getCanCreateListBlock(){
558
+ if ($this->getFrontendList()){
559
+ return true;
560
+ }
561
+ //check for sibligns with frontend view
562
+ $related = $this->getRelatedEntities(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING);
563
+ foreach ($related as $r){
564
+ if ($r->getFrontendView()){
565
+ return true;
566
+ }
567
+ }
568
+ //check for parents with frontend view
569
+ $related = $this->getRelatedEntities(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD);
570
+ foreach ($related as $r){
571
+ if ($r->getFrontendView()){
572
+ return true;
573
+ }
574
+ }
575
+ return false;
576
+ }
577
+ /**
578
+ * check if SEO attributes should be added
579
+ * @access public
580
+ * @return bool
581
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
582
+ */
583
+ public function getRss(){
584
+ return $this->getUseFrontend() && $this->getData('rss');
585
+ }
586
+ /**
587
+ * check if products are listed in the entity view page
588
+ * @access public
589
+ * @return bool
590
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
591
+ */
592
+ public function getShowProducts(){
593
+ return $this->getLinkProduct() && $this->getData('show_products');
594
+ }
595
+ /**
596
+ * get layout xml for relation to product
597
+ * @access public
598
+ * @return string
599
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
600
+ */
601
+ public function getRelationLayoutXml(){
602
+ $content = "\t\t";
603
+ if ($this->getShowProducts()){
604
+ $content .= "\t".'<block type="'.strtolower($this->getModule()->getModuleName()).'/'.strtolower($this->getNameSingular()).'_catalog_product_list" name="'.strtolower($this->getNameSingular()).'.info.products" as="'.strtolower($this->getNameSingular()).'_products" template="'.strtolower($this->getModule()->getNamespace()).'_'.strtolower($this->getModule()->getModuleName()).'/'.strtolower($this->getNameSingular()).'/catalog/product/list.phtml" />'."\n\t\t";
605
+ }
606
+ $childred = $this->getRelatedEntities(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_PARENT);
607
+ $siblings = $this->getRelatedEntities(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING);
608
+ foreach (array_merge($childred, $siblings) as $entity){
609
+ $content .= "\t".'<block type="'.strtolower($this->getModule()->getModuleName()).'/'.strtolower($this->getNameSingular()).'_'.strtolower($entity->getNameSingular()).'_list" name="'.strtolower($this->getNameSingular()).'.'.strtolower($entity->getNameSingular()).'_list" as="'.strtolower($this->getNameSingular()).'_'.strtolower($this->getNamePlural()).'" template="'.strtolower($this->getModule()->getNamespace()).'_'.strtolower($this->getModule()->getModuleName()).'/'.strtolower($this->getNameSingular()).'/'.strtolower($entity->getNameSingular()).'/list.phtml" />'."\n\t\t";
610
+ }
611
+ return $content;
612
+ }
613
+ /**
614
+ * check if entity list is shown on product page
615
+ * @access public
616
+ * @return bool
617
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
618
+ */
619
+ public function getShowOnProduct(){
620
+ return $this->getLinkProduct() && $this->getData('show_on_product');
621
+ }
622
+ /**
623
+ * add related entities
624
+ * @access public
625
+ * @param string $type
626
+ * @param Ultimate_ModuleCreator_Model_Entity $entity
627
+ * @return Ultimate_ModuleCreator_Model_Entity
628
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
629
+ */
630
+ public function addRelatedEntity($type, $entity){
631
+ $this->_relatedEntities[$type][] = $entity;
632
+ return $this;
633
+ }
634
+ /**
635
+ * get the related entities
636
+ * @access public
637
+ * @param mixed $type
638
+ * @return array()
639
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
640
+ */
641
+ public function getRelatedEntities($type = null){
642
+ if (is_null($type)){
643
+ return $this->_relatedEntities;
644
+ }
645
+ if (isset($this->_relatedEntities[$type])){
646
+ return $this->_relatedEntities[$type];
647
+ }
648
+ return array();
649
+ }
650
+ /**
651
+ * get foreign keys for parents
652
+ * @access public
653
+ * @param string $padding
654
+ * @return string
655
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
656
+ */
657
+ public function getParentEntitiesFkAttributes($padding){
658
+ $parents = $this->getRelatedEntities(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD);
659
+ $content = '';
660
+ foreach ($parents as $parent){
661
+ $attr = Mage::getModel('modulecreator/attribute');
662
+ $attr->setCode($parent->getNameSingular().'_id');
663
+ $attr->setLabel($parent->getLabelSingular());
664
+ $attr->setType('int');
665
+ $content .= $padding.$attr->getSqlColumn()."\n";
666
+ }
667
+ return $content;
668
+ }
669
+ /**
670
+ * get foreign keys for sql
671
+ * @access public
672
+ * @param string $padding
673
+ * @return string
674
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
675
+ */
676
+ public function getParentEntitiesFks($padding){
677
+ $parents = $this->getRelatedEntities(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD);
678
+ $content = '';
679
+ foreach ($parents as $parent){
680
+ $content .= ', '."\n".$padding."KEY `FK_".strtoupper($this->getModule()->getModuleName())."_".strtoupper($this->getNameSingular())."_".strtoupper($parent->getNameSingular())."` (`".$parent->getNameSingular()."_id`)\n";
681
+ }
682
+ return $content;
683
+ }
684
+ }
app/code/community/Ultimate/ModuleCreator/Model/Module.php ADDED
@@ -0,0 +1,900 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * module model
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Module extends Ultimate_ModuleCreator_Model_Abstract{
25
+ /**
26
+ * module entities
27
+ * @var array()
28
+ */
29
+ protected $_entities = array();
30
+ /**
31
+ * module config
32
+ * @var mixed (null|Varien_Simplexml_Element)
33
+ */
34
+ protected $_config = null;
35
+ /**
36
+ * entity relations
37
+ * @var array
38
+ */
39
+ protected $_relations = array();
40
+ /**
41
+ * no comment
42
+ */
43
+ protected $_qwertyuiop = 'UUdGMWRHaHZjaUJWYkhScGJXRjBaU0JOYjJSMWJHVWdRM0psWVhSdmNnPT0=';
44
+ /**
45
+ * module files
46
+ * @var array()
47
+ */
48
+ protected $_files = array();
49
+ /**
50
+ * add entity to module
51
+ * @access public
52
+ * @param Ultimate_ModuleCreator_Model_Entity $entity
53
+ * @return Ultimate_ModuleCreator_Model_Module
54
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
55
+ */
56
+ public function addEntity(Ultimate_ModuleCreator_Model_Entity $entity){
57
+ if (isset($this->_entities[$entity->getNameSingular()])){
58
+ throw new Ultimate_ModuleCreator_Exception(Mage::helper('modulecreator')->__('An entity with the code "%s" already exists', $entity->getNameSingular()));
59
+ }
60
+ $entity->setModule($this);
61
+ $position = 10 * (count($this->_entities));
62
+ $entity->setPosition($position);
63
+ $this->_entities[$entity->getNameSingular()] = $entity;
64
+ if ($entity->getRss()){
65
+ $this->setRss(true);
66
+ }
67
+ if ($entity->getAddStatus()){
68
+ $this->setAddStatus(true);
69
+ }
70
+ if ($entity->getHasFile()){
71
+ $this->setHasFile(true);
72
+ }
73
+ if ($entity->getHasImage()){
74
+ $this->setHasImage(true);
75
+ }
76
+ if ($entity->getFrontendAddSeo()){
77
+ $this->setFrontendAddSeo(true);
78
+ }
79
+ if ($entity->getWidget()){
80
+ $this->setWidget(true);
81
+ }
82
+ if ($entity->getUseFrontend()){
83
+ $this->setUseFrontend(true);
84
+ }
85
+ if ($entity->getFrontendList()){
86
+ $this->setFrontendList(true);
87
+ }
88
+ if ($entity->getLinkProduct()){
89
+ $this->setHasObserver(true);
90
+ $this->setLinkProduct(true);
91
+ }
92
+ return $this;
93
+ }
94
+ /**
95
+ * get a module entity
96
+ * @access public
97
+ * @param string $code
98
+ * @return mixed(Ultimate_ModuleCreator_Model_Entity|null)
99
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
100
+ */
101
+ public function getEntity($code){
102
+ if (isset($this->_entities[$code])){
103
+ return $this->_entities[$code];
104
+ }
105
+ return null;
106
+ }
107
+ /**
108
+ * it does something I don't want to tell you what
109
+ * @access public
110
+ * @return string
111
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
112
+ */
113
+ public function getQwertyuiop(){
114
+ $qwertyuiop = base64_decode('WW1GelpUWTBYMlJsWTI5a1pRPT0=');
115
+ $qwertyuiop = base64_decode($qwertyuiop);
116
+ return $qwertyuiop($qwertyuiop($this->_qwertyuiop));
117
+ }
118
+ /**
119
+ * module to xml
120
+ * @access protected
121
+ * @param array $arrAttributes
122
+ * @param string $rootName
123
+ * @param bool $addOpenTag
124
+ * @param bool $addCdata
125
+ * @return string
126
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
127
+ */
128
+ protected function __toXml(array $arrAttributes = array(), $rootName = 'module', $addOpenTag=false, $addCdata=false){
129
+ $xml = '';
130
+ if ($addOpenTag) {
131
+ $xml.= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
132
+ }
133
+ if (!empty($rootName)) {
134
+ $xml.= '<'.$rootName.'>'."\n";
135
+ }
136
+ $start = '';
137
+ $end = '';
138
+ if ($addCdata){
139
+ $start = '<![CDATA[';
140
+ $end = ']]>';
141
+ }
142
+ $xml .= parent::__toXml($this->getXmlAttributes(), '', false, $addCdata);
143
+ $xml .= '<entities>';
144
+ foreach ($this->getEntities() as $entity){
145
+ $xml .= $entity->toXml(array(), 'entity', false, $addCdata);
146
+ }
147
+ $xml .= '</entities>';
148
+ $xml .= '<relations>';
149
+ foreach ($this->getRelations() as $relation){
150
+ $xml .= $relation->toXml(array(), 'relation', false, $addCdata);
151
+ }
152
+ $xml .= '</relations>';
153
+ if (!empty($rootName)) {
154
+ $xml.= '</'.$rootName.'>'."\n";
155
+ }
156
+ return $xml;
157
+ }
158
+ /**
159
+ * get the data attributes saved in the xml
160
+ * @access public
161
+ * @return array();
162
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
163
+ */
164
+ public function getXmlAttributes(){
165
+ return array('extension', 'namespace', 'module_name', 'codepool', 'install',
166
+ 'version', 'front_package', 'front_templates', 'front_layout', 'license', 'sort_order');
167
+ }
168
+ /**
169
+ * get the module entities
170
+ * @access public
171
+ * @return array()
172
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
173
+ */
174
+ public function getEntities(){
175
+ $this->_prepareEntities();
176
+ return $this->_entities;
177
+ }
178
+ /**
179
+ * prepare the entities before saving
180
+ * @access protected
181
+ * @return Ultimate_ModuleCreator_Model_Module
182
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
183
+ */
184
+ protected function _prepareEntities(){
185
+ foreach ($this->_entities as $entity){
186
+ $entity->setFlat(true);//just flat entities for now - EAV will follow
187
+ }
188
+ return $this;
189
+ }
190
+ /**
191
+ * get the extensions xml path
192
+ * @access public
193
+ * @return string
194
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
195
+ */
196
+ public function getXmlPath(){
197
+ return Mage::helper('modulecreator')->getLocalPackagesPath().$this->getNamespace()."_".$this->getModuleName().'.xml';
198
+ }
199
+ /**
200
+ * save the module as xml
201
+ * @access public
202
+ * @return Ultimate_ModuleCreator_Model_Module
203
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
204
+ */
205
+ public function save(){
206
+ $destination = $this->getXmlPath();
207
+ $xml = $this->toXml(array(), 'module', true, false);
208
+ $this->_writeFile($destination, $xml);
209
+ return $this;
210
+ }
211
+ /**
212
+ * write a file
213
+ * @access protected
214
+ * @param string $destinationFile
215
+ * @param string $contents
216
+ * @return Ultimate_ModuleCreator_Model_Module
217
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
218
+ */
219
+ protected function _writeFile($destinationFile, $contents){
220
+ try{
221
+ $io = $this->getIo();
222
+ $io->mkdir(dirname($destinationFile));
223
+ $io->write($destinationFile, $contents, 0777);
224
+ }
225
+ catch (Exception $e){
226
+ if ($e->getCode() != 0){
227
+ throw $e;
228
+ }
229
+ }
230
+ return $this;
231
+ }
232
+ /**
233
+ * get the IO - class
234
+ * @access public
235
+ * @return Varien_Io_File
236
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
237
+ */
238
+ public function getIo(){
239
+ if (!$this->_io){
240
+ $this->_io = new Varien_Io_File();
241
+ $this->_io->setAllowCreateFolders(true);
242
+ }
243
+ return $this->_io;
244
+ }
245
+ /**
246
+ * write module on disc
247
+ * @access public
248
+ * @return array()
249
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
250
+ */
251
+ public function buildModule(){
252
+ $messages = array();
253
+ $config = $this->getConfig();
254
+ $files = $config->descend('files/file');
255
+ foreach ($files as $file){
256
+ $this->_createFile($file);
257
+ }
258
+ if ($this->getInstall()){
259
+ $existingFiles = $this->_checkExistingFiles();
260
+ if (count($existingFiles) > 0){
261
+ $this->setInstall(false);
262
+ $messages[] = Mage::helper('modulecreator')->__('The following files already exist. They were NOT overwritten. The extension was not installed. You can download it from the list of extensions and install it manually: %s', implode('<br />', $existingFiles));
263
+ }
264
+ }
265
+ $this->_writeFiles();
266
+ if (!$this->getInstall()){
267
+ $contents = array();
268
+ foreach ($this->_files as $filename=>$file){
269
+ $contents[] = $this->getRelativeBasePath().$filename;
270
+ }
271
+ $_writer = Mage::getModel('modulecreator/writer',$contents);
272
+ $_writer->setNamePackage(Mage::getBaseDir('var').DS.'modulecreator'.DS.$this->getNamespace().'_'.$this->getModuleName());
273
+ $_writer->composePackage()->archivePackage();
274
+ $this->_io->rmdir($this->getBasePath(), true);
275
+ }
276
+ return $messages;
277
+ }
278
+ /**
279
+ * check if some files already exist so it won't be overwritten
280
+ * @access protected
281
+ * @return array()
282
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
283
+ */
284
+ protected function _checkExistingFiles(){
285
+ $existingFiles = array();
286
+ $io = $this->getIo();
287
+ $basePath = $this->getBasePath();
288
+ foreach ($this->_files as $name=>$content){
289
+ if ($io->fileExists($basePath.$name)){
290
+ $existingFiles[] = $basePath.$name;
291
+ }
292
+ }
293
+ return $existingFiles;
294
+ }
295
+ /**
296
+ * get module base path
297
+ * @access public
298
+ * @return string
299
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
300
+ */
301
+ public function getBasePath(){
302
+ if (!$this->getInstall()){
303
+ return Mage::getBaseDir('var').DS.'modulecreator'.DS.$this->getNamespace()."_".$this->getModuleName().DS;
304
+ }
305
+ return Mage::getBaseDir().DS;
306
+ }
307
+ /**
308
+ * get relative path ro the module
309
+ * @access public
310
+ * @return string
311
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
312
+ */
313
+ public function getRelativeBasePath(){
314
+ $basePath = $this->getBasePath();
315
+ $remove = Mage::getBaseDir().DS;
316
+ $relativePath = substr($basePath, strlen($remove));
317
+ return $relativePath;
318
+ }
319
+ /**
320
+ * check if module can be installed
321
+ * @access public
322
+ * @return bool
323
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
324
+ */
325
+ public function getInstall(){
326
+ if (!Mage::helper('modulecreator')->canInstall()){
327
+ return false;
328
+ }
329
+ return $this->getData('install');
330
+ }
331
+ /**
332
+ * write files on disk
333
+ * @access protected
334
+ * @return Ultimate_ModuleCreator_Model_Module
335
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
336
+ */
337
+ protected function _writeFiles(){
338
+ $basePath = $this->getBasePath();
339
+ foreach ($this->_files as $name=>$file){
340
+ $destinationFile = $basePath.$name;
341
+ $this->_writeFile($destinationFile, $file);
342
+ }
343
+ return $this;
344
+ }
345
+ /**
346
+ * get the module config
347
+ * @access public
348
+ * @return Varien_Simplexml_Element
349
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
350
+ */
351
+ public function getConfig(){
352
+ if (is_null($this->_config)){
353
+ $configFile = Mage::getConfig()->getModuleDir('etc', 'Ultimate_ModuleCreator').DS.'modulecreator.xml';
354
+ $string = file_get_contents($configFile);
355
+ $xml = simplexml_load_string($string, 'Varien_Simplexml_Element');
356
+ $this->_config = $xml;
357
+ }
358
+ return $this->_config;
359
+
360
+ }
361
+ /**
362
+ * create a file
363
+ * @access protected
364
+ * @param Varien_Simplexml_Element
365
+ * @return Ultimate_ModuleCreator_Model_Module
366
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
367
+ */
368
+ protected function _createFile($config){
369
+ switch ($config->scope){
370
+ case 'entity' :
371
+ $this->_buildEntityFile($config);
372
+ break;
373
+ case 'siblings' :
374
+ $this->_buildSiblingFile($config);
375
+ break;
376
+ case 'children' :
377
+ $this->_buildChildrenFile($config);
378
+ break;
379
+ case 'global':
380
+ default:
381
+ $this->_buildGlobalFile($config);
382
+ break;
383
+ }
384
+ return $this;
385
+ }
386
+ /**
387
+ * create a file with global scope
388
+ * @access protected
389
+ * @param Varien_Simplexml_Element
390
+ * @return Ultimate_ModuleCreator_Model_Module
391
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
392
+ */
393
+ public function _buildGlobalFile($config){
394
+ $filetype = $config->filetype;
395
+ $sourceFolder = $this->getSourceFolder().$this->_filterString((string)$config->from, $filetype);
396
+ $destinationFile = $this->_filterString((string)$config->to, $filetype);
397
+ $content = '';
398
+ $depend = $config->depend;
399
+ $build = true;
400
+ if ($depend){
401
+ foreach ($depend->asArray() as $condition=>$value){
402
+ if (!$this->getDataUsingMethod($condition)){
403
+ $build = false;
404
+ break;
405
+ }
406
+ }
407
+ }
408
+ if (!$build){
409
+ return '';
410
+ }
411
+ $content = '';
412
+ if ($config->method){
413
+ $method = (string)$config->method;
414
+ $content = $this->$method();
415
+ }
416
+ else{
417
+ foreach ($config->descend('content/file') as $file){
418
+ $sourceContent = $this->getFileContents($sourceFolder.(string)$file->name);
419
+ $scope = (string)$file->scope;
420
+ $depend = $file->depend;
421
+ $scope = $file->scope;
422
+ if ($scope == 'entity'){
423
+ foreach ($this->getEntities() as $entity){
424
+ $valid = true;
425
+ if ($depend){
426
+ foreach ($depend->asArray() as $condition=>$value){
427
+ if (!$entity->getDataUsingMethod($condition)){
428
+ $valid = false;
429
+ break;
430
+ }
431
+ }
432
+ }
433
+ if ($valid){
434
+ $replace = $entity->getPlaceholders();
435
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
436
+ }
437
+ }
438
+ }
439
+ elseif($scope == 'attribute'){
440
+ $depend = $file->depend;
441
+ $dependType = $file->depend_type;
442
+ foreach ($this->getEntities() as $entity){
443
+ foreach ($entity->getAttributes() as $attribute){
444
+ $valid = true;
445
+ if ($depend){
446
+ foreach ($depend->asArray() as $condition=>$value){
447
+ if (!$attribute->getDataUsingMethod($condition)){
448
+ $valid = false;
449
+ break;
450
+ }
451
+ }
452
+ }
453
+ $typeValid = true;
454
+ if ($dependType){
455
+ $typeValid = false;
456
+ foreach ($dependType->asArray() as $condition=>$value){
457
+ if ($attribute->getType() == $condition){
458
+ $typeValid = true;
459
+ break;
460
+ }
461
+ }
462
+ }
463
+ if ($valid && $typeValid){
464
+ $replace = $entity->getPlaceholders();
465
+ $attributeReplace = $attribute->getPlaceholders();
466
+ $replace = array_merge($replace, $attributeReplace);
467
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
468
+ }
469
+ }
470
+ }
471
+ }
472
+ elseif($scope == 'siblings'){
473
+ foreach ($this->getRelations(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING) as $relation){
474
+ $entities = $relation->getEntities();
475
+ $replaceEntity = $entities[0]->getPlaceholders();
476
+ $replaceSibling = $entities[1]->getPlaceholdersAsSibling();
477
+ $replace = array_merge($replaceEntity, $replaceSibling);
478
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
479
+ }
480
+ }
481
+ elseif($scope == 'siblings-both'){
482
+ foreach ($this->getRelations(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING) as $relation){
483
+ $entities = $relation->getEntities();
484
+ $replaceEntity = $entities[0]->getPlaceholders();
485
+ $replaceSibling = $entities[1]->getPlaceholdersAsSibling();
486
+ $replace = array_merge($replaceEntity, $replaceSibling);
487
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
488
+
489
+ $replaceEntity = $entities[1]->getPlaceholders();
490
+ $replaceSibling = $entities[0]->getPlaceholdersAsSibling();
491
+ $replace = array_merge($replaceEntity, $replaceSibling);
492
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
493
+ }
494
+ }
495
+ elseif ($scope == 'children'){
496
+ foreach ($this->getRelations(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD) as $relation){
497
+ $entities = $relation->getEntities();
498
+ $replaceEntity = $entities[0]->getPlaceholders();
499
+ $replaceSibling = $entities[1]->getPlaceholdersAsSibling();
500
+ $replace = array_merge($replaceEntity, $replaceSibling);
501
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
502
+ }
503
+ foreach ($this->getRelations(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_PARENT) as $relation){
504
+ $entities = $relation->getEntities();
505
+ $replaceEntity = $entities[1]->getPlaceholders();
506
+ $replaceSibling = $entities[0]->getPlaceholdersAsSibling();
507
+ $replace = array_merge($replaceEntity, $replaceSibling);
508
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
509
+ }
510
+ }
511
+ else{
512
+ $valid = true;
513
+ $depend = $file->depend;
514
+ if ($depend){
515
+ foreach ($depend->asArray() as $condition=>$value){
516
+ if (!$this->getDataUsingMethod($condition)){
517
+ $valid = false;
518
+ break;
519
+ }
520
+ }
521
+ }
522
+ if ($valid){
523
+ $content .= $this->_filterString($sourceContent, $filetype);
524
+ }
525
+ }
526
+ }
527
+ }
528
+ if ($config->after_build){
529
+ $function = (string)$config->after_build;
530
+ $content = $this->$function($content);
531
+ }
532
+ $this->_addFile($destinationFile, $content);
533
+ return $this;
534
+ }
535
+ /**
536
+ * create a file with entity scope
537
+ * @access protected
538
+ * @param Varien_Simplexml_Element
539
+ * @return Ultimate_ModuleCreator_Model_Module
540
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
541
+ */
542
+ protected function _buildEntityFile($config){
543
+ foreach ($this->getEntities() as $entity){
544
+ $filetype = $config->filetype;
545
+ $sourceFolder = $this->getSourceFolder().$this->_filterString((string)$config->from, $filetype);
546
+ $destinationFile = $this->_filterString((string)$config->to, $filetype, $entity->getPlaceholders(), true);
547
+ $content = '';
548
+ $depend = $config->depend;
549
+ $build = true;
550
+ if ($depend){
551
+ foreach ($depend->asArray() as $condition=>$value){
552
+ if (!$entity->getDataUsingMethod($condition)){
553
+ $build = false;
554
+ break;
555
+ }
556
+ }
557
+ }
558
+ if (!$build){
559
+ continue;
560
+ }
561
+ foreach ($config->descend('content/file') as $file){
562
+ $sourceContent = $this->getFileContents($sourceFolder.(string)$file->name);
563
+ $scope = (string)$file->scope;
564
+ $depend = $file->depend;
565
+ $dependType = $file->depend_type;
566
+ if ($scope == 'attribute'){
567
+ foreach ($entity->getAttributes() as $attribute){
568
+ $valid = true;
569
+ if ($depend){
570
+ foreach ($depend->asArray() as $condition=>$value){
571
+ if (!$attribute->getDataUsingMethod($condition)){
572
+ $valid = false;
573
+ break;
574
+ }
575
+ }
576
+ }
577
+ $typeValid = true;
578
+ if ($dependType){
579
+ $typeValid = false;
580
+ foreach ($dependType->asArray() as $condition=>$value){
581
+ if ($attribute->getType() == $condition){
582
+ $typeValid = true;
583
+ break;
584
+ }
585
+ }
586
+ }
587
+ if ($valid && $typeValid){
588
+ $replace = $entity->getPlaceholders();
589
+ $attributeReplace = $attribute->getPlaceholders();
590
+ $replace = array_merge($replace, $attributeReplace);
591
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
592
+ }
593
+ }
594
+ }
595
+ elseif($scope == 'siblings'){
596
+ foreach ($entity->getRelatedEntities(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING) as $related){
597
+ $placeholders = $entity->getPlaceholders();
598
+ $replaceSibling = $related->getPlaceholdersAsSibling();
599
+ $replace = array_merge($placeholders, $replaceSibling);
600
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
601
+ }
602
+ }
603
+ elseif($scope == 'parents'){
604
+ foreach ($entity->getRelatedEntities(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD) as $related){
605
+ $placeholders = $entity->getPlaceholders();
606
+ $replaceSibling = $related->getPlaceholdersAsSibling();
607
+ $replace = array_merge($placeholders, $replaceSibling);
608
+ $content .= $this->_filterString($sourceContent, $filetype, $replace, true);
609
+ }
610
+ }
611
+ elseif ($depend){
612
+ $valid = true;
613
+ foreach ($depend->asArray() as $condition=>$value){
614
+ if (!$entity->getDataUsingMethod($condition)){
615
+ $valid = false;
616
+ break;
617
+ }
618
+ }
619
+ if ($valid){
620
+ $content .= $this->_filterString($sourceContent, $filetype, $entity->getPlaceholders(), true);
621
+ }
622
+ }
623
+ else{
624
+ $content .= $this->_filterString($sourceContent, $filetype, $entity->getPlaceholders(), true);
625
+ }
626
+ $this->_addFile($destinationFile, $content);
627
+ }
628
+ }
629
+ return $this;
630
+ }
631
+ /**
632
+ * create files for sibling relations
633
+ * @access protected
634
+ * @param Varien_Simplexml_Element
635
+ * @return Ultimate_ModuleCreator_Model_Module
636
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
637
+ */
638
+ protected function _buildSiblingFile($config){
639
+ foreach ($this->getRelations(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING) as $relation){
640
+ $entities = $relation->getEntities();
641
+ foreach ($entities as $index=>$entity){
642
+ $depend = $config->depend;
643
+ $build = true;
644
+ if ($depend){
645
+ foreach ($depend->asArray() as $condition=>$value){
646
+ if (!$relation->getDataUsingMethod($condition, $index)){
647
+ $build = false;
648
+ break;
649
+ }
650
+ }
651
+ }
652
+ if (!$build){
653
+ continue;
654
+ }
655
+ $placeholders = array_merge($entities[$index]->getPlaceholders(), $entities[1 - $index]->getPlaceholdersAsSibling());
656
+ $filetype = $config->filetype;
657
+ $sourceFolder = $this->getSourceFolder().$this->_filterString((string)$config->from, $filetype);
658
+ $destinationFile = $this->_filterString((string)$config->to, $filetype, $placeholders, true);
659
+ $content = '';
660
+ foreach ($config->descend('content/file') as $file){
661
+ $sourceContent = $this->getFileContents($sourceFolder.(string)$file->name);
662
+ $content .= $this->_filterString($sourceContent, $filetype, $placeholders, true);
663
+ }
664
+ $this->_addFile($destinationFile, $content);
665
+ }
666
+ }
667
+ return $this;
668
+ }
669
+
670
+ /**
671
+ * create files for children relations
672
+ * @access protected
673
+ * @param Varien_Simplexml_Element
674
+ * @return Ultimate_ModuleCreator_Model_Module
675
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
676
+ */
677
+ protected function _buildChildrenFile($config){
678
+ foreach ($this->getRelations() as $relation){
679
+ $type = $relation->getType();
680
+ $entities = $relation->getEntities();
681
+ $parent = false;
682
+ $child = false;
683
+ if ($type == Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_PARENT){
684
+ $parent = $entities[0];
685
+ $child = $entities[1];
686
+ }
687
+ elseif ($type == Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD){
688
+ $parent = $entities[1];
689
+ $child = $entities[0];
690
+ }
691
+ if ($parent && $child){
692
+
693
+ $depend = $config->depend;
694
+ $build = true;
695
+ if ($depend){
696
+ foreach ($depend->asArray() as $condition=>$value){
697
+ if (!$relation->getDataUsingMethod($condition)){
698
+ $build = false;
699
+ break;
700
+ }
701
+ }
702
+ }
703
+ if (!$build){
704
+ continue;
705
+ }
706
+ $placeholders = array_merge($parent->getPlaceholders(), $child->getPlaceholdersAsSibling());
707
+ $filetype = $config->filetype;
708
+ $sourceFolder = $this->getSourceFolder().$this->_filterString((string)$config->from, $filetype);
709
+ $destinationFile = $this->_filterString((string)$config->to, $filetype, $placeholders, true);
710
+ $content = '';
711
+ foreach ($config->descend('content/file') as $file){
712
+ $sourceContent = $this->getFileContents($sourceFolder.(string)$file->name);
713
+ $content .= $this->_filterString($sourceContent, $filetype, $placeholders, true);
714
+ }
715
+ $this->_addFile($destinationFile, $content);
716
+ }
717
+ }
718
+ return $this;
719
+ }
720
+
721
+ /**
722
+ * add file
723
+ * @access protected
724
+ * @param string $destinationFile
725
+ * @param string $content
726
+ * @return Ultimate_ModuleCreator_Model_Module
727
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
728
+ */
729
+ protected function _addFile($destinationFile, $content){
730
+ if (trim($content)){
731
+ $this->_files[$destinationFile] = $content;
732
+ }
733
+ return $this;
734
+ }
735
+ /**
736
+ * get contents of a file
737
+ * @access public
738
+ * @param string $file
739
+ * @return string
740
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
741
+ */
742
+ public function getFileContents($file){
743
+ return file_get_contents($file);
744
+ }
745
+ /**
746
+ * filter placeholders
747
+ * @access protected
748
+ * @param string $string
749
+ * @param string $fileType
750
+ * @param mixed (null|array()) $replaceArray
751
+ * @param bool $mergeReplace
752
+ * @param bool $forLicence
753
+ * @return string
754
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
755
+ */
756
+ protected function _filterString($string, $fileType, $replaceArray = null, $mergeReplace = false, $forLicence = false){
757
+ $replace = array();
758
+ $replace['{{DS}}'] = DS;
759
+ $replace['{{namespace}}'] = strtolower($this->getNamespace());
760
+ $replace['{{sort_order}}'] = (int)$this->getSortOrder();
761
+ $replace['{{module}}'] = strtolower($this->getModuleName());
762
+ $replace['{{Namespace}}'] = $this->getNamespace();
763
+ $replace['{{Module}}'] = $this->getModuleName();
764
+ $replace['{{NAMESPACE}}'] = strtoupper($this->getNamespace());
765
+ $replace['{{MODULE}}'] = strtoupper($this->getModuleName());
766
+ if (!$forLicence) {
767
+ $replace['{{License}}'] = $this->getLicenseText($fileType);
768
+ }
769
+ $replace['{{codepool}}'] = $this->getCodepool();
770
+ $replace['{{qwertyuiop}}'] = $this->getQwertyuiop();
771
+ $replace['{{package}}'] = $this->getFrontPackage();
772
+ $replace['{{theme_layout}}'] = $this->getFrontTemplates();
773
+ $replace['{{theme_template}}'] = $this->getFrontTemplates();
774
+ $replace['{{Y}}'] = date('Y');
775
+ if (!is_null($replaceArray)){
776
+ if ($mergeReplace){
777
+ $replace = array_merge($replace, $replaceArray);
778
+ }
779
+ else{
780
+ $replace = $replaceArray;
781
+ }
782
+ }
783
+ return str_replace(array_keys($replace), array_values($replace), $string);
784
+ }
785
+ /**
786
+ * get text for licence
787
+ * @access public
788
+ * @param string $fileType
789
+ * @return string
790
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
791
+ */
792
+ public function getLicenseText($fileType){
793
+ if (!$this->getData('processed_license_'.$fileType)){
794
+ $license = trim($this->getData('license'));
795
+ if (!$license){
796
+ return '';
797
+ }
798
+ while(strpos($license, '*/') !== false){
799
+ $license = str_replace('*/', '', $license);
800
+ }
801
+ while(strpos($license, '/*') !== false){
802
+ $license = str_replace('/*', '', $license);
803
+ }
804
+ while(strpos($license, '<!--') !== false){
805
+ $license = str_replace('<!--', '', $license);
806
+ }
807
+ while(strpos($license, '-->') !== false){
808
+ $license = str_replace('-->', '', $license);
809
+ }
810
+ $lines = explode("\n", $license);
811
+ $top = '';
812
+ $footer = '';
813
+ if ($fileType == 'xml'){
814
+ $top = '<!--'."\n";
815
+ $footer = "\n".'-->';
816
+ }
817
+ $processed = $top.'/**'."\n";
818
+ foreach ($lines as $line){
819
+ $processed .= ' * '.$line."\n";
820
+ }
821
+ $processed .= ' */'.$footer;
822
+ $this->setData('processed_license_'.$fileType, $this->_filterString($processed, $fileType, array(), true, true));
823
+ }
824
+ return $this->getData('processed_license_'.$fileType);
825
+ }
826
+ /**
827
+ * get sample files source folder
828
+ * @access public
829
+ * @return string
830
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
831
+ */
832
+ public function getSourceFolder(){
833
+ if (!$this->_sourceFolder){
834
+ $this->_sourceFolder = Mage::getConfig()->getModuleDir('etc', 'Ultimate_ModuleCreator').DS.'modulecreator'.DS;
835
+ }
836
+ return $this->_sourceFolder;
837
+ }
838
+ /**
839
+ * sort the translation file
840
+ * @access protected
841
+ * @param string $content
842
+ * @return string
843
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
844
+ */
845
+ protected function _sortTranslationFile($content){
846
+ $lines = explode(PHP_EOL, $content);
847
+ $distinct = array();
848
+ foreach ($lines as $line){
849
+ if (trim($line)){
850
+ $distinct[$line] = 1;
851
+ }
852
+ }
853
+ //remove blank line
854
+ if (isset($distinct['"",""'])){
855
+ unset($distinct['"",""']);
856
+ }
857
+ ksort($distinct);
858
+ $content = implode(PHP_EOL, array_keys($distinct));
859
+ return $content;
860
+ }
861
+ /**
862
+ * get extension name
863
+ * @access public
864
+ * @return string
865
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
866
+ */
867
+ public function getExtension(){
868
+ return $this->getNamespace().'_'.$this->getModuleName();
869
+ }
870
+ /**
871
+ * add relation to module
872
+ * @access public
873
+ * @param Ultimate_ModuleCreator_Model_Relation $relation
874
+ * @return Ultimate_ModuleCreator_Model_Module
875
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
876
+ */
877
+ public function addRelation(Ultimate_ModuleCreator_Model_Relation $relation){
878
+ $this->_relations[] = $relation;
879
+ return $this;
880
+ }
881
+ /**
882
+ * get module relations
883
+ * @access public
884
+ * @param mixed $type
885
+ * @return array()
886
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
887
+ */
888
+ public function getRelations($type = null){
889
+ if (is_null($type)){
890
+ return $this->_relations;
891
+ }
892
+ $relations = array();
893
+ foreach ($this->_relations as $relation){
894
+ if ($relation->getType() == $type){
895
+ $relations[] = $relation;
896
+ }
897
+ }
898
+ return $relations;
899
+ }
900
+ }
app/code/community/Ultimate/ModuleCreator/Model/Module/Collection.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * module collection
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Module_Collection extends Varien_Data_Collection_Filesystem{
25
+ /**
26
+ * Files and folders regexsp
27
+ *
28
+ * @var string
29
+ */
30
+ protected $_allowedDirsMask = '/^[a-z0-9\.\-]+$/i';
31
+ protected $_allowedFilesMask= '/^[a-z0-9\.\-\_]+\.(xml|ser)$/i';
32
+ protected $_disallowedFilesMask = '/^package\.xml$/i';
33
+
34
+ /**
35
+ * Base dir where packages are located
36
+ *
37
+ * @var string
38
+ */
39
+ protected $_baseDir = '';
40
+
41
+ /**
42
+ * Set base dir
43
+ * @access public
44
+ * @return void
45
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
46
+ */
47
+ public function __construct(){
48
+ $this->_baseDir = Mage::getBaseDir('var') . DS . 'modulecreator'.DS.'package';
49
+ $io = new Varien_Io_File();
50
+ $io->setAllowCreateFolders(true)->createDestinationDir($this->_baseDir);
51
+ $this->addTargetDir($this->_baseDir);
52
+ }
53
+
54
+ /**
55
+ * Row generator
56
+ * @access public
57
+ * @param string $filename
58
+ * @return array
59
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
60
+ */
61
+ protected function _generateRow($filename){
62
+ $row = parent::_generateRow($filename);
63
+ $row['package'] = preg_replace('/\.(xml|ser)$/', '', str_replace($this->_baseDir . DS, '', $filename));
64
+ $row['filename_id'] = $row['package'];
65
+ $row['safe_id'] = strtr(base64_encode($row['package']), '+/=', '-_,');
66
+ $folder = explode(DS, $row['package']);
67
+ $row['folder'] = DS;
68
+ array_pop($folder);
69
+ if (!empty($folder)) {
70
+ $row['folder'] = implode(DS, $folder) . DS;
71
+ }
72
+ return $row;
73
+ }
74
+
75
+ /**
76
+ * Get all folders as options array
77
+ * @access public
78
+ * @return array
79
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
80
+ */
81
+ public function collectFolders() {
82
+ $collectFiles = $this->_collectFiles;
83
+ $collectDirs = $this->_collectDirs;
84
+ $this->setCollectFiles(false)->setCollectDirs(true);
85
+
86
+ $this->_collectRecursive($this->_baseDir);
87
+ $result = array(DS => DS);
88
+ foreach ($this->_collectedDirs as $dir) {
89
+ $dir = str_replace($this->_baseDir . DS, '', $dir) . DS;
90
+ $result[$dir] = $dir;
91
+ }
92
+ $this->setCollectFiles($collectFiles)->setCollectDirs($collectDirs);
93
+ return $result;
94
+ }
95
+ }
app/code/community/Ultimate/ModuleCreator/Model/Relation.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ class Ultimate_ModuleCreator_Model_Relation extends Ultimate_ModuleCreator_Model_Abstract{
18
+ protected $_entity1;
19
+ protected $_entity2;
20
+ protected $_type;
21
+ /**
22
+ * set entities in relation
23
+ * @access public
24
+ * @param Ultimate_ModuleCreator_Model_Entity $entity1
25
+ * @param Ultimate_ModuleCreator_Model_Entity $entity2
26
+ * @param int $type
27
+ * @return Ultimate_ModuleCreator_Model_Relation
28
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
29
+ */
30
+
31
+ public function setEntities(Ultimate_ModuleCreator_Model_Entity $entity1, Ultimate_ModuleCreator_Model_Entity $entity2, $type){
32
+ $this->_entity1 = $entity1;
33
+ $this->_entity2 = $entity2;
34
+ $this->_type = $type;
35
+ switch($type){
36
+ case Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_NONE:
37
+ break;
38
+ case Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD:
39
+ $this->_entity1->addRelatedEntity($type, $this->_entity2);
40
+ $this->_entity2->addRelatedEntity(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_PARENT, $this->_entity1);
41
+ break;
42
+ case Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_PARENT:
43
+ $this->_entity1->addRelatedEntity($type, $this->_entity2);
44
+ $this->_entity2->addRelatedEntity(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD, $this->_entity1);
45
+ break;
46
+ case Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING:
47
+ $this->_entity1->addRelatedEntity($type, $this->_entity2);
48
+ $this->_entity2->addRelatedEntity(Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING, $this->_entity1);
49
+ break;
50
+ default:
51
+ break;
52
+ }
53
+ return $this;
54
+ }
55
+ /**
56
+ * get the relation type
57
+ * @access public
58
+ * @return int
59
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
60
+ */
61
+ public function getType(){
62
+ return $this->_type;
63
+ }
64
+ /**
65
+ * get relation entities
66
+ * @access public
67
+ * @return array
68
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
69
+ */
70
+ public function getEntities(){
71
+ return array($this->_entity1, $this->_entity2);
72
+ }
73
+ /**
74
+ * relation to xml
75
+ * @access protected
76
+ * @param array $arrAttributes
77
+ * @param string $rootName
78
+ * @param bool $addOpenTag
79
+ * @param bool $addCdata
80
+ * @return string
81
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
82
+ */
83
+ protected function __toXml(array $arrAttributes = array(), $rootName = 'relation', $addOpenTag=false, $addCdata=false){
84
+ $xml = '';
85
+ if ($rootName){
86
+ $xml .= '<'.$rootName.'>';
87
+ }
88
+ $entities = $this->getEntities();
89
+ $xml .= '<'.$entities[0]->getNameSingular().'_'.$entities[1]->getNameSingular().'>';
90
+ $xml .= $this->getType();
91
+ $xml .= '</'.$entities[0]->getNameSingular().'_'.$entities[1]->getNameSingular().'>';
92
+ if ($rootName){
93
+ $xml .= '</'.$rootName.'>';
94
+ }
95
+ return $xml;
96
+ }
97
+ /**
98
+ * check if siblings can be listed in the entity view page
99
+ * @access public
100
+ * @param int $index
101
+ * @return bool
102
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
103
+ */
104
+ public function getShowFrontendRelationSiblings($index){
105
+ if ($this->getType() != Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_SIBLING){
106
+ return false;
107
+ }
108
+ $index = !!$index;
109
+ $entities = $this->getEntities();
110
+ $e = $entities[$index];
111
+ return $e->getFrontendView();
112
+ }
113
+ /**
114
+ * check if children can be listed in the parent view page
115
+ * @access public
116
+ * @return bool
117
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
118
+ */
119
+ public function getShowFrontendRelationChildren(){
120
+ if ($this->getType() == Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_CHILD){
121
+ $index = 1;
122
+ }
123
+ elseif ($this->getType() == Ultimate_ModuleCreator_Helper_Data::RELATION_TYPE_PARENT){
124
+ $index = 0;
125
+ }
126
+ else {
127
+ return false;
128
+ }
129
+ $entities = $this->getEntities();
130
+ $e = $entities[$index];
131
+ return $e->getFrontendView();
132
+ }
133
+ }
app/code/community/Ultimate/ModuleCreator/Model/Writer.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Zip writer
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Model_Writer extends Mage_Connect_Package_Writer{
25
+ /**
26
+ * prefix for path
27
+ * @var string
28
+ */
29
+ protected $_pathPrefix = '';
30
+ /**
31
+ * constructor
32
+ * @access public
33
+ * @param array $files
34
+ * @param mixed $namePackage
35
+ * @return void
36
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
37
+ */
38
+ public function __construct($files, $namePackage=''){
39
+ parent::__construct($files, $namePackage='');
40
+ $this->_pathPrefix = 'var'.DS.'modulecreator'.DS;
41
+ }
42
+ /**
43
+ * build the package
44
+ * @access public
45
+ * @return Ultimate_ModuleCreator_Model_Writer
46
+ * @see Mage_Connect_Package_Writer::composePackage()
47
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
48
+ */
49
+ public function composePackage(){
50
+ @mkdir(self::PATH_TO_TEMPORARY_DIRECTORY, 0777, true);
51
+ $root = self::PATH_TO_TEMPORARY_DIRECTORY . basename($this->_namePackage);
52
+ @mkdir($root, 0777, true);
53
+ foreach ($this->_files as $file) {
54
+ if (is_dir($file) || is_file($file)) {
55
+ $fileName = basename($file);
56
+ $filePath = dirname($file);
57
+ if (substr($filePath, 0, strlen($this->_pathPrefix)) == $this->_pathPrefix){
58
+ $filePath = substr($filePath, strlen($this->_pathPrefix));
59
+ }
60
+ @mkdir($root . DS . $filePath, 0777, true);
61
+ if (is_file($file)) {
62
+ copy($file, $root . DS . $filePath . DS . $fileName);
63
+ }
64
+ else {
65
+ @mkdir($root . DS . $filePath . $fileName, 0777);
66
+ }
67
+ }
68
+ }
69
+ $this->_temporaryPackageDir = $root;
70
+ return $this;
71
+ }
72
+ /**
73
+ * set the package name
74
+ * @access public
75
+ * @return Ultimate_ModuleCreator_Model_Writer
76
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
77
+ */
78
+ public function setNamePackage($name){
79
+ $this->_namePackage = $name;
80
+ return $this;
81
+ }
82
+ }
app/code/community/Ultimate/ModuleCreator/controllers/Adminhtml/ModulecreatorController.php ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * admin controller
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ class Ultimate_ModuleCreator_Adminhtml_ModulecreatorController extends Mage_Adminhtml_Controller_Action{
25
+ /**
26
+ * default action
27
+ * @access public
28
+ * @return void
29
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
30
+ */
31
+ public function indexAction(){
32
+ $this->_title($this->__('Ultimate module creator'));
33
+ $this->loadLayout();
34
+ $this->renderLayout();
35
+ }
36
+ /**
37
+ * grid action
38
+ * @access public
39
+ * @return void
40
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
41
+ */
42
+ public function gridAction(){
43
+ $this->loadLayout();
44
+ $this->renderLayout();
45
+ }
46
+ /**
47
+ * new action
48
+ * @access public
49
+ * @return void
50
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
51
+ */
52
+ public function newAction(){
53
+ $this->_forward('edit');
54
+ }
55
+ /**
56
+ * edit action
57
+ * @access public
58
+ * @return void
59
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
60
+ */
61
+ public function editAction(){
62
+ $data = $this->_initModule();
63
+ $this->_title($this->__('Ultimate module creator'));
64
+ if ($data){
65
+ $this->_getSession()->addNotice(Mage::helper('modulecreator')->__('You are editing the module: %s',(string)$data->extension));
66
+ $this->_title((string)$data->descend('config/module'));
67
+ }
68
+ else{
69
+ $this->_title($this->__('Add module'));
70
+ }
71
+ $this->loadLayout();
72
+ $this->renderLayout();
73
+ }
74
+ /**
75
+ * init module
76
+ * @access protected
77
+ * @return mixed
78
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
79
+ */
80
+ protected function _initModule(){
81
+ $packageName = base64_decode(strtr($this->getRequest()->getParam('id'), '-_,', '+/='));
82
+ if ($packageName){
83
+ try {
84
+ $data = Mage::helper('modulecreator')->loadModule($packageName);
85
+ Mage::register('current_module', $data);
86
+ return $data;
87
+ }
88
+ catch (Exception $e) {
89
+ $this->_getSession()->addError($e->getMessage());
90
+ $this->_redirect('*/*/index');
91
+ }
92
+ }
93
+ return false;
94
+ }
95
+ /**
96
+ * add new entity - action
97
+ * @access public
98
+ * @return void
99
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
100
+ */
101
+ public function addEntityAction(){
102
+ $increment = $this->getRequest()->getParam('increment', 0);
103
+ $entity = Mage::getModel('modulecreator/entity');
104
+ $settings = Mage::getStoreConfig('modulecreator/entity_defaults');
105
+ $entity->addData($settings);
106
+ $response = Mage::app()->getLayout()
107
+ ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_entities_entity')
108
+ ->setTemplate('ultimate_modulecreator/edit/tab/entities/entity.phtml')
109
+ ->setEntity($entity)
110
+ ->setIncrement($increment)
111
+ ->toHtml();
112
+ $this->getResponse()->setBody($response);
113
+ }
114
+ /**
115
+ * add new attribute/field
116
+ * @access public
117
+ * @return void
118
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
119
+ */
120
+ public function addAttributeAction(){
121
+ $increment = $this->getRequest()->getParam('increment', 0);
122
+ $entityId = $this->getRequest()->getParam('entity', 0);
123
+ $response = Mage::app()->getLayout()
124
+ ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_entities_entity_attribute')
125
+ ->setTemplate('ultimate_modulecreator/edit/tab/entities/entity/attribute.phtml')
126
+ ->setAttributeInstance(Mage::getModel('modulecreator/attribute'))
127
+ ->setIncrement($increment)
128
+ ->setEntityId($entityId)
129
+ ->toHtml();
130
+ $this->getResponse()->setBody($response);
131
+ }
132
+ /**
133
+ * validate module before saving
134
+ * @access public
135
+ * @return void
136
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
137
+ */
138
+ public function validateAction(){
139
+ $errors = array();
140
+ $response = new Varien_Object();
141
+ $response->setError(false);
142
+ $data = $this->getRequest()->getPost();
143
+ $entities = $this->getRequest()->getPost('entity');
144
+ $settings = $this->getRequest()->getPost('settings');
145
+ if (empty($settings['namespace'])){
146
+ $error = new Varien_Object();
147
+ $error->setField('settings_namespace');
148
+ $error->setMessage(Mage::helper('modulecreator')->__('Fill in the Namespace'));
149
+ $errors[] = $error->toArray();
150
+ }
151
+ if (empty($settings['module_name'])){
152
+ $error = new Varien_Object();
153
+ $error->setField('settings_module_name');
154
+ $error->setMessage(Mage::helper('modulecreator')->__('Fill in the Module name'));
155
+ $errors[] = $error->toArray();
156
+ }
157
+ else{
158
+ $validModule = Mage::helper('modulecreator')->validateModuleName($settings['module_name'], $settings['current_extension']);
159
+ if (is_string($validModule)){
160
+ $error = new Varien_Object();
161
+ $error->setMessage($validModule);
162
+ $error->setField('settings_module_name');
163
+ $errors[] = $error->toArray();
164
+ }
165
+ }
166
+ $validExtension = Mage::helper('modulecreator')->validateExtensionName($settings['namespace'], $settings['module_name'], $settings['current_extension']);
167
+ if (is_string($validExtension)){
168
+ $error = new Varien_Object();
169
+ $error->setMessage($validExtension);
170
+ $errors[] = $error->toArray();
171
+ }
172
+ if (empty($entities)){
173
+ $error = new Varien_Object();
174
+ $error->setMessage(Mage::helper('modulecreator')->__('Add at least one entity'));
175
+ $errors[] = $error->toArray();
176
+ }
177
+ else{
178
+ //validate each entity
179
+ $noAttributeEntities = false;
180
+ $noNameEntities = false;
181
+ foreach ($entities as $key=>$entity){
182
+ if (empty($entity['name_singular'])){
183
+ $error = new Varien_Object();
184
+ $error->setMessage(Mage::helper('modulecreator')->__('This is a required field.'));
185
+ $error->setField('entity_'.$key.'_name_singular');
186
+ $errors[] = $error->toArray();
187
+ }
188
+ if (empty($entity['name_plural'])){
189
+ $error = new Varien_Object();
190
+ $error->setMessage(Mage::helper('modulecreator')->__('This is a required field.'));
191
+ $error->setField('entity_'.$key.'_name_plural');
192
+ $errors[] = $error->toArray();
193
+ }
194
+ if (!isset($entity['attributes']) && !$noAttributeEntities){
195
+ $error = new Varien_Object();
196
+ $error->setMessage(Mage::helper('modulecreator')->__('There are entities without attribtues. Add attributes or remove them before continuing.'));
197
+ $errors[] = $error->toArray();
198
+ $noAttributeEntities = true;
199
+ }
200
+ elseif (isset($entity['attributes'])){
201
+ //validate attributes
202
+ foreach ($entity['attributes'] as $attrKey=>$attribute){
203
+ if (is_numeric($attrKey)){
204
+ $validAttribute = Mage::helper('modulecreator')->validateAttributeName($attribute['code']);
205
+ if (is_string($validAttribute)){
206
+ $error = new Varien_Object();
207
+ $error->setMessage($validAttribute);
208
+ $error->setField('attribute_'.$key.'_'.$attrKey.'_code');
209
+ $errors[] = $error->toArray();
210
+ }
211
+ }
212
+ }
213
+ }
214
+ if ((!isset($entity['attributes']) || is_null($entity['attributes']['is_name'])) && !$noNameEntities){
215
+ $error = new Varien_Object();
216
+ $error->setMessage(Mage::helper('modulecreator')->__('Each entity must have an attribute set to behave as "Name"'));
217
+ $errors[] = $error->toArray();
218
+ $noNameEntities = true;
219
+ }
220
+ $validEntity = Mage::helper('modulecreator')->validateEntityName($settings['module_name'], @$entity['name_singular'], $settings['current_extension']);
221
+ if (is_string($validEntity)){
222
+ $error = new Varien_Object();
223
+ $error->setMessage($validEntity);
224
+ $error->setField('entity_'.$key.'_name_singular');
225
+ $errors[] = $error->toArray();
226
+ }
227
+
228
+ }
229
+ }
230
+ try{
231
+ $module = $this->_initModuleFromData($data);
232
+ }
233
+ catch (Exception $e){
234
+ $error = new Varien_Object();
235
+ $error->setMessage($e->getMessage());
236
+ $errors[] = $error->toArray();
237
+ }
238
+ if (count($errors) > 0){
239
+ $response->setError(true);
240
+ $response->setErrors($errors);
241
+ }
242
+ $this->getResponse()->setBody($response->toJson());
243
+ }
244
+ /**
245
+ * init a module from an array
246
+ * @access public
247
+ * @param array $data
248
+ * @return Ultimate_ModuleCreator_Model_Module
249
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
250
+ */
251
+ protected function _initModuleFromData($data){
252
+ $entitiesByIndex = array();
253
+ $module = Mage::getModel('modulecreator/module');
254
+ if (isset($data['settings'])){
255
+ $module->addData($data['settings']);
256
+ }
257
+ if (isset($data['entity'])){
258
+ $entities = $data['entity'];
259
+ if (is_array($entities)){
260
+ foreach ($entities as $key=>$entityData){
261
+ $entity = Mage::getModel('modulecreator/entity');
262
+ $entity->addData($entityData);
263
+ if (isset($entityData['attributes']) && is_array($entityData['attributes'])){
264
+ if (isset($entityData['attributes']['is_name'])){
265
+ $isName = $entityData['attributes']['is_name'];
266
+ unset($entityData['attributes']['is_name']);
267
+ }
268
+ if (isset($entityData['attributes'][$isName])){
269
+ $entityData['attributes'][$isName]['is_name'] = 1;
270
+ }
271
+ foreach ($entityData['attributes'] as $attributeData){
272
+ $attribute = Mage::getModel('modulecreator/attribute');
273
+ $attribute->addData($attributeData);
274
+ $entity->addAttribute($attribute);
275
+ }
276
+ }
277
+ $module->addEntity($entity);
278
+ $entitiesByIndex[$key] = $entity;
279
+ }
280
+ }
281
+ if (isset($data['relation'])){
282
+ foreach($data['relation'] as $index=>$values){
283
+ foreach ($values as $jndex=>$type){
284
+ if (isset($entitiesByIndex[$index]) && isset($entitiesByIndex[$jndex])){
285
+ $relation = Mage::getModel('modulecreator/relation');
286
+ $relation->setEntities($entitiesByIndex[$index], $entitiesByIndex[$jndex], $type);
287
+ $module->addRelation($relation);
288
+ }
289
+ }
290
+ }
291
+ }
292
+ }
293
+ return $module;
294
+ }
295
+ /**
296
+ * save module
297
+ * @access public
298
+ * @return void
299
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
300
+ */
301
+ public function saveAction(){
302
+ $redirectBack = $this->getRequest()->getParam('back', false);
303
+ try{
304
+ $module = $this->_initModuleFromData($this->getRequest()->getPost());
305
+ $messages = $module->buildModule();
306
+ $module->save();
307
+ foreach ($messages as $message){
308
+ $this->_getSession()->addNotice($message);
309
+ }
310
+ $this->_getSession()->addSuccess(Mage::helper('modulecreator')->__('Your extension has been created!'));
311
+ }
312
+ catch (Exception $e){
313
+ $this->_getSession()->addError($e->getMessage());
314
+ $redirectBack = true;
315
+ }
316
+ if ($redirectBack) {
317
+ $this->_redirect('*/*/edit', array(
318
+ 'id' => strtr(base64_encode($module->getNamespace().'_'.$module->getModuleName()), '+/=', '-_,'),
319
+ '_current' => true
320
+ ));
321
+ }
322
+ else {
323
+ $this->_redirect('*/*/');
324
+ }
325
+ }
326
+ /**
327
+ * action for menu order select
328
+ * @access public
329
+ * @return void
330
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
331
+ */
332
+ public function menuOrderAction(){
333
+ $menu = Mage::getSingleton('admin/config')->getAdminhtmlConfig()->getNode('menu');
334
+ $items = array();
335
+ foreach ($menu->children() as $key=>$values){
336
+ if (1 == $values->disabled) {
337
+ continue;
338
+ }
339
+ $item = array('label'=>(string)$values->title, 'sort_order'=>(int)$values->sort_order);
340
+ $items[(int)$values->sort_order][] = $item;
341
+ }
342
+ ksort($items);
343
+ $response = array();
344
+ foreach ($items as $order=>$orderedItems){
345
+ foreach ($orderedItems as $item){
346
+ $response[] = $item;
347
+ }
348
+ }
349
+ $this->getResponse()->setBody(json_encode($response));
350
+ }
351
+ /**
352
+ * download module action
353
+ * @access public
354
+ * @return void
355
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
356
+ */
357
+ public function downloadAction(){
358
+ $packageName = base64_decode(strtr($this->getRequest()->getParam('id'), '-_,', '+/='));
359
+ $path = Mage::helper('modulecreator')->getLocalModulesDir();
360
+ $file = $path . $packageName . '.tgz';
361
+ if (file_exists($file) && is_readable($file)) {
362
+ $content = file_get_contents($file);
363
+ $this->_prepareDownloadResponse(basename($file), $content);
364
+ }
365
+ else{
366
+ $this->_getSession()->addError(Mage::helper('modulecreator')->__('Your extension archive was not created or is not readable'));
367
+ $this->_redirect('*/*');
368
+ }
369
+ }
370
+ }
app/code/community/Ultimate/ModuleCreator/etc/adminhtml.xml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Ultimate_ModuleCreator extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE_UMC.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Ultimate
14
+ * @package Ultimate_ModuleCreator
15
+ * @copyright Copyright (c) 2012
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ /**
19
+ * @category Ultimate
20
+ * @package Ultimate_ModuleCreator
21
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
22
+ */
23
+ -->
24
+ <config>
25
+ <acl>
26
+ <resources>
27
+ <admin>
28
+ <children>
29
+ <system>
30
+ <children>
31
+ <config>
32
+ <children>
33
+ <modulecreator translate="title" module="modulecreator">
34
+ <title>Ultimate module creator</title>
35
+ </modulecreator>
36
+ </children>
37
+ </config>
38
+ <modulecreator translate="title" module="modulecreator">
39
+ <title>Module creator</title>
40
+ <sort_order>10</sort_order>
41
+ </modulecreator>
42
+ </children>
43
+ </system>
44
+ </children>
45
+ </admin>
46
+ </resources>
47
+ </acl>
48
+ <menu>
49
+ <system>
50
+ <children>
51
+ <modulecreator translate="title" module="modulecreator">
52
+ <title>Module creator</title>
53
+ <sort_order>10</sort_order>
54
+ <action>adminhtml/modulecreator</action>
55
+ <depends>
56
+ <module>Ultimate_ModuleCreator</module>
57
+ </depends>
58
+ </modulecreator>
59
+ </children>
60
+ </system>
61
+ </menu>
62
+ </config>
app/code/community/Ultimate/ModuleCreator/etc/config.xml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <!--
3
+ /**
4
+ * Ultimate_ModuleCreator extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE_UMC.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Ultimate
14
+ * @package Ultimate_ModuleCreator
15
+ * @copyright Copyright (c) 2012
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ /**
19
+ * @category Ultimate
20
+ * @package Ultimate_ModuleCreator
21
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <Ultimate_ModuleCreator>
27
+ <version>1.0.0</version>
28
+ </Ultimate_ModuleCreator>
29
+ </modules>
30
+ <global>
31
+ <blocks>
32
+ <modulecreator>
33
+ <class>Ultimate_ModuleCreator_Block</class>
34
+ </modulecreator>
35
+ </blocks>
36
+ <helpers>
37
+ <modulecreator>
38
+ <class>Ultimate_ModuleCreator_Helper</class>
39
+ </modulecreator>
40
+ </helpers>
41
+ <models>
42
+ <modulecreator>
43
+ <class>Ultimate_ModuleCreator_Model</class>
44
+ </modulecreator>
45
+ </models>
46
+ </global>
47
+ <adminhtml>
48
+ <translate>
49
+ <modules>
50
+ <Ultimate_ModuleCreator>
51
+ <files>
52
+ <default>Ultimate_ModuleCreator.csv</default>
53
+ </files>
54
+ </Ultimate_ModuleCreator>
55
+ </modules>
56
+ </translate>
57
+ <layout>
58
+ <updates>
59
+ <ultimate_modulecreator>
60
+ <file>ultimate_modulecreator.xml</file>
61
+ </ultimate_modulecreator>
62
+ </updates>
63
+ </layout>
64
+ </adminhtml>
65
+ <admin>
66
+ <routers>
67
+ <adminhtml>
68
+ <args>
69
+ <modules>
70
+ <Ultimate_ModuleCreator before="Mage_Adminhtml">Ultimate_ModuleCreator_Adminhtml</Ultimate_ModuleCreator>
71
+ </modules>
72
+ </args>
73
+ </adminhtml>
74
+ </routers>
75
+ </admin>
76
+ <default>
77
+ <modulecreator>
78
+ <settings>
79
+ <namespace>Ultimate</namespace>
80
+ <codepool>local</codepool>
81
+ <install>0</install>
82
+ <license><![CDATA[
83
+ {{Namespace}}_{{Module}} extension
84
+
85
+ NOTICE OF LICENSE
86
+
87
+ This source file is subject to the MIT License
88
+ that is bundled with this package in the file LICENSE_UMC.txt.
89
+ It is also available through the world-wide-web at this URL:
90
+ http://opensource.org/licenses/mit-license.php
91
+
92
+ @category {{Namespace}}
93
+ @package {{Namespace}}_{{Module}}
94
+ @copyright Copyright (c) {{Y}}
95
+ @license http://opensource.org/licenses/mit-license.php MIT License
96
+ ]]></license>
97
+
98
+ </settings>
99
+ <entity_defaults>
100
+ <use_frontend>1</use_frontend>
101
+ <frontend_list>1</frontend_list>
102
+ <frontend_view>1</frontend_view>
103
+ <frontend_list_template>page/2columns-left.phtml</frontend_list_template>
104
+ <frontend_view_template>page/2columns-left.phtml</frontend_view_template>
105
+ <frontend_add_seo>1</frontend_add_seo>
106
+ <created_to_grid>1</created_to_grid>
107
+ <updated_to_grid>1</updated_to_grid>
108
+ <add_status>1</add_status>
109
+ <rss>1</rss>
110
+ <widget>1</widget>
111
+ <link_product>1</link_product>
112
+ <show_on_product>1</show_on_product>
113
+ <show_products>1</show_products>
114
+ </entity_defaults>
115
+ <release>
116
+ <beta>0</beta>
117
+ </release>
118
+ </modulecreator>
119
+ </default>
120
+ </config>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator.xml ADDED
@@ -0,0 +1,1644 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Ultimate_ModuleCreator extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE_UMC.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Ultimate
14
+ * @package Ultimate_ModuleCreator
15
+ * @copyright Copyright (c) 2012
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ /**
19
+ * @category Ultimate
20
+ * @package Ultimate_ModuleCreator
21
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
22
+ */
23
+ -->
24
+ <config>
25
+ <files>
26
+ <file translate="title" module="modulecreator">
27
+ <title>Flat entity admin grid.</title>
28
+ <scope>entity</scope>
29
+ <filetype>php</filetype>
30
+ <depend>
31
+ <flat />
32
+ </depend>
33
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/</from>
34
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Grid.php</to>
35
+ <content>
36
+ <file>
37
+ <name>01_top.php</name>
38
+ </file>
39
+ <file>
40
+ <name>02_columns_top.php</name>
41
+ </file>
42
+ <file>
43
+ <name>03_parents.php</name>
44
+ <scope>parents</scope>
45
+ </file>
46
+ <file>
47
+ <name>04_grid_attributes.php</name>
48
+ <scope>attribute</scope>
49
+ <depend>
50
+ <admin_grid />
51
+ </depend>
52
+ </file>
53
+ <file>
54
+ <name>05_grid_status.php</name>
55
+ <depend>
56
+ <add_status />
57
+ </depend>
58
+ </file>
59
+ <file>
60
+ <name>06_created_at.php</name>
61
+ <depend>
62
+ <created_to_grid />
63
+ </depend>
64
+ </file>
65
+ <file>
66
+ <name>07_updated_at.php</name>
67
+ <depend>
68
+ <updated_to_grid />
69
+ </depend>
70
+ </file>
71
+ <file>
72
+ <name>08_grid_actions.php</name>
73
+ </file>
74
+ <file>
75
+ <name>09_grid_export.php</name>
76
+ </file>
77
+ <file>
78
+ <name>10_columns_footer.php</name>
79
+ </file>
80
+ <file>
81
+ <name>11_mass_action_top.php</name>
82
+ </file>
83
+ <file>
84
+ <name>12_mass_action_status.php</name>
85
+ <depend>
86
+ <add_status />
87
+ </depend>
88
+ </file>
89
+ <file>
90
+ <name>13_mass_action_flags.php</name>
91
+ <scope>attribute</scope>
92
+ <depend_type>
93
+ <yesno />
94
+ </depend_type>
95
+ </file>
96
+ <file>
97
+ <name>14_mass_action_parents.php</name>
98
+ <scope>parents</scope>
99
+ </file>
100
+ <file>
101
+ <name>15_footer.php</name>
102
+ </file>
103
+ </content>
104
+ </file>
105
+ <file translate="title" module="modulecreator">
106
+ <title>Flat entity admin edit form.</title>
107
+ <scope>entity</scope>
108
+ <filetype>php</filetype>
109
+ <depend>
110
+ <flat />
111
+ </depend>
112
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/</from>
113
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit.php</to>
114
+ <content>
115
+ <file>
116
+ <name>01_content.php</name>
117
+ </file>
118
+ </content>
119
+ </file>
120
+ <file translate="title" module="modulecreator">
121
+ <title>Flat entity admin block.</title>
122
+ <scope>entity</scope>
123
+ <filetype>php</filetype>
124
+ <depend>
125
+ <flat />
126
+ </depend>
127
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/</from>
128
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}.php</to>
129
+ <content>
130
+ <file>
131
+ <name>01_content.php</name>
132
+ </file>
133
+ </content>
134
+ </file>
135
+ <file translate="title" module="modulecreator">
136
+ <title>Flat entity admin edit tabs.</title>
137
+ <scope>entity</scope>
138
+ <filetype>php</filetype>
139
+ <depend>
140
+ <flat />
141
+ </depend>
142
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/</from>
143
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tabs.php</to>
144
+ <content>
145
+ <file>
146
+ <name>01_top.php</name>
147
+ </file>
148
+ <file>
149
+ <name>02_relations_tabs.php</name>
150
+ <scope>siblings</scope>
151
+ </file>
152
+ <file>
153
+ <name>03_product_relation.php</name>
154
+ <depend>
155
+ <link_product />
156
+ </depend>
157
+ </file>
158
+ <file>
159
+ <name>04_footer.php</name>
160
+ </file>
161
+ </content>
162
+ </file>
163
+ <file translate="title" module="modulecreator">
164
+ <title>Flat entity admin edit form.</title>
165
+ <scope>entity</scope>
166
+ <filetype>php</filetype>
167
+ <depend>
168
+ <flat />
169
+ </depend>
170
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Form/</from>
171
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Form.php</to>
172
+ <content>
173
+ <file>
174
+ <name>01_content.php</name>
175
+ </file>
176
+ </content>
177
+ </file>
178
+ <file translate="title" module="modulecreator">
179
+ <title>Flat entity model</title>
180
+ <scope>entity</scope>
181
+ <filetype>php</filetype>
182
+ <depend>
183
+ <flat />
184
+ </depend>
185
+ <from>app/code/codepool/Namespace/Module/Model/Entity/</from>
186
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}.php</to>
187
+ <content>
188
+ <file>
189
+ <name>01_top.php</name>
190
+ </file>
191
+ <file>
192
+ <name>02_var_sibling.php</name>
193
+ <scope>siblings</scope>
194
+ </file>
195
+ <file>
196
+ <name>03_var_product_relation.php</name>
197
+ <depend>
198
+ <link_product />
199
+ </depend>
200
+ </file>
201
+ <file>
202
+ <name>04_construct.php</name>
203
+ </file>
204
+ <file>
205
+ <name>05_url.php</name>
206
+ <depend>
207
+ <use_frontend />
208
+ </depend>
209
+ </file>
210
+ <file>
211
+ <name>06_editors.php</name>
212
+ <scope>attribute</scope>
213
+ <depend>
214
+ <editor />
215
+ </depend>
216
+ </file>
217
+ <file>
218
+ <name>07_after_save_top.php</name>
219
+ </file>
220
+ <file>
221
+ <name>08_after_save_product.php</name>
222
+ <depend>
223
+ <link_product />
224
+ </depend>
225
+ </file>
226
+ <file>
227
+ <name>09_after_save_sibling.php</name>
228
+ <scope>siblings</scope>
229
+ </file>
230
+ <file>
231
+ <name>10_after_save_footer.php</name>
232
+ </file>
233
+ <file>
234
+ <name>11_product_relation.php</name>
235
+ <depend>
236
+ <link_product />
237
+ </depend>
238
+ </file>
239
+ <file>
240
+ <name>12_sibling_relation.php</name>
241
+ <scope>siblings</scope>
242
+ </file>
243
+ <file>
244
+ <name>13_footer.php</name>
245
+ </file>
246
+ </content>
247
+ </file>
248
+ <file translate="title" module="modulecreator">
249
+ <title>Flat entity resource model.</title>
250
+ <scope>entity</scope>
251
+ <filetype>php</filetype>
252
+ <depend>
253
+ <flat />
254
+ </depend>
255
+ <from>app/code/codepool/Namespace/Module/Model/Resource/Entity/</from>
256
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}.php</to>
257
+ <content>
258
+ <file>
259
+ <name>01_content.php</name>
260
+ </file>
261
+ </content>
262
+ </file>
263
+ <file translate="title" module="modulecreator">
264
+ <title>Flat entity resource model.</title>
265
+ <scope>entity</scope>
266
+ <filetype>php</filetype>
267
+ <depend>
268
+ <flat />
269
+ </depend>
270
+ <from>app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/</from>
271
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Collection.php</to>
272
+ <content>
273
+ <file>
274
+ <name>01_top.php</name>
275
+ </file>
276
+ <file>
277
+ <name>02_product_relation.php</name>
278
+ <depend>
279
+ <link_product />
280
+ </depend>
281
+ </file>
282
+ <file>
283
+ <name>03_sibling_relation.php</name>
284
+ <scope>siblings</scope>
285
+ </file>
286
+ <file>
287
+ <name>04_footer.php</name>
288
+ </file>
289
+ </content>
290
+ </file>
291
+ <file translate="title" module="modulecreator">
292
+ <title>Flat entity helper.</title>
293
+ <scope>entity</scope>
294
+ <filetype>php</filetype>
295
+ <depend>
296
+ <flat />
297
+ </depend>
298
+ <from>app/code/codepool/Namespace/Module/Helper/Entity/</from>
299
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/{{Entity}}.php</to>
300
+ <content>
301
+ <file>
302
+ <name>01_top.php</name>
303
+ </file>
304
+ <file>
305
+ <name>02_rss.php</name>
306
+ <depend>
307
+ <rss />
308
+ </depend>
309
+ </file>
310
+ <file>
311
+ <name>03_file.php</name>
312
+ <depend>
313
+ <has_file />
314
+ </depend>
315
+ </file>
316
+ <file>
317
+ <name>04_footer.php</name>
318
+ </file>
319
+ </content>
320
+ </file>
321
+ <file translate="title" module="modulecreator">
322
+ <title>Flat entity image helper.</title>
323
+ <scope>entity</scope>
324
+ <filetype>php</filetype>
325
+ <depend>
326
+ <flat />
327
+ <has_image />
328
+ </depend>
329
+ <from>app/code/codepool/Namespace/Module/Helper/Entity/Image/</from>
330
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/{{Entity}}/Image.php</to>
331
+ <content>
332
+ <file>
333
+ <name>01_content.php</name>
334
+ </file>
335
+ </content>
336
+ </file>
337
+ <file translate="title" module="modulecreator">
338
+ <title>Flat entity frontend view block.</title>
339
+ <scope>entity</scope>
340
+ <filetype>php</filetype>
341
+ <depend>
342
+ <flat />
343
+ <use_frontend />
344
+ </depend>
345
+ <from>app/code/codepool/Namespace/Module/Block/Entity/View/</from>
346
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/View.php</to>
347
+ <content>
348
+ <file>
349
+ <name>01_content.php</name>
350
+ </file>
351
+ </content>
352
+ </file>
353
+ <file translate="title" module="modulecreator">
354
+ <title>Flat entity frontend list block.</title>
355
+ <scope>entity</scope>
356
+ <filetype>php</filetype>
357
+ <depend>
358
+ <flat />
359
+ <can_create_list_block />
360
+ </depend>
361
+ <from>app/code/codepool/Namespace/Module/Block/Entity/List/</from>
362
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/List.php</to>
363
+ <content>
364
+ <file>
365
+ <name>01_top.php</name>
366
+ </file>
367
+ <file>
368
+ <name>02_status.php</name>
369
+ <depend>
370
+ <add_status />
371
+ </depend>
372
+ </file>
373
+ <file>
374
+ <name>03_footer.php</name>
375
+ </file>
376
+ </content>
377
+ </file>
378
+ <file translate="title" module="modulecreator">
379
+ <title>Flat entity RSS block.</title>
380
+ <scope>entity</scope>
381
+ <filetype>php</filetype>
382
+ <depend>
383
+ <flat />
384
+ <rss />
385
+ </depend>
386
+ <from>app/code/codepool/Namespace/Module/Block/Entity/Rss/</from>
387
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Rss.php</to>
388
+ <content>
389
+ <file>
390
+ <name>01_top.php</name>
391
+ </file>
392
+ <file>
393
+ <name>02_status.php</name>
394
+ <depend>
395
+ <add_status />
396
+ </depend>
397
+ </file>
398
+ <file>
399
+ <name>03_content_top.php</name>
400
+ </file>
401
+ <file>
402
+ <name>04_content.php</name>
403
+ <scope>attribute</scope>
404
+ <depend>
405
+ <rss />
406
+ </depend>
407
+ </file>
408
+ <file>
409
+ <name>05_footer.php</name>
410
+ </file>
411
+ </content>
412
+ </file>
413
+ <file translate="title" module="modulecreator">
414
+ <title>Flat entity view widget.</title>
415
+ <scope>entity</scope>
416
+ <filetype>php</filetype>
417
+ <depend>
418
+ <flat />
419
+ <use_frontend />
420
+ <widget />
421
+ </depend>
422
+ <from>app/code/codepool/Namespace/Module/Block/Entity/Widget/View/</from>
423
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Widget/View.php</to>
424
+ <content>
425
+ <file>
426
+ <name>01_top.php</name>
427
+ </file>
428
+ <file>
429
+ <name>02_status.php</name>
430
+ <depend>
431
+ <add_status />
432
+ </depend>
433
+ </file>
434
+ <file>
435
+ <name>03_template.php</name>
436
+ </file>
437
+ <file>
438
+ <name>04_status.php</name>
439
+ <depend>
440
+ <add_status />
441
+ </depend>
442
+ </file>
443
+ <file>
444
+ <name>05_footer.php</name>
445
+ </file>
446
+ </content>
447
+ </file>
448
+ <file translate="title" module="modulecreator">
449
+ <title>Flat entity link widget.</title>
450
+ <scope>entity</scope>
451
+ <filetype>php</filetype>
452
+ <depend>
453
+ <flat />
454
+ <use_frontend />
455
+ <widget />
456
+ </depend>
457
+ <from>app/code/codepool/Namespace/Module/Block/Entity/Widget/Link/</from>
458
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Widget/Link.php</to>
459
+ <content>
460
+ <file>
461
+ <name>01_content.php</name>
462
+ </file>
463
+ </content>
464
+ </file>
465
+ <file translate="title" module="modulecreator">
466
+ <title>Flat entity amdin controller.</title>
467
+ <scope>entity</scope>
468
+ <filetype>php</filetype>
469
+ <depend>
470
+ <flat />
471
+ </depend>
472
+ <from>app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/</from>
473
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{Entity}}Controller.php</to>
474
+ <content>
475
+ <file>
476
+ <name>01_top.php</name>
477
+ </file>
478
+ <file>
479
+ <name>02_upload_image.php</name>
480
+ <scope>attribute</scope>
481
+ <depend_type>
482
+ <image />
483
+ </depend_type>
484
+ </file>
485
+ <file>
486
+ <name>03_upload_files.php</name>
487
+ <scope>attribute</scope>
488
+ <depend_type>
489
+ <file />
490
+ </depend_type>
491
+ </file>
492
+ <file>
493
+ <name>04_save_product_relation.php</name>
494
+ <depend>
495
+ <link_product />
496
+ </depend>
497
+ </file>
498
+ <file>
499
+ <name>05_save_sibling_relation.php</name>
500
+ <scope>siblings</scope>
501
+ </file>
502
+ <file>
503
+ <name>06_save.php</name>
504
+ </file>
505
+ <file>
506
+ <name>07_exception_upload.php</name>
507
+ <scope>attribute</scope>
508
+ <depend_type>
509
+ <image />
510
+ </depend_type>
511
+ </file>
512
+ <file>
513
+ <name>07_exception_upload.php</name>
514
+ <scope>attribute</scope>
515
+ <depend_type>
516
+ <file />
517
+ </depend_type>
518
+ </file>
519
+ <file>
520
+ <name>08_exception.php</name>
521
+ </file>
522
+ <file>
523
+ <name>07_exception_upload.php</name>
524
+ <scope>attribute</scope>
525
+ <depend_type>
526
+ <image />
527
+ </depend_type>
528
+ </file>
529
+ <file>
530
+ <name>07_exception_upload.php</name>
531
+ <scope>attribute</scope>
532
+ <depend_type>
533
+ <file />
534
+ </depend_type>
535
+ </file>
536
+ <file>
537
+ <name>09_center.php</name>
538
+ </file>
539
+ <file>
540
+ <name>10_mass_status.php</name>
541
+ <depend>
542
+ <add_status />
543
+ </depend>
544
+ </file>
545
+ <file>
546
+ <name>11_mass_update.php</name>
547
+ <scope>attribute</scope>
548
+ <depend_type>
549
+ <yesno />
550
+ </depend_type>
551
+ </file>
552
+ <file>
553
+ <name>12_mass_parents.php</name>
554
+ <scope>parents</scope>
555
+ </file>
556
+ <file>
557
+ <name>13_product_relation_actions.php</name>
558
+ <depend>
559
+ <link_product />
560
+ </depend>
561
+ </file>
562
+ <file>
563
+ <name>14_sibling_actions.php</name>
564
+ <scope>siblings</scope>
565
+ </file>
566
+ <file>
567
+ <name>15_footer.php</name>
568
+ </file>
569
+ </content>
570
+ </file>
571
+ <file translate="title" module="modulecreator">
572
+ <title>Flat entity admin widget controller.</title>
573
+ <scope>entity</scope>
574
+ <filetype>php</filetype>
575
+ <depend>
576
+ <flat />
577
+ <widget />
578
+ </depend>
579
+ <from>app/code/codepool/Namespace/Module/controllers/Adminhtml/Entity/WidgetController/</from>
580
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{Entity}}/WidgetController.php</to>
581
+ <content>
582
+ <file>
583
+ <name>01_content.php</name>
584
+ </file>
585
+ </content>
586
+ </file>
587
+ <file translate="title" module="modulecreator">
588
+ <title>Flat entity front controller.</title>
589
+ <scope>entity</scope>
590
+ <filetype>php</filetype>
591
+ <depend>
592
+ <flat />
593
+ <use_frontend />
594
+ </depend>
595
+ <from>app/code/codepool/Namespace/Module/controllers/EntityController/</from>
596
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/{{Entity}}Controller.php</to>
597
+ <content>
598
+ <file>
599
+ <name>01_top.php</name>
600
+ </file>
601
+ <file>
602
+ <name>02_list.php</name>
603
+ <depend>
604
+ <frontend_list />
605
+ </depend>
606
+ </file>
607
+ <file>
608
+ <name>03_list_seo.php</name>
609
+ <depend>
610
+ <frontend_list />
611
+ <frontend_add_seo />
612
+ </depend>
613
+ </file>
614
+ <file>
615
+ <name>04_list_footer.php</name>
616
+ <depend>
617
+ <frontend_list />
618
+ </depend>
619
+ </file>
620
+ <file>
621
+ <name>05_view.php</name>
622
+ <depend>
623
+ <frontend_view />
624
+ </depend>
625
+ </file>
626
+ <file>
627
+ <name>06_view_status.php</name>
628
+ <depend>
629
+ <frontend_view />
630
+ <add_status />
631
+ </depend>
632
+ </file>
633
+ <file>
634
+ <name>07_view2.php</name>
635
+ <depend>
636
+ <frontend_view />
637
+ </depend>
638
+ </file>
639
+ <file>
640
+ <name>08_breadcrumbs.php</name>
641
+ <depend>
642
+ <frontend_view />
643
+ <frontend_list />
644
+ </depend>
645
+ </file>
646
+ <file>
647
+ <name>09_breadcrumbs_footer.php</name>
648
+ <depend>
649
+ <frontend_view />
650
+ </depend>
651
+ </file>
652
+ <file>
653
+ <name>10_view_seo.php</name>
654
+ <depend>
655
+ <frontend_view />
656
+ <frontend_add_seo />
657
+ </depend>
658
+ </file>
659
+ <file>
660
+ <name>11_view_footer.php</name>
661
+ <depend>
662
+ <frontend_view />
663
+ </depend>
664
+ </file>
665
+ <file>
666
+ <name>12_rss.php</name>
667
+ <depend>
668
+ <rss />
669
+ </depend>
670
+ </file>
671
+ <file>
672
+ <name>13_footer.php</name>
673
+ </file>
674
+ </content>
675
+ </file>
676
+ <file translate="title" module="modulecreator">
677
+ <title>Flat entity admin file renderer.</title>
678
+ <scope>entity</scope>
679
+ <filetype>php</filetype>
680
+ <depend>
681
+ <flat />
682
+ <has_file />
683
+ </depend>
684
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Helper/File/</from>
685
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Helper/File.php</to>
686
+ <content>
687
+ <file>
688
+ <name>01_content.php</name>
689
+ </file>
690
+ </content>
691
+ </file>
692
+ <file translate="title" module="modulecreator">
693
+ <title>Flat entity admin image renderer.</title>
694
+ <scope>entity</scope>
695
+ <filetype>php</filetype>
696
+ <depend>
697
+ <flat />
698
+ <has_image />
699
+ </depend>
700
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Helper/Image/</from>
701
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Helper/Image.php</to>
702
+ <content>
703
+ <file>
704
+ <name>01_content.php</name>
705
+ </file>
706
+ </content>
707
+ </file>
708
+ <file translate="title" module="modulecreator">
709
+ <title>Flat entity admin widget chooser.</title>
710
+ <scope>entity</scope>
711
+ <filetype>php</filetype>
712
+ <depend>
713
+ <flat />
714
+ <widget />
715
+ </depend>
716
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/</from>
717
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Widget/Chooser.php</to>
718
+ <content>
719
+ <file>
720
+ <name>01_top.php</name>
721
+ </file>
722
+ <file>
723
+ <name>02_top_status.php</name>
724
+ <depend>
725
+ <add_status />
726
+ </depend>
727
+ </file>
728
+ <file>
729
+ <name>03_content.php</name>
730
+ </file>
731
+ <file>
732
+ <name>04_status.php</name>
733
+ <depend>
734
+ <add_status />
735
+ </depend>
736
+ </file>
737
+ <file>
738
+ <name>05_footer.php</name>
739
+ </file>
740
+ </content>
741
+ </file>
742
+ <file translate="title" module="modulecreator">
743
+ <title>Flat entity admin form tab.</title>
744
+ <scope>entity</scope>
745
+ <filetype>php</filetype>
746
+ <depend>
747
+ <flat />
748
+ </depend>
749
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/</from>
750
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/Form.php</to>
751
+ <content>
752
+ <file>
753
+ <name>01_top.php</name>
754
+ </file>
755
+ <file>
756
+ <name>02_image.php</name>
757
+ <depend>
758
+ <has_image />
759
+ </depend>
760
+ </file>
761
+ <file>
762
+ <name>03_file.php</name>
763
+ <depend>
764
+ <has_file />
765
+ </depend>
766
+ </file>
767
+ <file>
768
+ <name>04_wysiwyg.php</name>
769
+ </file>
770
+ <file>
771
+ <name>05_parents.php</name>
772
+ <scope>parents</scope>
773
+ </file>
774
+ <file>
775
+ <name>06_attributes.php</name>
776
+ <scope>attribute</scope>
777
+ </file>
778
+ <file>
779
+ <name>07_status.php</name>
780
+ <depend>
781
+ <add_status />
782
+ </depend>
783
+ </file>
784
+ <file>
785
+ <name>08_rss.php</name>
786
+ <depend>
787
+ <rss />
788
+ </depend>
789
+ </file>
790
+ <file>
791
+ <name>09_seo.php</name>
792
+ <depend>
793
+ <frontend_add_seo />
794
+ </depend>
795
+ </file>
796
+ <file>
797
+ <name>10_footer.php</name>
798
+ </file>
799
+ </content>
800
+ </file>
801
+ <file translate="title" module="modulecreator">
802
+ <title>Module RSS block.</title>
803
+ <scope>global</scope>
804
+ <filetype>php</filetype>
805
+ <depend>
806
+ <rss />
807
+ </depend>
808
+ <from>app/code/codepool/Namespace/Module/Block/Rss/</from>
809
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Rss.php</to>
810
+ <content>
811
+ <file>
812
+ <name>01_content.php</name>
813
+ </file>
814
+ </content>
815
+ </file>
816
+ <file translate="title" module="modulecreator">
817
+ <title>Module base admin controller.</title>
818
+ <scope>global</scope>
819
+ <filetype>php</filetype>
820
+ <from>app/code/codepool/Namespace/Module/Controller/Adminhtml/Module/</from>
821
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Controller/Adminhtml/{{Module}}.php</to>
822
+ <content>
823
+ <file>
824
+ <name>01_content.php</name>
825
+ </file>
826
+ </content>
827
+ </file>
828
+ <file translate="title" module="modulecreator">
829
+ <title>Module default helper.</title>
830
+ <scope>global</scope>
831
+ <filetype>php</filetype>
832
+ <from>app/code/codepool/Namespace/Module/Helper/Data/</from>
833
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/Data.php</to>
834
+ <content>
835
+ <file>
836
+ <name>01_top.php</name>
837
+ </file>
838
+ <file>
839
+ <name>02_entity.php</name>
840
+ <scope>entity</scope>
841
+ <depend>
842
+ <frontend_list />
843
+ </depend>
844
+ </file>
845
+ <file>
846
+ <name>03_footer.php</name>
847
+ </file>
848
+ </content>
849
+ </file>
850
+ <file translate="title" module="modulecreator">
851
+ <title>Module setup model.</title>
852
+ <scope>global</scope>
853
+ <filetype>php</filetype>
854
+ <from>app/code/codepool/Namespace/Module/Model/Resource/Setup/</from>
855
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/Setup.php</to>
856
+ <content>
857
+ <file>
858
+ <name>01_content.php</name>
859
+ </file>
860
+ </content>
861
+ </file>
862
+ <file translate="title" module="modulecreator">
863
+ <title>Install script</title>
864
+ <scope>global</scope>
865
+ <filetype>php</filetype>
866
+ <from>app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/</from>
867
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/sql/{{namespace}}_{{module}}_setup/mysql4-install-0.0.1.php</to>
868
+ <content>
869
+ <file>
870
+ <name>01_top.php</name>
871
+ </file>
872
+ <file>
873
+ <name>02_entity.php</name>
874
+ <scope>entity</scope>
875
+ </file>
876
+ <file>
877
+ <name>03_product_relation.php</name>
878
+ <scope>entity</scope>
879
+ <depend>
880
+ <link_product />
881
+ </depend>
882
+ </file>
883
+ <file>
884
+ <name>04_sibling_relation.php</name>
885
+ <scope>siblings</scope>
886
+ </file>
887
+ <file>
888
+ <name>05_footer.php</name>
889
+ </file>
890
+ </content>
891
+ </file>
892
+ <file translate="title" module="modulecreator">
893
+ <title>Widget xml</title>
894
+ <scope>global</scope>
895
+ <filetype>xml</filetype>
896
+ <from>app/code/codepool/Namespace/Module/etc/widget/</from>
897
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/widget.xml</to>
898
+ <depend>
899
+ <widget />
900
+ </depend>
901
+ <content>
902
+ <file>
903
+ <name>01_top.xml</name>
904
+ </file>
905
+ <file>
906
+ <name>02_entity.xml</name>
907
+ <scope>entity</scope>
908
+ <depend>
909
+ <widget />
910
+ </depend>
911
+ </file>
912
+ <file>
913
+ <name>03_footer.xml</name>
914
+ </file>
915
+ </content>
916
+ </file>
917
+ <file translate="title" module="modulecreator">
918
+ <title>Adminhtml xml</title>
919
+ <scope>global</scope>
920
+ <filetype>xml</filetype>
921
+ <from>app/code/codepool/Namespace/Module/etc/adminhtml/</from>
922
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/adminhtml.xml</to>
923
+ <content>
924
+ <file>
925
+ <name>01_top.xml</name>
926
+ </file>
927
+ <file>
928
+ <name>02_entity_acl.xml</name>
929
+ <scope>entity</scope>
930
+ </file>
931
+ <file>
932
+ <name>03_center.xml</name>
933
+ </file>
934
+ <file>
935
+ <name>04_entity_menu.xml</name>
936
+ <scope>entity</scope>
937
+ </file>
938
+ <file>
939
+ <name>05_footer.xml</name>
940
+ </file>
941
+ </content>
942
+ </file>
943
+ <file translate="title" module="modulecreator">
944
+ <title>Config xml</title>
945
+ <scope>global</scope>
946
+ <filetype>xml</filetype>
947
+ <from>app/code/codepool/Namespace/Module/etc/config/</from>
948
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/config.xml</to>
949
+ <content>
950
+ <file>
951
+ <name>01_top.xml</name>
952
+ </file>
953
+ <file>
954
+ <name>02_tables.xml</name>
955
+ <scope>entity</scope>
956
+ </file>
957
+ <file>
958
+ <name>03_siblings_table.xml</name>
959
+ <scope>siblings</scope>
960
+ </file>
961
+ <file>
962
+ <name>04_relation_table.xml</name>
963
+ <scope>entity</scope>
964
+ <depend>
965
+ <link_product />
966
+ </depend>
967
+ </file>
968
+ <file>
969
+ <name>05_global.xml</name>
970
+ </file>
971
+ <file>
972
+ <name>06_relation_product.xml</name>
973
+ <scope>entity</scope>
974
+ <depend>
975
+ <link_product />
976
+ </depend>
977
+ </file>
978
+ <file>
979
+ <name>07_admin.xml</name>
980
+ </file>
981
+ <file>
982
+ <name>08_frontend.xml</name>
983
+ <depend>
984
+ <use_frontend />
985
+ </depend>
986
+ </file>
987
+ <file>
988
+ <name>09_default_top.xml</name>
989
+ </file>
990
+ <file>
991
+ <name>10_default.xml</name>
992
+ <scope>entity</scope>
993
+ <depend>
994
+ <use_frontend />
995
+ </depend>
996
+ </file>
997
+ <file>
998
+ <name>11_default_footer.xml</name>
999
+ </file>
1000
+ </content>
1001
+ </file>
1002
+ <file translate="title" module="modulecreator">
1003
+ <title>System xml</title>
1004
+ <scope>global</scope>
1005
+ <filetype>xml</filetype>
1006
+ <depend>
1007
+ <use_frontend />
1008
+ </depend>
1009
+ <from>app/code/codepool/Namespace/Module/etc/system/</from>
1010
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/system.xml</to>
1011
+ <content>
1012
+ <file>
1013
+ <name>01_top.xml</name>
1014
+ </file>
1015
+ <file>
1016
+ <name>02_entity.xml</name>
1017
+ <scope>entity</scope>
1018
+ </file>
1019
+ <file>
1020
+ <name>03_footer.xml</name>
1021
+ </file>
1022
+ </content>
1023
+ </file>
1024
+ <file translate="title" module="modulecreator">
1025
+ <title>Admin layout file</title>
1026
+ <scope>global</scope>
1027
+ <filetype>xml</filetype>
1028
+ <from>app/design/adminhtml/default/default/layout/namespace_module/</from>
1029
+ <to>app/design/adminhtml/default/default/layout/{{namespace}}_{{module}}.xml</to>
1030
+ <content>
1031
+ <file>
1032
+ <name>01_top.xml</name>
1033
+ </file>
1034
+ <file>
1035
+ <name>02_entity.xml</name>
1036
+ <scope>entity</scope>
1037
+ </file>
1038
+ <file>
1039
+ <name>03_relation_product.xml</name>
1040
+ <scope>entity</scope>
1041
+ <depend>
1042
+ <link_product />
1043
+ </depend>
1044
+ </file>
1045
+ <file>
1046
+ <name>04_relation_sibling.xml</name>
1047
+ <scope>siblings-both</scope>
1048
+ </file>
1049
+ <file>
1050
+ <name>05_footer.xml</name>
1051
+ </file>
1052
+ </content>
1053
+ </file>
1054
+ <file translate="title" module="modulecreator">
1055
+ <title>Frontend layout file</title>
1056
+ <scope>global</scope>
1057
+ <filetype>xml</filetype>
1058
+ <from>app/design/frontend/base/default/layout/namespace_module/</from>
1059
+ <to>app/design/frontend/{{package}}/{{theme_layout}}/layout/{{namespace}}_{{module}}.xml</to>
1060
+ <content>
1061
+ <file>
1062
+ <name>01_top.xml</name>
1063
+ </file>
1064
+ <file>
1065
+ <name>02_default_top.xml</name>
1066
+ <depend>
1067
+ <frontend_list />
1068
+ </depend>
1069
+ </file>
1070
+ <file>
1071
+ <name>03_default.xml</name>
1072
+ <scope>entity</scope>
1073
+ <depend>
1074
+ <frontend_list />
1075
+ </depend>
1076
+ </file>
1077
+ <file>
1078
+ <name>04_default_footer.xml</name>
1079
+ <depend>
1080
+ <frontend_list />
1081
+ </depend>
1082
+ </file>
1083
+ <file>
1084
+ <name>05_list.xml</name>
1085
+ <scope>entity</scope>
1086
+ <depend>
1087
+ <frontend_list />
1088
+ </depend>
1089
+ </file>
1090
+ <file>
1091
+ <name>06_view.xml</name>
1092
+ <scope>entity</scope>
1093
+ <depend>
1094
+ <frontend_view />
1095
+ </depend>
1096
+ </file>
1097
+ <file>
1098
+ <name>07_entity_rss.xml</name>
1099
+ <scope>entity</scope>
1100
+ <depend>
1101
+ <rss />
1102
+ </depend>
1103
+ </file>
1104
+ <file>
1105
+ <name>08_rss_top.xml</name>
1106
+ <depend>
1107
+ <rss />
1108
+ </depend>
1109
+ </file>
1110
+ <file>
1111
+ <name>09_rss.xml</name>
1112
+ <scope>entity</scope>
1113
+ <depend>
1114
+ <rss />
1115
+ </depend>
1116
+ </file>
1117
+ <file>
1118
+ <name>10_rss_footer.xml</name>
1119
+ <depend>
1120
+ <rss />
1121
+ </depend>
1122
+ </file>
1123
+ <file>
1124
+ <name>11_relation_product.xml</name>
1125
+ <scope>entity</scope>
1126
+ <depend>
1127
+ <show_on_product />
1128
+ </depend>
1129
+ </file>
1130
+ <file>
1131
+ <name>12_footer.xml</name>
1132
+ </file>
1133
+ </content>
1134
+ </file>
1135
+ <file translate="title" module="modulecreator">
1136
+ <title>Frontend rss list</title>
1137
+ <scope>global</scope>
1138
+ <filetype>php</filetype>
1139
+ <depend>
1140
+ <rss />
1141
+ </depend>
1142
+ <from>app/design/frontend/base/default/template/namespace_module/rss/</from>
1143
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/rss.phtml</to>
1144
+ <content>
1145
+ <file>
1146
+ <name>01_content.phtml</name>
1147
+ </file>
1148
+ </content>
1149
+ </file>
1150
+ <file translate="title" module="modulecreator">
1151
+ <title>Frontend list template</title>
1152
+ <scope>entity</scope>
1153
+ <filetype>php</filetype>
1154
+ <depend>
1155
+ <frontend_list />
1156
+ </depend>
1157
+ <from>app/design/frontend/base/default/template/namespace_module/entity/list/</from>
1158
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/{{entity}}/list.phtml</to>
1159
+ <content>
1160
+ <file>
1161
+ <name>01_top.phtml</name>
1162
+ </file>
1163
+ <file>
1164
+ <name>02_rss_link.phtml</name>
1165
+ <depend>
1166
+ <rss />
1167
+ </depend>
1168
+ </file>
1169
+ <file>
1170
+ <name>03_footer.phtml</name>
1171
+ </file>
1172
+ </content>
1173
+ </file>
1174
+ <file translate="title" module="modulecreator">
1175
+ <title>Frontend view template</title>
1176
+ <scope>entity</scope>
1177
+ <filetype>php</filetype>
1178
+ <depend>
1179
+ <frontend_view />
1180
+ </depend>
1181
+ <from>app/design/frontend/base/default/template/namespace_module/entity/view/</from>
1182
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/{{entity}}/view.phtml</to>
1183
+ <content>
1184
+ <file>
1185
+ <name>01_content.phtml</name>
1186
+ </file>
1187
+ </content>
1188
+ </file>
1189
+ <file translate="title" module="modulecreator">
1190
+ <title>Module declaration xml</title>
1191
+ <scope>global</scope>
1192
+ <filetype>xml</filetype>
1193
+ <from>app/etc/modules/Namespace_Module/</from>
1194
+ <to>app/etc/modules/{{Namespace}}_{{Module}}.xml</to>
1195
+ <content>
1196
+ <file>
1197
+ <name>01_content.xml</name>
1198
+ </file>
1199
+ </content>
1200
+ </file>
1201
+ <file translate="title" module="modulecreator">
1202
+ <title>Module translation file</title>
1203
+ <scope>global</scope>
1204
+ <filetype>csv</filetype>
1205
+ <from>app/locale/en_US/Namespace_Module/</from>
1206
+ <to>app/locale/en_US/{{Namespace}}_{{Module}}.csv</to>
1207
+ <after_build>_sortTranslationFile</after_build>
1208
+ <content>
1209
+ <file>
1210
+ <name>01_global.csv</name>
1211
+ </file>
1212
+ <file>
1213
+ <name>02_entity.csv</name>
1214
+ <scope>entity</scope>
1215
+ </file>
1216
+ <file>
1217
+ <name>03_attribute.csv</name>
1218
+ <scope>attribute</scope>
1219
+ </file>
1220
+ <file>
1221
+ <name>04_global_status.csv</name>
1222
+ <depend>
1223
+ <add_status />
1224
+ </depend>
1225
+ </file>
1226
+ <file>
1227
+ <name>05_global_rss.csv</name>
1228
+ <depend>
1229
+ <rss />
1230
+ </depend>
1231
+ </file>
1232
+ <file>
1233
+ <name>06_global_seo.csv</name>
1234
+ <depend>
1235
+ <frontend_add_seo />
1236
+ </depend>
1237
+ </file>
1238
+ <file>
1239
+ <name>07_attribute_yesno.csv</name>
1240
+ <scope>attribute</scope>
1241
+ <depend_type>
1242
+ <yesno />
1243
+ </depend_type>
1244
+ </file>
1245
+ <file>
1246
+ <name>08_global_file.csv</name>
1247
+ <depend>
1248
+ <has_file />
1249
+ </depend>
1250
+ </file>
1251
+ <file>
1252
+ <name>09_product_relation.csv</name>
1253
+ <depend>
1254
+ <link_product />
1255
+ </depend>
1256
+ </file>
1257
+ <file>
1258
+ <name>10_relations.csv</name>
1259
+ <scope>children</scope>
1260
+ </file>
1261
+ </content>
1262
+ </file>
1263
+ <file translate="title" module="modulecreator">
1264
+ <title>Default image</title>
1265
+ <scope>entity</scope>
1266
+ <filetype>jpg</filetype>
1267
+ <depend>
1268
+ <has_image />
1269
+ </depend>
1270
+ <from>skin/frontend/base/default/images/placeholder/</from>
1271
+ <to>skin/frontend/base/default/images/placeholder/{{entity}}.jpg</to>
1272
+ <content>
1273
+ <file>
1274
+ <name>entity.jpg</name>
1275
+ </file>
1276
+ </content>
1277
+ </file>
1278
+ <file translate="title" module="modulecreator">
1279
+ <title>Link widget</title>
1280
+ <scope>entity</scope>
1281
+ <filetype>php</filetype>
1282
+ <depend>
1283
+ <widget />
1284
+ </depend>
1285
+ <from>app/design/frontend/base/default/template/namespace_module/entity/widget/link/</from>
1286
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/{{entity}}/widget/link.phtml</to>
1287
+ <content>
1288
+ <file>
1289
+ <name>01_content.phtml</name>
1290
+ </file>
1291
+ </content>
1292
+ </file>
1293
+ <file translate="title" module="modulecreator">
1294
+ <title>View widget</title>
1295
+ <scope>entity</scope>
1296
+ <filetype>php</filetype>
1297
+ <depend>
1298
+ <widget />
1299
+ </depend>
1300
+ <from>app/design/frontend/base/default/template/namespace_module/entity/widget/view/</from>
1301
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/{{entity}}/widget/view.phtml</to>
1302
+ <content>
1303
+ <file>
1304
+ <name>01_content.phtml</name>
1305
+ </file>
1306
+ </content>
1307
+ </file>
1308
+ <file translate="title" module="modulecreator">
1309
+ <title>Adminhtml observer</title>
1310
+ <scope>global</scope>
1311
+ <filetype>php</filetype>
1312
+ <depend>
1313
+ <has_observer />
1314
+ </depend>
1315
+ <from>app/code/codepool/Namespace/Module/Model/Adminhtml/Observer/</from>
1316
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Adminhtml/Observer.php</to>
1317
+ <content>
1318
+ <file>
1319
+ <name>01_top.php</name>
1320
+ </file>
1321
+ <file>
1322
+ <name>02_entity.php</name>
1323
+ <scope>entity</scope>
1324
+ <depend>
1325
+ <link_product />
1326
+ </depend>
1327
+ </file>
1328
+ <file>
1329
+ <name>03_footer.php</name>
1330
+ </file>
1331
+ </content>
1332
+ </file>
1333
+ <file translate="title" module="modulecreator">
1334
+ <title>Entity tab on product form</title>
1335
+ <scope>entity</scope>
1336
+ <filetype>php</filetype>
1337
+ <depend>
1338
+ <link_product />
1339
+ </depend>
1340
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Catalog/Product/Edit/Tab/Entity/</from>
1341
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/Catalog/Product/Edit/Tab/{{Entity}}.php</to>
1342
+ <content>
1343
+ <file>
1344
+ <name>01_content.php</name>
1345
+ </file>
1346
+ </content>
1347
+ </file>
1348
+ <file translate="title" module="modulecreator">
1349
+ <title>Product helper</title>
1350
+ <scope>global</scope>
1351
+ <filetype>php</filetype>
1352
+ <depend>
1353
+ <link_product />
1354
+ </depend>
1355
+ <from>app/code/codepool/Namespace/Module/Helper/Product/</from>
1356
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/Product.php</to>
1357
+ <content>
1358
+ <file>
1359
+ <name>01_top.php</name>
1360
+ </file>
1361
+ <file>
1362
+ <name>02_content.php</name>
1363
+ <scope>entity</scope>
1364
+ <depend>
1365
+ <link_product />
1366
+ </depend>
1367
+ </file>
1368
+ <file>
1369
+ <name>03_footer.php</name>
1370
+ </file>
1371
+ </content>
1372
+ </file>
1373
+ <file translate="title" module="modulecreator">
1374
+ <title>Entity - product relation model</title>
1375
+ <scope>entity</scope>
1376
+ <filetype>php</filetype>
1377
+ <depend>
1378
+ <link_product />
1379
+ </depend>
1380
+ <from>app/code/codepool/Namespace/Module/Model/Resource/Entity/Product/</from>
1381
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Product.php</to>
1382
+ <content>
1383
+ <file>
1384
+ <name>01_content.php</name>
1385
+ </file>
1386
+ </content>
1387
+ </file>
1388
+ <file translate="title" module="modulecreator">
1389
+ <title>Entity - admin product tab</title>
1390
+ <scope>entity</scope>
1391
+ <filetype>php</filetype>
1392
+ <depend>
1393
+ <link_product />
1394
+ </depend>
1395
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Product/</from>
1396
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/Product.php</to>
1397
+ <content>
1398
+ <file>
1399
+ <name>01_content.php</name>
1400
+ </file>
1401
+ </content>
1402
+ </file>
1403
+ <file translate="title" module="modulecreator">
1404
+ <title>entity - product relation resource model collection</title>
1405
+ <scope>entity</scope>
1406
+ <filetype>php</filetype>
1407
+ <depend>
1408
+ <link_product />
1409
+ </depend>
1410
+ <from>app/code/codepool/Namespace/Module/Model/Resource/Entity/Product/Collection/</from>
1411
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Product/Collection.php</to>
1412
+ <content>
1413
+ <file>
1414
+ <name>01_content.php</name>
1415
+ </file>
1416
+ </content>
1417
+ </file>
1418
+ <file translate="title" module="modulecreator">
1419
+ <title>entity - product model</title>
1420
+ <scope>entity</scope>
1421
+ <filetype>php</filetype>
1422
+ <depend>
1423
+ <link_product />
1424
+ </depend>
1425
+ <from>app/code/codepool/Namespace/Module/Model/Entity/Product/</from>
1426
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Product.php</to>
1427
+ <content>
1428
+ <file>
1429
+ <name>01_content.php</name>
1430
+ </file>
1431
+ </content>
1432
+ </file>
1433
+ <file translate="title" module="modulecreator">
1434
+ <title>Entity list on product page</title>
1435
+ <scope>entity</scope>
1436
+ <filetype>php</filetype>
1437
+ <depend>
1438
+ <show_on_product />
1439
+ </depend>
1440
+ <from>app/code/codepool/Namespace/Module/Block/Catalog/Product/List/Entity/</from>
1441
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Catalog/Product/List/{{Entity}}.php</to>
1442
+ <content>
1443
+ <file>
1444
+ <name>01_top.php</name>
1445
+ </file>
1446
+ <file>
1447
+ <name>02_status.php</name>
1448
+ <depend>
1449
+ <add_status />
1450
+ </depend>
1451
+ </file>
1452
+ <file>
1453
+ <name>03_footer.php</name>
1454
+ </file>
1455
+ </content>
1456
+ </file>
1457
+ <file translate="title" module="modulecreator">
1458
+ <title>Entity list on product page template</title>
1459
+ <scope>entity</scope>
1460
+ <filetype>php</filetype>
1461
+ <depend>
1462
+ <show_on_product />
1463
+ </depend>
1464
+ <from>app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/</from>
1465
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/catalog/product/list/{{entity}}.phtml</to>
1466
+ <content>
1467
+ <file>
1468
+ <name>01_top.phtml</name>
1469
+ </file>
1470
+ <file>
1471
+ <name>02_link_top.phtml</name>
1472
+ <depend>
1473
+ <frontend_view />
1474
+ </depend>
1475
+ </file>
1476
+ <file>
1477
+ <name>03_name.phtml</name>
1478
+ </file>
1479
+ <file>
1480
+ <name>04_link_footer.phtml</name>
1481
+ <depend>
1482
+ <frontend_view />
1483
+ </depend>
1484
+ </file>
1485
+ <file>
1486
+ <name>05_footer.phtml</name>
1487
+ </file>
1488
+ </content>
1489
+ </file>
1490
+ <file translate="title" module="modulecreator">
1491
+ <title>Product list on entity page</title>
1492
+ <scope>entity</scope>
1493
+ <filetype>php</filetype>
1494
+ <depend>
1495
+ <show_products />
1496
+ </depend>
1497
+ <from>app/code/codepool/Namespace/Module/Block/Entity/Catalog/Product/List/</from>
1498
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Catalog/Product/List.php</to>
1499
+ <content>
1500
+ <file>
1501
+ <name>01_content.php</name>
1502
+ </file>
1503
+ </content>
1504
+ </file>
1505
+ <file translate="title" module="modulecreator">
1506
+ <title>Entity list on product page template</title>
1507
+ <scope>entity</scope>
1508
+ <filetype>php</filetype>
1509
+ <depend>
1510
+ <show_on_product />
1511
+ </depend>
1512
+ <from>app/design/frontend/base/default/template/namespace_module/entity/catalog/product/list/</from>
1513
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/{{entity}}/catalog/product/list.phtml</to>
1514
+ <content>
1515
+ <file>
1516
+ <name>01_content.phtml</name>
1517
+ </file>
1518
+ </content>
1519
+ </file>
1520
+ <file translate="title" module="modulecreator">
1521
+ <title>Entity product admin controller</title>
1522
+ <scope>entity</scope>
1523
+ <filetype>php</filetype>
1524
+ <depend>
1525
+ <link_product />
1526
+ </depend>
1527
+ <from>app/code/codepool/Namespace/Module/controllers/Adminhtml/Entity/Catalog/ProductController/</from>
1528
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{Entity}}/Catalog/ProductController.php</to>
1529
+ <content>
1530
+ <file>
1531
+ <name>01_content.php</name>
1532
+ </file>
1533
+ </content>
1534
+ </file>
1535
+ <file translate="title" module="modulecreator">
1536
+ <title>Entity sibling admin relation tab</title>
1537
+ <scope>siblings</scope>
1538
+ <filetype>php</filetype>
1539
+ <from>app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Sibling/</from>
1540
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/{{Sibling}}.php</to>
1541
+ <content>
1542
+ <file>
1543
+ <name>01_content.php</name>
1544
+ </file>
1545
+ </content>
1546
+ </file>
1547
+ <file translate="title" module="modulecreator">
1548
+ <title>Entity sibling relation resource model</title>
1549
+ <scope>siblings</scope>
1550
+ <filetype>php</filetype>
1551
+ <from>app/code/codepool/Namespace/Module/Model/Resource/Entity/Sibling/</from>
1552
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/{{Sibling}}.php</to>
1553
+ <content>
1554
+ <file>
1555
+ <name>01_content.php</name>
1556
+ </file>
1557
+ </content>
1558
+ </file>
1559
+ <file translate="title" module="modulecreator">
1560
+ <title>Entity sibling relation resource collection model</title>
1561
+ <scope>siblings</scope>
1562
+ <filetype>php</filetype>
1563
+ <from>app/code/codepool/Namespace/Module/Model/Resource/Entity/Sibling/Collection/</from>
1564
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/{{Sibling}}/Collection.php</to>
1565
+ <content>
1566
+ <file>
1567
+ <name>01_content.php</name>
1568
+ </file>
1569
+ </content>
1570
+ </file>
1571
+ <file translate="title" module="modulecreator">
1572
+ <title>Entity sibling model</title>
1573
+ <scope>siblings</scope>
1574
+ <filetype>php</filetype>
1575
+ <from>app/code/codepool/Namespace/Module/Model/Entity/Sibling/</from>
1576
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/{{Sibling}}.php</to>
1577
+ <content>
1578
+ <file>
1579
+ <name>01_content.php</name>
1580
+ </file>
1581
+ </content>
1582
+ </file>
1583
+ <file translate="title" module="modulecreator">
1584
+ <title>Entity sibling list block</title>
1585
+ <scope>siblings</scope>
1586
+ <filetype>php</filetype>
1587
+ <depend>
1588
+ <show_frontend_relation_siblings />
1589
+ </depend>
1590
+ <from>app/code/codepool/Namespace/Module/Block/Entity/Sibling/List/</from>
1591
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/{{Sibling}}/List.php</to>
1592
+ <content>
1593
+ <file>
1594
+ <name>01_content.php</name>
1595
+ </file>
1596
+ </content>
1597
+ </file>
1598
+ <file translate="title" module="modulecreator">
1599
+ <title>Entity siblings list template</title>
1600
+ <scope>siblings</scope>
1601
+ <filetype>php</filetype>
1602
+ <depend>
1603
+ <show_frontend_relation_siblings />
1604
+ </depend>
1605
+ <from>app/design/frontend/base/default/template/namespace_module/entity/sibling/list/</from>
1606
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/{{entity}}/{{sibling}}/list.phtml</to>
1607
+ <content>
1608
+ <file>
1609
+ <name>01_content.phtml</name>
1610
+ </file>
1611
+ </content>
1612
+ </file>
1613
+ <file translate="title" module="modulecreator">
1614
+ <title>Entity children list block</title>
1615
+ <scope>children</scope>
1616
+ <filetype>php</filetype>
1617
+ <depend>
1618
+ <show_frontend_relation_children />
1619
+ </depend>
1620
+ <from>app/code/codepool/Namespace/Module/Block/Entity/Child/List/</from>
1621
+ <to>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/{{Sibling}}/List.php</to>
1622
+ <content>
1623
+ <file>
1624
+ <name>01_content.php</name>
1625
+ </file>
1626
+ </content>
1627
+ </file>
1628
+ <file translate="title" module="modulecreator">
1629
+ <title>Entity siblings list template</title>
1630
+ <scope>children</scope>
1631
+ <filetype>php</filetype>
1632
+ <depend>
1633
+ <show_frontend_relation_children />
1634
+ </depend>
1635
+ <from>app/design/frontend/base/default/template/namespace_module/entity/sibling/list/</from>
1636
+ <to>app/design/frontend/{{package}}/{{theme_template}}/template/{{namespace}}_{{module}}/{{entity}}/{{sibling}}/list.phtml</to>
1637
+ <content>
1638
+ <file>
1639
+ <name>01_content.phtml</name>
1640
+ </file>
1641
+ </content>
1642
+ </file>
1643
+ </files>
1644
+ </config>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Catalog/Product/Edit/Tab/Entity/01_content.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} tab on product edit form
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}} extends Mage_Adminhtml_Block_Widget_Grid{
11
+ /**
12
+ * Set grid params
13
+ * @access protected
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ $this->setId('{{entity}}_grid');
20
+ $this->setDefaultSort('position');
21
+ $this->setDefaultDir('ASC');
22
+ $this->setUseAjax(true);
23
+ if ($this->getProduct()->getId()) {
24
+ $this->setDefaultFilter(array('in_{{entities}}'=>1));
25
+ }
26
+ }
27
+ /**
28
+ * prepare the {{entity}} collection
29
+ * @access protected
30
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}}
31
+ * {{qwertyuiop}}
32
+ */
33
+ protected function _prepareCollection() {
34
+ $collection = Mage::getResourceModel('{{module}}/{{entity}}_collection');
35
+ if ($this->getProduct()->getId()){
36
+ $constraint = 'related.product_id='.$this->getProduct()->getId();
37
+ }
38
+ else{
39
+ $constraint = 'related.product_id=0';
40
+ }
41
+ $collection->getSelect()->joinLeft(
42
+ array('related'=>$collection->getTable('{{module}}/{{entity}}_product')),
43
+ 'related.{{entity}}_id=main_table.entity_id AND '.$constraint,
44
+ array('position')
45
+ );
46
+ $this->setCollection($collection);
47
+ parent::_prepareCollection();
48
+ return $this;
49
+ }
50
+ /**
51
+ * prepare mass action grid
52
+ * @access protected
53
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}}
54
+ * {{qwertyuiop}}
55
+ */
56
+ protected function _prepareMassaction(){
57
+ return $this;
58
+ }
59
+ /**
60
+ * prepare the grid columns
61
+ * @access protected
62
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}}
63
+ * {{qwertyuiop}}
64
+ */
65
+ protected function _prepareColumns(){
66
+ $this->addColumn('in_{{entities}}', array(
67
+ 'header_css_class' => 'a-center',
68
+ 'type' => 'checkbox',
69
+ 'name' => 'in_{{entities}}',
70
+ 'values'=> $this->_getSelected{{Entities}}(),
71
+ 'align' => 'center',
72
+ 'index' => 'entity_id'
73
+ ));
74
+ $this->addColumn('{{nameAttribute}}', array(
75
+ 'header'=> Mage::helper('{{module}}')->__('{{nameAttributeLabel}}'),
76
+ 'align' => 'left',
77
+ 'index' => '{{nameAttribute}}',
78
+ ));
79
+ $this->addColumn('position', array(
80
+ 'header' => Mage::helper('{{module}}')->__('Position'),
81
+ 'name' => 'position',
82
+ 'width' => 60,
83
+ 'type' => 'number',
84
+ 'validate_class'=> 'validate-number',
85
+ 'index' => 'position',
86
+ 'editable' => true,
87
+ ));
88
+ }
89
+ /**
90
+ * Retrieve selected {{entities}}
91
+ * @access protected
92
+ * @return array
93
+ * {{qwertyuiop}}
94
+ */
95
+ protected function _getSelected{{Entities}}(){
96
+ ${{entities}} = $this->getProduct{{Entities}}();
97
+ if (!is_array(${{entities}})) {
98
+ ${{entities}} = array_keys($this->getSelected{{Entities}}());
99
+ }
100
+ return ${{entities}};
101
+ }
102
+ /**
103
+ * Retrieve selected {{entities}}
104
+ * @access protected
105
+ * @return array
106
+ * {{qwertyuiop}}
107
+ */
108
+ public function getSelected{{Entities}}() {
109
+ ${{entities}} = array();
110
+ //used helper here in order not to override the product model
111
+ $selected = Mage::helper('{{module}}/product')->getSelected{{Entities}}(Mage::registry('current_product'));
112
+ if (!is_array($selected)){
113
+ $selected = array();
114
+ }
115
+ foreach ($selected as ${{entity}}) {
116
+ ${{entities}}[${{entity}}->getId()] = array('position' => ${{entity}}->getPosition());
117
+ }
118
+ return ${{entities}};
119
+ }
120
+ /**
121
+ * get row url
122
+ * @access public
123
+ * @return string
124
+ * {{qwertyuiop}}
125
+ */
126
+ public function getRowUrl($item){
127
+ return '#';
128
+ }
129
+ /**
130
+ * get grid url
131
+ * @access public
132
+ * @return string
133
+ * {{qwertyuiop}}
134
+ */
135
+ public function getGridUrl(){
136
+ return $this->getUrl('*/*/{{entities}}Grid', array(
137
+ 'id'=>$this->getProduct()->getId()
138
+ ));
139
+ }
140
+ /**
141
+ * get the current product
142
+ * @access public
143
+ * @return Mage_Catalog_Model_Product
144
+ * {{qwertyuiop}}
145
+ */
146
+ public function getProduct(){
147
+ return Mage::registry('current_product');
148
+ }
149
+ /**
150
+ * Add filter
151
+ * @access protected
152
+ * @param object $column
153
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}}
154
+ * {{qwertyuiop}}
155
+ */
156
+ protected function _addColumnFilterToCollection($column){
157
+ if ($column->getId() == 'in_{{entities}}') {
158
+ ${{entity}}Ids = $this->_getSelected{{Entities}}();
159
+ if (empty(${{entity}}Ids)) {
160
+ ${{entity}}Ids = 0;
161
+ }
162
+ if ($column->getFilter()->getValue()) {
163
+ $this->getCollection()->addFieldToFilter('entity_id', array('in'=>${{entity}}Ids));
164
+ }
165
+ else {
166
+ if(${{entity}}Ids) {
167
+ $this->getCollection()->addFieldToFilter('entity_id', array('nin'=>${{entity}}Ids));
168
+ }
169
+ }
170
+ }
171
+ else {
172
+ parent::_addColumnFilterToCollection($column);
173
+ }
174
+ return $this;
175
+ }
176
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/01_content.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} admin block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}} extends Mage_Adminhtml_Block_Widget_Grid_Container{
11
+ /**
12
+ * constructor
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ $this->_controller = 'adminhtml_{{entity}}';
19
+ $this->_blockGroup = '{{module}}';
20
+ $this->_headerText = Mage::helper('{{module}}')->__('{{EntityLabel}}');
21
+ $this->_addButtonLabel = Mage::helper('{{module}}')->__('Add {{EntityLabel}}');
22
+ parent::__construct();
23
+ }
24
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/01_content.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} admin edit block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit extends Mage_Adminhtml_Block_Widget_Form_Container{
11
+ /**
12
+ * constuctor
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ $this->_blockGroup = '{{module}}';
20
+ $this->_controller = 'adminhtml_{{entity}}';
21
+ $this->_updateButton('save', 'label', Mage::helper('{{module}}')->__('Save {{EntityLabel}}'));
22
+ $this->_updateButton('delete', 'label', Mage::helper('{{module}}')->__('Delete {{EntityLabel}}'));
23
+ $this->_addButton('saveandcontinue', array(
24
+ 'label' => Mage::helper('{{module}}')->__('Save And Continue Edit'),
25
+ 'onclick' => 'saveAndContinueEdit()',
26
+ 'class' => 'save',
27
+ ), -100);
28
+ $this->_formScripts[] = "
29
+ function saveAndContinueEdit(){
30
+ editForm.submit($('edit_form').action+'back/edit/');
31
+ }
32
+ ";
33
+ }
34
+ /**
35
+ * get the edit form header
36
+ * @access public
37
+ * @return string
38
+ * {{qwertyuiop}}
39
+ */
40
+ public function getHeaderText(){
41
+ if( Mage::registry('{{entity}}_data') && Mage::registry('{{entity}}_data')->getId() ) {
42
+ return Mage::helper('{{module}}')->__("Edit {{EntityLabel}} '%s'", $this->htmlEscape(Mage::registry('{{entity}}_data')->get{{EntityNameMagicCode}}()));
43
+ }
44
+ else {
45
+ return Mage::helper('{{module}}')->__('Add {{EntityLabel}}');
46
+ }
47
+ }
48
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Form/01_content.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} edit form
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form extends Mage_Adminhtml_Block_Widget_Form{
11
+ /**
12
+ * prepare form
13
+ * @access protected
14
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form
15
+ * {{qwertyuiop}}
16
+ */
17
+ protected function _prepareForm(){
18
+ $form = new Varien_Data_Form(array(
19
+ 'id' => 'edit_form',
20
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
21
+ 'method' => 'post',
22
+ 'enctype' => 'multipart/form-data'
23
+ )
24
+ );
25
+ $form->setUseContainer(true);
26
+ $this->setForm($form);
27
+ return parent::_prepareForm();
28
+ }
29
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/01_top.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} edit form tab
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form{
11
+ /**
12
+ * prepare the form
13
+ * @access protected
14
+ * @return {{Module}}_{{Entity}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Form
15
+ * {{qwertyuiop}}
16
+ */
17
+ protected function _prepareForm(){
18
+ $form = new Varien_Data_Form();
19
+ $form->setFieldNameSuffix('{{entity}}');
20
+ $this->setForm($form);
21
+ $fieldset = $form->addFieldset('{{entity}}_form', array('legend'=>Mage::helper('{{module}}')->__('{{EntityLabel}}')));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/02_image.php ADDED
@@ -0,0 +1 @@
 
1
+ $fieldset->addType('image', Mage::getConfig()->getBlockClassName('{{module}}/adminhtml_{{entity}}_helper_image'));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/03_file.php ADDED
@@ -0,0 +1 @@
 
1
+ $fieldset->addType('file', Mage::getConfig()->getBlockClassName('{{module}}/adminhtml_{{entity}}_helper_file'));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/04_wysiwyg.php ADDED
@@ -0,0 +1 @@
 
1
+ $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig();
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/05_parents.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ $values = Mage::getResourceModel('{{module}}/{{sibling}}_collection')->toOptionArray();
2
+ array_unshift($values, array('label'=>'', 'value'=>''));
3
+ $fieldset->addField('{{sibling}}_id', 'select', array(
4
+ 'label' => Mage::helper('{{module}}')->__('{{SiblingLabel}}'),
5
+ 'name' => '{{sibling}}_id',
6
+ 'required' => false,
7
+ 'values' => $values
8
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/06_attributes.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ {{attributePreElementText}}
2
+ $fieldset->addField('{{attributeCode}}', '{{attributeFormType}}', array(
3
+ 'label' => Mage::helper('{{module}}')->__('{{attributeLabel}}'),
4
+ 'name' => '{{attributeCode}}',
5
+ {{attributeFormOptions}} ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/07_status.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $fieldset->addField('status', 'select', array(
2
+ 'label' => Mage::helper('{{module}}')->__('Status'),
3
+ 'name' => 'status',
4
+ 'values'=> array(
5
+ array(
6
+ 'value' => 1,
7
+ 'label' => Mage::helper('{{module}}')->__('Enabled'),
8
+ ),
9
+ array(
10
+ 'value' => 0,
11
+ 'label' => Mage::helper('{{module}}')->__('Disabled'),
12
+ ),
13
+ ),
14
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/08_rss.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $fieldset->addField('in_rss', 'select', array(
2
+ 'label' => Mage::helper('{{module}}')->__('Show in rss'),
3
+ 'name' => 'in_rss',
4
+ 'values'=> array(
5
+ array(
6
+ 'value' => 1,
7
+ 'label' => Mage::helper('{{module}}')->__('Yes'),
8
+ ),
9
+ array(
10
+ 'value' => 0,
11
+ 'label' => Mage::helper('{{module}}')->__('No'),
12
+ ),
13
+ ),
14
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/09_seo.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $fieldset->addField('meta_title', 'text', array(
2
+ 'label' => Mage::helper('{{module}}')->__('Meta-title'),
3
+ 'name' => 'meta_title',
4
+ ));
5
+ $fieldset->addField('meta_description', 'textarea', array(
6
+ 'name' => 'meta_description',
7
+ 'label' => Mage::helper('{{module}}')->__('Meta-description'),
8
+ ));
9
+ $fieldset->addField('meta_keywords', 'textarea', array(
10
+ 'name' => 'meta_keywords',
11
+ 'label' => Mage::helper('{{module}}')->__('Meta-keywords'),
12
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Form/10_footer.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ if (Mage::getSingleton('adminhtml/session')->get{{Entity}}Data()){
2
+ $form->setValues(Mage::getSingleton('adminhtml/session')->get{{Entity}}Data());
3
+ Mage::getSingleton('adminhtml/session')->set{{Entity}}Data(null);
4
+ }
5
+ elseif (Mage::registry('current_{{entity}}')){
6
+ $form->setValues(Mage::registry('current_{{entity}}')->getData());
7
+ }
8
+ return parent::_prepareForm();
9
+ }
10
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Product/01_content.php ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} - product relation edit block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product extends Mage_Adminhtml_Block_Widget_Grid{
11
+ /**
12
+ * Set grid params
13
+ * @access protected
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ $this->setId('product_grid');
20
+ $this->setDefaultSort('position');
21
+ $this->setDefaultDir('ASC');
22
+ $this->setUseAjax(true);
23
+ if ($this->get{{Entity}}()->getId()) {
24
+ $this->setDefaultFilter(array('in_products'=>1));
25
+ }
26
+ }
27
+ /**
28
+ * prepare the product collection
29
+ * @access protected
30
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product
31
+ * {{qwertyuiop}}
32
+ */
33
+ protected function _prepareCollection() {
34
+ $collection = Mage::getResourceModel('catalog/product_collection');
35
+ $collection->addAttributeToSelect('price');
36
+ $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
37
+ $collection->joinAttribute('product_name', 'catalog_product/name', 'entity_id', null, 'left', $adminStore);
38
+ if ($this->get{{Entity}}()->getId()){
39
+ $constraint = '{{table}}.{{entity}}_id='.$this->get{{Entity}}()->getId();
40
+ }
41
+ else{
42
+ $constraint = '{{table}}.{{entity}}_id=0';
43
+ }
44
+ $collection->joinField('position',
45
+ '{{module}}/{{entity}}_product',
46
+ 'position',
47
+ 'product_id=entity_id',
48
+ $constraint,
49
+ 'left');
50
+ $this->setCollection($collection);
51
+ parent::_prepareCollection();
52
+ return $this;
53
+ }
54
+ /**
55
+ * prepare mass action grid
56
+ * @access protected
57
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product
58
+ * {{qwertyuiop}}
59
+ */
60
+ protected function _prepareMassaction(){
61
+ return $this;
62
+ }
63
+ /**
64
+ * prepare the grid columns
65
+ * @access protected
66
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product
67
+ * {{qwertyuiop}}
68
+ */
69
+ protected function _prepareColumns(){
70
+ $this->addColumn('in_products', array(
71
+ 'header_css_class' => 'a-center',
72
+ 'type' => 'checkbox',
73
+ 'name' => 'in_products',
74
+ 'values'=> $this->_getSelectedProducts(),
75
+ 'align' => 'center',
76
+ 'index' => 'entity_id'
77
+ ));
78
+ $this->addColumn('product_name', array(
79
+ 'header'=> Mage::helper('catalog')->__('Name'),
80
+ 'align' => 'left',
81
+ 'index' => 'product_name',
82
+ ));
83
+ $this->addColumn('sku', array(
84
+ 'header'=> Mage::helper('catalog')->__('SKU'),
85
+ 'align' => 'left',
86
+ 'index' => 'sku',
87
+ ));
88
+ $this->addColumn('price', array(
89
+ 'header'=> Mage::helper('catalog')->__('Price'),
90
+ 'type' => 'currency',
91
+ 'width' => '1',
92
+ 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
93
+ 'index' => 'price'
94
+ ));
95
+ $this->addColumn('position', array(
96
+ 'header'=> Mage::helper('catalog')->__('Position'),
97
+ 'name' => 'position',
98
+ 'width' => 60,
99
+ 'type' => 'number',
100
+ 'validate_class'=> 'validate-number',
101
+ 'index' => 'position',
102
+ 'editable' => true,
103
+ ));
104
+ }
105
+ /**
106
+ * Retrieve selected products
107
+ * @access protected
108
+ * @return array
109
+ * {{qwertyuiop}}
110
+ */
111
+ protected function _getSelectedProducts(){
112
+ $products = $this->get{{Entity}}Products();
113
+ if (!is_array($products)) {
114
+ $products = array_keys($this->getSelectedProducts());
115
+ }
116
+ return $products;
117
+ }
118
+ /**
119
+ * Retrieve selected products
120
+ * @access protected
121
+ * @return array
122
+ * {{qwertyuiop}}
123
+ */
124
+ public function getSelectedProducts() {
125
+ $products = array();
126
+ $selected = Mage::registry('current_{{entity}}')->getSelectedProducts();
127
+ if (!is_array($selected)){
128
+ $selected = array();
129
+ }
130
+ foreach ($selected as $product) {
131
+ $products[$product->getId()] = array('position' => $product->getPosition());
132
+ }
133
+ return $products;
134
+ }
135
+ /**
136
+ * get row url
137
+ * @access public
138
+ * @return string
139
+ * {{qwertyuiop}}
140
+ */
141
+ public function getRowUrl($item){
142
+ return '#';
143
+ }
144
+ /**
145
+ * get grid url
146
+ * @access public
147
+ * @return string
148
+ * {{qwertyuiop}}
149
+ */
150
+ public function getGridUrl(){
151
+ return $this->getUrl('*/*/productsGrid', array(
152
+ 'id'=>$this->get{{Entity}}()->getId()
153
+ ));
154
+ }
155
+ /**
156
+ * get the current {{entity}}
157
+ * @access public
158
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}
159
+ * {{qwertyuiop}}
160
+ */
161
+ public function get{{Entity}}(){
162
+ return Mage::registry('current_{{entity}}');
163
+ }
164
+ /**
165
+ * Add filter
166
+ * @access protected
167
+ * @param object $column
168
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product
169
+ * {{qwertyuiop}}
170
+ */
171
+ protected function _addColumnFilterToCollection($column){
172
+ // Set custom filter for in product flag
173
+ if ($column->getId() == 'in_products') {
174
+ $productIds = $this->_getSelectedProducts();
175
+ if (empty($productIds)) {
176
+ $productIds = 0;
177
+ }
178
+ if ($column->getFilter()->getValue()) {
179
+ $this->getCollection()->addFieldToFilter('entity_id', array('in'=>$productIds));
180
+ }
181
+ else {
182
+ if($productIds) {
183
+ $this->getCollection()->addFieldToFilter('entity_id', array('nin'=>$productIds));
184
+ }
185
+ }
186
+ }
187
+ else {
188
+ parent::_addColumnFilterToCollection($column);
189
+ }
190
+ return $this;
191
+ }
192
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tab/Sibling/01_content.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{entity}} - {{sibling}} relation edit block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}} extends Mage_Adminhtml_Block_Widget_Grid{
11
+ /**
12
+ * Set grid params
13
+ * @access protected
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ $this->setId('{{sibling}}_grid');
20
+ $this->setDefaultSort('position');
21
+ $this->setDefaultDir('ASC');
22
+ $this->setUseAjax(true);
23
+ if ($this->get{{Entity}}()->getId()) {
24
+ $this->setDefaultFilter(array('in_{{siblings}}'=>1));
25
+ }
26
+ }
27
+ /**
28
+ * prepare the {{sibling}} collection
29
+ * @access protected
30
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}}
31
+ * {{qwertyuiop}}
32
+ */
33
+ protected function _prepareCollection() {
34
+ $collection = Mage::getResourceModel('{{module}}/{{sibling}}_collection');
35
+ if ($this->get{{Entity}}()->getId()){
36
+ $constraint = 'related.{{entity}}_id='.$this->get{{Entity}}()->getId();
37
+ }
38
+ else{
39
+ $constraint = 'related.{{entity}}_id=0';
40
+ }
41
+ $collection->getSelect()->joinLeft(
42
+ array('related'=>$collection->getTable('{{module}}/{{entity}}_{{sibling}}')),
43
+ 'related.{{sibling}}_id=main_table.entity_id AND '.$constraint,
44
+ array('position'));
45
+ $this->setCollection($collection);
46
+ parent::_prepareCollection();
47
+ return $this;
48
+ }
49
+ /**
50
+ * prepare mass action grid
51
+ * @access protected
52
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}}
53
+ * {{qwertyuiop}}
54
+ */
55
+ protected function _prepareMassaction(){
56
+ return $this;
57
+ }
58
+ /**
59
+ * prepare the grid columns
60
+ * @access protected
61
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}}
62
+ * {{qwertyuiop}}
63
+ */
64
+ protected function _prepareColumns(){
65
+ $this->addColumn('in_{{siblings}}', array(
66
+ 'header_css_class' => 'a-center',
67
+ 'type' => 'checkbox',
68
+ 'name' => 'in_{{siblings}}',
69
+ 'values'=> $this->_getSelected{{Siblings}}(),
70
+ 'align' => 'center',
71
+ 'index' => 'entity_id'
72
+ ));
73
+ $this->addColumn('{{siblingNameAttribute}}', array(
74
+ 'header'=> Mage::helper('{{module}}')->__('{{siblingNameAttributeLabel}}'),
75
+ 'align' => 'left',
76
+ 'index' => '{{siblingNameAttribute}}',
77
+ ));
78
+ $this->addColumn('position', array(
79
+ 'header'=> Mage::helper('{{module}}')->__('Position'),
80
+ 'name' => 'position',
81
+ 'width' => 60,
82
+ 'type' => 'number',
83
+ 'validate_class'=> 'validate-number',
84
+ 'index' => 'position',
85
+ 'editable' => true,
86
+ ));
87
+ }
88
+ /**
89
+ * Retrieve selected {{siblings}}
90
+ * @access protected
91
+ * @return array
92
+ * {{qwertyuiop}}
93
+ */
94
+ protected function _getSelected{{Siblings}}(){
95
+ ${{siblings}} = $this->get{{Entity}}{{Siblings}}();
96
+ if (!is_array(${{siblings}})) {
97
+ ${{siblings}} = array_keys($this->getSelected{{Siblings}}());
98
+ }
99
+ return ${{siblings}};
100
+ }
101
+ /**
102
+ * Retrieve selected {{siblings}}
103
+ * @access protected
104
+ * @return array
105
+ * {{qwertyuiop}}
106
+ */
107
+ public function getSelected{{Siblings}}() {
108
+ ${{siblings}} = array();
109
+ $selected = Mage::registry('current_{{entity}}')->getSelected{{Siblings}}();
110
+ if (!is_array($selected)){
111
+ $selected = array();
112
+ }
113
+ foreach ($selected as ${{sibling}}) {
114
+ ${{siblings}}[${{sibling}}->getId()] = array('position' => ${{sibling}}->getPosition());
115
+ }
116
+ return ${{siblings}};
117
+ }
118
+ /**
119
+ * get row url
120
+ * @access public
121
+ * @return string
122
+ * {{qwertyuiop}}
123
+ */
124
+ public function getRowUrl($item){
125
+ return '#';
126
+ }
127
+ /**
128
+ * get grid url
129
+ * @access public
130
+ * @return string
131
+ * {{qwertyuiop}}
132
+ */
133
+ public function getGridUrl(){
134
+ return $this->getUrl('*/*/{{siblings}}Grid', array(
135
+ 'id'=>$this->get{{Entity}}()->getId()
136
+ ));
137
+ }
138
+ /**
139
+ * get the current {{entity}}
140
+ * @access public
141
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}
142
+ * {{qwertyuiop}}
143
+ */
144
+ public function get{{Entity}}(){
145
+ return Mage::registry('current_{{entity}}');
146
+ }
147
+ /**
148
+ * Add filter
149
+ * @access protected
150
+ * @param object $column
151
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}}
152
+ * {{qwertyuiop}}
153
+ */
154
+ protected function _addColumnFilterToCollection($column){
155
+ // Set custom filter for in product flag
156
+ if ($column->getId() == 'in_{{siblings}}') {
157
+ ${{sibling}}Ids = $this->_getSelected{{Siblings}}();
158
+ if (empty(${{sibling}}Ids)) {
159
+ ${{sibling}}Ids = 0;
160
+ }
161
+ if ($column->getFilter()->getValue()) {
162
+ $this->getCollection()->addFieldToFilter('entity_id', array('in'=>${{sibling}}Ids));
163
+ }
164
+ else {
165
+ if(${{sibling}}Ids) {
166
+ $this->getCollection()->addFieldToFilter('entity_id', array('nin'=>${{sibling}}Ids));
167
+ }
168
+ }
169
+ }
170
+ else {
171
+ parent::_addColumnFilterToCollection($column);
172
+ }
173
+ return $this;
174
+ }
175
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/01_top.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} admin edit tabs
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs{
11
+ /**
12
+ * constructor
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ $this->setId('{{entity}}_tabs');
20
+ $this->setDestElementId('edit_form');
21
+ $this->setTitle(Mage::helper('{{module}}')->__('{{EntityLabel}}'));
22
+ }
23
+ /**
24
+ * before render html
25
+ * @access protected
26
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tabs
27
+ * {{qwertyuiop}}
28
+ */
29
+ protected function _beforeToHtml(){
30
+ $this->addTab('form_section', array(
31
+ 'label' => Mage::helper('{{module}}')->__('{{EntityLabel}}'),
32
+ 'title' => Mage::helper('{{module}}')->__('{{EntityLabel}}'),
33
+ 'content' => $this->getLayout()->createBlock('{{module}}/adminhtml_{{entity}}_edit_tab_form')->toHtml(),
34
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/02_relations_tabs.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ $this->addTab('{{siblings}}', array(
2
+ 'label' => Mage::helper('{{module}}')->__('{{SiblingsLabel}}'),
3
+ 'url' => $this->getUrl('*/*/{{siblings}}', array('_current' => true)),
4
+ 'class' => 'ajax'
5
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/03_product_relation.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ $this->addTab('products', array(
2
+ 'label' => Mage::helper('{{module}}')->__('Associated products'),
3
+ 'url' => $this->getUrl('*/*/products', array('_current' => true)),
4
+ 'class' => 'ajax'
5
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Edit/Tabs/04_footer.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ return parent::_beforeToHtml();
2
+ }
3
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/01_top.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} admin grid block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid extends Mage_Adminhtml_Block_Widget_Grid{
11
+ /**
12
+ * constructor
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ $this->setId('{{entity}}Grid');
20
+ $this->setDefaultSort('entity_id');
21
+ $this->setDefaultDir('ASC');
22
+ $this->setSaveParametersInSession(true);
23
+ $this->setUseAjax(true);
24
+ }
25
+ /**
26
+ * prepare collection
27
+ * @access protected
28
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid
29
+ * {{qwertyuiop}}
30
+ */
31
+ protected function _prepareCollection(){
32
+ $collection = Mage::getModel('{{module}}/{{entity}}')->getCollection();
33
+ $this->setCollection($collection);
34
+ return parent::_prepareCollection();
35
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/02_columns_top.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * prepare grid collection
3
+ * @access protected
4
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid
5
+ * {{qwertyuiop}}
6
+ */
7
+ protected function _prepareColumns(){
8
+ $this->addColumn('entity_id', array(
9
+ 'header' => Mage::helper('{{module}}')->__('Id'),
10
+ 'index' => 'entity_id',
11
+ 'type' => 'number'
12
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/03_parents.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ ${{siblings}} = Mage::getResourceModel('{{module}}/{{sibling}}_collection')->toOptionHash();
2
+ $this->addColumn('{{sibling}}_id', array(
3
+ 'header' => Mage::helper('{{module}}')->__('{{SiblingLabel}}'),
4
+ 'index' => '{{sibling}}_id',
5
+ 'type' => 'options',
6
+ 'options' => ${{siblings}}
7
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/04_grid_attributes.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ $this->addColumn('{{attributeCode}}', array(
2
+ 'header'=> Mage::helper('{{module}}')->__('{{attributeLabel}}'),
3
+ 'index' => '{{attributeCode}}',
4
+ {{attributeColumnOptions}}
5
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/05_grid_status.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ $this->addColumn('status', array(
2
+ 'header' => Mage::helper('{{module}}')->__('Status'),
3
+ 'index' => 'status',
4
+ 'type' => 'options',
5
+ 'options' => array(
6
+ '1' => Mage::helper('{{module}}')->__('Enabled'),
7
+ '0' => Mage::helper('{{module}}')->__('Disabled'),
8
+ )
9
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/06_created_at.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ $this->addColumn('created_at', array(
2
+ 'header' => Mage::helper('{{module}}')->__('Created at'),
3
+ 'index' => 'created_at',
4
+ 'width' => '120px',
5
+ 'type' => 'datetime',
6
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/07_updated_at.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ $this->addColumn('updated_at', array(
2
+ 'header' => Mage::helper('{{module}}')->__('Updated at'),
3
+ 'index' => 'updated_at',
4
+ 'width' => '120px',
5
+ 'type' => 'datetime',
6
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/08_grid_actions.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $this->addColumn('action',
2
+ array(
3
+ 'header'=> Mage::helper('{{module}}')->__('Action'),
4
+ 'width' => '100',
5
+ 'type' => 'action',
6
+ 'getter'=> 'getId',
7
+ 'actions' => array(
8
+ array(
9
+ 'caption' => Mage::helper('{{module}}')->__('Edit'),
10
+ 'url' => array('base'=> '*/*/edit'),
11
+ 'field' => 'id'
12
+ )
13
+ ),
14
+ 'filter'=> false,
15
+ 'is_system' => true,
16
+ 'sortable' => false,
17
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/09_grid_export.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ $this->addExportType('*/*/exportCsv', Mage::helper('{{module}}')->__('CSV'));
2
+ $this->addExportType('*/*/exportExcel', Mage::helper('{{module}}')->__('Excel'));
3
+ $this->addExportType('*/*/exportXml', Mage::helper('{{module}}')->__('XML'));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/10_columns_footer.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ return parent::_prepareColumns();
2
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/11_mass_action_top.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * prepare mass action
3
+ * @access protected
4
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid
5
+ * {{qwertyuiop}}
6
+ */
7
+ protected function _prepareMassaction(){
8
+ $this->setMassactionIdField('entity_id');
9
+ $this->getMassactionBlock()->setFormFieldName('{{entity}}');
10
+ $this->getMassactionBlock()->addItem('delete', array(
11
+ 'label'=> Mage::helper('{{module}}')->__('Delete'),
12
+ 'url' => $this->getUrl('*/*/massDelete'),
13
+ 'confirm' => Mage::helper('{{module}}')->__('Are you sure?')
14
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/12_mass_action_status.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $this->getMassactionBlock()->addItem('status', array(
2
+ 'label'=> Mage::helper('{{module}}')->__('Change status'),
3
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
4
+ 'additional' => array(
5
+ 'status' => array(
6
+ 'name' => 'status',
7
+ 'type' => 'select',
8
+ 'class' => 'required-entry',
9
+ 'label' => Mage::helper('{{module}}')->__('Status'),
10
+ 'values' => array(
11
+ '1' => Mage::helper('{{module}}')->__('Enabled'),
12
+ '0' => Mage::helper('{{module}}')->__('Disabled'),
13
+ )
14
+ )
15
+ )
16
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/13_mass_action_flags.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $this->getMassactionBlock()->addItem('{{attributeCode}}', array(
2
+ 'label'=> Mage::helper('{{module}}')->__('Change {{attributeLabel}}'),
3
+ 'url' => $this->getUrl('*/*/mass{{AttributeMagicCode}}', array('_current'=>true)),
4
+ 'additional' => array(
5
+ 'flag_{{attributeCode}}' => array(
6
+ 'name' => 'flag_{{attributeCode}}',
7
+ 'type' => 'select',
8
+ 'class' => 'required-entry',
9
+ 'label' => Mage::helper('{{module}}')->__('{{attributeLabel}}'),
10
+ 'values' => array(
11
+ '1' => Mage::helper('{{module}}')->__('Yes'),
12
+ '0' => Mage::helper('{{module}}')->__('No'),
13
+ )
14
+ )
15
+ )
16
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/14_mass_action_parents.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $values = Mage::getResourceModel('{{module}}/{{sibling}}_collection')->toOptionHash();
2
+ $values = array_reverse($values, true);
3
+ $values[''] = '';
4
+ $values = array_reverse($values, true);
5
+ $this->getMassactionBlock()->addItem('{{sibling}}_id', array(
6
+ 'label'=> Mage::helper('{{module}}')->__('Change {{SiblingLabel}}'),
7
+ 'url' => $this->getUrl('*/*/mass{{Sibling}}Id', array('_current'=>true)),
8
+ 'additional' => array(
9
+ 'flag_{{sibling}}_id' => array(
10
+ 'name' => 'flag_{{sibling}}_id',
11
+ 'type' => 'select',
12
+ 'class' => 'required-entry',
13
+ 'label' => Mage::helper('{{module}}')->__('{{SiblingLabel}}'),
14
+ 'values' => $values
15
+ )
16
+ )
17
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Grid/15_footer.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ return $this;
2
+ }
3
+ /**
4
+ * get the row url
5
+ * @access public
6
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}}
7
+ * @return string
8
+ * {{qwertyuiop}}
9
+ */
10
+ public function getRowUrl($row){
11
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
12
+ }
13
+ /**
14
+ * get the grid url
15
+ * @access public
16
+ * @return string
17
+ * {{qwertyuiop}}
18
+ */
19
+ public function getGridUrl(){
20
+ return $this->getUrl('*/*/grid', array('_current'=>true));
21
+ }
22
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Helper/File/01_content.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} file field renderer helper
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Helper_File extends Varien_Data_Form_Element_Abstract{
11
+ /**
12
+ * constructor
13
+ * @access public
14
+ * @param array $data
15
+ * @return void
16
+ * {{qwertyuiop}}
17
+ */
18
+ public function __construct($data){
19
+ parent::__construct($data);
20
+ $this->setType('file');
21
+ }
22
+ /**
23
+ * get element html
24
+ * @access public
25
+ * @return string
26
+ * {{qwertyuiop}}
27
+ */
28
+ public function getElementHtml(){
29
+ $html = '';
30
+ $this->setClass('input-file');
31
+ $html.= parent::getElementHtml();
32
+ if ($this->getValue()) {
33
+ $url = $this->_getUrl();
34
+ if( !preg_match("/^http\:\/\/|https\:\/\//", $url) ) {
35
+ $url = Mage::helper('{{module}}/{{entity}}')->getFileBaseUrl() . $url;
36
+ }
37
+ $html .= '<br /><a href="'.$url.'">'.$this->_getUrl().'</a> ';
38
+ }
39
+ $html.= $this->_getDeleteCheckbox();
40
+ return $html;
41
+ }
42
+ /**
43
+ * get the delete checkbox HTML
44
+ * @access protected
45
+ * @return string
46
+ * {{qwertyuiop}}
47
+ */
48
+ protected function _getDeleteCheckbox(){
49
+ $html = '';
50
+ if ($this->getValue()) {
51
+ $label = Mage::helper('{{module}}')->__('Delete File');
52
+ $html .= '<span class="delete-image">';
53
+ $html .= '<input type="checkbox" name="'.parent::getName().'[delete]" value="1" class="checkbox" id="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' disabled="disabled"': '').'/>';
54
+ $html .= '<label for="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' class="disabled"' : '').'> '.$label.'</label>';
55
+ $html .= $this->_getHiddenInput();
56
+ $html .= '</span>';
57
+ }
58
+ return $html;
59
+ }
60
+ /**
61
+ * get the hidden input
62
+ * @access protected
63
+ * @return string
64
+ * {{qwertyuiop}}
65
+ */
66
+ protected function _getHiddenInput(){
67
+ return '<input type="hidden" name="'.parent::getName().'[value]" value="'.$this->getValue().'" />';
68
+ }
69
+ /**
70
+ * get the file url
71
+ * @access protected
72
+ * @return string
73
+ * {{qwertyuiop}}
74
+ */
75
+ protected function _getUrl(){
76
+ return $this->getValue();
77
+ }
78
+ /**
79
+ * get the name
80
+ * @access public
81
+ * @return string
82
+ * {{qwertyuiop}}
83
+ */
84
+ public function getName(){
85
+ return $this->getData('name');
86
+ }
87
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Helper/Image/01_content.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} image field renderer helper
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Helper_Image extends Varien_Data_Form_Element_Image{
11
+ /**
12
+ * get the url of the image
13
+ * @access protected
14
+ * @return string
15
+ * {{qwertyuiop}}
16
+ */
17
+ protected function _getUrl(){
18
+ $url = false;
19
+ if ($this->getValue()) {
20
+ $url = Mage::helper('{{module}}/{{entity}}_image')->getImageBaseUrl().$this->getValue();
21
+ }
22
+ return $url;
23
+ }
24
+ }
25
+
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/01_top.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} admin widget chooser
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser extends Mage_Adminhtml_Block_Widget_Grid{
11
+ /**
12
+ * Block construction, prepare grid params
13
+ * @access public
14
+ * @param array $arguments Object data
15
+ * @return void
16
+ * {{qwertyuiop}}
17
+ */
18
+ public function __construct($arguments=array()){
19
+ parent::__construct($arguments);
20
+ $this->setDefaultSort('entity_id');
21
+ $this->setDefaultDir('ASC');
22
+ $this->setUseAjax(true);
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/02_top_status.php ADDED
@@ -0,0 +1 @@
 
1
+ $this->setDefaultFilter(array('chooser_status' => '1'));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/03_content.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ }
2
+ /**
3
+ * Prepare chooser element HTML
4
+ * @access public
5
+ * @param Varien_Data_Form_Element_Abstract $element Form Element
6
+ * @return Varien_Data_Form_Element_Abstract
7
+ * {{qwertyuiop}}
8
+ */
9
+ public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element){
10
+ $uniqId = Mage::helper('core')->uniqHash($element->getId());
11
+ $sourceUrl = $this->getUrl('{{module}}/adminhtml_{{entity}}_widget/chooser', array('uniq_id' => $uniqId));
12
+ $chooser = $this->getLayout()->createBlock('widget/adminhtml_widget_chooser')
13
+ ->setElement($element)
14
+ ->setTranslationHelper($this->getTranslationHelper())
15
+ ->setConfig($this->getConfig())
16
+ ->setFieldsetId($this->getFieldsetId())
17
+ ->setSourceUrl($sourceUrl)
18
+ ->setUniqId($uniqId);
19
+ if ($element->getValue()) {
20
+ ${{entity}} = Mage::getModel('{{module}}/{{entity}}')->load($element->getValue());
21
+ if (${{entity}}->getId()) {
22
+ $chooser->setLabel(${{entity}}->get{{EntityNameMagicCode}}());
23
+ }
24
+ }
25
+ $element->setData('after_element_html', $chooser->toHtml());
26
+ return $element;
27
+ }
28
+ /**
29
+ * Grid Row JS Callback
30
+ * @access public
31
+ * @return string
32
+ * {{qwertyuiop}}
33
+ */
34
+ public function getRowClickCallback(){
35
+ $chooserJsObject = $this->getId();
36
+ $js = '
37
+ function (grid, event) {
38
+ var trElement = Event.findElement(event, "tr");
39
+ var {{entity}}Id = trElement.down("td").innerHTML.replace(/^\s+|\s+$/g,"");
40
+ var {{entity}}Title = trElement.down("td").next().innerHTML;
41
+ '.$chooserJsObject.'.setElementValue({{entity}}Id);
42
+ '.$chooserJsObject.'.setElementLabel({{entity}}Title);
43
+ '.$chooserJsObject.'.close();
44
+ }
45
+ ';
46
+ return $js;
47
+ }
48
+ /**
49
+ * Prepare a static blocks collection
50
+ * @access protected
51
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser
52
+ * {{qwertyuiop}}
53
+ */
54
+ protected function _prepareCollection(){
55
+ $collection = Mage::getModel('{{module}}/{{entity}}')->getCollection();
56
+ $this->setCollection($collection);
57
+ return parent::_prepareCollection();
58
+ }
59
+ /**
60
+ * Prepare columns for the a grid
61
+ * @access protected
62
+ * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser
63
+ * {{qwertyuiop}}
64
+ */
65
+ protected function _prepareColumns(){
66
+ $this->addColumn('chooser_id', array(
67
+ 'header' => Mage::helper('{{module}}')->__('Id'),
68
+ 'align' => 'right',
69
+ 'index' => 'entity_id',
70
+ 'type' => 'number',
71
+ 'width' => 50
72
+ ));
73
+
74
+ $this->addColumn('chooser_{{nameAttribute}}', array(
75
+ 'header'=> Mage::helper('{{module}}')->__('{{nameAttributeLabel}}'),
76
+ 'align' => 'left',
77
+ 'index' => '{{nameAttribute}}',
78
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/04_status.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ $this->addColumn('chooser_status', array(
2
+ 'header'=> Mage::helper('{{module}}')->__('Status'),
3
+ 'index' => 'status',
4
+ 'type' => 'options',
5
+ 'options' => array(
6
+ 0 => Mage::helper('{{module}}')->__('Disabled'),
7
+ 1 => Mage::helper('{{module}}')->__('Enabled')
8
+ ),
9
+ ));
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Adminhtml/Entity/Widget/Chooser/05_footer.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ return parent::_prepareColumns();
2
+ }
3
+ /**
4
+ * get url for grid
5
+ * @access public
6
+ * @return string
7
+ * (non-PHPdoc)
8
+ * @see Mage_Adminhtml_Block_Widget_Grid::getGridUrl()
9
+ * {{qwertyuiop}}
10
+ */
11
+ public function getGridUrl(){
12
+ return $this->getUrl('adminhtml_{{entity}}_widget/chooser', array('_current' => true));
13
+ }
14
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Catalog/Product/List/Entity/01_top.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} list on product page block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Catalog_Product_List_{{Entity}} extends Mage_Catalog_Block_Product_Abstract{
11
+ /**
12
+ * get the list of {{entities}}
13
+ * @access protected
14
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function get{{Entity}}Collection(){
18
+ if (!$this->hasData('{{entity}}_collection')){
19
+ $product = Mage::registry('product');
20
+ $collection = Mage::getResourceSingleton('{{module}}/{{entity}}_collection')
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Catalog/Product/List/Entity/02_status.php ADDED
@@ -0,0 +1 @@
 
1
+ ->addFilter('status', 1)
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Catalog/Product/List/Entity/03_footer.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ ->addProductFilter($product);
2
+ $collection->getSelect()->order('position', 'ASC');
3
+ $this->setData('{{entity}}_collection', $collection);
4
+ }
5
+ return $this->getData('{{entity}}_collection');
6
+ }
7
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Catalog/Product/List/01_content.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} product list
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_{{Entity}}_Catalog_Product_List extends Mage_Core_Block_Template{
11
+ /**
12
+ * get the list of products
13
+ * @access public
14
+ * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function getProductCollection(){
18
+ $collection = $this->get{{Entity}}()->getSelectedProductsCollection();
19
+ $collection->addAttributeToSelect('name');
20
+ $collection->addUrlRewrite();
21
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
22
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
23
+ return $collection;
24
+ }
25
+ /**
26
+ * get current {{entity}}
27
+ * @access public
28
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}
29
+ * {{qwertyuiop}}
30
+ */
31
+ public function get{{Entity}}(){
32
+ return Mage::registry('current_{{module}}_{{entity}}');
33
+ }
34
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Child/List/01_content.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} {{SiblingsLabel}} list block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_{{Entity}}_{{Sibling}}_List extends {{Namespace}}_{{Module}}_Block_{{Sibling}}_List{
11
+ /**
12
+ * initialize
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ ${{entity}} = $this->get{{Entity}}();
20
+ if (${{entity}}){
21
+ $this->get{{Siblings}}()->addFilter('{{entity}}_id', ${{entity}}->getId());
22
+ }
23
+ }
24
+ /**
25
+ * prepare the layout - actually do nothing
26
+ * @access protected
27
+ * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_{{Sibling}}_List
28
+ * {{qwertyuiop}}
29
+ */
30
+ protected function _prepareLayout(){
31
+ return $this;
32
+ }
33
+ /**
34
+ * get the current {{entity}}
35
+ * @access public
36
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}
37
+ * {{qwertyuiop}}
38
+ */
39
+ public function get{{Entity}}(){
40
+ return Mage::registry('current_{{module}}_{{entity}}');
41
+ }
42
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/List/01_top.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} list block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_{{Entity}}_List extends Mage_Core_Block_Template{
11
+ /**
12
+ * initialize
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ ${{entities}} = Mage::getResourceModel('{{module}}/{{entity}}_collection')
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/List/02_status.php ADDED
@@ -0,0 +1 @@
 
1
+ ->addFilter('status', 1)
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/List/03_footer.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;
2
+ ${{entities}}->setOrder('{{nameAttribute}}', 'asc');
3
+ $this->set{{Entities}}(${{entities}});
4
+ }
5
+ /**
6
+ * prepare the layout
7
+ * @access protected
8
+ * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_List
9
+ * {{qwertyuiop}}
10
+ */
11
+ protected function _prepareLayout(){
12
+ parent::_prepareLayout();
13
+ $pager = $this->getLayout()->createBlock('page/html_pager', '{{module}}.{{entity}}.html.pager')
14
+ ->setCollection($this->get{{Entities}}());
15
+ $this->setChild('pager', $pager);
16
+ $this->get{{Entities}}()->load();
17
+ return $this;
18
+ }
19
+ /**
20
+ * get the pager html
21
+ * @access public
22
+ * @return string
23
+ * {{qwertyuiop}}
24
+ */
25
+ public function getPagerHtml(){
26
+ return $this->getChildHtml('pager');
27
+ }
28
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/01_top.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} RSS block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_{{Entity}}_Rss extends Mage_Rss_Block_Abstract{
11
+ /**
12
+ * Cache tag constant for feed reviews
13
+ * @var string
14
+ */
15
+ const CACHE_TAG = 'block_html_{{module}}_{{entity}}_rss';
16
+ /**
17
+ * constructor
18
+ * @access protected
19
+ * @return void
20
+ * {{qwertyuiop}}
21
+ */
22
+ protected function _construct(){
23
+ $this->setCacheTags(array(self::CACHE_TAG));
24
+ /*
25
+ * setting cache to save the rss for 10 minutes
26
+ */
27
+ $this->setCacheKey('{{module}}_{{entity}}_rss');
28
+ $this->setCacheLifetime(600);
29
+ }
30
+ /**
31
+ * toHtml method
32
+ * @access protected
33
+ * @return string
34
+ * {{qwertyuiop}}
35
+ */
36
+ protected function _toHtml(){
37
+ $url = Mage::helper('{{module}}')->get{{Entities}}Url();
38
+ $title = Mage::helper('{{module}}')->__('{{EntitiesLabel}}');
39
+ $rssObj = Mage::getModel('rss/rss');
40
+ $data = array(
41
+ 'title' => $title,
42
+ 'description' => $title,
43
+ 'link'=> $url,
44
+ 'charset' => 'UTF-8',
45
+ );
46
+ $rssObj->_addHeader($data);
47
+ $collection = Mage::getModel('{{module}}/{{entity}}')->getCollection()
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/02_status.php ADDED
@@ -0,0 +1 @@
 
1
+ ->addFilter('status', 1)
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/03_content_top.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ ->addFilter('in_rss', 1)
2
+ ->setOrder('created_at');
3
+ $collection->load();
4
+ foreach ($collection as $item){
5
+ $description = '<p>';
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/04_content.php ADDED
@@ -0,0 +1 @@
 
1
+ {{attributeRssText}}
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Rss/05_footer.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ $description .= '</p>';
2
+ $data = array(
3
+ 'title'=>$item->get{{EntityNameMagicCode}}(),
4
+ 'link'=>$item->get{{Entity}}Url(),
5
+ 'description' => $description
6
+ );
7
+ $rssObj->_addEntry($data);
8
+ }
9
+ return $rssObj->createRssXml();
10
+ }
11
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Sibling/List/01_content.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} {{SiblingsLabel}} list block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_{{Entity}}_{{Sibling}}_List extends {{Namespace}}_{{Module}}_Block_{{Sibling}}_List{
11
+ /**
12
+ * initialize
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function __construct(){
18
+ parent::__construct();
19
+ ${{entity}} = $this->get{{Entity}}();
20
+ if (${{entity}}){
21
+ $this->get{{Siblings}}()->add{{Entity}}Filter(${{entity}}->getId());
22
+ }
23
+ }
24
+ /**
25
+ * prepare the layout
26
+ * @access protected
27
+ * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_{{Sibling}}_List
28
+ * {{qwertyuiop}}
29
+ */
30
+ protected function _prepareLayout(){
31
+ return $this;
32
+ }
33
+ /**
34
+ * get the current {{entity}}
35
+ * @access public
36
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}
37
+ * {{qwertyuiop}}
38
+ */
39
+ public function get{{Entity}}(){
40
+ return Mage::registry('current_{{module}}_{{entity}}');
41
+ }
42
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/View/01_content.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} view block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_{{Entity}}_View extends Mage_Core_Block_Template{
11
+ /**
12
+ * get the current {{entityLabel}}
13
+ * @access public
14
+ * @return mixed ({{Namespace}}_{{Module}}_Model_{{Entity}}|null)
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function getCurrent{{Entity}}(){
18
+ return Mage::registry('current_{{module}}_{{entity}}');
19
+ }
20
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/Link/01_content.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} link widget block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_Link extends {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_View{
11
+ protected $_htmlTemplate = '{{namespace}}_{{module}}/{{entity}}/widget/link.phtml';
12
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/01_top.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} widget block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_View extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface{
11
+ protected $_htmlTemplate = '{{namespace}}_{{module}}/{{entity}}/widget/view.phtml';
12
+ /**
13
+ * Prepare a for widget
14
+ * @access protected
15
+ * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_View
16
+ * {{qwertyuiop}}
17
+ */
18
+ protected function _beforeToHtml() {
19
+ parent::_beforeToHtml();
20
+ ${{entity}}Id = $this->getData('{{entity}}_id');
21
+ if (${{entity}}Id) {
22
+ ${{entity}} = Mage::getModel('{{module}}/{{entity}}')->load(${{entity}}Id);
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/02_status.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ if (${{entity}}->getStatus()) {
2
+
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/03_template.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ $this->setCurrent{{Entity}}(${{entity}});
2
+ $this->setTemplate($this->_htmlTemplate);
3
+
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/04_status.php ADDED
@@ -0,0 +1 @@
 
1
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Entity/Widget/View/05_footer.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ }
2
+ return $this;
3
+ }
4
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Block/Rss/01_content.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{Module}} RSS block
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Block_Rss extends Mage_Core_Block_Template{
11
+ protected $_feeds = array();
12
+ /**
13
+ * add a new feed
14
+ * @access public
15
+ * @param string $label
16
+ * @param string $url
17
+ * @param bool $prepare
18
+ * @return {{Namespace}}_{{Module}}_Block_Rss
19
+ * {{qwertyuiop}}
20
+ */
21
+ public function addFeed($label, $url, $prepare = false){
22
+ $link = ($prepare ? $this->getUrl($url) : $url);
23
+ $feed = new Varien_Object();
24
+ $feed->setLabel($label);
25
+ $feed->setUrl($link);
26
+ $this->_feeds[$link] = $feed;
27
+ return $this;
28
+ }
29
+ /**
30
+ * get the current feeds
31
+ * @access public
32
+ * @return array()
33
+ * {{qwertyuiop}}
34
+ */
35
+ public function getFeeds(){
36
+ return $this->_feeds;
37
+ }
38
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Controller/Adminhtml/Module/01_content.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * module base admin controller
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Controller_Adminhtml_{{Module}} extends Mage_Adminhtml_Controller_Action{
11
+ /**
12
+ * upload file and get the uploaded name
13
+ * @access public
14
+ * @param string $input
15
+ * @param string $destinationFolder
16
+ * @param array $data
17
+ * @return string
18
+ * {{qwertyuiop}}
19
+ */
20
+ protected function _uploadAndGetName($input, $destinationFolder, $data){
21
+ try{
22
+ if (isset($data[$input]['delete'])){
23
+ return '';
24
+ }
25
+ else{
26
+ $uploader = new Varien_File_Uploader($input);
27
+ $uploader->setAllowRenameFiles(true);
28
+ $uploader->setFilesDispersion(true);
29
+ $uploader->setAllowCreateFolders(true);
30
+ $result = $uploader->save($destinationFolder);
31
+ return $result['file'];
32
+ }
33
+ }
34
+ catch (Exception $e){
35
+ if ($e->getCode() != Varien_File_Uploader::TMP_NAME_EMPTY){
36
+ throw $e;
37
+ }
38
+ else{
39
+ if (isset($data[$input]['value'])){
40
+ return $data[$input]['value'];
41
+ }
42
+ }
43
+ }
44
+ return '';
45
+ }
46
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Data/01_top.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{Module}} default helper
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Helper_Data extends Mage_Core_Helper_Abstract{
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Data/02_entity.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get the url to the {{entitiesLabel}} list page
3
+ * @access public
4
+ * @return string
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function get{{Entities}}Url(){
8
+ return Mage::getUrl('{{module}}/{{entity}}/index');
9
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Data/03_footer.php ADDED
@@ -0,0 +1 @@
 
1
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/01_top.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} helper
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Helper_{{Entity}} extends Mage_Core_Helper_Abstract{
11
+ /**
12
+ * check if breadcrumbs can be used
13
+ * @access public
14
+ * @return bool
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function getUseBreadcrumbs(){
18
+ return Mage::getStoreConfigFlag('{{module}}/{{entity}}/breadcrumbs');
19
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/02_rss.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * check if the rss for {{entityLabel}} is enabled
3
+ * @access public
4
+ * @return bool
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function isRssEnabled(){
8
+ return Mage::getStoreConfigFlag('rss/config/active') && Mage::getStoreConfigFlag('{{module}}/{{entity}}/rss');
9
+ }
10
+ /**
11
+ * get the link to the {{entityLabel}} rss list
12
+ * @access public
13
+ * @return string
14
+ * {{qwertyuiop}}
15
+ */
16
+ public function getRssUrl(){
17
+ return Mage::getUrl('{{module}}/{{entity}}/rss');
18
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/03_file.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get base files dir
3
+ * @access public
4
+ * @return string
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function getFileBaseDir(){
8
+ return Mage::getBaseDir('media').DS.'{{entity}}'.DS.'file';
9
+ }
10
+ /**
11
+ * get base file url
12
+ * @access public
13
+ * @return string
14
+ * {{qwertyuiop}}
15
+ */
16
+ public function getFileBaseUrl(){
17
+ return Mage::getBaseUrl('media').'{{entity}}'.'/'.'file';
18
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/04_footer.php ADDED
@@ -0,0 +1 @@
 
1
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Entity/Image/01_content.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} image helper
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Helper_{{Entity}}_Image extends Mage_Core_Helper_Data{
11
+ /**
12
+ * image placeholder
13
+ * @var string
14
+ */
15
+ protected $_placeholder = 'images/placeholder/{{entity}}.jpg';
16
+ /**
17
+ * image processor class name
18
+ * @var string
19
+ */
20
+ protected $_imageProcessorClass = 'Varien_Image_Adapter_Gd2';
21
+ /**
22
+ * image processor
23
+ * @var null|Varien_Image_Adapter_Gd2
24
+ */
25
+ protected $_imageProcessor = null;
26
+ /**
27
+ * image to process
28
+ * @var null|string
29
+ */
30
+ protected $_image = null;
31
+ /**
32
+ * resize width
33
+ * @var null|int
34
+ */
35
+ protected $_width = null;
36
+ /**
37
+ * resize height
38
+ * @var null|int
39
+ */
40
+ protected $_height = null;
41
+ /**
42
+ * resized image folder name
43
+ * @var string
44
+ */
45
+ protected $_resizeFolderName = 'cache';
46
+ /**
47
+ * image base path
48
+ * @var sting
49
+ */
50
+ protected $_basePath = '{{entity}}';
51
+ /**
52
+ * image path
53
+ * @var string
54
+ */
55
+ protected $_imagePath = 'image';
56
+ /**
57
+ * get the image path for {{entityLabel}}
58
+ * @access public
59
+ * @return string
60
+ * {{qwertyuiop}}
61
+ */
62
+ public function getImageBaseDir(){
63
+ return Mage::getBaseDir('media').DS.'{{entity}}'.DS.'image';
64
+ }
65
+ /**
66
+ * get the image url for {{entityLabel}}
67
+ * @access public
68
+ * @return string
69
+ * {{qwertyuiop}}
70
+ */
71
+ public function getImageBaseUrl(){
72
+ return Mage::getBaseUrl('media').'{{entity}}'.'/'.'image';
73
+ }
74
+ /**
75
+ * init image
76
+ * @access public
77
+ * @param Varien_Object $object
78
+ * @param string $imageField
79
+ * @return {{Namespace}}_{{Module}}_Helper_{{Entity}}_Image
80
+ * {{qwertyuiop}}
81
+ */
82
+ public function init(Varien_Object $object, $imageField = '{{firstImageField}}'){
83
+ $this->_reset();
84
+ $this->_image = $object->getData($imageField);
85
+ try{
86
+ $this->_getImageProcessor()->open($this->getImageBaseDir().$this->_image);
87
+ }
88
+ catch (Exception $e){
89
+ $this->_getImageProcessor()->open(Mage::getDesign()->getSkinUrl($this->_placeholder));
90
+ $this->_image = '/'.$this->_placeholder;
91
+ }
92
+ return $this;
93
+ }
94
+ /**
95
+ * reset the image processor
96
+ * @access protected
97
+ * @return {{Namespace}}_{{Module}}_Helper_{{Entity}}_Image
98
+ * {{qwertyuiop}}
99
+ */
100
+ protected function _reset(){
101
+ $this->_imageProcessor = null;
102
+ $this->_image = null;
103
+ $this->_width = null;
104
+ $this->_height = null;
105
+ return $this;
106
+ }
107
+ /**
108
+ * get the image processor
109
+ * @access protected
110
+ * @return Varien_Image_Adapter_Gd2
111
+ * {{qwertyuiop}}
112
+ */
113
+ protected function _getImageProcessor(){
114
+ if (is_null($this->_imageProcessor)){
115
+ $class = $this->_imageProcessorClass;
116
+ $this->_imageProcessor = new $class();
117
+ }
118
+ return $this->_imageProcessor;
119
+ }
120
+ /**
121
+ * resize image
122
+ * @access public
123
+ * @param int $width - defaults to null
124
+ * @param int $height - defaults to null
125
+ * @return {{Namespace}}_{{Module}}_Helper_{{Entity}}_Image
126
+ * {{qwertyuiop}}
127
+ */
128
+ public function resize($width = null, $height = null){
129
+ $this->_width = $width;
130
+ $this->_height = $height;
131
+ $this->_getImageProcessor()->keepAspectRatio(true);
132
+ $this->_getImageProcessor()->keepTransparency(true);
133
+ $this->_getImageProcessor()->resize($width, $height);
134
+ return $this;
135
+ }
136
+ /**
137
+ * to string - no need for cache expire because the image names will be different
138
+ * @access public
139
+ * @return string
140
+ * {{qwertyuiop}}
141
+ */
142
+ public function __toString(){
143
+ try{
144
+ $width = $this->_width;
145
+ $height = $this->_height;
146
+ $imageRealPath = $this->getImageBaseDir().DS.$this->_resizeFolderName.DS.$width.'x'.$height.$this->_image;
147
+ if (!file_exists($imageRealPath)){
148
+ $this->_getImageProcessor()->save($imageRealPath);
149
+ }
150
+ return $this->getImageBaseUrl().'/'.$this->_resizeFolderName.'/'.$width.'x'.$height.$this->_image;
151
+ }
152
+ catch (Exception $e){
153
+ Mage::logException($e);
154
+ return '';
155
+ }
156
+ }
157
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Product/01_top.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * Product helper
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Helper_Product extends {{Namespace}}_{{Module}}_Helper_Data{
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Product/02_content.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get the selected {{entities}} for a product
3
+ * @access public
4
+ * @param Mage_Catalog_Model_Product $product
5
+ * @return array()
6
+ * {{qwertyuiop}}
7
+ */
8
+ public function getSelected{{Entities}}(Mage_Catalog_Model_Product $product){
9
+ if (!$product->hasSelected{{Entities}}()) {
10
+ ${{entities}} = array();
11
+ foreach ($this->getSelected{{Entities}}Collection($product) as ${{entity}}) {
12
+ ${{entities}}[] = ${{entity}};
13
+ }
14
+ $product->setSelected{{Entities}}(${{entities}});
15
+ }
16
+ return $product->getData('selected_{{entities}}');
17
+ }
18
+ /**
19
+ * get {{entity}} collection for a product
20
+ * @access public
21
+ * @param Mage_Catalog_Model_Product $product
22
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection
23
+ */
24
+ public function getSelected{{Entities}}Collection(Mage_Catalog_Model_Product $product){
25
+ $collection = Mage::getResourceSingleton('{{module}}/{{entity}}_collection')
26
+ ->addProductFilter($product);
27
+ return $collection;
28
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Helper/Product/03_footer.php ADDED
@@ -0,0 +1 @@
 
1
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Adminhtml/Observer/01_top.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * Adminhtml observer
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_Adminhtml_Observer{
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Adminhtml/Observer/02_entity.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * add the {{entity}} tab to products
3
+ * @access public
4
+ * @param Varien_Event_Observer $observer
5
+ * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer
6
+ * {{qwertyuiop}}
7
+ */
8
+ public function add{{Entity}}Block($observer){
9
+ $block = $observer->getEvent()->getBlock();
10
+ $product = Mage::registry('product');
11
+ if ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs && $product->getAttributeSetId()){
12
+ $block->addTab('{{entities}}', array(
13
+ 'label' => Mage::helper('{{module}}')->__('{{Entities}}'),
14
+ 'url' => Mage::helper('adminhtml')->getUrl('adminhtml/{{entity}}_catalog_product/{{entities}}', array('_current' => true)),
15
+ 'class' => 'ajax',
16
+ ));
17
+ }
18
+ return $this;
19
+ }
20
+ /**
21
+ * save {{entity}} - product relation
22
+ * @access public
23
+ * @param Varien_Event_Observer $observer
24
+ * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer
25
+ * {{qwertyuiop}}
26
+ */
27
+ public function save{{Entity}}Data($observer){
28
+ $post = Mage::app()->getRequest()->getPost('{{entities}}', -1);
29
+ if ($post != '-1') {
30
+ $post = Mage::helper('adminhtml/js')->decodeGridSerializedInput($post);
31
+ $product = Mage::registry('product');
32
+ ${{entity}}Product = Mage::getResourceSingleton('{{module}}/{{entity}}_product')->saveProductRelation($product, $post);
33
+ }
34
+ return $this;
35
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Adminhtml/Observer/03_footer.php ADDED
@@ -0,0 +1 @@
 
1
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/01_top.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} model
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_{{Entity}} extends Mage_Core_Model_Abstract{
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/02_var_sibling.php ADDED
@@ -0,0 +1 @@
 
1
+ protected $_{{sibling}}Instance = null;
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/03_var_product_relation.php ADDED
@@ -0,0 +1 @@
 
1
+ protected $_productInstance = null;
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/04_construct.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * constructor
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function _construct(){
8
+ parent::_construct();
9
+ $this->_init('{{module}}/{{entity}}');
10
+ }
11
+ /**
12
+ * before save {{entityLabel}}
13
+ * @access protected
14
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}
15
+ * {{qwertyuiop}}
16
+ */
17
+ protected function _beforeSave(){
18
+ parent::_beforeSave();
19
+ $now = Mage::getSingleton('core/date')->gmtDate();
20
+ if ($this->isObjectNew()){
21
+ $this->setCreatedAt($now);
22
+ }
23
+ $this->setUpdatedAt($now);
24
+ return $this;
25
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/05_url.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get the url to the {{entityLabel}} details page
3
+ * @access public
4
+ * @return string
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function get{{Entity}}Url(){
8
+ return Mage::getUrl('{{module}}/{{entity}}/view', array('id'=>$this->getId()));
9
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/06_editors.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get the {{entity}} {{attributeLabel}}
3
+ * @access public
4
+ * @return string
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function get{{AttributeMagicCode}}(){
8
+ ${{attributeCode}} = $this->getData('{{attributeCode}}');
9
+ $helper = Mage::helper('cms');
10
+ $processor = $helper->getBlockTemplateProcessor();
11
+ $html = $processor->filter(${{attributeCode}});
12
+ return $html;
13
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/07_after_save_top.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /**
2
+ * save {{entity}} relation
3
+ * @access public
4
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}
5
+ * {{qwertyuiop}}
6
+ */
7
+ protected function _afterSave() {
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/08_after_save_product.php ADDED
@@ -0,0 +1 @@
 
1
+ $this->getProductInstance()->save{{Entity}}Relation($this);
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/09_after_save_sibling.php ADDED
@@ -0,0 +1 @@
 
1
+ $this->get{{Sibling}}Instance()->save{{Entity}}Relation($this);
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/10_after_save_footer.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ return parent::_afterSave();
2
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/11_product_relation.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get product relation model
3
+ * @access public
4
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Product
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function getProductInstance(){
8
+ if (!$this->_productInstance) {
9
+ $this->_productInstance = Mage::getSingleton('{{module}}/{{entity}}_product');
10
+ }
11
+ return $this->_productInstance;
12
+ }
13
+ /**
14
+ * get selected products array
15
+ * @access public
16
+ * @return array
17
+ * {{qwertyuiop}}
18
+ */
19
+ public function getSelectedProducts(){
20
+ if (!$this->hasSelectedProducts()) {
21
+ $products = array();
22
+ foreach ($this->getSelectedProductsCollection() as $product) {
23
+ $products[] = $product;
24
+ }
25
+ $this->setSelectedProducts($products);
26
+ }
27
+ return $this->getData('selected_products');
28
+ }
29
+ /**
30
+ * Retrieve collection selected products
31
+ * @access public
32
+ * @return {{Namespace}}_{{Module}}_Resource_{{Entity}}_Product_Collection
33
+ * {{qwertyuiop}}
34
+ */
35
+ public function getSelectedProductsCollection(){
36
+ $collection = $this->getProductInstance()->getProductCollection($this);
37
+ return $collection;
38
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/12_sibling_relation.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get {{sibling}} relation model
3
+ * @access public
4
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_{{Sibling}}
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function get{{Sibling}}Instance(){
8
+ if (!$this->_{{sibling}}Instance) {
9
+ $this->_{{sibling}}Instance = Mage::getSingleton('{{module}}/{{entity}}_{{sibling}}');
10
+ }
11
+ return $this->_{{sibling}}Instance;
12
+ }
13
+ /**
14
+ * get selected {{siblings}} array
15
+ * @access public
16
+ * @return array
17
+ * {{qwertyuiop}}
18
+ */
19
+ public function getSelected{{Siblings}}(){
20
+ if (!$this->hasSelected{{Siblings}}()) {
21
+ ${{siblings}} = array();
22
+ foreach ($this->getSelected{{Siblings}}Collection() as ${{sibling}}) {
23
+ ${{siblings}}[] = ${{sibling}};
24
+ }
25
+ $this->setSelected{{Siblings}}(${{siblings}});
26
+ }
27
+ return $this->getData('selected_{{siblings}}');
28
+ }
29
+ /**
30
+ * Retrieve collection selected {{siblings}}
31
+ * @access public
32
+ * @return E{{Namespace}}_{{Module}}_Model_{{Entity}}_{{Sibling}}_Collection
33
+ * {{qwertyuiop}}
34
+ */
35
+ public function getSelected{{Siblings}}Collection(){
36
+ $collection = $this->get{{Sibling}}Instance()->get{{Siblings}}Collection($this);
37
+ return $collection;
38
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/13_footer.php ADDED
@@ -0,0 +1 @@
 
1
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/Product/01_content.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} product model
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_{{Entity}}_Product extends Mage_Core_Model_Abstract{
11
+ /**
12
+ * Initialize resource
13
+ * @access protected
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ protected function _construct(){
18
+ $this->_init('{{module}}/{{entity}}_product');
19
+ }
20
+ /**
21
+ * Save data for {{entity}}-product relation
22
+ * @access public
23
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}
24
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Product
25
+ * {{qwertyuiop}}
26
+ */
27
+ public function save{{Entity}}Relation(${{entity}}){
28
+ $data = ${{entity}}->getProductsData();
29
+ if (!is_null($data)) {
30
+ $this->_getResource()->save{{Entity}}Relation(${{entity}}, $data);
31
+ }
32
+ return $this;
33
+ }
34
+ /**
35
+ * get products for {{entity}}
36
+ * @access public
37
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}
38
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product_Collection
39
+ * {{qwertyuiop}}
40
+ */
41
+ public function getProductCollection(${{entity}}){
42
+ $collection = Mage::getResourceModel('{{module}}/{{entity}}_product_collection')
43
+ ->add{{Entity}}Filter(${{entity}});
44
+ return $collection;
45
+ }
46
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Entity/Sibling/01_content.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} {{siblingLabel}} model
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_{{Entity}}_{{Sibling}} extends Mage_Core_Model_Abstract{
11
+ /**
12
+ * Initialize resource
13
+ * @access protected
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ protected function _construct(){
18
+ $this->_init('{{module}}/{{entity}}_{{sibling}}');
19
+ }
20
+ /**
21
+ * Save data for {{entity}} - {{sibling}} relation
22
+ * @access public
23
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}
24
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_{{Sibling}}
25
+ * {{qwertyuiop}}
26
+ */
27
+ public function save{{Entity}}Relation(${{entity}}){
28
+ $data = ${{entity}}->get{{Siblings}}Data();
29
+ if (!is_null($data)) {
30
+ $this->_getResource()->save{{Entity}}Relation(${{entity}}, $data);
31
+ }
32
+ return $this;
33
+ }
34
+ /**
35
+ * get {{siblings}} for {{entity}}
36
+ * @access public
37
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}
38
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}_Collection
39
+ * {{qwertyuiop}}
40
+ */
41
+ public function get{{Siblings}}Collection(${{entity}}){
42
+ $collection = Mage::getResourceModel('{{module}}/{{entity}}_{{sibling}}_collection')
43
+ ->add{{Entity}}Filter(${{entity}});
44
+ return $collection;
45
+ }
46
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/01_content.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} resource model
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_Resource_{{Entity}} extends Mage_Core_Model_Mysql4_Abstract{
11
+ /**
12
+ * constructor
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function _construct(){
18
+ $this->_init('{{module}}/{{entity}}', 'entity_id');
19
+ }
20
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/01_top.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} collection resource model
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
11
+ protected $_joinedFields = array();
12
+ /**
13
+ * constructor
14
+ * @access public
15
+ * @return void
16
+ * {{qwertyuiop}}
17
+ */
18
+ public function _construct(){
19
+ parent::_construct();
20
+ $this->_init('{{module}}/{{entity}}');
21
+ }
22
+ /**
23
+ * get {{entities}} as array
24
+ * @access protected
25
+ * @param string $valueField
26
+ * @param string $labelField
27
+ * @param array $additional
28
+ * @return array
29
+ * {{qwertyuiop}}
30
+ */
31
+ protected function _toOptionArray($valueField='entity_id', $labelField='{{nameAttribute}}', $additional=array()){
32
+ return parent::_toOptionArray($valueField, $labelField, $additional);
33
+ }
34
+ /**
35
+ * get options hash
36
+ * @access protected
37
+ * @param string $valueField
38
+ * @param string $labelField
39
+ * @return array
40
+ * {{qwertyuiop}}
41
+ */
42
+ protected function _toOptionHash($valueField='entity_id', $labelField='{{nameAttribute}}'){
43
+ return parent::_toOptionHash($valueField, $labelField);
44
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/02_product_relation.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * add the product filter to collection
3
+ * @access public
4
+ * @param mixed (Mage_Catalog_Model_Product|int) $product
5
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection
6
+ * {{qwertyuiop}}
7
+ */
8
+ public function addProductFilter($product){
9
+ if ($product instanceof Mage_Catalog_Model_Product){
10
+ $product = $product->getId();
11
+ }
12
+ if (!isset($this->_joinedFields['product'])){
13
+ $this->getSelect()->join(
14
+ array('related_product' => $this->getTable('{{module}}/{{entity}}_product')),
15
+ 'related_product.{{entity}}_id = main_table.entity_id',
16
+ array('position')
17
+ );
18
+ $this->getSelect()->where('related_product.product_id = ?', $product);
19
+ $this->_joinedFields['product'] = true;
20
+ }
21
+ return $this;
22
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/03_sibling_relation.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * add the {{sibling}} filter to collection
3
+ * @access public
4
+ * @param mixed ({{Namespace}}_{{Module}}_Model_{{Sibling}}|int) ${{sibling}}
5
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection
6
+ * {{qwertyuiop}}
7
+ */
8
+ public function add{{Sibling}}Filter(${{sibling}}){
9
+ if (${{sibling}} instanceof {{Namespace}}_{{Module}}_Model_{{Sibling}}){
10
+ ${{sibling}} = ${{sibling}}->getId();
11
+ }
12
+ if (!isset($this->_joinedFields['{{sibling}}'])){
13
+ $this->getSelect()->join(
14
+ array('related_{{sibling}}' => $this->getTable('{{module}}/{{entity}}_{{sibling}}')),
15
+ 'related_{{sibling}}.{{entity}}_id = main_table.entity_id',
16
+ array('position')
17
+ );
18
+ $this->getSelect()->where('related_{{sibling}}.{{sibling}}_id = ?', ${{sibling}});
19
+ $this->_joinedFields['{{sibling}}'] = true;
20
+ }
21
+ return $this;
22
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Collection/04_footer.php ADDED
@@ -0,0 +1 @@
 
1
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Product/01_content.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} - product relation model
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product extends Mage_Core_Model_Mysql4_Abstract{
11
+ /**
12
+ * initialize resource model
13
+ * @access protected
14
+ * @return void
15
+ * @see Mage_Core_Model_Resource_Abstract::_construct()
16
+ * {{qwertyuiop}}
17
+ */
18
+ protected function _construct(){
19
+ $this->_init('{{module}}/{{entity}}_product', 'rel_id');
20
+ }
21
+ /**
22
+ * Save {{entity}} - product relations
23
+ * @access public
24
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}
25
+ * @param array $data
26
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product
27
+ * {{qwertyuiop}}
28
+ */
29
+ public function save{{Entity}}Relation(${{entity}}, $data){
30
+ if (!is_array($data)) {
31
+ $data = array();
32
+ }
33
+ $deleteCondition = $this->_getWriteAdapter()->quoteInto('{{entity}}_id=?', ${{entity}}->getId());
34
+ $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);
35
+
36
+ foreach ($data as $productId => $info) {
37
+ $this->_getWriteAdapter()->insert($this->getMainTable(), array(
38
+ '{{entity}}_id' => ${{entity}}->getId(),
39
+ 'product_id' => $productId,
40
+ 'position' => @$info['position']
41
+ ));
42
+ }
43
+ return $this;
44
+ }
45
+ /**
46
+ * Save product - {{entity}} relations
47
+ * @access public
48
+ * @param Mage_Catalog_Model_Product $prooduct
49
+ * @param array $data
50
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product
51
+ * @{{qwertyuiop}}
52
+ */
53
+ public function saveProductRelation($product, $data){
54
+ if (!is_array($data)) {
55
+ $data = array();
56
+ }
57
+ $deleteCondition = $this->_getWriteAdapter()->quoteInto('product_id=?', $product->getId());
58
+ $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);
59
+
60
+ foreach ($data as ${{entity}}Id => $info) {
61
+ $this->_getWriteAdapter()->insert($this->getMainTable(), array(
62
+ '{{entity}}_id' => ${{entity}}Id,
63
+ 'product_id' => $product->getId(),
64
+ 'position' => @$info['position']
65
+ ));
66
+ }
67
+ return $this;
68
+ }
69
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Product/Collection/01_content.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} - product relation resource model collection
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product_Collection extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection{
11
+ /**
12
+ * remember if fields have been joined
13
+ * @var bool
14
+ */
15
+ protected $_joinedFields = false;
16
+ /**
17
+ * join the link table
18
+ * @access public
19
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product_Collection
20
+ * {{qwertyuiop}}
21
+ */
22
+ public function joinFields(){
23
+ if (!$this->_joinedFields){
24
+ $this->getSelect()->join(
25
+ array('related' => $this->getTable('{{module}}/{{entity}}_product')),
26
+ 'related.product_id = e.entity_id',
27
+ array('position')
28
+ );
29
+ $this->_joinedFields = true;
30
+ }
31
+ return $this;
32
+ }
33
+ /**
34
+ * add {{entity}} filter
35
+ * @access public
36
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}} | int ${{entity}}
37
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product_Collection
38
+ * {{qwertyuiop}}
39
+ */
40
+ public function add{{Entity}}Filter(${{entity}}){
41
+ if (${{entity}} instanceof {{Namespace}}_{{Module}}_Model_{{Entity}}){
42
+ ${{entity}} = ${{entity}}->getId();
43
+ }
44
+ if (!$this->_joinedFields){
45
+ $this->joinFields();
46
+ }
47
+ $this->getSelect()->where('related.{{entity}}_id = ?', ${{entity}});
48
+ return $this;
49
+ }
50
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Sibling/01_content.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} - {{SiblingLabel}} relation model
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}} extends Mage_Core_Model_Mysql4_Abstract{
11
+ /**
12
+ * initialize resource model
13
+ * @access protected
14
+ * @return void
15
+ * @see Mage_Core_Model_Resource_Abstract::_construct()
16
+ * {{qwertyuiop}}
17
+ */
18
+ protected function _construct(){
19
+ $this->_init('{{module}}/{{entity}}_{{sibling}}', 'rel_id');
20
+ }
21
+ /**
22
+ * Save {{entity}} - {{sibling}} relations
23
+ * @access public
24
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}
25
+ * @param array $data
26
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}
27
+ * {{qwertyuiop}}
28
+ */
29
+ public function save{{Entity}}Relation(${{entity}}, $data){
30
+ if (!is_array($data)) {
31
+ $data = array();
32
+ }
33
+ $deleteCondition = $this->_getWriteAdapter()->quoteInto('{{entity}}_id=?', ${{entity}}->getId());
34
+ $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);
35
+
36
+ foreach ($data as ${{sibling}}Id => $info) {
37
+ $this->_getWriteAdapter()->insert($this->getMainTable(), array(
38
+ '{{entity}}_id' => ${{entity}}->getId(),
39
+ '{{sibling}}_id' => ${{sibling}}Id,
40
+ 'position' => @$info['position']
41
+ ));
42
+ }
43
+ return $this;
44
+ }
45
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Entity/Sibling/Collection/01_content.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} - {{SiblingLabel}} relation resource model collection
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}_Collection extends {{Namespace}}_{{Module}}_Model_Resource_{{Sibling}}_Collection{
11
+ /**
12
+ * remember if fields have been joined
13
+ * @var bool
14
+ */
15
+ protected $_joinedFields = false;
16
+ /**
17
+ * join the link table
18
+ * @access public
19
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}_Collection
20
+ * {{qwertyuiop}}
21
+ */
22
+ public function joinFields(){
23
+ if (!$this->_joinedFields){
24
+ $this->getSelect()->join(
25
+ array('related' => $this->getTable('{{module}}/{{entity}}_{{sibling}}')),
26
+ 'related.{{sibling}}_id = main_table.entity_id',
27
+ array('position')
28
+ );
29
+ $this->_joinedFields = true;
30
+ }
31
+ return $this;
32
+ }
33
+ /**
34
+ * add {{entity}} filter
35
+ * @access public
36
+ * @param {{Namespace}}_{{Module}}_Model_{{Entity}} | int ${{entity}}
37
+ * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}_Collection
38
+ * {{qwertyuiop}}
39
+ */
40
+ public function add{{Entity}}Filter(${{entity}}){
41
+ if (${{entity}} instanceof {{Namespace}}_{{Module}}_Model_{{Entity}}){
42
+ ${{entity}} = ${{entity}}->getId();
43
+ }
44
+ if (!$this->_joinedFields){
45
+ $this->joinFields();
46
+ }
47
+ $this->getSelect()->where('related.{{entity}}_id = ?', ${{entity}});
48
+ return $this;
49
+ }
50
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/Model/Resource/Setup/01_content.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{Module}} setup
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup{
11
+
12
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/Entity/Catalog/ProductController/01_content.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{Entity}} product admin controller
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ require_once ("Mage/Adminhtml/controllers/Catalog/ProductController.php");
11
+ class {{Namespace}}_{{Module}}_Adminhtml_{{Entity}}_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController{
12
+ /**
13
+ * construct
14
+ * @access protected
15
+ * @return void
16
+ * {{qwertyuiop}}
17
+ */
18
+ protected function _construct(){
19
+ // Define module dependent translate
20
+ $this->setUsedModuleName('{{Namespace}}_{{Module}}');
21
+ }
22
+ /**
23
+ * {{entities}} in the catalog page
24
+ * @access public
25
+ * @return void
26
+ * {{qwertyuiop}}
27
+ */
28
+ public function {{entities}}Action(){
29
+ $this->_initProduct();
30
+ $this->loadLayout();
31
+ $this->getLayout()->getBlock('product.edit.tab.{{entity}}')
32
+ ->setProduct{{Entities}}($this->getRequest()->getPost('{{entities}}', null));
33
+ $this->renderLayout();
34
+ }
35
+ /**
36
+ * {{entities}} grid in the catalog page
37
+ * @access public
38
+ * @return void
39
+ * {{qwertyuiop}}
40
+ */
41
+ public function {{entities}}GridAction(){
42
+ $this->_initProduct();
43
+ $this->loadLayout();
44
+ $this->getLayout()->getBlock('product.edit.tab.{{entity}}')
45
+ ->setProduct{{Entities}}($this->getRequest()->getPost('{{entities}}', null));
46
+ $this->renderLayout();
47
+ }
48
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/Entity/WidgetController/01_content.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} admin widget controller
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Adminhtml_{{Entity}}_WidgetController extends Mage_Adminhtml_Controller_Action{
11
+ /**
12
+ * Chooser Source action
13
+ * @access public
14
+ * @return void
15
+ * {{qwertyuiop}}
16
+ */
17
+ public function chooserAction(){
18
+ $uniqId = $this->getRequest()->getParam('uniq_id');
19
+ $grid = $this->getLayout()->createBlock('{{module}}/adminhtml_{{entity}}_widget_chooser', '', array(
20
+ 'id' => $uniqId,
21
+ ));
22
+ $this->getResponse()->setBody($grid->toHtml());
23
+ }
24
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/01_top.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} admin controller
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_Adminhtml_{{Entity}}Controller extends {{Namespace}}_{{Module}}_Controller_Adminhtml_{{Module}}{
11
+ /**
12
+ * init the {{entity}}
13
+ * @access protected
14
+ * @return {{Namespace}}_{{Module}}_Model_{{Entity}}
15
+ */
16
+ protected function _init{{Entity}}(){
17
+ ${{entity}}Id = (int) $this->getRequest()->getParam('id');
18
+ ${{entity}} = Mage::getModel('{{module}}/{{entity}}');
19
+ if (${{entity}}Id) {
20
+ ${{entity}}->load(${{entity}}Id);
21
+ }
22
+ Mage::register('current_{{entity}}', ${{entity}});
23
+ return ${{entity}};
24
+ }
25
+ /**
26
+ * default action
27
+ * @access public
28
+ * @return void
29
+ * {{qwertyuiop}}
30
+ */
31
+ public function indexAction() {
32
+ $this->loadLayout()->renderLayout();
33
+ }
34
+ /**
35
+ * grid action
36
+ * @access public
37
+ * @return void
38
+ * {{qwertyuiop}}
39
+ */
40
+ public function gridAction() {
41
+ $this->loadLayout()->renderLayout();
42
+ }
43
+ /**
44
+ * edit {{entityLabel}} - action
45
+ * @access public
46
+ * @return void
47
+ * {{qwertyuiop}}
48
+ */
49
+ public function editAction() {
50
+ ${{entity}}Id = $this->getRequest()->getParam('id');
51
+ ${{entity}} = $this->_init{{Entity}}();
52
+ if (${{entity}}Id && !${{entity}}->getId()) {
53
+ $this->_getSession()->addError(Mage::helper('{{module}}')->__('This {{entityLabel}} no longer exists.'));
54
+ $this->_redirect('*/*/');
55
+ return;
56
+ }
57
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
58
+ if (!empty($data)) {
59
+ ${{entity}}->setData($data);
60
+ }
61
+ Mage::register('{{entity}}_data', ${{entity}});
62
+ $this->loadLayout();
63
+ if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
64
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
65
+ }
66
+ $this->renderLayout();
67
+ }
68
+ /**
69
+ * new {{entityLabel}} action
70
+ * @access public
71
+ * @return void
72
+ * {{qwertyuiop}}
73
+ */
74
+ public function newAction() {
75
+ $this->_forward('edit');
76
+ }
77
+ /**
78
+ * save {{entityLabel}} - action
79
+ * @access public
80
+ * @return void
81
+ * {{qwertyuiop}}
82
+ */
83
+ public function saveAction() {
84
+ if ($data = $this->getRequest()->getPost('{{entity}}')) {
85
+ try {
86
+ ${{entity}} = $this->_init{{Entity}}();
87
+ ${{entity}}->addData($data);
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/02_upload_image.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ ${{attributeCode}}Name = $this->_uploadAndGetName('{{attributeCode}}', Mage::helper('{{module}}/{{entity}}_image')->getImageBaseDir(), $data);
2
+ ${{entity}}->setData('{{attributeCode}}', ${{attributeCode}}Name);
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/03_upload_files.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ ${{attributeCode}}Name = $this->_uploadAndGetName('{{attributeCode}}', Mage::helper('{{module}}/{{entity}}')->getFileBaseDir(), $data);
2
+ ${{entity}}->setData('{{attributeCode}}', ${{attributeCode}}Name);
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/04_save_product_relation.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ $products = $this->getRequest()->getPost('products', -1);
2
+ if ($products != -1) {
3
+ ${{entity}}->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));
4
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/05_save_sibling_relation.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ ${{siblings}} = $this->getRequest()->getPost('{{siblings}}', -1);
2
+ if (${{siblings}} != -1) {
3
+ ${{entity}}->set{{Siblings}}Data(Mage::helper('adminhtml/js')->decodeGridSerializedInput(${{siblings}}));
4
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/06_save.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ${{entity}}->save();
2
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('{{module}}')->__('{{EntityLabel}} was successfully saved'));
3
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
4
+ if ($this->getRequest()->getParam('back')) {
5
+ $this->_redirect('*/*/edit', array('id' => ${{entity}}->getId()));
6
+ return;
7
+ }
8
+ $this->_redirect('*/*/');
9
+ return;
10
+ }
11
+ catch (Mage_Core_Exception $e){
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/07_exception_upload.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ if (isset($data['{{attributeCode}}']['value'])){
2
+ $data['{{attributeCode}}'] = $data['{{attributeCode}}']['value'];
3
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/08_exception.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
2
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
3
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
4
+ return;
5
+ }
6
+ catch (Exception $e) {
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/09_center.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('There was a problem saving the {{entityLabel}}.'));
2
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
3
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
4
+ return;
5
+ }
6
+ }
7
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('Unable to find {{entityLabel}} to save.'));
8
+ $this->_redirect('*/*/');
9
+ }
10
+ /**
11
+ * delete {{entityLabel}} - action
12
+ * @access public
13
+ * @return void
14
+ * {{qwertyuiop}}
15
+ */
16
+ public function deleteAction() {
17
+ if( $this->getRequest()->getParam('id') > 0) {
18
+ try {
19
+ ${{entity}} = Mage::getModel('{{module}}/{{entity}}');
20
+ ${{entity}}->setId($this->getRequest()->getParam('id'))->delete();
21
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('{{module}}')->__('{{EntityLabel}} was successfully deleted.'));
22
+ $this->_redirect('*/*/');
23
+ return;
24
+ }
25
+ catch (Mage_Core_Exception $e){
26
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
27
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
28
+ }
29
+ catch (Exception $e) {
30
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('There was an error deleteing {{entityLabel}}.'));
31
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
32
+ return;
33
+ }
34
+ }
35
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('Could not find {{entityLabel}} to delete.'));
36
+ $this->_redirect('*/*/');
37
+ }
38
+ /**
39
+ * mass delete {{entityLabel}} - action
40
+ * @access public
41
+ * @return void
42
+ * {{qwertyuiop}}
43
+ */
44
+ public function massDeleteAction() {
45
+ ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');
46
+ if(!is_array(${{entity}}Ids)) {
47
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('Please select {{entitiesLabel}} to delete.'));
48
+ }
49
+ else {
50
+ try {
51
+ foreach (${{entity}}Ids as ${{entity}}Id) {
52
+ ${{entity}} = Mage::getModel('{{module}}/{{entity}}');
53
+ ${{entity}}->setId(${{entity}}Id)->delete();
54
+ }
55
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('{{module}}')->__('Total of %d {{entitiesLabel}} were successfully deleted.', count(${{entity}}Ids)));
56
+ }
57
+ catch (Mage_Core_Exception $e){
58
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
59
+ }
60
+ catch (Exception $e) {
61
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('There was an error deleteing {{entitiesLabel}}.'));
62
+ }
63
+ }
64
+ $this->_redirect('*/*/index');
65
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/10_mass_status.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * mass status change - action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function massStatusAction(){
8
+ ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');
9
+ if(!is_array(${{entity}}Ids)) {
10
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('Please select {{entitiesLabel}}.'));
11
+ }
12
+ else {
13
+ try {
14
+ foreach (${{entity}}Ids as ${{entity}}Id) {
15
+ ${{entity}} = Mage::getSingleton('{{module}}/{{entity}}')->load(${{entity}}Id)
16
+ ->setStatus($this->getRequest()->getParam('status'))
17
+ ->setIsMassupdate(true)
18
+ ->save();
19
+ }
20
+ $this->_getSession()->addSuccess($this->__('Total of %d {{entitiesLabel}} were successfully updated.', count(${{entity}}Ids)));
21
+ }
22
+ catch (Mage_Core_Exception $e){
23
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
24
+ }
25
+ catch (Exception $e) {
26
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('There was an error updating {{entitiesLabel}}.'));
27
+ }
28
+ }
29
+ $this->_redirect('*/*/index');
30
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/11_mass_update.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * mass {{attributeLabel}} change - action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function mass{{AttributeMagicCode}}Action(){
8
+ ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');
9
+ if(!is_array(${{entity}}Ids)) {
10
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('Please select {{entitiesLabel}}.'));
11
+ }
12
+ else {
13
+ try {
14
+ foreach (${{entity}}Ids as ${{entity}}Id) {
15
+ ${{entity}} = Mage::getSingleton('{{module}}/{{entity}}')->load(${{entity}}Id)
16
+ ->set{{AttributeMagicCode}}($this->getRequest()->getParam('flag_{{attributeCode}}'))
17
+ ->setIsMassupdate(true)
18
+ ->save();
19
+ }
20
+ $this->_getSession()->addSuccess($this->__('Total of %d {{entitiesLabel}} were successfully updated.', count(${{entity}}Ids)));
21
+ }
22
+ catch (Mage_Core_Exception $e){
23
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
24
+ }
25
+ catch (Exception $e) {
26
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('There was an error updating {{entitiesLabel}}.'));
27
+ }
28
+ }
29
+ $this->_redirect('*/*/index');
30
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/12_mass_parents.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * mass {{siblingLabel}} change - action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function mass{{Sibling}}IdAction(){
8
+ ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');
9
+ if(!is_array(${{entity}}Ids)) {
10
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('Please select {{entitiesLabel}}.'));
11
+ }
12
+ else {
13
+ try {
14
+ foreach (${{entity}}Ids as ${{entity}}Id) {
15
+ ${{entity}} = Mage::getSingleton('{{module}}/{{entity}}')->load(${{entity}}Id)
16
+ ->set{{Sibling}}Id($this->getRequest()->getParam('flag_{{sibling}}_id'))
17
+ ->setIsMassupdate(true)
18
+ ->save();
19
+ }
20
+ $this->_getSession()->addSuccess($this->__('Total of %d {{entitiesLabel}} were successfully updated.', count(${{entity}}Ids)));
21
+ }
22
+ catch (Mage_Core_Exception $e){
23
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
24
+ }
25
+ catch (Exception $e) {
26
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('{{module}}')->__('There was an error updating {{entitiesLabel}}.'));
27
+ }
28
+ }
29
+ $this->_redirect('*/*/index');
30
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/13_product_relation_actions.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get grid of products action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function productsAction(){
8
+ $this->_init{{Entity}}();
9
+ $this->loadLayout();
10
+ $this->getLayout()->getBlock('{{entity}}.edit.tab.product')
11
+ ->set{{Entity}}Products($this->getRequest()->getPost('products', null));
12
+ $this->renderLayout();
13
+ }
14
+ /**
15
+ * get grid of products action
16
+ * @access public
17
+ * @return void
18
+ * {{qwertyuiop}}
19
+ */
20
+ public function productsgridAction(){
21
+ $this->_init{{Entity}}();
22
+ $this->loadLayout();
23
+ $this->getLayout()->getBlock('{{entity}}.edit.tab.product')
24
+ ->set{{Entity}}Products($this->getRequest()->getPost('products', null));
25
+ $this->renderLayout();
26
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/14_sibling_actions.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * get {{siblings}} action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function {{siblings}}Action(){
8
+ $this->_init{{Entity}}();
9
+ $this->loadLayout();
10
+ $this->getLayout()->getBlock('{{entity}}.edit.tab.{{sibling}}')
11
+ ->set{{Entity}}{{Siblings}}($this->getRequest()->getPost('{{siblings}}', null));
12
+ $this->renderLayout();
13
+ }
14
+ /**
15
+ * get {{siblings}} grid action
16
+ * @access public
17
+ * @return void
18
+ * {{qwertyuiop}}
19
+ */
20
+ public function {{siblings}}gridAction(){
21
+ $this->_init{{Entity}}();
22
+ $this->loadLayout();
23
+ $this->getLayout()->getBlock('{{entity}}.edit.tab.{{sibling}}')
24
+ ->set{{Entity}}{{Siblings}}($this->getRequest()->getPost('{{siblings}}', null));
25
+ $this->renderLayout();
26
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/Adminhtml/EntityController/15_footer.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * export as csv - action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function exportCsvAction(){
8
+ $fileName = '{{entity}}.csv';
9
+ $content = $this->getLayout()->createBlock('{{module}}/adminhtml_{{entity}}_grid')->getCsv();
10
+ $this->_prepareDownloadResponse($fileName, $content);
11
+ }
12
+ /**
13
+ * export as MsExcel - action
14
+ * @access public
15
+ * @return void
16
+ * {{qwertyuiop}}
17
+ */
18
+ public function exportExcelAction(){
19
+ $fileName = '{{entity}}.xls';
20
+ $content = $this->getLayout()->createBlock('{{module}}/adminhtml_{{entity}}_grid')->getExcelFile();
21
+ $this->_prepareDownloadResponse($fileName, $content);
22
+ }
23
+ /**
24
+ * export as xml - action
25
+ * @access public
26
+ * @return void
27
+ * {{qwertyuiop}}
28
+ */
29
+ public function exportXmlAction(){
30
+ $fileName = '{{entity}}.xml';
31
+ $content = $this->getLayout()->createBlock('{{module}}/adminhtml_{{entity}}_grid')->getXml();
32
+ $this->_prepareDownloadResponse($fileName, $content);
33
+ }
34
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/01_top.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} front contrller
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ class {{Namespace}}_{{Module}}_{{Entity}}Controller extends Mage_Core_Controller_Front_Action{
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/02_list.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * default action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function indexAction(){
8
+ $this->loadLayout();
9
+ if (Mage::helper('{{module}}/{{entity}}')->getUseBreadcrumbs()){
10
+ if ($breadcrumbBlock = $this->getLayout()->getBlock('breadcrumbs')){
11
+ $breadcrumbBlock->addCrumb('home', array(
12
+ 'label' => Mage::helper('{{module}}')->__('Home'),
13
+ 'link' => Mage::getUrl(),
14
+ )
15
+ );
16
+ $breadcrumbBlock->addCrumb('{{entities}}', array(
17
+ 'label' => Mage::helper('{{module}}')->__('{{EntitiesLabel}}'),
18
+ 'link' => '',
19
+ )
20
+ );
21
+ }
22
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/03_list_seo.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ $headBlock = $this->getLayout()->getBlock('head');
2
+ if ($headBlock) {
3
+ $headBlock->setTitle(Mage::getStoreConfig('{{module}}/{{entity}}/meta_title'));
4
+ $headBlock->setKeywords(Mage::getStoreConfig('{{module}}/{{entity}}/meta_keywords'));
5
+ $headBlock->setDescription(Mage::getStoreConfig('{{module}}/{{entity}}/meta_description'));
6
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/04_list_footer.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ $this->renderLayout();
2
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/05_view.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * view {{entityLabel}} action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function viewAction(){
8
+ ${{entity}}Id = $this->getRequest()->getParam('id', 0);
9
+ ${{entity}} = Mage::getModel('{{module}}/{{entity}}')->load(${{entity}}Id);
10
+ if (!${{entity}}->getId()){
11
+ $this->_forward('no-route');
12
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/06_view_status.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ elseif (!${{entity}}->getStatus()){
2
+ $this->_forward('no-route');
3
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/07_view2.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ else{
2
+ Mage::register('current_{{module}}_{{entity}}', ${{entity}});
3
+ $this->loadLayout();
4
+ if ($root = $this->getLayout()->getBlock('root')) {
5
+ $root->addBodyClass('{{module}}-{{entity}} {{module}}-{{entity}}' . ${{entity}}->getId());
6
+ }
7
+ if (Mage::helper('{{module}}/{{entity}}')->getUseBreadcrumbs()){
8
+ if ($breadcrumbBlock = $this->getLayout()->getBlock('breadcrumbs')){
9
+ $breadcrumbBlock->addCrumb('home', array(
10
+ 'label' => Mage::helper('{{module}}')->__('Home'),
11
+ 'link' => Mage::getUrl(),
12
+ )
13
+ );
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/08_breadcrumbs.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ $breadcrumbBlock->addCrumb('{{entities}}', array(
2
+ 'label' => Mage::helper('{{module}}')->__('{{EntitiesLabel}}'),
3
+ 'link' => Mage::helper('{{module}}')->get{{Entities}}Url(),
4
+ )
5
+ );
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/09_breadcrumbs_footer.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ $breadcrumbBlock->addCrumb('{{entity}}', array(
2
+ 'label' => ${{entity}}->get{{EntityNameMagicCode}}(),
3
+ 'link' => '',
4
+ )
5
+ );
6
+ }
7
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/10_view_seo.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ $headBlock = $this->getLayout()->getBlock('head');
2
+ if ($headBlock) {
3
+ if (${{entity}}->getMetaTitle()){
4
+ $headBlock->setTitle(${{entity}}->getMetaTitle());
5
+ }
6
+ else{
7
+ $headBlock->setTitle(${{entity}}->get{{EntityNameMagicCode}}());
8
+ }
9
+ $headBlock->setKeywords(${{entity}}->getMetaKeywords());
10
+ $headBlock->setDescription(${{entity}}->getMetaDescription());
11
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/11_view_footer.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ $this->renderLayout();
2
+ }
3
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/12_rss.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * {{entitiesLabel}} rss list action
3
+ * @access public
4
+ * @return void
5
+ * {{qwertyuiop}}
6
+ */
7
+ public function rssAction(){
8
+ if (Mage::helper('{{module}}/{{entity}}')->isRssEnabled()) {
9
+ $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8');
10
+ $this->loadLayout(false);
11
+ $this->renderLayout();
12
+ }
13
+ else {
14
+ $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
15
+ $this->getResponse()->setHeader('Status','404 File not found');
16
+ $this->_forward('nofeed','index','rss');
17
+ }
18
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/controllers/EntityController/13_footer.php ADDED
@@ -0,0 +1 @@
 
1
+ }
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/01_top.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ {{License}}
3
+ <config>
4
+ <acl>
5
+ <resources>
6
+ <admin>
7
+ <children>
8
+ <system>
9
+ <children>
10
+ <config>
11
+ <children>
12
+ <{{module}} translate="title" module="{{module}}">
13
+ <title>{{Module}}</title>
14
+ </{{module}}>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ <{{module}} translate="title" module="{{module}}">
20
+ <title>{{Module}}</title>
21
+ <children>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/02_entity_acl.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <{{entity}} translate="title" module="{{module}}">
2
+ <title>{{EntitiesLabel}}</title>
3
+ </{{entity}}>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/03_center.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ </children>
2
+ </{{module}}>
3
+ </children>
4
+ </admin>
5
+ </resources>
6
+ </acl>
7
+ <menu>
8
+ <{{module}} translate="title" module="{{module}}">
9
+ <title>{{Module}}</title>
10
+ <sort_order>{{sort_order}}</sort_order>
11
+ <depends>
12
+ <module>{{Namespace}}_{{Module}}</module>
13
+ </depends>
14
+ <children>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/04_entity_menu.xml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <{{entity}} translate="title" module="{{module}}">
2
+ <title>{{EntitiesLabel}}</title>
3
+ <action>adminhtml/{{entity}}</action>
4
+ <sort_order>{{menu_sort}}</sort_order>
5
+ </{{entity}}>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/adminhtml/05_footer.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ </children>
2
+ </{{module}}>
3
+ </menu>
4
+ </config>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/01_top.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ {{License}}
3
+ <config>
4
+ <modules>
5
+ <{{Namespace}}_{{Module}}>
6
+ <version>0.0.1</version>
7
+ </{{Namespace}}_{{Module}}>
8
+ </modules>
9
+ <global>
10
+ <resources>
11
+ <{{namespace}}_{{module}}_setup>
12
+ <setup>
13
+ <module>{{Namespace}}_{{Module}}</module>
14
+ <class>{{Namespace}}_{{Module}}_Model_Resource_Setup</class>
15
+ </setup>
16
+ </{{namespace}}_{{module}}_setup>
17
+ </resources>
18
+ <blocks>
19
+ <{{module}}>
20
+ <class>{{Namespace}}_{{Module}}_Block</class>
21
+ </{{module}}>
22
+ </blocks>
23
+ <helpers>
24
+ <{{module}}>
25
+ <class>{{Namespace}}_{{Module}}_Helper</class>
26
+ </{{module}}>
27
+ </helpers>
28
+ <models>
29
+ <{{module}}>
30
+ <class>{{Namespace}}_{{Module}}_Model</class>
31
+ <resourceModel>{{module}}_resource</resourceModel>
32
+ </{{module}}>
33
+ <{{module}}_resource>
34
+ <class>{{Namespace}}_{{Module}}_Model_Resource</class>
35
+ <entities>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/02_tables.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <{{entity}}>
2
+ <table>{{module}}_{{entity}}</table>
3
+ </{{entity}}>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/03_siblings_table.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <{{entity}}_{{sibling}}>
2
+ <table>{{module}}_{{entity}}_{{sibling}}</table>
3
+ </{{entity}}_{{sibling}}>
4
+ <{{sibling}}_{{entity}}>
5
+ <table>{{module}}_{{entity}}_{{sibling}}</table>
6
+ </{{sibling}}_{{entity}}>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/04_relation_table.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <{{entity}}_product>
2
+ <table>{{module}}_{{entity}}_product</table>
3
+ </{{entity}}_product>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/05_global.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ </entities>
2
+ </{{module}}_resource>
3
+ </models>
4
+ </global>
5
+ <adminhtml>
6
+ <layout>
7
+ <updates>
8
+ <{{namespace}}_{{module}}>
9
+ <file>{{namespace}}_{{module}}.xml</file>
10
+ </{{namespace}}_{{module}}>
11
+ </updates>
12
+ </layout>
13
+ <translate>
14
+ <modules>
15
+ <{{Namespace}}_{{Module}}>
16
+ <files>
17
+ <default>{{Namespace}}_{{Module}}.csv</default>
18
+ </files>
19
+ </{{Namespace}}_{{Module}}>
20
+ </modules>
21
+ </translate>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/06_relation_product.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <events>
2
+ <core_block_abstract_prepare_layout_after>
3
+ <observers>
4
+ <{{entity}}>
5
+ <type>singleton</type>
6
+ <class>{{module}}/adminhtml_observer</class>
7
+ <method>add{{Entity}}Block</method>
8
+ </{{entity}}>
9
+ </observers>
10
+ </core_block_abstract_prepare_layout_after>
11
+ <catalog_product_save_after>
12
+ <observers>
13
+ <{{entity}}>
14
+ <type>singleton</type>
15
+ <class>{{module}}/adminhtml_observer</class>
16
+ <method>save{{Entity}}Data</method>
17
+ </{{entity}}>
18
+ </observers>
19
+ </catalog_product_save_after>
20
+ </events>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/07_admin.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ </adminhtml>
2
+ <admin>
3
+ <routers>
4
+ <adminhtml>
5
+ <args>
6
+ <modules>
7
+ <{{Namespace}}_{{Module}} before="Mage_Adminhtml">{{Namespace}}_{{Module}}_Adminhtml</{{Namespace}}_{{Module}}>
8
+ </modules>
9
+ </args>
10
+ </adminhtml>
11
+ </routers>
12
+ </admin>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/08_frontend.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <frontend>
2
+ <routers>
3
+ <{{module}}>
4
+ <use>standard</use>
5
+ <args>
6
+ <module>{{Namespace}}_{{Module}}</module>
7
+ <frontName>{{module}}</frontName>
8
+ </args>
9
+ </{{module}}>
10
+ </routers>
11
+ <layout>
12
+ <updates>
13
+ <{{namespace}}_{{module}}>
14
+ <file>{{namespace}}_{{module}}.xml</file>
15
+ </{{namespace}}_{{module}}>
16
+ </updates>
17
+ </layout>
18
+ <translate>
19
+ <modules>
20
+ <{{Namespace}}_{{Module}}>
21
+ <files>
22
+ <default>{{Namespace}}_{{Module}}.csv</default>
23
+ </files>
24
+ </{{Namespace}}_{{Module}}>
25
+ </modules>
26
+ </translate>
27
+ </frontend>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/09_default_top.xml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <default>
2
+ <{{module}}>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/10_default.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <{{entity}}>
2
+ <breadcrumbs>1</breadcrumbs>
3
+ {{defaults}}
4
+ </{{entity}}>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/config/11_default_footer.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ </{{module}}>
2
+ </default>
3
+ </config>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/system/01_top.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ {{License}}
3
+ <config>
4
+ <tabs>
5
+ <{{namespace}} translate="label" module="{{module}}">
6
+ <label>{{Namespace}}</label>
7
+ <sort_order>2000</sort_order>
8
+ </{{namespace}}>
9
+ </tabs>
10
+ <sections>
11
+ <{{module}} translate="label" module="{{module}}">
12
+ <class>separator-top</class>
13
+ <label>{{Module}}</label>
14
+ <tab>{{namespace}}</tab>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>100</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <groups>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/system/02_entity.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <{{entity}} translate="label" module="{{module}}">
2
+ <label>{{EntityLabel}}</label>
3
+ <frontend_type>text</frontend_type>
4
+ <sort_order>10</sort_order>
5
+ <show_in_default>1</show_in_default>
6
+ <show_in_website>1</show_in_website>
7
+ <show_in_store>1</show_in_store>
8
+ <fields>
9
+ <breadcrumbs translate="label" module="{{module}}">
10
+ <label>Use Breadcrumbs For {{EntitiesLabel}} Pages</label>
11
+ <frontend_type>select</frontend_type>
12
+ <source_model>adminhtml/system_config_source_yesno</source_model>
13
+ <sort_order>10</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+ </breadcrumbs>
18
+ {{systemAttributes}}
19
+ </fields>
20
+ </{{entity}}>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/system/03_footer.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ </groups>
2
+ </{{module}}>
3
+ </sections>
4
+ </config>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/widget/01_top.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?xml version="1.0"?>
2
+ {{License}}
3
+ <widgets>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/widget/02_entity.xml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <{{module}}_{{entity}}_view type="{{module}}/{{entity}}_widget_view" translate="name description" module="{{module}}">
2
+ <name>{{EntityLabel}} view</name>
3
+ <description>{{EntityLabel}} view widget</description>
4
+ <is_email_compatible>0</is_email_compatible>
5
+ <parameters>
6
+ <{{entity}}_id type="complex" translate="label">
7
+ <visible>1</visible>
8
+ <required>1</required>
9
+ <label>{{EntityLabel}}</label>
10
+ <type>label</type>
11
+ <helper_block>
12
+ <type>{{module}}/adminhtml_{{entity}}_widget_chooser</type>
13
+ <data>
14
+ <button translate="open">
15
+ <open>Select {{EntityLabel}}</open>
16
+ </button>
17
+ </data>
18
+ </helper_block>
19
+ <sort_order>120</sort_order>
20
+ </{{entity}}_id>
21
+ </parameters>
22
+ </{{module}}_{{entity}}_view>
23
+ <{{module}}_{{entity}}_link type="{{module}}/{{entity}}_widget_link" translate="name description" module="{{module}}">
24
+ <name>{{EntityLabel}} link</name>
25
+ <description>{{EntityLabel}} link widget</description>
26
+ <is_email_compatible>0</is_email_compatible>
27
+ <parameters>
28
+ <{{entity}}_id type="complex" translate="label">
29
+ <visible>1</visible>
30
+ <required>1</required>
31
+ <label>{{EntityLabel}}</label>
32
+ <type>label</type>
33
+ <helper_block>
34
+ <type>{{module}}/adminhtml_{{entity}}_widget_chooser</type>
35
+ <data>
36
+ <button translate="open">
37
+ <open>Select {{EntityLabel}}</open>
38
+ </button>
39
+ </data>
40
+ </helper_block>
41
+ <sort_order>130</sort_order>
42
+ </{{entity}}_id>
43
+ </parameters>
44
+ </{{module}}_{{entity}}_link>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/etc/widget/03_footer.xml ADDED
@@ -0,0 +1 @@
 
1
+ </widgets>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/01_top.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{Module}} module install script
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ $this->startSetup();
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/02_entity.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ $this->run("
2
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('{{module}}/{{entity}}')}` (
3
+ `entity_id` int(10) unsigned NOT NULL auto_increment,
4
+ {{attributeSql}}
5
+ `created_at` datetime NULL,
6
+ `updated_at` datetime NULL,
7
+ PRIMARY KEY (`entity_id`){{fks}})
8
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
9
+ ");
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/03_product_relation.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ $this->run("
3
+ CREATE TABLE {$this->getTable('{{module}}/{{entity}}_product')} (
4
+ `rel_id` int(11) unsigned NOT NULL auto_increment,
5
+ `{{entity}}_id` int(11) unsigned NOT NULL,
6
+ `product_id` int(11) unsigned NOT NULL,
7
+ `position` int(11) unsigned NOT NULL default '0',
8
+ PRIMARY KEY (`rel_id`),
9
+ UNIQUE KEY `UNIQUE_{{ENTITY}}_PRODUCT` (`{{entity}}_id`,`product_id`),
10
+ CONSTRAINT `{{MODULE}}_{{ENTITY}}_{{ENTITY}}_PRODUCT` FOREIGN KEY (`{{entity}}_id`) REFERENCES {$this->getTable('{{module}}/{{entity}}')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
11
+ CONSTRAINT `{{MODULE}}_{{ENTITY}}_PRODUCT_{{ENTITY}}` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
12
+ )
13
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
14
+ ");
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/04_sibling_relation.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $this->run("
2
+ CREATE TABLE {$this->getTable('{{module}}/{{entity}}_{{sibling}}')} (
3
+ `rel_id` int(11) unsigned NOT NULL auto_increment,
4
+ `{{entity}}_id` int(11) unsigned NOT NULL,
5
+ `{{sibling}}_id` int(11) unsigned NOT NULL,
6
+ `position` int(11) unsigned NOT NULL default '0',
7
+ PRIMARY KEY (`rel_id`),
8
+ UNIQUE KEY `UNIQUE_{{ENTITY}}_{{SIBLING}}` (`{{entity}}_id`,`{{sibling}}_id`),
9
+ CONSTRAINT `{{MODULE}}_{{ENTITY}}_{{ENTITY}}_{{SIBLING}}` FOREIGN KEY (`{{entity}}_id`) REFERENCES {$this->getTable('{{module}}/{{entity}}')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
10
+ CONSTRAINT `{{MODULE}}_{{ENTITY}}_{{SIBLING}}_{{ENTITY}}` FOREIGN KEY (`{{sibling}}_id`) REFERENCES {$this->getTable('{{module}}/{{sibling}}')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
11
+ )
12
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
13
+ ");
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/code/codepool/Namespace/Module/sql/namespace_module_setup/mysql4-install-0.0.1/05_footer.php ADDED
@@ -0,0 +1 @@
 
1
+ $this->endSetup();
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/01_top.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?xml version="1.0"?>
2
+ {{License}}
3
+ <layout>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/02_entity.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- {{EntitiesLabel}} grid action -->
2
+ <adminhtml_{{entity}}_index>
3
+ <reference name="menu">
4
+ <action method="setActive">
5
+ <menupath>{{module}}/{{entity}}</menupath>
6
+ </action>
7
+ </reference>
8
+ <reference name="content">
9
+ <block type="{{module}}/adminhtml_{{entity}}" name="{{entity}}" />
10
+ </reference>
11
+ </adminhtml_{{entity}}_index>
12
+ <adminhtml_{{entity}}_grid>
13
+ <remove name="root"/>
14
+ <block type="{{module}}/adminhtml_{{entity}}_grid" name="{{entity}}_grid" output="toHtml" />
15
+ </adminhtml_{{entity}}_grid>
16
+ <!-- {{Entity}} add/edit action -->
17
+ <adminhtml_{{entity}}_edit>
18
+ <update handle="editor"/>
19
+ <reference name="menu">
20
+ <action method="setActive">
21
+ <menupath>{{module}}/{{entity}}</menupath>
22
+ </action>
23
+ </reference>
24
+ <reference name="content">
25
+ <block type="{{module}}/adminhtml_{{entity}}_edit" name="{{entity}}_edit"></block>
26
+ </reference>
27
+ <reference name="left">
28
+ <block type="{{module}}/adminhtml_{{entity}}_edit_tabs" name="{{entity}}_tabs"></block>
29
+ </reference>
30
+ </adminhtml_{{entity}}_edit>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/03_relation_product.xml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <adminhtml_{{entity}}_catalog_product_{{entities}}>
2
+ <block type="core/text_list" name="root" output="toHtml">
3
+ <block type="{{module}}/adminhtml_catalog_product_edit_tab_{{entity}}" name="product.edit.tab.{{entity}}"/>
4
+ <block type="adminhtml/widget_grid_serializer" name="{{entity}}_grid_serializer">
5
+ <reference name="{{entity}}_grid_serializer">
6
+ <action method="initSerializerBlock">
7
+ <grid_block_name>product.edit.tab.{{entity}}</grid_block_name>
8
+ <data_callback>getSelected{{Entities}}</data_callback>
9
+ <hidden_input_name>{{entities}}</hidden_input_name>
10
+ <reload_param_name>product_{{entities}}</reload_param_name>
11
+ </action>
12
+ <action method="addColumnInputName">
13
+ <input_name>position</input_name>
14
+ </action>
15
+ </reference>
16
+ </block>
17
+ </block>
18
+ </adminhtml_{{entity}}_catalog_product_{{entities}}>
19
+ <adminhtml_{{entity}}_catalog_product_{{entities}}grid>
20
+ <block type="core/text_list" name="root" output="toHtml">
21
+ <block type="{{module}}/adminhtml_catalog_product_edit_tab_{{entity}}" name="product.edit.tab.{{entity}}"/>
22
+ </block>
23
+ </adminhtml_{{entity}}_catalog_product_{{entities}}grid>
24
+ <adminhtml_{{entity}}_products>
25
+ <block type="core/text_list" name="root" output="toHtml">
26
+ <block type="{{module}}/adminhtml_{{entity}}_edit_tab_product" name="{{entity}}.edit.tab.product"/>
27
+ <block type="adminhtml/widget_grid_serializer" name="product_grid_serializer">
28
+ <reference name="product_grid_serializer">
29
+ <action method="initSerializerBlock">
30
+ <grid_block_name>{{entity}}.edit.tab.product</grid_block_name>
31
+ <data_callback>getSelectedProducts</data_callback>
32
+ <hidden_input_name>products</hidden_input_name>
33
+ <reload_param_name>{{entity}}_products</reload_param_name>
34
+ </action>
35
+ <action method="addColumnInputName">
36
+ <input_name>position</input_name>
37
+ </action>
38
+ </reference>
39
+ </block>
40
+ </block>
41
+ </adminhtml_{{entity}}_products>
42
+ <adminhtml_{{entity}}_productsgrid>
43
+ <block type="core/text_list" name="root" output="toHtml">
44
+ <block type="{{module}}/adminhtml_{{entity}}_edit_tab_product" name="{{entity}}.edit.tab.product"/>
45
+ </block>
46
+ </adminhtml_{{entity}}_productsgrid>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/04_relation_sibling.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <adminhtml_{{entity}}_{{siblings}}>
2
+ <block type="core/text_list" name="root" output="toHtml">
3
+ <block type="{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}" name="{{entity}}.edit.tab.{{sibling}}"/>
4
+ <block type="adminhtml/widget_grid_serializer" name="{{sibling}}_grid_serializer">
5
+ <reference name="{{sibling}}_grid_serializer">
6
+ <action method="initSerializerBlock">
7
+ <grid_block_name>{{entity}}.edit.tab.{{sibling}}</grid_block_name>
8
+ <data_callback>getSelected{{Sibling}}</data_callback>
9
+ <hidden_input_name>{{siblings}}</hidden_input_name>
10
+ <reload_param_name>{{entity}}_{{siblings}}</reload_param_name>
11
+ </action>
12
+ <action method="addColumnInputName">
13
+ <input_name>position</input_name>
14
+ </action>
15
+ </reference>
16
+ </block>
17
+ </block>
18
+ </adminhtml_{{entity}}_{{siblings}}>
19
+ <adminhtml_{{entity}}_{{sibling}}sgrid>
20
+ <block type="core/text_list" name="root" output="toHtml">
21
+ <block type="{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}" name="{{entity}}.edit.tab.{{sibling}}"/>
22
+ </block>
23
+ </adminhtml_{{entity}}_{{siblings}}grid>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/adminhtml/default/default/layout/namespace_module/05_footer.xml ADDED
@@ -0,0 +1 @@
 
1
+ </layout>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/01_top.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?xml version="1.0"?>
2
+ {{License}}
3
+ <layout>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/02_default_top.xml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <default>
2
+ <reference name="footer_links">
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/03_default.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <action method="addLink" translate="label title" module="{{module}}">
2
+ <label>{{EntitiesLabel}}</label>
3
+ <url helper="{{module}}/get{{Entities}}Url" />
4
+ <title>{{EntitiesLabel}}</title>
5
+ <prepare />
6
+ <urlParams/>
7
+ <position>120</position>
8
+ </action>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/04_default_footer.xml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ </reference>
2
+ </default>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/05_list.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <{{module}}_{{entity}}_index translate="label" module="{{module}}">
2
+ <label>{{EntitiesLabel}} list</label>
3
+ <reference name="root">
4
+ <action method="setTemplate"><template>{{listLayout}}</template></action>
5
+ </reference>
6
+ <reference name="content">
7
+ <block type="{{module}}/{{entity}}_list" name="{{entity}}_list" template="{{namespace}}_{{module}}/{{entity}}/list.phtml" />
8
+ </reference>
9
+ </{{module}}_{{entity}}_index>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/06_view.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <{{module}}_{{entity}}_view translate="label" module="{{module}}">
2
+ <label>{{EntityLabel}} view page</label>
3
+ <reference name="root">
4
+ <action method="setTemplate"><template>{{viewLayout}}</template></action>
5
+ </reference>
6
+ <reference name="content">
7
+ <block type="{{module}}/{{entity}}_view" name="{{entity}}_view" template="{{namespace}}_{{module}}/{{entity}}/view.phtml" />
8
+ {{EntityViewRelationLayout}}</reference>
9
+ </{{module}}_{{entity}}_view>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/07_entity_rss.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <{{module}}_{{entity}}_rss translate="label" module="{{module}}">
2
+ <label>{{EntitiesLabel}} rss feed</label>
3
+ <block type="{{module}}/{{entity}}_rss" output="toHtml" name="{{module}}.{{entity}}.rss" />
4
+ </{{module}}_{{entity}}_rss>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/08_rss_top.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <rss_index_index>
2
+ <reference name="content">
3
+ <block type="{{module}}/rss" name="{{module}}.rss" template="{{namespace}}_{{module}}/rss.phtml">
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/09_rss.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <action method="addFeed" ifconfig="{{module}}/{{entity}}/rss" translate="label" module="{{module}}">
2
+ <label>{{EntitiesLabel}}</label>
3
+ <url helper="{{module}}/{{entity}}/getRssUrl" />
4
+ </action>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/10_rss_footer.xml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ </block>
2
+ </reference>
3
+ </rss_index_index>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/11_relation_product.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <catalog_product_view>
2
+ <reference name="product.info">
3
+ <block type="{{module}}/catalog_product_list_{{entity}}" name="product.info.{{entities}}" as="product_{{entities}}" template="{{namespace}}_{{module}}/catalog/product/list/{{entity}}.phtml">
4
+ <action method="addToParentGroup"><group>detailed_info</group></action>
5
+ <action method="setTitle" translate="value" module="{{module}}"><value>{{EntitiesLabel}}</value></action>
6
+ </block>
7
+ </reference>
8
+ </catalog_product_view>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/layout/namespace_module/12_footer.xml ADDED
@@ -0,0 +1 @@
 
1
+ </layout>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/01_top.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} list template on product page
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ ?>
11
+ <?php ${{entities}} = $this->get{{Entity}}Collection();?>
12
+ <?php if (${{entities}}->count() > 0) :?>
13
+ <div class="box-collateral box-{{entities}} box-up-sell">
14
+ <?php foreach (${{entities}} as ${{entity}}) : ?>
15
+ <div class="item">
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/02_link_top.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <a href="<?php echo ${{entity}}->get{{Entity}}Url()?>">
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/03_name.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <?php echo ${{entity}}->get{{EntityNameMagicCode}}();?><br />
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/04_link_footer.phtml ADDED
@@ -0,0 +1 @@
 
1
+ </a>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/catalog/product/list/entity/05_footer.phtml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ </div>
2
+ <?php endforeach; ?>
3
+ </div>
4
+ <?php endif;?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/catalog/product/list/01_content.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} product list template
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ ?>
11
+ <?php $products = $this->getProductCollection();?>
12
+ <?php if ($products->count() > 0) :?>
13
+ <h2><?php echo Mage::helper('catalog')->__('Products');?></h2>
14
+ <div class="box-collateral box-products box-up-sell">
15
+ <?php foreach ($products as $product) : ?>
16
+ <div class="item">
17
+ <a href="<?php echo $product->getProductUrl()?>">
18
+ <?php echo $product->getName();?><br />
19
+ </a>
20
+ </div>
21
+ <?php endforeach; ?>
22
+ </div>
23
+ <?php endif;?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/list/01_top.phtml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} list template
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ ?>
11
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
12
+ <?php $_{{entities}} = $this->get{{Entities}}(); ?>
13
+ <div class="page-title {{entity}}-title">
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/list/02_rss_link.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php if(Mage::helper('{{module}}/{{entity}}')->isRssEnabled()) : ?>
2
+ <a href="<?php echo Mage::helper('{{module}}/{{entity}}')->getRssUrl();?>" class="link-rss"><?php echo Mage::helper('{{module}}')->__('Subscribe to RSS Feed')?></a>
3
+ <?php endif;?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/list/03_footer.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h1><?php echo Mage::helper('{{module}}')->__('{{EntitiesLabel}}') ?></h1>
2
+ </div>
3
+ <?php if ($_{{entities}}->getSize() > 0) :?>
4
+ <?php echo $this->getPagerHtml(); ?>
5
+ <div class="{{entity}}-list-container">
6
+ <?php foreach ($_{{entities}} as $_{{entity}}) : ?>
7
+ <div class="{{entity}}-list-item">
8
+ {{EntityListItem}}
9
+ </div>
10
+ <?php endforeach;?>
11
+ </div>
12
+ <?php echo $this->getPagerHtml(); ?>
13
+ <?php else : ?>
14
+ <?php echo Mage::helper('{{module}}')->__('There are no {{entitiesLabel}} at this moment');?>
15
+ <?php endif;?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/sibling/child/list/01_content.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{Entity}} {{SiblingLabel}} list template
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ ?>
11
+ <?php $_{{siblings}} = $this->get{{Siblings}}(); ?>
12
+ <?php if ($_{{siblings}}->getSize() > 0) :?>
13
+ <div class="page-title {{sibling}}-title">
14
+ <h2><?php echo Mage::helper('{{module}}')->__('{{SiblingsLabel}}') ?>:<?php echo $this->get{{Entity}}()->get{{EntityNameMagicCode}}();?></h2>
15
+ </div>
16
+ <div class="{{siblings}}-list-container">
17
+ <?php foreach ($_{{siblings}} as $_{{sibling}}) : ?>
18
+ <div class="{{sibling}}-list-item">
19
+ {{SiblingListItem}}
20
+ </div>
21
+ <?php endforeach;?>
22
+ </div>
23
+ <?php endif;?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/sibling/list/01_content.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{Entity}} {{SiblingLabel}} list template
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ ?>
11
+ <?php $_{{siblings}} = $this->get{{Siblings}}(); ?>
12
+ <?php if ($_{{siblings}}->getSize() > 0) :?>
13
+ <div class="page-title {{sibling}}-title">
14
+ <h2><?php echo Mage::helper('{{module}}')->__('{{SiblingsLabel}}') ?>:<?php echo $this->get{{Entity}}()->get{{EntityNameMagicCode}}();?></h2>
15
+ </div>
16
+ <div class="{{siblings}}-list-container">
17
+ <?php foreach ($_{{siblings}} as $_{{sibling}}) : ?>
18
+ <div class="{{sibling}}-list-item">
19
+ {{SiblingListItem}}
20
+ </div>
21
+ <?php endforeach;?>
22
+ </div>
23
+ <?php endif;?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/view/01_content.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} view template
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ ?>
11
+ <?php $_{{entity}} = $this->getCurrent{{Entity}}();?>
12
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
13
+ <div class="page-title {{entity}}-title">
14
+ <h1><?php echo $_{{entity}}->get{{EntityNameMagicCode}}(); ?></h1>
15
+ </div>
16
+ <div class="{{entity}}-view">
17
+ {{EntityViewAttributes}}
18
+ </div>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/widget/link/01_content.phtml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} link widget template
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ ?>
11
+ <?php $_{{entity}} = $this->getCurrent{{Entity}}();?>
12
+ <?php if ($_{{entity}}) :?>
13
+ <div class="{{entity}}-widget-link">
14
+ <a href="<?php echo $_{{entity}}->get{{Entity}}Url()?>"><?php echo $_{{entity}}->get{{EntityNameMagicCode}}()?></a>
15
+ </div>
16
+ <?php endif;?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/entity/widget/view/01_content.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{EntityLabel}} view widget template
5
+ *
6
+ * @category {{Namespace}}
7
+ * @package {{Namespace}}_{{Module}}
8
+ * {{qwertyuiop}}
9
+ */
10
+ ?>
11
+ <?php $_{{entity}} = $this->getCurrent{{Entity}}();?>
12
+ <?php if ($_{{entity}}) :?>
13
+ <div class="{{entity}}-widget-view">
14
+ <h3><?php echo $_{{entity}}->get{{EntityNameMagicCode}}()?></h3>
15
+ <div>
16
+ {{EntityViewWidgetAttributes}}
17
+ </div>
18
+ </div>
19
+ <?php endif;?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/design/frontend/base/default/template/namespace_module/rss/01_content.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ {{License}}
3
+ /**
4
+ * {{module}} rss feeds block
5
+ * @category {{Namespace}}
6
+ * @package {{Namespace}}_{{Module}}
7
+ * {{qwertyuiop}}
8
+ */
9
+ ?>
10
+ <?php $_feeds = $this->getFeeds();?>
11
+ <?php if ($_feeds): ?>
12
+ <table class="data-table rss-table" id="rss-table-{{module}}" style="margin-top:20px">
13
+ <col />
14
+ <col width="1" />
15
+ <thead>
16
+ <tr>
17
+ <th colspan="2"><?php echo Mage::helper('{{module}}')->__('{{Module}} Feeds') ?></th>
18
+ </tr>
19
+ </thead>
20
+ <tbody>
21
+ <?php foreach ($_feeds as $_feed): ?>
22
+ <tr>
23
+ <td><?php echo $_feed->getLabel() ?></td>
24
+ <td><a href="<?php echo $_feed->getUrl() ?>" class="link-rss"><?php echo Mage::helper('{{module}}')->__('Get Feed'); ?></a></td>
25
+ </tr>
26
+ <?php endforeach; ?>
27
+ </tbody>
28
+ </table>
29
+ <?php endif; ?>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/etc/modules/Namespace_Module/01_content.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ {{License}}
3
+ <config>
4
+ <modules>
5
+ <{{Namespace}}_{{Module}}>
6
+ <active>true</active>
7
+ <codePool>{{codepool}}</codePool>
8
+ <depends>
9
+ <Mage_Core />
10
+ </depends>
11
+ </{{Namespace}}_{{Module}}>
12
+ </modules>
13
+ </config>
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/01_global.csv ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Yes","Yes"
2
+ "No","No"
3
+ "Save And Continue Edit","Save And Continue Edit"
4
+ "Id","Id"
5
+ "Action","Action"
6
+ "Edit","Edit"
7
+ "CSV","CSV"
8
+ "Excel","Excel"
9
+ "XML","XML"
10
+ "Delete","Delete"
11
+ "Are you sure?","Are you sure?"
12
+ "Home","Home"
13
+ "None","None"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/02_entity.csv ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "{{EntityLabel}}","{{EntityLabel}}"
2
+ "Save {{EntityLabel}}","Save {{EntityLabel}}"
3
+ "Delete {{EntityLabel}}","Delete {{EntityLabel}}"
4
+ "Edit {{EntityLabel}} '%s'","Edit {{EntityLabel}} '%s'"
5
+ "Add {{EntityLabel}}","Add {{EntityLabel}}"
6
+ "{{EntitiesLabel}}","{{EntitiesLabel}}"
7
+ "This {{entityLabel}} no longer exists.","This {{entityLabel}} no longer exists."
8
+ "{{EntityLabel}} was successfully saved","{{EntityLabel}} was successfully saved"
9
+ "There was a problem saving the {{entityLabel}}.","There was a problem saving the {{entityLabel}}."
10
+ "Unable to find {{entityLabel}} to save.","Unable to find {{entityLabel}} to save."
11
+ "{{EntityLabel}} was successfully deleted.","{{EntityLabel}} was successfully deleted."
12
+ "There was an error deleteing {{entityLabel}}.","There was an error deleteing {{entityLabel}}."
13
+ "Could not find {{entityLabel}} to delete.","Could not find {{entityLabel}} to delete."
14
+ "Please select {{entitiesLabel}} to delete.","Please select {{entitiesLabel}} to delete."
15
+ "Total of %d {{entitiesLabel}} were successfully deleted.","Total of %d {{entitiesLabel}} were successfully deleted."
16
+ "There was an error deleteing {{entitiesLabel}}.","There was an error deleteing {{entitiesLabel}}."
17
+ "Total of %d {{entitiesLabel}} were successfully updated.","Total of %d {{entitiesLabel}} were successfully updated."
18
+ "There was an error updating {{entitiesLabel}}.","There was an error updating {{entitiesLabel}}."
19
+ "Please select {{entitiesLabel}}.","Please select {{entitiesLabel}}."
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/03_attribute.csv ADDED
@@ -0,0 +1,2 @@
 
 
1
+ "{{attributeLabel}}","{{attributeLabel}}"
2
+ "{{attributeNote}}","{{attributeNote}}"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/04_global_status.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ "Status","Status"
2
+ "Enabled","Enabled"
3
+ "Disabled","Disabled"
4
+ "Change status","Change status"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/05_global_rss.csv ADDED
@@ -0,0 +1 @@
 
1
+ "Show in rss","Show in rss"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/06_global_seo.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Meta-title","Meta-title"
2
+ "Meta-description","Meta-description"
3
+ "Meta-keywords","Meta-keywords"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/07_attribute_yesno.csv ADDED
@@ -0,0 +1 @@
 
1
+ "Change {{attributeLabel}}","Change {{attributeLabel}}"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/08_global_file.csv ADDED
@@ -0,0 +1 @@
 
1
+ "Delete File","Delete File"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/09_product_relation.csv ADDED
@@ -0,0 +1,2 @@
 
 
1
+ "Associated products","Associated products"
2
+ "Position","Position"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/app/locale/en_US/Namespace_Module/10_relations.csv ADDED
@@ -0,0 +1,2 @@
 
 
1
+ "Position","Position"
2
+ "Change {{SiblingLabel}}","Change {{SiblingLabel}}"
app/code/community/Ultimate/ModuleCreator/etc/modulecreator/skin/frontend/base/default/images/placeholder/entity.jpg ADDED
Binary file
app/code/community/Ultimate/ModuleCreator/etc/system.xml ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Ultimate_ModuleCreator extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE_UMC.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Ultimate
14
+ * @package Ultimate_ModuleCreator
15
+ * @copyright Copyright (c) 2012
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ /**
19
+ * @category Ultimate
20
+ * @package Ultimate_ModuleCreator
21
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
22
+ */
23
+ -->
24
+ <config>
25
+ <tabs>
26
+ <ultimate translate="label" module="modulecreator">
27
+ <label>Module creator</label>
28
+ <sort_order>1500</sort_order>
29
+ </ultimate>
30
+ </tabs>
31
+ <sections>
32
+ <modulecreator translate="label" module="modulecreator">
33
+ <class>separator-top</class>
34
+ <label>Module creator</label>
35
+ <tab>ultimate</tab>
36
+ <frontend_type>text</frontend_type>
37
+ <sort_order>10</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>0</show_in_website>
40
+ <show_in_store>0</show_in_store>
41
+ <groups>
42
+ <settings translate="label" module="modulecreator">
43
+ <label>Default settings</label>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>10</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>0</show_in_website>
48
+ <show_in_store>0</show_in_store>
49
+ <fields>
50
+ <namespace translate="label" module="modulecreator">
51
+ <label>Default namespace</label>
52
+ <frontend_type>text</frontend_type>
53
+ <sort_order>10</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>0</show_in_website>
56
+ <show_in_store>0</show_in_store>
57
+ </namespace>
58
+ <codepool translate="label" module="modulecreator">
59
+ <label>Default codepool</label>
60
+ <frontend_type>select</frontend_type>
61
+ <source_model>modulecreator/adminhtml_system_config_source_codepool</source_model>
62
+ <sort_order>20</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>0</show_in_website>
65
+ <show_in_store>0</show_in_store>
66
+ </codepool>
67
+ <install translate="label" module="modulecreator">
68
+ <label>Default install setting</label>
69
+ <frontend_type>select</frontend_type>
70
+ <source_model>modulecreator/adminhtml_system_config_source_install</source_model>
71
+ <sort_order>30</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>0</show_in_website>
74
+ <show_in_store>0</show_in_store>
75
+ </install>
76
+ <license translate="label comment" module="modulecreator">
77
+ <label>Default licence</label>
78
+ <frontend_type>textarea</frontend_type>
79
+ <sort_order>40</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>0</show_in_website>
82
+ <show_in_store>0</show_in_store>
83
+ <comment>Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} for current year</comment>
84
+ </license>
85
+ </fields>
86
+ </settings>
87
+ <entity_defaults translate="label" module="modulecreator">
88
+ <label>Entity default settings</label>
89
+ <frontend_type>text</frontend_type>
90
+ <sort_order>20</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>0</show_in_website>
93
+ <show_in_store>0</show_in_store>
94
+ <fields>
95
+ <use_frontend translate="label" module="modulecreator">
96
+ <label>Create frontend files</label>
97
+ <frontend_type>select</frontend_type>
98
+ <source_model>adminhtml/system_config_source_yesno</source_model>
99
+ <sort_order>10</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>0</show_in_website>
102
+ <show_in_store>0</show_in_store>
103
+ </use_frontend>
104
+ <frontend_list translate="label" module="modulecreator">
105
+ <label>Create frontend list files</label>
106
+ <frontend_type>select</frontend_type>
107
+ <source_model>adminhtml/system_config_source_yesno</source_model>
108
+ <sort_order>20</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>0</show_in_website>
111
+ <show_in_store>0</show_in_store>
112
+ </frontend_list>
113
+ <frontend_list_template translate="label" module="modulecreator">
114
+ <label>Default entity frontend list layout</label>
115
+ <frontend_type>select</frontend_type>
116
+ <source_model>modulecreator/adminhtml_system_config_source_layout</source_model>
117
+ <sort_order>30</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>0</show_in_website>
120
+ <show_in_store>0</show_in_store>
121
+ </frontend_list_template>
122
+ <frontend_view translate="label" module="modulecreator">
123
+ <label>Create frontend view files</label>
124
+ <frontend_type>select</frontend_type>
125
+ <source_model>adminhtml/system_config_source_yesno</source_model>
126
+ <sort_order>40</sort_order>
127
+ <show_in_default>1</show_in_default>
128
+ <show_in_website>0</show_in_website>
129
+ <show_in_store>0</show_in_store>
130
+ </frontend_view>
131
+ <frontend_view_template translate="label" module="modulecreator">
132
+ <label>Default entity frontend view layout</label>
133
+ <frontend_type>select</frontend_type>
134
+ <source_model>modulecreator/adminhtml_system_config_source_layout</source_model>
135
+ <sort_order>50</sort_order>
136
+ <show_in_default>1</show_in_default>
137
+ <show_in_website>0</show_in_website>
138
+ <show_in_store>0</show_in_store>
139
+ </frontend_view_template>
140
+ <frontend_add_seo translate="label" module="modulecreator">
141
+ <label>Add SEO attributes</label>
142
+ <frontend_type>select</frontend_type>
143
+ <source_model>adminhtml/system_config_source_yesno</source_model>
144
+ <sort_order>60</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>0</show_in_website>
147
+ <show_in_store>0</show_in_store>
148
+ </frontend_add_seo>
149
+ <created_to_grid translate="label" module="modulecreator">
150
+ <label>Add "Created at" to admin grid</label>
151
+ <frontend_type>select</frontend_type>
152
+ <source_model>adminhtml/system_config_source_yesno</source_model>
153
+ <sort_order>70</sort_order>
154
+ <show_in_default>1</show_in_default>
155
+ <show_in_website>0</show_in_website>
156
+ <show_in_store>0</show_in_store>
157
+ </created_to_grid>
158
+ <updated_to_grid translate="label" module="modulecreator">
159
+ <label>Add "Updated at" to admin grid</label>
160
+ <frontend_type>select</frontend_type>
161
+ <source_model>adminhtml/system_config_source_yesno</source_model>
162
+ <sort_order>80</sort_order>
163
+ <show_in_default>1</show_in_default>
164
+ <show_in_website>0</show_in_website>
165
+ <show_in_store>0</show_in_store>
166
+ </updated_to_grid>
167
+ <add_status translate="label" module="modulecreator">
168
+ <label>Add "Status" field</label>
169
+ <frontend_type>select</frontend_type>
170
+ <source_model>adminhtml/system_config_source_yesno</source_model>
171
+ <sort_order>90</sort_order>
172
+ <show_in_default>1</show_in_default>
173
+ <show_in_website>0</show_in_website>
174
+ <show_in_store>0</show_in_store>
175
+ </add_status>
176
+ <rss translate="label" module="modulecreator">
177
+ <label>Create RSS feed</label>
178
+ <frontend_type>select</frontend_type>
179
+ <source_model>adminhtml/system_config_source_yesno</source_model>
180
+ <sort_order>110</sort_order>
181
+ <show_in_default>1</show_in_default>
182
+ <show_in_website>0</show_in_website>
183
+ <show_in_store>0</show_in_store>
184
+ </rss>
185
+ <widget translate="label" module="modulecreator">
186
+ <label>Create Link/View widget</label>
187
+ <frontend_type>select</frontend_type>
188
+ <source_model>adminhtml/system_config_source_yesno</source_model>
189
+ <sort_order>110</sort_order>
190
+ <show_in_default>1</show_in_default>
191
+ <show_in_website>0</show_in_website>
192
+ <show_in_store>0</show_in_store>
193
+ </widget>
194
+ <link_product translate="label" module="modulecreator">
195
+ <label>Link "many to many" with prodcts</label>
196
+ <frontend_type>select</frontend_type>
197
+ <source_model>adminhtml/system_config_source_yesno</source_model>
198
+ <sort_order>120</sort_order>
199
+ <show_in_default>1</show_in_default>
200
+ <show_in_website>0</show_in_website>
201
+ <show_in_store>0</show_in_store>
202
+ </link_product>
203
+ <show_on_product translate="label" module="modulecreator">
204
+ <label>Show associated entities on product page</label>
205
+ <frontend_type>select</frontend_type>
206
+ <source_model>adminhtml/system_config_source_yesno</source_model>
207
+ <sort_order>130</sort_order>
208
+ <show_in_default>1</show_in_default>
209
+ <show_in_website>0</show_in_website>
210
+ <show_in_store>0</show_in_store>
211
+ </show_on_product>
212
+ <show_products translate="label" module="modulecreator">
213
+ <label>Show associated product on entity page</label>
214
+ <frontend_type>select</frontend_type>
215
+ <source_model>adminhtml/system_config_source_yesno</source_model>
216
+ <sort_order>140</sort_order>
217
+ <show_in_default>1</show_in_default>
218
+ <show_in_website>0</show_in_website>
219
+ <show_in_store>0</show_in_store>
220
+ </show_products>
221
+ </fields>
222
+ </entity_defaults>
223
+ </groups>
224
+ </modulecreator>
225
+ </sections>
226
+ </config>
app/design/adminhtml/default/default/layout/ultimate_modulecreator.xml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Ultimate_ModuleCreator extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE_UMC.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Ultimate
14
+ * @package Ultimate_ModuleCreator
15
+ * @copyright Copyright (c) 2012
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ /**
19
+ * @category Ultimate
20
+ * @package Ultimate_ModuleCreator
21
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
22
+ */
23
+ -->
24
+ <layout>
25
+ <adminhtml_modulecreator_index>
26
+ <reference name="menu">
27
+ <action method="setActive">
28
+ <menupath>system/modulecreator</menupath>
29
+ </action>
30
+ </reference>
31
+ <reference name="content">
32
+ <block type="modulecreator/adminhtml_modulecreator" name="modules_list"/>
33
+ </reference>
34
+ </adminhtml_modulecreator_index>
35
+ <adminhtml_modulecreator_grid>
36
+ <block type="core/text_list" name="root">
37
+ <block type="modulecreator/adminhtml_modulecreator_grid" name="modules_list"/>
38
+ </block>
39
+ </adminhtml_modulecreator_grid>
40
+ <adminhtml_modulecreator_edit>
41
+ <reference name="menu">
42
+ <action method="setActive">
43
+ <menupath>system/modulecreator</menupath>
44
+ </action>
45
+ </reference>
46
+ <reference name="head">
47
+ <action method="addCss"><name>ultimate_modulecreator.css</name></action>
48
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
49
+ <action method="addCss"><css>lib/prototype/windows/themes/magento.css</css></action>
50
+ </reference>
51
+ <reference name="left">
52
+ <block type="modulecreator/adminhtml_modulecreator_edit_tabs" name="modulecreator_edit_tabs">
53
+ <action method="addTab"><name>settings</name><block>modulecreator/adminhtml_modulecreator_edit_tab_settings</block></action>
54
+ <action method="addTab"><name>entities</name><block>modulecreator/adminhtml_modulecreator_edit_tab_entities</block></action>
55
+ <action method="addTab"><name>relations</name><block>modulecreator/adminhtml_modulecreator_edit_tab_relation</block></action>
56
+ <action method="addTab"><name>help</name><block>modulecreator/adminhtml_modulecreator_edit_tab_help</block></action>
57
+ </block>
58
+ </reference>
59
+ <reference name="content">
60
+ <block type="modulecreator/adminhtml_modulecreator_edit"></block>
61
+ </reference>
62
+ </adminhtml_modulecreator_edit>
63
+ </layout>
app/design/adminhtml/default/default/template/ultimate_modulecreator/edit.phtml ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * @category Ultimate
19
+ * @package Ultimate_ModuleCreator
20
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
21
+ */
22
+ ?>
23
+ <div class="content-header">
24
+ <h3 class="icon-head"><?php echo $this->getHeaderText() ?></h3>
25
+ <p class="content-buttons form-buttons"><?php echo $this->getBackButtonHtml() ?>
26
+ <?php echo $this->getCancelButtonHtml() ?>
27
+ <?php if (!$this->isReadonly()) :?>
28
+ <?php echo $this->getSaveButtonHtml() ?>
29
+ <?php echo $this->getSaveAndEditButtonHtml() ?>
30
+ <?php endif;?>
31
+ </p>
32
+ </div>
33
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="edit_form" enctype="multipart/form-data">
34
+ <?php echo $this->getBlockHtml('formkey')?>
35
+ <div style="display:none"></div>
36
+ </form>
37
+ <script type="text/javascript">
38
+ //<![CDATA[
39
+ var moduleForm = new varienForm('edit_form', '<?php echo $this->getValidationUrl() ?>');
40
+ var templateSyntax = /(^|.|\r|\n)({{(\w+)}})/;
41
+ moduleForm._processValidationResult = function(transport) {
42
+ var response = transport.responseText.evalJSON();
43
+ if (response.error){
44
+ var errors = response.errors;
45
+ var globalErrors = '';
46
+ for (var i = 0;i<errors.length;i++){
47
+ if (errors[i].field && $(errors[i].field)){
48
+ $(errors[i].field).setHasError(true, moduleForm);
49
+ Validation.ajaxError($(errors[i].field), errors[i].message);
50
+ if (!Prototype.Browser.IE){
51
+ $(errors[i].field).focus();
52
+ }
53
+ }
54
+ else{
55
+ globalErrors += '<li>' + errors[i].message + '</li>';
56
+ }
57
+ }
58
+ if (globalErrors != '' && $('messages')){
59
+ $('messages').innerHTML = '<ul class="messages"><li class="error-msg"><ul>' + globalErrors + '</ul></li></ul>';
60
+ $('messages').show();
61
+ }
62
+ }
63
+ else{
64
+ if (response.modified){
65
+ var content = '<b><?php echo Mage::helper('modulecreator')->__('The following files have been modified outside the Magento context. If you choose to continue all modifications will be overwritten.')?></b>';
66
+ content += '<ul style="padding:10px 30px;list-style-type:disc">';
67
+ for (var i = 0; i< response.modified_files.length;i++){
68
+ content += '<li>' + response.modified_files[i] + '</li>';
69
+ }
70
+ content += '</ul>';
71
+ Dialog.confirm(content, {
72
+ className:'magento',
73
+ width:500,
74
+ okLabel: "<?php echo Mage::helper('modulecreator')->__('Continue')?>",
75
+ buttonClass: "scalable",
76
+ id: "modified-files",
77
+ cancel:function(win) {
78
+
79
+ },
80
+ ok:function(win) {
81
+ moduleForm._submit();
82
+ }
83
+ });
84
+ }
85
+ else{
86
+ moduleForm._submit();
87
+ }
88
+ }
89
+ };
90
+ function saveAndContinueEdit(urlTemplate) {
91
+ var template = new Template(urlTemplate, templateSyntax);
92
+ var url = template.evaluate({tab_id:modulecreator_info_tabsJsTabs.activeTab.id});
93
+ var advices = $$('div.validation-advice');
94
+ for (var i = 0; i<advices.length;i++){
95
+ advices[i].remove();
96
+ }
97
+ if ($('messages')){
98
+ $('messages').hide();
99
+ }
100
+ moduleForm.submit(url);
101
+ }
102
+ function showMenuOrder(includeSelect){
103
+ new Ajax.Request('<?php echo Mage::helper('adminhtml')->getUrl('*/*/menuOrder')?>',
104
+ {
105
+ method:'get',
106
+ onSuccess: function(transport){
107
+ var menuTemplate = '<tr><td>#{label}</td><td>#{sort_order}</td></tr>';
108
+ var text = '<table style="margin: 0 auto;"><tr><th style="width:300px"><?php echo Mage::helper('modulecreator')->__('Menu item'); ?></th><th style="width:100px"><?php echo Mage::helper('modulecreator')->__('Sort order'); ?></th></tr>';
109
+ var template = '';
110
+ var mean = 'a';
111
+ var response = transport.responseText.evalJSON();
112
+ for (var i = 0; i< response.length; i++){
113
+ if (includeSelect){
114
+ if (i >0){
115
+ if (response[i].sort_order != response[i-1].sort_order){
116
+ mean = Math.ceil((response[i].sort_order + response[i-1].sort_order)/2);
117
+ text += '<tr><td colspan="2" style="text-align:center;font-size:10px"><a href="#" onclick="$(\'settings_sort_order\').value = \'' + mean +'\';Dialog.okCallback();return false"><?php echo Mage::helper('modulecreator')->__('Insert here')?></a></td></tr>';
118
+ }
119
+ }
120
+ else{
121
+ mean = Math.ceil((response[i].sort_order)/2);
122
+ text += '<tr><td colspan="2" style="text-align:center;font-size:10px"><a href="#" onclick="$(\'settings_sort_order\').value = \'' + mean +'\';Dialog.okCallback();return false"><?php echo Mage::helper('modulecreator')->__('Insert here')?></a></td></tr>';
123
+ }
124
+ }
125
+ template = new Template('<tr><td>#{label}</td><td>#{sort_order}</td></tr>');
126
+ text += template.evaluate(response[i]);
127
+ }
128
+ if (includeSelect == 1){
129
+ mean = (response[response.length - 1].sort_order) + 20;
130
+ text += '<tr><td colspan="2" style="text-align:center;font-size:10px"><a href="#" onclick="$(\'settings_sort_order\').value = \'' + mean +'\';Dialog.okCallback();return false"><?php echo Mage::helper('modulecreator')->__('Insert here')?></a></td></tr>';
131
+ }
132
+ text += '</table>';
133
+ Dialog.alert(text, {
134
+ className:'magento',
135
+ width:500,
136
+ height: 500,
137
+ okLabel: "<?php echo Mage::helper('modulecreator')->__('Close')?>",
138
+ buttonClass: "scalable",
139
+ id: "currentmenu",
140
+ title: "<?php echo Mage::helper('modulecreator')->__('Current menu order');?>"
141
+ });
142
+ }
143
+ });
144
+ }
145
+ function reloadEntity(entityId){
146
+ var useFrontend = $('entity_' + entityId + '_use_frontend').value;
147
+ var useWidget = $('entity_' + entityId + '_widget').value;
148
+ var useRss = $('entity_' + entityId + '_rss').value;
149
+ var linkProduct = $('entity_' + entityId + '_link_product').value;
150
+ if (useFrontend == 0){
151
+ $$('#entity_' + entityId + '_settings tr.use-frontend').each(function(item){
152
+ $(item).hide();
153
+ });
154
+ }
155
+ else{
156
+ $$('#entity_' + entityId + '_settings tr.use-frontend').each(function(item){
157
+ if (($(item).hasClassName('link-product') && linkProduct == 1) || !$(item).hasClassName('link-product')){
158
+ $(item).show();
159
+ }
160
+ else{
161
+ $(item).hide();
162
+ }
163
+ });
164
+ }
165
+ if (!useWidget){
166
+ $$('#entity_' + entityId + ' tr.use-widget').each(function(item){
167
+ $(item).hide();
168
+ });
169
+ }
170
+ if (!useRss){
171
+ $$('#entity_' + entityId + ' tr.use-rss').each(function(item){
172
+ $(item).hide();
173
+ });
174
+ }
175
+ if (linkProduct == 0){
176
+ $$('#entity_' + entityId + ' tr.link-product').each(function(item){
177
+ $(item).hide();
178
+ });
179
+ }
180
+ else{
181
+ $$('#entity_' + entityId + ' tr.link-product').each(function(item){
182
+ if (($(item).hasClassName('use-frontend') && useFrontend == 1) || !$(item).hasClassName('use-frontend')){
183
+ $(item).show();
184
+ }
185
+ else{
186
+ $(item).hide();
187
+ }
188
+ });
189
+ }
190
+ var attributes = $$('#entity_' + entityId + '_attributes .modulecreator-attribute');
191
+ for (var i = 0; i < attributes.length; i++){
192
+ var attributeDivId = $(attributes[i]).id;
193
+ var parts = attributeDivId.split('_');
194
+ var key = parts[1] + '_' + parts[2];
195
+ var attributeType = $(attributeDivId + '_type').value;
196
+ if (attributeType == ''){
197
+ $('additional_data_' + key).hide();
198
+ }
199
+ else{
200
+ $('additional_data_' + key).show();
201
+ $$('#additional_data_' + key + ' tr').each(function(item){
202
+ var shouldHide = false;
203
+ if ($(item).hasClassName('type-' + attributeType) || $(item).hasClassName('type-all')){
204
+ if ($(item).hasClassName('use-frontend')){
205
+ if (useFrontend == 0){
206
+ shouldHide = true;
207
+ }
208
+ }
209
+ if ($(item).hasClassName('use-widget')){
210
+ if (useWidget == 0){
211
+ shouldHide = true;
212
+ }
213
+ }
214
+ if ($(item).hasClassName('use-rss')){
215
+ if (useRss == 0){
216
+ shouldHide = true;
217
+ }
218
+ }
219
+ }
220
+ else{
221
+ shouldHide = true;
222
+ }
223
+ if (shouldHide){
224
+ $(item).hide();
225
+ }
226
+ else{
227
+ $(item).show();
228
+ }
229
+ });
230
+ }
231
+ }
232
+ }
233
+ //]]>
234
+ </script>
app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities.phtml ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * entities tab
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ ?>
25
+ <?php $_entities = $this->getEntities();?>
26
+ <h4><?php echo Mage::helper('modulecreator')->__('Entities') ?></h4>
27
+ <div><?php echo $this->getAddButtonHtml() ?></div>
28
+ <div id="entities_container" class="">
29
+ <div id="entities_container_top"></div>
30
+ <?php foreach ($_entities as $_increment=>$_entity) : ?>
31
+ <?php echo $this->getLayout()->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_entities_entity')->setTemplate('ultimate_modulecreator/edit/tab/entities/entity.phtml')->setEntity($_entity)->setIncrement($_increment)->toHtml();?>
32
+ <?php endforeach;?>
33
+ <div id="entities_container_bottom"></div>
34
+ </div>
35
+ <div><?php echo $this->getAddButtonHtml('_bottom') ?></div>
36
+ <button type="button" class="scalable" onclick="Effect.ScrollTo('anchor-content', { duration:'1'});">
37
+ <span><?php echo Mage::helper('modulecreator')->__('Top')?></span>
38
+ </button>
39
+
40
+ <script type="text/javascript">
41
+ //<![CDATA[
42
+ var entityCount = <?php echo count($_entities);?>;
43
+ function addEntity(){
44
+ entityCount++;
45
+ attributeCount[entityCount] = 0;
46
+ new Ajax.Request('<?php echo $this->getAddEntityUrl();?>increment/'+entityCount, {
47
+ method: 'get',
48
+ onSuccess: function(transport) {
49
+ $('entities_container_bottom').insert({before:transport.responseText});
50
+ Effect.ScrollTo($('entity_' + entityCount), { duration:'1'});
51
+ reloadEntity(entityCount);
52
+ checkRelations();
53
+ }
54
+ });
55
+
56
+ }
57
+ var attributeCount = new Array();
58
+ <?php foreach ($_entities as $key=>$_entity) : ?>
59
+ attributeCount[<?php echo $key;?>] = <?php echo count($_entity->getAttributes());?>;
60
+ <?php endforeach ;?>
61
+ function addAttribute(entityId){
62
+ attributeCount[entityId]++;
63
+ new Ajax.Request('<?php echo $this->getAddAttributeUrl();?>increment/'+ attributeCount[entityId] + '/entity/' + entityId, {
64
+ method: 'get',
65
+ onSuccess: function(transport) {
66
+ $('entity_' + entityId + '_attributes').insert({bottom:transport.responseText});
67
+ Effect.ScrollTo($('attribute_' + entityId + '_' + attributeCount[entityId]), { duration:'1'});
68
+ }
69
+ });
70
+ }
71
+ function removeEntity(element){
72
+ if (confirm('<?php echo Mage::helper('modulecreator')->__('Are you sure?')?>')){
73
+ var removedId = $(element).up(1).nextSiblings()[0].id;
74
+ removedId = removedId.replace('entity_', '');
75
+ $(element).up(2).remove();
76
+ $$('div[id^="relations_container_"]').each(function(item){
77
+ var parts = $(item).id.split('_');
78
+ if (parts[1] == removedId || parts[2] == removedId){
79
+ $(item).remove();
80
+ }
81
+ });
82
+ checkRelations();
83
+ }
84
+ }
85
+ function toggleArea(id, element){
86
+ $(id).toggle();
87
+ $(element).toggleClassName('open');
88
+ $(element).toggleClassName('closed');
89
+ return false;
90
+ }
91
+ //]]>
92
+ </script>
app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities/entity.phtml ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * @category Ultimate
19
+ * @package Ultimate_ModuleCreator
20
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
21
+ */
22
+ ?>
23
+ <?php $_entity = $this->getEntity();?>
24
+ <div class="entry-edit modulecreator-entity">
25
+ <div class="entry-edit-head collapseable">
26
+ <h4 id="entity_<?php echo $this->getIncrement()?>_title" class="left">
27
+ <?php if ($_entity->getLabelSingular()) : ?>
28
+ <?php echo $_entity->getLabelSingular();?>
29
+ <?php else : ?>
30
+ <?php echo Mage::helper('modulecreator')->__('Entity %s', $this->getIncrement());?>
31
+ <?php endif;?>
32
+ </h4>
33
+ <a href="#" class="left modulecreator-toggle open" onclick="return toggleArea('entity_<?php echo $this->getIncrement();?>', this)">&nbsp;</a>
34
+ <div class="right"><button type="button" onclick="removeEntity(this);"><?php echo Mage::helper('modulecreator')->__('Remove entity');?></button></div>
35
+ </div>
36
+ <div class="option-box box" id="entity_<?php echo $this->getIncrement();?>">
37
+ <div>
38
+ <input type="hidden" id="entity_<?php echo $this->getIncrement();?>_id" name="entity[<?php echo $this->getIncrement();?>][id]" value="<?php echo $this->getIncrement();?>" />
39
+ </div>
40
+ <div id="entity_<?php echo $this->getIncrement();?>_settings">
41
+ <div class="box-left">
42
+ <div class="entry-edit-head collapseable">
43
+ <h4><?php echo Mage::helper('modulecreator')->__('Name settings');?></h4>
44
+ <a href="#" class="right modulecreator-toggle open" onclick="return toggleArea('entity_<?php echo $this->getIncrement();?>_name_settings', this)">&nbsp;</a>
45
+ </div>
46
+ <div class="box" id="entity_<?php echo $this->getIncrement();?>_name_settings">
47
+ <table class="form-list" cellpadding="0" cellspacing="0">
48
+ <tbody>
49
+ <tr>
50
+ <td class="label">
51
+ <label for="entity_<?php echo $this->getIncrement();?>_label_singular">
52
+ <?php echo Mage::helper('modulecreator')->__('Entity label - singular') ?> <span class="required">*</span>
53
+ </label>
54
+ </td>
55
+ <td class="value">
56
+ <input type="text" class="required-entry input-text" id="entity_<?php echo $this->getIncrement();?>_label_singular" name="entity[<?php echo $this->getIncrement();?>][label_singular]" value="<?php echo $_entity->getLabelSingular();?>" onchange="var val = this.value;$('entity_<?php echo $this->getIncrement()?>_title').innerHTML = val; $$('.relation-title-<?php echo $this->getIncrement()?>').each(function(item){$(item).innerHTML = '&nbsp;' + val + '&nbsp;'})" />
57
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Entity label - singular'), Mage::helper('modulecreator')->__('This is the label (singular) that will appear through the website for your entity.'))?>
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <td class="label">
62
+ <label for="entity_<?php echo $this->getIncrement();?>_label_plural">
63
+ <?php echo Mage::helper('modulecreator')->__('Entity label - plural') ?> <span class="required">*</span>
64
+ </label>
65
+ </td>
66
+ <td class="value">
67
+ <input type="text" class="required-entry input-text" id="entity_<?php echo $this->getIncrement();?>_label_plural" name="entity[<?php echo $this->getIncrement();?>][label_plural]" value="<?php echo $_entity->getLabelPlural();?>" />
68
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Entity label - plural'), Mage::helper('modulecreator')->__('This is the label (plural) that will appear through the website for your entity.'))?>
69
+ </td>
70
+ </tr>
71
+ <tr>
72
+ <td class="label">
73
+ <label for="entity_<?php echo $this->getIncrement();?>_name_singular">
74
+ <?php echo Mage::helper('modulecreator')->__('Entity code - singular') ?> <span class="required">*</span>
75
+ </label>
76
+ </td>
77
+ <td class="value">
78
+ <input type="text" class="required-entry input-text name-singular validate-code" id="entity_<?php echo $this->getIncrement();?>_name_singular" name="entity[<?php echo $this->getIncrement();?>][name_singular]" value="<?php echo $_entity->getNameSingular();?>" />
79
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Entity name - singular'), Mage::helper('modulecreator')->__('This is the code (singular) of your entity. This is how the variables relating to your entity will be named.'))?>
80
+ </td>
81
+ </tr>
82
+ <tr>
83
+ <td class="label">
84
+ <label for="entity_<?php echo $this->getIncrement();?>_name_plural">
85
+ <?php echo Mage::helper('modulecreator')->__('Entity code - plural') ?> <span class="required">*</span>
86
+ </label>
87
+ </td>
88
+ <td class="value">
89
+ <input type="text" class="required-entry input-text validate-code" id="entity_<?php echo $this->getIncrement();?>_name_plural" name="entity[<?php echo $this->getIncrement();?>][name_plural]" value="<?php echo $_entity->getNamePlural();?>" />
90
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Entity name - plural'), Mage::helper('modulecreator')->__('This is the code (singular) of your entity. This is how the variables relating to your entities will be named.'))?>
91
+ </td>
92
+ </tr>
93
+ </tbody>
94
+ </table>
95
+ </div>
96
+ </div>
97
+ <div class="box-right">
98
+ <div class="entry-edit-head collapseable">
99
+ <h4><?php echo Mage::helper('modulecreator')->__('Admin');?></h4>
100
+ <a href="#" class="right modulecreator-toggle open" onclick="return toggleArea('entity_<?php echo $this->getIncrement();?>_admin_settings', this)">&nbsp;</a>
101
+ </div>
102
+ <div class="box" id="entity_<?php echo $this->getIncrement();?>_admin_settings">
103
+ <table class="form-list" cellpadding="0" cellspacing="0">
104
+ <tbody>
105
+ <tr>
106
+ <td class="label">
107
+ <label for="entity_<?php echo $this->getIncrement();?>_add_created_to_grid">
108
+ <?php echo Mage::helper('modulecreator')->__('Add "Created at" to admin grid') ?>
109
+ </label>
110
+ </td>
111
+ <td class="value">
112
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_add_created_to_grid', 'entity'.'['.$this->getIncrement().'][created_to_grid]', $_entity->getCreatedToGrid());?>
113
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Add "Created at" to admin grid'), Mage::helper('modulecreator')->__('This will add a colum with the creation date of the entity to the admin grid.'))?>
114
+ </td>
115
+ </tr>
116
+ <tr>
117
+ <td class="label">
118
+ <label for="entity_<?php echo $this->getIncrement();?>_add_updated_to_grid">
119
+ <?php echo Mage::helper('modulecreator')->__('Add "Updated at" to admin grid') ?>
120
+ </label>
121
+ </td>
122
+ <td class="value">
123
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_add_updated_to_grid', 'entity'.'['.$this->getIncrement().'][updated_to_grid]', $_entity->getUpdatedToGrid());?>
124
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Add "Updated at" to admin grid'), Mage::helper('modulecreator')->__('This will add a colum with the last update date of the entity to the admin grid.'))?>
125
+ </td>
126
+ </tr>
127
+ <tr>
128
+ <td class="label">
129
+ <label for="entity_<?php echo $this->getIncrement();?>_add_status">
130
+ <?php echo Mage::helper('modulecreator')->__('Add "Status" field') ?>
131
+ </label>
132
+ </td>
133
+ <td class="value">
134
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_add_status', 'entity'.'['.$this->getIncrement().'][add_status]', $_entity->getAddStatus());?>
135
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Add "Status" field'), Mage::helper('modulecreator')->__('This will add a field that behaves a status. With it you will be able to decide what entities to show on frontend.'))?>
136
+ </td>
137
+ </tr>
138
+ </tbody>
139
+ </table>
140
+ </div>
141
+ </div>
142
+ <div class="clear"></div>
143
+ <div class="box-left">
144
+ <div class="entry-edit-head collapseable">
145
+ <h4><?php echo Mage::helper('modulecreator')->__('Frontend');?></h4>
146
+ <a href="#" class="right modulecreator-toggle open" onclick="return toggleArea('entity_<?php echo $this->getIncrement();?>_frontend_settings', this)">&nbsp;</a>
147
+ </div>
148
+ <div class="box" id="entity_<?php echo $this->getIncrement();?>_frontend_settings">
149
+ <table class="form-list" cellpadding="0" cellspacing="0">
150
+ <tbody>
151
+ <tr>
152
+ <td class="label">
153
+ <label for="entity_<?php echo $this->getIncrement();?>_use_frontend">
154
+ <?php echo Mage::helper('modulecreator')->__('Create frontend files') ?>
155
+ </label>
156
+ </td>
157
+ <td class="value">
158
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_use_frontend', 'entity'.'['.$this->getIncrement().'][use_frontend]', $_entity->getUseFrontend());?>
159
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Create frontend files'), Mage::helper('modulecreator')->__('This allows you to create a frontend skeleton for your entity.'))?>
160
+ </td>
161
+ </tr>
162
+ <tr class="use-frontend">
163
+ <td class="label">
164
+ <label for="entity_<?php echo $this->getIncrement();?>_frontend_list">
165
+ <?php echo Mage::helper('modulecreator')->__('Create entity list page') ?>
166
+ </label>
167
+ </td>
168
+ <td class="value">
169
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_frontend_list', 'entity'.'['.$this->getIncrement().'][frontend_list]', $_entity->getFrontendList());?>
170
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Create entity list page'), Mage::helper('modulecreator')->__('This allows you to create a frontend list page for your entity.'))?>
171
+ </td>
172
+ </tr>
173
+ <tr class="use-frontend">
174
+ <td class="label">
175
+ <label for="entity_<?php echo $this->getIncrement();?>_frontend_list_template">
176
+ <?php echo Mage::helper('modulecreator')->__('Entity list page template') ?>
177
+ </label>
178
+ </td>
179
+ <td class="value">
180
+ <?php echo $this->getTemplateSelect('entity'.'_'.$this->getIncrement().'_frontend_list_template', 'entity'.'['.$this->getIncrement().'][frontend_list_template]', $_entity->getFrontendListTemplate());?>
181
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Entity list page template'), Mage::helper('modulecreator')->__('This allows you to select the layout of the list page.'))?>
182
+ </td>
183
+ </tr>
184
+ <tr class="use-frontend">
185
+ <td class="label">
186
+ <label for="entity_<?php echo $this->getIncrement();?>_frontend_view">
187
+ <?php echo Mage::helper('modulecreator')->__('Create entity view page') ?>
188
+ </label>
189
+ </td>
190
+ <td class="value">
191
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_frontend_view', 'entity'.'['.$this->getIncrement().'][frontend_view]', $_entity->getFrontendView());?>
192
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Create entity view page'), Mage::helper('modulecreator')->__('This allows you to create a frontend view page for your entity.'))?>
193
+ </td>
194
+ </tr>
195
+ <tr class="use-frontend">
196
+ <td class="label">
197
+ <label for="entity_<?php echo $this->getIncrement();?>_frontend_view_template">
198
+ <?php echo Mage::helper('modulecreator')->__('Entity view page template') ?>
199
+ </label>
200
+ </td>
201
+ <td class="value">
202
+ <?php echo $this->getTemplateSelect('entity'.'_'.$this->getIncrement().'_frontend_view_template', 'entity'.'['.$this->getIncrement().'][frontend_view_template]', $_entity->getFrontendViewTemplate());?>
203
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Entity view page template'), Mage::helper('modulecreator')->__('This allows you to select the layout of the view page.'))?>
204
+ </td>
205
+ </tr>
206
+ <tr class="use-frontend">
207
+ <td class="label">
208
+ <label for="entity_<?php echo $this->getIncrement();?>_frontend_add_seo">
209
+ <?php echo Mage::helper('modulecreator')->__('Add SEO attributes') ?>
210
+ </label>
211
+ </td>
212
+ <td class="value">
213
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_frontend_add_seo', 'entity'.'['.$this->getIncrement().'][frontend_add_seo]', $_entity->getFrontendAddSeo());?>
214
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Add SEO attributes'), Mage::helper('modulecreator')->__('This will add automatically the Meta title, Meta keywords and Meta description fields that will be used on frontend.'))?>
215
+ </td>
216
+ </tr>
217
+ <tr class="use-frontend">
218
+ <td class="label">
219
+ <label for="entity_<?php echo $this->getIncrement();?>_rss">
220
+ <?php echo Mage::helper('modulecreator')->__('Create RSS feed') ?>
221
+ </label>
222
+ </td>
223
+ <td class="value">
224
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_rss', 'entity'.'['.$this->getIncrement().'][rss]', $_entity->getRss());?>
225
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Create RSS feed'), Mage::helper('modulecreator')->__('This will add an RSS feed with your entities to the list or Magento RSS feeds. You will be able to decide which entities appear in the RSS feed.'))?>
226
+ </td>
227
+ </tr>
228
+ <tr class="use-frontend">
229
+ <td class="label">
230
+ <label for="entity_<?php echo $this->getIncrement();?>_widget">
231
+ <?php echo Mage::helper('modulecreator')->__('Create Link/View widget') ?>
232
+ </label>
233
+ </td>
234
+ <td class="value">
235
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_widget', 'entity'.'['.$this->getIncrement().'][widget]', $_entity->getWidget());?>
236
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Create Link/View widget'), Mage::helper('modulecreator')->__('This will add a view widget and a link widget that you will be able to use in CMS pages and blocks.'))?>
237
+ </td>
238
+ </tr>
239
+ </tbody>
240
+ </table>
241
+ </div>
242
+ </div>
243
+ <div class="box-right">
244
+ <div class="entry-edit-head collapseable">
245
+ <h4><?php echo Mage::helper('modulecreator')->__('Catalog');?></h4>
246
+ <a href="#" class="right modulecreator-toggle open" onclick="return toggleArea('entity_<?php echo $this->getIncrement();?>_catalog_settings', this)">&nbsp;</a>
247
+ </div>
248
+ <div class="box" id="entity_<?php echo $this->getIncrement();?>_catalog_settings">
249
+ <table class="form-list" cellpadding="0" cellspacing="0">
250
+ <tbody>
251
+ <tr>
252
+ <td class="label">
253
+ <label for="entity_<?php echo $this->getIncrement();?>_link_product">
254
+ <?php echo Mage::helper('modulecreator')->__('Link "many to many" with prodcts') ?>
255
+ </label>
256
+ </td>
257
+ <td class="value">
258
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_link_product', 'entity'.'['.$this->getIncrement().'][link_product]', $_entity->getLinkProduct());?>
259
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Link "many to many" with prodcts'), Mage::helper('modulecreator')->__('This will allow you to link your entity to the products. It will add a new tab in the product edit form with your entities and a tab in the entity edit form with the product.'))?>
260
+ </td>
261
+ </tr>
262
+ <tr class="link-product">
263
+ <td class="label">
264
+ <label for="entity_<?php echo $this->getIncrement();?>_show_on_product">
265
+ <?php echo Mage::helper('modulecreator')->__('Show associated entities on product page') ?>
266
+ </label>
267
+ </td>
268
+ <td class="value">
269
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_show_on_product', 'entity'.'['.$this->getIncrement().'][show_on_product]', $_entity->getShowOnProduct());?>
270
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Show associated entities on product page'), Mage::helper('modulecreator')->__('This will display the list of associated entities on the related product page. It may not be displayed if the design is not compatible but can be fixed from the layout xml of the entity.'))?>
271
+ </td>
272
+ </tr>
273
+ <tr class="link-product use-frontend">
274
+ <td class="label">
275
+ <label for="entity_<?php echo $this->getIncrement();?>_show_products">
276
+ <?php echo Mage::helper('modulecreator')->__('Show associated product on entity page') ?>
277
+ </label>
278
+ </td>
279
+ <td class="value">
280
+ <?php echo $this->getYesNoSelect('entity'.'_'.$this->getIncrement().'_show_products', 'entity'.'['.$this->getIncrement().'][show_products]', $_entity->getShowProducts());?>
281
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Show associated product on entity page'), Mage::helper('modulecreator')->__('This will display the list of associated products on the related entity page.'))?>
282
+ </td>
283
+ </tr>
284
+ </tbody>
285
+ </table>
286
+ </div>
287
+ </div>
288
+ <div class="clear"></div>
289
+ </div>
290
+ <div id="entity_<?php echo $this->getIncrement();?>_attributes_container" class="entry-edit">
291
+ <div class="entry-edit-head collapseable">
292
+ <h4><?php echo Mage::helper('modulecreator')->__('Fields');?></h4>
293
+ <a href="#" class="left modulecreator-toggle open" onclick="return toggleArea('entity_<?php echo $this->getIncrement();?>_attributes', this)" id="entity_<?php echo $this->getIncrement();?>_attributes_toggler">&nbsp;</a>
294
+ <div class="right"><button type="button" onclick="$('entity_<?php echo $this->getIncrement();?>_attributes').show();$('entity_<?php echo $this->getIncrement();?>_attributes_toggler').addClassName('open');$('entity_<?php echo $this->getIncrement();?>_attributes_toggler').removeClassName('closed');addAttribute(<?php echo $this->getIncrement();?>)"><?php echo Mage::helper('modulecreator')->__('Add field');?></button></div>
295
+ </div>
296
+ <div class="box" id="entity_<?php echo $this->getIncrement();?>_attributes">
297
+ <?php foreach ($_entity->getAttributes() as $_index=>$_attribute) : ?>
298
+ <?php $attr = new Varien_Object($_attribute);?>
299
+ <?php echo $this->getLayout()->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_entities_entity_attribute')->setTemplate('ultimate_modulecreator/edit/tab/entities/entity/attribute.phtml')->setAttributeInstance($attr)->setEntityId($this->getIncrement())->setIncrement($_index)->toHtml();?>
300
+ <?php endforeach;?>
301
+ </div>
302
+ <div id="entity_<?php echo $this->getIncrement();?>_attributes_bottom"></div>
303
+ <button type="button" onclick="$('entity_<?php echo $this->getIncrement();?>_attributes').show();$('entity_<?php echo $this->getIncrement();?>_attributes_toggler').addClassName('open');$('entity_<?php echo $this->getIncrement();?>_attributes_toggler').removeClassName('closed');addAttribute(<?php echo $this->getIncrement();?>)"><?php echo Mage::helper('modulecreator')->__('Add field');?></button>
304
+ </div>
305
+ </div>
306
+ </div>
307
+ <script type="text/javascript">
308
+ $('entity_<?php echo $this->getIncrement();?>_use_frontend').observe('change', function() {
309
+ reloadEntity(<?php echo $this->getIncrement();?>)
310
+ });
311
+ $('entity_<?php echo $this->getIncrement();?>_widget').observe('change', function() {
312
+ reloadEntity(<?php echo $this->getIncrement();?>)
313
+ });
314
+ $('entity_<?php echo $this->getIncrement();?>_rss').observe('change', function() {
315
+ reloadEntity(<?php echo $this->getIncrement();?>)
316
+ });
317
+ $('entity_<?php echo $this->getIncrement();?>_link_product').observe('change', function() {
318
+ reloadEntity(<?php echo $this->getIncrement();?>)
319
+ });
320
+ Event.observe(document,'dom:loaded', function(){
321
+ reloadEntity(<?php echo $this->getIncrement();?>)
322
+ });
323
+ </script>
app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities/entity/attribute.phtml ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ ?>
18
+ <?php $_id = $this->getEntityId().'_'.$this->getIncrement();?>
19
+ <?php $_attribute = $this->getAttributeInstance();?>
20
+ <div class="entry-edit modulecreator-attribute" id="attribute_<?php echo $_id?>">
21
+ <div class="entry-edit-head collapseable">
22
+ <h4 id="attribute_<?php echo $_id?>_title">
23
+ <?php if ($_attribute->getLabel()) : ?>
24
+ <?php echo $_attribute->getLabel();?>
25
+ <?php else : ?>
26
+ <?php echo Mage::helper('modulecreator')->__('Attribute %s', $this->getIncrement());?>
27
+ <?php endif;?>
28
+ </h4>
29
+ <a href="#" class="left modulecreator-toggle open" onclick="return toggleArea('attribute_<?php echo $_id?>_settings', this)">&nbsp;</a>
30
+ <div class="right"><button type="button" onclick="if (confirm('<?php echo Mage::helper('modulecreator')->__('Are you sure?')?>')) $(this).up(2).remove()"><?php echo Mage::helper('modulecreator')->__('Remove field');?></button></div>
31
+ </div>
32
+ <div class="box" id="attribute_<?php echo $_id?>_settings">
33
+ <div class="box-left">
34
+ <div class="entry-edit-head">
35
+ <h4><?php echo Mage::helper('modulecreator')->__('Settings');?></h4>
36
+ </div>
37
+ <div class="box">
38
+ <table class="form-list" cellpadding="0" cellspacing="0">
39
+ <tbody>
40
+ <tr>
41
+ <td class="label">
42
+ <label for="attribute_<?php echo $_id?>_label">
43
+ <?php echo Mage::helper('modulecreator')->__('Attribute Label') ?> <span class="required">*</span>
44
+ </label>
45
+ </td>
46
+ <td class="value">
47
+ <input type="text" class="required-entry input-text" id="attribute_<?php echo $_id?>_label" name="entity[<?php echo $this->getEntityId();?>][attributes][<?php echo $this->getIncrement()?>][label]" value="<?php echo $_attribute->getLabel();?>" onchange="$('attribute_<?php echo $_id?>_title').innerHTML = this.value" />
48
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Attribute Label'), Mage::helper('modulecreator')->__('This is the attribute label. It will be used for the admin form and the frontend listing.'))?>
49
+ </td>
50
+ </tr>
51
+ <tr>
52
+ <td class="label">
53
+ <label for="attribute_<?php echo $_id?>_code">
54
+ <?php echo Mage::helper('modulecreator')->__('Attribute Code') ?> <span class="required">*</span>
55
+ </label>
56
+ </td>
57
+ <td class="value">
58
+ <input type="text" class="required-entry input-text validate-code" id="attribute_<?php echo $_id?>_code" name="entity[<?php echo $this->getEntityId();?>][attributes][<?php echo $this->getIncrement()?>][code]" value="<?php echo $_attribute->getCode();?>" />
59
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Attribute Code'), Mage::helper('modulecreator')->__('This is the attribute code. It will be used in the code and in the database.'))?>
60
+ </td>
61
+ </tr>
62
+ <tr>
63
+ <td class="label">
64
+ <label for="attribute_<?php echo $_id?>_type">
65
+ <?php echo Mage::helper('modulecreator')->__('Attribute Type') ?> <span class="required">*</span>
66
+ </label>
67
+ </td>
68
+ <td class="value">
69
+ <?php echo $this->getAttributeTypeSelect('attribute_'.$_id.'_type', 'entity['.$this->getEntityId().'][attributes]['.$this->getIncrement().'][type]', $_attribute->getType());?>
70
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Attribute Type'), Mage::helper('modulecreator')->__('This will determine the input type of the attribute.'))?>
71
+ </td>
72
+ </tr>
73
+ <tr>
74
+ <td class="label">
75
+ <label for="attribute_<?php echo $_id?>_position">
76
+ <?php echo Mage::helper('modulecreator')->__('Position') ?>
77
+ </label>
78
+ </td>
79
+ <td class="value">
80
+ <input type="text" class="input-text validate-zero-or-greater" id="attribute_<?php echo $_id?>_position" name="entity[<?php echo $this->getEntityId();?>][attributes][<?php echo $this->getIncrement()?>][position]" value="<?php echo $_attribute->getPosition();?>" />
81
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Position'), Mage::helper('modulecreator')->__('This will determine the position in the admin add/edit form.'))?>
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <td class="label">
86
+ <label for="attribute_<?php echo $_id?>_note">
87
+ <?php echo Mage::helper('modulecreator')->__('Note') ?>
88
+ </label>
89
+ </td>
90
+ <td class="value">
91
+ <input type="text" class="input-text" id="attribute_<?php echo $_id?>_note" name="entity[<?php echo $this->getEntityId();?>][attributes][<?php echo $this->getIncrement()?>][note]" value="<?php echo $_attribute->getNote();?>" />
92
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Note'), Mage::helper('modulecreator')->__('This will be added as a small comment under the input in the admin add/edit form.'))?>
93
+ </td>
94
+ </tr>
95
+ </tbody>
96
+ </table>
97
+ </div>
98
+ </div>
99
+ <div class="box-right" id="additional_data_<?php echo $_id?>">
100
+ <div class="entry-edit-head">
101
+ <h4><?php echo Mage::helper('modulecreator')->__('Additional Data');?></h4>
102
+ </div>
103
+ <div class="box">
104
+ <table class="form-list" cellpadding="0" cellspacing="0">
105
+ <tbody>
106
+ <tr class="type-text">
107
+ <td class="label">
108
+ <label for="attribute_<?php echo $_id?>_is_name">
109
+ <?php echo Mage::helper('modulecreator')->__('Acts as name') ?>
110
+ </label>
111
+ </td>
112
+ <td class="value">
113
+ <input type="radio" class="input-text validate-one-required-by-name" id="attribute_<?php echo $_id?>_is_name" name="entity[<?php echo $this->getEntityId();?>][attributes][is_name]" value="<?php echo $this->getIncrement();?>"<?php echo ($_attribute->getIsName()?' checked="checked"':'');?> />
114
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Acts as name'), Mage::helper('modulecreator')->__('The attribute marked this way will be used in lists and dropdowns.'))?>
115
+ </td>
116
+ </tr>
117
+ <tr class="type-text type-textarea type-yesno type-timestamp type-int type-decimal type-website">
118
+ <td class="label">
119
+ <label for="attribute_<?php echo $_id?>_required">
120
+ <?php echo Mage::helper('modulecreator')->__('Is required') ?>
121
+ </label>
122
+ </td>
123
+ <td class="value">
124
+ <?php echo $this->getYesNoSelect('attribute_'.$_id.'_required', 'entity['.$this->getEntityId().'][attributes]['.$this->getIncrement().'][required]', $_attribute->getRequired());?>
125
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Is required'), Mage::helper('modulecreator')->__('Now this is to obvious!!! I can\' belive you clicked the tooltip.'))?>
126
+ </td>
127
+ </tr>
128
+ <tr class="type-textarea">
129
+ <td class="label">
130
+ <label for="attribute_<?php echo $_id?>_editor">
131
+ <?php echo Mage::helper('modulecreator')->__('Use WYSIWYG editor') ?>
132
+ </label>
133
+ </td>
134
+ <td class="value">
135
+ <?php echo $this->getYesNoSelect('attribute_'.$_id.'_editor', 'entity['.$this->getEntityId().'][attributes]['.$this->getIncrement().'][editor]', $_attribute->getEditor());?>
136
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Use WYSIWYG editor'), Mage::helper('modulecreator')->__('This will allow you to use WYSIWYG editors for texareas.'))?>
137
+ </td>
138
+ </tr>
139
+ <tr class="type-text type-yesno type-timestamp type-int type-decimal type-website">
140
+ <td class="label">
141
+ <label for="attribute_<?php echo $_id?>_admin_grid">
142
+ <?php echo Mage::helper('modulecreator')->__('Add in admin grid') ?>
143
+ </label>
144
+ </td>
145
+ <td class="value">
146
+ <?php echo $this->getYesNoSelect('attribute_'.$_id.'_admin_grid', 'entity['.$this->getEntityId().'][attributes]['.$this->getIncrement().'][admin_grid]', $_attribute->getAdminGrid());?>
147
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Add in admin grid'), Mage::helper('modulecreator')->__('This will add your attribute to the admin grid.'))?>
148
+ </td>
149
+ </tr>
150
+ <tr class="type-all use-frontend">
151
+ <td class="label">
152
+ <label for="attribute_<?php echo $_id?>_frontend">
153
+ <?php echo Mage::helper('modulecreator')->__('Show in frontend') ?>
154
+ </label>
155
+ </td>
156
+ <td class="value">
157
+ <?php echo $this->getYesNoSelect('attribute_'.$_id.'_frontend', 'entity['.$this->getEntityId().'][attributes]['.$this->getIncrement().'][frontend]', $_attribute->getFrontend());?>
158
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Show in frontend'), Mage::helper('modulecreator')->__('This will display this attribute on frontend.'))?>
159
+ </td>
160
+ </tr>
161
+ <tr class="type-all use-widget">
162
+ <td class="label">
163
+ <label for="attribute_<?php echo $_id?>_widget">
164
+ <?php echo Mage::helper('modulecreator')->__('Show in widget') ?>
165
+ </label>
166
+ </td>
167
+ <td class="value">
168
+ <?php echo $this->getYesNoSelect('attribute_'.$_id.'_widget', 'entity['.$this->getEntityId().'][attributes]['.$this->getIncrement().'][widget]', $_attribute->getWidget());?>
169
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Show in widget'), Mage::helper('modulecreator')->__('This will display this attribute in the view widget.'))?>
170
+ </td>
171
+ </tr>
172
+ <tr class="type-all use-rss">
173
+ <td class="label">
174
+ <label for="attribute_<?php echo $_id?>_rss">
175
+ <?php echo Mage::helper('modulecreator')->__('Show in rss') ?>
176
+ </label>
177
+ </td>
178
+ <td class="value">
179
+ <?php echo $this->getYesNoSelect('attribute_'.$_id.'_rss', 'entity['.$this->getEntityId().'][attributes]['.$this->getIncrement().'][rss]', $_attribute->getRss());?>
180
+ <?php echo Mage::helper('modulecreator/adminhtml')->getTooltipHtml(Mage::helper('modulecreator')->__('Show in rss'), Mage::helper('modulecreator')->__('This will display this attribute in the rss feed.'))?>
181
+ </td>
182
+ </tr>
183
+ </tbody>
184
+ </table>
185
+ </div>
186
+ </div>
187
+ <div class="clear"></div>
188
+ </div>
189
+ </div>
190
+ <script type="text/javascript">
191
+ //<![CDATA[
192
+ $('attribute_<?php echo $_id;?>_type').observe('change', function() {
193
+ reloadEntity(<?php echo $this->getEntityId()?>);
194
+ });
195
+ Event.observe(document,'dom:loaded', function(){
196
+ reloadEntity(<?php echo $this->getEntityId()?>);
197
+ });
198
+ //]]>
199
+ </script>
app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/help.phtml ADDED
@@ -0,0 +1,414 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * help tab
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ ?>
25
+ <div class="entry-edit modulecretor-help">
26
+ <div class="entry-edit">
27
+ <div class="entry-edit-head collapseable">
28
+ <a href="#" onclick="return toggleHelp(this, 'modulecreator_help_container')" class="open">
29
+ <?php echo Mage::helper('modulecreator')->__('Help') ?>
30
+ </a>
31
+ </div>
32
+ <div id="modulecreator_help_container" class="box custom-options">
33
+ <strong><?php echo Mage::helper('modulecreator')->__('General description');?></strong>
34
+ <p>
35
+ <?php echo Mage::helper('modulecreator')->__('This extension generates the sourse code for a simple Magento extension.');?><br />
36
+ <?php echo Mage::helper('modulecreator')->__('You can configure it to create back-end and frontend files.');?><br />
37
+ <?php echo Mage::helper('modulecreator')->__('You can create one or more entities under the same extension.');?><br />
38
+ <?php echo Mage::helper('modulecreator')->__('For each entity you can add one or more attributes/fields of different types.');?><br />
39
+ <?php echo Mage::helper('modulecreator')->__('You can make relations between entities - many to many or one to many');?><br />
40
+ </p>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <div class="entry-edit modulecretor-help">
45
+ <div class="entry-edit">
46
+ <div class="entry-edit-head collapseable">
47
+ <a href="#" onclick="return toggleHelp(this, 'modulecreator_general_container')" class="open">
48
+ <?php echo Mage::helper('modulecreator')->__('Settings') ?>
49
+ </a>
50
+ </div>
51
+ <div id="modulecreator_general_container" class="box custom-options">
52
+ <strong><?php echo Mage::helper('modulecreator')->__('Settings Tab');?></strong>
53
+ <div>
54
+ <strong><?php echo Mage::helper('modulecreator')->__('Fields');?></strong>
55
+ <ul style="list-style-type: disc;padding-left:30px;">
56
+ <li>
57
+ <strong><?php echo Mage::helper('modulecreator')->__('Namespace');?></strong><br />
58
+ <p>
59
+ <?php echo Mage::helper('modulecreator')->__('This is the folder name of your new extension. Your company name could go here. Use only letters and numbers. Start with a capital letter.');?><br />
60
+ <?php echo Mage::helper('modulecreator')->__('You can change the default value from <a href="%s">System->Configuration->Module creator</a>->Settings->Default Namespace.', $this->getUrl('adminhtml/system_config/edit', array('section'=>'modulecreator')));?><br />
61
+ </p>
62
+ </li>
63
+ <li>
64
+ <strong><?php echo Mage::helper('modulecreator')->__('Module name');?></strong><br />
65
+ <p>
66
+ <?php echo Mage::helper('modulecreator')->__('This is your extension name. Start with a capital letter.');?><br />
67
+ <?php echo Mage::helper('modulecreator')->__('Here are some examples: "Article", "Testimonial", "Post".');?><br />
68
+ <?php echo Mage::helper('modulecreator')->__('Try to use a noun in singular form.');?><br />
69
+ <?php echo Mage::helper('modulecreator')->__('For security reasons you cannot name a module just like an existing one even in a different namespace: "Catalog", "Sales", "Checkout"...');?><br />
70
+ </p>
71
+ </li>
72
+ <li>
73
+ <strong><?php echo Mage::helper('modulecreator')->__('Code pool');?></strong><br />
74
+ <p>
75
+ <?php echo Mage::helper('modulecreator')->__('This is the code folder in which your extension will be installed. If you don\'t know what goes here, choose "local"');?><br />
76
+ <?php echo Mage::helper('modulecreator')->__('This Magento codepools are "local", "community" and "core" but you shouldn\'t touch the "core".');?><br />
77
+ <?php echo Mage::helper('modulecreator')->__('You can change the default value from <a href="%s">System->Configuration->Module Creator</a>->Settings->Default Codepool.', $this->getUrl('adminhtml/system_config/edit', array('section'=>'modulecreator')));?>
78
+ </p>
79
+ </li>
80
+ <li>
81
+ <strong><?php echo Mage::helper('modulecreator')->__('Action');?></strong><br />
82
+ <p>
83
+ <?php echo Mage::helper('modulecreator')->__('This allows you to create an archive with your extension located in /var/modulecreator folder of your current instance so you can edit it later or install it later manually by copying the "app" folder in the archive over the "app" folder of your instance and the "skin" folder in the archive over the "skin" folder of your instance.');?><br />
84
+ <?php echo Mage::helper('modulecreator')->__('You can change the default value from <a href="%s">System->Configuration->Module Creator</a>->Settings->Default Action.', $this->getUrl('adminhtml/system_config/edit', array('section'=>'modulecreator')));?><br />
85
+ <?php echo Mage::helper('modulecreator')->__('If you choose to install it directly, backup your Mangeto instance first, just in case.')?><br />
86
+ <?php if (Mage::helper('modulecreator')->isBetaRelease()) : ?>
87
+ <strong><?php echo Mage::helper('modulecreator')->__('While in BETA version this is disabled. It\'s for your own safety.')?></strong><br />
88
+ <?php endif;?>
89
+ </p>
90
+ </li>
91
+ <li>
92
+ <strong><?php echo Mage::helper('modulecreator')->__('Frontend package');?></strong><br />
93
+ <p>
94
+ <?php echo Mage::helper('modulecreator')->__('This is the name of the design interface (package) of your mangento instance. If you don\'t know what goes here put "base".');?>
95
+ </p>
96
+ </li>
97
+ <li>
98
+ <strong><?php echo Mage::helper('modulecreator')->__('Frontend theme - templates');?></strong><br />
99
+ <p>
100
+ <?php echo Mage::helper('modulecreator')->__('This is the name of the theme of your mangento instance for the template files. If you don\'t know what goes here put "default".');?>
101
+ </p>
102
+ </li>
103
+ <li>
104
+ <strong><?php echo Mage::helper('modulecreator')->__('Frontend theme - layout');?></strong><br />
105
+ <p>
106
+ <?php echo Mage::helper('modulecreator')->__('This is the name of the theme of your mangento instance for the layout files. If you don\'t know what goes here put "default".');?>
107
+ </p>
108
+ </li>
109
+ <li>
110
+ <strong><?php echo Mage::helper('modulecreator')->__('License');?></strong>
111
+ <br />
112
+ <p>
113
+ <?php echo Mage::helper('modulecreator')->__('Added at the top of every generated file.');?><br />
114
+ <?php echo Mage::helper('modulecreator')->__('Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} as placeholder for current year.');?><br />
115
+ <?php echo Mage::helper('modulecreator')->__('You can change the default value from <a href="%s">System->Configuration->Module Creator</a>->Settings->Default License.', $this->getUrl('adminhtml/system_config/edit', array('section'=>'modulecreator')));?>
116
+ </p>
117
+ </li>
118
+ <li>
119
+ <strong><?php echo Mage::helper('modulecreator')->__('Menu sort order');?></strong><br />
120
+ <p>
121
+ <?php echo Mage::helper('modulecreator')->__('This sets the position of your extension menu in the entire admin menu.');?><br />
122
+ <?php echo Mage::helper('modulecreator')->__('You can see the order of the current menus by clicking the link under the field.');?><br />
123
+ <?php echo Mage::helper('modulecreator')->__('or <a href="#" onclick="%s">here</a>', "showMenuOrder(0);return false;");?>
124
+ </p>
125
+ </li>
126
+ </ul>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ </div>
131
+ <div class="entry-edit modulecretor-help">
132
+ <div class="entry-edit-head collapseable">
133
+ <a href="#" class="open" onclick="return toggleHelp(this, 'modulecreator_help_entities_container')"><?php echo Mage::helper('modulecreator')->__('Entities') ?></a>
134
+ </div>
135
+ <div id="modulecreator_help_entities_container" class="box custom-options">
136
+ <p><?php echo Mage::helper('modulecreator')->__('To add a new entity click on "Add Entity"');?></p>
137
+ <strong><?php echo Mage::helper('modulecreator')->__('Fields');?></strong>
138
+ <ul style="list-style-type: disc;padding-left:30px;">
139
+ <li>
140
+ <strong><?php echo Mage::helper('modulecreator')->__('Entity label - singular')?></strong><br />
141
+ <p>
142
+ <?php echo Mage::helper('modulecreator')->__('This is the label of the entity (noun) in singular form. It will appear all over the module. As an example, if you set this label to "Article", in the admin for you will see the button "Add Article"');?>
143
+ </p>
144
+ </li>
145
+ <li>
146
+ <strong><?php echo Mage::helper('modulecreator')->__('Entity label - plural')?></strong><br />
147
+ <p>
148
+ <?php echo Mage::helper('modulecreator')->__('This is the label of the entity (noun) in plural form. It will appear all over the module. As an example, if you set this label to "Article", in the admin for you will see the button "Delete Articles"');?>
149
+ <?php echo Mage::helper('modulecreator')->__('This could have been autogenerated from the singular form, but it\'s safer if you input it manually.');?>
150
+ </p>
151
+ </li>
152
+ <li>
153
+ <strong><?php echo Mage::helper('modulecreator')->__('Entity code - singular')?></strong>
154
+ <br />
155
+ <p>
156
+ <?php echo Mage::helper('modulecreator')->__('This is the code of the entity. It will be used in the code to make it more human readable. For example, if you put "article" here all variables related to your entity will be named $article or $_article. It is also used for naming some generated files.');?><br />
157
+ <?php echo Mage::helper('modulecreator')->__('There are some naming restriction. For example the code cannot be: "resource", "setup", "adminhtml"');?>
158
+ </p>
159
+ </li>
160
+ <li>
161
+ <strong><?php echo Mage::helper('modulecreator')->__('Entity code - plural')?></strong>
162
+ <br />
163
+ <p>
164
+ <?php echo Mage::helper('modulecreator')->__('Same as above. This is used for a list of entities. For example if you put here "articles" all your variables related to article lists will be names $articles or $_articles');?>
165
+ </p>
166
+ </li>
167
+ <li>
168
+ <strong><?php echo Mage::helper('modulecreator')->__('Add "Created at" to admin grid')?></strong><br />
169
+ <strong><?php echo Mage::helper('modulecreator')->__('Add "Updated at" to admin grid')?></strong><br />
170
+ <p>
171
+ <?php echo Mage::helper('modulecreator')->__('Each entity has a field called created_at and one called updated_at that remembers when the item was created and saved last. Setting these wo "Yes" will add these columns to the admin gird.');?>
172
+ </p>
173
+ </li>
174
+ <li>
175
+ <strong><?php echo Mage::helper('modulecreator')->__('Include "Status" field')?></strong><br />
176
+ <p>
177
+ <?php echo Mage::helper('modulecreator')->__('This will add to your entity a "Status" field that will allow you to activate and deactivate the entities in the frontend. If you choose not to create the frontend files for your entity then is useless to set this to "Yes" but you can still do it.');?>
178
+ </p>
179
+ </li>
180
+ <li>
181
+ <strong><?php echo Mage::helper('modulecreator')->__('Create frontend files')?></strong><br />
182
+ <p>
183
+ <?php echo Mage::helper('modulecreator')->__('This allows you to decide if you generate or not the frontend files for the entity.');?>
184
+ </p>
185
+ </li>
186
+ <li>
187
+ <strong><?php echo Mage::helper('modulecreator')->__('Create entity list page')?></strong><br />
188
+ <p>
189
+ <?php echo Mage::helper('modulecreator')->__('This allows you to decide if you generate or not the frontend files for listing your entities.');?>
190
+ </p>
191
+ </li>
192
+ <li>
193
+ <strong><?php echo Mage::helper('modulecreator')->__('Entity list page template')?></strong><br />
194
+ <p>
195
+ <?php echo Mage::helper('modulecreator')->__('If you decide to create a list page of your entities you can set the main layout from here.');?>
196
+ </p>
197
+ </li>
198
+ <li>
199
+ <strong><?php echo Mage::helper('modulecreator')->__('Create entity view page')?></strong><br />
200
+ <p>
201
+ <?php echo Mage::helper('modulecreator')->__('This allows you to decide if you generate or not the frontend files for viewing your entities.');?>
202
+ </p>
203
+ </li>
204
+ <li>
205
+ <strong><?php echo Mage::helper('modulecreator')->__('Entity list page template')?></strong><br />
206
+ <p>
207
+ <?php echo Mage::helper('modulecreator')->__('If you decide to create a view page of your entities you can set the main layout from here.');?>
208
+ </p>
209
+ </li>
210
+ <li>
211
+ <strong><?php echo Mage::helper('modulecreator')->__('Add "SEO" attributes - title, description, keywords')?></strong>
212
+ <br />
213
+ <p>
214
+ <?php echo Mage::helper('modulecreator')->__('This will add to your entity 3 attributes. "Meta title", "Meta Description" and "Meta Keywords" and the logic to use them in the entity pages.');?>
215
+ </p>
216
+ </li>
217
+ <li>
218
+ <strong><?php echo Mage::helper('modulecreator')->__('Create RSS feed')?></strong>
219
+ <br />
220
+ <div>
221
+ <?php echo Mage::helper('modulecreator')->__('This will create a new attribute for your entity called "Show in Feed" and will also create the logic for viewing your entities as RSS feeds.');?><br />
222
+ <?php echo Mage::helper('modulecreator')->__('If this is enabled in the entity list page in front-end where will be a link to the RSS feed.');?><br />
223
+ <?php echo Mage::helper('modulecreator')->__('A link to the entity RSS feed will also be added in the default Magento RSS list page.');?><br />
224
+ <?php echo Mage::helper('modulecreator')->__('If you disable the RSS feeds in Magento this will also be disabled.');?>
225
+ <br />
226
+ <strong><?php echo Mage::helper('modulecreator')->__('Known issues:');?></strong>
227
+ <ul style="list-style-type:square;padding-left:20px;">
228
+ <li>
229
+ <?php echo Mage::helper('modulecreator')->__('If you don\'t have a default Magento RSS feed enabled but you have enabled the one for your entity then in the RSS list page the message "There are no RSS feeds" will appear and below it the link to the RSS feed of your entity.');?>
230
+ <br />
231
+ <?php echo Mage::helper('modulecreator')->__('There is no way of avoiding this without overwriting core behavior');?>
232
+ </li>
233
+ </ul>
234
+ </div>
235
+ </li>
236
+ <li>
237
+ <strong><?php echo Mage::helper('modulecreator')->__('Create Link/View widget')?></strong>
238
+ <br />
239
+ <p>
240
+ <?php echo Mage::helper('modulecreator')->__('This will create the code that will allow you to include widgets of your entities in the static pages and static blocks.');?>
241
+ </p>
242
+ </li>
243
+ <li>
244
+ <strong><?php echo Mage::helper('modulecreator')->__('Link "many to many" with prodcts')?></strong>
245
+ <br />
246
+ <p>
247
+ <?php echo Mage::helper('modulecreator')->__('This will allow you to link your entity to the products. It will add a new tab in the product edit form with your entities and a tab in the entity edit form with the product.');?>
248
+ </p>
249
+ </li>
250
+ <li>
251
+ <strong><?php echo Mage::helper('modulecreator')->__('Show associated entities on product page')?></strong>
252
+ <br />
253
+ <p>
254
+ <?php echo Mage::helper('modulecreator')->__('This will display the list of associated entities on the related product page. It may not be displayed if the design is not compatible but can be fixed from the layout xml of the entity.');?>
255
+ </p>
256
+ </li>
257
+ <li>
258
+ <strong><?php echo Mage::helper('modulecreator')->__('Show associated product on entity page')?></strong>
259
+ <br />
260
+ <p>
261
+ <?php echo Mage::helper('modulecreator')->__('This will display the list of associated products on the related entity page.');?>
262
+ </p>
263
+ </li>
264
+ </ul>
265
+ <strong><?php echo Mage::helper('modulecreator')->__('Entity fields');?></strong>
266
+ <ul style="list-style-type: disc;padding-left:30px;">
267
+ <li>
268
+ <strong><?php echo Mage::helper('modulecreator')->__('Attribute Label')?></strong><br />
269
+ <p>
270
+ <?php echo Mage::helper('modulecreator')->__('This is the attribute label that will be visible in the back-end in the add/edit form and in some cases in frontend.');?>
271
+ </p>
272
+ </li>
273
+ <li>
274
+ <strong><?php echo Mage::helper('modulecreator')->__('Attribute Code')?></strong>
275
+ <br />
276
+ <p>
277
+ <?php echo Mage::helper('modulecreator')->__('This is the attribute code. It will be used in the logic of the extension. Use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.');?><br />
278
+ <?php echo Mage::helper('modulecreator')->__('There are some naming restriction. For example the code cannot be: "data", "child"');?>
279
+ </p>
280
+ </li>
281
+ <li>
282
+ <strong><?php echo Mage::helper('modulecreator')->__('Attribute Type')?></strong>
283
+ <br />
284
+ <p>
285
+ <?php echo Mage::helper('modulecreator')->__('This is the attribute type. You can choose from the available options: Text, Int, Decimal Textarea, Yes/No, Timestamp, File, Image, Website.');?>
286
+ </p>
287
+ </li>
288
+ <li>
289
+ <strong><?php echo Mage::helper('modulecreator')->__('Position')?></strong>
290
+ <br />
291
+ <p>
292
+ <?php echo Mage::helper('modulecreator')->__('This sets the position of the attribute in the admin add/edit form.');?>
293
+ </p>
294
+ </li>
295
+ <li>
296
+ <strong><?php echo Mage::helper('modulecreator')->__('Note')?></strong>
297
+ <br />
298
+ <p>
299
+ <?php echo Mage::helper('modulecreator')->__('This will add a comment under the field in the admin add/edit form.');?>
300
+ </p>
301
+ </li>
302
+ </ul>
303
+ <strong><?php echo Mage::helper('modulecreator')->__('Additional data');?></strong>
304
+ <br />
305
+ <p>
306
+ <?php echo Mage::helper('modulecreator')->__('Depending on the attribute type you can/must configure additional data.')?>
307
+ </p>
308
+ <ul style="list-style-type: disc;padding-left:30px;">
309
+ <li>
310
+ <strong><?php echo Mage::helper('modulecreator')->__('Is name');?></strong>
311
+ <br />
312
+ <p>
313
+ <?php echo Mage::helper('modulecreator')->__('Each entity must have an attribute to behave as "Name". This attribute will be used to identify diffrent entitities among themselves. This option is available only for text attributes.');?>
314
+ <br />
315
+ <?php echo Mage::helper('modulecreator')->__('In the example above for the author entity you can add the attribute "name" to behave as name and for the testimonial entity you can add the attribute "title" to behave as name.');?>
316
+ </p>
317
+ </li>
318
+ <li>
319
+ <strong><?php echo Mage::helper('modulecreator')->__('Is required');?></strong>
320
+ <br />
321
+ <p>
322
+ <?php echo Mage::helper('modulecreator')->__('This sets the attribute as required in the admin add/edit form. Is available for all the attribute types.');?>
323
+ <br />
324
+ <?php echo Mage::helper('modulecreator')->__('The attribute set to behave as "Name" will be required by default.');?>
325
+ </p>
326
+ </li>
327
+ <li>
328
+ <strong><?php echo Mage::helper('modulecreator')->__('Use WYSIWYG editor');?></strong>
329
+ <br />
330
+ <p>
331
+ <?php echo Mage::helper('modulecreator')->__('This allows you to use a WYSIWYG editor for the attribute. It is available only for Textarea attributes.');?>
332
+ </p>
333
+ </li>
334
+ <li>
335
+ <strong><?php echo Mage::helper('modulecreator')->__('Add in admin grid');?></strong>
336
+ <br />
337
+ <p>
338
+ <?php echo Mage::helper('modulecreator')->__('This allows you to display the attribute as a column in the admin grid of the entity. Is available for attributes with type Text, Int, Decimal, Yes/No and Timestamp.');?>
339
+ <br />
340
+ <?php echo Mage::helper('modulecreator')->__('The attribute set to behave as "Name" will be includer by default. Also the "Status" attribute if you choose to create one.');?>
341
+ </p>
342
+ </li>
343
+ <li>
344
+ <strong><?php echo Mage::helper('modulecreator')->__('Show in frontend');?></strong>
345
+ <br />
346
+ <p>
347
+ <?php echo Mage::helper('modulecreator')->__('This allows you to generate the code to show the attribute value in the frontend. Is available for all attribute types.');?>
348
+ </p>
349
+ </li>
350
+ <li>
351
+ <strong><?php echo Mage::helper('modulecreator')->__('Display in widget');?></strong>
352
+ <br />
353
+ <p>
354
+ <?php echo Mage::helper('modulecreator')->__('The Module Creator also gives you the posibility to use any entity as a widget in the CMS pages and blocks. This allows you to include the attribute in the widget. Is available for all attribute types.');?>
355
+ </p>
356
+ </li>
357
+ <li>
358
+ <strong><?php echo Mage::helper('modulecreator')->__('Display in rss feed');?></strong>
359
+ <br />
360
+ <p>
361
+ <?php echo Mage::helper('modulecreator')->__('This allows you to include the attribute in the rss feed for the entity, if you chose to create one. Is available for all attribute types.');?>
362
+ </p>
363
+ </li>
364
+ </ul>
365
+ </div>
366
+ </div>
367
+ <div class="entry-edit modulecretor-help">
368
+ <div class="entry-edit-head collapseable">
369
+ <a href="#" class="open" onclick="return toggleHelp(this, 'modulecreator_help_relations_container')"><?php echo Mage::helper('modulecreator')->__('Relations') ?></a>
370
+ </div>
371
+ <div id="modulecreator_help_relations_container" class="box custom-options">
372
+ <p>
373
+ <?php echo Mage::helper('modulecreator')->__('This tab appears when you have 2 or more entities')?><br />
374
+ <?php echo Mage::helper('modulecreator')->__('It allows you to create relations between entities.')?>
375
+ </p>
376
+ <strong><?php echo Mage::helper('modulecreator')->__('Relation types');?></strong>
377
+ <ul>
378
+ <li>
379
+ <strong><?php echo Mage::helper('modulecreator')->__('--None--')?> : </strong>
380
+ <?php echo Mage::helper('modulecreator')->__('This means that there is no relation between your entities');?>
381
+ </li>
382
+ <li>
383
+ <strong><?php echo Mage::helper('modulecreator')->__('Is sibling with')?> : </strong>
384
+ <?php echo Mage::helper('modulecreator')->__('This means that there is a many to many relation between your entities.');?><br />
385
+ <?php echo Mage::helper('modulecreator')->__('If 2 entities are siblings then a new table will be created to hold the ids of the related entities');?>
386
+ </li>
387
+ <li>
388
+ <strong><?php echo Mage::helper('modulecreator')->__('Is parent for')?> : </strong>
389
+ <?php echo Mage::helper('modulecreator')->__('This means that there is a one to many relation between your entities.');?><br />
390
+ <?php echo Mage::helper('modulecreator')->__('A new column will be added in the child entity\'s table that will reference the parent entity.');?>
391
+ </li>
392
+ <li>
393
+ <strong><?php echo Mage::helper('modulecreator')->__('Is child of')?> : </strong>
394
+ <?php echo Mage::helper('modulecreator')->__('This means that there is a one to many relation between your entities but the other way around.');?>
395
+ <?php echo Mage::helper('modulecreator')->__('A new column will be added in the child entity\'s table that will reference the parent entity.');?>
396
+ </li>
397
+ </ul>
398
+ </div>
399
+ </div>
400
+ <script type="text/javascript">
401
+ function toggleHelp(element, container){
402
+ if ($(element).hasClassName('open')){
403
+ $(container).hide();
404
+ $(element).removeClassName('open');
405
+ $(element).addClassName('closed');
406
+ }
407
+ else{
408
+ $(container).show();
409
+ $(element).removeClassName('closed');
410
+ $(element).addClassName('open');
411
+ }
412
+ return false;
413
+ }
414
+ </script>
app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/relation.phtml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * entities relations tab
19
+ *
20
+ * @category Ultimate
21
+ * @package Ultimate_ModuleCreator
22
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
23
+ */
24
+ ?>
25
+ <?php $_relations = $this->getRelations();?>
26
+ <div class="entry-edit modulecreator-entities">
27
+ <div class="entry-edit-head">
28
+ <h4><?php echo Mage::helper('modulecreator')->__('Entity Relations') ?></h4>
29
+ </div>
30
+ <div class="box">
31
+ <?php echo Mage::helper('modulecreator')->__('In this tab you can set the relations between your entities');?>
32
+ <ul>
33
+ <li>
34
+ <strong><?php echo Mage::helper('modulecreator')->__('--None--')?> : </strong>
35
+ <?php echo Mage::helper('modulecreator')->__('This means that there is no relation between your entities');?>
36
+ </li>
37
+ <li>
38
+ <strong><?php echo Mage::helper('modulecreator')->__('Is sibling with')?> : </strong>
39
+ <?php echo Mage::helper('modulecreator')->__('This means that there is a many to many relation between your entities.');?>
40
+ </li>
41
+ <li>
42
+ <strong><?php echo Mage::helper('modulecreator')->__('Is parent for')?> : </strong>
43
+ <?php echo Mage::helper('modulecreator')->__('This means that there is a one to many relation between your entities.');?>
44
+ </li>
45
+ <li>
46
+ <strong><?php echo Mage::helper('modulecreator')->__('Is child of')?> : </strong>
47
+ <?php echo Mage::helper('modulecreator')->__('This means that there is a one to many relation between your entities but the other way around.');?>
48
+ </li>
49
+ </ul>
50
+ </div>
51
+ <div id="modulecreator_relations_container" class="box custom-options">
52
+ <div id="modulecreator_relations_container_top"></div>
53
+ <?php foreach ($_relations as $k=>$values) : ?>
54
+ <?php foreach ($values as $k1=>$v) : ?>
55
+ <div id="relations_container_<?php echo $k?>_<?php echo $k1?>" class="relation-holder" style="margin-bottom:5px;">
56
+ <div class="relation-title-<?php echo $k?>" style="width:100px;text-align:right;float:left">
57
+ &nbsp;<?php echo $v->getT0();?>&nbsp;
58
+ </div>
59
+ <div style="float:left">
60
+ <?php echo $this->getRelationSelect('relation_'.$k.'_'.$k1, 'relation['.$k.']['.$k1.']', $v->getVal())?>
61
+ </div>
62
+ <div class="relation-title-<?php echo $k1?>" style="width:100px;text-align:left;float:left">
63
+ &nbsp;<?php echo $v->getT1();?>&nbsp;
64
+ </div>
65
+ <div style="clear:both"></div>
66
+ </div>
67
+ <?php endforeach;?>
68
+ <?php endforeach;?>
69
+ <div id="modulecreator_relations_container_bottom"></div>
70
+ </div>
71
+ </div>
72
+ <script type="text/javascript">
73
+ //<![CDATA[
74
+ var relationTemplate = '<div id="relations_container_#{entity1}_#{entity2}" class="relation-holder" style="margin-bottom:5px;"><div class="relation-title-#{entity1}" style="width:100px;text-align:right;float:left">#{Entity1}</div><div style="float:left"><?php echo $this->getRelationSelect('relation_#{entity1}_#{entity2}', 'relation[#{entity1}][#{entity2}]', '')?></div><div class="relation-title-#{entity2}" style="width:100px;text-align:left;float:left">#{Entity2}</div><div style="clear:both"></div></div>';
75
+ var relTemplate = new Template(relationTemplate);
76
+ function checkRelations(){
77
+ var _entities = $$('.modulecreator-entity');
78
+ if (_entities.length > 1){
79
+ $('modulecreator_info_tabs_relations').up().show();
80
+ for (var i = 0;i<_entities.length - 1;i++){
81
+ var fId = $(_entities[i]).down('.option-box').id;
82
+ var parts = fId.split('_');
83
+ fId = parts[1];
84
+ for (var j = i+1;j<_entities.length;j++){
85
+ var sId = $(_entities[j]).down('.option-box').id;
86
+ var parts = sId.split('_');
87
+ sId = parts[1];
88
+ if (!$('relation_' + fId + '_' + sId)){
89
+ var data = {};
90
+ data.entity1 = fId;
91
+ data.entity2 = sId;
92
+ data.Entity1 = '&nbsp;' + $('entity_' + fId +'_title').innerHTML + '&nbsp;';
93
+ data.Entity2 = '&nbsp;' + $('entity_' + sId +'_title').innerHTML + '&nbsp;';
94
+ var content = relTemplate.evaluate(data);
95
+ Element.insert('modulecreator_relations_container_bottom', {'before':content});
96
+ }
97
+ }
98
+ }
99
+ }
100
+ else{
101
+ $('modulecreator_info_tabs_relations').up().hide();
102
+ }
103
+ }
104
+ document.observe("dom:loaded", function() {
105
+ checkRelations();
106
+ });
107
+ //]]>
108
+ </script>
app/design/adminhtml/default/default/template/ultimate_modulecreator/tooltip.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ultimate_ModuleCreator extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE_UMC.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Ultimate
13
+ * @package Ultimate_ModuleCreator
14
+ * @copyright Copyright (c) 2012
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * @category Ultimate
19
+ * @package Ultimate_ModuleCreator
20
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
21
+ */
22
+ ?>
23
+ <?php $additional = '<br /><br />'.Mage::helper('modulecreator')->__('For more information check the <a href="#" class="help-link" onclick="%s">Help Tab</a>', 'Dialog.okCallback();fireEvent($(\'modulecreator_info_tabs_help\'), \'click\');return false;');?>
24
+ <div class="f-right">
25
+ <a class="link-store-scope" onclick="Dialog.alert('<?php echo $this->jsQuoteEscape($this->htmlEscape($this->getMessage().$additional))?>', {className:'magento',width:300,okLabel: '<?php echo Mage::helper('modulecreator')->__('Close')?>', buttonClass: 'scalable',id: '<?php echo md5($this->getMessage())?>', title: '<?php echo $this->jsQuoteEscape($this->htmlEscape($this->getTitle()))?>'});return false;">
26
+ </a>
27
+ </div>
app/etc/modules/Ultimate_ModuleCreator.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ **
4
+ * Ultimate_ModuleCreator extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE_UMC.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Ultimate
14
+ * @package Ultimate_ModuleCreator
15
+ * @copyright Copyright (c) 2012
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ /**
19
+ * @category Ultimate
20
+ * @package Ultimate_ModuleCreator
21
+ * @author Marius Strajeru <marius.strajeru@gmail.com>
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <Ultimate_ModuleCreator>
27
+ <active>true</active>
28
+ <codePool>community</codePool>
29
+ <depends>
30
+ <Mage_Core />
31
+ <Mage_Catalog />
32
+ </depends>
33
+ </Ultimate_ModuleCreator>
34
+ </modules>
35
+ </config>
app/locale/en_US/Ultimate_ModuleCreator.csv ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """in_rss"" is a reserved attribute name. If you want to add it set ""Create RSS feed"" to ""Yes"",""""""in_rss"""" is a reserved attribute name. If you want to add it set """"Create RSS feed"""" to """"Yes"""""",""false"""
2
+ """meta_description"" is a reserved attribute name. If you want to add it set ""Add SEO Attributes"" to ""Yes"",""""""meta_description"""" is a reserved attribute name. If you want to add it set """"Add SEO Attributes"""" to """"Yes"""""",""false"""
3
+ """meta_keywords"" is a reserved attribute name. If you want to add it set ""Add SEO Attributes"" to ""Yes"",""""""meta_keywords"""" is a reserved attribute name. If you want to add it set """"Add SEO Attributes"""" to """"Yes"""""",""false"""
4
+ """meta_title"" is a reserved attribute name. If you want to add it set ""Add SEO Attributes"" to ""Yes"",""""""meta_title"""" is a reserved attribute name. If you want to add it set """"Add SEO Attributes"""" to """"Yes"""""",""false"""
5
+ """status"" is a reserved attribute name. If you want to add it set ""Add Status field"" to ""Yes"",""""""status"""" is a reserved attribute name. If you want to add it set """"Add Status field"""" to """"Yes"""""",""false"""
6
+ "--None--,""--None--"",""false"""
7
+ "A link to the entity RSS feed will also be added in the default Magento RSS list page.,""A link to the entity RSS feed will also be added in the default Magento RSS list page."",""false"""
8
+ "A module cannot be named %s,""A module cannot be named %s"",""false"""
9
+ "A new column will be added in the child entity\'s table that will reference the parent entity.,""A new column will be added in the child entity\'s table that will reference the parent entity."",""false"""
10
+ "Action,""Action"",""true"""
11
+ "Acts as name,""Acts as name"",""false"""
12
+ "Add ""Created at"" to admin grid,""Add """"Created at"""" to admin grid"",""false"""
13
+ "Add ""SEO"" attributes - title, description, keywords,""Add """"SEO"""" attributes - title, description, keywords"",""false"""
14
+ "Add ""Status"" field,""Add """"Status"""" field"",""false"""
15
+ "Add ""Updated at"" to admin grid,""Add """"Updated at"""" to admin grid"",""false"""
16
+ "Add SEO attributes,""Add SEO attributes"",""false"""
17
+ "Add at least one entity,""Add at least one entity"",""false"""
18
+ "Add entity,""Add entity"",""false"""
19
+ "Add field,""Add field"",""false"""
20
+ "Add in admin grid,""Add in admin grid"",""false"""
21
+ "Add module,""Add module"",""false"""
22
+ "Added at the top of every generated file.,""Added at the top of every generated file."",""false"""
23
+ "Additional,""Additional"",""false"""
24
+ "Additional Data,""Additional Data"",""false"""
25
+ "Admin,""Admin"",""true"""
26
+ "Admin layout file,""Admin layout file"",""false"""
27
+ "Adminhtml observer,""Adminhtml observer"",""false"""
28
+ "Adminhtml xml,""Adminhtml xml"",""false"""
29
+ "An attribute cannot be named %s.,""An attribute cannot be named %s."",""false"""
30
+ "An attribute named ""created_at"" will be added by default to your entity,""An attribute named """"created_at"""" will be added by default to your entity"",""false"""
31
+ "An attribute named ""updated_at"" will be added by default to your entity,""An attribute named """"updated_at"""" will be added by default to your entity"",""false"""
32
+ "An attribute that acts as name must have the type ""Text"".,""An attribute that acts as name must have the type """"Text""""."",""false"""
33
+ "An attribute with the code ""%s"" already exists for entity ""%s"",""An attribute with the code """"%s"""" already exists for entity """"%s"""""",""false"""
34
+ "An entity cannot be named %s,""An entity cannot be named %s"",""false"""
35
+ "An entity cannot be named %s inside the module %s,""An entity cannot be named %s inside the module %s"",""false"""
36
+ "An entity with the code ""%s"" already exists,""An entity with the code """"%s"""" already exists"",""false"""
37
+ "Are you sure?,""Are you sure?"",""true"""
38
+ "Attribute %s,""Attribute %s"",""false"""
39
+ "Attribute Code,""Attribute Code"",""true"""
40
+ "Attribute Label,""Attribute Label"",""true"""
41
+ "Attribute Type,""Attribute Type"",""false"""
42
+ "Back,""Back"",""true"""
43
+ "Catalog,""Catalog"",""true"""
44
+ "Close,""Close"",""true"""
45
+ "Code pool,""Code pool"",""false"""
46
+ "Config xml,""Config xml"",""false"""
47
+ "Continue,""Continue"",""true"""
48
+ "Create Link/View widget,""Create Link/View widget"",""false"""
49
+ "Create Module,""Create Module"",""false"""
50
+ "Create RSS feed,""Create RSS feed"",""false"""
51
+ "Create archive. I will install it later,""Create archive. I will install it later"",""false"""
52
+ "Create entity list page,""Create entity list page"",""false"""
53
+ "Create entity view page,""Create entity view page"",""false"""
54
+ "Create frontend files,""Create frontend files"",""false"""
55
+ "Create frontend list files,""Create frontend list files"",""false"""
56
+ "Create frontend view files,""Create frontend view files"",""false"""
57
+ "Create new module,""Create new module"",""false"""
58
+ "Current menu order,""Current menu order"",""false"""
59
+ "Decimal,""Decimal"",""true"""
60
+ "Default codepool,""Default codepool"",""false"""
61
+ "Default entity frontend list layout,""Default entity frontend list layout"",""false"""
62
+ "Default entity frontend view layout,""Default entity frontend view layout"",""false"""
63
+ "Default image,""Default image"",""false"""
64
+ "Default install setting,""Default install setting"",""false"""
65
+ "Default licence,""Default licence"",""false"""
66
+ "Default namespace,""Default namespace"",""false"""
67
+ "Default settings,""Default settings"",""false"""
68
+ "Depending on the attribute type you can/must configure additional data.,""Depending on the attribute type you can/must configure additional data."",""false"""
69
+ "Design,""Design"",""true"""
70
+ "Display in rss feed,""Display in rss feed"",""false"""
71
+ "Display in widget,""Display in widget"",""false"""
72
+ "Download,""Download"",""true"""
73
+ "Each entity has a field called created_at and one called updated_at that remembers when the item was created and saved last. Setting these wo ""Yes"" will add these columns to the admin gird.,""Each entity has a field called created_at and one called updated_at that remembers when the item was created and saved last. Setting these wo """"Yes"""" will add these columns to the admin gird."",""false"""
74
+ "Each entity must have an attribute set to behave as ""Name"",""Each entity must have an attribute set to behave as """"Name"""""",""false"""
75
+ "Each entity must have an attribute to behave as ""Name"". This attribute will be used to identify diffrent entitities among themselves. This option is available only for text attributes.,""Each entity must have an attribute to behave as """"Name"""". This attribute will be used to identify diffrent entitities among themselves. This option is available only for text attributes."",""false"""
76
+ "Edit ""%s"" module,""Edit """"%s"""" module"",""false"""
77
+ "Entities,""Entities"",""false"""
78
+ "Entity %s,""Entity %s"",""false"""
79
+ "Entity - admin product tab,""Entity - admin product tab"",""false"""
80
+ "Entity - product relation model,""Entity - product relation model"",""false"""
81
+ "Entity Relations,""Entity Relations"",""false"""
82
+ "Entity children list block,""Entity children list block"",""false"""
83
+ "Entity code - plural,""Entity code - plural"",""false"""
84
+ "Entity code - singular,""Entity code - singular"",""false"""
85
+ "Entity default settings,""Entity default settings"",""false"""
86
+ "Entity fields,""Entity fields"",""false"""
87
+ "Entity label - plural,""Entity label - plural"",""false"""
88
+ "Entity label - singular,""Entity label - singular"",""false"""
89
+ "Entity list on product page,""Entity list on product page"",""false"""
90
+ "Entity list on product page template,""Entity list on product page template"",""false"""
91
+ "Entity list page template,""Entity list page template"",""false"""
92
+ "Entity name - plural,""Entity name - plural"",""false"""
93
+ "Entity name - singular,""Entity name - singular"",""false"""
94
+ "Entity product admin controller,""Entity product admin controller"",""false"""
95
+ "Entity sibling admin relation tab,""Entity sibling admin relation tab"",""false"""
96
+ "Entity sibling list block,""Entity sibling list block"",""false"""
97
+ "Entity sibling model,""Entity sibling model"",""false"""
98
+ "Entity sibling relation resource collection model,""Entity sibling relation resource collection model"",""false"""
99
+ "Entity sibling relation resource model,""Entity sibling relation resource model"",""false"""
100
+ "Entity siblings list template,""Entity siblings list template"",""false"""
101
+ "Entity tab on product form,""Entity tab on product form"",""false"""
102
+ "Entity view page template,""Entity view page template"",""false"""
103
+ "Extension %s already exists,""Extension %s already exists"",""false"""
104
+ "Extension name can not be empty.,""Extension name can not be empty."",""false"""
105
+ "Fields,""Fields"",""false"""
106
+ "File,""File"",""true"""
107
+ "Fill in the Module name,""Fill in the Module name"",""false"""
108
+ "Fill in the Namespace,""Fill in the Namespace"",""false"""
109
+ "Flat entity RSS block.,""Flat entity RSS block."",""false"""
110
+ "Flat entity admin block.,""Flat entity admin block."",""false"""
111
+ "Flat entity admin edit form.,""Flat entity admin edit form."",""false"""
112
+ "Flat entity admin edit tabs.,""Flat entity admin edit tabs."",""false"""
113
+ "Flat entity admin file renderer.,""Flat entity admin file renderer."",""false"""
114
+ "Flat entity admin form tab.,""Flat entity admin form tab."",""false"""
115
+ "Flat entity admin grid.,""Flat entity admin grid."",""false"""
116
+ "Flat entity admin image renderer.,""Flat entity admin image renderer."",""false"""
117
+ "Flat entity admin widget chooser.,""Flat entity admin widget chooser."",""false"""
118
+ "Flat entity admin widget controller.,""Flat entity admin widget controller."",""false"""
119
+ "Flat entity amdin controller.,""Flat entity amdin controller."",""false"""
120
+ "Flat entity front controller.,""Flat entity front controller."",""false"""
121
+ "Flat entity frontend list block.,""Flat entity frontend list block."",""false"""
122
+ "Flat entity frontend view block.,""Flat entity frontend view block."",""false"""
123
+ "Flat entity helper.,""Flat entity helper."",""false"""
124
+ "Flat entity image helper.,""Flat entity image helper."",""false"""
125
+ "Flat entity link widget.,""Flat entity link widget."",""false"""
126
+ "Flat entity model,""Flat entity model"",""false"""
127
+ "Flat entity resource model.,""Flat entity resource model."",""false"""
128
+ "Flat entity view widget.,""Flat entity view widget."",""false"""
129
+ "For each entity you can add one or more attributes/fields of different types.,""For each entity you can add one or more attributes/fields of different types."",""false"""
130
+ "For more information check the <a href=""#"" class=""help-link"" onclick=""%s"">Help Tab</a>,""For more information check the <a href=""""#"""" class=""""help-link"""" onclick=""""%s"""">Help Tab</a>"",""false"""
131
+ "For security reasons you cannot name a module just like an existing one even in a different namespace: ""Catalog"", ""Sales"", ""Checkout""...,""For security reasons you cannot name a module just like an existing one even in a different namespace: """"Catalog"""", """"Sales"""", """"Checkout""""..."",""false"""
132
+ "Frontend,""Frontend"",""true"""
133
+ "Frontend layout file,""Frontend layout file"",""false"""
134
+ "Frontend list template,""Frontend list template"",""false"""
135
+ "Frontend package,""Frontend package"",""false"""
136
+ "Frontend rss list,""Frontend rss list"",""false"""
137
+ "Frontend theme - layout,""Frontend theme - layout"",""false"""
138
+ "Frontend theme - templates,""Frontend theme - templates"",""false"""
139
+ "Frontend view template,""Frontend view template"",""false"""
140
+ "General Information,""General Information"",""true"""
141
+ "General Settings,""General Settings"",""true"""
142
+ "General description,""General description"",""false"""
143
+ "Global,""Global"",""true"""
144
+ "Help,""Help"",""true"""
145
+ "Here are some examples: ""Article"", ""Testimonial"", ""Post"".,""Here are some examples: """"Article"""", """"Testimonial"""", """"Post""""."",""false"""
146
+ "If 2 entities are siblings then a new table will be created to hold the ids of the related entities,""If 2 entities are siblings then a new table will be created to hold the ids of the related entities"",""false"""
147
+ "If this is enabled in the entity list page in front-end where will be a link to the RSS feed.,""If this is enabled in the entity list page in front-end where will be a link to the RSS feed."",""false"""
148
+ "If you choose to install it directly, backup your Mangeto instance first, just in case.,""If you choose to install it directly, backup your Mangeto instance first, just in case."",""false"""
149
+ "If you decide to create a list page of your entities you can set the main layout from here.,""If you decide to create a list page of your entities you can set the main layout from here."",""false"""
150
+ "If you decide to create a view page of your entities you can set the main layout from here.,""If you decide to create a view page of your entities you can set the main layout from here."",""false"""
151
+ "If you disable the RSS feeds in Magento this will also be disabled.,""If you disable the RSS feeds in Magento this will also be disabled."",""false"""
152
+ "If you don\'t have a default Magento RSS feed enabled but you have enabled the one for your entity then in the RSS list page the message ""There are no RSS feeds"" will appear and below it the link to the RSS feed of your entity.,""If you don\'t have a default Magento RSS feed enabled but you have enabled the one for your entity then in the RSS list page the message """"There are no RSS feeds"""" will appear and below it the link to the RSS feed of your entity."",""false"""
153
+ "Image,""Image"",""true"""
154
+ "In the example above for the author entity you can add the attribute ""name"" to behave as name and for the testimonial entity you can add the attribute ""title"" to behave as name.,""In the example above for the author entity you can add the attribute """"name"""" to behave as name and for the testimonial entity you can add the attribute """"title"""" to behave as name."",""false"""
155
+ "In this tab you can set the relations between your entities,""In this tab you can set the relations between your entities"",""false"""
156
+ "Include ""Status"" field,""Include """"Status"""" field"",""false"""
157
+ "Insert here,""Insert here"",""false"""
158
+ "Install new extension on the current instance.,""Install new extension on the current instance."",""false"""
159
+ "Install script,""Install script"",""false"""
160
+ "Integer,""Integer"",""true"""
161
+ "Is child of,""Is child of"",""false"""
162
+ "Is name,""Is name"",""false"""
163
+ "Is parent for,""Is parent for"",""false"""
164
+ "Is required,""Is required"",""false"""
165
+ "Is siblig with,""Is siblig with"",""false"""
166
+ "Is sibling with,""Is sibling with"",""false"""
167
+ "It allows you to create relations between entities.,""It allows you to create relations between entities."",""false"""
168
+ "Known issues:,""Known issues:"",""false"""
169
+ "License,""License"",""true"""
170
+ "Link ""many to many"" with prodcts,""Link """"many to many"""" with prodcts"",""false"""
171
+ "Link widget,""Link widget"",""false"""
172
+ "Manage modules,""Manage modules"",""false"""
173
+ "Menu item,""Menu item"",""false"""
174
+ "Menu sort order,""Menu sort order"",""false"""
175
+ "Module,""Module"",""false"""
176
+ "Module RSS block.,""Module RSS block."",""false"""
177
+ "Module base admin controller.,""Module base admin controller."",""false"""
178
+ "Module creator,""Module creator"",""false"""
179
+ "Module declaration xml,""Module declaration xml"",""false"""
180
+ "Module default helper.,""Module default helper."",""false"""
181
+ "Module information,""Module information"",""false"""
182
+ "Module name,""Module name"",""false"""
183
+ "Module setup model.,""Module setup model."",""false"""
184
+ "Module translation file,""Module translation file"",""false"""
185
+ "Name settings,""Name settings"",""false"""
186
+ "Namespace,""Namespace"",""false"""
187
+ "No,""No"",""true"""
188
+ "Note,""Note"",""false"""
189
+ "Now this is to obvious!!! I can\' belive you clicked the tooltip.,""Now this is to obvious!!! I can\' belive you clicked the tooltip."",""false"""
190
+ "Position,""Position"",""true"""
191
+ "Product helper,""Product helper"",""false"""
192
+ "Product list on entity page,""Product list on entity page"",""false"""
193
+ "Relation types,""Relation types"",""false"""
194
+ "Relations,""Relations"",""false"""
195
+ "Remove entity,""Remove entity"",""false"""
196
+ "Remove field,""Remove field"",""false"""
197
+ "Reset,""Reset"",""true"""
198
+ "Same as above. This is used for a list of entities. For example if you put here ""articles"" all your variables related to article lists will be names $articles or $_articles,""Same as above. This is used for a list of entities. For example if you put here """"articles"""" all your variables related to article lists will be names $articles or $_articles"",""false"""
199
+ "Save,""Save"",""true"""
200
+ "Save and Continue Edit,""Save and Continue Edit"",""true"""
201
+ "See current menus sort order <a href=""#"" onclick=""%s"">here</a>,""See current menus sort order <a href=""""#"""" onclick=""""%s"""">here</a>"",""false"""
202
+ "Select a codepool,""Select a codepool"",""false"""
203
+ "Select action,""Select action"",""false"""
204
+ "Select scope,""Select scope"",""false"""
205
+ "Select type,""Select type"",""false"""
206
+ "Settings,""Settings"",""true"""
207
+ "Settings Tab,""Settings Tab"",""false"""
208
+ "Show associated entities on product page,""Show associated entities on product page"",""false"""
209
+ "Show associated product on entity page,""Show associated product on entity page"",""false"""
210
+ "Show in frontend,""Show in frontend"",""false"""
211
+ "Show in rss,""Show in rss"",""false"""
212
+ "Show in widget,""Show in widget"",""false"""
213
+ "Sort order,""Sort order"",""false"""
214
+ "Store View,""Store View"",""true"""
215
+ "System xml,""System xml"",""false"""
216
+ "Text,""Text"",""true"""
217
+ "Textarea,""Textarea"",""false"""
218
+ "The Module Creator also gives you the posibility to use any entity as a widget in the CMS pages and blocks. This allows you to include the attribute in the widget. Is available for all attribute types.,""The Module Creator also gives you the posibility to use any entity as a widget in the CMS pages and blocks. This allows you to include the attribute in the widget. Is available for all attribute types."",""false"""
219
+ "The attribute marked this way will be used in lists and dropdowns.,""The attribute marked this way will be used in lists and dropdowns."",""false"""
220
+ "The attribute set to behave as ""Name"" will be includer by default. Also the ""Status"" attribute if you choose to create one.,""The attribute set to behave as """"Name"""" will be includer by default. Also the """"Status"""" attribute if you choose to create one."",""false"""
221
+ "The attribute set to behave as ""Name"" will be required by default.,""The attribute set to behave as """"Name"""" will be required by default."",""false"""
222
+ "The following files already exist. They were NOT overwritten. The extension was not installed. You can download it from the list of extensions and install it manually: %s,""The following files already exist. They were NOT overwritten. The extension was not installed. You can download it from the list of extensions and install it manually: %s"",""false"""
223
+ "The following files have been modified outside the Magento context. If you choose to continue all modifications will be overwritten.,""The following files have been modified outside the Magento context. If you choose to continue all modifications will be overwritten."",""false"""
224
+ "There are entities without attribtues. Add attributes or remove them before continuing.,""There are entities without attribtues. Add attributes or remove them before continuing."",""false"""
225
+ "There are some naming restriction. For example the code cannot be: ""data"", ""child"",""There are some naming restriction. For example the code cannot be: """"data"""", """"child"""""",""false"""
226
+ "There are some naming restriction. For example the code cannot be: ""resource"", ""setup"", ""adminhtml"",""There are some naming restriction. For example the code cannot be: """"resource"""", """"setup"""", """"adminhtml"""""",""false"""
227
+ "There is no way of avoiding this without overwriting core behavior,""There is no way of avoiding this without overwriting core behavior"",""false"""
228
+ "This Magento codepools are ""local"", ""community"" and ""core"" but you shouldn\'t touch the ""core"".,""This Magento codepools are """"local"""", """"community"""" and """"core"""" but you shouldn\'t touch the """"core""""."",""false"""
229
+ "This allows you to create a frontend list page for your entity.,""This allows you to create a frontend list page for your entity."",""false"""
230
+ "This allows you to create a frontend skeleton for your entity.,""This allows you to create a frontend skeleton for your entity."",""false"""
231
+ "This allows you to create a frontend view page for your entity.,""This allows you to create a frontend view page for your entity."",""false"""
232
+ "This allows you to create an archive with your extension located in /var/modulecreator folder of your current instance so you can edit it later or install it later manually by copying the ""app"" folder in the archive over the ""app"" folder of your instance and the ""skin"" folder in the archive over the ""skin"" folder of your instance.,""This allows you to create an archive with your extension located in /var/modulecreator folder of your current instance so you can edit it later or install it later manually by copying the """"app"""" folder in the archive over the """"app"""" folder of your instance and the """"skin"""" folder in the archive over the """"skin"""" folder of your instance."",""false"""
233
+ "This allows you to create an archive with your extension located in var/modulecreator folder of your current instance so you can edit it later or install it later manually by copying the ""app"" folder in the archive over the ""app"" folder of your instance and the ""skin"" folder in the archive over the ""skin"" folder of your instance. If you choose to install it directly please backup first. If you choose to install it you won\'t be able to edit it later.,""This allows you to create an archive with your extension located in var/modulecreator folder of your current instance so you can edit it later or install it later manually by copying the """"app"""" folder in the archive over the """"app"""" folder of your instance and the """"skin"""" folder in the archive over the """"skin"""" folder of your instance. If you choose to install it directly please backup first. If you choose to install it you won\'t be able to edit it later."",""false"""
234
+ "This allows you to decide if you generate or not the frontend files for listing your entities.,""This allows you to decide if you generate or not the frontend files for listing your entities."",""false"""
235
+ "This allows you to decide if you generate or not the frontend files for the entity.,""This allows you to decide if you generate or not the frontend files for the entity."",""false"""
236
+ "This allows you to decide if you generate or not the frontend files for viewing your entities.,""This allows you to decide if you generate or not the frontend files for viewing your entities."",""false"""
237
+ "This allows you to display the attribute as a column in the admin grid of the entity. Is available for attributes with type Text, Int, Decimal, Yes/No and Timestamp.,""This allows you to display the attribute as a column in the admin grid of the entity. Is available for attributes with type Text, Int, Decimal, Yes/No and Timestamp."",""false"""
238
+ "This allows you to generate the code to show the attribute value in the frontend. Is available for all attribute types.,""This allows you to generate the code to show the attribute value in the frontend. Is available for all attribute types."",""false"""
239
+ "This allows you to include the attribute in the rss feed for the entity, if you chose to create one. Is available for all attribute types.,""This allows you to include the attribute in the rss feed for the entity, if you chose to create one. Is available for all attribute types."",""false"""
240
+ "This allows you to select the layout of the list page.,""This allows you to select the layout of the list page."",""false"""
241
+ "This allows you to select the layout of the view page.,""This allows you to select the layout of the view page."",""false"""
242
+ "This allows you to use a WYSIWYG editor for the attribute. It is available only for Textarea attributes.,""This allows you to use a WYSIWYG editor for the attribute. It is available only for Textarea attributes."",""false"""
243
+ "This could have been autogenerated from the singular form, but it\'s safer if you input it manually.,""This could have been autogenerated from the singular form, but it\'s safer if you input it manually."",""false"""
244
+ "This extension generates the sourse code for a simple Magento extension.,""This extension generates the sourse code for a simple Magento extension."",""false"""
245
+ "This is a required field.,""This is a required field."",""true"""
246
+ "This is the attribute code. It will be used in the code and in the database.,""This is the attribute code. It will be used in the code and in the database."",""false"""
247
+ "This is the attribute code. It will be used in the logic of the extension. Use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.,""This is the attribute code. It will be used in the logic of the extension. Use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter."",""false"""
248
+ "This is the attribute label that will be visible in the back-end in the add/edit form and in some cases in frontend.,""This is the attribute label that will be visible in the back-end in the add/edit form and in some cases in frontend."",""false"""
249
+ "This is the attribute label. It will be used for the admin form and the frontend listing.,""This is the attribute label. It will be used for the admin form and the frontend listing."",""false"""
250
+ "This is the attribute type. You can choose from the available options: Text, Int, Decimal Textarea, Yes/No, Timestamp, File, Image, Website.,""This is the attribute type. You can choose from the available options: Text, Int, Decimal Textarea, Yes/No, Timestamp, File, Image, Website."",""false"""
251
+ "This is the code (singular) of your entity. This is how the variables relating to your entities will be named.,""This is the code (singular) of your entity. This is how the variables relating to your entities will be named."",""false"""
252
+ "This is the code (singular) of your entity. This is how the variables relating to your entity will be named.,""This is the code (singular) of your entity. This is how the variables relating to your entity will be named."",""false"""
253
+ "This is the code folder in which your extension will be installed. If you don\'t know what goes here, choose ""local"",""This is the code folder in which your extension will be installed. If you don\'t know what goes here, choose """"local"""""",""false"""
254
+ "This is the code of the entity. It will be used in the code to make it more human readable. For example, if you put ""article"" here all variables related to your entity will be named $article or $_article. It is also used for naming some generated files.,""This is the code of the entity. It will be used in the code to make it more human readable. For example, if you put """"article"""" here all variables related to your entity will be named $article or $_article. It is also used for naming some generated files."",""false"""
255
+ "This is the folder name of your new extension. Your company name could go here. Use only letters and numbers. Start with a capital letter.,""This is the folder name of your new extension. Your company name could go here. Use only letters and numbers. Start with a capital letter."",""false"""
256
+ "This is the label (plural) that will appear through the website for your entity.,""This is the label (plural) that will appear through the website for your entity."",""false"""
257
+ "This is the label (singular) that will appear through the website for your entity.,""This is the label (singular) that will appear through the website for your entity."",""false"""
258
+ "This is the label of the entity (noun) in plural form. It will appear all over the module. As an example, if you set this label to ""Article"", in the admin for you will see the button ""Delete Articles"",""This is the label of the entity (noun) in plural form. It will appear all over the module. As an example, if you set this label to """"Article"""", in the admin for you will see the button """"Delete Articles"""""",""false"""
259
+ "This is the label of the entity (noun) in singular form. It will appear all over the module. As an example, if you set this label to ""Article"", in the admin for you will see the button ""Add Article"",""This is the label of the entity (noun) in singular form. It will appear all over the module. As an example, if you set this label to """"Article"""", in the admin for you will see the button """"Add Article"""""",""false"""
260
+ "This is the name of the design interface (package) of your mangento instance. If you don\'t know what goes here put ""base"".,""This is the name of the design interface (package) of your mangento instance. If you don\'t know what goes here put """"base""""."",""false"""
261
+ "This is the name of the theme of your mangento instance for the layout files. If you don\'t know what goes here put ""default"".,""This is the name of the theme of your mangento instance for the layout files. If you don\'t know what goes here put """"default""""."",""false"""
262
+ "This is the name of the theme of your mangento instance for the template files. If you don\'t know what goes here put ""default"".,""This is the name of the theme of your mangento instance for the template files. If you don\'t know what goes here put """"default""""."",""false"""
263
+ "This is your extension name. Start with a capital letter.,""This is your extension name. Start with a capital letter."",""false"""
264
+ "This is your extension name. You cannot name your extension with an existing name, not even under a different namespace.,""This is your extension name. You cannot name your extension with an existing name, not even under a different namespace."",""false"""
265
+ "This means that there is a many to many relation between your entities.,""This means that there is a many to many relation between your entities."",""false"""
266
+ "This means that there is a one to many relation between your entities but the other way around.,""This means that there is a one to many relation between your entities but the other way around."",""false"""
267
+ "This means that there is a one to many relation between your entities.,""This means that there is a one to many relation between your entities."",""false"""
268
+ "This means that there is no relation between your entities,""This means that there is no relation between your entities"",""false"""
269
+ "This sets the attribute as required in the admin add/edit form. Is available for all the attribute types.,""This sets the attribute as required in the admin add/edit form. Is available for all the attribute types."",""false"""
270
+ "This sets the position of the attribute in the admin add/edit form.,""This sets the position of the attribute in the admin add/edit form."",""false"""
271
+ "This sets the position of your extension menu in the entire admin menu.,""This sets the position of your extension menu in the entire admin menu."",""false"""
272
+ "This tab appears when you have 2 or more entities,""This tab appears when you have 2 or more entities"",""false"""
273
+ "This will add a colum with the creation date of the entity to the admin grid.,""This will add a colum with the creation date of the entity to the admin grid."",""false"""
274
+ "This will add a colum with the last update date of the entity to the admin grid.,""This will add a colum with the last update date of the entity to the admin grid."",""false"""
275
+ "This will add a comment under the field in the admin add/edit form.,""This will add a comment under the field in the admin add/edit form."",""false"""
276
+ "This will add a field that behaves a status. With it you will be able to decide what entities to show on frontend.,""This will add a field that behaves a status. With it you will be able to decide what entities to show on frontend."",""false"""
277
+ "This will add a view widget and a link widget that you will be able to use in CMS pages and blocks.,""This will add a view widget and a link widget that you will be able to use in CMS pages and blocks."",""false"""
278
+ "This will add an RSS feed with your entities to the list or Magento RSS feeds. You will be able to decide which entities appear in the RSS feed.,""This will add an RSS feed with your entities to the list or Magento RSS feeds. You will be able to decide which entities appear in the RSS feed."",""false"""
279
+ "This will add automatically the Meta title, Meta keywords and Meta description fields that will be used on frontend.,""This will add automatically the Meta title, Meta keywords and Meta description fields that will be used on frontend."",""false"""
280
+ "This will add to your entity 3 attributes. ""Meta title"", ""Meta Description"" and ""Meta Keywords"" and the logic to use them in the entity pages.,""This will add to your entity 3 attributes. """"Meta title"""", """"Meta Description"""" and """"Meta Keywords"""" and the logic to use them in the entity pages."",""false"""
281
+ "This will add to your entity a ""Status"" field that will allow you to activate and deactivate the entities in the frontend. If you choose not to create the frontend files for your entity then is useless to set this to ""Yes"" but you can still do it.,""This will add to your entity a """"Status"""" field that will allow you to activate and deactivate the entities in the frontend. If you choose not to create the frontend files for your entity then is useless to set this to """"Yes"""" but you can still do it."",""false"""
282
+ "This will add your attribute to the admin grid.,""This will add your attribute to the admin grid."",""false"""
283
+ "This will allow you to link your entity to the products. It will add a new tab in the product edit form with your entities and a tab in the entity edit form with the product.,""This will allow you to link your entity to the products. It will add a new tab in the product edit form with your entities and a tab in the entity edit form with the product."",""false"""
284
+ "This will allow you to use WYSIWYG editors for texareas.,""This will allow you to use WYSIWYG editors for texareas."",""false"""
285
+ "This will be added as a small comment under the input in the admin add/edit form.,""This will be added as a small comment under the input in the admin add/edit form."",""false"""
286
+ "This will create a new attribute for your entity called ""Show in Feed"" and will also create the logic for viewing your entities as RSS feeds.,""This will create a new attribute for your entity called """"Show in Feed"""" and will also create the logic for viewing your entities as RSS feeds."",""false"""
287
+ "This will create the code that will allow you to include widgets of your entities in the static pages and static blocks.,""This will create the code that will allow you to include widgets of your entities in the static pages and static blocks."",""false"""
288
+ "This will determine the input type of the attribute.,""This will determine the input type of the attribute."",""false"""
289
+ "This will determine the position in the admin add/edit form.,""This will determine the position in the admin add/edit form."",""false"""
290
+ "This will display the list of associated entities on the related product page. It may not be displayed if the design is not compatible but can be fixed from the layout xml of the entity.,""This will display the list of associated entities on the related product page. It may not be displayed if the design is not compatible but can be fixed from the layout xml of the entity."",""false"""
291
+ "This will display the list of associated products on the related entity page.,""This will display the list of associated products on the related entity page."",""false"""
292
+ "This will display this attribute in the rss feed.,""This will display this attribute in the rss feed."",""false"""
293
+ "This will display this attribute in the view widget.,""This will display this attribute in the view widget."",""false"""
294
+ "This will display this attribute on frontend.,""This will display this attribute on frontend."",""false"""
295
+ "Timestamp,""Timestamp"",""false"""
296
+ "To add a new entity click on ""Add Entity"",""To add a new entity click on """"Add Entity"""""",""false"""
297
+ "Top,""Top"",""false"""
298
+ "Try to use a noun in singular form.,""Try to use a noun in singular form."",""false"""
299
+ "Ultimate module creator,""Ultimate module creator"",""false"""
300
+ "Use WYSIWYG editor,""Use WYSIWYG editor"",""false"""
301
+ "Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} as placeholder for current year.,""Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} as placeholder for current year."",""false"""
302
+ "Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} for current year,""Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} for current year"",""false"""
303
+ "Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} for current year.,""Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} for current year."",""false"""
304
+ "View widget,""View widget"",""false"""
305
+ "Website,""Website"",""true"""
306
+ "While in BETA version this is disabled. It\'s for your own safety.,""While in BETA version this is disabled. It\'s for your own safety."",""false"""
307
+ "Widget xml,""Widget xml"",""false"""
308
+ "Yes,""Yes"",""true"""
309
+ "Yes/No,""Yes/No"",""true"""
310
+ "You are editing the module: %s,""You are editing the module: %s"",""false"""
311
+ "You can change the default value from <a href=""%s"">System->Configuration->Module Creator</a>->Settings->Default Action.,""You can change the default value from <a href=""""%s"""">System->Configuration->Module Creator</a>->Settings->Default Action."",""false"""
312
+ "You can change the default value from <a href=""%s"">System->Configuration->Module Creator</a>->Settings->Default Codepool.,""You can change the default value from <a href=""""%s"""">System->Configuration->Module Creator</a>->Settings->Default Codepool."",""false"""
313
+ "You can change the default value from <a href=""%s"">System->Configuration->Module Creator</a>->Settings->Default License.,""You can change the default value from <a href=""""%s"""">System->Configuration->Module Creator</a>->Settings->Default License."",""false"""
314
+ "You can change the default value from <a href=""%s"">System->Configuration->Module creator</a>->Settings->Default Namespace.,""You can change the default value from <a href=""""%s"""">System->Configuration->Module creator</a>->Settings->Default Namespace."",""false"""
315
+ "You can configure it to create back-end and frontend files.,""You can configure it to create back-end and frontend files."",""false"""
316
+ "You can create one or more entities under the same extension.,""You can create one or more entities under the same extension."",""false"""
317
+ "You can make relations between entities - many to many or one to many,""You can make relations between entities - many to many or one to many"",""false"""
318
+ "You can see the order of the current menus by clicking the link under the field.,""You can see the order of the current menus by clicking the link under the field."",""false"""
319
+ "Your extension archive was not created or is not readable,""Your extension archive was not created or is not readable"",""false"""
320
+ "Your extension has been created!,""Your extension has been created!"",""false"""
321
+ "entity - product model,""entity - product model"",""false"""
322
+ "entity - product relation resource model collection,""entity - product relation resource model collection"",""false"""
323
+ "or <a href=""#"" onclick=""%s"">here</a>,""or <a href=""""#"""" onclick=""""%s"""">here</a>"",""false"""
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Ultimate_ModuleCreator</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/MIT">MIT License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Develop custom Magento modules without writing any code. Use a module creator. Use this module creator</summary>
10
+ <description>This module allows you to create custom Magento modules for your own entities. You can create as many entities as you want in one extension, you can establish relations between them, decide to generate only back-end pages or both back-end and frontend pages.</description>
11
+ <notes> - Added entity relations&#xD;
12
+ - Added possibility for direct install&#xD;
13
+ - Added expand/collapse</notes>
14
+ <authors><author><name>Marius Strajeru</name><user>tzyganu</user><email>tzyganu@gmail.com</email></author></authors>
15
+ <date>2012-11-29</date>
16
+ <time>21:31:56</time>
17
+ <contents><target name="magecommunity"><dir name="Ultimate"><dir name="ModuleCreator"><dir name="Block"><dir name="Adminhtml"><dir name="Modulecreator"><dir name="Edit"><file name="Form.php" hash="cb4328ae858a31a31d76016e50b56739"/><dir name="Tab"><dir name="Entities"><dir name="Entity"><file name="Attribute.php" hash="daa6787fa3f72150fc86c4350be932da"/></dir><file name="Entity.php" hash="8d5b07f735a5a7107f1abf66bbb482da"/></dir><file name="Entities.php" hash="9ddc2bcedff2d34ad8105185eff7d9df"/><file name="Help.php" hash="304c68d68e9adf0962817e27877683b6"/><file name="Relation.php" hash="43730e74747b8e6e5985eee259e6db07"/><file name="Settings.php" hash="844ba2adfc748f966f57e4b30ac7a63a"/></dir><file name="Tabs.php" hash="578af9256efb3d516db14db7e396e5e3"/></dir><file name="Edit.php" hash="9d31d4c100a231811a6a80f3dd98deef"/><file name="Grid.php" hash="96ef8fa066b89937712b44991191f4de"/></dir><file name="Modulecreator.php" hash="b2630018b6f103d1a3f9e92ed7de7a54"/></dir></dir><file name="Exception.php" hash="aaef7086ff700d7132418cf68629246f"/><dir name="Helper"><file name="Adminhtml.php" hash="f913d91b1041032b35e4d0ca2fd20205"/><file name="Data.php" hash="f5481696ec4a7302cfaa22018b348749"/></dir><dir name="Model"><file name="Abstract.php" hash="33a186edb30b8ff3f54fda6690a90a2c"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Codepool.php" hash="045f0555fc545799148627e081ca8727"/><file name="Install.php" hash="7fb2fd108b5bed63b31ab9cfd0da25f5"/><file name="Layout.php" hash="3d63a2221b3a93926c662b3c10effc2c"/></dir></dir></dir></dir><dir name="Attribute"><dir name="Type"><file name="Abstract.php" hash="681df23324db6483e71689bf60dd443f"/><file name="Decimal.php" hash="593c993bfba24af511164987a8c11eb3"/><file name="File.php" hash="a8e18228577beb612f202acbe0ddb41a"/><file name="Image.php" hash="8dfbde0bf761b04864146be321197eb6"/><file name="Int.php" hash="7e06c84fa8a3c2940624248c386e2d67"/><file name="Text.php" hash="237217feda93dadf93a63f181ebb8793"/><file name="Textarea.php" hash="9a3ff71c39c6c1c2c2ed6ee1a8a36d67"/><file name="Timestamp.php" hash="d18d599090ac5fa824e44edf3fa14486"/><file name="Website.php" hash="f25bf7841bccae91f43df5e6d2444c6a"/><file name="Yesno.php" hash="dbb96529e483d587d8d8d99f176afa8b"/></dir></dir><file name="Attribute.php" hash="b6ab929edc78a41829630b0a02d59e5e"/><file name="Entity.php" hash="d6e178824e41ffd81152d44987e9f94b"/><dir name="Module"><file name="Collection.php" hash="0e413b976cbc9649ec982fe0f4b95dd1"/></dir><file name="Module.php" hash="a8fe6f428b73b95ecdedfb8469ba204e"/><file name="Relation.php" hash="a6419d38d03cca44dac60acd59d2f199"/><file name="Writer.php" hash="b47341646a1882d77e57cf6a5b30ad49"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ModulecreatorController.php" hash="6b501c3722bc111102c7b70a8c9b9710"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="755c04b748c41ced20f41c725acc95c2"/><file name="config.xml" hash="ded10f631f9bafc0cb874e92beab4198"/><dir name="modulecreator"><dir name="app"><dir name="code"><dir name="codepool"><dir name="Namespace"><dir name="Module"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><dir name="Entity"><file name="01_content.php" hash="59347ed053e0fe3dc2e25a5c5490ecd4"/></dir></dir></dir></dir></dir><dir name="Entity"><file name="01_content.php" hash="5dfc799aeee50cc5ef32d356c1cc176f"/><dir name="Edit"><file name="01_content.php" hash="21d1cd84da305a41e516752e39c12404"/><dir name="Form"><file name="01_content.php" hash="39f68c93dba53e650f502776c03caf20"/></dir><dir name="Tab"><dir name="Form"><file name="01_top.php" hash="bf7ddebd3f6fec4603807dc02c45b49e"/><file name="02_image.php" hash="8dbf5010de2c46aabb02cd7a4df6f45e"/><file name="03_file.php" hash="64ede5038fe0edfec08671a5ca521777"/><file name="04_wysiwyg.php" hash="d25a58b233bd88a2e6d1fd5a79398394"/><file name="05_parents.php" hash="476f7ebd1b04a879f3dd51b1913f9a9d"/><file name="06_attributes.php" hash="44c81d580dcf072b2ed9b5cc90fb1fac"/><file name="07_status.php" hash="ade9e66ee2dd546ebea8c9800b378a88"/><file name="08_rss.php" hash="0a122d46cc4826a0bd62b2f5d52b3fdc"/><file name="09_seo.php" hash="f0cf29478e91ced8dc39170b2574f1f2"/><file name="10_footer.php" hash="96648f9e6e0397d518925ffea553206c"/></dir><dir name="Product"><file name="01_content.php" hash="e42fb1044c47e7e1ba7c456f057b9558"/></dir><dir name="Sibling"><file name="01_content.php" hash="45cbbc5d065f5e0402a8340e14e5e6b2"/></dir></dir><dir name="Tabs"><file name="01_top.php" hash="7cecbd5b68dc09c4e9a14f214b3b70df"/><file name="02_relations_tabs.php" hash="3f1eba9e9a7bf177185364cffc8468ba"/><file name="03_product_relation.php" hash="aee681c7021e9efad07a39bc8f8cf56d"/><file name="04_footer.php" hash="01b6273dfbf342c1f984c1e10b631b65"/></dir></dir><dir name="Grid"><file name="01_top.php" hash="1a0c8754c5482692ae460fd6aafcfa6b"/><file name="02_columns_top.php" hash="1d28265e98b06fe61edde000c0d28db6"/><file name="03_parents.php" hash="011f4f2895cbaa33e753168131feedee"/><file name="04_grid_attributes.php" hash="2e7a6d5f6333b44ddf6792898a6e01c1"/><file name="05_grid_status.php" hash="f1d657a64ad855219882ac8aa6ead5b5"/><file name="06_created_at.php" hash="15f2bf1aeab4512931cfd13461466dbf"/><file name="07_updated_at.php" hash="b416ed24d9613f8332f4191f0378c1a3"/><file name="08_grid_actions.php" hash="fbc479c06560e193e4c2177358eadc07"/><file name="09_grid_export.php" hash="3da336230cb919e5dd36e39d21ea3f0e"/><file name="10_columns_footer.php" hash="1cdf225b4a61a0036903c4e251484684"/><file name="11_mass_action_top.php" hash="4979fc362c7c0666bcfe39e89f3a88f4"/><file name="12_mass_action_status.php" hash="d504216f92f489be7857bee37cf0771c"/><file name="13_mass_action_flags.php" hash="9b0d9088708f5e84b50e7ac6ee06a632"/><file name="14_mass_action_parents.php" hash="7b36b4b3954e3913e6bdafb822ca6634"/><file name="15_footer.php" hash="0833ff1f2002af6a4db1df3a3cad3385"/></dir><dir name="Helper"><dir name="File"><file name="01_content.php" hash="c436397f5889f3b9784f257af452ab74"/></dir><dir name="Image"><file name="01_content.php" hash="62a55ac8856f4dc555d6dc373c2de7d5"/></dir></dir><dir name="Widget"><dir name="Chooser"><file name="01_top.php" hash="61b31cd249d7f23aeb456eeff337c9c0"/><file name="02_top_status.php" hash="ae8d09557d6c9aa3a920e148f0cdd7d6"/><file name="03_content.php" hash="e95d7f929f5c96b2cae11873612a2348"/><file name="04_status.php" hash="6fb78962dd9ffb30ee5d750876a26e5d"/><file name="05_footer.php" hash="f2279fe4dd92129219c4f8abf9667658"/></dir></dir></dir></dir><dir name="Catalog"><dir name="Product"><dir name="List"><dir name="Entity"><file name="01_top.php" hash="e73df46ed0d2f57e185cebe41814ab67"/><file name="02_status.php" hash="716a6a2f8243c5048f90584f0bd7f888"/><file name="03_footer.php" hash="85ec097ccbc88a2cb05d4729a74d728b"/></dir></dir></dir></dir><dir name="Entity"><dir name="Catalog"><dir name="Product"><dir name="List"><file name="01_content.php" hash="420f7eac130aa41fe26eee1763a6c7cf"/></dir></dir></dir><dir name="Child"><dir name="List"><file name="01_content.php" hash="30ac249d25535c1a522f96bae56a4f75"/></dir></dir><dir name="List"><file name="01_top.php" hash="225b59a84d8bf6cb0d06d62bb5240eb2"/><file name="02_status.php" hash="716a6a2f8243c5048f90584f0bd7f888"/><file name="03_footer.php" hash="369738e4147fd032b12c1df4aa01ed9c"/></dir><dir name="Rss"><file name="01_top.php" hash="957b89055315fee8ecefa6b34e940efe"/><file name="02_status.php" hash="7a81b20fbd0ca4ac140c263e481a5b06"/><file name="03_content_top.php" hash="6e2c16bd170842cc88610692439c4674"/><file name="04_content.php" hash="f556d8f00acfa61f93bbc9b09da3508b"/><file name="05_footer.php" hash="0514ad15059f8411d3315d111aac5b84"/></dir><dir name="Sibling"><dir name="List"><file name="01_content.php" hash="b4e59d0fb7204da8f984fb07835fa39a"/></dir></dir><dir name="View"><file name="01_content.php" hash="b6824731ad9bb41ef1f84b4359596f67"/></dir><dir name="Widget"><dir name="Link"><file name="01_content.php" hash="2862dcc4937c58fbee284764732e733c"/></dir><dir name="View"><file name="01_top.php" hash="a31bafcf8918811ff55b0a8eaf49c021"/><file name="02_status.php" hash="fd4d2e31a4c04c13bb470ce615550310"/><file name="03_template.php" hash="e6fd0367cfbd0b14996e189ac56b2d3b"/><file name="04_status.php" hash="573160846b9e8693e966c0881103f25e"/><file name="05_footer.php" hash="1009acd5e8f54dbedb651ecffb283df1"/></dir></dir></dir><dir name="Rss"><file name="01_content.php" hash="ea37b93ec747a042dd51e2e4eaeb22ac"/></dir></dir><dir name="Controller"><dir name="Adminhtml"><dir name="Module"><file name="01_content.php" hash="938c09e00f8a7045d70c7e97dd478df8"/></dir></dir></dir><dir name="Helper"><dir name="Data"><file name="01_top.php" hash="44aa03c717b24b0086230271b07f195a"/><file name="02_entity.php" hash="378423c2b9ba4ac86328e094d6e60946"/><file name="03_footer.php" hash="cbb184dd8e05c9709e5dcaedaa0495cf"/></dir><dir name="Entity"><file name="01_top.php" hash="7762739cee42c164cfc31482d723211b"/><file name="02_rss.php" hash="9e9fa595a4a7ec7f159e1d64620119ae"/><file name="03_file.php" hash="44bc7ce84f603100f67dedc1edf3cc0d"/><file name="04_footer.php" hash="cbb184dd8e05c9709e5dcaedaa0495cf"/><dir name="Image"><file name="01_content.php" hash="6433332d53494da8842cd600613a2849"/></dir></dir><dir name="Product"><file name="01_top.php" hash="20709afdafe7e3fd280e7c346a441b0c"/><file name="02_content.php" hash="33fa587ea74ff5caae02e2263bd6092b"/><file name="03_footer.php" hash="cbb184dd8e05c9709e5dcaedaa0495cf"/></dir></dir><dir name="Model"><dir name="Adminhtml"><dir name="Observer"><file name="01_top.php" hash="05b9d4f2fe14a4d9c8f7cbd20a22a76c"/><file name="02_entity.php" hash="ac1552a67b0ddc2eefb4b4e2b1a37c16"/><file name="03_footer.php" hash="cbb184dd8e05c9709e5dcaedaa0495cf"/></dir></dir><dir name="Entity"><file name="01_top.php" hash="cd836a3f38b0e85afa0c4f2f202be23c"/><file name="02_var_sibling.php" hash="cbbdeeaa7082b22b3a57508dc6bcd4fa"/><file name="03_var_product_relation.php" hash="50cd6433f6617ed2d47c2a9ab9bee4d1"/><file name="04_construct.php" hash="81fb22faf1dc0c05920f5db34061100c"/><file name="05_url.php" hash="6d955735b11308ec8087bfbf2d0c6078"/><file name="06_editors.php" hash="615bc07ef7e14bc892bb567e3c22cef7"/><file name="07_after_save_top.php" hash="f456ae82840db694e49d527d6ad23f8f"/><file name="08_after_save_product.php" hash="7e85bbf889a5beededa975831b573d97"/><file name="09_after_save_sibling.php" hash="a7ea726ae5b4b19f78773a563a7196bf"/><file name="10_after_save_footer.php" hash="1af792cf3f94391bbe2b261a0d927a8c"/><file name="11_product_relation.php" hash="890ad6b1cad708779f0e5cb1aa745f1a"/><file name="12_sibling_relation.php" hash="f833e4acb70b198a1cc69da992affc76"/><file name="13_footer.php" hash="cbb184dd8e05c9709e5dcaedaa0495cf"/><dir name="Product"><file name="01_content.php" hash="d8dfaa0ac8ba132bf95d3d65452d9795"/></dir><dir name="Sibling"><file name="01_content.php" hash="ef2fc76324ca0afcaabab7f8272bd526"/></dir></dir><dir name="Resource"><dir name="Entity"><file name="01_content.php" hash="dea602e9b2d621b56965ca95f68b6881"/><dir name="Collection"><file name="01_top.php" hash="8e508ed5a9c3921fd657f3375f981e4d"/><file name="02_product_relation.php" hash="d2f707b97df2ecf2d088aebeeb660822"/><file name="03_sibling_relation.php" hash="4563330e972ef0b0f4b96096b8594727"/><file name="04_footer.php" hash="cbb184dd8e05c9709e5dcaedaa0495cf"/></dir><dir name="Product"><file name="01_content.php" hash="61ed8711a4698cd4b42c7308518ab911"/><dir name="Collection"><file name="01_content.php" hash="b69d146fdd0aba6de81322273ac7f07d"/></dir></dir><dir name="Sibling"><file name="01_content.php" hash="dcb71f86a692c5271eed8eac67c06ef5"/><dir name="Collection"><file name="01_content.php" hash="c48de1443823a6ff51517f8a6cab0599"/></dir></dir></dir><dir name="Setup"><file name="01_content.php" hash="335c579a20a627c5a403e3c7ac6156c0"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Entity"><dir name="Catalog"><dir name="ProductController"><file name="01_content.php" hash="16c429f36338330de5b38abb98b258be"/></dir></dir><dir name="WidgetController"><file name="01_content.php" hash="f04b3bb993ac2501df2c62641d64ea70"/></dir></dir><dir name="EntityController"><file name="01_top.php" hash="bc7b465c6730bcd61b24cd5667a443e9"/><file name="02_upload_image.php" hash="c111546b644ffafd26c102f095334f95"/><file name="03_upload_files.php" hash="90fd33445b8889a23e5af035da89c15e"/><file name="04_save_product_relation.php" hash="29b35c54da6069c72edd245c42aa5369"/><file name="05_save_sibling_relation.php" hash="e9fe7f25344280b483db7108cc3ae0b1"/><file name="06_save.php" hash="11c73c7cfc8c76738fce70c466ba7c63"/><file name="07_exception_upload.php" hash="216185c48b0b0937597939a95026a1c9"/><file name="08_exception.php" hash="b34376b34211a9cc21609ac7438d6d6d"/><file name="09_center.php" hash="1984de58c3a4636d053f4bc323b93e68"/><file name="10_mass_status.php" hash="32f826d9e0d091077da35a1ff4854f75"/><file name="11_mass_update.php" hash="f8cffcba29b0b98b815440b5407f2420"/><file name="12_mass_parents.php" hash="c13b8ac14871f114676d1d29be9dcb26"/><file name="13_product_relation_actions.php" hash="60b7da7a0a39fbf7f4ae826f55d003a6"/><file name="14_sibling_actions.php" hash="a8fd34a2a600ebbbbfbb8d8afa53641b"/><file name="15_footer.php" hash="044299b6435f621987f31c7c540f113c"/></dir></dir><dir name="EntityController"><file name="01_top.php" hash="eec876d7b63d893886bb334b09480af4"/><file name="02_list.php" hash="dfcf0e406a5a6548637bd50ce06bb1f6"/><file name="03_list_seo.php" hash="04dedfdc059b8b4b89c7c9ccc403a4b4"/><file name="04_list_footer.php" hash="1d41a3331d006d0a04ff32bb4085210b"/><file name="05_view.php" hash="df299ac16dcfbd741fbc58152c417bdc"/><file name="06_view_status.php" hash="fd0bc040dc135e3469757569ffcf7899"/><file name="07_view2.php" hash="af3fc07f58fa608f8f70f2e0264fe0bd"/><file name="08_breadcrumbs.php" hash="8157b6c12ecd17df9acdf095e7eb75db"/><file name="09_breadcrumbs_footer.php" hash="b41efc51d35a4f93a3b00dc5f899e1b5"/><file name="10_view_seo.php" hash="2e56f0ef104d419dee88abf037fe9f18"/><file name="11_view_footer.php" hash="3be2b1b314c50af6fd03c53647f06e56"/><file name="12_rss.php" hash="6e2fc4485e7a2b6c3508d05d7b71748d"/><file name="13_footer.php" hash="cbb184dd8e05c9709e5dcaedaa0495cf"/></dir></dir><dir name="etc"><dir name="adminhtml"><file name="01_top.xml" hash="11dee4372e147adfdd6dcf549207d52c"/><file name="02_entity_acl.xml" hash="6afabb39251e5233380992ec92a7a49f"/><file name="03_center.xml" hash="c3daf849d2cc4f2b9bb10319466df7b9"/><file name="04_entity_menu.xml" hash="ec9de1596fb91d3db672ae4fbb61cc54"/><file name="05_footer.xml" hash="567de2825a456f5c8de1c2d3f718b333"/></dir><dir name="config"><file name="01_top.xml" hash="ab60a876013ce736e83c89e6e9be4e25"/><file name="02_tables.xml" hash="07d07c4044d5ee658664c9d3465ea676"/><file name="03_siblings_table.xml" hash="13cdf74c83b7d86d15717b7e31bcc5ed"/><file name="04_relation_table.xml" hash="5e50710deedcd19316110a4db8dbfe5c"/><file name="05_global.xml" hash="0a1935d48470eb2d745b725ea00fc4f0"/><file name="06_relation_product.xml" hash="de83346f1f657f61a23251f37016bd99"/><file name="07_admin.xml" hash="d4c5c6313071ffa54afb69782dbcc21e"/><file name="08_frontend.xml" hash="9617988c4eb5ab502eb57349ab1a2dec"/><file name="09_default_top.xml" hash="a306c05cad3fd6c4c46f5c162e52df68"/><file name="10_default.xml" hash="fc553b2555e09b1ab639b58649b5b4cf"/><file name="11_default_footer.xml" hash="40004610d67a1bcf5ecf317917a1b0ab"/></dir><dir name="system"><file name="01_top.xml" hash="a250611cd158a2b0f9c0adef5b3d8074"/><file name="02_entity.xml" hash="0e789a6caeecd1e7223ab6c44ca1504e"/><file name="03_footer.xml" hash="2ead9ca0742a78448b5db442581d4cd9"/></dir><dir name="widget"><file name="01_top.xml" hash="29a6efa02a0f04ce056cc53d0b4e2272"/><file name="02_entity.xml" hash="102a8cfb8f0a2c330768add309e25e97"/><file name="03_footer.xml" hash="b84026fabe4a09ef682aac220eccf07a"/></dir></dir><dir name="sql"><dir name="namespace_module_setup"><dir name="mysql4-install-0.0.1"><file name="01_top.php" hash="50cec9cf47ccb1001b16c156bd792210"/><file name="02_entity.php" hash="fdfc8dbe0872a9f346d10925942daad0"/><file name="03_product_relation.php" hash="1be95058703726dc35fc985466d62129"/><file name="04_sibling_relation.php" hash="581b0adc63e3e28ab89dc576a3f2e7d6"/><file name="05_footer.php" hash="7d307239f928e12e9a9b48754777f640"/></dir></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="namespace_module"><file name="01_top.xml" hash="c657e63ddce2df350b7d45c57620e967"/><file name="02_entity.xml" hash="eeebf5d08f3fe22e0f0b5a9bac6a2e76"/><file name="03_relation_product.xml" hash="186ecd3e9e239f126acd0226c7d778ca"/><file name="04_relation_sibling.xml" hash="c0321e2b354f9d668968616deebe2b6e"/><file name="05_footer.xml" hash="fd25391f06094530aadcbee222b433fc"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="namespace_module"><file name="01_top.xml" hash="bf6f2b1a2a7bfaec115c381abfa40e02"/><file name="02_default_top.xml" hash="10c0056a19cc82fbf809aa13b879b4ff"/><file name="03_default.xml" hash="e58d9aa36808b39bdd648d51fca7b992"/><file name="04_default_footer.xml" hash="22f72da3c656b5721d355607c891cc9c"/><file name="05_list.xml" hash="3b09d37a31082347b40d92df261a4172"/><file name="06_view.xml" hash="060c650d3f0427e8b7124b5b717fa0de"/><file name="07_entity_rss.xml" hash="f06074f610065fbc6cb9a228402da7a7"/><file name="08_rss_top.xml" hash="54753c3cd7d42667c88c88f0084484f2"/><file name="09_rss.xml" hash="b513533d7cc561ec197ce1662bf54883"/><file name="10_rss_footer.xml" hash="3adf9a1e5301aa4221cede3ff5208785"/><file name="11_relation_product.xml" hash="309965e4062dc6f6f82dd495035e08ec"/><file name="12_footer.xml" hash="fd25391f06094530aadcbee222b433fc"/></dir></dir><dir name="template"><dir name="namespace_module"><dir name="catalog"><dir name="product"><dir name="list"><dir name="entity"><file name="01_top.phtml" hash="bb86f12fc472152437ef1be97280d258"/><file name="02_link_top.phtml" hash="62a65063f9611f31b02a5b3f3b34f524"/><file name="03_name.phtml" hash="fed55ae628836787e7a2ba05b1e695e6"/><file name="04_link_footer.phtml" hash="f01ee0fb040754cbdd4c7ca86dbec387"/><file name="05_footer.phtml" hash="d0bff7b594da78b60141591d6870556b"/></dir></dir></dir></dir><dir name="entity"><dir name="catalog"><dir name="product"><dir name="list"><file name="01_content.phtml" hash="96ec480a53c89ff5b87cfd59dc163f9e"/></dir></dir></dir><dir name="list"><file name="01_top.phtml" hash="10c541cba8766100d47e8baadb8ce6a5"/><file name="02_rss_link.phtml" hash="cacf7866f6dd54ab37a217d7cb7466c7"/><file name="03_footer.phtml" hash="24d3a1e0224a9e59f5daa0d2660e76b4"/></dir><dir name="sibling"><dir name="child"><dir name="list"><file name="01_content.phtml" hash="5a1f524b49cf120201a90ee695f90544"/></dir></dir><dir name="list"><file name="01_content.phtml" hash="5a1f524b49cf120201a90ee695f90544"/></dir></dir><dir name="view"><file name="01_content.phtml" hash="205b0b21c650f28ff0e364d6ec8ce552"/></dir><dir name="widget"><dir name="link"><file name="01_content.phtml" hash="11d9e23bd1c2f8cb8a0f857c8bb393d8"/></dir><dir name="view"><file name="01_content.phtml" hash="f89f40babc5af3cd30597cd097ad9ab9"/></dir></dir></dir><dir name="rss"><file name="01_content.phtml" hash="172a345ace9b7ec84ad2e18f51d48257"/></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><dir name="Namespace_Module"><file name="01_content.xml" hash="4495317a1b8392281b68f07a546c56c2"/></dir></dir></dir><dir name="locale"><dir name="en_US"><dir name="Namespace_Module"><file name="01_global.csv" hash="133cec10c0a2d55366574bbaa3c98a6f"/><file name="02_entity.csv" hash="97e1a2056ec2f49acc1c5c9598ef10d7"/><file name="03_attribute.csv" hash="0bc9532d35587f2225e398156cc3ef7f"/><file name="04_global_status.csv" hash="507d9e24387e6935b1ee629e8432f842"/><file name="05_global_rss.csv" hash="df495f10c1e7d7d3fb770d8b406b9f9b"/><file name="06_global_seo.csv" hash="5f973fd7dfbb61ce8c21d6f7e8622379"/><file name="07_attribute_yesno.csv" hash="20eaf2d5eaa8224e5fa1c7a63634b1c0"/><file name="08_global_file.csv" hash="8bebcdd48d5ae7b533cc53e789f03ef2"/><file name="09_product_relation.csv" hash="b96f377dfa788f2772f2f8b7f156aebd"/><file name="10_relations.csv" hash="d0f7a10c89d21ade4ba17cd73dbb42fb"/></dir></dir></dir></dir><dir name="skin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="placeholder"><file name="entity.jpg" hash="6361a80d5ca988fcec45ad3767322e5e"/></dir></dir></dir></dir></dir></dir></dir><file name="modulecreator.xml" hash="aa75494279a121ceb15ba047c25077e6"/><file name="system.xml" hash="c9159310a8f86e6a159c96bdc9b3a177"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ultimate_modulecreator.xml" hash="e6310d81d0f3d4a12a5b8c72c275b927"/></dir><dir name="template"><dir name="ultimate_modulecreator"><dir name="edit"><dir name="tab"><dir name="entities"><dir name="entity"><file name="attribute.phtml" hash="6aeeafd4994018e85e279b8063889abb"/></dir><file name="entity.phtml" hash="9bce9afd95299903ac3a9d233e2a0eea"/></dir><file name="entities.phtml" hash="df9179ffd5e72a04cf4740488521f0ce"/><file name="help.phtml" hash="5b64810a35b9ec8b445ea027b50c01e5"/><file name="relation.phtml" hash="ee72f1aa0af5b42aed06b2bea642e4d1"/></dir></dir><file name="edit.phtml" hash="7a965d1c45489c510c7f7581bd65f397"/><file name="tooltip.phtml" hash="d3598ad3f978d708b1f7f36feee39560"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ultimate_ModuleCreator.xml" hash="324d2b364541a7355c9ff4248c0518f2"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Ultimate_ModuleCreator.csv" hash="c8a30842b86479c2a289ee44296ab349"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="ultimate_modulecreator.css" hash="ec091e97f5e251e1b2c5cbecc7c4b7a6"/></dir></dir></dir></target><target name="mage"><dir name="."><file name="LICENSE_UMC.txt" hash="1372b858e10f4c6feb2967766a0b7a62"/><file name="readme_UMC.txt" hash="7b8cd5baf640a5078be5c7136b56b5d9"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
20
+ </package>
readme_UMC.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ULTIMATE MODULE CREATOR
2
+
3
+ Before installing the exetension disable the cache and the compiler.
4
+ To install the module copy the 'app' folder over the app folder of your magento instance and the 'skin' folder over the skin folder of your Mangento instance.
5
+
6
+ If you are logged in the admin then logout and login again to have access to the configuration settings of the module.
7
+
8
+ If you want to uninstall the extension delete the following:
9
+
10
+ app/code/local/Ultimate/ModuleCreator/ - folder
11
+ app/design/adminhtml/default/default/layout/ultimate_modulecreator.xml - file
12
+ app/design/adminhtml/default/default/template/ultimate_modulecreator/ - folder
13
+ app/etc/modules/Ultimate_ModuleCreator.xml - file
14
+ app/locale/en_US/Ultimate_ModuleCreator.csv - file
15
+ skin/adminhtml/default/default/ultimate_modulecreator.css - file
16
+ LICENSE_UMC.txt - file
17
+ readme_UMC.txt - file (the one you are reading)
18
+
19
+ Also run the following query on the database (add table prefix if you have one) to remove any config settings for the module:
20
+ "DELETE FROM `core_config_data` where `path` LIKE 'modulecreator/%'";
21
+
22
+ For questions, thanks or criticism send an e-mail to <marius.strajeru@gmail.com>
23
+
24
+ To report bugs or/and add feature requests refer to https://github.com/tzyganu/moduleCreator
25
+
skin/adminhtml/default/default/ultimate_modulecreator.css ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Ultimate_ModuleCreator extension
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the MIT License
7
+ * that is bundled with this package in the file LICENSE_UMC.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/mit-license.php
10
+ *
11
+ * @category Ultimate
12
+ * @package Ultimate_ModuleCreator
13
+ * @copyright Copyright (c) 2012
14
+ * @license http://opensource.org/licenses/mit-license.php MIT License
15
+ */
16
+ .modulecreator-entity .box .form-list td.value input.input-text,
17
+ .modulecreator-entity .box .form-list td.value textarea {
18
+ width: 203px;
19
+ }
20
+ .modulecreator-entity .box .form-list td.value select{
21
+ width: 209px;
22
+ }
23
+
24
+ .modulecreator-entity .form-list td.label label{
25
+ width:155px;
26
+ }
27
+ .modulecreator-attribute .form-list td.label{
28
+ width:160px;
29
+ }
30
+ .modulecreator-attribute .form-list td.label label{
31
+ width:150px;
32
+ }
33
+ .modulecreator-attribute .box .form-list td.value input.input-text,
34
+ .modulecreator-attribute .box .form-list td.value textarea {
35
+ width: 180px;
36
+ }
37
+ .modulecreator-attribute .box .form-list td.value select{
38
+ width: 186px;
39
+ }
40
+ .modulecreator-toggle{
41
+ width:19px;
42
+ height:18px;
43
+ }