[
  {
    "path": ".gitignore",
    "content": "/vendor/\ncomposer.lock\n"
  },
  {
    "path": "LICENSE_UMC",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Marius\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "Ultimate Module Creator 1.9.6.0\r\n======\r\n## Notice\r\n\r\n<strong>Because of lack of time, motivation and because Magento2 is already a mature platform, I'm deciding to pull the plug on this module creator.  \r\nThere will be no updates, no new features.  \r\n\r\nFeel free to fork it, make it better and redestribute it. </strong>\r\n\r\n\r\n<strike>New</strike> Ultimate Module Creator for Magento 1.7 +\r\n-------------\r\n\r\nThis is the new version of <a href=\"https://github.com/tzyganu/moduleCreator\">Ultimate Module Creator</a>.\r\n\r\n\r\nThis should be the version 2.0 of the Magento extension but I'm keeping this version for the Module Creator for Magento 2.0.  \r\n\r\nBackwards compatibility has been broken.\r\n\r\nIf someone wants to help with the testing please submit any bugs, improvements or feature requests <a href=\"https://github.com/tzyganu/UMC1.9/issues\">here</a>\r\n\r\nAlso any good code is welcomed.\r\n\r\n**Note**\r\nFor the rest of the document UMC = Ultimate Module Creator\r\n\r\nDocumentation can be found on the [wiki pages](https://github.com/tzyganu/UMC1.9/wiki/).  \r\nThe documentation includes a list of [features](https://github.com/tzyganu/UMC1.9/wiki/features) and [release notes](https://github.com/tzyganu/UMC1.9/wiki/release-notes)  \r\n\r\n\r\n\r\n\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Form.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */\n/**\n * admin form block\n * \n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */  \nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Form extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare form\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit_Form\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form(\n            array(\n                'id'     => 'edit_form',\n                'action' => $this->getUrl(\n                    '*/modulecreator/save',\n                    array(\n                        'id' => $this->getRequest()->getParam('id')\n                    )\n                ),\n                'method' => 'post'\n            )\n        );\n        $form->setUseContainer(true);\n        $this->setForm($form);\n        return parent::_prepareForm();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities/Entity/Attribute.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * add attribute form\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method Varien_Object getAttributeInstance()\n * @method Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity_Attribute setAttributeInstance()\n * @method string getEntityId()\n * @method Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity_Attribute setIncrement()\n * @method int getIncrement()\n * @method Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity_Attribute setEntityId()\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity_Attribute extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare attribute form\n     *\n     * @access protected\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareForm()\n    {\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n        $form = $helper->getXmlForm('attribute', false);\n        $form->setHtmlIdPrefix('attribute_'.$this->getEntityId().'_'.$this->getIncrement().'_');\n        $form->addFieldNameSuffix('entity['.$this->getEntityId().'][attributes]['.$this->getIncrement().']');\n        $this->setForm($form);\n        $form->addValues($this->getAttributeInstance()->getData());\n        return parent::_prepareForm();\n    }\n\n    /**\n     * set an entity with default values\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setDefaultAttributeInstance()\n    {\n        /** @var Ultimate_ModuleCreator_Model_Attribute $attribute */\n        $attribute = Mage::getModel('modulecreator/attribute');\n        $settings  = Mage::getStoreConfig(Ultimate_ModuleCreator_Helper_Data::XML_ATTRIBUTE_CONFIG_PATH);\n        $attribute->addData($settings);\n        $this->setAttributeInstance($attribute);\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities/Entity.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * add entity form\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity setEntity()\n * @method Varien_Object getEntity()\n * @method Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity setIncrement()\n * @method int getIncrement()\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare entity form\n     *\n     * @access protected\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareForm()\n    {\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n        $form = $helper->getXmlForm('entity');\n        $form->setHtmlIdPrefix('entity_'.$this->getIncrement().'_');\n        $form->addFieldNameSuffix('entity['.$this->getIncrement().']');\n        $this->setForm($form);\n        $form->addValues($this->getEntity()->getData());\n        return parent::_prepareForm();\n    }\n\n    /**\n     * set an entity with default values\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setDefaultEntity()\n    {\n        /** @var Ultimate_ModuleCreator_Model_Entity  $entity */\n        $entity    = Mage::getModel('modulecreator/entity');\n        $settings  = Mage::getStoreConfig(Ultimate_ModuleCreator_Helper_Data::XML_ENTITY_CONFIG_PATH);\n        $entity->addData($settings);\n        $this->setEntity($entity);\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Entities.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * entities tab\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit_Tab_Entities extends Mage_Adminhtml_Block_Widget implements\n    Mage_Adminhtml_Block_Widget_Tab_Interface\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function _construct()\n    {\n        parent::_construct();\n        $this->setTemplate('ultimate_modulecreator/edit/tab/entities.phtml');\n    }\n\n    /**\n     * Return Tab label\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTabLabel()\n    {\n        return Mage::helper('modulecreator')->__('Entities');\n    }\n\n    /**\n     * Return Tab title\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTabTitle()\n    {\n        return Mage::helper('modulecreator')->__('Entities');\n    }\n\n    /**\n     * Can show tab in tabs\n     *\n     * @access public\n     * @return boolean\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function canShowTab()\n    {\n        return true;\n    }\n\n    /**\n     * Tab is hidden\n     *\n     * @access public\n     * @return boolean\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function isHidden()\n    {\n        return false;\n    }\n\n    /**\n     * get the list of entities\n     *\n     * @access public\n     * @return array()\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntities()\n    {\n        /** @var null|Ultimate_ModuleCreator_Model_Module $module */\n        $module = Mage::registry('current_module');\n        if ($module) {\n            return $module->getEntities();\n        }\n        return array();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Help/Fieldset.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * help fieldset\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit_Tab_Help_Fieldset setFieldsets()\n * @method Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit_Tab_Help_Fieldset setColumns()\n * @method Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit_Tab_Help_Fieldset setDescription()\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit_Tab_Help_Fieldset extends Mage_Adminhtml_Block_Template\n{\n    /**\n     * default column type\n     */\n    const DEFAULT_COLUMN_TYPE = 'text';\n\n    /**\n     * constructor\n     *\n     * @access public\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setTemplate('ultimate_modulecreator/edit/tab/help/fieldset.phtml');\n    }\n\n    /**\n     * format value\n     *\n     * @param $field\n     * @param $column\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormatedValue($field, $column)\n    {\n        if (!isset($column['type'])) {\n            $column['type'] = self::DEFAULT_COLUMN_TYPE;\n        }\n        if (!isset($column['key'])) {\n            return '';\n        }\n        $key = $column['key'];\n        $rawValue = $field->$key;\n        switch($column['type']) {\n            case 'bool':\n                $value = (bool)(string)$rawValue;\n                if ($value == 1) {\n                    return Mage::helper('modulecreator')->__('Yes');\n                }\n                return Mage::helper('modulecreator')->__('No');\n            break;\n            case 'text':\n                //intentional fall through\n            default:\n                return $rawValue;\n            break;\n        }\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Help.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */\n/**\n * help tab block\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit_Tab_Help extends Mage_Adminhtml_Block_Widget_Form implements\n    Mage_Adminhtml_Block_Widget_Tab_Interface\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function _construct()\n    {\n        parent::_construct();\n        $this->setTemplate('ultimate_modulecreator/edit/tab/help.phtml');\n    }\n\n    /**\n     * Return Tab label\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTabLabel()\n    {\n        return Mage::helper('modulecreator')->__('Help');\n    }\n\n    /**\n     * Return Tab title\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTabTitle()\n    {\n        return Mage::helper('modulecreator')->__('Help');\n    }\n\n    /**\n     * Can show tab in tabs\n     *\n     * @access public\n     * @return boolean\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function canShowTab()\n    {\n        return true;\n    }\n\n    /**\n     * Tab is hidden\n     *\n     * @access public\n     * @return boolean\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function isHidden()\n    {\n        return false;\n    }\n    /**\n     * get UMC version\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getVersion()\n    {\n        $version    = (string)Mage::app()->getConfig()->getNode('modules/Ultimate_ModuleCreator/version');\n        $build      = (string)Mage::app()->getConfig()->getNode('modules/Ultimate_ModuleCreator/build');\n        if ($build) {\n            $version .= ' - '.$build;\n        }\n        return $version;\n    }\n\n    /**\n     * prepare tab layout\n     *\n     * @return Mage_Core_Block_Abstract\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareLayout()\n    {\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n\n        $columns = array(\n            'label' => array(\n                'header' => Mage::helper('modulecreator')->__('Field'),\n                'key'    => 'label'\n            ),\n            'type' => array(\n                'header' => Mage::helper('modulecreator')->__('Type'),\n                'key'    => 'type'\n            ),\n            'required' => array(\n                'header' => Mage::helper('modulecreator')->__('Required'),\n                'type'   => 'bool',\n                'key'    => 'required'\n            ),\n            'system' => array(\n                'header' => Mage::helper('modulecreator')->__('Has default'),\n                'type'   => 'bool',\n                'key'    => 'system'\n            ),\n            'tooltip' => array(\n                'header' => Mage::helper('modulecreator')->__('Description'),\n                'key'    => 'tooltip'\n            ),\n        );\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $settingsTabHelp */\n        $settingsTabHelp = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $settingsTabHelp->setFieldsets($helper->getFieldsetXmlData('settings'))\n            ->setColumns($columns)\n            ->setDescription(Mage::helper('modulecreator')->__('General settings tab.'));\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $entityTabHelp */\n        $entityTabHelp = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $entityTabHelp->setFieldsets($helper->getFieldsetXmlData('entity'))\n            ->setColumns($columns)\n            ->setDescription(Mage::helper('modulecreator')->__('Entity management.'));\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $attributeTabHelp */\n        $attributeTabHelp = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $attributeTabHelp->setFieldsets($helper->getFieldsetXmlData('attribute'))\n            ->setColumns($columns)\n            ->setDescription(Mage::helper('modulecreator')->__('Field/Attribute management.'));\n\n        $fieldTypes = array(\n            'field_types' => array(\n                'label'  => Mage::helper('modulecreator')->__('Supported field / attribute types'),\n                'fields' => $helper->getAttributeTypes()\n            )\n        );\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $fieldTypesHelp */\n        $fieldTypesHelp = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $fieldTypesHelp->setFieldsets($fieldTypes)\n            ->setColumns(\n                array(\n                    'label'     => array(\n                        'header'=>Mage::helper('modulecreator')->__('Field'),\n                        'key'   =>'label'\n                    ),\n                    'allow_is_name'     => array(\n                        'header'=>Mage::helper('modulecreator')->__('Can behave as name'),\n                        'key'   =>'allow_is_name',\n                        'type'  => 'bool'\n                    ),\n                )\n            )\n            ->setDescription(Mage::helper('modulecreator')->__('Supported field / attribute types'));\n        $relationTypes = array(\n            'field_types'=> array(\n                'label'=> Mage::helper('modulecreator')->__('Relation types'),\n                'fields' => $helper->getRelationTypes()\n            )\n        );\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $relationsTypesHelp */\n        $relationsTypesHelp = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $relationsTypesHelp->setFieldsets($relationTypes)\n            ->setColumns(\n                array(\n                    'label'     => array(\n                        'header'=>Mage::helper('modulecreator')->__('Relation'),\n                        'key'   =>'label'\n                    ),\n                    'description'     => array(\n                        'header'=>Mage::helper('modulecreator')->__('Description'),\n                        'key'   =>'description',\n                    ),\n                )\n            )\n            ->setDescription(Mage::helper('modulecreator')->__('Entity Relations'));\n\n        $objN = new stdClass();\n        $objN->restricted = 'Mage';\n        $objN->label = Mage::helper('modulecreator')->__('Disallowed namespace names');\n\n        $routers = (array)Mage::getConfig()->getNode('frontend/routers');\n        $objM = new stdClass();\n        $objM->restricted = implode(', ', array_keys($routers));\n        $objM->label = Mage::helper('modulecreator')->__('Disallowed module names');\n\n        $entityRestrictedNames = implode(\n            ', ',\n            array_keys((array)$helper->getConfig()->getNode('restricted/entity'))\n        );\n        $objE = new stdClass();\n        $objE->restricted = $entityRestrictedNames;\n        $objE->label = Mage::helper('modulecreator')->__('Disallowed entity names');\n\n        $attributeRestrictedNames = implode(\n            ', ',\n            array_keys((array)$helper->getConfig()->getNode('restricted/attribute'))\n        );\n        $objA = new stdClass();\n        $objA->restricted = $attributeRestrictedNames;\n        $objA->label = Mage::helper('modulecreator')->__('Disallowed field/attribute names');\n        $restrictions = array(\n            'field_types'=> array(\n                'label'  => Mage::helper('modulecreator')->__('Naming restrictions'),\n                'fields' => array($objN, $objM, $objE, $objA)\n            )\n        );\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $restrictionsHelp */\n        $restrictionsHelp = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $restrictionsHelp->setFieldsets($restrictions)\n            ->setColumns(\n                array(\n                    'label'     => array(\n                        'header'=>Mage::helper('modulecreator')->__('Entity'),\n                        'key'   =>'label'\n                    ),\n                    'description'     => array(\n                        'header'=>Mage::helper('modulecreator')->__('Resticted'),\n                        'key'   =>'restricted',\n                    ),\n                )\n            )\n            ->setDescription(Mage::helper('modulecreator')->__('Naming restrictions'));\n\n        /** @var null|Ultimate_ModuleCreator_Model_Module $currentModule */\n        $currentModule = Mage::registry('current_module');\n        if (!$currentModule) {\n            /** @var Ultimate_ModuleCreator_Model_Module $currentModule */\n            $currentModule = Mage::getModel('modulecreator/module');\n        }\n        $files = $currentModule->getConfig()->getNode('files');\n        $allowedFiles = array();\n        foreach ((array)$files as $file) {\n            if ($file->scope == 'disabled') {\n                continue;\n            }\n            $allowedFiles[] = $file;\n        }\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $filesHelp */\n        $filesHelp = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $filesHelp->setFieldsets(\n            array(\n                'files'=> array(\n                    'label'=>Mage::helper('modulecreator')->__('Generated files'),\n                    'fields' => $allowedFiles\n                )\n            )\n        )\n        ->setColumns(\n            array(\n                'label'     => array(\n                    'header'=>Mage::helper('modulecreator')->__('File'),\n                    'key'   =>'title'\n                ),\n                'destination'=> array(\n                    'header'=>Mage::helper('modulecreator')->__('Path'),\n                    'key'   =>'destination'\n                ),\n                'description'     => array(\n                    'header'=>Mage::helper('modulecreator')->__('Description'),\n                    'key'   =>'description',\n                ),\n                'condition'     => array(\n                    'header'=>Mage::helper('modulecreator')->__('Condition'),\n                    'key'   =>'condition',\n                ),\n            )\n        )\n        ->setDescription(Mage::helper('modulecreator')->__('Created files'));\n\n        $this->setChild('settings_tab_help', $settingsTabHelp);\n        $this->setChild('entity_tab_help', $entityTabHelp);\n        $this->setChild('attribute_tab_help', $attributeTabHelp);\n        $this->setChild('attribute_types_help', $fieldTypesHelp);\n        $this->setChild('relation_types_help', $relationsTypesHelp);\n        $this->setChild('restrictions_help', $restrictionsHelp);\n        $this->setChild('files_help', $filesHelp);\n\n        $releaseNotes = (array)$helper->getReleaseNotes();\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $releaseNotesHelp */\n        $releaseNotesHelp = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $releaseNotesHelp->setFieldsets($releaseNotes)\n            ->setColumns(\n                array(\n                    'type' => array(\n                        'header' => Mage::helper('modulecreator')->__('Type'),\n                        'key'    => 'type'\n                    ),\n                    'label'      => array(\n                        'header' => Mage::helper('modulecreator')->__('Label'),\n                        'key'    => 'label'\n                    ),\n                    'comment' => array(\n                        'header' => Mage::helper('modulecreator')->__('Comment'),\n                        'key'    => 'comment'\n                    ),\n                )\n            )\n            ->setDescription(Mage::helper('modulecreator')->__('Release notes'));\n        $this->setChild('release_notes', $releaseNotesHelp);\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Help_Fieldset $thanks */\n        $thanks = $this->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_help_fieldset');\n        $thanks->setFieldsets(\n            array(\n                'files'=> array(\n                    'label'  =>Mage::helper('modulecreator')->__('Thanks'),\n                    'fields' => (array)$helper->getThanks()\n                )\n            )\n        )\n        ->setColumns(\n            array(\n                'type'     => array(\n                    'header'=>Mage::helper('modulecreator')->__('To'),\n                    'key'   =>'to'\n                ),\n                'label'     => array(\n                    'header'=>Mage::helper('modulecreator')->__('Because'),\n                    'key'   =>'for'\n                ),\n            )\n        )\n        ->setDescription(Mage::helper('modulecreator')->__('Thank you for your help'));\n        $this->setChild('thanks', $thanks);\n        return parent::_prepareLayout();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Relation.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */\n/**\n * relations tab block\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method array getRelations()\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Relation extends Mage_Adminhtml_Block_Widget_Form implements\n    Mage_Adminhtml_Block_Widget_Tab_Interface\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function _construct()\n    {\n        parent::_construct();\n        $this->setTemplate('ultimate_modulecreator/edit/tab/relation.phtml');\n    }\n\n    /**\n     * Return Tab label\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTabLabel()\n    {\n        return Mage::helper('modulecreator')->__('Entity Relations');\n    }\n\n    /**\n     * Return Tab title\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTabTitle()\n    {\n        return Mage::helper('modulecreator')->__('Entity Relations');\n    }\n\n    /**\n     * Can show tab in tabs\n     *\n     * @access public\n     * @return boolean\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function canShowTab()\n    {\n        return true;\n    }\n\n    /**\n     * Tab is hidden\n     *\n     * @access public\n     * @return boolean\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function isHidden()\n    {\n        return count($this->getRelations()) == 0;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tab/Settings.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * settings tab block\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Settings extends Mage_Adminhtml_Block_Widget_Form implements\n    Mage_Adminhtml_Block_Widget_Tab_Interface\n{\n    /**\n     * Return Tab label\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTabLabel()\n    {\n        return Mage::helper('modulecreator')->__('General Settings');\n    }\n\n    /**\n     * Return Tab title\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTabTitle()\n    {\n        return Mage::helper('modulecreator')->__('General Settings');\n    }\n\n    /**\n     * Can show tab in tabs\n     *\n     * @access public\n     * @return boolean\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function canShowTab()\n    {\n        return true;\n    }\n\n    /**\n     * Tab is hidden\n     *\n     * @access public\n     * @return boolean\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function isHidden()\n    {\n        return false;\n    }\n\n    /**\n     * prepare the form\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Settings\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareForm()\n    {\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n        $form = $helper->getXmlForm('settings');\n        $form->setHtmlIdPrefix('settings_');\n        $module = Mage::registry('current_module');\n        $values = array();\n        if ($module) {\n            $values = $module->getData();\n        } else {\n            $values = Mage::getStoreConfig(Ultimate_ModuleCreator_Helper_Data::XML_SETTINGS_CONFIG_PATH);\n        }\n        $this->setForm($form);\n        $form->addFieldNameSuffix('settings');\n        $form->addValues($values);\n        return parent::_prepareForm();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit/Tabs.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * add/edit tabs\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tabs setTitle\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs\n{\n    /**\n     * construct\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function _construct()\n    {\n        parent::_construct();\n        $this->setId('modulecreator_info_tabs');\n        $this->setDestElementId('edit_form');\n        $this->setTitle(Mage::helper('modulecreator')->__('Module information'));\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Edit.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * module edit block\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit extends Mage_Adminhtml_Block_Widget_Form_Container\n{\n    /**\n     * config path to expanded/collapsed fieldsets\n     */\n    const XML_FIELDSET_COLLAPSED    = 'modulecreator/general/collapsed';\n\n    /**\n     * construct\n     *\n     * @access public\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->_blockGroup = 'adminhtml_modulecreator';\n        $this->_controller = 'modulecreator';\n        $this->setTemplate('ultimate_modulecreator/edit.phtml');\n    }\n\n    /**\n     * get current module\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getModule()\n    {\n        return Mage::registry('current_module');\n    }\n\n    /**\n     * get header text\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHeaderText()\n    {\n        $module = $this->getModule();\n        if ($module) {\n            return Mage::helper('modulecreator')->__('Edit module \"%s\"', $module->getExtensionName());\n        }\n        return Mage::helper('modulecreator')->__('Create Module');\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Edit\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareLayout()\n    {\n        /** @var Mage_Adminhtml_Block_Widget_Button $backButton */\n        $backButton = $this->getLayout()\n            ->createBlock('adminhtml/widget_button')\n            ->setData(\n                array(\n                    'label' => Mage::helper('modulecreator')->__('Back'),\n                    'onclick'   => 'setLocation(\\''.$this->getUrl('*/*/').'\\')',\n                    'class' => 'back'\n                )\n            );\n        $this->setChild('back_button', $backButton);\n\n        /** @var Mage_Adminhtml_Block_Widget_Button $resetButton */\n        $resetButton = $this->getLayout()\n            ->createBlock('adminhtml/widget_button')\n            ->setData(\n                array(\n                    'label' => Mage::helper('modulecreator')->__('Reset'),\n                    'onclick'   => 'setLocation(\\''.$this->getUrl('*/*/*', array('_current'=>true)).'\\')'\n                )\n            );\n        $this->setChild('reset_button', $resetButton);\n\n        /** @var Mage_Adminhtml_Block_Widget_Button $saveButton */\n        $saveButton = $this->getLayout()\n            ->createBlock('adminhtml/widget_button')\n            ->setData(\n                array(\n                    'label' => Mage::helper('modulecreator')->__('Save'),\n                    'onclick'   => 'moduleForm.submit()',\n                    'class' => 'save'\n                )\n            );\n        $this->setChild('save_button', $saveButton);\n\n        /** @var Mage_Adminhtml_Block_Widget_Button $saveEditButton */\n        $saveEditButton = $this->getLayout()\n            ->createBlock('adminhtml/widget_button')\n            ->setData(\n                array(\n                    'label' => Mage::helper('modulecreator')->__('Save and Continue Edit'),\n                    'onclick'   => 'saveAndContinueEdit(\\''.$this->getSaveAndContinueUrl().'\\')',\n                    'class' => 'save'\n                )\n            );\n        $this->setChild('save_and_edit_button', $saveEditButton);\n\n        /** @var Mage_Adminhtml_Block_Widget_Button $addEntityButton */\n        $addEntityButton = $this->getLayout()\n            ->createBlock('adminhtml/widget_button')\n            ->setData(\n                array(\n                    'label' => Mage::helper('modulecreator')->__('Add entity'),\n                    'class' => 'add add-entity'\n                )\n            );\n        $this->setChild('add-entity', $addEntityButton);\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity $block */\n        $block = Mage::app()->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_entities_entity');\n        $block->setTemplate('ultimate_modulecreator/edit/tab/entities/entity.phtml');\n        $block->setDefaultEntity();\n        $block->setIncrement('{{entity_id}}');\n        $this->setChild('entity-template', $block);\n\n        /** @var Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Edit_Tab_Entities_Entity_Attribute $block */\n        $block = Mage::app()->getLayout()\n            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_entities_entity_attribute');\n        $block->setTemplate('ultimate_modulecreator/edit/tab/entities/entity/attribute.phtml');\n        $block->setDefaultAttributeInstance();\n        $block->setIncrement('{{attribute_id}}');\n        $block->setEntityId('{{entity_id}}');\n        $this->setChild('attribute-template', $block);\n\n        $this->setChild(\n            'menu-selector',\n            Mage::app()->getLayout()->createBlock('modulecreator/adminhtml_modulecreator_menu')\n        );\n        return $this;\n    }\n\n    /**\n     * get the back button html\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getBackButtonHtml()\n    {\n        return $this->getChildHtml('back_button');\n    }\n\n    /**\n     * get the cancel button html\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCancelButtonHtml()\n    {\n        return $this->getChildHtml('reset_button');\n    }\n\n    /**\n     * get the save button html\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSaveButtonHtml()\n    {\n        return $this->getChildHtml('save_button');\n    }\n\n    /**\n     * get the save and continue edit button html\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSaveAndEditButtonHtml()\n    {\n        return $this->getChildHtml('save_and_edit_button');\n    }\n\n    /**\n     * get html for \"add entity\" button\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAddEntityButtonHtml()\n    {\n        return $this->getChildHtml('add-entity');\n    }\n\n    /**\n     * get the save and continue edit url\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSaveAndContinueUrl()\n    {\n        return $this->getUrl(\n            '*/*/save',\n            array(\n                '_current'   => true,\n                'back'   => 'edit',\n                'tab'=> '{{tab_id}}',\n                'active_tab' => null\n            )\n        );\n    }\n\n    /**\n     * get the validation url\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getValidationUrl()\n    {\n        return $this->getUrl('*/*/validate', array('_current'=>true));\n    }\n\n    /**\n     * check if edit mode is read only\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function isReadonly()\n    {\n        $module = $this->getModule();\n        if (!$module) {\n            return false;\n        }\n        if (Mage::registry('module_read_only')) {\n            return true;\n        }\n        if ($module = Mage::registry('current_module')) {\n            $installedModules = array_keys((array)Mage::getConfig()->getNode('modules')->children());\n            foreach ($installedModules as $installed) {\n                if ($installed == $module->getExtensionName()) {\n                    Mage::register('module_read_only', true);\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n\n    /**\n     * get select for relations\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRelationSelectTemplate()\n    {\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n        $types  = $helper->getRelationTypes();\n        $template = '<select class=\"relation-select\" name=\"relation[#{e1}][#{e2}]\" id=\"relation_#{e1}_#{e2}\">';\n        foreach ($types as $type=>$values) {\n            $template .= '<option value=\"'.$type.'\">'.(string)$values->label.'</option>';\n        }\n        $template .= '</select>';\n        return $template;\n    }\n\n    /**\n     * check if fieldsets should be collapsed\n     *\n     * @access public\n     * @return int\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getShowFieldsetsCollapsed()\n    {\n        return (int)Mage::getStoreConfigFlag(self::XML_FIELDSET_COLLAPSED);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Grid/Column/Renderer/Download.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */\n/**\n * download column renderer\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Grid_Column_Renderer_Download extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract\n{\n    /**\n     * render row\n     *\n     * @access public\n     * @param Varien_Object $row\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function render(Varien_Object $row)\n    {\n        /** @var string $what */\n        $what = $this->getColumn()->getWhat();\n        /** @var string $id */\n        $id =  $row->getSafeId();\n        $packageName = base64_decode(strtr($id, '-_,', '+/='));\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n        $path = $helper->getLocalModulesDir();\n        switch ($what) {\n            case 'config':\n                $file = $path.'package'.DS.$packageName . '.xml';\n                break;\n            case 'list':\n                $file = $path.'package'.DS.$packageName . DS. 'files.log';\n                break;\n            case 'uninstall' :\n                $file = $path.'package'.DS.$packageName . DS. 'uninstall.sql';\n                break;\n            default:\n                $file = $path . $packageName . '.tgz';\n                break;\n        }\n        if (file_exists($file) && is_readable($file)) {\n            return '<a href=\"'.\n                $this->getUrl('*/*/download', array('type'=>$what, 'id'=>$id)).'\">'.$this->_getLabel().\n                '</a>';\n        }\n        return '<span style=\"color:red;\">'.\n            Mage::helper('modulecreator')->__('File does not exist or is not readable').\n            '</span>';\n    }\n\n    /**\n     * get the link label\n     *\n     * @access protected\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _getLabel()\n    {\n        if ($this->getColumn()->getLabel()) {\n            return $this->getColumn()->getLabel();\n        }\n        return Mage::helper('modulecreator')->__('Download');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Grid.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */ \n/**\n * modules grid.\n * \n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Grid setUseAjax()\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Grid extends Mage_Adminhtml_Block_Widget_Grid\n{\n    /**\n     * no filters\n     * @var bool\n     */\n    protected $_filterVisibility = false;\n\n    /**\n     * Initialize Grid block\n     *\n     * @access public\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->_defaultLimit = 200;\n        $this->setId('ModuleCreator_grid');\n        $this->setUseAjax(true);\n    }\n\n    /**\n     * Creates extension collection if it has not been created yet\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Module_Collection\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCollection()\n    {\n        if (!$this->_collection) {\n            $this->_collection = Mage::getModel('modulecreator/module_collection');\n        }\n        return $this->_collection;\n    }\n\n    /**\n     * Prepare Collection for Grid\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Grid\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareCollection()\n    {\n        $this->setCollection($this->getCollection());\n        return parent::_prepareCollection();\n    }\n\n    /**\n     * Prepare grid columns\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Block_Adminhtml_ModuleCreator_Grid\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareColumns()\n    {\n        $this->addColumn(\n            'filename_id',\n            array(\n                'header' => Mage::helper('modulecreator')->__('Module'),\n                'index'  => 'filename_id',\n                'filter' => false,\n            )\n        );\n        $actionColumnRenderer = 'modulecreator/adminhtml_modulecreator_grid_column_renderer_download';\n        $this->addColumn(\n            'action_edit',\n            array(\n                'header'=>  Mage::helper('modulecreator')->__('Edit'),\n                'width' => '100',\n                'type'  => 'action',\n                'getter'=> 'getSafeId',\n                'actions'   => array(\n                    array(\n                        'caption'   => Mage::helper('modulecreator')->__('Edit'),\n                        'url'   => array('base'=> '*/*/edit'),\n                        'field' => 'id'\n                    )\n                ),\n                'filter'    => false,\n                'is_system' => true,\n                'sortable'  => false,\n            )\n        );\n        $this->addColumn(\n            'action_config',\n            array(\n                'header'    =>  Mage::helper('modulecreator')->__('Download Config File'),\n                'label'     => Mage::helper('modulecreator')->__('Download Config File'),\n                'width'     => '150',\n                'renderer'  => $actionColumnRenderer,\n                'filter'    => false,\n                'is_system' => true,\n                'sortable'  => false,\n                'what'      => 'config'\n            )\n        );\n        $this->addColumn(\n            'action',\n            array(\n                'header'    =>  Mage::helper('modulecreator')->__('Download Module'),\n                'label'     => Mage::helper('modulecreator')->__('Download Module'),\n                'width'     => '100',\n                'renderer'  => $actionColumnRenderer,\n                'filter'    => false,\n                'is_system' => true,\n                'sortable'  => false,\n            )\n        );\n        $this->addColumn(\n            'action_list',\n            array(\n                'header'    =>  Mage::helper('modulecreator')->__('Download List of Files'),\n                'label'     => Mage::helper('modulecreator')->__('Download List of Files'),\n                'width'     => '100',\n                'renderer'  => $actionColumnRenderer,\n                'filter'    => false,\n                'is_system' => true,\n                'sortable'  => false,\n                'what'      => 'list'\n            )\n        );\n        $this->addColumn(\n            'action_uninstall',\n            array(\n                'header'    =>  Mage::helper('modulecreator')->__('Download Uninstall DB Script'),\n                'label'     => Mage::helper('modulecreator')->__('Download Uninstall DB Script'),\n                'width'     => '200',\n                'renderer'  => $actionColumnRenderer,\n                'filter'    => false,\n                'is_system' => true,\n                'sortable'  => false,\n                'what'      => 'uninstall'\n            )\n        );\n        return parent::_prepareColumns();\n    }\n\n    /**\n     * Self URL getter\n     *\n     * @access public\n     * @param array() $params\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCurrentUrl($params = array())\n    {\n        if (!isset($params['_current'])) {\n            $params['_current'] = true;\n        }\n        return $this->getUrl('*/*/grid', $params);\n    }\n\n    /**\n     * Row URL getter\n     *\n     * @access public\n     * @param Ultimate_ModuleCreator_Model_Module $row\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRowUrl($row)\n    {\n        return $this->getUrl(\n            '*/*/edit',\n            array(\n                'id' => strtr(\n                    base64_encode(\n                        $row->getFilenameId()\n                    ),\n                    '+/=',\n                    '-_,'\n                )\n            )\n        );\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/Menu.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * select menu block.\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_Menu extends Mage_Adminhtml_Block_Page_Menu\n{\n    /**\n     * don't cache\n     *\n     * @access public\n     * @return int|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCacheLifetime()\n    {\n        return null;\n    }\n\n    /**\n     * draw the menu\n     *\n     * @access public\n     * @param $menu\n     * @param string $parentId\n     * @param int $level\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function renderUmcMenu($menu, $parentId = '', $level = 0)\n    {\n        $html = '<ul ' . (!$level ? 'id=\"umc-nav\"' : '') . '>';\n        $html .= $this->_renderSelector($parentId, 0);\n        $previousSortOrder = 0;\n        foreach ($menu as $key=> $item) {\n            $html .= '<li>';\n            $html .= '<span class=\"delete toggler collapsed\"></span>';\n            $html .= '<a href=\"#\" onclick=\"return false\">' . $this->escapeHtml($item['label']) . '</a>';\n            if ($parentId) {\n                $nextParentId = $parentId.'/'.$key;\n            } else {\n                $nextParentId = $key;\n            }\n            if (!empty($item['children'])) {\n                $html .= $this->renderUmcMenu($item['children'], $nextParentId, $level + 1);\n            } else {\n                $html .= '<ul>'.$this->_renderSelector($nextParentId, 10).'</ul>';\n            }\n            $html .= '</li>';\n            $html .= $this->_renderSelector($parentId, (int)(($item['sort_order'] + $previousSortOrder)/2));\n            $previousSortOrder = $item['sort_order'];\n        }\n        $html .= '</ul>';\n\n        return $html;\n    }\n\n    /**\n     * render the selection link\n     *\n     * @access protected\n     * @param $parentId\n     * @param $sortOrder\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _renderSelector($parentId, $sortOrder)\n    {\n        $html  = '<li class=\"umc-menu-selector\">';\n        $html .= '<a class=\"insert-menu\" menu-data=\\'{\"parent\":\"'.$parentId.'\", \"sort_order\": \"'.$sortOrder.'\"}\\'';\n        $html .= 'title=\"'.Mage::helper('modulecreator')->__('Insert here').'\">';\n        $html .= Mage::helper('modulecreator')->__('Insert here');\n        $html .= '</a>';\n        $html .= '</li>';\n        return $html;\n    }\n\n    /**\n     * render menu\n     *\n     * @access protected\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _toHtml()\n    {\n        return $this->renderUmcMenu($this->getMenuArray());\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/System/Config/Form/Fieldset/Abstract.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * abstract system->config fieldset renderer\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nabstract class Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_System_Config_Form_Fieldset_Abstract extends Mage_Adminhtml_Block_System_Config_Form_Fieldset\n{\n    /**\n     * @var Varien_Object\n     */\n    protected $_dummyElement;\n\n    /**\n     * @var Mage_Adminhtml_Block_System_Config_Form_Field\n     */\n    protected $_fieldRenderer;\n\n    /**\n     * @var array\n     */\n    protected $_values;\n\n    /**\n     * get the form name\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public abstract function getFormName();\n\n    /**\n     * render the config section\n     *\n     * @access public\n     * @param Varien_Data_Form_Element_Abstract $element\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function render(Varien_Data_Form_Element_Abstract $element)\n    {\n        $html = $this->_getHeaderHtml($element);\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n        $config = $helper->getConfig();\n        $formName = $this->getFormName();\n        if (!$config->getNode('forms/'.$formName)) {\n            return '';\n        }\n        $fieldsets = $config->getNode('forms/'.$formName.'/fieldsets');\n        $index = 0;\n        foreach ((array)$fieldsets as $key => $set) {\n            $positions = array();\n            foreach ((array)$set->fields as $id=>$field) {\n                if (!$field->system) {\n                    continue;\n                }\n                $positions[(int)$field->position][$id] = $field;\n            }\n            ksort($positions);\n            $sorted = array();\n            foreach ($positions as $fields) {\n                $sorted = array_merge($sorted, $fields);\n            }\n            foreach($sorted as $id => $field) {\n                $html.= $this->_getFieldHtml($element, $id, $field);\n            }\n        }\n        $html .= $this->_getFooterHtml($element);\n        return $html;\n    }\n\n    /**\n     * get field renderer.\n     *\n     * @access protected\n     * @return Mage_Adminhtml_Block_System_Config_Form_Field\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _getFieldRenderer()\n    {\n        if (empty($this->_fieldRenderer)) {\n            $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');\n        }\n        return $this->_fieldRenderer;\n    }\n\n    /**\n     * get HTML for the field\n     *\n     * @access protected\n     * @param Varien_Data_Form_Element_Fieldset $fieldset\n     * @param string $key\n     * @param $field\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _getFieldHtml($fieldset, $key, $field)\n    {\n        $formName = $this->getFormName();\n        $path = 'modulecreator/'.$formName.'/' . $key;\n        $data = Mage::getStoreConfig($path, 0);\n        $settings = array(\n            'name'          => 'groups['.$formName.'][fields]['.$key.'][value]',\n            'label'         => (string)$field->label,\n            'value'         => $data,\n            'inherit'       => false,\n            'can_use_default_value' => false,\n            'can_use_website_value' => false,\n        );\n        if (in_array((string)$field->type, array('select', 'multiselect'))) {\n            $settings['values'] = Mage::getModel((string)$field->source)->toArray(((string)$field->type == 'select'));\n        }\n        if ($field->tooltip) {\n            $settings['tooltip'] = (string)$field->tooltip;\n        }\n        $field = $fieldset->addField(\n            $formName.$key,\n            (string)$field->type, $settings\n        );\n        $field->setRenderer($this->_getFieldRenderer());\n        return $field->toHtml();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/System/Config/Form/Fieldset/Attribute.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * attribute system->config fieldset renderer\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_System_Config_Form_Fieldset_Attribute extends Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_System_Config_Form_Fieldset_Abstract\n{\n    /**\n     * get the form name from umc.xml\n     *\n     * @access public\n     * @return mixed|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormName()\n    {\n        return 'attribute';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/System/Config/Form/Fieldset/Entity.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * entity system->config fieldset renderer\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_System_Config_Form_Fieldset_Entity extends Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_System_Config_Form_Fieldset_Abstract\n{\n    /**\n     * get the form name from umc.xml\n     *\n     * @access public\n     * @return mixed|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormName()\n    {\n        return 'entity';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator/System/Config/Form/Fieldset/Settings.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * module settings system->config fieldset renderer\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_System_Config_Form_Fieldset_Settings extends Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator_System_Config_Form_Fieldset_Abstract\n{\n    /**\n     * get the form name from umc.xml\n     *\n     * @access public\n     * @return mixed|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormName()\n    {\n        return 'settings';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Block/Adminhtml/Modulecreator.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */ \n/**\n * main admin block - grid container.\n * \n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */ \nclass Ultimate_ModuleCreator_Block_Adminhtml_Modulecreator extends Mage_Adminhtml_Block_Widget_Grid_Container\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function __construct()\n    {\n        $this->_controller = 'adminhtml_modulecreator';\n        $this->_blockGroup = 'modulecreator';\n        $this->_headerText = Mage::helper('modulecreator')->__('Manage modules');\n        parent::__construct();\n        $this->_updateButton('add', 'label', Mage::helper('modulecreator')->__('Create new module'));\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Exception.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */  \nclass Ultimate_ModuleCreator_Exception extends Mage_Core_Exception\n{\n\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Helper/Data.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * module main helper\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Helper_Data extends Mage_Core_Helper_Abstract\n{\n    /**\n     * path to entity types\n     */\n    const ENTITY_TYPES_PATH          = 'types/umc_entity';\n\n    /**\n     * path to attribute types\n     */\n    const ATTRIBUTE_TYPES_PATH       = 'types/umc_attribute';\n\n    /**\n     * path to attribute types groups\n     */\n    const ATTRIBUTE_TYPE_GROUPS_PATH = 'types/umc_attribute_group';\n\n    /**\n     * path to relation types\n     */\n    const RELATION_TYPES_PATH        = 'types/umc_relation';\n\n    /**\n     * path to settings config\n     */\n    const XML_SETTINGS_CONFIG_PATH   = 'modulecreator/settings';\n\n    /**\n     * path to entity config\n     */\n    const XML_ENTITY_CONFIG_PATH     = 'modulecreator/entity';\n\n    /**\n     * path to attribute config\n     */\n    const XML_ATTRIBUTE_CONFIG_PATH  = 'modulecreator/attribute';\n\n    /**\n     * xml path to release notes\n     */\n    const XML_RELEASE_NOTES_PATH     = 'release_notes';\n\n    /**\n     * path to thanks\n     */\n    const XML_THANKS_PATH            = 'thanks';\n\n    /**\n     * path to dropdown attribute subtypes\n     */\n    const DROPDOWN_TYPES_PATH        = 'types/umc_dropdown';\n\n    /**\n     * config path to show tooltips\n     */\n    const SHOW_TOOLTIPS_PATH         = 'modulecreator/general/tooltips';\n\n    /**\n     * nothing to see here\n     * just some constants\n     */\n    const WE1MX1NZU1RFTV9G           = 'c3lzdGVtL2Y=';\n    const WE1MX1NZU1RFTV9Q           = 'c3lzdGVtL3A=';\n    const WE1MX1NZU1RFTV9QUA         = 'c3lzdGVtL3Bw';\n\n    /**\n     * form xml cache\n     *\n     * @var null\n     */\n    protected $_formXml = null;\n\n    /**\n     * module creator config\n     *\n     * @var null\n     */\n    protected $_config  = null;\n\n    /**\n     * tooltip block\n     *\n     * @var Mage_Adminhtml_Block_Template\n     */\n    protected $_tooltipBlock = null;\n\n    /**\n     * get the tooltip html\n     *\n     * @access public\n     * @param string $title\n     * @param string $text\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTooltipHtml($title, $text)\n    {\n        return $this->getTooltipBlock()->setTitle($title)->setMessage($text)->toHtml();\n    }\n\n    /**\n     * get the tooltip block for help messages\n     *\n     * @access public\n     * @return Mage_Adminhtml_Block_Template\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTooltipBlock()\n    {\n        if (is_null($this->_tooltipBlock)) {\n            $this->_tooltipBlock = Mage::app()->getLayout()\n                ->createBlock('adminhtml/template')\n                ->setTemplate('ultimate_modulecreator/tooltip.phtml');\n        }\n        return $this->_tooltipBlock;\n    }\n\n    /**\n     * get local extension packages path\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLocalPackagesPath()\n    {\n        return $this->getLocalModulesDir().'package'.DS;\n    }\n\n    /**\n     * get local extension path\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLocalModulesDir()\n    {\n        return Mage::getBaseDir('var').DS.'modulecreator'.DS;\n    }\n\n    /**\n     * get the umc config\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Config\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getConfig()\n    {\n        if (is_null($this->_config)) {\n            $this->_config = Mage::getConfig()->loadModulesConfiguration('umc.xml')->applyExtends();\n        }\n        return $this->_config;\n    }\n\n    /**\n     * get a form\n     *\n     * @access public\n     * @param $formName\n     * @return Varien_Data_Form\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getXmlForm($formName)\n    {\n        $xmlForms = $this->getConfig();\n        $form = new Varien_Data_Form();\n        if (!$xmlForms->getNode('forms/'.$formName)) {\n            return $form;\n        }\n        $fieldsets = $xmlForms->getNode('forms/'.$formName.'/fieldsets');\n        $index = 0;\n        foreach ((array)$fieldsets as $key => $set) {\n            $fieldset = $form->addFieldset(\n                uniqid('fieldset_').'_'.$key,\n                array(\n                    'legend'=>(string)$set->label\n                )\n            );\n            $positions = array();\n            foreach ((array)$set->fields as $id=>$field) {\n                $positions[(int)$field->position][$id] = $field;\n            }\n            ksort($positions);\n            $sorted = array();\n            foreach ($positions as $fields) {\n                $sorted = array_merge($sorted, $fields);\n            }\n            foreach ($sorted as $id => $field) {\n                $settings = array(\n                    'name'              => $id,\n                    'label'             => $field->label,\n                    'title'             => $field->label,\n                    'required'          => (string)$field->required,\n                    'class'             => (string)$field->class,\n                );\n                if ($field->readonly) {\n                    $settings['readonly'] = \"readonly\";\n                }\n                if ($field->type != 'hidden') {\n                    if (Mage::getStoreConfigFlag(self::SHOW_TOOLTIPS_PATH)) {\n                        if ($field->tooltip) {\n                            $settings['after_element_html'] = $this->getTooltipHtml(\n                                $field->label,\n                                (string)$field->tooltip\n                            );\n                        }\n                    }\n                    if ($field->note) {\n                        $settings['note'] = $field->note;\n                    }\n                }\n                if ($set->use_depends) {\n                    $dependClass = (string)$field->depend_class;\n                    if (empty($dependClass)) {\n                        $dependClass = 'type-all';\n                    }\n                    $settings['class'] .=' '.$dependClass;\n                }\n                if (in_array((string)$field->type, array('select', 'multiselect'))) {\n                    $settings['values'] = Mage::getModel((string)$field->source)\n                        ->toArray(((string)$field->type == 'select'));\n                }\n\n                $fieldset->addField($id, (string)$field->type, $settings);\n            }\n            $index++;\n        }\n        return $form;\n    }\n\n    /**\n     * get data for xml form\n     *\n     * @param $formName\n     * @param null $fieldset\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFieldsetXmlData($formName, $fieldset = null)\n    {\n        $xmlForms = $this->getConfig();\n        if (!$xmlForms->getNode('forms/'.$formName)) {\n            return array();\n        }\n        $fieldsets = $xmlForms->getNode('forms/'.$formName.'/fieldsets');\n        $index = 0;\n        $data = array();\n        foreach ((array)$fieldsets as $key => $set) {\n            if (!is_null($fieldset) && $fieldset != $key ) {\n                continue;\n            }\n            $data[$key] = array();\n            $data[$key]['label'] = (string)$set->label;\n            $positions = array();\n            foreach ((array)$set->fields as $id=>$field) {\n                $positions[(int)$field->position][$id] = $field;\n            }\n            ksort($positions);\n            $sorted = array();\n            foreach ($positions as $fields) {\n                $sorted = array_merge($sorted, $fields);\n            }\n            foreach ($sorted as $field) {\n                $data[$key]['fields'][] = $field;\n            }\n            $index++;\n        }\n        return $data;\n    }\n\n    /**\n     * get all entity types\n     *\n     * @access public\n     * @return array\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityTypes()\n    {\n        $types = $this->getConfig()->getNode(self::ENTITY_TYPES_PATH);\n        if (!$types) {\n            throw new Ultimate_ModuleCreator_Exception($this->__('No entity types configured'));\n        }\n        return (array)$types;\n    }\n\n    /**\n     * get relation types\n     *\n     * @access public\n     * @return array\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRelationTypes()\n    {\n        $types = $this->getConfig()->getNode(self::RELATION_TYPES_PATH);\n        if (!$types) {\n            throw new Ultimate_ModuleCreator_Exception($this->__('No relation types configured'));\n        }\n        return (array)$types;\n    }\n\n    /**\n     * get attribute types\n     *\n     * @param bool $asArray\n     * @return array|Varien_Simplexml_Element\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributeTypes($asArray = true)\n    {\n        $types = $this->getConfig()->getNode(self::ATTRIBUTE_TYPES_PATH);\n        if (!$types) {\n            throw new Ultimate_ModuleCreator_Exception($this->__('No attribute types configured'));\n        }\n        if ($asArray) {\n            return (array)$types;\n        }\n        return $types;\n    }\n\n    /**\n     * get available name attribute types\n     *\n     * @access public\n     * @param bool $onlyLabels\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameAttributeTypes($onlyLabels = false)\n    {\n        $types = $this->getAttributeTypes();\n        $nameTypes = array();\n        foreach ($types as $type=>$values) {\n            if ((string)$values->allow_is_name == 1) {\n                if (!$onlyLabels) {\n                    $nameTypes[$type] = $values;\n                } else {\n                    $nameTypes[$type] = (string)$values->label;\n                }\n            }\n        }\n        return $nameTypes;\n    }\n\n    /**\n     * get the attribute type groups\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributeTypeGroups()\n    {\n        $groups = $this->getConfig()->getNode(self::ATTRIBUTE_TYPE_GROUPS_PATH);\n        return (array)$groups;\n    }\n\n    /**\n     * load a module\n     *\n     * @access public\n     * @param Varien_Simplexml_Element $xml\n     * @return bool|Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function loadModule($xml)\n    {\n        /** @var Ultimate_ModuleCreator_Model_Module $module */\n        $module = Mage::getModel('modulecreator/module');\n        $moduleFields = $module->getXmlAttributes();\n        $data = array();\n        foreach ($moduleFields as $field) {\n            $data[$field] = (string)$xml->$field;\n        }\n        $module->setData($data);\n        /** @var Ultimate_ModuleCreator_Model_Entity $entity */\n        $entity = Mage::getModel('modulecreator/entity');\n        $entityFields = $entity->getXmlAttributes();\n        foreach ($xml->entities->entity as $entityNode) {\n            $data = array();\n            foreach ($entityFields as $field) {\n                $data[$field] = (string)$entityNode->$field;\n            }\n            $entity = Mage::getModel('modulecreator/entity');\n            $entity->setData($data);\n            $module->addEntity($entity);\n            foreach ($entityNode->attributes->attribute as $attributeNode) {\n                $attributeData = (array)$attributeNode;\n                foreach ($attributeData as $key=>$value) {\n                    $attributeData[$key] = (string)$value;\n                }\n                $attribute = Mage::getModel('modulecreator/attribute');\n                $attribute->setData($attributeData);\n                $entity->addAttribute($attribute);\n            }\n        }\n        $relations = (array)$xml->descend('relations');\n        if ($relations) {\n            foreach ($relations as $key=>$type) {\n                $parts = explode('_', $key);\n                if (count($parts) == 2) {\n                    $e1 = $module->getEntity($parts[0]);\n                    $e2 = $module->getEntity($parts[1]);\n                    if ($e1 && $e2) {\n                        /** @var Ultimate_ModuleCreator_Model_Relation $relation */\n                        $relation = Mage::getModel('modulecreator/relation');\n                        $relation->setEntities($e1, $e2, (string)$type);\n                        $module->addRelation($relation);\n                    }\n                }\n            }\n        }\n        return $module;\n    }\n\n    /**\n     * get indentation.\n     *\n     * @access public\n     * @param int $count\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPadding($count = 1)\n    {\n        return str_repeat(\"    \", $count);\n    }\n\n    /**\n     * get end of line\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEol()\n    {\n        return \"\\n\";\n    }\n\n    /**\n     * get release notes config xml\n     *\n     * @access public\n     * @return Varien_Simplexml_Element\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getReleaseNotes()\n    {\n        $notes = (array)$this->getConfig()->getNode(self::XML_RELEASE_NOTES_PATH);\n        $releaseNotes = array();\n        foreach ($notes as $note) {\n            $_note = array();\n            $_note['label'] = Mage::helper('modulecreator')->__(\n                'v%s - %s',\n                $note->version,\n                $note->date\n            );\n            $_note['fields'] = (array)$note->data;\n            $releaseNotes[(string)$note->version] = $_note;\n        }\n        return $releaseNotes;\n    }\n\n    /**\n     * get dropdown attribute subtypes\n     *\n     * @param bool $asArray\n     * @return array|Varien_Simplexml_Element\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDropdownSubtypes($asArray = true)\n    {\n        $types = $this->getConfig()->getNode(self::DROPDOWN_TYPES_PATH);\n        if (!$types) {\n            throw new Ultimate_ModuleCreator_Exception($this->__('No dropdown subtypes configured'));\n        }\n        if ($asArray) {\n            return (array)$types;\n        }\n        return $types;\n    }\n\n    /**\n     * this does nothing\n     * don't look through the code - go away\n     * I said it does nothing\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getQwertyuiop()\n    {\n        $f  = $this->getConfig()->getNode(base64_decode(self::WE1MX1NZU1RFTV9G));\n        $_f = base64_decode($f);\n        $p  = $this->getConfig()->getNode($_f(self::WE1MX1NZU1RFTV9Q));\n        $_p = $_f($p);\n        return $_p;\n    }\n\n    /**\n     * this also does nothing\n     * don't look here either\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getQwertyuiopp()\n    {\n        $f  = $this->getConfig()->getNode(base64_decode(self::WE1MX1NZU1RFTV9G));\n        $_f = base64_decode($f);\n        $pp = $this->getConfig()->getNode($_f(self::WE1MX1NZU1RFTV9QUA));\n        $_pp = $_f($pp);\n        return $_pp;\n    }\n\n    /**\n     * get the list of people that helped on this extension\n     *\n     * @access public\n     * @return Varien_Simplexml_Element\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getThanks()\n    {\n        return $this->getConfig()->getNode(self::XML_THANKS_PATH);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Abstract.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Abstract extends Varien_Object\n{\n    /**\n     * entity code\n     *\n     * @var string\n     */\n    protected $_entityCode = 'umc_abstract';\n\n    /**\n     * end of line characters\n     *\n     * @var string\n     */\n    protected $_eol;\n\n    /**\n     * var used for indentation\n     *\n     * @var string\n     */\n    protected $_padding;\n\n    /**\n     * helper\n     *\n     * @var mixed\n     */\n    protected $_helper;\n\n    /**\n     * to array\n     *\n     * @access public\n     * @param array\n     * @return array()\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray(array $arrAttributes = array())\n    {\n        if (empty($arrAttributes)) {\n            $arrAttributes = array_keys($this->_data);\n        }\n        $arrRes = array();\n        foreach ($arrAttributes as $attribute) {\n            $arrRes[$attribute] = $this->getDataUsingMethod($attribute);\n        }\n        return $arrRes;\n    }\n\n    /**\n     * get the list of attributes that need saving in XML\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getXmlAttributes()\n    {\n        $dom    = $this->getHelper()->getConfig();\n        $code   = $this->_entityCode;\n        return array_keys((array)$dom->getNode('xml_attributes/'.$code));\n    }\n\n    /**\n     * getter for helper member\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Helper_Data|mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHelper()\n    {\n        if (is_null($this->_helper)) {\n            $this->_helper = Mage::helper('modulecreator');\n        }\n        return $this->_helper;\n    }\n\n    /**\n     * getter for padding\n     *\n     * @access public\n     * @param int $length\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPadding($length = 1)\n    {\n        if (is_null($this->_padding)) {\n            $this->_padding = $this->getHelper()->getPadding();\n        }\n        return str_repeat($this->_padding, $length);\n    }\n\n    /**\n     * getter for end of line\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEol()\n    {\n        if (is_null($this->_eol)) {\n            $this->_eol = $this->getHelper()->getEol();\n        }\n        return $this->_eol;\n    }\n\n    /**\n     * esacape values\n     *\n     * @param $text\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function escapeText($text)\n    {\n        return Mage::helper('core')->jsQuoteEscape($text);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Abstract.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * abstract attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method bool getIsMultipleSelect()\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Abstract extends Ultimate_ModuleCreator_Model_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type            = 'abstract';\n\n    /**\n     * attribute object\n     *\n     * @var mixed\n     */\n    protected $_attribute       = null;\n\n    /**\n     * sql column ddl type\n     *\n     * @var string\n     */\n    protected $_typeDdl         = 'TYPE_TEXT';\n\n    /**\n     * sql column ddl size\n     *\n     * @var string\n     */\n    protected $_sizeDdl         = '255';\n\n    /**\n     * eav setup type\n     *\n     * @var string\n     */\n    protected $_setupType       = 'varchar';\n\n    /**\n     * eav setup backend\n     *\n     * @var string\n     */\n    protected $_setupBackend    = '';\n\n    /**\n     * eav setup input\n     *\n     * @var string\n     */\n    protected $_setupInput \t    = 'text';\n\n    /**\n     * eav setup source\n     *\n     * @var string\n     */\n    protected $_setupSource\t    = '';\n\n    /**\n     * set the attribute\n     *\n     * @param Ultimate_ModuleCreator_Model_Attribute $attribute\n     * @return Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setAttribute(Ultimate_ModuleCreator_Model_Attribute $attribute)\n    {\n        $this->_attribute = $attribute;\n        return $this;\n    }\n\n    /**\n     * get attribute object\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Attribute|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttribute()\n    {\n        return $this->_attribute;\n    }\n\n    /**\n     * get entity\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Entity\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntity()\n    {\n        return $this->getAttribute()->getEntity();\n    }\n\n    /**\n     * get module\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getModule()\n    {\n        return $this->getAttribute()->getModule();\n    }\n\n    /**\n     * get namespace\n     *\n     * @access public\n     * @param bool $lower\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNamespace($lower = false)\n    {\n        return $this->getModule()->getNamespace($lower);\n    }\n\n    /**\n     * check if attribute can be in admin grid\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminGrid()\n    {\n        return $this->getAttribute()->getData('admin_grid');\n    }\n\n    /**\n     * get column options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminColumnOptions()\n    {\n        return '';\n    }\n\n    /**\n     * get text for rss\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRssText()\n    {\n        $eol        = $this->getEol();\n        $attribute  = $this->getAttribute();\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $html       = $this->getPadding(3);\n        $html      .= '$'.'description .= \\'<div>\\'.'.$eol.$this->getPadding(4).'Mage::helper(\\'';\n        $html      .= $namespace.'_'.$module;\n        $html      .= '\\')->__(\\''.$attribute->getLabel();\n        $html      .= '\\').\\': '.$eol.$this->getPadding(4).'\\'.$item->get';\n        $html      .= $this->getAttribute()->getMagicMethodCode();\n        $html      .= '().'.$eol.$this->getPadding(4).'\\'</div>\\';'.$this->getEol();\n\n        return $html;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return 'text';\n    }\n\n    /**\n     * get column ddl type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeDdl()\n    {\n        return $this->_typeDdl;\n    }\n\n    /**\n     * get column ddl size\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSizeDdl()\n    {\n        return $this->_sizeDdl;\n    }\n\n    /**\n     * get the html for frontend\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendHtml()\n    {\n        $html  = '<?php echo Mage::helper(\\'';\n        $html .= $this->getNamespace(true).'_'.$this->getModule()->getLowerModuleName();\n        $html .= '\\')->__(\\'';\n        $html .= $this->getAttribute()->getLabel();\n        $html .= '\\');?>:<?php echo $_';\n        $html .= strtolower($this->getAttribute()->getEntity()->getNameSingular());\n        $html .= '->get'.$this->getAttribute()->getMagicMethodCode().'();?>';\n        $html .= $this->getHelper()->getEol();\n        return $html;\n    }\n\n    /**\n     * get the setup type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupType()\n    {\n        return $this->_setupType;\n    }\n\n    /**\n     * get setup backend type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupBackend()\n    {\n        return $this->_setupBackend;\n    }\n\n    /**\n     * get the setup input\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupInput()\n    {\n        return $this->_setupInput;\n    }\n\n    /**\n     * get the setup source\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupSource()\n    {\n        return $this->_setupSource;\n    }\n\n    /**\n     * check if attribute is visible\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getVisible()\n    {\n        return true;\n    }\n\n    /**\n     * check if source needs to be generated\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getGenerateSource()\n    {\n        return false;\n    }\n\n    /**\n     * get additional setup values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalSetup()\n    {\n        return '';\n    }\n\n    /**\n     * check if attribute is required\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRequired()\n    {\n        return $this->getAttribute()->getData('required');\n    }\n\n    /**\n     * check if attribute is yes/no\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsYesNo()\n    {\n        return false;\n    }\n\n    /**\n     * can use editor\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditor()\n    {\n        return false;\n    }\n\n    /**\n     * get attribute options for source model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributeOptions()\n    {\n        return $this->getPadding(2).'return array();';\n    }\n\n    /**\n     * get admin from options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormOptions()\n    {\n        $options = '';\n        $padding = $this->getPadding(4);\n        $eol     = $this->getEol();\n        $note = $this->getAttribute()->getNote();\n        if ($note) {\n            $options .= $padding.\"'note'\t=> $\".\"this->__('\".Mage::helper('core')->jsQuoteEscape($note).\"'),\".$eol;\n        }\n        if ($this->getRequired()) {\n            $options .= $padding.\"'required'  => true,\".$eol;\n            $options .= $padding.\"'class' => 'required-entry',\".$eol;\n        }\n        return $options.$eol;\n    }\n\n    /**\n     * getter for attribute type\n     *\n     * @return string\n     * @access public\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getType()\n    {\n        return $this->_type;\n    }\n\n    /**\n     * getter xml node for attribute\n     *\n     * @return string\n     * @access public\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeConfigPath()\n    {\n        return Ultimate_ModuleCreator_Helper_Data::ATTRIBUTE_TYPES_PATH.'/'.$this->getType();\n    }\n\n    /**\n     * getter config for attribute\n     *\n     * @access public\n     * @param $path\n     * @return Varien_Simplexml_Element\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getConfig($path = null)\n    {\n        if (!is_null($path)) {\n            $path = $this->getTypeConfigPath().'/'.$path;\n        } else {\n            $path = $this->getTypeConfigPath();\n        }\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n        return $helper->getConfig()->getNode($path);\n    }\n\n    /**\n     * check if attribute can behave as name\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsAllowedAsName()\n    {\n        return (bool)(string)$this->getConfig('allow_is_name');\n    }\n\n    /**\n     * check if attribute can be in mass update\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMassUpdate()\n    {\n        return (bool)(string)$this->getConfig('mass_update');\n    }\n\n    /**\n     * get values for mass action\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMassActionValues()\n    {\n        return '';\n    }\n\n    /**\n     * get attribute default value\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueProcessed()\n    {\n        return $this->getAttribute()->getData('default_value');\n    }\n\n    /**\n     * get attribute default value setup content\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueSetup()\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Country.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * country attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Country extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'country';\n\n    /**\n     * sql column ddl size\n     *\n     * @var string\n     */\n    protected $_sizeDdl     = '2';\n\n    /**\n     * eav setup input\n     *\n     * @var string\n     */\n    protected $_setupInput \t= 'select';\n\n    /**\n     * get admin column options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminColumnOptions()\n    {\n        $options  = $this->getEol();\n        $options .= $this->getPadding(4);\n        $options .= \"'type'=> 'country',\".$this->getEol();\n        return $options;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return 'select';\n    }\n\n    /**\n     * get text for rss\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRssText()\n    {\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $text       = $this->getPadding(3);\n        $text      .= '$description .= \\'<div>\\''.$eol.$this->getPadding(4).'.Mage::helper(\\'';\n        $text      .= $namespace.'_'.$module;\n        $text      .= '\\')->__(\"';\n        $text      .= $this->getAttribute()->getLabel();\n        $text      .= '\").\\':'.$eol.$this->getPadding(4).'\\'.(($item->get';\n        $text      .= $this->getAttribute()->getMagicMethodCode();\n        $text      .= '()) '.$eol.$this->getPadding(4).'? Mage::getModel(\\'directory/country\\')->load($item->get';\n        $text      .= $this->getAttribute()->getMagicMethodCode();\n        $text      .= '())->getName():'.$eol.$this->getPadding(4).'Mage::helper(\\'';\n        $text      .= $namespace.'_'.$module;\n        $text      .= '\\')->__(\\'None\\')).'.$eol.$this->getPadding(4).'\\'</div>\\';'.$this->getEol();\n        return $text;\n    }\n\n    /**\n     * get html for frontend\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendHtml()\n    {\n        $entityName = $this->getEntity()->getNameSingular(true);\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        if ($this->getEntity()->getIsEav()) {\n            $html  = '<?php echo Mage::helper(\\'';\n            $html .= $namespace.'_'.$module;\n            $html .= '\\')->__(\"';\n            $html .= $this->getAttribute()->getLabel();\n            $html .= '\");?>:<?php echo $_';\n            $html .= $this->getEntity()->getNameSingular(true);\n            $html .= '->getAttributeText(\\'';\n            $html .= $this->getAttribute()->getCode().'\\');?>'.$this->getEol();\n            return $html;\n        }\n        $html  = '<?php echo Mage::helper(\\'';\n        $html .= $namespace.'_'.$module;\n        $html .= '\\')->__(\"';\n        $html .= $this->getAttribute()->getLabel();\n        $html .= '\");?>:<?php echo ($_';\n        $html .= $entityName.'->get'.$this->getAttribute()->getMagicMethodCode();\n        $html .= '()) ? Mage::getModel(\\'directory/country\\')->load($_';\n        $html .= $entityName.'->get'.$this->getAttribute()->getMagicMethodCode();\n        $html .= '())->getName():Mage::helper(\\'';\n        $html .= $namespace.'_'.$module;\n        $html .= '\\')->__(\\'None\\') ?>'.$this->getEol();\n        return $html;\n    }\n\n    /**\n     * get source for setup\n     *\n     * @access public\n     * @return string|void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupSource()\n    {\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        return $namespace.'_'.$module.'/attribute_source_country';\n    }\n\n    /**\n     * get admin from options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormOptions()\n    {\n        $options  = parent::getFormOptions();\n        $options .= $this->getPadding(3);\n        $options .=\"'values'=> Mage::getResourceModel('directory/country_collection')->toOptionArray(),\";\n        $options .= $this->getEol();\n        return $options;\n    }\n\n    /**\n     * get values for mass action\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMassActionValues()\n    {\n        return 'Mage::getResourceModel(\\'directory/country_collection\\')->toOptionArray()'.$this->getEol();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Decimal.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * decimal attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Decimal extends Ultimate_ModuleCreator_Model_Attribute_Type_Int\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'decimal';\n\n    /**\n     * sql column ddl type\n     *\n     * @var string\n     */\n    protected $_typeDdl     = 'TYPE_DECIMAL';\n\n    /**\n     * sql column ddl size\n     *\n     * @var string\n     */\n    protected $_sizeDdl     = \"'12,4'\";\n\n    /**\n     * eav setup type\n     *\n     * @var string\n     */\n    protected $_setupType   = 'decimal';\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Dropdown/Abstract.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * abstract attribute dropdown type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method string getAttributeOptions\n * @method string getSetupType()\n * @method string getTypeDdl()\n * @method string getSizeDdl()\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Abstract extends Ultimate_ModuleCreator_Model_Abstract\n{\n    /**\n     * type attribute\n     *\n     * @var Ultimate_ModuleCreator_Model_Attribute_Type_Decimal\n     */\n    protected $_typeAttribute;\n\n    /**\n     * check if source needs to be generated\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getGenerateSource()\n    {\n        return true;\n    }\n\n    /**\n     * type attribute setter\n     *\n     * @access public\n     * @param Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown $attributeType\n     * @return $this\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setTypeAttribute(Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown $attributeType)\n    {\n        $this->_typeAttribute = $attributeType;\n        return $this;\n    }\n\n    /**\n     * type attribute getter\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeAttribute()\n    {\n        return $this->_typeAttribute;\n    }\n\n    /**\n     * get additional setup values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalSetup()\n    {\n        return '';\n    }\n\n    /**\n     * get attribute default value\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueProcessed()\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Dropdown/Category.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * category attribute dropdown type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Category extends Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Product\n{\n    /**\n     * entity code for source\n     *\n     * @var string\n     */\n    protected $_entityCode = 'catalog_category';\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Dropdown/Custom.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * custom attribute dropdown type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Custom extends Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Abstract\n{\n    /**\n     * check if source needs to be generated\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getGenerateSource()\n    {\n        return $this->getTypeAttribute()->getAttribute()->getEntity()->getIsFlat();\n    }\n\n    /**\n     * get additional setup values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalSetup()\n    {\n        $content = '';\n        if ($this->getTypeAttribute()->getAttribute()->getEntity()->getIsEav()) {\n            $padding  = $this->getPadding(6);\n            $tab      = $this->getPadding();\n            $eol      = $this->getEol();\n            if ($this->getTypeAttribute()->getAttribute()->getOptions()) {\n                $content .= $padding.\"'option' =>\".$eol;\n                $content .= $padding.$tab.\"array (\".$eol;\n                $content .= $padding.$tab.$tab.\"'values' =>\".$eol;\n                $content .= $padding.$tab.$tab.$tab.\"array (\".$eol;\n                foreach ($this->getTypeAttribute()->getAttribute()->getOptions(true) as $option) {\n                    $content .= $padding.$tab.$tab.$tab.$tab.\"'\".Mage::helper('core')->jsQuoteEscape($option).\"',\".$eol;\n                }\n                $content .= $padding.$tab.$tab.$tab.\"),\".$eol;\n                $content .= $padding.$tab.$tab.\"),\".$eol;\n            }\n        }\n        return $content;\n    }\n\n    /**\n     * get attribute options for source model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributeOptions()\n    {\n        $content = '';\n        $padding  = $this->getPadding(2);\n        $tab      = $this->getPadding();\n        $eol      = $this->getEol();\n        $module   = $this->getTypeAttribute()->getAttribute()->getEntity()->getModule()->getLowerModuleName();\n        $namespace = $this->getTypeAttribute()->getAttribute()->getEntity()->getModule()->getNamespace(true);\n        if ($this->getTypeAttribute()->getAttribute()->getOptions()) {\n            $content .= $padding.'$options =  array('.$eol;\n            foreach ($this->getTypeAttribute()->getAttribute()->getOptions(true) as $index=>$option) {\n                $content .= $padding.$tab.'array('.$eol;\n                $content .= $padding.$tab.$tab.\"'label' => Mage::helper('\";\n                $content .= $namespace.'_'.$module.\"')->__('\".Mage::helper('core')->jsQuoteEscape($option).\"'),\".$eol;\n                $content .= $padding.$tab.$tab.\"'value' => \".($index+1).$eol;\n                $content .= $padding.$tab.'),'.$eol;\n            }\n            $content .= $padding.\");\".$eol;\n            $content .= $padding.'if ($withEmpty) {'.$eol;\n            $content .= $padding.$tab.'array_unshift($options, array(\\'label\\'=>\\'\\', \\'value\\'=>\\'\\'));'.$eol;\n            $content .= $padding.'}'.$eol;\n            $content .= $padding.'return $options;'.$eol;\n        } else {\n            $content  = $padding.'return array();';\n        }\n        return $content;\n    }\n\n    /**\n     * get attribute default value\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueProcessed()\n    {\n        if ($this->getTypeAttribute()->getAttribute()->getForcedDefaultValue()) {\n            return $this->getTypeAttribute()->getAttribute()->getForcedDefaultValue();\n        }\n        if ($this->getTypeAttribute()->getAttribute()->getEntity()->getIsFlat()) {\n            $options = $this->getTypeAttribute()->getAttribute()->getOptions(true);\n            $defaultValue = trim($this->getTypeAttribute()->getAttribute()->getDefaultValue());\n            $defaultValue = explode(Ultimate_ModuleCreator_Model_Attribute::OPTION_SEPARATOR, $defaultValue);\n            $multiselectValues = array();\n            foreach ($options as $index=>$option) {\n                if (in_array($option, $defaultValue)) {\n                    if ($this->getTypeAttribute() instanceof Ultimate_ModuleCreator_Model_Attribute_Type_Multiselect) {\n                        $multiselectValues[] = $index + 1;\n                    } else {\n                        return ($index + 1);\n                    }\n                }\n            }\n            return implode(',', $multiselectValues);\n        }\n        //EAV default values are handled in the install script. there is no way of doing it through the definition.\n        return '';\n    }\n}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Dropdown/Customer.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * customer attribute dropdown type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Customer extends Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Product\n{\n    /**\n     * entity code for source\n     *\n     * @var string\n     */\n    protected $_entityCode = 'customer';\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Dropdown/Product.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * product attribute dropdown type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Product extends Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Abstract\n{\n    /**\n     * entity code for source\n     *\n     * @var string\n     */\n    protected $_entityCode      = 'catalog_product';\n    /**\n     * entity attribute\n     *\n     * @var string\n     */\n    protected $_entityAttribute = null;\n\n    /**\n     * get attribute options for source model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributeOptions()\n    {\n        $content = '';\n        $padding  = $this->getPadding(2);\n        $eol      = $this->getEol();\n        $attrCode = $this->getTypeAttribute()->getAttribute()->getOptionsSourceAttribute();\n        $content .= $padding.'$'.\"source  = Mage::getModel('eav/config')->getAttribute('\";\n        $content .= $this->getEntityCode().\"', '\".$attrCode.\"');\".$eol;\n        $content .= $padding.'return $source->getSource()->getAllOptions($withEmpty, $defaultValues);';\n        return $content;\n    }\n\n    /**\n     * get entity code\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityCode()\n    {\n        return $this->_entityCode;\n    }\n\n    /**\n     * get attribute setup type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupType()\n    {\n        $attrCode = $this->getTypeAttribute()->getAttribute()->getOptionsSourceAttribute();\n        /** @var Mage_Eav_Model_Config $config */\n        $config = Mage::getModel('eav/config');\n        $productAttribute = $config->getAttribute($this->getEntityCode(), $attrCode);\n        if ($productAttribute->getId()) {\n            $type = $productAttribute->getBackendType();\n            if ($type == 'static') {\n                return false;\n            }\n            return $type;\n        }\n        return false;\n    }\n\n    /**\n     * get attribute setup type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeDdl()\n    {\n        $entityAttribute = $this->_getEntityAttribute();\n        switch($entityAttribute->getBackendType()) {\n            case 'int':\n                return 'TYPE_INTEGER';\n            break;\n            case 'varchar':\n                return 'TYPE_TEXT';\n            break;\n            case 'text':\n                return 'TYPE_TEXT';\n            case 'datetime':\n                return 'TYPE_DATETIME';\n            break;\n            case 'decimal':\n                return 'TYPE_DECIMAL';\n            break;\n            default:\n                return false;\n            break;\n        }\n    }\n\n    /**\n     * get attribute setup type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeSize()\n    {\n        $entityAttribute = $this->_getEntityAttribute();\n        switch($entityAttribute->getBackendType()) {\n            case 'int':\n                return 'null';\n                break;\n            case 'varchar':\n                return '255';\n                break;\n            case 'text':\n                return \"'64k'\";\n                break;\n            case 'datetime':\n                return \"255\";\n                break;\n            case 'decimal':\n                return \"'12,4'\";\n                break;\n            default:\n                return false;\n                break;\n        }\n    }\n\n    /**\n     * get the source model attribute\n     *\n     * @access public\n     * @return null|Mage_Eav_Model_Entity_Attribute_Abstract\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _getEntityAttribute()\n    {\n        if (is_null($this->_entityAttribute)) {\n            $attrCode = $this->getTypeAttribute()->getAttribute()->getOptionsSourceAttribute();\n            /** @var Mage_Eav_Model_Config $config */\n            $config = Mage::getModel('eav/config');\n            $productAttribute = $config->getAttribute($this->getEntityCode(), $attrCode);\n            $this->_entityAttribute = $productAttribute;\n        }\n        return $this->_entityAttribute;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Dropdown.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * dropdown attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'dropdown';\n\n    /**\n     * dropdown subtype\n     *\n     * @var Ultimate_ModuleCreator_Model_Abstract\n     */\n    protected $_subTypeInstance;\n\n    /**\n     * sql colum ddl type\n     *\n     * @var string\n     */\n    protected $_typeDdl     = 'TYPE_INTEGER';\n\n    /**\n     * sql colum ddl size\n     *\n     * @var string\n     */\n    protected $_sizeDdl     = 'null';\n\n    /**\n     * eav setup type\n     *\n     * @var string\n     */\n    protected $_setupType   = 'int';\n\n    /**\n     * eav setup input\n     *\n     * @var string\n     */\n    protected $_setupInput \t= 'select';\n\n    /**\n     * eav setup source\n     *\n     * @var string\n     */\n    protected $_setupSource = 'eav/entity_attribute_source_table';\n\n    /**\n     * get source for setup\n     *\n     * @access public\n     * @return string|void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupSource()\n    {\n        if (!$this->getGenerateSource()) {\n            return parent::getSetupSource();\n        }\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $entity     = $this->getEntity()->getNameSingular(true);\n        return $namespace.'_'.$module.'/'.$entity.'_attribute_source_'.$this->getAttribute()->getCodeForFileName();\n    }\n\n    /**\n     * get admin column options\n     *\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminColumnOptions()\n    {\n        $options    = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $entity     = strtolower($this->getAttribute()->getEntity()->getNameSingular());\n        $attr       = $this->getAttribute()->getCode();\n        $options   .= $this->getPadding(4).\"'type'  => 'options',\".$this->getEol();\n        if ($this->getAttribute()->getEntity()->getIsEav()) {\n            $options .= $this->getPadding(4).\n                \"'options' => Mage::helper('\".$namespace.'_'.$module.\n                \"')->convertOptions(\".$this->getEol().$this->getPadding(5).\"Mage::getModel('eav/config')->getAttribute('\".\n                $namespace.'_'.$module.'_'.$entity.\"', '\".$attr.\n                \"')->getSource()->getAllOptions(false)\".$this->getEol().$this->getPadding(4).\")\".$this->getEol();\n        } else {\n            $options .= $this->getPadding(4).\n                \"'options' => Mage::helper('\".$namespace.'_'.$module.\n                \"')->convertOptions(\".$this->getEol().$this->getPadding(5).\"Mage::getModel('\".\n                $namespace.'_'.$module.'/'.$entity.\"_attribute_source_\".\n                $this->getAttribute()->getCodeForFileName(false).\n                \"')->getAllOptions(false)\".$this->getEol().$this->getPadding(4).\")\".$this->getEol();\n        }\n        return $options;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return 'select';\n    }\n\n    /**\n     * get text for rss\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRssText()\n    {\n        $eol            = $this->getEol();\n        $entityName     = $this->getEntity()->getNameSingular(true);\n        $module         = $this->getModule()->getLowerModuleName();\n        $namespace      = $this->getNamespace(true);\n        if ($this->getAttribute()->getEntity()->getIsEav()) {\n            return $this->getPadding(3).\n                '$description .= \\'<div>\\'.'.$eol.$this->getPadding(4).'Mage::helper(\\''.\n                $namespace.'_'.$module.'\\')->__(\"'.$this->getAttribute()->getLabel().\n                '\").\\': \\''.$eol.$this->getPadding(4).'.$item->getAttributeText(\\''.\n                $this->getAttribute()->getCode().'\\').'.$eol.$this->getPadding(4).'\\'</div>\\';'.$this->getEol();\n        } else {\n            $attributeFile = $this->getAttribute()->getCodeForFileName(false);\n            $code = $this->getAttribute()->getMagicMethodCode();\n            return $this->getPadding(3).\n                '$description .= \\'<div>\\'.'.$eol.$this->getPadding(4).'Mage::helper(\\''.\n                $namespace.'_'.$module.'\\')->__(\"'.\n                $this->getAttribute()->getLabel().'\").\\': \\''.$eol.$this->getPadding(4).'.Mage::getSingleton(\\''.\n                $namespace.'_'.$module.'/'.$entityName.'_attribute_source_'.$attributeFile.\n                '\\')->getOptionText($item->get'.$code.'()).'.$eol.$this->getPadding(4).'\\'</div>\\';'.$this->getEol();\n        }\n    }\n\n    /**\n     * check if source needs to be generated\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getGenerateSource()\n    {\n        return $this->getSubTypeInstance()->getGenerateSource();\n    }\n\n    /**\n     * get subtype instance\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Abstract\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSubTypeInstance()\n    {\n        if (!$this->_subTypeInstance) {\n            $type = $this->getAttribute()->getOptionsSource();\n            try{\n                /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n                $helper = Mage::helper('modulecreator');\n                $types  = $helper->getDropdownSubtypes(false);\n                $instanceModel = (string)$types->$type->type_model;\n                /** @var Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Abstract $subtypeInstance */\n                $subtypeInstance = Mage::getModel($instanceModel);\n                $this->_subTypeInstance = $subtypeInstance;\n                $this->_subTypeInstance->setTypeAttribute($this);\n            } catch (Exception $e){\n                throw new Ultimate_ModuleCreator_Exception(\"Invalid dropdown subtype: \". $type);\n            }\n        }\n        return $this->_subTypeInstance;\n    }\n\n    /**\n     * get additional setup values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalSetup()\n    {\n        return $this->getSubTypeInstance()->getAdditionalSetup();\n    }\n\n    /**\n     * get html for frontend\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendHtml()\n    {\n        $entityName     = $this->getEntity()->getNameSingular(true);\n        $module         = $this->getModule()->getLowerModuleName();\n        $namespace      = $this->getNamespace(true);\n        if ($this->getAttribute()->getEntity()->getIsEav()) {\n            return '<?php echo Mage::helper(\\''.\n                $namespace.'_'.$module.'\\')->__(\"'.\n                $this->getAttribute()->getLabel().'\");?>:<?php echo $_'.\n                $entityName.'->getAttributeText(\\''.\n                $this->getAttribute()->getCode().'\\');?>'.$this->getEol();\n        } else {\n            $attributeFile = $this->getAttribute()->getCodeForFileName(false);\n            $code = $this->getAttribute()->getMagicMethodCode();\n            return '<?php echo Mage::helper(\\''.\n                $namespace.'_'.$module.'\\')->__(\"'.\n                $this->getAttribute()->getLabel().\n                '\");?>:<?php echo Mage::getSingleton(\\''.\n                $namespace.'_'.$module.'/'.$entityName.'_attribute_source_'.$attributeFile.\n                '\\')->getOptionText($_'.$entityName.'->get'.$code.'())'.';?>'.$this->getEol();\n        }\n    }\n\n    /**\n     * get attribute options for source model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributeOptions()\n    {\n        return $this->getSubTypeInstance()->getAttributeOptions();\n    }\n\n    /**\n     * get the options for form input\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormOptions()\n    {\n        $options    = parent::getFormOptions();\n        $padding    = $this->getPadding(4);\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getEntity()->getNameSingular(true);\n        $namespace  = $this->getNamespace(true);\n        $options   .= $padding.\"'values'=> Mage::getModel('\".\n            $namespace.'_'.$module.'/'.$entity.\"_attribute_source_\".\n            $this->getAttribute()->getCodeForFileName(false).\n            \"')->getAllOptions(\".$this->getOptionsFlag().\"),\".$this->getEol();\n        return $options;\n    }\n\n    /**\n     * check if options should be returned with empty\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getOptionsFlag()\n    {\n        return 'true';\n    }\n\n    /**\n     * get the setup type of the dropdown\n     *\n     * @access public\n     * @return string|void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupType()\n    {\n        $setupType = $this->getSubTypeInstance()->getSetupType();\n        if (empty($setupType)) {\n            return parent::getSetupType();\n        }\n        return $setupType;\n    }\n\n    /**\n     * get the setup type of the dropdown\n     *\n     * @access public\n     * @return string|void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeDdl()\n    {\n        $setupType = $this->getSubTypeInstance()->getTypeDdl();\n        if (empty($setupType)) {\n            return parent::getTypeDdl();\n        }\n        return $setupType;\n    }\n\n    /**\n     * get column ddl size\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSizeDdl()\n    {\n        $size = $this->getSubTypeInstance()->getSizeDdl();\n        if (empty($size)) {\n            return parent::getSizeDdl();\n        }\n        return $size;\n    }\n\n    /**\n     * get values for mass action\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMassActionValues()\n    {\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getEntity()->getNameSingular(true);\n        $namespace  = $this->getNamespace(true);\n        if ($this->getEntity()->getIsEav()) {\n            return \"Mage::getModel('eav/config')->getAttribute('\".\n                $namespace.'_'.$module.\"_\".$entity.\"', '\".\n                $this->getAttribute()->getCode().\"')\".$this->getEol().$this->getPadding(7).\"->getSource()->getAllOptions(\".\n                $this->getOptionsFlag().\"),\".$this->getEol();\n        } else {\n            return \"Mage::getModel('\".\n                $namespace.'_'.$module.'/'.$entity.\"_attribute_source_\".\n                $this->getAttribute()->getCodeForFileName(false).\n                \"')\".$this->getEol().$this->getPadding(7).\"->getAllOptions(\".$this->getOptionsFlag().\"),\".$this->getEol();\n        }\n    }\n\n    /**\n     * get attribute default value\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueProcessed()\n    {\n        return $this->getSubTypeInstance()->getDefaultValueProcessed();\n    }\n\n    /**\n     * get attribute default value setup content\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueSetup()\n    {\n        $content = '';\n        if ($this->getSubTypeInstance() instanceof Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Custom\n            && $this->getAttribute()->getDefaultValue()\n        ) {\n            $eol      = $this->getEol();\n            $entity   = $this->getEntity();\n            $attribute= $this->getAttribute();\n            $content .= '$attribute = Mage::getSingleton(\\'eav/config\\')->getAttribute(\\''.\n                $this->getNamespace(true).'_'.$this->getModule()->getLowerModuleName().'_'.$entity->getNameSingular().\n                '\\', \\''.$attribute->getCode().'\\');'.$eol;\n            $content .= '$options = $attribute->getSource()->getAllOptions(false);'.$eol;\n            $content .= 'foreach ($options as $option) {'.$eol;\n            $content .= $this->getPadding().'if ($option[\\'label\\'] == \\''.\n                Mage::helper('core')->jsQuoteEscape($attribute->getDefaultValue()).'\\') {'.$eol;\n            $content .= $this->getPadding(2).\n                '$this->updateAttribute(\\''.\n                $this->getNamespace(true).'_'.$this->getModule()->getLowerModuleName().'_'.$entity->getNameSingular().\n                '\\', \\''.$attribute->getCode().'\\', \\'default_value\\', $option[\\'value\\']);'.$eol;\n            $content .= $this->getPadding().'}'.$eol;\n            $content .= '}'.$eol;\n        }\n        return $content;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/File.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * file attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_File extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type       = 'file';\n\n    /**\n     * eav setup input\n     *\n     * @var string\n     */\n    protected $_setupInput = 'file';\n\n    /**\n     * don't show in admin grid\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminGrid()\n    {\n        return false;\n    }\n\n    /**\n     * check if attribute is required\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRequired()\n    {\n        return false;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return 'file';\n    }\n\n    /**\n     * get text for rss\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRssText()\n    {\n        $content    = '';\n        $entityName = $this->getEntity()->getNameSingular(true);\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $content   .= $this->getPadding(3).'if ($item->get'.$this->getAttribute()->getMagicMethodCode().'()) {'.$eol;\n        $content   .= $this->getPadding(4).'$description .= \\'<div>\\';'.$eol;\n        $content   .= $this->getPadding(4).'$description .= Mage::helper(\\''.\n            $namespace.'_'.$module.'\\')->__(\\''.$this->getAttribute()->getLabel().'\\');'.$eol;\n        $content   .= $this->getPadding(4).'$description .= \\'    <a href=\"\\'.Mage::helper(\\''.\n            $namespace.'_'.$module.'/'.$entityName.'\\')->getFileBaseUrl().$item->get'.\n            $this->getAttribute()->getMagicMethodCode().'().\\'\">\\';'.$eol;\n        $content   .= $this->getPadding(4).'$description .= \\'        <span>\\'. basename($item->get'.\n            $this->getAttribute()->getMagicMethodCode().'()).\\'</span>\\';'.$eol;\n        $content   .= $this->getPadding(4).'$description .= \\'    </a>\\';'.$eol;\n        $content   .= $this->getPadding(4).'$description .= \\'</div>\\';'.$eol;\n        $content   .= $this->getPadding(3).'}'.$eol;\n\n        return $content;\n    }\n\n    /**\n     * get the html for frontend\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendHtml()\n    {\n        $content    = '';\n        $eol        = $this->getEol();\n        $entityName = $this->getAttribute()->getEntity()->getNameSingular(true);\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $content   .= $this->getPadding().'<?php if ($_'.$entityName.'->get'.\n            $this->getAttribute()->getMagicMethodCode().'()) :?>'.$eol;\n        $content   .= $this->getPadding(2).'<a href=\"<?php echo Mage::helper(\\''.\n            $namespace.'_'.$module.'/'.$entityName.'\\')->getFileBaseUrl().$_'.\n            $entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'();?>\">'.$eol;\n        $content   .= $this->getPadding(3).'<span><?php echo basename($_'.\n            $entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'())?></span>'.$eol;\n        $content   .= $this->getPadding(2).'</a>'.$eol;\n        $content   .= $this->getPadding().'<?php endif;?>'.$eol;\n        return $content;\n    }\n\n    /**\n     * get the setup backend type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupBackend()\n    {\n        $attribute = $this->getAttribute();\n        $entity = $attribute->getEntity();\n        $module = $this->getModule();\n        return $this->getNamespace(true).'_'.\n            $module->getLowerModuleName().'/'.\n            $entity->getNameSingular(true).'_attribute_backend_file';\n    }\n\n    /**\n     * get attribute default value\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueProcessed()\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Image.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * image attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Image extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type       = 'image';\n    /**\n     * eav setup input\n     *\n     * @var string\n     */\n    protected $_setupInput = 'image';\n\n    /**\n     * don't show in admin grid\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminGrid()\n    {\n        return false;\n    }\n\n    /**\n     * check if attribute is required\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRequired()\n    {\n        return false;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return 'image';\n    }\n\n    /**\n     * get text for rss\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRssText()\n    {\n        $eol        = $this->getEol();\n        $content    = '';\n        $entityName = $this->getEntity()->getNameSingular(true);\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $content   .= $this->getPadding(3).'if ($item->get'.$this->getAttribute()->getMagicMethodCode().'()) {'.$eol;\n        $content   .= $this->getPadding(4).'$description .= \\'<div>\\';'.$eol;\n        $content   .= $this->getPadding(4).'$description .= Mage::helper(\\''.$namespace.'_'.$module.\n            '\\')->__(\\''.$this->getAttribute()->getLabel().'\\');'.$eol;\n        $content   .= $this->getPadding(4).'$description .= \\'<img src=\"\\'.Mage::helper(\\''.\n            $namespace.'_'.$module.'/'.$entityName.'_image\\')->init($item, \\''.\n            $this->getAttribute()->getCode().'\\')->resize(75).\\'\" alt=\"\\'.$this->escapeHtml($item->get'.\n            $this->getEntity()->getNameAttributeMagicCode().'()).\\'\" />\\';'.$eol;\n        $content   .= $this->getPadding(4).'$description .= \\'</div>\\';'.$eol;\n        $content   .= $this->getPadding(3).'}'.$eol;\n        return $content;\n    }\n\n    /**\n     * get the html for frontend\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendHtml()\n    {\n        $eol        = $this->getEol();\n        $content    = '';\n        $entityName = $this->getEntity()->getNameSingular(true);\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $content   .= '<?php if ($_'.$entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'()) :?>'.$eol;\n        $content   .= $this->getHelper()->getPadding().\n            '<img src=\"<?php echo Mage::helper(\\''.$namespace.'_'.$module.'/'.$entityName.'_image\\')->init($_'.\n            $entityName.', \\''.$this->getAttribute()->getCode().\n            '\\')->resize(75);?>\" alt=\"<?php echo $this->escapeHtml($_'.\n            $entityName.'->get'.$this->getAttribute()->getEntity()->getNameAttributeMagicCode().'());?>\" />'.$eol;\n        $content   .= '<?php endif;?>'.$eol;\n        return $content;\n    }\n\n    /**\n     * get the setup backend type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupBackend()\n    {\n        $attribute  = $this->getAttribute();\n        $entity     = $attribute->getEntity();\n        $module     = $entity->getModule();\n        return $this->getNamespace(true).'_'.\n            $module->getLowerModuleName().'/'.\n            $entity->getNameSingular(true).'_attribute_backend_image';\n    }\n\n    /**\n     * get attribute default value\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueProcessed()\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Int.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * int attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Int extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'int';\n\n    /**\n     * sql column ddl type\n     *\n     * @var string\n     */\n    protected $_typeDdl     = 'TYPE_INTEGER';\n\n    /**\n     * sql column ddl size\n     *\n     * @var string\n     */\n    protected $_sizeDdl     = 'null';\n\n    /**\n     * eav setup type\n     *\n     * @var string\n     */\n    protected $_setupType   = 'int';\n\n    /**\n     * get admin column options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminColumnOptions()\n    {\n        $options = $this->getEol();\n        $options .= $this->getPadding(4);\n        $options .= \"'type'=> 'number',\".$this->getEol();\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Multiselect.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * multiselect attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Multiselect extends Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'multiselect';\n\n    /**\n     * sql column ddl type\n     *\n     * @var string\n     */\n    protected $_typeDdl     = 'TYPE_TEXT';\n\n    /**\n     * sql column ddl size\n     *\n     * @var string\n     */\n    protected $_sizeDdl     = \"'64k'\";\n\n    /**\n     * eav setup input\n     *\n     * @var string\n     */\n    protected $_setupInput \t= 'multiselect';\n\n    /**\n     * eav setup type\n     *\n     * @var string\n     */\n    protected $_setupType   = 'text';\n\n    /**\n     * backend setup type\n     *\n     * @var string\n     */\n    protected $_setupBackend = 'eav/entity_attribute_backend_array';\n\n    /**\n     * don't show in admin grid\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminGrid()\n    {\n        return false;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return 'multiselect';\n    }\n\n    /**\n     * check if attribute is multiple select\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsMultipleSelect()\n    {\n        return true;\n    }\n\n    /**\n     * get the setup type of the dropdown\n     *\n     * @access public\n     * @return string|void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupType()\n    {\n        return $this->_setupType;\n    }\n\n    /**\n     * get attribute setup type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeDdl()\n    {\n        return $this->_typeDdl;\n    }\n\n    /**\n     * check if options should be returned with empty\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getOptionsFlag()\n    {\n        return 'false';\n    }\n\n    /**\n     * get values for mass action\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMassActionValues()\n    {\n        return '';\n    }\n\n    /**\n     * get attribute default value setup content\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueSetup()\n    {\n        $content = '';\n        if ($this->getSubTypeInstance() instanceof Ultimate_ModuleCreator_Model_Attribute_Type_Dropdown_Custom\n            && $this->getAttribute()->getDefaultValue()\n        ) {\n            $eol      = $this->getEol();\n            $entity   = $this->getEntity();\n            $attribute= $this->getAttribute();\n            $content .= '$attribute = Mage::getSingleton(\\'eav/config\\')->getAttribute(\\''.\n                $this->getNamespace(true).'_'.$this->getModule()->getLowerModuleName().'_'.\n                $entity->getNameSingular().'\\', \\''.$attribute->getCode().'\\');'.$eol;\n            $content .= '$options = $attribute->getSource()->getAllOptions(false);'.$eol;\n            $content .= '$defaultOptions = array();'.$eol;\n            $content .= 'foreach ($options as $option) {'.$eol;\n            $content .= $this->getPadding().'if (in_array($option[\\'label\\'], array(\\''.\n                implode(\n                    \"','\",\n                    explode(\n                        Ultimate_ModuleCreator_Model_Attribute::OPTION_SEPARATOR,\n                        Mage::helper('core')->jsQuoteEscape($attribute->getDefaultValue())\n                    )\n                ).'\\'))) {'.$eol;\n            $content .= $this->getPadding(2).'$defaultOptions[] = $option[\\'value\\'];'.$eol;\n            $content .= $this->getPadding().'}'.$eol;\n            $content .= '}'.$eol;\n            $content .= '$this->updateAttribute(\\''.\n                $this->getNamespace(true).'_'.$this->getModule()->getLowerModuleName().'_'.\n                $entity->getNameSingular().'\\', \\''.$attribute->getCode().\n                '\\', \\'default_value\\', implode(\\',\\', $defaultOptions));'.$eol;\n        }\n        return $content;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Signedint.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * int attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Signedint extends Ultimate_ModuleCreator_Model_Attribute_Type_Int\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'signedint';\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Text.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * text attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Text extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type = 'text';\n\n    /**\n     * get admin column options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminColumnOptions()\n    {\n        $options = $this->getEol();\n        $options .= $this->getPadding(4);\n        $options .= \"'type'=> 'text',\".$this->getEol();\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Textarea.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * textarea attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Textarea extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'textarea';\n\n    /**\n     * sql column ddl type\n     *\n     * @var string\n     */\n    protected $_typeDdl     = 'TYPE_TEXT';\n\n    /**\n     * sql column ddl size\n     *\n     * @var string\n     */\n    protected $_sizeDdl     = \"'64k'\";\n\n    /**\n     * eav setup type\n     *\n     * @var string\n     */\n    protected $_setupType   = 'text';\n\n    /**\n     * eav setup input\n     *\n     * @var string\n     */\n    protected $_setupInput \t= 'textarea';\n\n    /**\n     * don't show in admin grid\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminGrid()\n    {\n        return false;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        if ($this->getAttribute()->getEditor()) {\n            return 'editor';\n        }\n        return 'textarea';\n    }\n\n    /**\n     * can use editor\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditor()\n    {\n        return $this->getAttribute()->getData('editor');\n    }\n\n    /**\n     * get the options for form input\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormOptions()\n    {\n        $options = '';\n        if ($this->getEditor() && !$this->getEntity()->getIsTree()) {\n            $options = $this->getPadding(3).\"'config' => \".\"$\".\"wysiwygConfig,\".$this->getEol();\n        }\n        $options .= parent::getFormOptions();\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Timestamp.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * timestamp attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Timestamp extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'timestamp';\n\n    /**\n     * sql column ddl type\n     *\n     * @var string\n     */\n    protected $_typeDdl     = 'TYPE_DATETIME';\n\n    /**\n     * eav setup type\n     *\n     * @var string\n     */\n    protected $_setupType   = 'datetime';\n\n    /**\n     * eav setup input\n     *\n     * @var string\n     */\n    protected $_setupInput \t= 'date';\n\n    /**\n     * setup backend\n     *\n     * @var string\n     */\n    protected $_setupBackend = 'eav/entity_attribute_backend_datetime';\n\n    /**\n     * get admin column options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminColumnOptions()\n    {\n        $options = $this->getEol();\n        $options .= $this->getPadding(4);\n        $options .= \"'type'=> 'date',\".$this->getEol();\n        return $options;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return 'date';\n    }\n\n    /**\n     * get html for frontend\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendHtml()\n    {\n        $entityName = $this->getEntity()->getNameSingular(true);\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        return '<?php echo Mage::helper(\\''.\n            $namespace.'_'.$module.'\\')->__(\"'.\n            $this->getAttribute()->getLabel().\n            '\");?>: <?php echo Mage::helper(\\'core\\')->formatDate($_'.\n            $entityName.'->get'.$this->getAttribute()->getMagicMethodCode().'(), \\'full\\');?>'.$this->getEol();\n    }\n\n    /**\n     * get options for admin form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormOptions()\n    {\n        $options = parent::getFormOptions();\n        $padding = $this->getPadding(3);\n        $eol     = $this->getEol();\n        $options .= $padding.'\\'image\\' => $this->getSkinUrl(\\'images/grid-cal.gif\\'),'.$eol;;\n        $options .= $padding.\n            '\\'format\\'  => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),'.$eol;\n        return $options;\n    }\n\n    /**\n     * get text for rss\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRssText()\n    {\n        $attribute  = $this->getAttribute();\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        return $this->getPadding(3).'$'.\n            'description .= \\'<div>\\'.Mage::helper(\\''.\n            $namespace.'_'.$module.'\\')->__(\\''.\n            $attribute->getLabel().'\\').\\': \\'.Mage::helper(\\'core\\')->formatDate($item->get'.\n            $this->getAttribute()->getMagicMethodCode().'(), \\'full\\').\\'</div>\\';'.$this->getEol();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute/Type/Yesno.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * yes/no attribute type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Attribute_Type_Yesno extends Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n{\n    /**\n     * type code\n     *\n     * @var string\n     */\n    protected $_type        = 'yesno';\n\n    /**\n     * sql column ddl type\n     *\n     * @var string\n     */\n    protected $_typeDdl     = 'TYPE_SMALLINT';\n\n    /**\n     * sql column ddl size\n     *\n     * @var string\n     */\n    protected $_sizeDdl     = 'null';\n\n    /**\n     * eav setup type\n     *\n     * @var string\n     */\n    protected $_setupType   = 'int';\n\n    /**\n     * eav setup input\n     */\n    protected $_setupInput \t= 'select';\n\n    /**\n     * eav setup source\n     */\n    protected $_setupSource\t= 'eav/entity_attribute_source_boolean';\n\n    /**\n     * get admin column options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminColumnOptions()\n    {\n        $eol        = $this->getEol();\n        $options    = $eol;\n        $extension  = $this->getModule()->getExtensionName(true);\n        $options   .= $this->getPadding(4).\"'type'    => 'options',\".$eol;\n        $options   .= $this->getPadding(5).\"'options'    => array(\".$eol;\n        $options   .= $this->getPadding(5).\"'1' => Mage::helper('\".$extension.\"')->__('Yes'),\".$eol;\n        $options   .= $this->getPadding(5).\"'0' => Mage::helper('\".$extension.\"')->__('No'),\".$eol;\n        $options   .= $this->getPadding(4).\")\".$eol;\n        return $options;\n    }\n\n    /**\n     * get the type for the form\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return 'select';\n    }\n\n    /**\n     * get text for rss\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRssText()\n    {\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        return $this->getPadding(3).\n            '$description .= \\'<div>\\'.Mage::helper(\\''.\n            $namespace.'_'.$module.'\\')->__(\"'.\n            $this->getAttribute()->getLabel().\n            '\").\\':\\'.(($item->get'.$this->getAttribute()->getMagicMethodCode().\n            '() == 1) ? Mage::helper(\\''.$namespace.'_'.$module.\n            '\\')->__(\\'Yes\\') : Mage::helper(\\''.\n            $namespace.'_'.$module.'\\')->__(\\'No\\')).\\'</div>\\';'.$this->getEol();\n    }\n\n    /**\n     * get html for frontend\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendHtml()\n    {\n        $entityName = $this->getEntity()->getNameSingular(true);\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        return '<?php echo Mage::helper(\\''.\n            $namespace.'_'.$module.'\\')->__(\"'.\n            $this->getAttribute()->getLabel().\n            '\");?>:<?php echo ($_'.\n            $entityName.'->get'.$this->getAttribute()->getMagicMethodCode().\n            '() == 1) ? Mage::helper(\\''.$namespace.'_'.$module.\n            '\\')->__(\\'Yes\\') : Mage::helper(\\''.\n            $namespace.'_'.$module.'\\')->__(\\'No\\') ?>'.$this->getEol();\n    }\n\n    /**\n     * check if attribute is yes/no\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsYesNo()\n    {\n        return true;\n    }\n\n    /**\n     * get the options for form input\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormOptions()\n    {\n        $options    = parent::getFormOptions();\n        $padding    = $this->getPadding(3);\n        $tab        = $this->getPadding();\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $options   .= $padding.\"'values'=> array(\".$eol;\n        $options   .= $padding.$tab.'array('.$eol;\n        $options   .= $padding.$tab.$tab.\"'value' => 1,\".$eol;\n        $options   .= $padding.$tab.$tab.\"'label' => Mage::helper('\".$namespace.'_'.$module.\"')->__('Yes'),\".$eol;\n        $options   .= $padding.$tab.\"),\".$eol;\n        $options   .= $padding.$tab.'array('.$eol;\n        $options   .= $padding.$tab.$tab.\"'value' => 0,\".$eol;\n        $options   .= $padding.$tab.$tab.\"'label' => Mage::helper('\".$namespace.'_'.$module.\"')->__('No'),\".$eol;\n        $options   .= $padding.$tab.\"),\".$eol;\n        $options   .= $padding.\"),\".$eol;\n        return $options;\n    }\n\n    /**\n     * get values for mass action\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMassActionValues()\n    {\n        $eol       = $this->getEol();\n        $module    = $this->getModule()->getLowerModuleName();\n        $namespace = $this->getNamespace(true);\n        $padding   = $this->getPadding(7);\n        $tab       = $this->getPadding();\n        $content   = 'array('.$eol;\n        $content  .= $padding.$tab.\"'1' => Mage::helper('\".$namespace.'_'.$module.\"')->__('Yes'),\".$eol;\n        $content  .= $padding.$tab.\"'0' => Mage::helper('\".$namespace.'_'.$module.\"')->__('No'),\".$eol;\n        $content  .= $padding.')'.$eol;\n        return $content;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Attribute.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method Ultimate_ModuleCreator_Model_Attribute setIndex()\n * @method string getForcedDefaultValue()\n * @method string getDefaultValue()\n * @method string getOptionsSourceAttribute()\n * @method string getLabel()\n * @method string getNote()\n * @method int getPosition()\n * @method string getCode()\n * @method bool getIsName()\n * @method Ultimate_ModuleCreator_Model_Attribute setUserDefined\n * @method Ultimate_ModuleCreator_Model_Attribute setEditor\n * @method string getType()\n * @method Ultimate_ModuleCreator_Model_Attribute setCode()\n * @method Ultimate_ModuleCreator_Model_Attribute setType()\n * @method Ultimate_ModuleCreator_Model_Attribute setLabel()\n * @method string getOptionsSource()\n * @method Ultimate_ModuleCreator_Model_Attribute setOptionsSource()\n * @method Ultimate_ModuleCreator_Model_Attribute setForcedSource()\n * @method Ultimate_ModuleCreator_Model_Attribute setScope()\n * @method Ultimate_ModuleCreator_Model_Attribute setUseFilterIndex()\n * @method Ultimate_ModuleCreator_Model_Attribute setPosition()\n * @method Ultimate_ModuleCreator_Model_Attribute setForcedSetupType()\n * @method Ultimate_ModuleCreator_Model_Attribute setForcedVisible()\n * @method string getPreElementText()\n * @method bool getUseFilterIndex()\n * @method bool hasForcedSetupType()\n * @method string getForcedSetupType()\n * @method string getForcedSetupBackend()\n * @method string getForcedSource()\n * @method int getScope()\n * @method bool hasForcedVisible()\n * @method string getForcedVisible()\n * @method Ultimate_ModuleCreator_Model_Attribute setDefaultValue()\n * @method Ultimate_ModuleCreator_Model_Attribute setForcedSetupBackend()\n * @method Ultimate_ModuleCreator_Model_Attribute setIgnoreApi()\n * @method Ultimate_ModuleCreator_Model_Attribute setOptions()\n * @method Ultimate_ModuleCreator_Model_Attribute setForcedDefaultValue()\n * @method bool getWidget()\n * @method bool getFrontend()\n * @method bool getIgnoreApi()\n * @method int getIndex()\n *\n */\nclass Ultimate_ModuleCreator_Model_Attribute extends Ultimate_ModuleCreator_Model_Abstract\n{\n    /**\n     * custom option separator\n     */\n    const OPTION_SEPARATOR      = \"\\n\";\n\n    /**\n     * entity object\n     *\n     * @var mixed(null|Ultimate_ModuleCreator_Model_Entity)\n     */\n    protected $_entity          = null;\n\n    /**\n     * attribute type instance\n     *\n     * @var mixed(null|Ultimate_ModuleCreator_Model_Attribute_Type_Abstract)\n     */\n    protected $_typeInstance    = null;\n\n    /**\n     * placeholders for replacing in source\n     *\n     * @var mixed\n     */\n    protected $_placeholders    = null;\n\n    /**\n     * set the model entity\n     *\n     * @access public\n     * @param  Ultimate_ModuleCreator_Model_Entity $entity\n     * @return Ultimate_ModuleCreator_Model_Attribute\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setEntity(Ultimate_ModuleCreator_Model_Entity $entity)\n    {\n        $this->_entity = $entity;\n        return $this;\n    }\n\n    /**\n     * get the attribute entity\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Entity\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntity()\n    {\n        return $this->_entity;\n    }\n\n    /**\n     * get the magic function code for attribute\n     *\n     * @access public\n     * @param bool $ucFirst\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMagicMethodCode($ucFirst = true)\n    {\n        $code = $this->getCode();\n        $code = $this->_camelize($code);\n        if ($ucFirst) {\n            return $code;\n        }\n        //lcfirst only works for php 5.3+\n        $code{0} = strtolower($code{0});\n        return $code;\n    }\n\n    /**\n     * get attribute the type instance\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Attribute_Type_Abstract\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeInstance()\n    {\n        if (!$this->_typeInstance) {\n            $type = $this->getType();\n            try {\n                $types = $this->getHelper()->getAttributeTypes(false);\n                $instanceModel = $types->$type->type_model;\n                /** @var Ultimate_ModuleCreator_Model_Attribute_Type_Abstract $typeInstance */\n                $typeInstance = Mage::getModel($instanceModel);\n                $this->_typeInstance = $typeInstance;\n                $this->_typeInstance->setAttribute($this);\n            } catch (Exception $e){\n                throw new Ultimate_ModuleCreator_Exception(\"Invalid attribute type: \". $type);\n            }\n        }\n        return $this->_typeInstance;\n    }\n\n    /**\n     * check if an attribute is in the admin grid\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminGrid()\n    {\n        if ($this->getIsName()) {\n            return true;\n        }\n        return $this->getTypeInstance()->getAdminGrid();\n    }\n\n    /**\n     * check if an attribute can use an editor\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditor()\n    {\n        return $this->getTypeInstance()->getEditor();\n    }\n\n    /**\n     * check if attribute is required\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRequired()\n    {\n        if ($this->getIsName()) {\n            return true;\n        }\n        return $this->getTypeInstance()->getRequired();\n    }\n\n    /**\n     * check if attribute can behave as name\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsAllowedAsName()\n    {\n        return $this->getTypeInstance()->getIsAllowedAsName();\n    }\n\n    /**\n     * check if the attribute acts as name\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNotIsName()\n    {\n        return !$this->getIsName();\n    }\n\n    /**\n     * get attribute placeholders\n     *\n     * @access public\n     * @param null $key\n     * @return mixed|null|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPlaceholders($key = null)\n    {\n        if (is_null($this->_placeholders)) {\n            $placeholders['{{attributeLabel}}']             = $this->escapeText($this->getLabel());\n            $placeholders['{{AttributeMagicCode}}']         = $this->getMagicMethodCode();\n            $placeholders['{{attributeMagicCode}}']         = $this->getMagicMethodCode(false);\n            $placeholders['{{attributeCode}}']              = $this->getCode();\n            $placeholders['{{attributeColumnOptions}}']     = $this->getAdminColumnOptions();\n            $placeholders['{{attributeFormType}}']          = $this->getFormType();\n            $placeholders['{{attributeFormOptions}}']       = $this->getFormOptions();\n            $placeholders['{{attributePreElementText}}']    = $this->getPreElementText();\n            $placeholders['{{attributeRssText}}']           = $this->getRssText();\n            $placeholders['{{attributeNote}}']              = $this->getNote();\n            $placeholders['{{AttributeCodeForFile}}']       = $this->getCodeForFileName(true);\n            $placeholders['{{attributeCodeForFile}}']       = $this->getCodeForFileName(false);\n            $placeholders['{{attributeOptions}}']           = $this->getAttributeOptions();\n            $placeholders['{{massActionValues}}']           = $this->getMassActionValues();\n\n            $eventObject = new Varien_Object(\n                array(\n                    'placeholders' => $placeholders\n                )\n            );\n            Mage::dispatchEvent('umc_attribute_placeholdrers', array('event_object'=>$eventObject));\n            $placeholders = $eventObject->getPlaceholders();\n            $this->_placeholders = $placeholders;\n        }\n        if (is_null($key)) {\n            return $this->_placeholders;\n        }\n        if (isset($this->_placeholders[$key])) {\n            return $this->_placeholders[$key];\n        }\n        return '';\n    }\n\n    /**\n     * get additional admin grid column options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminColumnOptions()\n    {\n        $options = $this->getTypeInstance()->getAdminColumnOptions();\n        if ($this->getUseFilterIndex()) {\n            $options .= $this->getPadding(3).\n                \"'filter_index' => '\".$this->getEntity()->getEntityTableAlias().\n                \".\".$this->getCode().\"'\".$this->getEol();\n        }\n        return $options;\n    }\n\n    /**\n     * get options for attribute\n     *\n     * @access public\n     * @param bool $asArray\n     * @return array|mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getOptions($asArray = false)\n    {\n        if (!$asArray) {\n            return $this->getData('options');\n        }\n        return explode(self::OPTION_SEPARATOR, $this->getData('options'));\n    }\n\n    /**\n     * get form type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormType()\n    {\n        return $this->getTypeInstance()->getFormType();\n    }\n\n    /**\n     * get text for rss\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRssText()\n    {\n        return $this->getTypeInstance()->getRssText();\n    }\n\n    /**\n     * get the sql column\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDdlSqlColumn()\n    {\n        $eol = $this->getEol();\n        $padding = $this->getPadding(2);\n        $tab = $this->getPadding();\n        $ddl = '';\n        $ddl .= \"->addColumn(\".$eol;\n        $ddl .= $padding.\"'{$this->getCode()}',\".$eol;\n        $ddl .= $padding.\"Varien_Db_Ddl_Table::\".$this->getTypeDdl().\", \".$this->getSizeDdl().\",\".$eol;\n        $ddl .= $padding.\"array(\";\n        $newLine = false;\n        if ($this->getRequired()) {\n            $ddl .= $eol.$padding.$tab.\"'nullable'  => false,\";\n            $newLine  = true;\n        }\n        //TODO: move this inside the type class\n        if ($this->getType() == 'int') {\n            $ddl .= $eol.$padding.$tab.\"'unsigned'  => true,\";\n            $newLine = true;\n        }\n        if ($newLine) {\n            $ddl .= $eol. $padding;\n        }\n        $ddl .= \"),\".$eol;\n        $ddl .= $padding.\"'\".$this->escapeText($this->getLabel()).\"'\".$eol.$tab.\")\";\n        return $ddl;\n    }\n\n    /**\n     * get column ddl type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeDdl()\n    {\n        return $this->getTypeInstance()->getTypeDdl();\n    }\n\n    /**\n     * get column ddl size\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSizeDdl()\n    {\n        return $this->getTypeInstance()->getSizeDdl();\n    }\n\n    /**\n     * get the frontend html\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendHtml()\n    {\n        return $this->getTypeInstance()->getFrontendHtml();\n    }\n\n    /**\n     * get wsdl format for attribute\n     *\n     * @access public\n     * @param bool $wsi\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlFormat($wsi = false)\n    {\n        if ($wsi) {\n            return '<xsd:element name=\"'.$this->getCode().'\" type=\"xsd:string\" />';\n        }\n        return '<element name=\"'.$this->getCode().'\" type=\"xsd:string\" minOccurs=\"'.(int)$this->getRequired().'\" />';\n    }\n\n    /**\n     * get setup content for attribute\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupContent()\n    {\n        $content    = '';\n        $padding5   = $this->getPadding(5);\n        $padding6   = $this->getPadding(6);\n        $eol        = $this->getEol();\n        $coreHelper = Mage::helper('core');\n        $content .= $padding5.\"'\".$this->getCode().\"' => array(\".$eol;\n        $content .= $padding6.\"'group'          => 'General',\".$eol;\n        $content .= $padding6.\"'type'           => '\".$this->getSetupType().\"',\".$eol;\n        $content .= $padding6.\"'backend'        => '\".$this->getSetupBackend().\"',\".$eol;\n        $content .= $padding6.\"'frontend'       => '',\".$eol;\n        $content .= $padding6.\"'label'          => '\".$coreHelper->jsQuoteEscape($this->getLabel()).\"',\".$eol;\n        $content .= $padding6.\"'input'          => '\".$this->getSetupInput().\"',\".$eol;\n        $content .= $padding6.\"'source'         => '\".$this->getSetupSource().\"',\".$eol;\n        $content .= $padding6.\"'global'         => \".$this->getSetupIsGlobal().\",\".$eol;\n        $content .= $padding6.\"'required'       => '\".$this->getRequired().\"',\".$eol;\n        $content .= $padding6.\"'user_defined'   => \".$this->getIsUserDefined().\",\".$eol;\n        $content .= $padding6.\"'default'        => '\".$coreHelper->jsQuoteEscape($this->getDefaultValueProcessed()).\n            \"',\".$eol;\n        $content .= $padding6.\"'unique'         => false,\".$eol;\n        $content .= $padding6.\"'position'       => '\".(int)$this->getPosition().\"',\".$eol;\n        $content .= $padding6.\"'note'           => '\".$coreHelper->jsQuoteEscape($this->getNote()).\"',\".$eol;\n        $content .= $padding6.\"'visible'        => '\".(int)$this->getVisible().\"',\".$eol;\n        $content .= $padding6.\"'wysiwyg_enabled'=> '\".(int)$this->getEditor().\"',\".$eol;\n        $content .= $this->getAdditionalSetup();\n        $content .= $padding5 .'),'.$eol;\n\n        return $content;\n    }\n\n    /**\n     * get setup type\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupType()\n    {\n        if ($this->hasForcedSetupType()) {\n            return $this->getForcedSetupType();\n        }\n        return $this->getTypeInstance()->getSetupType();\n    }\n\n    /**\n     * get setup backend\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupBackend()\n    {\n        if ($this->getForcedSetupBackend()) {\n            return $this->getForcedSetupBackend();\n        }\n        return $this->getTypeInstance()->getSetupBackend();\n    }\n\n    /**\n     * get setup input\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupInput()\n    {\n        return $this->getTypeInstance()->getSetupInput();\n    }\n\n    /**\n     * get setup source\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupSource()\n    {\n        if ($this->getForcedSource()) {\n            return $this->getForcedSource();\n        }\n        return $this->getTypeInstance()->getSetupSource();\n    }\n\n    /**\n     * check id an attribute is global\n     *\n     * @access public\n     * @return int\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSetupIsGlobal()\n    {\n        switch ($this->getScope()) {\n            case Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE:\n                return 'Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE';\n                break;\n            case Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL:\n                return 'Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL';\n                break;\n            case Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE:\n                return 'Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE';\n                break;\n            default :\n                return '';\n                break;\n        }\n    }\n\n    /**\n     * get attribute code for file name\n     *\n     * @access public\n     * @param bool $uppercase\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCodeForFileName($uppercase = false)\n    {\n        $code = str_replace('_', '', $this->getCode());\n        if ($uppercase) {\n            $code = ucfirst($code);\n        }\n        return $code;\n    }\n\n    /**\n     * check if attribute is visible\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getVisible()\n    {\n        if (($this->hasForcedVisible())) {\n            return $this->getForcedVisible();\n        }\n        return $this->getTypeInstance()->getVisible();\n    }\n\n    /**\n     * check if source needs to be generated\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getGenerateSource()\n    {\n        return $this->getTypeInstance()->getGenerateSource();\n    }\n\n    /**\n     * get additional setup values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalSetup()\n    {\n        return $this->getTypeInstance()->getAdditionalSetup();\n    }\n\n    /**\n     * check if attribute is yes/no\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsYesNo()\n    {\n        return $this->getTypeInstance()->getIsYesNo();\n    }\n\n    /**\n     * get attribute options for source model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributeOptions()\n    {\n        return $this->getTypeInstance()->getAttributeOptions();\n    }\n\n    /**\n     * check if attribute is user defined\n     *\n     * @access public\n     * @param bool $asText\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsUserDefined($asText = true)\n    {\n        if (!$this->hasData('user_defined')) {\n            $this->setData('user_defined', true);\n        }\n        if (!$asText) {\n            return $this->getData('user_defined');\n        }\n        if ($this->getData('user_defined')) {\n            return 'true';\n        }\n        return 'false';\n    }\n\n    /**\n     * get admin from options\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFormOptions()\n    {\n        return $this->getTypeInstance()->getFormOptions();\n    }\n\n    /**\n     * check if attribute is multiple select\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsMultipleSelect()\n    {\n        return $this->getTypeInstance()->getIsMultipleSelect();\n    }\n\n    /**\n     * check if entity is eav\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityEav()\n    {\n        return $this->getEntity()->getIsEav();\n    }\n\n    /**\n     * check if entity is not eav\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNotEntityEav()\n    {\n        return !$this->getEntityEav();\n    }\n\n    /**\n     * check if attribute can be in mass update\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMassUpdate()\n    {\n        return $this->getTypeInstance()->getMassUpdate();\n    }\n\n    /**\n     * get values for mass action\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMassActionValues()\n    {\n        return $this->getTypeInstance()->getMassActionValues();\n    }\n\n    /**\n     * get module\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getModule()\n    {\n        return $this->getEntity()->getModule();\n    }\n\n    /**\n     * get namespace\n     *\n     * @access public\n     * @param bool $lower\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNamespace($lower = false)\n    {\n        return $this->getModule()->getNamespace($lower);\n    }\n\n    /**\n     * get attribute default value\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueProcessed()\n    {\n        return $this->getTypeInstance()->getDefaultValueProcessed();\n    }\n\n    /**\n     * get attribute default value setup content\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultValueSetup()\n    {\n        return $this->getTypeInstance()->getDefaultValueSetup();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Config.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Config extends Varien_Simplexml_Config\n{\n    /**\n     * cache key\n     */\n    const CACHE_ID = 'umc_config';\n\n    /**\n     * get DOM of the config\n     *\n     * @access public\n     * @return null|Varien_Simplexml_Element\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDom()\n    {\n        if (is_null($this->_xml)) {\n            $this->_xml = Mage::getConfig()->loadModulesConfiguration('umc.xml')\n                ->applyExtends();\n        }\n        return $this->_xml;\n    }\n\n    /**\n     * get default translation module\n     *\n     * @return string\n     * @access protected\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _getDefaultTranslateModule()\n    {\n        return 'Ultimate_ModuleCreator';\n    }\n\n    /**\n     * translate node\n     *\n     * @access protected\n     * @param Varien_Simplexml_Element $node\n     * @return Ultimate_ModuleCreator_Model_Config\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _translateNode(&$node)\n    {\n        if ($node->getAttribute('translate')) {\n            $fields = explode(' ', $node->getAttribute('translate'));\n            $module = ($node->getAttribute('module'))\n                ? (string)$node->getAttribute('module')\n                : $this->_getDefaultTranslateModule();\n            foreach ($fields as $field) {\n                if ($node->$field) {\n                    $node->$field = Mage::helper($module)->__((string)$node->$field);\n                }\n            }\n        }\n        if ($node->hasChildren()) {\n            foreach ($node->children() as $child) {\n                $this->_translateNode($child);\n            }\n        }\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Entity/Type/Abstract.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * abstract entity type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nabstract class Ultimate_ModuleCreator_Model_Entity_Type_Abstract extends Ultimate_ModuleCreator_Model_Abstract\n{\n    /**\n     * constant for eav type\n     */\n    const TYPE_EAV = 'eav';\n\n    /**\n     * constant for flat type\n     */\n    const TYPE_FLAT = 'flat';\n\n    /**\n     * current entity\n     *\n     * @var  Ultimate_ModuleCreator_Model_Entity\n     */\n    protected $_entity;\n\n    /**\n     * set the entity\n     *\n     * @access public\n     * @param Ultimate_ModuleCreator_Model_Entity $entity\n     * @return Ultimate_ModuleCreator_Model_Entity_Type_Abstract\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setEntity(Ultimate_ModuleCreator_Model_Entity $entity)\n    {\n        $this->_entity = $entity;\n        return $this;\n    }\n\n    /**\n     * get the entity object\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Entity|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntity()\n    {\n        return $this->_entity;\n    }\n\n    /**\n     * get the module object\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Module|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getModule()\n    {\n        return $this->getEntity()->getModule();\n    }\n\n    /**\n     * get the namespace\n     *\n     * @access public\n     * @param bool $lower\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNamespace($lower = false)\n    {\n        return $this->getModule()->getNamespace($lower);\n    }\n\n    /**\n     * get lower module name\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLowerModuleName()\n    {\n        return $this->getModule()->getLowerModuleName();\n    }\n\n    /**\n     * get collection attributes\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCollectionAttributes()\n    {\n        return '';\n    }\n\n    /**\n     * get admin join\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminJoin()\n    {\n        return '';\n    }\n\n    /**\n     * prepare columns text\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPrepareColumnsHeader()\n    {\n        return '';\n    }\n\n    /**\n     * get name attribute grid eav\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameAttributeGridEav()\n    {\n        return '';\n    }\n\n    /**\n     * check if entity has images\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasImage()\n    {\n        return $this->getEntity()->getData('has_image');\n    }\n\n    /**\n     * check if entity has files\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasFile()\n    {\n        return $this->getEntity()->getData('has_file');\n    }\n\n    /**\n     * check if submenu should exist\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasSubmenu()\n    {\n        return false;\n    }\n\n    /**\n     * get Additional submenu\n     *\n     * @access public\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalMenu($padding)\n    {\n        return '';\n    }\n\n    /**\n     * get Additional menu acl\n     *\n     * @access public\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalMenuAcl($padding)\n    {\n        return '';\n    }\n\n    /**\n     * check if comments are allowed by store\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAllowCommentByStore()\n    {\n        return $this->getEntity()->getAllowComment() && $this->getEntity()->getStore();\n    }\n\n    /**\n     * get attributes content for setup\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributesSetup()\n    {\n        return '';\n    }\n\n    /**\n     * get parent class for the entity resource model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceModelParent()\n    {\n        return 'Mage_Core_Model_Resource_Db_Abstract';\n    }\n\n    /**\n     * get parent class for the entity resource collection model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceCollectionModelParent()\n    {\n        return 'Mage_Core_Model_Resource_Db_Collection_Abstract';\n    }\n\n    /**\n     * get related entities relations table\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceRelationsTables()\n    {\n        return '';\n    }\n\n    /**\n     * get related entities relations table declaration\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceRelationsTablesDeclare()\n    {\n        return '';\n    }\n\n    /**\n     * get admin layout content for index page\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminIndexLayoutContent()\n    {\n        $entity     = $this->getEntity()->getNameSingular(true);\n        $module     = $this->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        return $this->getPadding(3).'<block type=\"'.\n            $namespace.'_'.$module.'/adminhtml_'.$entity.'\" name=\"'.$entity.'\" />'.$this->getEol();\n    }\n\n    /**\n     * get the parent model class\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityParentModel()\n    {\n        return 'Mage_Core_Model_Abstract';\n    }\n\n    /**\n     * get entity table alias\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityTableAlias()\n    {\n        return 'main_table';\n    }\n\n    /**\n     * get additional prepare collection\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalPrepareCollection()\n    {\n        return '';\n    }\n\n    /**\n     * additional layout block for left section\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditLayoutLeft()\n    {\n        return '';\n    }\n\n    /**\n     * additional layout block edit\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditLayoutAdditional()\n    {\n        return '';\n    }\n\n    /**\n     * get param name for before save\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getBeforeSaveParam()\n    {\n        return 'Mage_Core_Model_Abstract';\n    }\n\n    /**\n     * entity attribute set string\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityAttributeSetId()\n    {\n        return '';\n    }\n\n    /**\n     * filter method name\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFilterMethod()\n    {\n        return 'addFieldToFilter';\n    }\n\n    /**\n     * convert multiple select fields to strings\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMultipleSelectConvert()\n    {\n        $padding = $this->getPadding(2);\n        $tab     = $this->getPadding();\n        $eol     = $this->getEol();\n        $content = '';\n        foreach ($this->getEntity()->getAttributes() as $attribute) {\n            if ($attribute->getIsMultipleSelect()) {\n                $ucCode = $attribute->getMagicMethodCode();\n                $lcCode = $attribute->getCodeForFileName(false);\n                $content .= '$'.$attribute->getCodeForFileName(false).' = $object->get'.$ucCode.'();'.$eol;\n                $content .= $padding.'if (is_array($'.$lcCode.')) {'.$eol;\n                $content .= $padding.$tab.'$object->set'.$ucCode.\"(implode(',', $\".$lcCode.'));'.$eol;\n                $content .= $padding.'}'.$eol.$padding;\n            }\n        }\n        return $content;\n    }\n\n    /**\n     * check if the entity helper can be created\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCanCreateEntityHelper()\n    {\n        return false;\n    }\n\n    /**\n     * get additional code for toOptionArray()\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getToOptionAddition()\n    {\n        return '';\n    }\n\n    /**\n     * get comment name field filter index\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCommentFilterIndexPrefix()\n    {\n        return $this->getEntityTableAlias().'.';\n    }\n\n    /**\n     * get additional api xml\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiAdditional()\n    {\n        return '';\n    }\n\n    /**\n     * get additional api faults\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiFaults()\n    {\n        return '';\n    }\n\n    /**\n     * additional API sub-entities.\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiAdditionalSettings()\n    {\n        return '';\n    }\n\n    /**\n     * get sub-entities acl\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSubEntitiesAcl()\n    {\n        return '';\n    }\n\n    /**\n     * get api aliases\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiResourcesAlias()\n    {\n        return '';\n    }\n\n    /**\n     * get api V2 aliases\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiResourcesAliasV2()\n    {\n        return '';\n    }\n\n    /**\n     * get attributes format for wsdl\n     *\n     * @access public\n     * @param bool $wsi\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlAttributes($wsi = false)\n    {\n        return '';\n    }\n\n    /**\n     * get default api attributes\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultApiAttributes()\n    {\n        return '';\n    }\n\n    /**\n     * get add all attributes to collection\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAllAttributesToCollection()\n    {\n        return '';\n    }\n\n    /**\n     * get load store id statement\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLoadStoreId()\n    {\n        return '';\n    }\n\n    /**\n     * get rest collection cleanup\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestCollectionCleanup()\n    {\n        return $this->getEol().$this->getPadding(2).'$'.\n            $this->getEntity()->getNamePlural(true).\n            'Array = $'.$this->getEntity()->getNamePlural(true).'Array[\\'items\\'];'.$this->getEol();\n    }\n\n    /**\n     * get rest collection store id\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestCollectionStoreId()\n    {\n        return '';\n    }\n\n    /**\n     * get default attribute values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultAttributeValues()\n    {\n        $content = '';\n        foreach ($this->getEntity()->getAttributes() as $attribute) {\n            $defaultValue = $attribute->getDefaultValueProcessed();\n            if (!empty($defaultValue)) {\n                $content .= $this->getPadding(2).\n                    '$values[\\''.$attribute->getCode().'\\'] = \\''.$defaultValue.'\\';'.$this->getEol();\n            }\n        }\n        if ($content) {\n            $content .= $this->getEol();\n        }\n        return $content;\n    }\n\n    /**\n     * get additional to option array select\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getToOptionArraySelect()\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Entity/Type/Eav.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Entity_Type_Eav extends Ultimate_ModuleCreator_Model_Entity_Type_Abstract\n{\n    /**\n     * parent entities FK\n     *\n     * @var null\n     */\n    protected $_parentAttributes = null;\n\n    /**\n     * get collection attributes\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCollectionAttributes()\n    {\n        $result = '';\n        $eol = $this->getEol();\n        $padding = $this->getPadding(3);\n        foreach ($this->_getParentAttributes() as $attribute) {\n            $result .= $eol;\n            $result .= $padding;\n            $result .= '->addAttributeToSelect(\\''.$attribute->getCode().'\\')';\n        }\n        foreach ($this->getEntity()->getAttributes() as $attribute) {\n            if ($attribute->getAdminGrid() && $attribute->getCode() != $this->getEntity()->getNameAttributeCode()) {\n                $result .= $eol;\n                $result .= $padding;\n                $result .= '->addAttributeToSelect(\\''.$attribute->getCode().'\\')';\n            }\n        }\n        foreach ($this->getEntity()->getSimulatedAttributes('status') as $attribute) {\n            $result .= $eol;\n            $result .= $padding;\n            $result .= '->addAttributeToSelect(\\''.$attribute->getCode().'\\')';\n        }\n        if ($this->getEntity()->getUrlRewrite()) {\n            foreach ($this->getEntity()->getSimulatedAttributes('url_rewrite') as $attribute) {\n                $result .= $eol;\n                $result .= $padding;\n                $result .= '->addAttributeToSelect(\\''.$attribute->getCode().'\\')';\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * get admin join\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminJoin()\n    {\n        $eol     = $this->getEol();\n        $result  = $eol;\n        $result .= $this->getPadding(2).'$adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;'.$eol;\n        $result .= $this->getPadding(2).'$store = $this->_getStore();'.$eol;\n        $result .= $this->getPadding(2).'$collection->joinAttribute('.$eol.$this->getPadding(3).'\\''.\n            $this->getEntity()->getNameAttributeCode().'\\', '.$eol.$this->getPadding(3).'\\''.\n            strtolower($this->getEntity()->getModule()->getNamespace()).'_'.\n            $this->getEntity()->getModule()->getLowerModuleName().'_'.\n            $this->getEntity()->getNameSingular().'/'.\n            $this->getEntity()->getNameAttributeCode().'\\', '.\n            $eol.$this->getPadding(3).'\\'entity_id\\', '\n            .$eol.$this->getPadding(3).'null, '.\n            $eol.$this->getPadding(3).'\\'inner\\', '.\n            $eol.$this->getPadding(3).'$adminStore'\n            .$eol.$this->getPadding(2).');'.$eol;\n        $result .= $this->getPadding(2).'if ($store->getId()) {'.$eol;\n        $result .= $this->getPadding(3).    '$collection->joinAttribute('.\n            $eol.$this->getPadding(4).'\\''.$this->getModule()->getNamespace(true).'_'.\n            $this->getModule()->getLowerModuleName().'_'.\n            $this->getEntity()->getNameSingular().'_'.\n            $this->getEntity()->getNameAttributeCode().'\\', '.\n            $eol.$this->getPadding(4).'\\''.$this->getModule()->getNamespace(true).\n            '_'.$this->getModule()->getLowerModuleName().\n            '_'.$this->getEntity()->getNameSingular().\n            '/'.$this->getEntity()->getNameAttributeCode().'\\', '.\n            $eol.$this->getPadding(4).'\\'entity_id\\', '.\n            $eol.$this->getPadding(4).'null, '.\n            $eol.$this->getPadding(4).'\\'inner\\', '.\n            $eol.$this->getPadding(4).'$store->getId()'.\n            $eol.$this->getPadding(3).');'.$eol;\n        $result .= $this->getPadding(2).'}'.$eol;\n        return $result;\n    }\n\n    /**\n     * prepare columns header\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPrepareColumnsHeader()\n    {\n        return '$store = $this->_getStore();'.$this->getEol().$this->getPadding(2);\n    }\n\n    /**\n     * get name attribute for grid\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameAttributeGridEav()\n    {\n        $eol     = $this->getEol();\n        $result  = $eol;\n        $result .= $this->getPadding(2).'if ($this->_getStore()->getId()) {'.$eol;\n        $result .= $this->getPadding(3).    '$this->addColumn('.\n            $eol.$this->getPadding(4).'\\''.$this->getNamespace(true).'_'.\n            $this->getLowerModuleName().'_'.$this->getEntity()->getNameSingular().'_'.\n            $this->getEntity()->getNameAttributeCode().'\\', '.\n            $eol.$this->getPadding(4).'array('.$eol;\n        $result .= $this->getPadding(5). '\\'header\\'    => Mage::helper(\\''.\n            $this->getNamespace(true).'_'.$this->getLowerModuleName().'\\')->__(\\''.\n            $this->getEntity()->getNameAttributeLabel().' in %s\\', $this->_getStore()->getName()),'.$eol;\n        $result .= $this->getPadding(5).'\\'align\\'     => \\'left\\','.$eol;\n        $result .= $this->getPadding(5).'\\'index\\'     => \\''.\n            $this->getNamespace(true).'_'.$this->getLowerModuleName().'_'.\n            $this->getEntity()->getNameSingular().'_'.$this->getEntity()->getNameAttributeCode().'\\','.$eol;\n        $result .= $this->getPadding(4).')'.\n            $eol.$this->getPadding(3).');'.$eol;\n        $result .= $this->getPadding(2).'}'.$eol;\n        return $result;\n    }\n\n    /**\n     * eav always has image\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasImage()\n    {\n        return true;\n    }\n\n    /**\n     * eav always has files\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasFile()\n    {\n        return true;\n    }\n\n    /**\n     * eav always has submenu\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasSubmenu()\n    {\n        return true;\n    }\n\n    /**\n     * get additional menu\n     *\n     * @access public\n     * @param $padding\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalMenu($padding)\n    {\n        $extension   = $this->getModule()->getExtensionName(true);\n        $module      = $this->getLowerModuleName();\n        $entity      = $this->getEntity()->getNameSingular(true);\n        $entityTitle = $this->getEntity()->getLabelSingular();\n        $action      = $module.'_'.$entity;\n        $eol         = $this->getEol();\n\n        $text  = $this->getPadding($padding).'<'.$entity.'_attributes translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $text .= $this->getPadding($padding + 1).'<title>Manage '.$entityTitle.' Attributes</title>'.$eol;\n        $text .= $this->getPadding($padding + 1).'<action>adminhtml/'.$action.'_attribute</action>'.$eol;\n        $text .= $this->getPadding($padding + 1).\n            '<sort_order>'.($this->getEntity()->getPosition() + 7).'</sort_order>'.$eol;\n        $text .= $this->getPadding($padding).'</'.$entity.'_attributes>'.$eol;\n        return $text;\n    }\n\n    /**\n     * get additional menu acl\n     *\n     * @access public\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalMenuAcl($padding)\n    {\n        $extension   = $this->getModule()->getExtensionName(true);\n        $entity      = $this->getEntity()->getNameSingular(true);\n        $entityTitle = $this->getEntity()->getLabelSingular();\n        $eol         = $this->getEol();\n\n        $text  = $this->getPadding($padding).'<'.$entity.'_attributes translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $text .= $this->getPadding($padding + 1).'<title>Manage '.$entityTitle.' attributes</title>'.$eol;\n        $text .= $this->getPadding($padding + 1).'<sort_order>'.\n            ($this->getEntity()->getPosition() + 7).'</sort_order>'.$eol;\n        $text .= $this->getPadding($padding).'</'.$entity.'_attributes>'.$eol;\n        return $text;\n    }\n\n    /**\n     * allow comments by store\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAllowCommentByStore()\n    {\n        return $this->getEntity()->getAllowComment();\n    }\n\n    /**\n     * get parent attributes\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Model_Attribute[]\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _getParentAttributes()\n    {\n        if (is_null($this->_parentAttributes)) {\n            $parents = $this->getEntity()->getRelatedEntities(\n                Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD\n            );\n            $this->_parentAttributes = array();\n            foreach ($parents as $parent) {\n                $module = $parent->getModule()->getLowerModuleName();\n                $namespace = $parent->getModule()->getNamespace(true);\n                $name   = $parent->getNameSingular();\n                /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                $attr   = Mage::getModel('modulecreator/attribute');\n                $attr->setCode($name.'_id');\n                $attr->setLabel($parent->getLabelSingular());\n                $attr->setType('dropdown');\n                $attr->setOptionsSource('custom');\n                $attr->setForcedSource($namespace.'_'.$module.'/'.$name.'_source');\n                $attr->setScope(Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL);\n                $attr->setEntity($this->getEntity());\n                $attr->setUseFilterIndex(true);\n                $this->_parentAttributes[] = $attr;\n            }\n        }\n        return $this->_parentAttributes;\n    }\n\n    /**\n     * get attributes content for setup\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributesSetup()\n    {\n        $content = '';\n        $position = 0;\n        //all parent attributes\n        /** @var Ultimate_ModuleCreator_Model_Attribute $attribute */\n        foreach ($this->_getParentAttributes() as $attribute) {\n            $content .= $attribute->getSetupContent();\n        }\n        foreach ($this->getEntity()->getAttributes() as $attribute) {\n            $content .= $attribute->getSetupContent();\n            $position = $attribute->getPosition();\n        }\n        $position += 10;\n        foreach ($this->getEntity()->getSimulatedAttributes(null, false, array('tree')) as $attribute) {\n            $attribute->setPosition($position);\n            $content .= $attribute->getSetupContent();\n            $position += 10;\n        }\n        foreach ($this->getEntity()->getSimulatedAttributes('tree', false) as $attribute) {\n            $attribute->setForcedSetupType('static');\n            $attribute->setForcedVisible(0);\n            $content .= $attribute->getSetupContent();\n            $position += 10;\n        }\n        return $content;\n    }\n\n    /**\n     * get parent class for the entity resource model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceModelParent()\n    {\n        return 'Mage_Catalog_Model_Resource_Abstract';\n    }\n\n    /**\n     * get parent class for the entity resource collection model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceCollectionModelParent()\n    {\n        return 'Mage_Catalog_Model_Resource_Collection_Abstract';\n    }\n\n    /**\n     * get related entities relations table\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceRelationsTables()\n    {\n        $padding    = $this->getPadding(2);\n        $content    = '';\n        $eol        = $this->getEol();\n        $entity     = $this->getEntity()->getNameSingular(true);\n        $module     = $this->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        if ($this->getEntity()->getLinkProduct()) {\n            $content .= $padding.'$'.'this->_'.\n                $entity.'ProductTable = $'.\"this->getTable('\".\n                $namespace.'_'.$module.\"/\".$entity.\"_product');\".$eol;\n        }\n        if ($this->getEntity()->getLinkCategory()) {\n            $content .= $padding.'$'.'this->_'.\n                $entity.'CategoryTable = $'.\"this->getTable('\".\n                $namespace.'_'.$module.\"/\".$entity.\"_category');\".$eol;\n        }\n        $related = $this->getEntity()->getRelatedEntities(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING);\n        foreach ($related as $_entity) {\n            $_entityUc      = ucfirst($_entity->getNameSingular());\n            $_entityLower   = $_entity->getNameSingular(true);\n            $content .= $padding.'$'.'this->_'.\n                $entity.$_entityUc.'Table = $'.\"this->getTable('\".\n                $namespace.'_'.$module.\"/\".$entity.\"_\".$_entityLower.\"');\".$eol;\n        }\n        return $content;\n    }\n\n    /**\n     * get related entities relations table declaration\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceRelationsTablesDeclare()\n    {\n        $padding = $this->getPadding();\n        $content = '';\n        $eol     = $this->getEol();\n        $entity  = $this->getEntity()->getNameSingular(true);\n        if ($this->getEntity()->getLinkProduct()) {\n            $content .= $padding.'protected $'.'_'.$entity.'ProductTable = null;'.$eol;\n        }\n        if ($this->getEntity()->getLinkCategory()) {\n            $content .= $padding.'protected $'.'_'.$entity.'CategoryTable = null;'.$eol;\n        }\n        $related = $this->getEntity()->getRelatedEntities(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING);\n        foreach ($related as $_entity) {\n            $_entityUc      = ucfirst($_entity->getNameSingular());\n            $content       .= $padding.'protected $'.'_'.$entity.$_entityUc.'Table = null;'.$eol;\n        }\n        return $content;\n    }\n\n    /**\n     * get admin layout content for index page\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminIndexLayoutContent()\n    {\n        $entity     = $this->getEntity()->getNameSingular(true);\n        $module     = $this->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        $eol        = $this->getEol();\n        $content    = $this->getPadding(3).\n            '<block type=\"'.$namespace.'_'.$module.\n            '/adminhtml_'.$entity.'\" name=\"'.$entity.'\">'.$eol;\n        $content   .= $this->getPadding(4).\n            '<block type=\"adminhtml/store_switcher\" name=\"store_switcher\" as=\"store_switcher\">'.$eol;\n        $content   .= $this->getPadding(5).'<action method=\"setUseConfirm\"><params>0</params></action>'.$eol;\n        $content   .= $this->getPadding(4).'</block>'.$eol;\n        $content   .= $this->getPadding(3).'</block>'.$eol;\n        return $content;\n    }\n\n    /**\n     * get the parent model class\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityParentModel()\n    {\n        return 'Mage_Catalog_Model_Abstract';\n    }\n\n    /**\n     * get entity table alias\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityTableAlias()\n    {\n        return 'e';\n    }\n\n    /**\n     * get additional prepare collection\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalPrepareCollection()\n    {\n        return \"->addAttributeToSelect('\".$this->getEntity()->getNameAttributeCode().\"')\";\n    }\n\n    /**\n     * additional layout block for left section\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditLayoutLeft()\n    {\n        return '<block type=\"adminhtml/store_switcher\" name=\"store_switcher\" before=\"-\"></block>'.\n            $this->getEol().$this->getPadding(3);\n    }\n\n    /**\n     * additional layout block edit\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditLayoutAdditional()\n    {\n        $content  = '';\n        $eol      = $this->getEol();\n        $content .= $eol.$this->getPadding(2).'<reference name=\"head\">'.$eol;\n        $content .= $this->getPadding(3).'<action method=\"setCanLoadTinyMce\"><load>1</load></action>'.$eol;\n        $content .= $this->getPadding(2).'</reference>'.$eol;\n        $content .= $this->getPadding(2).'<reference name=\"js\">'.$eol;\n        $content .= $this->getPadding(3).\n            '<block type=\"core/template\" name=\"catalog.wysiwyg.js\" template=\"catalog/wysiwyg/js.phtml\"/>'.\n            $eol;\n        $content .= $this->getPadding(2).'</reference>';\n        return $content;\n    }\n\n    /**\n     * get param name for before save\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getBeforeSaveParam()\n    {\n        return 'Varien_Object';\n    }\n\n    /**\n     * entity attribute set string\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityAttributeSetId()\n    {\n        $namespace  = $this->getNamespace(true);\n        $module     = $this->getLowerModuleName();\n        $entity     = $this->getEntity()->getNameSingular(true);\n        return $this->getEol().$this->getPadding().\n            \"->setAttributeSetId(Mage::getModel('\".$namespace.'_'.$module.'/'.$entity.\n            \"')->getDefaultAttributeSetId())\";\n    }\n\n    /**\n     * filter method name\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFilterMethod()\n    {\n        return 'addAttributeToFilter';\n    }\n\n    /**\n     * convert multiple select fields to strings\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMultipleSelectConvert()\n    {\n        return $this->getEol();\n    }\n\n    /**\n     * check if the entity helper can be created\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCanCreateEntityHelper()\n    {\n        return true;\n    }\n\n    /**\n     * get additional code for toOptionArray()\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getToOptionAddition()\n    {\n        $attribute = $this->getEntity()->getNameAttributeCode();\n        return '$this->addAttributeToSelect(\\''.$attribute.'\\');'.$this->getEol().$this->getPadding(2);\n    }\n\n    /**\n     * get comment name field filter index\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCommentFilterIndexPrefix()\n    {\n        return '';\n    }\n\n    /**\n     * get additional api xml\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiAdditional()\n    {\n        $eol      = $this->getEol();\n        $padding  = $this->getPadding(5);\n        $tab      = $this->getPadding();\n        $content  = '';\n        $content .= $padding.'<currentStore>'.$eol;\n        $content .= $padding.$tab.'<title>Set/Get current store view</title>'.$eol;\n        $content .= $padding.'</currentStore>'.$eol;\n        $content .= $padding.'<listOfAdditionalAttributes translate=\"title\" module=\"'.\n            $this->getNamespace(true).'_'.$this->getLowerModuleName().'\">'.$eol;\n        $content .= $padding.$tab.'<title>Get list of non-default attributes</title>'.$eol;\n        $content .= $padding.$tab.'<method>getAdditionalAttributes</method>'.$eol;\n        $content .= $padding.'</listOfAdditionalAttributes>'.$eol;\n        return $content;\n    }\n\n    /**\n     * get additional api faults\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiFaults()\n    {\n        $eol      = $this->getEol();\n        $padding  = $this->getPadding(5);\n        $tab      = $this->getPadding();\n        $content  = '';\n        $content .= $padding.'<store_not_exists>'.$eol;\n        $content .= $padding.$tab.'<code>100</code>'.$eol;\n        $content .= $padding.$tab.'<message>Requested store view not found.</message>'.$eol;\n        $content .= $padding.'</store_not_exists>'.$eol;\n        return $content;\n    }\n\n    /**\n     * additional API subentities.\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiAdditionalSettings()\n    {\n        $content = '';\n        $padding  = $this->getPadding(3);\n        $tab      = $this->getPadding();\n        $module   = $this->getLowerModuleName();\n        $entity   = $this->getEntity()->getNameSingular(true);\n        $eol      = $this->getEol();\n        $content .= $eol;\n        $extension = $this->getModule()->getExtensionName(true);\n        $content .= $padding.'<'.$module.'_'.$entity.'_attribute translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.'<title>Product attributes API</title>'.$eol;\n        $content .= $padding.$tab.'<model>'.$extension.'/'.$entity.'_attribute_api</model>'.$eol;\n        $content .= $padding.$tab.'<acl>'.$module.'/'.$entity.'</acl>'.$eol;\n        $content .= $padding.$tab.'<methods>'.$eol;\n        $content .= $padding.$tab.$tab.'<currentStore translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Set/Get current store view</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/write</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</currentStore>'.$eol;\n        $content .= $padding.$tab.$tab.'<list translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Retrieve attribute list</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<method>items</method>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/read</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</list>'.$eol;\n        $content .= $padding.$tab.$tab.'<options translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Retrieve attribute options</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/read</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</options>'.$eol;\n        $content .= $padding.$tab.$tab.'<types translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Get list of possible attribute types</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/types</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</types>'.$eol;\n        $content .= $padding.$tab.$tab.'<create translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Create new attribute</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/create</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</create>'.$eol;\n        $content .= $padding.$tab.$tab.'<update translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Update attribute</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/update</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</update>'.$eol;\n        $content .= $padding.$tab.$tab.'<remove translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Delete attribute</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/remove</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</remove>'.$eol;\n        $content .= $padding.$tab.$tab.'<info translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.\n            '<title>Get full information about attribute with list of options</title>'.\n            $eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/info</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</info>'.$eol;\n        $content .= $padding.$tab.$tab.'<addOption translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Add option</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/option/add</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</addOption>'.$eol;\n        $content .= $padding.$tab.$tab.'<removeOption translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<title>Remove option</title>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_attribute/option/remove</acl>'.$eol;\n        $content .= $padding.$tab.$tab.'</removeOption>'.$eol;\n        $content .= $padding.$tab.'</methods>'.$eol;\n        $content .= $padding.$tab.'<faults module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<store_not_exists>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>100</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>Requested store view not found.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</store_not_exists>'.$eol;\n        $content .= $padding.$tab.$tab.'<not_exists>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>101</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>Requested attribute not found.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</not_exists>'.$eol;\n        $content .= $padding.$tab.$tab.'<invalid_parameters>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>102</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>Invalid request parameters.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</invalid_parameters>'.$eol;\n        $content .= $padding.$tab.$tab.'<invalid_code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>103</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.\n            '<message>Attribute code is invalid. Please use only letters (a-z), '.\n            'numbers (0-9) or underscore(_) in this field, first character should be a letter.</message>'.\n            $eol;\n        $content .= $padding.$tab.$tab.'</invalid_code>'.$eol;\n        $content .= $padding.$tab.$tab.'<invalid_frontend_input>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>104</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>Incorrect attribute type.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</invalid_frontend_input>'.$eol;\n        $content .= $padding.$tab.$tab.'<unable_to_save>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>105</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>Unable to save attribute.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</unable_to_save>'.$eol;\n        $content .= $padding.$tab.$tab.'<can_not_delete>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>106</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>This attribute cannot be deleted.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</can_not_delete>'.$eol;\n        $content .= $padding.$tab.$tab.'<can_not_edit>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>107</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>This attribute cannot be edited.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</can_not_edit>'.$eol;\n        $content .= $padding.$tab.$tab.'<unable_to_add_option>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>108</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>Unable to add option.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</unable_to_add_option>'.$eol;\n        $content .= $padding.$tab.$tab.'<unable_to_remove_option>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<code>109</code>'.$eol;\n        $content .= $padding.$tab.$tab.$tab.'<message>Unable to remove option.</message>'.$eol;\n        $content .= $padding.$tab.$tab.'</unable_to_remove_option>'.$eol;\n        $content .= $padding.$tab.'</faults>'.$eol;\n        $content .= $padding.'</'.$module.'_'.$entity.'_attribute>'.$eol;\n        return $content;\n    }\n\n    /**\n     * get subentities acl\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSubEntitiesAcl()\n    {\n        $content = '';\n        $padding  = $this->getPadding(5);\n        $tab      = $this->getPadding();\n        $entity   = $this->getEntity()->getNameSingular(true);\n        $eol      = $this->getEol();\n        $title    = $this->getEntity()->getLabelSingular().' Attributes';\n        $extension = $this->getModule()->getExtensionName(true);\n        $content .= $eol;\n\n        $content .= $padding.'<'.$entity.'_attribute translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.'<title>'.$title.'</title>'.$eol;\n        $content .= $padding.$tab.'<sort_order>'.($this->getEntity()->getPosition() + 6).'</sort_order>'.$eol;\n        $content .= $padding.$tab.'<currentStore translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Set/Get current store view</title>'.$eol;\n        $content .= $padding.$tab.'</currentStore>'.$eol;\n        $content .= $padding.$tab.'<list translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Retrieve attribute list</title>'.$eol;\n        $content .= $padding.$tab.'</list>'.$eol;\n        $content .= $padding.$tab.'<options translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Retrieve attribute options</title>'.$eol;\n        $content .= $padding.$tab.'</options>'.$eol;\n        $content .= $padding.$tab.'<types translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Get list of possible attribute types</title>'.$eol;\n        $content .= $padding.$tab.'</types>'.$eol;\n        $content .= $padding.$tab.'<create translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Create new attribute</title>'.$eol;\n        $content .= $padding.$tab.'</create>'.$eol;\n        $content .= $padding.$tab.'<update translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Update attribute</title>'.$eol;\n        $content .= $padding.$tab.'</update>'.$eol;\n        $content .= $padding.$tab.'<remove translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Remove attribute</title>'.$eol;\n        $content .= $padding.$tab.'</remove>'.$eol;\n        $content .= $padding.$tab.'<info translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Get full information about attribute with list of options</title>'.$eol;\n        $content .= $padding.$tab.'</info>'.$eol;\n        $content .= $padding.$tab.'<addOption translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Add option</title>'.$eol;\n        $content .= $padding.$tab.'</addOption>'.$eol;\n        $content .= $padding.$tab.'<removeOption translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $content .= $padding.$tab.$tab.'<title>Remove option</title>'.$eol;\n        $content .= $padding.$tab.'</removeOption>'.$eol;\n        $content .= $padding.'</'.$entity.'_attribute>'.$eol;\n        return $content;\n    }\n\n    /**\n     * get api aliases\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiResourcesAlias()\n    {\n        $content = '';\n        $padding  = $this->getPadding(3);\n        $module   = $this->getLowerModuleName();\n        $entity   = $this->getEntity()->getNameSingular(true);\n        $eol      = $this->getEol();\n        $content .= $eol;\n        $content .= $padding.'<'.$entity.'_attribute>'.$module.'_'.$entity.'_attribute</'.$entity.'_attribute>';\n        return $content;\n    }\n\n    /**\n     * get api V2 aliases\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiResourcesAliasV2()\n    {\n        $content = '';\n        $padding  = $this->getPadding(4);\n        $module   = $this->getLowerModuleName();\n        $entity   = $this->getEntity()->getNameSingular(true);\n        $eol      = $this->getEol();\n        $content .= $eol;\n        $content .= $padding.'<'.$entity.'_attribute>'.$module.ucfirst($entity).'Attribute</'.$entity.'_attribute>';\n        return $content;\n    }\n\n    /**\n     * get attributes format for wsdl\n     *\n     * @access public\n     * @param bool $wsi\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlAttributes($wsi = false)\n    {\n        $tab        = $this->getPadding();\n        $padding    = str_repeat($tab, 5);\n        $eol        = $this->getEol();\n        $content    = '';\n        $module     = $this->getLowerModuleName();\n        $entity     = ucfirst($this->getEntity()->getNameSingular(true));\n        if (!$wsi) {\n            $content   .= $padding.\n                '<element name=\"additional_attributes\" type=\"typens:'.$module.$entity.\n                'AdditionalAttributesEntity\" minOccurs=\"0\"/>'.$eol;\n        } else {\n            $content   .= $padding.\n                '<xsd:element name=\"additional_attributes\" type=\"typens:associativeArray\" minOccurs=\"0\" />'.\n                $eol;\n        }\n        return $content;\n    }\n\n    /**\n     * get default api attributes\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultApiAttributes()\n    {\n        $padding  = $this->getPadding();\n        $tab      = $padding;\n        $eol      = $this->getEol();\n        $entity   = $this->getEntity();\n        $content  = $padding.'protected $_defaultAttributeList = array('.$eol;\n        $parents  = $entity->getRelatedEntities(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD);\n        foreach ($parents as $parent) {\n            $content .= $padding.$tab.\"'\".$parent->getNameSingular(true).'_id'.\"', \".$eol;\n        }\n        foreach ($entity->getAttributes() as $attribute) {\n            $content .= $padding.$tab.\"'\".$attribute->getCode().\"'\".', '.$eol;\n        }\n        $simulated = $entity->getSimulatedAttributes(null, false);\n        foreach ($simulated as $attr) {\n            $content .= $padding.$tab.\"'\".$attr->getCode().\"'\".', '.$eol;\n        }\n        $content .= $padding.$tab.\"'created_at', \".$eol;\n        $content .= $padding.$tab.\"'updated_at', \".$eol;\n        $content .= $padding.');'.$eol;\n        return $content;\n    }\n\n    /**\n     * get add all attributes to collection\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAllAttributesToCollection()\n    {\n        return '->addAttributeToSelect(\\'*\\')';\n    }\n\n    /**\n     * get load store id statement\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLoadStoreId()\n    {\n        return '->setStoreId(Mage::app()->getStore()->getId())';\n    }\n\n    /**\n     * get rest collection cleanup\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestCollectionCleanup()\n    {\n        return '';\n    }\n\n    /**\n     * get rest collection store id\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestCollectionStoreId()\n    {\n        return $this->getEol().$this->getPadding(2).'$collection->setStoreId($this->_getStore()->getId());';\n    }\n\n    /**\n     * get default attribute values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultAttributeValues()\n    {\n        return '';\n    }\n\n    /**\n     * get additional to option array select\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getToOptionArraySelect()\n    {\n        return '->addAttributeToSelect(\\''.$this->getEntity()->getNameAttributeCode().'\\')';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Entity/Type/Flat.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * flat entity type\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Entity_Type_Flat extends Ultimate_ModuleCreator_Model_Entity_Type_Abstract\n{\n\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Entity.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * entity model\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method Ultimate_ModuleCreator_Model_Entity setIndex()\n * @method Ultimate_ModuleCreator_Model_Entity setEditor()\n * @method Ultimate_ModuleCreator_Model_Entity setHasImage()\n * @method Ultimate_ModuleCreator_Model_Entity setHasFile()\n * @method Ultimate_ModuleCreator_Model_Entity setHasCountry()\n * @method Ultimate_ModuleCreator_Model_Entity setHasMultipleSelect()\n * @method bool getCreateFrontend()\n * @method bool getLinkProduct()\n * @method bool getLinkCategory()\n * @method bool getIsTree()\n * @method string getType()\n * @method string getLabelSingular()\n * @method string getLabelPlural()\n * @method string getProductAttributeCode()\n * @method string getCategoryAttributeCode()\n * @method int getPosition()\n * @method string getUrlRewriteList()\n * @method bool getAllowComment()\n * @method bool getStore()\n * @method bool getShowCategory()\n * @method int getProductAttributeScope()\n * @method int getCategoryAttributeScope()\n * @method bool getProductAttribute();\n * @method bool getCategoryAttribute()\n * @method string getProductAttributeGroup()\n * @method string getCategoryAttributeGroup()\n * @method int getListMenu()\n * @method bool getRest()\n * @method Ultimate_ModuleCreator_Model_Entity setPosition()\n * @method Ultimate_ModuleCreator_Model_Entity setRss()\n * @method bool getEditor()\n * @method bool getApi()\n * @method bool getHasCountry()\n * @method bool getSearch()\n * @method int getIndex()\n */\nclass Ultimate_ModuleCreator_Model_Entity extends Ultimate_ModuleCreator_Model_Abstract\n{\n    /**\n     * reference to type instance\n     *\n     * @var null|Ultimate_ModuleCreator_Model_Entity_Type_Abstract\n     */\n    protected $_typeInstance           = null;\n\n    /**\n     * entity code\n     *\n     * @var string\n     */\n    protected $_entityCode             = 'umc_entity';\n\n    /**\n     * entity attributes\n     *\n     * @var array\n     */\n    protected $_attributes             = array();\n\n    /**\n     * entity module\n     *\n     * @var Ultimate_ModuleCreator_Model_Module\n     */\n    protected $_module                 = null;\n\n    /**\n     * attribute that behaves as name\n     *\n     * @var Ultimate_ModuleCreator_Model_Attribute\n     */\n    protected $_nameAttribute           = null;\n\n    /**\n     * remember if attributes were prepared\n     *\n     * @var bool\n     */\n    protected $_preparedAttributes      = null;\n\n    /**\n     * related entities\n     *\n     * @var array()\n     */\n    protected $_relatedEntities         = array();\n\n    /**\n     * placeholders for replacing in source files\n     *\n     * @var mixed\n     */\n    protected $_placeholders            = null;\n\n    /**\n     * placeholders for sibling entities\n     *\n     * @var mixed\n     */\n    protected $_placeholdersAsSibling   = null;\n\n    /**\n     * set the entity module\n     *\n     * @access public\n     * @param Ultimate_ModuleCreator_Model_Module $module\n     * @return Ultimate_ModuleCreator_Model_Entity\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setModule(Ultimate_ModuleCreator_Model_Module $module)\n    {\n        $this->_module = $module;\n        return $this;\n    }\n\n    /**\n     * get the entity module\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getModule()\n    {\n        return $this->_module;\n    }\n\n    /**\n     * add new attribute\n     *\n     * @access public\n     * @param Ultimate_ModuleCreator_Model_Attribute $attribute\n     * @return Ultimate_ModuleCreator_Model_Entity\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function addAttribute(Ultimate_ModuleCreator_Model_Attribute $attribute)\n    {\n        Mage::dispatchEvent(\n            'umc_entity_add_attribute_before',\n            array('attribute'=>$attribute, 'entity'=>$this)\n        );\n        $attribute->setEntity($this);\n        if (isset($this->_attributes[$attribute->getCode()])) {\n            throw new Ultimate_ModuleCreator_Exception(\n                Mage::helper('modulecreator')->__(\n                    'An attribute with the code \"%s\" already exists for entity \"%s\"',\n                    $attribute->getCode(),\n                    $this->getNameSingular()\n                )\n            );\n        }\n        $this->_preparedAttributes = false;\n        $this->_attributes[$attribute->getCode()] = $attribute;\n        if ($attribute->getIsName()) {\n            if (!$attribute->getIsAllowedAsName()) {\n                /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n                $helper = Mage::helper('modulecreator');\n                $attributeTypes = $helper->getNameAttributeTypes(true);\n                throw new Ultimate_ModuleCreator_Exception(\n                    Mage::helper('modulecreator')->__(\n                        'An attribute that acts as name must have one of the types \"%s\".',\n                        implode(', ', $attributeTypes)\n                    )\n                );\n            }\n            $attribute->setUserDefined(false);\n            $this->_nameAttribute = $attribute;\n        }\n        if ($attribute->getEditor()) {\n            $this->setEditor(true);\n        }\n        if ($attribute->getType() == 'image') {\n            $this->setHasImage(true);\n        }\n        if ($attribute->getType() == 'file') {\n            $this->setHasFile(true);\n        }\n        if ($attribute->getType() == 'country') {\n            $this->setHasCountry(true);\n        }\n        if ($attribute->getIsMultipleSelect()) {\n            $this->setHasMultipleSelect(true);\n        }\n        Mage::dispatchEvent(\n            'umc_entity_add_attribute_after',\n            array('attribute'=>$attribute, 'entity'=>$this)\n        );\n        return $this;\n    }\n\n    /**\n     * prepare attributes\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Model_Entity\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareAttributes()\n    {\n        if ($this->_preparedAttributes) {\n            return $this;\n        }\n        $attributesByPosition = array();\n        foreach ($this->_attributes as $attribute) {\n            /** @var Ultimate_ModuleCreator_Model_Attribute $attribute */\n            $attributesByPosition[$attribute->getPosition()][] = $attribute;\n        }\n        ksort($attributesByPosition);\n        $attributes = array();\n        foreach ($attributesByPosition as $attributeList) {\n            foreach ($attributeList as $attribute) {\n                $attributes[$attribute->getCode()] = $attribute;\n            }\n        }\n        $this->_attributes = $attributes;\n        Mage::dispatchEvent('umc_entity_prepare_attributes', array('entity'=>$this));\n        $this->_preparedAttributes = true;\n        return $this;\n    }\n\n    /**\n     * ge the entity attributes\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Attribute[]\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributes()\n    {\n        if (!$this->_preparedAttributes) {\n            $this->_prepareAttributes();\n        }\n        return $this->_attributes;\n    }\n\n    /**\n     * entity to xml\n     *\n     * @access public\n     * @param array $arrAttributes\n     * @param string $rootName\n     * @param bool $addOpenTag\n     * @param bool $addCdata\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toXml(array $arrAttributes = array(), $rootName = 'entity', $addOpenTag=false, $addCdata=false)\n    {\n        $xml = '';\n        if ($addOpenTag) {\n            $xml.= '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.$this->getEol();\n        }\n        if (!empty($rootName)) {\n            $xml.= '<'.$rootName.'>'.$this->getEol();\n        }\n        $xml .= parent::toXml($this->getXmlAttributes(), '', false, $addCdata);\n        $xml .= '<attributes>'.$this->getEol();\n        foreach ($this->getAttributes() as $attribute) {\n            $xml .= $attribute->toXml(array(), 'attribute', false, $addCdata);\n        }\n        $xml .= '</attributes>'.$this->getEol();\n        if (!empty($rootName)) {\n            $xml.= '</'.$rootName.'>'.$this->getEol();\n        }\n        return $xml;\n    }\n\n    /**\n     * get magic function code for the name attribute\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameAttributeMagicCode()\n    {\n        $nameAttribute = $this->getNameAttribute();\n        if ($nameAttribute) {\n            $entityNameMagicCode = $nameAttribute->getMagicMethodCode();\n        } else {\n            $entityNameMagicCode = 'Name';\n        }\n        return $entityNameMagicCode;\n    }\n\n    /**\n     * get the name attribute\n     *\n     * @access public\n     * @return mixed(null|Ultimate_ModuleCreator_Model_Attribute)\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameAttribute()\n    {\n        return $this->_nameAttribute;\n    }\n\n    /**\n     * get the attribute code for the name attribute\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameAttributeCode()\n    {\n        return $this->_nameAttribute->getCode();\n    }\n\n    /**\n     * get the attribute label for the name attribute\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameAttributeLabel()\n    {\n        return $this->getNameAttribute()->getLabel();\n    }\n\n    /**\n     * check if the entity has file attributes\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasFile()\n    {\n        return $this->getTypeInstance()->getHasFile();\n    }\n\n    /**\n     * check if the entity has image attributes\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasImage()\n    {\n        return $this->getTypeInstance()->getHasImage();\n    }\n    /**\n     * check if the entity has upload attributes\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasUpload()\n    {\n        return $this->getHasFile() || $this->getHasImage();\n    }\n\n    /**\n     * get the first image attribute code\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFirstImageField()\n    {\n        foreach ($this->getAttributes() as $attribute) {\n            if ($attribute->getType() == 'image') {\n                return $attribute->getCode();\n            }\n        }\n        return '';\n    }\n\n    /**\n     * get the attribute name for plural\n     *\n     * @access public\n     * @param bool $lower\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNamePlural($lower = false)\n    {\n        $plural = $this->getData('name_plural');\n        if ($plural == $this->getNameSingular()) {\n            if ($plural == \"\") {\n                return \"\";\n            }\n            $plural = $this->getNameSingular().'s';\n        }\n        if ($lower) {\n            $plural = strtolower($plural);\n        }\n        return $plural;\n    }\n\n    /**\n     * check if frontend list files must be created\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCreateList()\n    {\n        return $this->getCreateFrontend() && $this->getData('create_list');\n    }\n\n    /**\n     * get list template\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getListTemplate()\n    {\n        if ($this->getCreateList()) {\n            return $this->getData('list_template');\n        }\n        return '';\n    }\n\n    /**\n     * check if frontend view files must be created\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCreateView()\n    {\n        return $this->getCreateFrontend() && $this->getData('create_view');\n    }\n\n    /**\n     * get list template\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getViewTemplate()\n    {\n        if ($this->getCreateView()) {\n            return $this->getData('view_template');\n        }\n        return '';\n    }\n\n    /**\n     * check if widget list files must be created\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWidget()\n    {\n        return $this->getCreateFrontend() && $this->getData('widget');\n    }\n\n    /**\n     * check if SEO attributes should be added\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAddSeo()\n    {\n        return $this->getCreateView() && $this->getData('add_seo');\n    }\n\n    /**\n     * check if SEO attributes should be added\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRss()\n    {\n        return $this->getCreateFrontend() && $this->getData('rss');\n    }\n\n    /**\n     * check if url rewrite should be added\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getUrlRewrite()\n    {\n        return $this->getCreateView() && $this->getData('url_rewrite');\n    }\n\n    /**\n     * get url prefix\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getUrlPrefix()\n    {\n        if ($this->getUrlRewrite()) {\n            return $this->getData('url_prefix');\n        }\n        return '';\n    }\n\n    /**\n     * get url suffix\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getUrlSuffix()\n    {\n        if ($this->getUrlRewrite()) {\n            return $this->getData('url_suffix');\n        }\n        return '';\n    }\n\n    /**\n     * check if products are listed in the entity view page\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getShowProducts()\n    {\n        return $this->getLinkProduct() &&\n            $this->getCreateFrontend() &&\n            $this->getData('show_products');\n    }\n\n    /**\n     * check if entity list is shown on product page\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getShowOnProduct()\n    {\n        return $this->getLinkProduct() && $this->getData('show_on_product');\n    }\n\n    /**\n     * check if entity list is shown on category page\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getShowOnCategory()\n    {\n        return $this->getLinkCategory() && $this->getData('show_on_category');\n    }\n\n    /**\n     * add related entities\n     *\n     * @access public\n     * @param string $type\n     * @param Ultimate_ModuleCreator_Model_Entity $entity\n     * @return Ultimate_ModuleCreator_Model_Entity\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function addRelatedEntity($type, $entity)\n    {\n        $this->_relatedEntities[$type][] = $entity;\n        return $this;\n    }\n\n    /**\n     * get the related entities\n     *\n     * @access public\n     * @param mixed $type\n     * @return Ultimate_ModuleCreator_Model_Entity[]\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRelatedEntities($type = null)\n    {\n        if (is_null($type)) {\n            return $this->_relatedEntities;\n        }\n        if (isset($this->_relatedEntities[$type])) {\n            return $this->_relatedEntities[$type];\n        }\n        return array();\n    }\n\n    /**\n     * check if entity does not behave as tree\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNotIsTree()\n    {\n        return !$this->getIsTree();\n    }\n\n    /**\n     * check if entity does not have url rewrites\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNotUrlRewrite()\n    {\n        return !$this->getUrlRewrite();\n    }\n\n    /**\n     * check if entity is EAV\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsEav()\n    {\n        return $this->getType() == Ultimate_ModuleCreator_Model_Entity_Type_Abstract::TYPE_EAV;\n    }\n\n    /**\n     * check if entity is Flat\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsFlat()\n    {\n        return $this->getType() == Ultimate_ModuleCreator_Model_Entity_Type_Abstract::TYPE_FLAT;\n    }\n\n    /**\n     * get the entity type instance\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Entity_Type_Abstract\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getTypeInstance()\n    {\n        if (is_null($this->_typeInstance)) {\n            $type = $this->getType();\n            /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n            $helper = Mage::helper('modulecreator');\n            $types  = $helper->getEntityTypes(false);\n            if (isset($types[$type])) {\n                /** @var Ultimate_ModuleCreator_Model_Entity_Type_Abstract $typeInstance */\n                $typeInstance = Mage::getModel((string)$types[$type]->type_model);\n                $this->_typeInstance = $typeInstance;\n            } else {\n                throw new Ultimate_ModuleCreator_Exception(\n                    Mage::helper('modulecreator')->__('Entity \"%s\" type is not valid', $type)\n                );\n            }\n            $this->_typeInstance->setEntity($this);\n        }\n        return $this->_typeInstance;\n    }\n\n    /**\n     * check if entity has default config settings\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasConfigDefaults()\n    {\n        return $this->getCreateFrontend();\n    }\n\n    /**\n     * check if entity is linked to core entities (product, category)\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLinkCore()\n    {\n        return $this->getLinkProduct() || $this->getLinkCategory();\n    }\n\n    /**\n     * get entity placeholders\n     *\n     * @access public\n     * @param null $param\n     * @return array|mixed|null|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPlaceholders($param = null)\n    {\n        if (is_null($this->_placeholders)) {\n            $this->_placeholders = array();\n            $this->_placeholders['{{entity_default_config}}']       = $this->getDefaultConfig();\n            $this->_placeholders['{{entity}}']                      = $this->getNameSingular(true);\n            $this->_placeholders['{{Entity}}']                      = ucfirst($this->getNameSingular(true));\n            $this->_placeholders['{{ENTITY}}']                      = strtoupper($this->getNameSingular());\n            $this->_placeholders['{{EntityLabel}}']                 = ucfirst($this->escapeText($this->getLabelSingular()));\n            $this->_placeholders['{{entityLabel}}']                 = strtolower($this->escapeText($this->getLabelSingular()));\n            $this->_placeholders['{{EntitiesLabel}}']               = ucfirst($this->escapeText($this->getLabelPlural()));\n            $this->_placeholders['{{entitiesLabel}}']               = strtolower($this->escapeText($this->getLabelPlural()));\n            $this->_placeholders['{{entityCollectionAttributes}}']  = $this->getCollectionAttributes();\n            $this->_placeholders['{{entityAdminJoin}}']             = $this->getAdminJoin();\n            $this->_placeholders['{{prepareColumnsHeader}}']        = $this->getPrepareColumnsHeader();\n            $this->_placeholders['{{nameAttributeGridEav}}']        = $this->getNameAttributeGridEav();\n            $this->_placeholders['{{nameAttributeCode}}']           = $this->getNameAttributeCode();\n            $this->_placeholders['{{nameAttributeLabel}}']          = $this->escapeText($this->getNameAttributeLabel());\n            $this->_placeholders['{{entities}}']                    = $this->getNamePlural(true);\n            $this->_placeholders['{{Entities}}']                    = ucfirst($this->getNamePlural(true));\n            $this->_placeholders['{{EntityNameMagicCode}}']         = $this->getNameAttributeMagicCode();\n            $this->_placeholders['{{attributeDdlSql}}']             = $this->getAttributesDdlSql();\n            $this->_placeholders['{{referenceHead}}']               = $this->getReferenceHeadLayout();\n            $this->_placeholders['{{EntityViewRelationLayout}}']    = $this->getRelationLayoutXml();\n            $this->_placeholders['{{listLayout}}']                  = $this->getListTemplate();\n            $this->_placeholders['{{viewLayout}}']                  = $this->getViewTemplate();\n            $this->_placeholders['{{entityHtmlLink}}']              = $this->getHtmlLink();\n            $this->_placeholders['{{EntityViewAttributes}}']        = $this->getViewAttributesHtml();\n            $this->_placeholders['{{EntityViewWidgetAttributes}}']  = $this->getViewWidgetAttributesHtml();\n            $this->_placeholders['{{systemAttributes}}']            = $this->getSystemAttributes();\n            $this->_placeholders['{{entityApiAdditional}}']         = $this->getApiAdditional();\n            $this->_placeholders['{{entityApiFaults}}']             = $this->getApiFaults();\n            $this->_placeholders['{{entityAdditionalApiAcl}}']      = $this->getAdditionalApiAcl();\n            $this->_placeholders['{{entityWsdlAttributes}}']        = $this->getWsdlAttributes();\n            $this->_placeholders['{{entityWsdlAttributesForAdd}}']  = $this->getWsdlAttributes(false, true);\n            $this->_placeholders['{{entityWsdlRelationTypes}}']     = $this->getWsdlRelationTypes();\n            $this->_placeholders['{{entityWsdlPortTypeRelation}}']  = $this->getWsdlPortTypeRelation();\n            $this->_placeholders['{{entityWsdlRelationBinding}}']   = $this->getWsdlRelationBinding();\n            $this->_placeholders['{{entityWsiRelationParamTypes}}'] = $this->getWsiRelationParamTypes();\n            $this->_placeholders['{{entityWsiRelationMessages}}']   = $this->getWsiRelationMessages();\n            $this->_placeholders['{{entityWsiPortTypeRelation}}']   = $this->getWsiPortTypeRelation();\n            $this->_placeholders['{{entityWsiRelationBinding}}']    = $this->getWsiRelationBinding();\n            $this->_placeholders['{{entityWsiAttributes}}']         = $this->getWsiAttributes();\n            $this->_placeholders['{{entityWsiAttributesForAdd}}']   = $this->getWsiAttributes(true);\n            $this->_placeholders['{{entityWsiRelationTypes}}']      = $this->getWsiRelationTypes();\n            $this->_placeholders['{{entityWsdlMessages}}']          = $this->getWsdlMessages();\n            $this->_placeholders['{{fksDdl}}']\t\t\t\t\t\t= $this->getParentEntitiesFksDdl();\n            $this->_placeholders['{{selectedMenuPath}}']            = $this->getSelectedMenuPath();\n            $this->_placeholders['{{entityAttributesSetup}}']       = $this->getAttributesSetup();\n            $this->_placeholders['{{ResourceModelParent}}']         = $this->getResourceModelParent();\n            $this->_placeholders['{{ResourceCollectionParent}}']    = $this->getResourceCollectionModelParent();\n            $this->_placeholders['{{RelationsResourceTables}}']     = $this->getResourceRelationsTables();\n            $this->_placeholders['{{RelationsResourceTablesDeclare}}'] = $this->getResourceRelationsTablesDeclare();\n            $this->_placeholders['{{adminIndexContent}}']           = $this->getAdminIndexLayoutContent();\n            $this->_placeholders['{{EntityParentModel}}']           = $this->getEntityParentModel();\n            $this->_placeholders['{{entityTableAlias}}']            = $this->getEntityTableAlias();\n            $this->_placeholders['{{additionalPrepareCollection}}'] = $this->getAdditionalPrepareCollection();\n            $this->_placeholders['{{entityEditLayoutLeft}}']        = $this->getEditLayoutLeft();\n            $this->_placeholders['{{entityLayoutAdditional}}']      = $this->getEditLayoutAdditional();\n            $this->_placeholders['{{productAttributeCode}}']        = $this->getProductAttributeCode();\n            $this->_placeholders['{{categoryAttributeCode}}']       = $this->getCategoryAttributeCode();\n            $this->_placeholders['{{entityProductAttributeScope}}'] = $this->getProductAttributeScopeLabel();\n            $this->_placeholders['{{entityCategoryAttributeScope}}']= $this->getCategoryAttributeScopeLabel();\n            $this->_placeholders['{{productAttributeGroup}}']       = $this->getProductAttributeGroupLabel();\n            $this->_placeholders['{{categoryAttributeGroup}}']      = $this->getCategoryAttributeGroupLabel();\n            $this->_placeholders['{{beforeSaveParam}}']             = $this->getBeforeSaveParam();\n            $this->_placeholders['{{EntityAttributeSetId}}']        = $this->getEntityAttributeSetId();\n            $this->_placeholders['{{filterMethod}}']                = $this->getFilterMethod();\n            $this->_placeholders['{{multipleSelectConvert}}']       = $this->getMultipleSelectConvert();\n            $this->_placeholders['{{toOptionAddition}}']            = $this->getToOptionAddition();\n            $this->_placeholders['{{multiselectMethods}}']          = $this->getMultiselectMethods();\n            $this->_placeholders['{{nameHtml}}']                    = $this->getNameHtml();\n            $this->_placeholders['{{isTree}}']                      = (int)$this->getIsTree();\n            $this->_placeholders['{{commentFilterIndexPrefix}}']    = $this->getCommentFilterIndexPrefix();\n            $this->_placeholders['{{entityApiAdditionalSettings}}'] = $this->getApiAdditionalSettings();\n            $this->_placeholders['{{subEntitiesAcl}}']              = $this->getSubEntitiesAcl();\n            $this->_placeholders['{{position}}']                    = $this->getPosition();\n            $this->_placeholders['{{entityApiResourcesAlias}}']     = $this->getApiResourcesAlias();\n            $this->_placeholders['{{entityApiResourcesAliasV2}}']   = $this->getApiResourcesAliasV2();\n            $this->_placeholders['{{defaultApiAttributes}}']        = $this->getDefaultApiAttributes();\n            $this->_placeholders['{{filterEntityDates}}']           = $this->getFilterDates();\n            $this->_placeholders['{{filterEntityDates3}}']          = $this->getFilterDates(3);\n            $this->_placeholders['{{allAttributesToCollection}}']   = $this->getAllAttributesToCollection();\n            $this->_placeholders['{{loadStoreId}}']                 = $this->getLoadStoreId();\n            $this->_placeholders['{{restCollectionCleanup}}']       = $this->getRestCollectionCleanup();\n            $this->_placeholders['{{restCollectionStoreId}}']       = $this->getRestCollectionStoreId();\n            $this->_placeholders['{{defaultAttributeValues}}']      = $this->getDefaultAttributeValues();\n            $this->_placeholders['{{toOptionArraySelect}}']         = $this->getToOptionArraySelect();\n            $this->_placeholders['{{parentStaticParams}}']          = $this->getParentStaticParams();\n\n\n            $eventObject = new Varien_Object(\n                array(\n                    'placeholders' => $this->_placeholders\n                )\n            );\n            Mage::dispatchEvent('umc_entity_placeholdrers', array('event_object'=>$eventObject));\n            $this->_placeholders = $eventObject->getPlaceholders();\n        }\n        if (is_null($param)) {\n            return $this->_placeholders;\n        }\n        if (isset($this->_placeholders[$param])) {\n            return $this->_placeholders[$param];\n        }\n        return '';\n    }\n\n    /**\n     * get placeholders as sibling\n     *\n     * @access public\n     * @param null $param\n     * @return array|mixed|null|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPlaceholdersAsSibling($param = null)\n    {\n        if (is_null($this->_placeholdersAsSibling)) {\n            $this->_placeholdersAsSibling = array();\n            $this->_placeholdersAsSibling['{{sibling_default_config}}']         = $this->getDefaultConfig();\n            $this->_placeholdersAsSibling['{{sibling}}']                        = $this->getNameSingular(true);\n            $this->_placeholdersAsSibling['{{Sibling}}']                        = ucfirst($this->getNameSingular(true));\n            $this->_placeholdersAsSibling['{{SIBLING}}']                        = strtoupper($this->getNameSingular());\n            $this->_placeholdersAsSibling['{{SiblingLabel}}']                   = ucfirst($this->getLabelSingular());\n            $this->_placeholdersAsSibling['{{siblingLabel}}']                   = strtolower($this->getLabelSingular());\n            $this->_placeholdersAsSibling['{{SiblingsLabel}}']                  = ucfirst($this->getLabelPlural());\n            $this->_placeholdersAsSibling['{{siblingsLabel}}']                  = $this->getLabelPlural(true);\n            $this->_placeholdersAsSibling['{{siblingCollectionAttributes}}']    = $this->getCollectionAttributes();\n            $this->_placeholdersAsSibling['{{siblingAdminJoin}}']               = $this->getAdminJoin();\n            $this->_placeholdersAsSibling['{{siblingColumnsHeader}}']           = $this->getPrepareColumnsHeader();\n            $this->_placeholdersAsSibling['{{siblingNameAttributeGridEav}}']    = $this->getNameAttributeGridEav();\n            $this->_placeholdersAsSibling['{{siblingNameAttributeCode}}']       = $this->getNameAttributeCode();\n            $this->_placeholdersAsSibling['{{siblingNameAttributeLabel}}']      = $this->getNameAttributeLabel();\n            $this->_placeholdersAsSibling['{{siblings}}']                       = strtolower($this->getNamePlural());\n            $this->_placeholdersAsSibling['{{Siblings}}']                       = ucfirst($this->getNamePlural(true));\n            $this->_placeholdersAsSibling['{{SiblingNameMagicCode}}']           = $this->getNameAttributeMagicCode();\n            $this->_placeholdersAsSibling['{{SiblingViewRelationLayout}}']      = $this->getRelationLayoutXml();\n            $this->_placeholdersAsSibling['{{siblingListLayout}}']              = $this->getListTemplate();\n            $this->_placeholdersAsSibling['{{siblingViewLayout}}']              = $this->getViewTemplate();\n            $this->_placeholdersAsSibling['{{SiblingListItem}}']                = $this->getHtmlLink();\n            $this->_placeholdersAsSibling['{{siblingNameAttribute}}']           = $this->getNameAttributeCode();\n            $this->_placeholdersAsSibling['{{siblingAdditionalPrepareCollection}}']\n                = $this->getAdditionalPrepareCollection();\n            $this->_placeholdersAsSibling['{{siblingTableAlias}}']              = $this->getEntityTableAlias();\n            $this->_placeholdersAsSibling['{{siblingFilterMethod}}']            = $this->getFilterMethod();\n            $this->_placeholdersAsSibling['{{siblingAllAttributesToCollection}}']\n                = $this->getAllAttributesToCollection();\n            $this->_placeholdersAsSibling['{{siblingLoadStoreId}}']              = $this->getLoadStoreId();\n            $this->_placeholdersAsSibling['{{siblingToOptionArraySelect}}']     = $this->getToOptionArraySelect();\n            $this->_placeholdersAsSibling['{{siblingParentStaticParams}}']      = $this->getParentStaticParams();\n\n            $eventObject = new Varien_Object(\n                array(\n                    'placeholders' => $this->_placeholdersAsSibling\n                )\n            );\n            Mage::dispatchEvent(\n                'umc_entity_placeholdrers_as_sibling',\n                array('event_object'=>$eventObject)\n            );\n            $this->_placeholdersAsSibling = $eventObject->getPlaceholders();\n        }\n        if (is_null($param)) {\n            return $this->_placeholdersAsSibling;\n        }\n        if (isset($this->_placeholdersAsSibling[$param])) {\n            return $this->_placeholdersAsSibling[$param];\n        }\n        return '';\n    }\n\n    /**\n     * get default config settings\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultConfig()\n    {\n        if (!$this->getHasConfigDefaults()) {\n            return '';\n        }\n        $padding3   = $this->getPadding(3);\n        $padding    = $this->getPadding();\n        $eol        = $this->getEol();\n\n        $text = '<'.$this->getNameSingular().'>'.$eol;\n        if ($this->getCreateFrontend()) {\n            $text.= $padding3.$padding.'<breadcrumbs>1</breadcrumbs>'.$eol;\n        }\n        if ($this->getUrlRewrite() && $this->getUrlPrefix()) {\n            $text.= $padding3.$padding.'<url_prefix>'.$this->getUrlPrefix().'</url_prefix>'.$eol;\n        }\n        if ($this->getUrlRewrite() && $this->getUrlSuffix()) {\n            $text.= $padding3.$padding.'<url_suffix>'.$this->getUrlSuffix().'</url_suffix>'.$eol;\n        }\n        if ($this->getUrlRewrite() && $this->getUrlRewriteList()) {\n            $text.= $padding3.$padding.'<url_rewrite_list>'.$this->getUrlRewriteList().'</url_rewrite_list>'.$eol;\n        }\n        if ($this->getAllowComment()) {\n            $text.= $padding3.$padding.'<allow_comment>1</allow_comment>'.$eol;\n        }\n        if ($this->getRss()) {\n            $text.= $padding3.$padding.'<rss>1</rss>'.$eol;\n        }\n        if ($this->getAddSeo()) {\n            $text.= $padding3.$padding.'<meta_title>'.$this->getLabelPlural().'</meta_title>'.$eol;\n        }\n        if ($this->getIsTree() && $this->getCreateFrontend()) {\n            $text.= $padding3.$padding.'<tree>1</tree>'.$eol;\n            $text.= $padding3.$padding.'<recursion>0</recursion>'.$eol;\n        }\n        $text .= $padding3.'</'.$this->getNameSingular().'>'.$eol;\n        return $text;\n    }\n\n    /**\n     * get xml for add product event\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAddBlockToProductEvent()\n    {\n        $text = '';\n        if ($this->getLinkProduct()) {\n            $ns     = $this->getNamespace(true);\n            $eol    = $this->getEol();\n            $text   = $this->getPadding(5).'<'.$ns.'_'.$this->getModule()->getLowerModuleName().'_'.\n                $this->getNameSingular(true).'>'.$eol;\n            $text  .= $this->getPadding(6).'<type>singleton</type>'.$eol;\n            $text  .= $this->getPadding(6).'<class>'.$ns.'_'.$this->getModule()->getLowerModuleName().\n                '/adminhtml_observer</class>'.$eol;\n            $text  .= $this->getPadding(6).'<method>add'.ucfirst(strtolower($this->getNameSingular())).\n                'Block</method>'.$eol;\n            $text  .= $this->getPadding(5).'</'.$ns.'_'.$this->getModule()->getLowerModuleName().'_'.\n                $this->getNameSingular(true).'>'.$eol;\n        }\n        return $text;\n    }\n\n    /**\n     * get xml for add product save after event\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getProductSaveAfterEvent()\n    {\n        $text = '';\n        if ($this->getLinkProduct()) {\n            $ns     = strtolower($this->getModule()->getNamespace());\n            $eol    = $this->getEol();\n            $text   = $this->getPadding(5).'<'.$ns.'_'.$this->getModule()->getLowerModuleName().'_'.\n                $this->getNameSingular(true).'>'.$eol;\n            $text  .= $this->getPadding(6).'<type>singleton</type>'.$eol;\n            $text  .= $this->getPadding(6).'<class>'.$ns.'_'.$this->getModule()->getLowerModuleName().\n                '/adminhtml_observer</class>'.$eol;\n            $text  .= $this->getPadding(6).'<method>save'.ucfirst(strtolower($this->getNameSingular())).\n                'Data</method>'.$eol;\n            $text  .= $this->getPadding(5).'</'.$ns.'_'.$this->getModule()->getLowerModuleName().\n                '_'.$this->getNameSingular(true).'>'.$eol;\n        }\n        return $text;\n    }\n\n    /**\n     * get xml for add can load ext js\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCanLoadExtJsEvent()\n    {\n        $text = '';\n        if ($this->getLinkProduct() && $this->getIsTree()) {\n            $eol    = $this->getEol();\n            $ns     = strtolower($this->getModule()->getNamespace());\n            $text   = $this->getPadding(5).'<'.$ns.'_'.$this->getModule()->getLowerModuleName().'_'.\n                $this->getNameSingular(true).'>'.$eol;\n            $text  .= $this->getPadding(6).'<type>singleton</type>'.$eol;\n            $text  .= $this->getPadding(6).'<class>'.$ns.'_'.$this->getModule()->getLowerModuleName().\n                '/adminhtml_observer</class>'.$eol;\n            $text  .= $this->getPadding(6).'<method>setCanLoadExtJs</method>'.$eol;\n            $text  .= $this->getPadding(5).'</'.$ns.'_'.$this->getModule()->getLowerModuleName().\n                '_'.$this->getNameSingular(true).'>'.$eol;\n        }\n        return $text;\n    }\n\n    /**\n     * get xml for admin menu\n     *\n     * @access public\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMenu($padding)\n    {\n        $extension  = $this->getModule()->getExtensionName(true);\n        $module     = $this->getModule()->getLowerModuleName();\n        $title      = ucwords($this->getLabelSingular());\n        $entity     = strtolower($this->getNameSingular());\n        $action     = $module.'_'.$entity;\n        $eol        = $this->getEol();\n\n        $text  = $this->getPadding($padding).'<'.$entity.' translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $text .= $this->getPadding($padding + 1).'<title>'.$title.'</title>'.$eol;\n        $text .= $this->getPadding($padding + 1).'<action>adminhtml/'.$action.'</action>'.$eol;\n        $text .= $this->getPadding($padding + 1).'<sort_order>'.$this->getPosition().'</sort_order>'.$eol;\n        $text .= $this->getPadding($padding).'</'.$entity.'>'.$eol;\n        if ($this->getAllowComment()) {\n            $text .= $this->getPadding($padding).'<'.$entity.\n                '_comments translate=\"title\" module=\"'.$extension.'\">'.$eol;\n            $text .= $this->getPadding($padding + 1).'<title>Manage '.$title.' Comments</title>'.$eol;\n            $text .= $this->getPadding($padding + 1).'<action>adminhtml/'.$action.'_comment</action>'.$eol;\n            $text .= $this->getPadding($padding + 1).'<sort_order>'.($this->getPosition() + 4).'</sort_order>'.$eol;\n            $text .= $this->getPadding($padding).'</'.$entity.'_comments>'.$eol;\n        }\n\n        $text .= $this->getTypeInstance()->getAdditionalMenu($padding);\n        return $text;\n\n    }\n\n    /**\n     * get xml for acl\n     *\n     * @access public\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMenuAcl($padding)\n    {\n        $extension  = $this->getModule()->getExtensionName(true);\n        $title      = ucwords($this->getLabelSingular());\n        $entity     = $this->getNameSingular(true);\n        $eol        = $this->getEol();\n\n        $text  = $this->getPadding($padding).'<'.$entity.' translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $text .= $this->getPadding($padding + 1).'<title>'.$title.'</title>'.$eol;\n        $text .= $this->getPadding($padding + 1).'<sort_order>'.$this->getPosition().'</sort_order>'.$eol;\n        $text .= $this->getPadding($padding).'</'.$entity.'>'.$eol;\n\n        if ($this->getAllowComment()) {\n            $text .= $this->getPadding($padding).'<'.$entity.\n                '_comments translate=\"title\" module=\"'.$extension.'\">'.$eol;\n            $text .= $this->getPadding($padding + 1).'<title>Manage '.$title.' Comments</title>'.$eol;\n            $text .= $this->getPadding($padding + 1).'<sort_order>'.($this->getPosition() + 5).'</sort_order>'.$eol;\n            $text .= $this->getPadding($padding).'</'.$entity.'_comments>'.$eol;\n        }\n        $text .= $this->getTypeInstance()->getAdditionalMenuAcl($padding);\n        return $text;\n\n    }\n\n    /**\n     * get attributes that need to be added in the admin grid collection\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCollectionAttributes()\n    {\n        return $this->getTypeInstance()->getCollectionAttributes();\n    }\n\n    /**\n     * get join with admin - for the admin grid\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminJoin()\n    {\n        return $this->getTypeInstance()->getAdminJoin();\n    }\n\n    /**\n     * code above the prepare columns\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPrepareColumnsHeader()\n    {\n        return $this->getTypeInstance()->getPrepareColumnsHeader();\n    }\n\n    /**\n     * name attribute in grid\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameAttributeGridEav()\n    {\n        return $this->getTypeInstance()->getNameAttributeGridEav();\n    }\n\n    /**\n     * check if the frontend list block can be created\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCanCreateListBlock()\n    {\n        if ($this->getCreateList()) {\n            return true;\n        }\n        if ($this->getShowOnProduct()) {\n            return true;\n        }\n        if ($this->getShowOnCategory()) {\n            return true;\n        }\n        //check for siblings with frontend view\n        $related = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        foreach ($related as $r) {\n            if ($r->getCreateView()) {\n                return true;\n            }\n        }\n        //check for parents with frontend view\n        $related = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD\n        );\n        foreach ($related as $r) {\n            if ($r->getCreateView()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * get ddl text for attributes\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributesDdlSql()\n    {\n        $padding    = $this->getPadding();\n        $eol        = $this->getEol();\n        $content    = '';\n        $content   .= $this->getParentEntitiesFkAttributes($padding, true);\n        if ($this->getIsFlat()) {\n            foreach ($this->getAttributes() as $attribute) {\n                $content .= $padding.$attribute->getDdlSqlColumn().$eol;\n            }\n        }\n        if ($this->getIsFlat()) {\n            $simulated = $this->getSimulatedAttributes(null, false);\n        } elseif ($this->getIsTree()) {\n            $simulated = $this->getSimulatedAttributes('tree', false);\n        } else {\n            $simulated = array();\n        }\n        foreach ($simulated as $attr) {\n            $content .= $padding.$attr->getDdlSqlColumn().$eol;\n        }\n        return substr($content, 0, strlen($content) - strlen($eol));\n    }\n\n    /**\n     * get foreign key columns\n     *\n     * @access public\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getParentEntitiesFkAttributes($padding)\n    {\n        if ($this->getIsEav()) {\n            return '';\n        }\n        $parents = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD\n        );\n        $content = '';\n        foreach ($parents as $parent) {\n            /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n            $attr = Mage::getModel('modulecreator/attribute');\n            $attr->setCode($parent->getPlaceholders('{{entity}}').'_id');\n            $attr->setLabel($parent->getPlaceholders('{{EntityLabel}}'). ' ID');\n            $attr->setType('int');\n            $content .= $padding.$attr->getDdlSqlColumn().\"\\n\";\n        }\n        return $content;\n    }\n\n    /**\n     * get simulated attributes\n     *\n     * @access public\n     * @param mixed $type\n     * @param bool $ignoreSettings\n     * @param array $except\n     * @return Ultimate_ModuleCreator_Model_Attribute[]\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSimulatedAttributes($type = null, $ignoreSettings = false, $except = array())\n    {\n        /** @var Ultimate_ModuleCreator_Model_Attribute[] $attributes */\n        $attributes = array();\n        $namespace  = $this->getNamespace(true);\n        if (is_null($type)) {\n            $types = array('status', 'url_rewrite', 'tree', 'rss', 'seo', 'comment');\n            $attributes = array();\n            foreach ($types as $type) {\n                if (!in_array($type, $except)) {\n                    $attributes = array_merge($attributes, $this->getSimulatedAttributes($type, $ignoreSettings));\n                }\n            }\n            return $attributes;\n        }\n        switch ($type) {\n            case 'status':\n                /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                $attr = Mage::getModel('modulecreator/attribute');\n                $attr->setCode('status');\n                $attr->setLabel('Enabled');\n                $attr->setType('yesno');\n                $attr->setDefaultValue('1');\n                $attributes[] = $attr;\n                break;\n            case 'url_rewrite':\n                if ($this->getUrlRewrite() || $ignoreSettings) {\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('url_key');\n                    $attr->setLabel('URL key');\n                    $attr->setType('text');\n                    $module = $this->getModule()->getLowerModuleName();\n                    $entity = $this->getNameSingular(true);\n                    $attr->setForcedSetupBackend($namespace.'_'.$module.'/'.$entity.'_attribute_backend_urlkey');\n                    $attributes[] = $attr;\n                }\n                break;\n            case 'tree' :\n                if ($this->getIsTree() || $ignoreSettings) {\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('parent_id');\n                    $attr->setLabel('Parent id');\n                    $attr->setType('int');\n                    $attributes[] = $attr;\n\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('path');\n                    $attr->setLabel('Path');\n                    $attr->setType('text');\n                    $attr->setIgnoreApi(true);\n                    $attributes[] = $attr;\n\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('position');\n                    $attr->setLabel('Position');\n                    $attr->setType('int');\n                    $attr->setIgnoreApi(true);\n                    $attributes[] = $attr;\n\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('level');\n                    $attr->setLabel('Level');\n                    $attr->setType('int');\n                    $attr->setIgnoreApi(true);\n                    $attributes[] = $attr;\n\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('children_count');\n                    $attr->setLabel('Children count');\n                    $attr->setType('int');\n                    $attr->setIgnoreApi(true);\n                    $attributes[] = $attr;\n                }\n                break;\n            case 'rss':\n                if ($this->getRss() || $ignoreSettings) {\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('in_rss');\n                    $attr->setLabel('In RSS');\n                    $attr->setType('yesno');\n                    $attr->setDefaultValue('1');\n                    $attributes[] = $attr;\n                }\n                break;\n            case 'seo':\n                if ($this->getAddSeo() || $ignoreSettings) {\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('meta_title');\n                    $attr->setLabel('Meta title');\n                    $attr->setType('text');\n                    $attributes[] = $attr;\n\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('meta_keywords');\n                    $attr->setLabel('Meta keywords');\n                    $attr->setType('textarea');\n                    $attributes[] = $attr;\n\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('meta_description');\n                    $attr->setLabel('Meta description');\n                    $attr->setType('textarea');\n                    $attributes[] = $attr;\n                }\n                break;\n            case 'comment':\n                if ($this->getAllowComment() || $ignoreSettings) {\n                    /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n                    $attr = Mage::getModel('modulecreator/attribute');\n                    $attr->setCode('allow_comment');\n                    $attr->setLabel('Allow Comment');\n                    $attr->setType('dropdown');\n                    $attr->setOptionsSource('custom');\n                    $attr->setOptions(false);\n                    $attr->setEntity($this);\n                    $attr->setDefaultValue('2');\n                    $attr->setForcedDefaultValue('2');\n                    $attr->setForcedSource(\n                        $namespace.'_'.$this->getModule()->getLowerModuleName().\n                        '/adminhtml_source_yesnodefault'\n                    );\n                    $attributes[] = $attr;\n                }\n                break;\n            default:\n                break;\n        }\n        foreach ($attributes as $attribute) {\n            $attribute->setUserDefined(false);\n        }\n        return $attributes;\n    }\n\n    /**\n     * get layout xml head reference\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getReferenceHeadLayout()\n    {\n        $eol        = $this->getEol();\n        $content    = $this->getPadding(2);\n        if ($this->getIsTree()) {\n            $namespace  = $this->getNamespace(true);\n            $module     = $this->getModule()->getLowerModuleName();\n            $entity     = $this->getNameSingular(true);\n            $content   .= '<reference name=\"head\">'.$eol;\n            $content   .= $this->getPadding(3).\n                '<action method=\"addItem\" ifconfig=\"'.$namespace.'_'.$module.'/'.$entity.\n                '/tree\"><type>skin_js</type><js>js/'.$namespace.'_'.$module.'/tree.js</js></action>'.$eol;\n            $content   .= $this->getPadding(2).'</reference>'.$eol;\n            $content   .= $this->getPadding(2);\n        }\n        return $content;\n    }\n\n    /**\n     * get layout xml for relation to product\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRelationLayoutXml()\n    {\n        $eol        = $this->getEol();\n        $content    = $this->getPadding(2);\n        $module     = $this->getModule()->getLowerModuleName();\n        $entityName = $this->getNameSingular(true);\n        $namespace  = $this->getNamespace(true);\n        if ($this->getIsTree()) {\n            $content .= $this->getPadding().'<block type=\"'.$namespace.'_'.$module.'/'.\n                $entityName.'_children\" name=\"'.$entityName.'_children\" template=\"'.\n                $namespace.'_'.$module.'/'.$entityName.'/children.phtml\" />'.$eol.$this->getPadding(2);\n        }\n        if ($this->getShowProducts()) {\n            $content .= $this->getPadding().'<block type=\"'.\n                $namespace.'_'.$module.'/'.$entityName.'_catalog_product_list\" name=\"'.\n                $entityName.'.info.products\" as=\"'.$entityName.'_products\" template=\"'.\n                $namespace.'_'.$module.'/'.$entityName.'/catalog/product/list.phtml\" />'.\n                $eol.$this->getPadding(2);\n        }\n        if ($this->getShowCategory()) {\n            $content .= $this->getPadding().'<block type=\"'.\n                $namespace.'_'.$module.'/'.$entityName.'_catalog_category_list\" name=\"'.\n                $entityName.'.info.categories\" as=\"'.$entityName.\n                '_categories\" template=\"'.$namespace.'_'.$module.'/'.$entityName.\n                '/catalog/category/list.phtml\" />'.$eol.$this->getPadding(2);\n        }\n        $children = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_PARENT\n        );\n        $siblings = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        /** @var Ultimate_ModuleCreator_Model_Entity[] $relatedEntities */\n        $relatedEntities = array_merge($children, $siblings);\n        foreach ($relatedEntities as $entity) {\n            $content .= $this->getPadding().'<block type=\"'.$namespace.'_'.$module.'/'.\n                $entityName.'_'.strtolower($entity->getNameSingular()).'_list\" name=\"'.$entityName.\n                '.'.strtolower($entity->getNameSingular()).'_list\" as=\"'.$entityName.'_'.\n                strtolower($entity->getNamePlural()).'\" template=\"'.$namespace.'_'.$module.'/'.$entityName.'/'.\n                strtolower($entity->getNameSingular()).'/list.phtml\" />'.$eol.$this->getPadding(2);\n        }\n        if ($this->getAllowComment()) {\n            $content .= $this->getPadding().'<block type=\"'.\n                $namespace.'_'.$module.'/'.$entityName.'_comment_list\" name=\"'.\n                $entityName.'.comments_list\" as=\"'.$entityName.'_comment_list\" template=\"'.$namespace.'_'.$module.'/'.\n                $entityName.'/comment/list.phtml\">'.$eol.$this->getPadding(2);\n            $content .= $this->getPadding(2).\n                '<block type=\"'.$namespace.'_'.$module.'/'.$entityName.\n                '_comment_form\" name=\"comment_form\" as=\"comment_form\" template=\"'.\n                $namespace.'_'.$module.'/'.$entityName.'/comment/form.phtml\" />'.$eol.$this->getPadding(2);\n            $content .= $this->getPadding().'</block>'.$eol.$this->getPadding(2);\n        }\n        return $content;\n    }\n\n    /**\n     * get html link to entity\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHtmlLink()\n    {\n        $eol        = $this->getEol();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($this->getNameSingular());\n        $nameCode   = $this->getNameAttributeMagicCode();\n        $content    = '';\n        $padd       = 3;\n        if ($this->getCreateView()) {\n            $padd = 4;\n            $content .= $this->getPadding(3).'<a href=\"<?php echo $_'.$entity.'->get'.$entityUc.'Url()?>\">'.$eol;\n        }\n        $content .= $this->getPadding($padd).'<?php echo $_'.$entity.'->get'.$nameCode.'();?>'.$eol;\n        if ($this->getCreateView()) {\n            $content .= $this->getPadding(3).'</a>';\n        }\n        $content .= '<br />';\n        return $content;\n    }\n\n    /**\n     * get the html for attributes in view page\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getViewAttributesHtml()\n    {\n        $eol     = $this->getEol();\n        $content = '';\n        foreach ($this->getAttributes() as $attribute) {\n            if ($attribute->getFrontend()) {\n                $content .= $this->getPadding().\n                    '<div class=\"'.$this->getNameSingular().'-'.$attribute->getCode().'\">'.$eol;\n                $content .= $this->getPadding(2).$attribute->getFrontendHtml().$eol;\n                $content .= $this->getPadding().'</div>'.$eol;\n            }\n        }\n        return $content;\n    }\n\n    /**\n     * check if comments should be split by store\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAllowCommentByStore()\n    {\n        return $this->getTypeInstance()->getAllowCommentByStore();\n    }\n\n    /**\n     * get view widget attributes\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getViewWidgetAttributesHtml()\n    {\n        $content = '';\n        $padding = $this->getPadding(3);\n        $tab     = $this->getPadding();\n        $eol     = $this->getEol();\n        foreach ($this->getAttributes() as $attribute) {\n            if ($attribute->getWidget()) {\n                $content .= $padding.'<div class=\"'.$attribute->getCode().'-widget\">'.\n                    $eol.$padding.$tab.$attribute->getFrontendHtml().$padding.'</div>'.$eol;\n            }\n        }\n        return $content;\n    }\n\n    /**\n     * get the system attributes\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSystemAttributes()\n    {\n        $position = 10;\n        $content = '';\n        $tab = $this->getPadding();\n        $eol = $this->getEol();\n        $padding = str_repeat($tab, 6);\n        if ($this->getCreateFrontend()) {\n            $content .= $padding.'<breadcrumbs translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Use Breadcrumbs</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>select</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<source_model>adminhtml/system_config_source_yesno</source_model>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.'</breadcrumbs>'.$eol;\n            $position += 10;\n        }\n        if ($this->getUrlRewrite()) {\n            $content .= $padding.'<url_rewrite_list translate=\"label comment\">'.$eol;\n            $content .= $padding.$tab.'<label>URL key for list page</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>text</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.$tab.'<comment>Leave empty to use default URL module/controller/action</comment>'.$eol;\n            $content .= $padding.'</url_rewrite_list>'.$eol;\n            $position += 10;\n\n\n            $content .= $padding.'<url_prefix translate=\"label comment\">'.$eol;\n            $content .= $padding.$tab.'<label>URL prefix</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>text</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.$tab.'<comment>Leave empty for no prefix</comment>'.$eol;\n            $content .= $padding.'</url_prefix>'.$eol;\n            $position += 10;\n\n            $content .= $padding.'<url_suffix translate=\"label comment\">'.$eol;\n            $content .= $padding.$tab.'<label>Url suffix</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>text</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.$tab.'<comment>What goes after the dot. Leave empty for no suffix.</comment>'.$eol;\n            $content .= $padding.'</url_suffix>'.$eol;\n            $position += 10;\n        }\n        if ($this->getAllowComment()) {\n            $content .= $padding.'<allow_comment translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Allow comments</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>select</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<source_model>adminhtml/system_config_source_yesno</source_model>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.'</allow_comment>'.$eol;\n            $position += 10;\n\n            $content .= $padding.'<allow_guest_comment translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Allow guest comments</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>select</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<source_model>adminhtml/system_config_source_yesno</source_model>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.$tab.'<depends>'.$eol;\n            $content .= $padding.$tab.$tab.'<allow_comment>1</allow_comment>'.$eol;\n            $content .= $padding.$tab.'</depends>'.$eol;\n            $content .= $padding.'</allow_guest_comment>'.$eol;\n            $position += 10;\n        }\n        if ($this->getRss()) {\n            $content .= $padding.'<rss translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Enable rss</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>select</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<source_model>adminhtml/system_config_source_yesno</source_model>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.'</rss>'.$eol;\n            $position += 10;\n        }\n        if ($this->getIsTree() && $this->getCreateList()) {\n            $content .= $padding.'<tree translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Display as tree</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>select</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<source_model>adminhtml/system_config_source_yesno</source_model>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.'</tree>'.$eol;\n            $position += 10;\n        }\n        if ($this->getIsTree() && ($this->getCreateList() || $this->getWidget())) {\n            $content .= $padding.'<recursion translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Recursion level</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>text</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.'</recursion>'.$eol;\n            $position += 10;\n        }\n\n        if ($this->getAddSeo() && $this->getCreateList()) {\n            $content .= $padding.'<meta_title translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Meta title for '.\n                strtolower($this->getLabelPlural()).' list page</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>text</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.'</meta_title>'.$eol;\n            $position += 10;\n\n            $content .= $padding.'<meta_description translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Meta description for '.\n                strtolower($this->getLabelPlural()).' list page</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>textarea</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.'</meta_description>'.$eol;\n            $position += 10;\n\n            $content .= $padding.'<meta_keywords translate=\"label\">'.$eol;\n            $content .= $padding.$tab.'<label>Meta keywords for '.\n                strtolower($this->getLabelPlural()).' list page</label>'.$eol;\n            $content .= $padding.$tab.'<frontend_type>textarea</frontend_type>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.$position.'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<show_in_default>1</show_in_default>'.$eol;\n            $content .= $padding.$tab.'<show_in_website>1</show_in_website>'.$eol;\n            $content .= $padding.$tab.'<show_in_store>1</show_in_store>'.$eol;\n            $content .= $padding.'</meta_keywords>'.$eol;\n        }\n        return substr($content, 0, strlen($content) - strlen($eol));\n    }\n\n    /**\n     * get additional api xml\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiAdditional()\n    {\n        $content  = $this->getApiTree();\n        $content .= $this->getTypeInstance()->getApiAdditional();\n        $content .= $this->getApiRelations();\n        return $content;\n    }\n\n    /**\n     * get additional api xml for tree entities\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiTree()\n    {\n        $content    = '';\n        $padding    = $this->getPadding();\n        $prefix     = str_repeat($padding, 5);\n        $eol        = $this->getEol();\n        $extension  = $this->getModule()->getExtensionName(true);\n        if ($this->getIsTree()) {\n            $module         = $this->getModule()->getLowerModuleName();\n            $entity         = $this->getNameSingular(true);\n            $entityLabel    = strtolower($this->getLabelSingular());\n            $entitiesLabel  = strtolower($this->getLabelPlural());\n            $content  = $prefix.'<level translate=\"title\" module=\"'.$extension.'\">'.$eol;\n            $content .= $prefix.$padding.'<title>Retrieve one level of '.$entitiesLabel.'</title>'.$eol;\n            $content .= $prefix.$padding.'<acl>'.$module.'/'.$entity.'/info</acl>'.$eol;\n            $content .= $prefix.'</level>'.$eol;\n            $content .= $prefix.'<move translate=\"title\" module=\"'.$extension.'\">'.$eol;\n            $content .= $prefix.$padding.'<title>Move '.$entityLabel.' in tree</title>'.$eol;\n            $content .= $prefix.$padding.'<acl>'.$module.'/'.$entity.'/move</acl>'.$eol;\n            $content .= $prefix.'</move>'.$eol;\n        }\n        return $content;\n    }\n\n    /**\n     * get api relations for a section\n     *\n     * @access public\n     * @param $relatedCode\n     * @param $relatedLabel\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiRelationsSection($relatedCode, $relatedLabel)\n    {\n        $eol            = $this->getEol();\n        $padding        = $this->getPadding();\n        $prefix         = $this->getPadding(5);\n        $module         = $this->getModule()->getLowerModuleName();\n        $entity         = $this->getNameSingular(true);\n        $entityLabelUc  = ucfirst($this->getLabelSingular());\n        $entityLabel    = strtolower($this->getLabelSingular());\n        $extension      = $this->getModule()->getExtensionName(true);\n\n        $string  = '';\n        $string .= $prefix. '<assign'.$relatedCode.' translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $string .= $prefix.$padding. '<title>Assign '.$relatedLabel.' to '.$entityLabelUc.'</title>'.$eol;\n        $string .= $prefix.$padding. '<acl>'.$module.'/'.$entity.'/update</acl>'.$eol;\n        $string .= $prefix. '</assign'.$relatedCode.'>'.$eol;\n\n        $string .= $prefix. '<unassign'.$relatedCode.' translate=\"title\" module=\"'.$extension.'\">'.$eol;\n        $string .= $prefix.$padding. '<title>Remove '.$relatedLabel.' from '.$entityLabel.'</title>'.$eol;\n        $string .= $prefix.$padding. '<acl>'.$module.'/'.$entity.'/update</acl>'.$eol;\n        $string .= $prefix. '</unassign'.$relatedCode.'>'.$eol;\n        return $string;\n    }\n\n    /**\n     * get API xml for entity relations\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiRelations()\n    {\n        $string         = '';\n        if ($this->getLinkProduct()) {\n            $string .= $this->getApiRelationsSection('Product', 'product');\n        }\n        if ($this->getLinkCategory()) {\n            $string .= $this->getApiRelationsSection('Category', 'category');\n        }\n        $siblings = $this->getRelatedEntities(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING);\n        foreach ($siblings as $sibling) {\n            $siblingNameUc   = ucfirst($sibling->getNameSingular());\n            $siblingLabel    = strtolower($sibling->getLabelSingular());\n            $string         .= $this->getApiRelationsSection($siblingNameUc, $siblingLabel);\n        }\n        $string .= $this->getPadding(4);\n        return $string;\n    }\n\n    /**\n     * get API faults for a section\n     *\n     * @access public\n     * @param $relatedCode\n     * @param $relatedLabel\n     * @param $code\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiFaultsSection($relatedCode, $relatedLabel, $code)\n    {\n        $padding        = $this->getPadding();\n        $prefix         = str_repeat($padding, 5);\n        $eol            = $this->getEol();\n        $string         = '';\n        $string        .= $prefix.'<'.$relatedCode.'_not_exists>'.$eol;\n        $string        .= $prefix.$padding.'<code>'.$code.'</code>'.$eol;\n        $string        .= $prefix.$padding.'<message>'.$relatedLabel.' does not exist.</message>'.$eol;\n        $string        .= $prefix.'</'.$relatedCode.'_not_exists>'.$eol;\n\n        return $string;\n    }\n\n    /**\n     * get list of faults for API\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiFaults()\n    {\n        $string         = '';\n        $padding        = $this->getPadding();\n        $prefix         = str_repeat($padding, 5);\n        $eol            = $this->getEol();\n        $code           = 105;\n        $entity         = $this->getNameSingular(true);\n        $entityLabelUc  = ucfirst($this->getLabelSingular());\n        if ($this->getIsTree()) {\n            $string .= $prefix.'<not_moved>'.$eol;\n            $string .= $prefix.$padding.'<code>'.$code.'</code>'.$eol;\n            $string .= $prefix.$padding.'<message>'.\n                $entityLabelUc.' not moved. Details in error message.</message>'.$eol;\n            $string .= $prefix.'</not_moved>'.$eol;\n            $code++;\n        }\n        if ($this->getLinkProduct()) {\n            $string .= $this->getApiFaultsSection('product', 'Product', $code);\n            $code++;\n        }\n        if ($this->getLinkCategory()) {\n            $string .= $this->getApiFaultsSection('category', 'Category', $code);\n            $code++;\n        }\n        $siblings = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        foreach ($siblings as $sibling) {\n            $siblingName     = $sibling->getNameSingular(true);\n            $siblingLabelUc  = ucfirst($sibling->getLabelSingular());\n\n            $string .= $this->getApiFaultsSection($entity.'_'.$siblingName, $siblingLabelUc, $code);\n            $code++;\n        }\n        $string .= $this->getTypeInstance()->getApiFaults();\n        $string .= str_repeat($padding, 4);\n        return $string;\n    }\n\n    /**\n     * get additional api acl\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalApiAcl()\n    {\n        $content    = '';\n        $padding    = $this->getPadding();\n        $prefix     = str_repeat($padding, 6);\n        $eol        = $this->getEol();\n        $extension  = $this->getModule()->getExtensionName(true);\n        if ($this->getIsTree()) {\n            $content       .= $prefix.'<move translate=\"title\" module=\"'.$extension.'\">'.$eol;\n            $content       .= $prefix.$padding.'<title>Move</title>'.$eol;\n            $content       .= $prefix.'</move>'.$eol;\n        }\n        $content .= str_repeat($padding, 5);\n        return $content;\n    }\n\n    /**\n     * get attributes format for wsdl\n     *\n     * @access public\n     * @param bool $wsi\n     * @param bool $forAdd\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlAttributes($wsi = false, $forAdd = false)\n    {\n        $parents    = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD\n        );\n        $tab        = $this->getPadding();\n        $padding    = str_repeat($tab, 5);\n        $eol        = $this->getEol();\n        $content    = '';\n        foreach ($parents as $parent) {\n            /** @var Ultimate_ModuleCreator_Model_Attribute $attr */\n            $attr = Mage::getModel('modulecreator/attribute');\n            $attr->setCode($parent->getNameSingular().'_id');\n            $attr->setLabel($parent->getLabelSingular());\n            $attr->setType('int');\n            $content .= $padding.$attr->getWsdlFormat($wsi).$eol;\n        }\n        foreach ($this->getAttributes() as $attribute) {\n            $content .= $padding.$attribute->getWsdlFormat($wsi).$eol;\n        }\n        $simulated = $this->getSimulatedAttributes(null, false);\n        foreach ($simulated as $attr) {\n            if (!$forAdd || !$attr->getIgnoreApi()) {\n                $content .= $padding.$attr->getWsdlFormat($wsi).$eol;\n            }\n        }\n        $content .= $this->getTypeInstance()->getWsdlAttributes($wsi);\n        return $content;\n    }\n\n    /**\n     * get attributes format for wsi\n     *\n     * @access public\n     * @param bool $forAdd\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiAttributes($forAdd = false)\n    {\n        return $this->getWsdlAttributes(true, $forAdd);\n    }\n\n    /**\n     * get wsdl relation type for a section\n     *\n     * @param $relatedCode\n     * @param $relatedId\n     * @param bool $wsi\n     * @return string\n     */\n    public function getWsdlRelationTypesSection($relatedCode, $relatedId, $wsi = false)\n    {\n        $content    = '';\n        $tab        = $this->getPadding();\n        $padding    = str_repeat($tab, 3);\n        $mainTag    = ($wsi) ? 'xsd:complexType':'complexType';\n        $subtag     = ($wsi) ? 'xsd:sequence' : 'all';\n        $element    = ($wsi) ? 'xsd:element' : 'element';\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($this->getNameSingular());\n\n        $content .= $padding.'<'.$mainTag .' name=\"'.$module.$entityUc.'Assign'.$relatedCode.'Entity\">'.$eol;\n        $content .= $padding.$tab.'<'.$subtag.'>'.$eol;\n        $content .= $padding.$tab.'<'.$element.' name=\"'.$entity.'Id\" type=\"xsd:string\"'.\n            ((!$wsi)?' minOccurs=\"1\"':'').' />'.$eol;\n        $content .= $padding.$tab.'<'.$element.' name=\"'.$relatedId.'Id\" type=\"xsd:string\"'.\n            ((!$wsi)?' minOccurs=\"1\"':'').' />'.$eol;\n        $content .= $padding.$tab.'<'.$element.' name=\"position\" type=\"xsd:string\"'.\n            ((!$wsi)?' minOccurs=\"0\"':'').' />'.$eol;\n        $content .= $padding.$tab.'</'.$subtag.'>'.$eol;\n        $content .= $padding.'</'.$mainTag.'>'.$eol;\n\n        $content .= $padding.'<'.$mainTag .' name=\"'.$module.$entityUc.'Unassign'.$relatedCode.'Entity\">'.$eol;\n        $content .= $padding.$tab.'<'.$subtag.'>'.$eol;\n        $content .= $padding.$tab.'<'.$element.' name=\"'.\n            $entity.'Id\" type=\"xsd:string\"'.((!$wsi)?' minOccurs=\"1\"':'').' />'.$eol;\n        $content .= $padding.$tab.'<'.$element.' name=\"'.\n            $relatedId.'Id\" type=\"xsd:string\"'.((!$wsi)?' minOccurs=\"1\"':'').' />'.$eol;\n        $content .= $padding.$tab.'</'.$subtag.'>'.$eol;\n        $content .= $padding.'</'.$mainTag.'>'.$eol;\n\n        return $content;\n    }\n\n    /**\n     * get entity WSDL relation types\n     *\n     * @access public\n     * @param bool $wsi\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlRelationTypes($wsi = false)\n    {\n        $content    = '';\n        $tab        = $this->getPadding();\n        $padding    = str_repeat($tab, 3);\n        $mainTag    = ($wsi) ? 'xsd:complexType':'complexType';\n        $subtag     = ($wsi) ? 'xsd:sequence' : 'all';\n        $element    = ($wsi) ? 'xsd:element' : 'element';\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($this->getNameSingular());\n        if ($this->getIsTree()) {\n            $content .= $padding.'<'.$mainTag .' name=\"'.$module.$entityUc.'MoveEntity\">'.$eol;\n            $content .= $padding.$tab.'<'.$subtag.'>'.$eol;\n            $content .= $padding.$tab.'<'.$element.\n                ' name=\"'.$entity.'_id\" type=\"xsd:string\"'.((!$wsi)?' minOccurs=\"1\"':'').' />'.$eol;\n            $content .= $padding.$tab.'<'.$element.\n                ' name=\"parent_id\" type=\"xsd:string\"'.((!$wsi)?' minOccurs=\"1\"':'').' />'.$eol;\n            $content .= $padding.$tab.'<'.$element.\n                ' name=\"after_id\" type=\"xsd:string\"'.((!$wsi)?' minOccurs=\"0\"':'').' />'.$eol;\n            $content .= $padding.$tab.'</'.$subtag.'>'.$eol;\n            $content .= $padding.'</'.$mainTag.'>'.$eol;\n        }\n        if ($this->getLinkProduct()) {\n            $content .= $this->getWsdlRelationTypesSection('Product', 'product', $wsi);\n        }\n        if ($this->getLinkCategory()) {\n            $content .= $this->getWsdlRelationTypesSection('Category', 'category', $wsi);\n        }\n        $siblings = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        foreach ($siblings as $sibling) {\n            $siblingName     = $sibling->getNameSingular(true);\n            $siblingNameUc   = ucfirst($sibling->getNameSingular());\n            $content .= $this->getWsdlRelationTypesSection($siblingNameUc, $siblingName, $wsi);\n\n        }\n        $content .= $tab.$tab;\n        return $content;\n    }\n\n    /**\n     * get entity WSI relation types\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiRelationTypes()\n    {\n        return $this->getWsdlRelationTypes(true);\n    }\n\n    /**\n     * get wsdl port type relations for a section\n     *\n     * @access public\n     * @param $relatedLabel\n     * @param $relatedText\n     * @param $wsi\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlPortTypeRelationSection($relatedLabel, $relatedText, $wsi)\n    {\n        $content    = '';\n        $tab        = $this->getPadding();\n        $padding    = $tab.$tab;\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entityUc   = ucfirst($this->getNameSingular());\n        $label      = strtolower($this->escapeText($this->getLabelSingular()));\n        $tagPrefix  = ($wsi) ? 'wsdl:':'';\n\n        $content .= $padding.'<'.$tagPrefix.'operation name=\"'.$module.$entityUc.'Assign'.$relatedLabel.'\">'.$eol;\n        $content .= $padding.$tab.'<'.$tagPrefix.'documentation>Assign '.\n            $relatedText.' to '.$label.'</'.$tagPrefix.'documentation>'.$eol;\n        $content .= $padding.$tab.'<'.$tagPrefix.'input message=\"typens:'.\n            $module.$entityUc.'Assign'.$relatedLabel.'Request\" />'.$eol;\n        $content .= $padding.$tab.'<'.$tagPrefix.'output message=\"typens:'.\n            $module.$entityUc.'Assign'.$relatedLabel.'Response\" />'.$eol;\n        $content .= $padding.'</'.$tagPrefix.'operation>'.$eol;\n        $content .= $padding.'<'.$tagPrefix.'operation name=\"'.$module.$entityUc.'Unassign'.$relatedLabel.'\">'.$eol;\n        $content .= $padding.$tab.'<'.$tagPrefix.'documentation>Remove '.\n            $relatedText.' from '.$label.'</'.$tagPrefix.'documentation>'.$eol;\n        $content .= $padding.$tab.'<'.$tagPrefix.'input message=\"typens:'.\n            $module.$entityUc.'Unassign'.$relatedLabel.'Request\" />'.$eol;\n        $content .= $padding.$tab.'<'.$tagPrefix.'output message=\"typens:'.\n            $module.$entityUc.'Unassign'.$relatedLabel.'Response\" />'.$eol;\n        $content .= $padding.'</'.$tagPrefix.'operation>'.$eol;\n\n        return $content;\n    }\n\n    /**\n     * get entity WSDL port type for relations\n     *\n     * @access public\n     * @param bool $wsi\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlPortTypeRelation($wsi = false)\n    {\n        $content    = '';\n        $tab        = $this->getPadding();\n        $padding    = $tab.$tab;\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($entity);\n        $label      = strtolower($this->escapeText($this->getLabelSingular()));\n\n        $tagPrefix = ($wsi) ? 'wsdl:':'';\n\n        if ($this->getIsTree()) {\n            $content .= $padding.'<'.$tagPrefix.'operation name=\"'.$module.$entityUc.'Move\">'.$eol;\n            $content .= $padding.$tab.'<'.$tagPrefix.'documentation>Move '.$label.\n                ' in tree</'.$tagPrefix.'documentation>'.$eol;\n            $content .= $padding.$tab.'<'.$tagPrefix.'input message=\"typens:'.$module.$entityUc.'MoveRequest\" />'.$eol;\n            $content .= $padding.$tab.'<'.$tagPrefix.'output message=\"typens:'.\n                $module.$entityUc.'MoveResponse\" />'.$eol;\n            $content .= $padding.'</'.$tagPrefix.'operation>'.$eol;\n\n        }\n\n        if ($this->getLinkProduct()) {\n            $content .= $this->getWsdlPortTypeRelationSection('Product', 'product', $wsi);\n        }\n\n        if ($this->getLinkCategory()) {\n            $content .= $this->getWsdlPortTypeRelationSection('Category', 'category', $wsi);\n        }\n        $siblings = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        foreach ($siblings as $sibling) {\n            $siblingNameUc   = ucfirst($sibling->getNameSingular());\n            $siblingLabel    = strtolower($sibling->getLabelSingular());\n\n            $content .= $this->getWsdlPortTypeRelationSection($siblingNameUc, $siblingLabel, $wsi);\n\n        }\n        $content .= $tab;\n        return $content;\n    }\n\n    /**\n     * get entity WSI port type for relations\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiPortTypeRelation()\n    {\n        return $this->getWsdlPortTypeRelation(true);\n    }\n\n    /**\n     * get wsld relation binding for a section\n     *\n     * @access public\n     * @param $sectionName\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlRelationBindingSection($sectionName)\n    {\n        $content     = '';\n        $tab        = $this->getPadding();\n        $doubleTab  = $tab.$tab;\n        $padding    = $doubleTab;\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($entity);\n\n        $content .= $padding.'<operation name=\"'.$module.$entityUc.$sectionName.'\">'.$eol;\n        $content .= $padding.$tab.'<soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />'.$eol;\n        $content .= $padding.$tab.'<input>'.$eol;\n        $content .= $padding.$doubleTab.\n            '<soap:body namespace=\"urn:{{var wsdl.name}}\"'.\n            ' use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />'.\n            $eol;\n        $content .= $padding.$tab.'</input>'.$eol;\n        $content .= $padding.$tab.'<output>'.$eol;\n        $content .= $padding.$doubleTab.\n            '<soap:body namespace=\"urn:{{var wsdl.name}}\"'.\n            ' use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />'.\n            $eol;\n        $content .= $padding.$tab.'</output>'.$eol;\n        $content .= $padding.'</operation>'.$eol;\n        return $content;\n    }\n\n    /**\n     * get WSDL relation binding\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlRelationBinding()\n    {\n        $content     = '';\n        if ($this->getIsTree()) {\n            $content .= $this->getWsdlRelationBindingSection('Move');\n        }\n        if ($this->getLinkProduct()) {\n            $content .= $this->getWsdlRelationBindingSection('AssignProduct');\n            $content .= $this->getWsdlRelationBindingSection('UnassignProduct');\n        }\n        if ($this->getLinkCategory()) {\n            $content .= $this->getWsdlRelationBindingSection('AssignCategory');\n            $content .= $this->getWsdlRelationBindingSection('UnassignCategory');\n        }\n\n        $siblings = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        foreach ($siblings as $sibling) {\n            $siblingName     = $sibling->getNameSingular(true);\n            $siblingNameUc   = ucfirst($siblingName);\n            $content .= $this->getWsdlRelationBindingSection('Assign'.$siblingNameUc);\n            $content .= $this->getWsdlRelationBindingSection('Unassign'.$siblingNameUc);\n        }\n        $content .= $this->getPadding();\n        return $content;\n    }\n\n    /**\n     * get wsld relation binding for a section\n     *\n     * @access public\n     * @param $sectionName\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiRelationBindingSection($sectionName)\n    {\n        $content     = '';\n        $tab        = $this->getPadding();\n        $doubleTab  = $tab.$tab;\n        $padding    = $doubleTab;\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($entity);\n\n        $content .= $padding.'<wsdl:operation name=\"'.$module.$entityUc.$sectionName.'\">'.$eol;\n        $content .= $padding.$tab.'<soap:operation soapAction=\"\" />'.$eol;\n        $content .= $padding.$tab.'<wsdl:input>'.$eol;\n        $content .= $padding.$doubleTab.'<soap:body use=\"literal\" />'.$eol;\n        $content .= $padding.$tab.'</wsdl:input>'.$eol;\n        $content .= $padding.$tab.'<wsdl:output>'.$eol;\n        $content .= $padding.$doubleTab.'<soap:body use=\"literal\" />'.$eol;\n        $content .= $padding.$tab.'</wsdl:output>'.$eol;\n        $content .= $padding.'</wsdl:operation>'.$eol;\n        return $content;\n    }\n\n    /**\n     * get WSI relation binding\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiRelationBinding()\n    {\n        $content     = '';\n        if ($this->getIsTree()) {\n            $content .= $this->getWsiRelationBindingSection('Move');\n        }\n        if ($this->getLinkProduct()) {\n            $content .= $this->getWsiRelationBindingSection('AssignProduct');\n            $content .= $this->getWsiRelationBindingSection('UnassignProduct');\n        }\n        if ($this->getLinkCategory()) {\n            $content .= $this->getWsiRelationBindingSection('AssignCategory');\n            $content .= $this->getWsiRelationBindingSection('UnassignCategory');\n        }\n\n        $siblings = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        foreach ($siblings as $sibling) {\n            $siblingName     = $sibling->getNameSingular(true);\n            $siblingNameUc   = ucfirst($siblingName);\n\n            $content .= $this->getWsiRelationBindingSection('Assign'.$siblingNameUc);\n            $content .= $this->getWsiRelationBindingSection('Unassign'.$siblingNameUc);\n        }\n        $content .= $this->getPadding();\n        return $content;\n    }\n\n    /**\n     * get wsi relation param types for a section\n     *\n     * @access public\n     * @param $sectionName\n     * @param $sectionParam\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiRelationParamTypesSection($sectionName, $sectionParam)\n    {\n        $content    = '';\n        $tab        = $this->getPadding();\n        $padding    = $this->getPadding(3);\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($entity);\n        $content .= $padding.'<xsd:element name=\"'.$module.$entityUc.'Assign'.$sectionName.'RequestParam\">'.$eol;\n        $content .= $padding.$tab.'<xsd:complexType>'.$eol;\n        $content .= $padding.str_repeat($tab, 2).'<xsd:sequence>'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"'.$entity.'Id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"'.$sectionParam.'Id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"position\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 2).'</xsd:sequence>'.$eol;\n        $content .= $padding.$tab.'</xsd:complexType>'.$eol;\n        $content .= $padding.'</xsd:element>'.$eol;\n\n        $content .= $padding.'<xsd:element name=\"'.$module.$entityUc.'Assign'.$sectionName.'ResponseParam\">'.$eol;\n        $content .= $padding.$tab.'<xsd:complexType>'.$eol;\n        $content .= $padding.str_repeat($tab, 2).'<xsd:sequence>'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:boolean\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 2).'</xsd:sequence>'.$eol;\n        $content .= $padding.$tab.'</xsd:complexType>'.$eol;\n        $content .= $padding.'</xsd:element>'.$eol;\n\n        $content .= $padding.'<xsd:element name=\"'.$module.$entityUc.'Unassign'.$sectionName.'RequestParam\">'.$eol;\n        $content .= $padding.$tab.'<xsd:complexType>'.$eol;\n        $content .= $padding.str_repeat($tab, 2).'<xsd:sequence>'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"'.$entity.'Id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"'.$sectionParam.'Id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 2).'</xsd:sequence>'.$eol;\n        $content .= $padding.$tab.'</xsd:complexType>'.$eol;\n        $content .= $padding.'</xsd:element>'.$eol;\n\n        $content .= $padding.'<xsd:element name=\"'.$module.$entityUc.'Unassign'.$sectionName.'ResponseParam\">'.$eol;\n        $content .= $padding.$tab.'<xsd:complexType>'.$eol;\n        $content .= $padding.str_repeat($tab, 2).'<xsd:sequence>'.$eol;\n        $content .= $padding.str_repeat($tab, 3).\n            '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:boolean\" />'.$eol;\n        $content .= $padding.str_repeat($tab, 2).'</xsd:sequence>'.$eol;\n        $content .= $padding.$tab.'</xsd:complexType>'.$eol;\n        $content .= $padding.'</xsd:element>'.$eol;\n\n        return $content;\n    }\n\n    /**\n     * get entity WSI relation param types\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiRelationParamTypes()\n    {\n        $content    = '';\n        $tab        = $this->getPadding();\n        $padding    = str_repeat($tab, 3);\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($entity);\n\n        if ($this->getIsTree()) {\n            $content .= $padding.'<xsd:element name=\"'.$module.$entityUc.'MoveRequestParam\">'.$eol;\n            $content .= $padding.$tab.'<xsd:complexType>'.$eol;\n            $content .= $padding.str_repeat($tab, 2).'<xsd:sequence>'.$eol;\n            $content .= $padding.str_repeat($tab, 3).\n                '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"session_id\" type=\"xsd:string\" />'.$eol;\n            $content .= $padding.str_repeat($tab, 3).\n                '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"'.$entity.'Id\" type=\"xsd:string\" />'.$eol;\n            $content .= $padding.str_repeat($tab, 3).\n                '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"parentId\" type=\"xsd:string\" />'.$eol;\n            $content .= $padding.str_repeat($tab, 3).\n                '<xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"afterId\" type=\"xsd:string\" />'.$eol;\n            $content .= $padding.str_repeat($tab, 2).'</xsd:sequence>'.$eol;\n            $content .= $padding.$tab.'</xsd:complexType>'.$eol;\n            $content .= $padding.'</xsd:element>'.$eol;\n\n            $content .= $padding.'<xsd:element name=\"'.$module.$entityUc.'AssignProductResponseParam\">'.$eol;\n            $content .= $padding.$tab.'<xsd:complexType>'.$eol;\n            $content .= $padding.str_repeat($tab, 2).'<xsd:sequence>'.$eol;\n            $content .= $padding.str_repeat($tab, 3).\n                '<xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:boolean\" />'.$eol;\n            $content .= $padding.str_repeat($tab, 2).'</xsd:sequence>'.$eol;\n            $content .= $padding.$tab.'</xsd:complexType>'.$eol;\n            $content .= $padding.'</xsd:element>'.$eol;\n        }\n\n        if ($this->getLinkProduct()) {\n            $content .= $this->getWsiRelationParamTypesSection('Product', 'product');\n        }\n\n        if ($this->getLinkCategory()) {\n            $content .= $this->getWsiRelationParamTypesSection('Category', 'category');\n        }\n\n        $siblings = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        foreach ($siblings as $sibling) {\n            $siblingName     = $sibling->getNameSingular(true);\n            $siblingNameUc   = ucfirst($siblingName);\n            $content .= $this->getWsiRelationParamTypesSection($siblingNameUc, $siblingName);\n        }\n        $content .= $tab.$tab;\n        return $content;\n    }\n\n    /**\n     * get wsi relation messaged for a section\n     *\n     * @param $sectionName\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiRelationMessagesSection($sectionName)\n    {\n        $content    = '';\n        $padding    = $this->getPadding();\n        $tab        = $padding;\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($entity);\n\n        $content .= $padding.'<wsdl:message name=\"'.$module.$entityUc.$sectionName.'Request\">'.$eol;\n        $content .= $padding.$tab.'<wsdl:part name=\"parameters\" element=\"typens:'.\n            $module.$entityUc.$sectionName.'RequestParam\" />'.$eol;\n        $content .= $padding.'</wsdl:message>'.$eol;\n        $content .= $padding.'<wsdl:message name=\"'.$module.$entityUc.$sectionName.'Response\">'.$eol;\n        $content .= $padding.$tab.'<wsdl:part name=\"parameters\" element=\"typens:'.\n            $module.$entityUc.$sectionName.'ResponseParam\" />'.$eol;\n        $content .= $padding.'</wsdl:message>'.$eol;\n\n        return $content;\n    }\n\n    /**\n     * get entity WSI relation messages\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsiRelationMessages()\n    {\n        $content     = '';\n        if ($this->getIsTree()) {\n            $content .= $this->getWsiRelationMessagesSection('Move');\n        }\n\n        if ($this->getLinkProduct()) {\n            $content .= $this->getWsiRelationMessagesSection('AssignProduct');\n            $content .= $this->getWsiRelationMessagesSection('UnassignProduct');\n        }\n\n        if ($this->getLinkCategory()) {\n            $content .= $this->getWsiRelationMessagesSection('AssignCategory');\n            $content .= $this->getWsiRelationMessagesSection('UnassignCategory');\n        }\n        $siblings = $this->getRelatedEntities(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING);\n        foreach ($siblings as $sibling) {\n            $siblingName     = $sibling->getNameSingular(true);\n            $siblingNameUc   = ucfirst($siblingName);\n\n            $content .= $this->getWsiRelationMessagesSection('Assign'.$siblingNameUc);\n            $content .= $this->getWsiRelationMessagesSection('Unassign'.$siblingNameUc);\n        }\n        return $content;\n    }\n\n    /**\n     * get wsdl messages for a section\n     *\n     * @param $sectionName\n     * @param $sectionParam\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlMessagesSection($sectionName, $sectionParam)\n    {\n        $content    = '';\n        $tab        = $this->getPadding();\n        $padding    = $tab.$tab;\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($entity);\n\n        $content .= $padding.'<message name=\"'.$module.$entityUc.'Assign'.$sectionName.'Request\">'.$eol;\n        $content .= $padding.$tab.'<part name=\"sessionId\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.$tab.'<part name=\"'.$entity.'_id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.$tab.'<part name=\"'.$sectionParam.'_id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.$tab.'<part name=\"position\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.'</message>'.$eol;\n        $content .= $padding.'<message name=\"'.$module.$entityUc.'Assign'.$sectionName.'Response\">'.$eol;\n        $content .= $padding.$tab.'<part name=\"result\" type=\"xsd:boolean\" />'.$eol;\n        $content .= $padding.'</message>'.$eol;\n        $content .= $padding.'<message name=\"'.$module.$entityUc.'Unassign'.$sectionName.'Request\">'.$eol;\n        $content .= $padding.$tab.'<part name=\"session_id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.$tab.'<part name=\"'.$entity.'_id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.$tab.'<part name=\"'.$sectionParam.'_id\" type=\"xsd:string\" />'.$eol;\n        $content .= $padding.'</message>'.$eol;\n        $content .= $padding.'<message name=\"'.$module.$entityUc.'Unassign'.$sectionName.'Response\">'.$eol;\n        $content .= $padding.$tab.'<part name=\"result\" type=\"xsd:boolean\" />'.$eol;\n        $content .= $padding.'</message>'.$eol;\n\n        return $content;\n    }\n\n    /**\n     * get entity WSDL messages for relations\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getWsdlMessages()\n    {\n        $content    = '';\n        $tab        = $this->getPadding();\n        $padding    = $tab.$tab;\n        $eol        = $this->getEol();\n        $module     = $this->getModule()->getLowerModuleName();\n        $entity     = $this->getNameSingular(true);\n        $entityUc   = ucfirst($entity);\n\n        if ($this->getIsTree()) {\n            $content .= $padding.'<message name=\"'.$module.$entityUc.'MoveRequest\">'.$eol;\n            $content .= $padding.$tab.'<part name=\"session_id\" type=\"xsd:string\" />'.$eol;\n            $content .= $padding.$tab.'<part name=\"'.$entity.'_id\" type=\"xsd:string\" />'.$eol;\n            $content .= $padding.$tab.'<part name=\"parent_id\" type=\"xsd:string\" />'.$eol;\n            $content .= $padding.$tab.'<part name=\"after_id\" type=\"xsd:string\" />'.$eol;\n            $content .= $padding.'</message>'.$eol;\n\n            $content .= $padding.'<message name=\"'.$module.$entityUc.'MoveResponse\">'.$eol;\n            $content .= $padding.$tab.'<part name=\"id\" type=\"xsd:boolean\"/>'.$eol;\n            $content .= $padding.'</message>'.$eol;\n        }\n        if ($this->getLinkProduct()) {\n            $content .= $this->getWsdlMessagesSection('Product', 'product');\n        }\n\n        if ($this->getLinkCategory()) {\n            $content .= $this->getWsdlMessagesSection('Category', 'category');\n        }\n\n        $siblings = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n        );\n        foreach ($siblings as $sibling) {\n            $siblingName     = $sibling->getNameSingular(true);\n            $siblingNameUc   = ucfirst($siblingName);\n\n            $content .= $this->getWsdlMessagesSection($siblingNameUc, $siblingName);\n        }\n        $content .= $tab;\n        return $content;\n    }\n    /**\n     * get foreign keys for sql (Ddl)\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getParentEntitiesFksDdl()\n    {\n        $padding    = $this->getPadding();\n        $eol        = $this->getEol();\n        $parents    = $this->getRelatedEntities(\n            Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD\n        );\n        $content    = '';\n\n        $module     = $this->getModule()->getLowerModuleName();\n        $namespace  = $this->getNamespace(true);\n        foreach ($parents as $parent) {\n            $parentName = $parent->getNameSingular(true);\n            $content .= $eol.$padding.\"->addIndex($\".\"this->getIdxName('\".\n                $namespace.'_'.$module.'/'.$parentName.\"', array('\".$parentName.\"_id')), array('\".\n                $parentName.\"_id'))\";\n        }\n        return $content;\n    }\n\n    /**\n     * get selected menu path\n     *\n     * @access public\n     * @param string $suffix\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSelectedMenuPath($suffix = '')\n    {\n        $path = $this->getModule()->getMenuParent();\n        if (!empty($path)) {\n            $path .= '/';\n        }\n        $path .= $this->getModule()->getExtensionName(true).'/';\n        $path .= $this->getNameSingular(true);\n\n        return $path . $suffix;\n    }\n\n    /**\n     * get attributes content for setup\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAttributesSetup()\n    {\n        return $this->getTypeInstance()->getAttributesSetup();\n    }\n\n    /**\n     * get parent class for the entity resource model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceModelParent()\n    {\n        return $this->getTypeInstance()->getResourceModelParent();\n    }\n\n    /**\n     * get parent class for the entity resource model\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceCollectionModelParent()\n    {\n        return $this->getTypeInstance()->getResourceCollectionModelParent();\n    }\n\n    /**\n     * get related entities relations table\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceRelationsTables()\n    {\n        return $this->getTypeInstance()->getResourceRelationsTables();\n    }\n\n    /**\n     * get related entities relations table declaration\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceRelationsTablesDeclare()\n    {\n        return $this->getTypeInstance()->getResourceRelationsTablesDeclare();\n    }\n\n    /**\n     * get admin layout content for index page\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdminIndexLayoutContent()\n    {\n        return $this->getTypeInstance()->getAdminIndexLayoutContent();\n    }\n\n    /**\n     * get the parent model class\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityParentModel()\n    {\n        return $this->getTypeInstance()->getEntityParentModel();\n    }\n\n    /**\n     * get entity table alias\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityTableAlias()\n    {\n        return $this->getTypeInstance()->getEntityTableAlias();\n    }\n\n    /**\n     * get additional prepare collection\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAdditionalPrepareCollection()\n    {\n        return $this->getTypeInstance()->getAdditionalPrepareCollection();\n    }\n\n    /**\n     * additional layout block for left section\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditLayoutLeft()\n    {\n        return $this->getTypeInstance()->getEditLayoutLeft();\n    }\n\n    /**\n     * additional layout block edit\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEditLayoutAdditional()\n    {\n        return $this->getTypeInstance()->getEditLayoutAdditional();\n    }\n\n    /**\n     * get the label for product attribute scope\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getProductAttributeScopeLabel()\n    {\n        return $this->_getScopeLabel($this->getProductAttributeScope());\n    }\n\n    /**\n     * get the label for category attribute scope\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCategoryAttributeScopeLabel()\n    {\n        return $this->_getScopeLabel($this->getCategoryAttributeScope());\n    }\n\n    /**\n     * get scope label for install scripts\n     *\n     * @param $value\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _getScopeLabel($value)\n    {\n        $values = array(\n            Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE =>\n                'Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE',\n            Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE =>\n                'Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE',\n            Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL =>\n                'Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL'\n        );\n        if (!isset($values[$value])) {\n            $value = Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL;\n        }\n        return $values[$value];\n    }\n\n    /**\n     * check if the entity is used as an attribute\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsAttribute()\n    {\n        return $this->getProductAttribute() || $this->getCategoryAttribute();\n    }\n\n    /**\n     * check if source model can be created\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCanCreateSourceModel()\n    {\n        return $this->getIsAttribute() || $this->getIsParent();\n    }\n\n    /**\n     * check if entity has children\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIsParent()\n    {\n        $children = $this->getRelatedEntities(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_PARENT);\n        return count($children) > 0;\n    }\n\n    /**\n     * get product attribute group\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getProductAttributeGroupLabel()\n    {\n        if ($this->getProductAttributeGroup()) {\n            return \"'group'             => '\".$this->getProductAttributeGroup().\"',\".\n                $this->getEol().$this->getPadding(2);\n        }\n        return '';\n    }\n    /**\n     * get category attribute group\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCategoryAttributeGroupLabel()\n    {\n        if ($this->getCategoryAttributeGroup()) {\n            return \"'group'             => '\".$this->getCategoryAttributeGroup().\n                \"',\".$this->getEol().$this->getPadding(2);\n        }\n        return '';\n    }\n\n    /**\n     * get param name for before save\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getBeforeSaveParam()\n    {\n        return $this->getTypeInstance()->getBeforeSaveParam();\n    }\n\n    /**\n     * entity attribute set string\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityAttributeSetId()\n    {\n        return $this->getTypeInstance()->getEntityAttributeSetId();\n    }\n\n    /**\n     * filter method name\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFilterMethod()\n    {\n        return $this->getTypeInstance()->getFilterMethod();\n    }\n\n    /**\n     * convert multiple select fields to strings\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMultipleSelectConvert()\n    {\n        return $this->getTypeInstance()->getMultipleSelectConvert();\n    }\n\n    /**\n     * check if the entity helper can be created\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCanCreateEntityHelper()\n    {\n        if ($this->getIsTree()) {\n            return true;\n        }\n        if ($this->getHasFile()) {\n            return true;\n        }\n        if ($this->getCreateFrontend()) {\n            return true;\n        }\n        return $this->getTypeInstance()->getCanCreateEntityHelper();\n    }\n\n    /**\n     * get additional code for toOptionArray()\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getToOptionAddition()\n    {\n        return $this->getTypeInstance()->getToOptionAddition();\n    }\n\n    /**\n     * check if entity should be included in the category menu\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getShowInCategoryMenu()\n    {\n        return $this->getListMenu() ==\n            Ultimate_ModuleCreator_Model_Source_Entity_Menu::CATEGORY_MENU;\n    }\n\n    /**\n     * get multiselect methods\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMultiselectMethods()\n    {\n        $content = '';\n        $padding = $this->getPadding();\n        $tab     = $this->getPadding();\n        $eol     = $this->getEol();\n        foreach ($this->getAttributes() as $attribute) {\n            $magicCode = $attribute->getMagicMethodCode();\n            $code      = $attribute->getCode();\n            if ($attribute->getTypeInstance() instanceof Ultimate_ModuleCreator_Model_Attribute_Type_Multiselect) {\n                $content .= $eol.$padding.'/**'.$eol;\n                $content .= $padding.'  * get '.$attribute->getLabel().$eol;\n                $content .= $padding.'  *'.$eol;\n                $content .= $padding.'  * @access public'.$eol;\n                $content .= $padding.'  * @return array'.$eol;\n                $content .= $padding.'  * '.$this->getModule()->getQwertyuiop().$eol;\n                $content .= $padding.'  */'.$eol;\n                $content .= $padding.'public function get'.$magicCode.'()'.$eol;\n                $content .= $padding.'{'.$eol;\n                $content .= $padding.$tab.'if (!$this->getData(\\''.$code.'\\')) {'.$eol;\n                $content .= $padding.$tab.$tab.'return explode(\\',\\', $this->getData(\\''.$code.'\\'));'.$eol;\n                $content .= $padding.$tab.'}'.$eol;\n                $content .= $padding.$tab.'return $this->getData(\\''.$code.'\\');'.$eol;\n                $content .= $padding.'}';\n            }\n        }\n        return $content;\n    }\n\n    /**\n     * get html for displaying the name\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameHtml()\n    {\n        $content = '';\n        $lower   = $this->getNameSingular(true);\n        $ucFirst = ucfirst($lower);\n        $name    = $this->getNameAttributeMagicCode();\n        if ($this->getCreateView()) {\n            $content .= '\\'<a href=\"\\'.$'.$lower.'->get'.$ucFirst.'Url().\\'\">\\'.$'.$lower.'->get'.$name.'().\\'</a>\\'';\n        } else {\n            $content .= '\\'<a href=\"#\">\\'.$'.$lower.'->get'.$name.'().\\'</a>\\'';\n        }\n        return $content;\n    }\n\n    /**\n     * check if the entity is not store related\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNoStore()\n    {\n        return !$this->getStore();\n    }\n\n    /**\n     * get comment name field filter index\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCommentFilterIndexPrefix()\n    {\n        return $this->getTypeInstance()->getCommentFilterIndexPrefix();\n    }\n\n    /**\n     * additional API subentities.\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiAdditionalSettings()\n    {\n        $content = '';\n\n        if ($this->getAllowComment()) {\n            $padding  = $this->getPadding(3);\n            $tab      = $this->getPadding();\n            $module   = $this->getModule()->getLowerModuleName();\n            $entity   = $this->getNameSingular(true);\n            $eol      = $this->getEol();\n            $title    = $this->getLabelSingular().' Comments';\n            $ns       = $this->getNamespace(true);\n\n            $content .= $eol;\n            $content .= $padding.'<'.$module.'_'.$entity.'_comment translate=\"title\" module=\"'.\n                $ns.'_'.$module.'\">'.$eol;\n            $content .= $padding.$tab.'<title>'.$title.'</title>'.$eol;\n            $content .= $padding.$tab.'<model>'.$ns.'_'.$module.'/'.$entity.'_comment_api</model>'.$eol;\n            $content .= $padding.$tab.'<acl>'.$module.'/'.$entity.'/comment</acl>'.$eol;\n            $content .= $padding.$tab.'<methods>'.$eol;\n            $content .= $padding.$tab.$tab.'<list translate=\"title\" module=\"'.$ns.'_'.$module.'\">'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<title>Retrieve '.$title.'</title>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<method>items</method>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_comment/list</acl>'.$eol;\n            $content .= $padding.$tab.$tab.'</list>'.$eol;\n            $content .= $padding.$tab.$tab.'<updateStatus translate=\"title\" module=\"'.$ns.'_'.$module.'\">'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<title>Update '.$this->getLabelSingular().' Status</title>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<method>updateStatus</method>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<acl>'.$module.'/'.$entity.'_comment/updateStatus</acl>'.$eol;\n            $content .= $padding.$tab.$tab.'</updateStatus>'.$eol;\n            $content .= $padding.$tab.'</methods>'.$eol;\n            $content .= $padding.$tab.'<faults module=\"'.$ns.'_'.$module.'\">'.$eol;\n            $content .= $padding.$tab.$tab.'<not_exists>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<code>101</code>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<message>Requested comment not found.</message>'.$eol;\n            $content .= $padding.$tab.$tab.'</not_exists>'.$eol;\n            $content .= $padding.$tab.'</faults>'.$eol;\n            $content .= $padding.'</'.$module.'_'.$entity.'_comment>'.$eol;\n        }\n        $content .= $this->getTypeInstance()->getApiAdditionalSettings();\n        return $content;\n    }\n\n    /**\n     * get subentities acl\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSubEntitiesAcl()\n    {\n        $content = '';\n        if ($this->getAllowComment()) {\n            $padding  = $this->getPadding(5);\n            $tab      = $this->getPadding();\n            $module   = $this->getModule()->getLowerModuleName();\n            $entity   = $this->getNameSingular(true);\n            $eol      = $this->getEol();\n            $title    = $this->getLabelSingular().' Comments';\n            $content .= $eol;\n            $ns       = $this->getModule()->getNamespace(true);\n\n            $content .= $padding.'<'.$entity.'_comment translate=\"title\" module=\"'.$ns.'_'.$module.'\">'.$eol;\n            $content .= $padding.$tab.'<title>'.$title.'</title>'.$eol;\n            $content .= $padding.$tab.'<sort_order>'.($this->getPosition() + 3).'</sort_order>'.$eol;\n            $content .= $padding.$tab.'<list translate=\"title\" module=\"'.$ns.'_'.$module.'\">'.$eol;\n            $content .= $padding.$tab.$tab.'<title>List</title>'.$eol;\n            $content .= $padding.$tab.'</list>'.$eol;\n            $content .= $padding.$tab.'<updateStatus translate=\"title\" module=\"'.$ns.'_'.$module.'\">'.$eol;\n            $content .= $padding.$tab.$tab.'<title>Update Status</title>'.$eol;\n            $content .= $padding.$tab.'</updateStatus>'.$eol;\n            $content .= $padding.'</'.$entity.'_comment>'.$eol;\n        }\n        $content .= $this->getTypeInstance()->getSubEntitiesAcl();\n        return $content;\n    }\n\n    /**\n     * get api aliases\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiResourcesAlias()\n    {\n        $content = '';\n        if ($this->getAllowComment()) {\n            $padding  = $this->getPadding(3);\n            $module   = $this->getModule()->getLowerModuleName();\n            $entity   = $this->getNameSingular(true);\n            $eol      = $this->getEol();\n            $content .= $eol;\n            $content .= $padding.'<'.$entity.'_comment>'.$module.'_'.$entity.'_comment</'.$entity.'_comment>';\n        }\n        $content .= $this->getTypeInstance()->getApiResourcesAlias();\n        return $content;\n    }\n\n    /**\n     * get api V2 aliases\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getApiResourcesAliasV2()\n    {\n        $content = '';\n        if ($this->getAllowComment()) {\n            $padding  = $this->getPadding(4);\n            $module   = $this->getModule()->getLowerModuleName();\n            $entity   = strtolower($this->getNameSingular());\n            $eol      = $this->getEol();\n            $content .= $eol;\n            $content .= $padding.'<'.$entity.'_comment>'.$module.ucfirst($entity).'Comment</'.$entity.'_comment>';\n        }\n        $content .= $this->getTypeInstance()->getApiResourcesAliasV2();\n        return $content;\n    }\n\n    /**\n     * get default api attributes\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultApiAttributes()\n    {\n        return $this->getTypeInstance()->getDefaultApiAttributes();\n    }\n\n    /**\n     * get the module namespace\n     *\n     * @access public\n     * @param bool $lower\n     * @return mixed|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNamespace($lower = false)\n    {\n        return $this->getModule()->getNamespace($lower);\n    }\n\n    /**\n     * get entity name\n     *\n     * @access public\n     * @param bool $lower\n     * @return mixed|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNameSingular($lower = false)\n    {\n        $name = $this->getData('name_singular');\n        if ($lower) {\n            $name = strtolower($name);\n        }\n        return $name;\n    }\n\n    /**\n     * get code that filters dates\n     *\n     * @access public\n     * @param int $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFilterDates($padding = 4)\n    {\n        $dateAttributes = array();\n        foreach ($this->getAttributes() as $attribute) {\n            if ($attribute->getTypeInstance() instanceof\n                Ultimate_ModuleCreator_Model_Attribute_Type_Timestamp) {\n                $dateAttributes[] = $attribute->getCode();\n            }\n        }\n        if (count($dateAttributes) == 0) {\n            return '';\n        }\n        return $this->getEol().$this->getPadding($padding).\n            '$data = $this->_filterDates($data, array(\\''.implode(\"' ,'\", $dateAttributes).'\\'));';\n    }\n\n    /**\n     * get add all attributes to collection\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAllAttributesToCollection()\n    {\n        return $this->getTypeInstance()->getAllAttributesToCollection();\n    }\n\n    /**\n     * get load store id statement\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLoadStoreId()\n    {\n        return $this->getTypeInstance()->getLoadStoreId();\n    }\n\n    /**\n     * get rest resource group\n     *\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestResourceGroup($padding)\n    {\n        $content = '';\n        $eol = $this->getEol();\n        if ($this->getRest()) {\n            $ns       = $this->getNamespace(true);\n            $md       = $this->getModule()->getLowerModuleName();\n            $entity   = $this->getNameSingular(true);\n            $content .= $this->getPadding($padding).'<'.$ns.'_'.$md.'_'.$entity.\n                ' translate=\"title\" module=\"'.$ns.'_'.$md.'\">'.$eol;\n            $content .= $this->getPadding($padding + 1).'<title>'.$this->getLabelSingular().'</title>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<sort_order>'.$this->getPosition().'</sort_order>'.$eol;\n            $content .= $this->getPadding($padding).'</'.$ns.'_'.$md.'_'.$entity.'>'.$eol;\n        }\n        return $content;\n    }\n\n    /**\n     * get rest resource\n     *\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestResource($padding)\n    {\n        $content = '';\n        $eol = $this->getEol();\n        if ($this->getRest()) {\n            $ns       = $this->getNamespace(true);\n            $md       = $this->getModule()->getLowerModuleName();\n            $entity   = $this->getNameSingular(true);\n            $content .= $this->getPadding($padding).'<'.$ns.'_'.$md.'_'.$entity.\n                ' translate=\"title\" module=\"'.$ns.'_'.$md.'\">'.$eol;\n            $content .= $this->getPadding($padding + 1).'<group>'.$ns.'_'.$md.'_'.$entity.'</group>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<model>'.$ns.'_'.$md.'/api2_'.$entity.'</model>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<working_model>'.$ns.'_'.$md.'/'.$entity.\n                '</working_model>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<title>'.$this->getLabelSingular().'</title>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<sort_order>'.$this->getPosition().'</sort_order>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<privileges>'.$eol;\n            $content .= $this->getPadding($padding + 2).'<admin>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<create>1</create>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<retrieve>1</retrieve>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<update>1</update>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<delete>1</delete>'.$eol;\n            $content .= $this->getPadding($padding + 2).'</admin>'.$eol;\n            $content .= $this->getPadding($padding + 2).'<customer>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<retrieve>1</retrieve>'.$eol;\n            $content .= $this->getPadding($padding + 2).'</customer>'.$eol;\n            $content .= $this->getPadding($padding + 2).'<guest>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<retrieve>1</retrieve>'.$eol;\n            $content .= $this->getPadding($padding + 2).'</guest>'.$eol;\n            $content .= $this->getPadding($padding + 1).'</privileges>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<attributes translate=\"'.\n                $this->getRestAttributes(true, true).'\" module=\"'.$ns.'_'.$md.'\">'.$eol;\n            foreach ($this->getRestAttributes(false, false) as $code=>$label) {\n                $content .= $this->getPadding($padding + 2).'<'.$code.'>'.$label.'</'.$code.'>'.$eol;\n            }\n            $content .= $this->getPadding($padding + 1).'</attributes>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<routes>'.$eol;\n            $content .= $this->getPadding($padding + 2).'<route_entity>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<route>/'.$md.'_'.$this->getNamePlural(true).\n                '/:id</route>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<action_type>entity</action_type>'.$eol;\n            $content .= $this->getPadding($padding + 2).'</route_entity>'.$eol;\n            if ($this->getIsEav() || $this->getStore()) {\n                $content .= $this->getPadding($padding + 2).'<route_entity_with_store>'.$eol;\n                $content .= $this->getPadding($padding + 3).'<route>/'.$md.'_'.$this->getNamePlural(true).\n                    '/:id/store/:store</route>'.$eol;\n                $content .= $this->getPadding($padding + 3).'<action_type>entity</action_type>'.$eol;\n                $content .= $this->getPadding($padding + 2).'</route_entity_with_store>'.$eol;\n            }\n            $content .= $this->getPadding($padding + 2).'<route_collection>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<route>/'.$md.'_'.$this->getNamePlural(true).'</route>'.$eol;\n            $content .= $this->getPadding($padding + 3).'<action_type>collection</action_type>'.$eol;\n            $content .= $this->getPadding($padding + 2).'</route_collection>'.$eol;\n            if ($this->getIsEav() || $this->getStore()) {\n                $content .= $this->getPadding($padding + 2).'<route_collection_with_store>'.$eol;\n                $content .= $this->getPadding($padding + 3).'<route>/'.$md.'_'.$this->getNamePlural(true).\n                    '/store/:store</route>'.$eol;\n                $content .= $this->getPadding($padding + 3).'<action_type>collection</action_type>'.$eol;\n                $content .= $this->getPadding($padding + 2).'</route_collection_with_store>'.$eol;\n            }\n            $content .= $this->getPadding($padding + 1).'</routes>'.$eol;\n            $content .= $this->getPadding($padding + 1).'<versions>1</versions>'.$eol;\n            $content .= $this->getPadding($padding).'</'.$ns.'_'.$md.'_'.$entity.'>'.$eol;\n        }\n        return $content;\n    }\n\n    /**\n     * get rest attributes\n     *\n     * @param bool $codeOnly\n     * @param bool $asString\n     * @return array|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestAttributes($codeOnly = false, $asString = false)\n    {\n        $attributes = array(\n            'entity_id' => 'Id',\n        );\n        foreach ($this->getAttributes() as $attribute) {\n            $attributes[$attribute->getCode()] = $attribute->getLabel();\n        }\n        foreach ($this->getSimulatedAttributes() as $attribute) {\n            $attributes[$attribute->getCode()] = $attribute->getLabel();\n        }\n        if ($codeOnly) {\n            if ($asString) {\n                return implode(' ', array_keys($attributes));\n            }\n            return array_keys($attributes);\n        }\n        return $attributes;\n    }\n\n    /**\n     * @access public\n     *\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestCollectionCleanup()\n    {\n        return $this->getTypeInstance()->getRestCollectionCleanup();\n    }\n\n    /**\n     * @access public\n     *\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestCollectionStoreId()\n    {\n        return $this->getTypeInstance()->getRestCollectionStoreId();\n    }\n\n    /**\n     * get default attribute values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDefaultAttributeValues()\n    {\n        return $this->getTypeInstance()->getDefaultAttributeValues();\n    }\n\n    /**\n     * check if entity has parent entities\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasParentRelation()\n    {\n        return count($this->getRelatedEntities(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD)) > 0;\n    }\n\n    /**\n     * get additional to option array select\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getToOptionArraySelect()\n    {\n        return $this->getTypeInstance()->getToOptionArraySelect();\n    }\n\n    /**\n     * get parent grid column static params\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getParentStaticParams()\n    {\n        if ($this->getNotIsTree()) {\n            return '';\n        }\n        $eol      = $this->getEol();\n        $padding  = $this->getPadding(4);\n        $tab      = $this->getPadding();\n        $content  = $eol;\n        $content .= $padding.\"'static' => array(\".$eol;\n        $content .= $padding.$tab.\"'clear' => 1\".$eol;\n        $content .= $padding.\"),\";\n        return $content;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Module/Collection.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */ \n/**\n * module collection\n * \n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */ \nclass Ultimate_ModuleCreator_Model_Module_Collection extends Varien_Data_Collection_Filesystem\n{\n    /**\n     * Files and folders regexsp\n     * @var string\n     */\n    protected $_allowedDirsMask     = '/^[a-z0-9\\.\\-]+$/i';\n    protected $_allowedFilesMask    = '/^[a-z0-9\\.\\-\\_]+\\.(xml)$/i';\n    protected $_disallowedFilesMask = '/^package\\.xml$/i';\n\n    /**\n     * Base dir where packages are located\n     *\n     * @var string\n     */\n    protected $_baseDir = '';\n\n    /**\n     * Set base dir\n     *\n     * @access public\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function __construct()\n    {\n        $this->_baseDir = Mage::getBaseDir('var') . DS . 'modulecreator'.DS.'package';\n        $io = new Varien_Io_File();\n        $io->setAllowCreateFolders(true);\n        $io->createDestinationDir($this->_baseDir);\n        $this->addTargetDir($this->_baseDir);\n    }\n\n    /**\n     * Row generator\n     *\n     * @access public\n     * @param string $filename\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _generateRow($filename)\n    {\n        $row = parent::_generateRow($filename);\n        $row['package']     = preg_replace('/\\.(xml)$/', '', str_replace($this->_baseDir . DS, '', $filename));\n        $row['filename_id'] = $row['package'];\n        $row['safe_id']     = strtr(base64_encode($row['package']), '+/=', '-_,');\n        $folder             = explode(DS, $row['package']);\n        $row['folder']      = DS;\n        array_pop($folder);\n        if (!empty($folder)) {\n            $row['folder'] = implode(DS, $folder) . DS;\n        }\n        return $row;\n    }\n\n    /**\n     * Get all folders as options array\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function collectFolders()\n    {\n        $collectFiles = $this->_collectFiles;\n        $collectDirs = $this->_collectDirs;\n        $this->setCollectFiles(false)->setCollectDirs(true);\n\n        $this->_collectRecursive($this->_baseDir);\n        $result = array(DS => DS);\n        foreach ($this->_collectedDirs as $dir) {\n            $dir = str_replace($this->_baseDir . DS, '', $dir) . DS;\n            $result[$dir] = $dir;\n        }\n        $this->setCollectFiles($collectFiles)->setCollectDirs($collectDirs);\n        return $result;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Module.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * @method string getFilenameId()\n * @method string getMenuParent()\n * @method Ultimate_ModuleCreator_Model_Module setRss()\n * @method Ultimate_ModuleCreator_Model_Module setHasFile()\n * @method Ultimate_ModuleCreator_Model_Module setHasImage()\n * @method Ultimate_ModuleCreator_Model_Module setAddSeo()\n * @method Ultimate_ModuleCreator_Model_Module setWidget()\n * @method Ultimate_ModuleCreator_Model_Module setCreateFrontend()\n * @method Ultimate_ModuleCreator_Model_Module setCanCreateRouter()\n * @method Ultimate_ModuleCreator_Model_Module setCreateList()\n * @method Ultimate_ModuleCreator_Model_Module setHasTree()\n * @method Ultimate_ModuleCreator_Model_Module setEditor()\n * @method Ultimate_ModuleCreator_Model_Module setHasConfigDefaults()\n * @method Ultimate_ModuleCreator_Model_Module setLinkProduct()\n * @method Ultimate_ModuleCreator_Model_Module setHasObserver()\n * @method Ultimate_ModuleCreator_Model_Module setLinkCategory()\n * @method Ultimate_ModuleCreator_Model_Module setLinkCore()\n * @method Ultimate_ModuleCreator_Model_Module setUrlRewrite()\n * @method Ultimate_ModuleCreator_Model_Module setHasEav()\n * @method Ultimate_ModuleCreator_Model_Module setHasFlat()\n * @method Ultimate_ModuleCreator_Model_Module setApi()\n * @method Ultimate_ModuleCreator_Model_Module setAllowComment()\n * @method Ultimate_ModuleCreator_Model_Module setAllowCommentByStore()\n * @method Ultimate_ModuleCreator_Model_Module setHasCountry()\n * @method Ultimate_ModuleCreator_Model_Module setHasSeo()\n * @method Ultimate_ModuleCreator_Model_Module setShowOnProduct()\n * @method Ultimate_ModuleCreator_Model_Module setShowOnCategory()\n * @method Ultimate_ModuleCreator_Model_Module setShowInCategoryMenu()\n * @method Ultimate_ModuleCreator_Model_Module setSearch()\n * @method Ultimate_ModuleCreator_Model_Module setHasCatalogAttribute()\n * @method Ultimate_ModuleCreator_Model_Module setRest()\n * @method int getInstall()\n * @method Ultimate_ModuleCreator_Model_Module setInstall()\n * @method bool getHasEav()\n * @method int getSortOrder()\n * @method string getMenuText()\n * @method string getCodepool()\n * @method string getVersion()\n * @method bool getCreateFrontend()\n * @method bool getLinkProduct()\n * @method bool getLinkCategory()\n * @method bool getHasCatalogAttribute()\n * @method bool getLinkCore()\n * @method bool getShowInCategoryMenu()\n * @method string getModuleName()\n */\nclass Ultimate_ModuleCreator_Model_Module extends Ultimate_ModuleCreator_Model_Abstract\n{\n    /**\n     * enterprise version where Varien_Io_File was changed\n     *\n     * @var string\n     */\n    const EFFIN_VERSION_ENTERPRISE = '1.13.1';\n\n    /**\n     * community version where Varien_Io_File was changed\n     *\n     * @var string\n     */\n    const EFFIN_VERSION_COMMUNITY  = '1.8.1';\n\n    /**\n     * entity code\n     *\n     * @var string\n     */\n    protected $_entityCode   = 'umc_module';\n\n    /**\n     * module entities\n     *\n     * @var array()\n     */\n    protected $_entities     = array();\n\n    /**\n     * module config\n     *\n     * @var mixed (null|Varien_Simplexml_Element)\n     */\n    protected $_config        = null;\n\n    /**\n     * entity relations\n     *\n     * @var array\n     */\n    protected $_relations     = array();\n\n    /**\n     * io member\n     *\n     * @var null|Varien_Io_File\n     */\n    protected $_io            = null;\n\n    /**\n     * error log\n     *\n     * @var array\n     */\n    protected $_errors        = array();\n\n    /**\n     * source folder\n     *\n     * @var null\n     */\n    protected $_sourceFolder  = null;\n\n    /**\n     * placeholders\n     *\n     * @var null\n     */\n    protected $_placeholders  = null;\n\n    /**\n     * base placeholders\n     *\n     * @var array\n     */\n    protected $_basePlaceholders = array();\n\n    /**\n     * generated files\n     *\n     * @var array\n     */\n    protected $_files         = array();\n\n    /**\n     * keep modman paths\n     *\n     * @var array\n     */\n    protected $_modman        = array();\n\n    /**\n     * add entity to module\n     *\n     * @access public\n     * @param  Ultimate_ModuleCreator_Model_Entity $entity\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @throws Ultimate_ModuleCreator_Exception\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function addEntity(Ultimate_ModuleCreator_Model_Entity $entity)\n    {\n        Mage::dispatchEvent(\n            'umc_module_add_entity_before',\n            array('entity'=>$entity, 'module'=>$this)\n        );\n        if (isset($this->_entities[$entity->getNameSingular()])) {\n            throw new Ultimate_ModuleCreator_Exception(\n                Mage::helper('modulecreator')->__(\n                    'An entity with the code \"%s\" already exists',\n                    $entity->getNameSingular()\n                )\n            );\n        }\n        $entity->setModule($this);\n        $entity->setIndex(count($this->_entities));\n        $position = 10 * (count($this->_entities));\n        $entity->setPosition($position);\n        $this->_entities[$entity->getNameSingular()] = $entity;\n        if ($entity->getRss()) {\n            $this->setRss(true);\n        }\n        if ($entity->getHasFile()) {\n            $this->setHasFile(true);\n        }\n        if ($entity->getHasImage()) {\n            $this->setHasImage(true);\n        }\n        if ($entity->getAddSeo()) {\n            $this->setAddSeo(true);\n        }\n        if ($entity->getWidget()) {\n            $this->setWidget(true);\n        }\n        if ($entity->getCreateFrontend()) {\n            $this->setCreateFrontend(true);\n            $this->setCanCreateRouter(true);\n        }\n        if ($entity->getCreateList()) {\n            $this->setCreateList(true);\n        }\n        if ($entity->getIsTree()) {\n            $this->setHasTree(true);\n        }\n        if ($entity->getEditor()) {\n            $this->setEditor(true);\n        }\n        if ($entity->getHasConfigDefaults()) {\n            $this->setHasConfigDefaults(true);\n        }\n        if ($entity->getLinkProduct()) {\n            $this->setLinkProduct(true);\n            $this->setHasObserver(true);\n        }\n        if ($entity->getLinkCategory()) {\n            $this->setLinkCategory(true);\n            $this->setHasObserver(true);\n        }\n        if ($entity->getLinkCore()) {\n            $this->setLinkCore(true);\n        }\n        if ($entity->getUrlRewrite()) {\n            $this->setUrlRewrite(true);\n        }\n        if ($entity->getIsEav()) {\n            $this->setHasEav(true);\n        }\n        if ($entity->getIsFlat()) {\n            $this->setHasFlat(true);\n        }\n        if ($entity->getApi()) {\n            $this->setApi(true);\n        }\n        if ($entity->getAllowComment()) {\n            $this->setAllowComment(true);\n        }\n        if ($entity->getAllowCommentByStore()) {\n            $this->setAllowCommentByStore(true);\n        }\n        if ($entity->getHasCountry()) {\n            $this->setHasCountry(true);\n        }\n        if ($entity->getAddSeo()) {\n            $this->setHasSeo(true);\n        }\n        if ($entity->getCanCreateListBlock()) {\n            $this->setCreateFrontend(true);\n        }\n        if ($entity->getShowOnProduct()) {\n            $this->setShowOnProduct(true);\n        }\n        if ($entity->getShowOnCategory()) {\n            $this->setShowOnCategory(true);\n        }\n        if ($entity->getShowInCategoryMenu()) {\n            $this->setShowInCategoryMenu(true);\n        }\n        if ($entity->getSearch()) {\n            $this->setSearch(true);\n        }\n        if ($entity->getProductAttribute() ||$entity->getCategoryAttribute()) {\n            $this->setHasCatalogAttribute(true);\n        }\n        if ($entity->getRest()) {\n            $this->setRest(true);\n        }\n        Mage::dispatchEvent(\n            'umc_module_add_entity_after',\n            array('entity'=>$entity, 'module'=>$this)\n        );\n        return $this;\n    }\n\n    /**\n     * get a module entity\n     *\n     * @access public\n     * @param string $code\n     * @return mixed(Ultimate_ModuleCreator_Model_Entity|null)\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntity($code)\n    {\n        if (isset($this->_entities[$code])) {\n            return $this->_entities[$code];\n        }\n        return null;\n    }\n\n    /**\n     * module to xml\n     *\n     * @access public\n     * @param array $arrAttributes\n     * @param string $rootName\n     * @param bool $addOpenTag\n     * @param bool $addCdata\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toXml(array $arrAttributes = array(), $rootName = 'module', $addOpenTag=false, $addCdata=false)\n    {\n        $xml = '';\n        $eol = $this->getEol();\n        if ($addOpenTag) {\n            $xml.= '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.$eol;\n        }\n        if (!empty($rootName)) {\n            $xml.= '<'.$rootName.'>'.$eol;\n        }\n        $xml .= parent::toXml($this->getXmlAttributes(), '', false, $addCdata);\n        $xml .= '<entities>'.$eol;\n        foreach ($this->getEntities() as $entity) {\n            $xml .= $entity->toXml(array(), 'entity', false, $addCdata);\n        }\n        $xml .= '</entities>'.$eol;\n        $xml .= '<relations>'.$eol;\n        foreach ($this->getRelations() as $relation) {\n            $xml .= $relation->toXml(array(), '', false, $addCdata);\n        }\n        $xml .= '</relations>'.$eol;\n        if (!empty($rootName)) {\n            $xml.= '</'.$rootName.'>'.$eol;\n        }\n        return $xml;\n    }\n\n    /**\n     * get the module entities\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Entity[]\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntities()\n    {\n        $this->_prepareEntities();\n        return $this->_entities;\n    }\n\n    /**\n     * prepare the entities before saving\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _prepareEntities()\n    {\n        Mage::dispatchEvent('umc_module_prepare_entities', array('module'=>$this));\n        return $this;\n    }\n\n    /**\n     * add relation to module\n     *\n     * @access public\n     * @param Ultimate_ModuleCreator_Model_Relation $relation\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function addRelation(Ultimate_ModuleCreator_Model_Relation $relation)\n    {\n        Mage::dispatchEvent(\n            'umc_module_add_relation_before',\n            array('relation'=>$relation, 'module'=>$this)\n        );\n        $this->_relations[] = $relation;\n        Mage::dispatchEvent(\n            'umc_module_add_relation_after',\n            array('relation'=>$relation, 'module'=>$this)\n        );\n        return $this;\n    }\n\n    /**\n     * get module relations\n     *\n     * @access public\n     * @param mixed $type\n     * @return Ultimate_ModuleCreator_Model_Relation[]\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRelations($type = null)\n    {\n        if (is_null($type)) {\n            return $this->_relations;\n        }\n        $relations = array();\n        foreach ($this->_relations as $relation) {\n            /** @var Ultimate_ModuleCreator_Model_Relation $relation */\n            if ($relation->getType() == $type) {\n                $relations[] = $relation;\n            }\n        }\n        return $relations;\n    }\n\n    /**\n     * get the extensions xml path\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getXmlPath()\n    {\n        return $this->getHelper()->getLocalPackagesPath().\n            $this->getNamespace().\"_\".$this->getModuleName().'.xml';\n    }\n\n    /**\n     * save the module as xml\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function save()\n    {\n        $destination = $this->getXmlPath();\n        $xml = $this->toXml(array(), 'module', true, true);\n        $this->_writeFile($destination, $xml);\n        return $this;\n    }\n\n    /**\n     * validate the module\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function validate()\n    {\n        $config     = $this->getHelper()->getConfig();\n        $settings   = $config->getNode('forms/settings/fieldsets');\n        foreach ($settings->fieldset as $set) {\n            foreach ($set->fields->children() as $key => $values) {\n                $v = $this->getData($key);\n                if ((string)$values->required == 1 && (!$this->hasData($key) || $v === \"\")) {\n                    $this->_addError(\n                        Mage::helper(\"modulecreator\")->__('This is a required field.'),\n                        'settings_'.$key\n                    );\n                }\n            }\n        }\n        //validate namespace\n        if (strtolower($this->getNamespace()) == 'mage') {\n            $this->_addError(\n                Mage::helper('modulecreator')->__(\"You shouldn't use the namespace Mage. Be Creative\"),\n                'settings_namespace'\n            );\n        }\n        //validate module name\n        $routers = Mage::getConfig()->getNode('frontend/routers');\n        $moduleName = $this->getModuleName();\n        $lower = strtolower($moduleName);\n        $extension = $this->getExtensionName();\n        if ($routers->$lower) {\n            if ((string)$routers->$lower->args->module != $extension) {\n                $this->_addError(\n                    Mage::helper('modulecreator')->__(\n                        'You cannot use the module name %s',\n                        $this->getModuleName()\n                    ),\n                    'settings_module_name'\n                );\n            }\n        }\n        //validate front key\n        foreach ((array)$routers as $router) {\n            if ((string)$router->args->frontName == $this->getFrontKey() &&\n                $router->args->module != $extension) {\n                $this->_addError(\n                    Mage::helper('modulecreator')->__(\n                        'You cannot use the front key %s. It is used by the module %s',\n                        $this->getFrontKey(),\n                        (string)$router->args->module\n                    ),\n                    'settings_front_key'\n                );\n                break;\n            }\n        }\n        //validate entity count\n        if (count($this->getEntities()) == 0) {\n            $this->_addError(Mage::helper('modulecreator')->__('Add at least an entity'));\n        } else {\n            //validate entities\n            foreach ($this->getEntities() as $entity) {\n                $entityCode = $entity->getNameSingular(true);\n                if (in_array($entityCode, $this->getRestrictedEntityNames())) {\n                    $this->_addError(\n                        Mage::helper('modulecreator')->__(\n                            'The entity code \"%s\" is restricted',\n                            $entityCode\n                        ),\n                        'entity_'.$entity->getIndex().'_name_singular'\n                    );\n                }\n                if (count($entity->getAttributes()) == 0) {\n                    $this->_addError(\n                        Mage::helper('modulecreator')->__(\n                            'The entity \"%s\" must have at least one attribute.',\n                            $entity->getLabelSingular()\n                        )\n                    );\n                } else {\n                    //validate name attribute\n                    if (is_null($entity->getNameAttribute())) {\n                        $this->_addError(\n                            Mage::helper('modulecreator')->__(\n                                'The entity \"%s\" must have an attribute that behaves as a name.',\n                                $entity->getLabelSingular()\n                            )\n                        );\n                    }\n                    $restrictedAttributes = $this->getRestrictedAttributeCodes();\n                    //validate attributes\n                    foreach ($entity->getAttributes() as $attribute) {\n                        $code = $attribute->getCode();\n                        if (isset($restrictedAttributes[$code])) {\n                            //presume \"not guilty\"\n                            $valid = true;\n                            if (!isset($restrictedAttributes[$code]->depend_entity)) {//if general restriction.\n                                $valid = false;\n                            } else {//if depends on entity setting.\n                                foreach ((array)$restrictedAttributes[$code]->depend_entity as $prop=>$value) {\n                                    if ($entity->getDataUsingMethod($prop) == $value) {\n                                        //\"found guilty\"\n                                        $valid = false;\n                                        break;\n                                    }\n                                }\n                            }\n                            if (!$valid) {\n                                $this->_addError(\n                                    $restrictedAttributes[$code]->message,\n                                    'attribute_'.$entity->getIndex().'_'.$attribute->getIndex().'_code'\n                                );\n                            }\n                        }\n                        //validate attributes against getters (\"getData\", \"getCollection\", ,....)\n                        $methodCodes = $this->getMethodAttributeCodes();\n                        if (in_array($code, $methodCodes)) {\n                            $method = $method = str_replace(' ', '', ucwords(str_replace('_', ' ', $code)));\n                            $this->_addError(\n                                Mage::helper('modulecreator')->__('Attribute code %s is restricted because a method similar to \"set%s()\" or \"get%s()\" exists in parent model class', $code, $method, $method),\n                                'attribute_'.$entity->getIndex().'_'.$attribute->getIndex().'_code'\n                            );\n                        }\n                    }\n                }\n            }\n        }\n\n        return $this->_errors;\n    }\n\n    /**\n     * add an error to the error list\n     *\n     * @access protected\n     * @param $message\n     * @param null $attribute\n     * @param string $separator\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _addError($message, $attribute = null, $separator = '<br />')\n    {\n        if (empty($attribute)) {\n            $this->_errors[''][] = $message;\n        } else {\n            if (!isset($this->_errors[$attribute])) {\n                $this->_errors[$attribute] = '';\n            } else {\n                $this->_errors[$attribute] .= $separator;\n            }\n            $this->_errors[$attribute] .= $message;\n        }\n        return $this;\n    }\n\n    /**\n     * write a file\n     *\n     * @access protected\n     * @param string $destinationFile\n     * @param string $contents\n     * @throws Exception\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _writeFile($destinationFile, $contents)\n    {\n        try {\n            $io = $this->getIo();\n            $io->mkdir(dirname($destinationFile));\n            /**\n             * Varien_Io_File has changed in CE 1.8.1 / EE 1.13.1 A LOT\n             */\n            if (version_compare(Mage::getVersion(), $this->getEffinVersion(), '<')) {\n                $io->write($destinationFile, $contents, 0777);\n            } else {\n                $io->filePutContent($destinationFile, $contents);\n            }\n        } catch (Exception $e) {\n            if ($e->getCode() != 0) {\n                throw $e;\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * get the version for which the io writer has changed\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEffinVersion()\n    {\n        if (Mage::getEdition() == Mage::EDITION_ENTERPRISE) {\n            return self::EFFIN_VERSION_ENTERPRISE;\n        }\n        return self::EFFIN_VERSION_COMMUNITY;\n    }\n\n    /**\n     * get the IO - class instance\n     *\n     * @access public\n     * @return Varien_Io_File\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getIo()\n    {\n        if (!$this->_io) {\n            $this->_io = new Varien_Io_File();\n            $this->_io->setAllowCreateFolders(true);\n        }\n        return $this->_io;\n    }\n\n    /**\n     * get module relations as json\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRelationsAsJson()\n    {\n        $json = array();\n        $relations = $this->getRelations();\n        foreach ($relations as $relation) {\n            $entities = $relation->getEntities();\n            $json[$entities[0]->getIndex().'_'.$entities[1]->getIndex()] = $relation->getType();\n        }\n        return json_encode($json);\n    }\n\n    /**\n     * get the extension name\n     *\n     * @param bool $lower\n     * @return string\n     * @access public\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getExtensionName($lower = false)\n    {\n        $name = $this->getNamespace().'_'.$this->getModuleName();\n        if ($lower) {\n            $name = strtolower($name);\n        }\n        return $name;\n    }\n\n    /**\n     * get the restricted entity name\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestrictedEntityNames()\n    {\n        return $this->getDataSetDefault(\n            'restricted_entity_names',\n            array_keys(\n                (array)$this->getHelper()->getConfig()->getNode('restricted/entity')\n            )\n        );\n    }\n\n    /**\n     * get the restricted attribute codes\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestrictedAttributeCodes()\n    {\n        return $this->getDataSetDefault(\n            'restricted_attribute_codes',\n            (array)$this->getHelper()->getConfig()->getNode('restricted/attribute')\n        );\n    }\n\n    /**\n     * get the restricted attribute codes because of the method names\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMethodAttributeCodes()\n    {\n        if (!$this->hasData('method_attribute_codes')) {\n            $attributes = array();\n            $methods = get_class_methods('Mage_Catalog_Model_Abstract');\n            $start = array('get', 'set', 'has', 'uns');\n            foreach ($methods as  $method) {\n                if (in_array(substr($method, 0, 3), $start)) {\n                    $attribute = strtolower(preg_replace('/(.)([A-Z])/', \"$1_$2\", substr($method, 3)));\n                    $attributes[$attribute] = 1;\n                }\n            }\n            $this->setData('method_attribute_codes', array_keys($attributes));\n        }\n        return $this->getData('method_attribute_codes');\n    }\n\n    /**\n     * build the module\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function buildModule()\n    {\n        $config     = $this->getConfig();\n        $files      = $config->getNode('files');\n        $messages   = array();\n        foreach ((array)$files as $file) {\n            if ($file->scope == 'disabled') {\n                continue;\n            }\n            $this->_createFile($file);\n        }\n        if ($this->getInstall()) {\n            $existingFiles = $this->_checkExistingFiles();\n            if (count($existingFiles) > 0) {\n                $this->setInstall(false);\n                $messages[] = Mage::helper('modulecreator')->__(\n                    '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',\n                    implode('<br />', $existingFiles)\n                );\n            }\n        }\n        $this->_writeFiles();\n        if (!$this->getInstall()) {\n            $contents = array();\n            foreach ($this->_files as $filename=>$file) {\n                $contents[] = $this->getRelativeBasePath().$filename;\n            }\n            /** @var Ultimate_ModuleCreator_Model_Writer $_writer */\n            $_writer = Mage::getModel('modulecreator/writer', $contents);\n            $_writer->setPathPrefix('var'.DS.'modulecreator'.DS.$this->getExtensionName().DS);\n            $_writer->setNamePackage(Mage::getBaseDir('var').DS.'modulecreator'.DS.$this->getExtensionName());\n            $_writer->composePackage()->archivePackage();\n            $this->_io->rmdir($this->getBasePath(), true);\n        }\n        return $messages;\n    }\n\n    /**\n     * write files to disk\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _writeFiles()\n    {\n        $basePath = $this->getBasePath();\n        foreach ($this->_files as $name=>$file) {\n            $destinationFile = $basePath.$name;\n            $this->_writeFile($destinationFile, $file);\n        }\n        $this->_writeLog();\n        $this->_writeUninstall();\n        $this->_writeModman();\n        return $this;\n    }\n\n    /**\n     * write log with generated files\n     *\n     * can be used for uninstall\n     * @access protected\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _writeLog()\n    {\n        $filesToWrite = array_keys($this->_files);\n        asort($filesToWrite);\n        $filesToWrite = array_values($filesToWrite);\n        $text = implode($this->getEol(), $filesToWrite);\n        $this->_writeFile($this->getLogPath(), $text);\n        return $this;\n    }\n\n    /**\n     * write sql uninstall script\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _writeUninstall()\n    {\n        $lines      = array();\n        $module     = $this->getPlaceholder('{{module}}');\n        $namespace  = $this->getNamespace(true);\n        $lines[] = '-- add table prefix if you have one';\n        foreach ($this->getRelations(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING) as $relation) {\n            $entities = $relation->getEntities();\n            $tableName = $namespace.'_'.$module.'_'.\n                $entities[0]->getPlaceholders('{{entity}}').'_'.\n                $entities[1]->getPlaceholders('{{entity}}');\n            $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n        }\n        foreach ($this->getEntities() as $entity) {\n            if ($entity->getIsEav()) {\n                $entityTypeCode = $namespace.'_'.$this->getLowerModuleName().'_'.$entity->getPlaceholders('{{entity}}');\n                $lines[] = \"DELETE\".\" FROM eav_attribute WHERE entity_type_id IN \".\n                    \"(SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = '{$entityTypeCode}');\";\n                $lines[] = \"DELETE\".\" FROM eav_entity_type WHERE entity_type_code = '{$entityTypeCode}';\";\n            }\n            if ($entity->getProductAttribute()) {\n                $lines[] = \"DELETE\".\" FROM eav_attribute WHERE attribute_code = '\".\n                    $entity->getProductAttributeCode().\n                    \"' AND entity_type_id IN\n                    (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product');\";\n            }\n            if ($entity->getCategoryAttribute()) {\n                $lines[] = \"DELETE\".\" FROM eav_attribute WHERE attribute_code = '\".$entity->getCategoryAttributeCode().\n                    \"' AND entity_type_id IN (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_category');\";\n            }\n            if ($entity->getAllowCommentByStore()) {\n                $tableName = $namespace.'_'.$module.'_'.$entity->getPlaceholders('{{entity}}').'_comment_store';\n                $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n            }\n            if ($entity->getAllowComment()) {\n                $tableName = $namespace.'_'.$module.'_'.$entity->getPlaceholders('{{entity}}').'_comment';\n                $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n            }\n            if ($entity->getLinkProduct()) {\n                $tableName = $namespace.'_'.$module.'_'.$entity->getPlaceholders('{{entity}}').'_product';\n                $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n            }\n            if ($entity->getLinkCategory()) {\n                $tableName = $namespace.'_'.$module.'_'.$entity->getPlaceholders('{{entity}}').'_category';\n                $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n            }\n            if ($entity->getStore()) {\n                $tableName = $namespace.'_'.$module.'_'.$entity->getPlaceholders('{{entity}}').'_store';\n                $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n            }\n            if ($entity->getIsEav()) {\n                foreach (array('int', 'decimal','datetime', 'varchar', 'text') as $type) {\n                    $tableName = $namespace.'_'.$module.'_'.$entity->getPlaceholders('{{entity}}').'_'.$type;\n                    $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n                }\n            }\n            $tableName = $namespace.'_'.$module.'_'.$entity->getPlaceholders('{{entity}}');\n            $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n        }\n        if ($this->getHasEav()) {\n            $tableName = $namespace.'_'.$module.'_eav_attribute';\n            $lines[] = 'DROP'.' TABLE IF EXISTS '.$tableName.';';\n        }\n        $lines[] = \"DELETE\".\" FROM core_resource WHERE code = '\".$namespace.'_'.$module.\"_setup';\";\n        $lines[] = \"DELETE\".\" FROM core_config_data WHERE path like '\".$namespace.'_'.$module.\"/%';\";\n        $text = implode($this->getEol(), $lines);\n        $this->_writeFile($this->getUninstallPath(), $text);\n        return $this;\n    }\n\n    /**\n     * write the modman file\n     *\n     * @access protected\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _writeModman()\n    {\n        $paths = array(\n            'app/etc/modules/'.$this->getNamespace().'_'.$this->getModuleName().'.xml',\n            'app/code/'.$this->getCodepool().'/'.$this->getNamespace().'/'.$this->getModuleName(),\n            'app/locale/en_US/'.$this->getNamespace().'_'.$this->getModuleName().'.csv',\n            'app/design/adminhtml/default/default/layout/'.$this->getNamespace(true).'_'.$this->getLowerModuleName().'.xml',\n            'app/design/adminhtml/default/default/template/'.$this->getNamespace(true).'_'.$this->getLowerModuleName()\n        );\n        if ($this->getCreateFrontend()) {\n            $paths[] = 'app/design/frontend/base/default/layout/'.$this->getNamespace(true).'_'.$this->getLowerModuleName().'.xml';\n            $paths[] = 'app/design/adminhtml/default/default/template/'.$this->getNamespace(true).'_'.$this->getLowerModuleName();\n        }\n        foreach ($this->getEntities() as $entity) {\n            if ($entity->getHasImage()) {\n                $paths[] = 'skin/frontend/base/default/images/placeholder/'.$entity->getNameSingular(true).'.jpg';\n            }\n            if ($entity->getIsTree()) {\n                $paths[] = 'skin/frontend/base/default/css/'.$this->getNamespace(true).'_'.$this->getLowerModuleName();\n                $paths[] = 'skin/frontend/base/default/images/'.$this->getNamespace(true).'_'.$this->getLowerModuleName();\n                $paths[] = 'skin/frontend/base/default/js/'.$this->getNamespace(true).'_'.$this->getLowerModuleName();\n            }\n        }\n        sort($paths);\n        $paths = array_unique($paths);\n        $text = '';\n        $eol = $this->getEol();\n        foreach ($paths as $path) {\n            $text .= $path . '    '.$path.$eol;\n        }\n        $this->_writeFile($this->getModmanPath(), $text);\n        return $this;\n    }\n\n    /**\n     * get path for modman file\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getModmanPath()\n    {\n        return $this->getHelper()->getLocalPackagesPath().$this->getExtensionName().'/modman';\n    }\n\n    /**\n     * check if some files already exist so it won't be overwritten\n     *\n     * @access protected\n     * @return array()\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _checkExistingFiles()\n    {\n        $existingFiles = array();\n        $io = $this->getIo();\n        $basePath = $this->getBasePath();\n        foreach ($this->_files as $name=>$content) {\n            if ($io->fileExists($basePath.$name)) {\n                $existingFiles[] = $basePath.$name;\n            }\n        }\n        return $existingFiles;\n    }\n\n    /**\n     * get path for log file\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLogPath()\n    {\n        return $this->getHelper()->getLocalPackagesPath().$this->getExtensionName().'/files.log';\n    }\n\n    /**\n     * get path for uninstall sql file\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getUninstallPath()\n    {\n        return $this->getHelper()->getLocalPackagesPath().$this->getExtensionName().'/uninstall.sql';\n    }\n\n    /**\n     * get module base path\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getBasePath()\n    {\n        if (!$this->getInstall()) {\n            return Mage::getBaseDir('var').DS.'modulecreator'.DS.$this->getExtensionName().DS;\n        }\n        return Mage::getBaseDir().DS;\n    }\n\n    /**\n     * get relative path ro the module\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRelativeBasePath()\n    {\n        $basePath = $this->getBasePath();\n        $remove = Mage::getBaseDir().DS;\n        $relativePath = substr($basePath, strlen($remove));\n        return $relativePath;\n    }\n\n    /**\n     * get the module config\n     *\n     * @access public\n     * @return Varien_Simplexml_Config\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getConfig()\n    {\n        if (is_null($this->_config)) {\n            $this->_config = Mage::getConfig()->loadModulesConfiguration('umc_source.xml')->applyExtends();\n        }\n        return $this->_config;\n    }\n\n    /**\n     * get contents of a file\n     *\n     * @access public\n     * @param string $file\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFileContents($file)\n    {\n        return file_get_contents($file);\n    }\n\n    /**\n     * create a file\n     *\n     * @access protected\n     * @param Varien_Simplexml_Element\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _createFile($config)\n    {\n        switch ($config->scope) {\n            case 'entity' :\n                $this->_buildEntityFile($config);\n                break;\n            case 'siblings':\n                $this->_buildSiblingFile($config);\n                break;\n            case 'children' :\n                $this->_buildChildrenFile($config);\n                break;\n            case 'attribute' :\n                $this->_buildAttributeFile($config);\n                break;\n            case 'global':\n            default:\n                $this->_buildGlobalFile($config);\n                break;\n        }\n        return $this;\n    }\n\n    /**\n     * validate xml condition\n     *\n     * @access protected\n     * @param Ultimate_ModuleCreator_Model_Abstract $entity\n     * @param Mage_Core_Model_Config_Element $conditions\n     * @param mixed $params\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _validateDepend(\n        Ultimate_ModuleCreator_Model_Abstract $entity,\n        Mage_Core_Model_Config_Element $conditions,\n        $params = null\n    ) {\n        if (!$conditions) {\n            return true;\n        }\n        if (!is_array($conditions)) {\n            $conditions = $conditions->asArray();\n        }\n        foreach ($conditions as $condition=>$value) {\n            if (!$entity->getDataUsingMethod($condition, $params)) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n   /**\n    * create a file with global scope\n    *\n    * @access protected\n    * @param Varien_Simplexml_Element\n    * @return Ultimate_ModuleCreator_Model_Module\n    * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n    */\n    public function _buildGlobalFile($config)\n    {\n        $filetype = $config->filetype;\n        $sourceFolder = $this->getSourceFolder().$this->_filterString((string)$config->source, $filetype);\n        $destination = $this->_filterString((string)$config->destination, $filetype);\n        $content = '';\n        $depend = $config->depend;\n        if (!$this->_validateDepend($this, $depend)) {\n            return '';\n        }\n        if ($config->method) {\n            $method = (string)$config->method;\n            $content = $this->$method();\n        } else {\n            $code = $this->_sortCodeFiles((array)$config->code);\n            foreach ($code as $file) {\n                $sourceContent = $this->getFileContents($sourceFolder.(string)$file->name);\n                $scope = (string)$file->scope;\n                $depend = $file->depend;\n                if ($scope == 'entity') {\n                    foreach ($this->getEntities() as $entity) {\n                        if ($this->_validateDepend($entity, $depend)) {\n                            $replace    = $entity->getPlaceholders();\n                            $content   .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                        }\n                    }\n                } elseif ($scope == 'attribute') {\n                    $depend = $file->depend;\n                    /** @var Mage_Core_Model_Config_Element $dependType */\n                    $dependType = $file->depend_type;\n                    foreach ($this->getEntities() as $entity) {\n                        foreach ($entity->getAttributes() as $attribute) {\n                            $valid = $this->_validateDepend($attribute, $depend);\n                            $typeValid = true;\n                            if ($dependType) {\n                                $typeValid = false;\n                                foreach ($dependType->asArray() as $condition=>$value) {\n                                    if ($attribute->getType() == $condition) {\n                                        $typeValid = true;\n                                        break;\n                                    }\n                                }\n                            }\n                            if ($valid && $typeValid) {\n                                $replace = $entity->getPlaceholders();\n                                $attributeReplace = $attribute->getPlaceholders();\n                                $replace    = array_merge($replace, $attributeReplace);\n                                $content   .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                            }\n                        }\n                    }\n                } elseif ($scope == 'siblings') {\n                    $relatedEntities = $this->getRelations(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n                    );\n                    foreach ($relatedEntities as $relation) {\n                        $entities       = $relation->getEntities();\n                        $replaceEntity  = $entities[0]->getPlaceholders();\n                        $replaceSibling = $entities[1]->getPlaceholdersAsSibling();\n                        $replace        = array_merge($replaceEntity, $replaceSibling);\n                        $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                    }\n                } elseif ($scope == 'siblings_both_tree') {\n                    $relatedEntities = $this->getRelations(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n                    );\n                    foreach ($relatedEntities as $relation) {\n                        $entities         = $relation->getEntities();\n                        if ($entities[0]->getIsTree() || $entities[1]->getIsTree()) {\n                            if ($entities[0]->getIsTree()) {\n                                $tree       = $entities[0];\n                                $sibling    = $entities[1];\n                            } else {\n                                $tree       = $entities[1];\n                                $sibling    = $entities[0];\n                            }\n                            $replaceEntity  = $tree->getPlaceholders();\n                            $replaceSibling = $sibling->getPlaceholdersAsSibling();\n                            $replace        = array_merge($replaceEntity, $replaceSibling);\n                            $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                        }\n                    }\n                } elseif ($scope == 'siblings_both_not_tree') {\n                    $relatedEntities = $this->getRelations(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n                    );\n                    foreach ($relatedEntities as $relation) {\n                        $entities = $relation->getEntities();\n                        if ($entities[0]->getIsTree() || $entities[1]->getIsTree()) {\n                            continue;\n                        }\n                        $replaceEntity  = $entities[0]->getPlaceholders();\n                        $replaceSibling = $entities[1]->getPlaceholdersAsSibling();\n                        $replace        = array_merge($replaceEntity, $replaceSibling);\n                        $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n\n                        $replaceEntity  = $entities[1]->getPlaceholders();\n                        $replaceSibling = $entities[0]->getPlaceholdersAsSibling();\n                        $replace        = array_merge($replaceEntity, $replaceSibling);\n                        $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                    }\n                } elseif ($scope == 'children') {\n                    $relatedEntities = $this->getRelations(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD\n                    );\n                    foreach ($relatedEntities as $relation) {\n                        $entities       = $relation->getEntities();\n                        $replaceEntity  = $entities[0]->getPlaceholders();\n                        $replaceSibling = $entities[1]->getPlaceholdersAsSibling();\n                        $replace        = array_merge($replaceEntity, $replaceSibling);\n                        $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                    }\n                    $relatedEntities = $this->getRelations(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_PARENT\n                    );\n                    foreach ($relatedEntities as $relation) {\n                        $entities       = $relation->getEntities();\n                        $replaceEntity  = $entities[1]->getPlaceholders();\n                        $replaceSibling = $entities[0]->getPlaceholdersAsSibling();\n                        $replace        = array_merge($replaceEntity, $replaceSibling);\n                        $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                    }\n                } else {\n                    if ($this->_validateDepend($this, $depend)) {\n                        $content .= $this->_filterString($sourceContent, $filetype);\n                    }\n                }\n            }\n        }\n\n        if ($config->after_build) {\n            $function   = (string)$config->after_build;\n            $content    = $this->$function($content);\n        }\n\n        $content = $this->_filterString($content, $config->type);\n        $this->_addFile($destination, $content);\n        return $this;\n    }\n\n    /**\n     * create a file with entity scope\n     *\n     * @access protected\n     * @param Varien_Simplexml_Element\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function _buildEntityFile($config)\n    {\n        foreach ($this->getEntities() as $entity) {\n            $filetype           = $config->filetype;\n            $sourceFolder       = $this->getSourceFolder().$this->_filterString((string)$config->source, $filetype);\n            $destinationFile    = $this->_filterString(\n                (string)$config->destination,\n                $filetype,\n                $entity->getPlaceholders(),\n                true\n            );\n            $content            =  '';\n            $depend             = $config->depend;\n            if (!$this->_validateDepend($entity, $depend)) {\n                continue;\n            }\n            $code = $this->_sortCodeFiles((array)$config->code);\n            foreach ($code as $file) {\n                $sourceContent  = $this->getFileContents($sourceFolder.(string)$file->name);\n                $scope          = (string)$file->scope;\n                $depend         = $file->depend;\n                /** @var Mage_Core_Model_Config_Element $dependType */\n                $dependType     = $file->depend_type;\n                if ($scope == 'attribute') {\n                    foreach ($entity->getAttributes() as $attribute) {\n                        $valid = $this->_validateDepend($attribute, $depend);\n                        $typeValid = true;\n                        if ($dependType) {\n                            $typeValid = false;\n                            foreach ($dependType->asArray() as $condition=>$value) {\n                                if ($attribute->getType() == $condition) {\n                                    $typeValid = true;\n                                    break;\n                                }\n                            }\n                        }\n                        if ($valid && $typeValid) {\n                            $replace = $entity->getPlaceholders();\n                            $attributeReplace = $attribute->getPlaceholders();\n                            $replace = array_merge($replace, $attributeReplace);\n                            $content .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                        }\n                    }\n                } elseif ($scope == 'siblings') {\n                    $relatedEntities = $entity->getRelatedEntities(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n                    );\n                    foreach ($relatedEntities as $related) {\n                        if ($this->_validateDepend($entity, $depend)) {\n                            $placeholders   = $entity->getPlaceholders();\n                            $replaceSibling = $related->getPlaceholdersAsSibling();\n                            $replace        = array_merge($placeholders, $replaceSibling);\n                            $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                        }\n                    }\n                } elseif ($scope == 'siblings_not_tree') {\n                    $relatedEntities = $entity->getRelatedEntities(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n                    );\n                    foreach ($relatedEntities as $related) {\n                        if ($related->getNotIsTree()) {\n                            $placeholders   = $entity->getPlaceholders();\n                            $replaceSibling = $related->getPlaceholdersAsSibling();\n                            $replace        = array_merge($placeholders, $replaceSibling);\n                            $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                        }\n                    }\n                } elseif ($scope == 'siblings_tree') {\n                    $relatedEntities = $entity->getRelatedEntities(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING\n                    );\n                    foreach ($relatedEntities as $related) {\n                        if ($related->getIsTree()) {\n                            $placeholders   = $entity->getPlaceholders();\n                            $replaceSibling = $related->getPlaceholdersAsSibling();\n                            $replace        = array_merge($placeholders, $replaceSibling);\n                            $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                        }\n                    }\n                } elseif ($scope == 'parents') {\n                    $relatedEntities = $entity->getRelatedEntities(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD\n                    );\n                    foreach ($relatedEntities as $related) {\n                        $placeholders   = $entity->getPlaceholders();\n                        $replaceSibling = $related->getPlaceholdersAsSibling();\n                        $replace        = array_merge($placeholders, $replaceSibling);\n                        $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                    }\n                } elseif ($scope == 'children') {\n                    $relatedEntities = $entity->getRelatedEntities(\n                        Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_PARENT\n                    );\n                    foreach ($relatedEntities as $related) {\n                        $placeholders   = $entity->getPlaceholders();\n                        $replaceSibling = $related->getPlaceholdersAsSibling();\n                        $replace        = array_merge($placeholders, $replaceSibling);\n                        $content       .= $this->_filterString($sourceContent, $filetype, $replace, true);\n                    }\n                } elseif ($depend) {\n                    if ($this->_validateDepend($entity, $depend)) {\n                        $content .= $this->_filterString($sourceContent, $filetype, $entity->getPlaceholders(), true);\n                    }\n                } else {\n                    $content .= $this->_filterString($sourceContent, $filetype, $entity->getPlaceholders(), true);\n                }\n                $this->_addFile($destinationFile, $content);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * generate files for sibling relations\n     *\n     * @access protected\n     * @param $config\n     * @return $this\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _buildSiblingFile($config)\n    {\n        foreach ($this->getRelations(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING) as $relation) {\n            $entities = $relation->getEntities();\n            foreach ($entities as $index=>$entity) {\n                $depend = $config->depend;\n                if (!$this->_validateDepend($relation, $depend, $index)) {\n                    continue;\n                }\n                $placeholders       = array_merge(\n                    $entities[$index]->getPlaceholders(),\n                    $entities[1 - $index]->getPlaceholdersAsSibling()\n                );\n                $filetype           = $config->filetype;\n                $sourceFolder       = $this->getSourceFolder().\n                    $this->_filterString((string)$config->source, $filetype);\n                $destinationFile    = $this->_filterString(\n                    (string)$config->destination,\n                    $filetype,\n                    $placeholders,\n                    true\n                );\n                $content            = '';\n                $code               = $this->_sortCodeFiles((array)$config->code);\n                foreach ($code as $file) {\n                    $depend = $file->depend;\n                    if (!$this->_validateDepend($relation, $depend, $index)) {\n                        continue;\n                    }\n                    $sourceContent = $this->getFileContents($sourceFolder.(string)$file->name);\n                    $content .= $this->_filterString($sourceContent, $filetype, $placeholders, true);\n                }\n                $this->_addFile($destinationFile, $content);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * create files for children relations\n     *\n     * @access protected\n     * @param Varien_Simplexml_Element\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _buildChildrenFile($config)\n    {\n        foreach ($this->getRelations() as $relation) {\n            $type       = $relation->getType();\n            $entities   = $relation->getEntities();\n            $parent     = false;\n            $child      = false;\n            if ($type == Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_PARENT) {\n                $parent = $entities[0];\n                $child  = $entities[1];\n            } elseif ($type == Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD) {\n                $parent = $entities[1];\n                $child  = $entities[0];\n            }\n            if ($parent && $child) {\n                $depend = $config->depend;\n                if ($this->_validateDepend($relation, $depend)) {\n                    $placeholders    = array_merge($parent->getPlaceholders(), $child->getPlaceholdersAsSibling());\n                    $filetype        = $config->filetype;\n                    $sourceFolder    = $this->getSourceFolder().\n                        $this->_filterString((string)$config->source, $filetype);\n                    $destinationFile = $this->_filterString(\n                        (string)$config->destination,\n                        $filetype,\n                        $placeholders,\n                        true\n                    );\n                    $content         = '';\n                    $code            = $this->_sortCodeFiles((array)$config->code);\n                    foreach ($code as $file) {\n                        $depend = $file->depend;\n                        if (!$this->_validateDepend($relation, $depend)) {\n                            continue;\n                        }\n                        $sourceContent = $this->getFileContents($sourceFolder.(string)$file->name);\n                        $content .= $this->_filterString($sourceContent, $filetype, $placeholders, true);\n                    }\n                    $this->_addFile($destinationFile, $content);\n                }\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * build source file for an attribute\n     *\n     * @access public\n     * @param $config\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _buildAttributeFile($config)\n    {\n        foreach ($this->getEntities() as $entity) {\n            foreach ($entity->getAttributes() as $attribute) {\n                $filetype        = $config->filetype;\n                $sourceFolder    = $this->getSourceFolder().$this->_filterString((string)$config->source, $filetype);\n                $placeholders    = array_merge($entity->getPlaceholders(), $attribute->getPlaceholders());\n                $destinationFile = $this->_filterString((string)$config->destination, $filetype, $placeholders, true);\n                $content         =  '';\n                $depend          = $config->depend;\n                if (!$this->_validateDepend($attribute, $depend)) {\n                    continue;\n                }\n                $code = $this->_sortCodeFiles((array)$config->code);\n                foreach ($code as $file) {\n                    $depend = $file->depend;\n                    if (!$this->_validateDepend($attribute, $depend)) {\n                        continue;\n                    }\n                    $sourceContent  = $this->getFileContents($sourceFolder.(string)$file->name);\n                    $content .= $this->_filterString($sourceContent, $filetype, $placeholders, true);\n                }\n                $this->_addFile($destinationFile, $content);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * get sample files source folder\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSourceFolder()\n    {\n        if (!isset($this->_sourceFolder)) {\n            $this->_sourceFolder = Mage::getConfig()->getModuleDir('etc', 'Ultimate_ModuleCreator').DS.'source'.DS;\n        }\n        return $this->_sourceFolder;\n    }\n\n    /**\n     * filter placeholders\n     *\n     * @access protected\n     * @param string $string\n     * @param string $fileType\n     * @param mixed (null|array()) $replaceArray\n     * @param bool $mergeReplace\n     * @param bool $forLicence\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _filterString(\n        $string,\n        $fileType,\n        $replaceArray = null,\n        $mergeReplace = false,\n        $forLicence = false\n    ) {\n        $replace = $this->getPlaceholder();\n        if (!$forLicence) {\n            $replace['{{License}}']     = $this->getLicenseText($fileType);\n        }\n        if (!is_null($replaceArray)) {\n            if ($mergeReplace) {\n                $replace = array_merge($replace, $replaceArray);\n            } else {\n                $replace = $replaceArray;\n            }\n        }\n        return str_replace(array_keys($replace), array_values($replace), $string);\n    }\n\n    /**\n     * add file to create list\n     *\n     * @access protected\n     * @param $destinationFile\n     * @param $content\n     * @return $this\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _addFile($destinationFile, $content)\n    {\n        if (trim($content)) {\n            $this->_files[$destinationFile] = $content;\n        }\n        return $this;\n    }\n\n    /**\n     * get text for licence\n     *\n     * @access public\n     * @param string $fileType\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLicenseText($fileType)\n    {\n        if (!$this->getData('processed_license_'.$fileType)) {\n            $eol        = $this->getEol();\n            $license    = trim($this->getData('license'));\n            if (!$license) {\n                return '';\n            }\n            while (strpos($license, '*/') !== false) {\n                $license = str_replace('*/', '', $license);\n            }\n            while (strpos($license, '/*') !== false) {\n                $license = str_replace('/*', '', $license);\n            }\n            while (strpos($license, '<!--') !== false) {\n                $license = str_replace('<!--', '', $license);\n            }\n            while (strpos($license, '-->') !== false) {\n                $license = str_replace('-->', '', $license);\n            }\n            $lines = explode(\"\\n\", $license);\n            $top = '';\n            $footer = '';\n            if ($fileType == 'xml') {\n                $top = '<!--'.$eol;\n                $footer = $eol.'-->';\n            }\n            $processed = $top.'/**'.$eol;\n            foreach ($lines as $line) {\n                $processed .= ' * '.$line.$eol;\n            }\n            $processed .= ' */'.$footer;\n            $this->setData(\n                'processed_license_'.$fileType,\n                $this->_filterString($processed, $fileType, array(), true, true)\n            );\n        }\n        return $this->getData('processed_license_'.$fileType);\n    }\n\n    /**\n     * get all placeholders\n     *\n     * @access public\n     * @param null $param\n     * @return array|null|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getPlaceholder($param = null)\n    {\n        if (is_null($this->_placeholders)) {\n            $this->_placeholders = array(\n                '{{DS}}'                                => DS,\n                '{{namespace}}'                         => $this->getNamespace(true),\n                '{{sort_order}}'                        => (int)$this->getSortOrder(),\n                '{{module}}'                            => strtolower($this->getModuleName()),\n                '{{Namespace}}'                         => $this->getNamespace(),\n                '{{Module}}'                            => $this->getModuleName(),\n                '{{NAMESPACE}}'                         => strtoupper($this->getNamespace()),\n                '{{MODULE}}'                            => strtoupper($this->getModuleName()),\n                '{{qwertyuiop}}'                        => $this->getQwertyuiop(),\n                '{{qwertyuiopp}}'                       => $this->getQwertyuiopp(),\n                '{{Y}}'                                 => date('Y'),\n                '{{entity_default_config}}'             => $this->getEntityDefaultConfig(),\n                '{{module_menu}}'                       => $this->escapeText($this->getMenuText()),\n                '{{codepool}}'                          => $this->getCodepool(),\n                '{{version}}'                           => $this->getVersion(),\n                '{{menuItemsXml}}'                      => $this->getMenuItemsXml(),\n                '{{menuAcl}}'                           => $this->getMenuAcl(),\n                '{{ModuleFolder}}'                      => ucfirst(strtolower($this->getModuleName())),\n                '{{ResourceSetup}}'                     => $this->getResourceSetupModel(),\n                '{{depends}}'                           => $this->getDepends(),\n                '{{productViewLayout}}'                 => $this->getProductViewLayout(),\n                '{{categoryViewLayout}}'                => $this->getCategoryViewLayout(),\n                '{{defaultLayoutHandle}}'               => $this->getFrontendDefaultLayoutHandle(),\n                '{{categoryMenuEvent}}'                 => $this->getCategoryMenuEvent(),\n                '{{customerCommentLinks}}'              => $this->getCustomerCommentLinks(),\n                '{{frontKey}}'                          => $this->getFrontKey(),\n                '{{SystemTabName}}'                     => $this->escapeText($this->getSystemTabName()),\n                '{{systemTabPosition}}'                 => $this->getSystemTabPosition(),\n                '{{RestResourceGroupsChildren}}'        => $this->getRestResourceGroupsChildren(),\n                '{{RestResources}}'                     => $this->getRestResources(),\n                '{{eavOptionsDefaults}}'                => $this->getEavOptionsDefaults()\n            );\n        }\n        if (is_null($param)) {\n            return $this->_placeholders;\n        }\n        if (isset($this->_placeholders[$param])) {\n            return $this->_placeholders[$param];\n        }\n        return '';\n    }\n\n    /**\n     * get config.xml default section\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityDefaultConfig()\n    {\n        $eol    = $this->getEol();\n        $text   = '';\n        if ($this->getCreateFrontend()) {\n            $text = $eol.$this->getPadding().'<default>'.$eol;\n            $text.= $this->getPadding(2).'<'.strtolower($this->getModuleName()).'>'.$eol;\n            foreach ($this->getEntities() as $entity) {\n                $text .= $this->getPadding(3).$entity->getDefaultConfig();\n            }\n            $text.= $this->getPadding(2).'</'.strtolower($this->getModuleName()).'>'.$eol;\n            $text.= $this->getPadding().'</default>';\n        }\n        return $text;\n    }\n\n    /**\n     * check if module related to catalog\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasCatalogRelation()\n    {\n        return $this->getLinkProduct() || $this->getLinkCategory();\n    }\n\n    /**\n     * get menu for entities\n     *\n     * @access public\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityMenu($padding)\n    {\n        $text = '';\n        foreach ($this->getEntities() as $entity) {\n            $text .= $entity->getMenu($padding);\n        }\n        return $text;\n    }\n\n    /**\n     * get menu ACL for entities\n     *\n     * @access public\n     * @param $padding\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityMenuAcl($padding)\n    {\n        $text = '';\n        foreach ($this->getEntities() as $entity) {\n            $text .= $entity->getMenuAcl($padding);\n        }\n        return $text;\n    }\n\n    /**\n     * sort source code files\n     *\n     * @access protected\n     * @param $files\n     * @param string $sortField\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _sortCodeFiles($files, $sortField = 'sort_order')\n    {\n        $sorted = array();\n        foreach ($files as $values) {\n            $sorted[(int)$values->$sortField][] = $values;\n        }\n        ksort($sorted);\n        $return = array();\n        foreach ($sorted as $values) {\n            foreach ($values as $file) {\n                $return[] = $file;\n            }\n        }\n        return $return;\n    }\n\n    /**\n     * get module name in lower case\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getLowerModuleName()\n    {\n        return strtolower($this->getModuleName());\n    }\n\n    /**\n     * get menu items xml\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMenuItemsXml()\n    {\n        $xml        = '';\n        $parts      = array();\n        $padding    = 2;\n        $namespace  = $this->getNamespace(true);\n        $eol        = $this->getEol();\n        if ($this->getMenuParent()) {\n            $parts = explode('/', $this->getMenuParent());\n        }\n        foreach ($parts as $part) {\n            $xml .= $this->getPadding($padding++).'<'.$part.'>'.$eol;\n            $xml .= $this->getPadding($padding++).'<children>'.$eol;\n        }\n        $xml .= $this->getPadding($padding++).'<'.$namespace.'_'.$this->getLowerModuleName().\n            ' translate=\"title\" module=\"'.$namespace.'_'.$this->getLowerModuleName().'\">'.$eol;\n        $xml .= $this->getPadding($padding).'<title>'.$this->getMenuText().'</title>'.$eol;\n        $xml .= $this->getPadding($padding).'<sort_order>'.$this->getSortOrder().'</sort_order>'.$eol;\n        $xml .= $this->getPadding($padding++).'<children>'.$eol;\n        $xml .= $this->getEntityMenu($padding);\n        $xml .= $this->getPadding(--$padding).'</children>'.$eol;\n        $xml .= $this->getPadding(--$padding).'</'.$namespace.'_'.$this->getLowerModuleName().'>';\n\n        $parts = array_reverse($parts);\n        foreach ($parts as $part) {\n            $xml .= $this->getPadding(--$padding).'</children>'.$eol;\n            $xml .= $this->getPadding(--$padding).'</'.$part.'>'.$eol;\n        }\n        return $xml;\n    }\n\n    /**\n     * get menu ACL\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getMenuAcl()\n    {\n        $xml        = '';\n        $parts      = array();\n        $padding    = 5;\n        $eol        = $this->getEol();\n        $namespace  = $this->getNamespace(true);\n        if ($this->getMenuParent()) {\n            $parts = explode('/', $this->getMenuParent());\n        }\n        foreach ($parts as $part) {\n            $xml .= $this->getPadding($padding++).'<'.$part.'>'.$eol;\n            $xml .= $this->getPadding($padding++).'<children>'.$eol;\n        }\n        $xml .= $this->getPadding($padding++).'<'.$namespace.'_'.\n            $this->getLowerModuleName().' translate=\"title\" module=\"'.\n            $namespace.'_'.$this->getLowerModuleName().'\">'.$eol;\n        $xml .= $this->getPadding($padding).'<title>'.$this->getMenuText().'</title>'.$eol;\n        $xml .= $this->getPadding($padding++).'<children>'.$eol;\n        $xml .= $this->getEntityMenuAcl($padding);\n        $xml .= $this->getPadding(--$padding).'</children>'.$eol;\n        $xml .= $this->getPadding(--$padding).'</'.$namespace.'_'.$this->getLowerModuleName().'>';\n\n        $parts = array_reverse($parts);\n        foreach ($parts as $part) {\n            $xml .= $this->getPadding(--$padding).'</children>'.$eol;\n            $xml .= $this->getPadding(--$padding).'</'.$part.'>'.$eol;\n        }\n        return $xml;\n    }\n\n    /**\n     * get resource setup base class\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getResourceSetupModel()\n    {\n        if ($this->getHasCatalogRelation() || $this->getHasEav() || $this->getHasCatalogAttribute()) {\n            return 'Mage_Catalog_Model_Resource_Setup';\n        }\n        return 'Mage_Core_Model_Resource_Setup';\n    }\n\n    /**\n     * sort the translation file\n     *\n     * @access protected\n     * @param string $content\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _sortTranslationFile($content)\n    {\n        $lines = explode($this->getEol(), $content);\n        $distinct = array();\n        foreach ($lines as $line) {\n            if (trim($line)) {\n                $distinct[$line] = 1;\n            }\n        }\n        //remove blank line\n        if (isset($distinct['\"\",\"\"'])) {\n            unset($distinct['\"\",\"\"']);\n        }\n        ksort($distinct);\n        $content = implode($this->getEol(), array_keys($distinct));\n        return $content;\n    }\n\n    /**\n     * this does nothing\n     * don't look through the code - go away\n     * I said it does nothing\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getQwertyuiop()\n    {\n        return $this->getHelper()->getQwertyuiop();\n    }\n\n    /**\n     * this also does nothing\n     * don't look here either\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getQwertyuiopp()\n    {\n        return $this->getHelper()->getQwertyuiopp();\n    }\n\n    /**\n     * check module dependency\n     *\n     * @access public\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getDepends()\n    {\n        if (!$this->hasData('_depends')) {\n            $dependency = array('<Mage_Core />'=>1);\n            if ($this->getLinkCore() || $this->getHasEav()) {\n                $dependency['<Mage_Catalog />'] = 1;\n            }\n            $eol = $this->getEol();\n            $padding = $this->getPadding(4);\n            $depends = '';\n            foreach ($dependency as $key=>$value) {\n                $depends = $padding.$key.$eol;\n            }\n            $this->setData('_depends', $depends);\n        }\n        return $this->getData('_depends');\n    }\n\n    /**\n     * get layout for product view page\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getProductViewLayout()\n    {\n        $content = '';\n        $padding = $this->getPadding(3);\n        $eol     = $this->getEol();\n        $tab     = $this->getPadding();\n        $ns      = $this->getNamespace(true);\n        $module  = $this->getLowerModuleName();\n        foreach ($this->getEntities() as $entity) {\n            $name  = strtolower($entity->getNameSingular());\n            $names = strtolower($entity->getNamePlural());\n            $label = $entity->getLabelPlural();\n            if ($entity->getShowOnProduct()) {\n                $content .= $padding.\n                    '<block type=\"'.$ns.'_'.$module.'/catalog_product_list_'.\n                    $name.'\" name=\"product.info.'.$names.'\" as=\"product_'.$names.\n                    '\" template=\"'.$ns.'_'.$module.'/catalog/product/list/'.$name.'.phtml\">'.$eol;\n                $content .= $padding.$tab.\n                    '<action method=\"addToParentGroup\"><group>detailed_info</group></action>'.$eol;\n                $content .= $padding.$tab.\n                    '<action method=\"setTitle\" translate=\"value\" module=\"'.\n                    $ns.'_'.$module.'\"><value>'.$label.'</value></action>'.$eol;\n                $content .= $padding.'</block>'.$eol;\n            }\n        }\n        return $content;\n    }\n    /**\n     * get layout for category view page\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCategoryViewLayout()\n    {\n        $content = '';\n        $padding = $this->getPadding(3);\n        $eol     = $this->getEol();\n        $ns      = $this->getNamespace(true);\n        $module  = $this->getLowerModuleName();\n        foreach ($this->getEntities() as $entity) {\n            $name  = $entity->getNameSingular(true);\n            $names = $entity->getNamePlural(true);\n            if ($entity->getShowOnCategory()) {\n                $content .= $padding.'<block type=\"'.\n                    $ns.'_'.$module.'/catalog_category_list_'.\n                    $name.'\" name=\"category.info.'.$names.\n                    '\" as=\"category_'.$names.'\" template=\"'.$ns.'_'.$module.\n                    '/catalog/category/list/'.$name.'.phtml\" after=\"-\" />'.$eol;\n            }\n        }\n        return $content;\n    }\n\n    /**\n     * get default layout handle\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontendDefaultLayoutHandle()\n    {\n        $padding    = $this->getPadding(1);\n        $tab        = $this->getPadding();\n        $eol        = $this->getEol();\n        /** @var Ultimate_ModuleCreator_Model_Entity[] $top */\n        $top        = array();\n        /** @var Ultimate_ModuleCreator_Model_Entity[] $footer */\n        $footer     = array();\n        $content    = $eol.$padding;\n        $namespace  = $this->getNamespace(true);\n        $tree       = false;\n        if ($this->getCreateFrontend()) {\n            foreach ($this->getEntities() as $entity) {\n                if ($entity->getCreateList()) {\n                    if ($entity->getListMenu() == Ultimate_ModuleCreator_Model_Source_Entity_Menu::TOP_LINKS) {\n                        $top[] = $entity;\n                    } elseif (\n                        $entity->getListMenu() == Ultimate_ModuleCreator_Model_Source_Entity_Menu::FOOTER_LINKS\n                    ) {\n                        $footer[] = $entity;\n                    }\n                    if ($entity->getIsTree()) {\n                        $tree = true;\n                    }\n                }\n            }\n        }\n        if (count($top) > 0 || count($footer) > 0 || $tree) {\n            $content .= '<default>'.$eol;\n            if ($tree) {\n                $content .= $padding.'<reference name=\"head\">'.$eol;\n                $content .= $padding.$tab.'<action method=\"addCss\"><js>css/'.\n                    $this->getNamespace(true).'_'.$this->getLowerModuleName().\n                    '/tree.css</js></action>'.$eol;\n                $content .= $padding.'</reference>'.$eol;\n            }\n            if (count($top) > 0) {\n                $content .= $padding.$tab.'<reference name=\"top.links\">'.$eol;\n                $position = 120;\n                foreach ($top as $entity) {\n                    $content .= $padding.$tab.$tab.'<action method=\"addLink\" translate=\"label title\" module=\"'.\n                        $namespace.'_'.$this->getLowerModuleName().'\">'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<label>'.$entity->getLabelPlural().'</label>'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<url helper=\"'.$namespace.'_'.\n                        $this->getLowerModuleName().'/'.strtolower($entity->getNameSingular()).'/get'.\n                        ucfirst(strtolower($entity->getNamePlural())).'Url\" />'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<title>'.$entity->getLabelPlural().'</title>'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<prepare />'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<urlParams/>'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<position>'.$position.'</position>'.$eol;\n                    $content .= $padding.$tab.$tab.'</action>'.$eol;\n                    $position += 10;\n                }\n                $content .= $padding.$tab.'</reference>'.$eol;\n            }\n            if (count($footer) > 0) {\n                $content .= $padding.$tab.'<reference name=\"footer_links\">'.$eol;\n                $position = 120;\n                foreach ($footer as $entity) {\n                    $content .= $padding.$tab.$tab.'<action method=\"addLink\" translate=\"label title\" module=\"'.\n                        $namespace.'_'.$this->getLowerModuleName().'\">'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<label>'.$entity->getLabelPlural().'</label>'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.\n                        '<url helper=\"'.$namespace.'_'.$this->getLowerModuleName().'/'.\n                        strtolower($entity->getNameSingular()).'/get'.\n                        ucfirst(strtolower($entity->getNamePlural())).'Url\" />'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<title>'.$entity->getLabelPlural().'</title>'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<prepare />'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<urlParams/>'.$eol;\n                    $content .= $padding.$tab.$tab.$tab.'<position>'.$position.'</position>'.$eol;\n                    $content .= $padding.$tab.$tab.'</action>'.$eol;\n                    $position += 10;\n                }\n                $content .= $padding.$tab.'</reference>'.$eol;\n            }\n            $content .= $padding.'</default>';\n        }\n        return $content;\n    }\n\n    /**\n     * get xml for category menu event\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCategoryMenuEvent()\n    {\n        if ($this->getShowInCategoryMenu()) {\n            $namespace  = $this->getNamespace(true);\n\n            $eol      = $this->getEol();\n            $padding  = $this->getPadding(2);\n            $tab      = $this->getPadding();\n            $content  = $eol;\n            $content .= $padding.'<events>'.$eol;\n            $content .= $padding.$tab.'<page_block_html_topmenu_gethtml_before>'.$eol;\n            $content .= $padding.$tab.$tab.'<observers>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'<'.$namespace.'_'.$this->getLowerModuleName().'>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.$tab.\n                '<class>'.$namespace.'_'.$this->getLowerModuleName().'/observer</class>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.$tab.'<method>addItemsToTopmenuItems</method>'.$eol;\n            $content .= $padding.$tab.$tab.$tab.'</'.$namespace.'_'.$this->getLowerModuleName().'>'.$eol;\n            $content .= $padding.$tab.$tab.'</observers>'.$eol;\n            $content .= $padding.$tab.'</page_block_html_topmenu_gethtml_before>'.$eol;\n            $content .= $padding.'</events>'.$eol;\n            return $content;\n        }\n        return '';\n    }\n\n    /**\n     * get customer comment links\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getCustomerCommentLinks()\n    {\n        $namespace  = $this->getNamespace(true);\n        $eol        = $this->getEol();\n        $padding    = $this->getPadding(3);\n        $content    = $eol;\n        $module     = $this->getLowerModuleName();\n        foreach ($this->getEntities() as $entity) {\n            if ($entity->getAllowComment()) {\n                $entityName = $entity->getNameSingular(true);\n                $label      = $entity->getLabelPlural();\n                $content   .= $padding . '<action method=\"addLink\" translate=\"label\" module=\"'.\n                    $namespace.'_'.$module.'\"><name>'.$entityName.'_comments</name><path>'.\n                    $namespace.'_'.$module.'/'.$entityName.'_customer_comment</path><label>'.\n                    $label.' Comments</label></action>'.$eol;\n            }\n        }\n        return $content;\n    }\n\n    /**\n     * get the module namespace\n     *\n     * @access public\n     * @param bool $lower\n     * @return mixed|string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNamespace($lower = false)\n    {\n        $namespace = $this->escapeText($this->getData('namespace'));\n        if ($lower) {\n            $namespace = strtolower($namespace);\n        }\n        return $namespace;\n    }\n\n    /**\n     * get front key\n     *\n     * @access public\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getFrontKey()\n    {\n        if (!$this->getCreateFrontend()) {\n            return $this->getData('front_key');\n        }\n        if (!$this->getData('front_key')) {\n            $frontKey = $this->getNamespace(true).'_'.$this->getLowerModuleName();\n            $this->setData('front_key', $frontKey);\n        }\n        return $this->getData('front_key');\n    }\n\n    /**\n     * system configuration tab name\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSystemTabName()\n    {\n        if (!$this->getData('system_tab')) {\n            $this->setData('system_tab', $this->getNamespace());\n        }\n        return $this->getData('system_tab');\n    }\n\n    /**\n     * system configuration tab position\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSystemTabPosition()\n    {\n        return (int)$this->getData('system_tab_position');\n    }\n\n    /**\n     * get xml for api2.xml resource groups children\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestResourceGroupsChildren()\n    {\n        $content = '';\n        foreach ($this->getEntities() as $entity) {\n            $content .= $entity->getRestResourceGroup(5);\n        }\n        return $content;\n    }\n\n    /**\n     * get xml for api2.xml resources\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getRestResources()\n    {\n        $content = '';\n        foreach ($this->getEntities() as $entity) {\n            $content .= $entity->getRestResource(3);\n        }\n        return $content;\n    }\n\n    /**\n     * get eav default values\n     *\n     * @access public\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEavOptionsDefaults()\n    {\n        $content = '';\n        foreach ($this->getEntities() as $entity) {\n            if ($entity->getIsEav()) {\n                foreach ($entity->getAttributes() as $attribute) {\n                    $content .= $attribute->getDefaultValueSetup();\n                }\n            }\n        }\n        return $content;\n    }\n\n    /**\n     * check if there are sibling relations\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasRelationColumnRenderer()\n    {\n        if (count($this->getRelations(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_SIBLING)) > 0) {\n            return true;\n        }\n        foreach ($this->getEntities() as $_entity) {\n            if ($_entity->getLinkCore()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * check if there are parent-child relations\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasParentRelation()\n    {\n        $parentRelations = $this->getRelations(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_PARENT);\n        if (count($parentRelations)) {\n            return true;\n        }\n        $childRelations = $this->getRelations(Ultimate_ModuleCreator_Model_Relation::RELATION_TYPE_CHILD);\n        if (count($childRelations)) {\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Relation.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Relation extends Ultimate_ModuleCreator_Model_Abstract\n{\n    /**\n     * relation type constants\n     */\n    const RELATION_TYPE_NONE    = 'none';\n    const RELATION_TYPE_CHILD   = 'child';\n    const RELATION_TYPE_PARENT  = 'parent';\n    const RELATION_TYPE_SIBLING = 'sibling';\n\n    /**\n     * @var Ultimate_ModuleCreator_Model_Entity\n     */\n    protected $_entity1;\n\n    /**\n     * @var Ultimate_ModuleCreator_Model_Entity\n     */\n    protected $_entity2;\n\n    /**\n     * relation type\n     *\n     * @var string\n     */\n    protected $_type;\n\n    /**\n     * set entities in relation\n     *\n     * @access public\n     * @param Ultimate_ModuleCreator_Model_Entity $entity1\n     * @param Ultimate_ModuleCreator_Model_Entity $entity2\n     * @param int $type\n     * @return Ultimate_ModuleCreator_Model_Relation\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setEntities(\n        Ultimate_ModuleCreator_Model_Entity $entity1,\n        Ultimate_ModuleCreator_Model_Entity $entity2,\n        $type\n    ) {\n        $this->_entity1 = $entity1;\n        $this->_entity2 = $entity2;\n        $this->_type    = $type;\n        switch($type) {\n            case self::RELATION_TYPE_NONE:\n                break;\n            case self::RELATION_TYPE_CHILD:\n                $this->_entity1->addRelatedEntity($type, $this->_entity2);\n                $this->_entity2->addRelatedEntity(self::RELATION_TYPE_PARENT, $this->_entity1);\n                break;\n            case self::RELATION_TYPE_PARENT:\n                $this->_entity1->addRelatedEntity($type, $this->_entity2);\n                $this->_entity2->addRelatedEntity(self::RELATION_TYPE_CHILD, $this->_entity1);\n                break;\n            case self::RELATION_TYPE_SIBLING:\n                $this->_entity1->addRelatedEntity($type, $this->_entity2);\n                $this->_entity2->addRelatedEntity(self::RELATION_TYPE_SIBLING, $this->_entity1);\n                break;\n            default:\n                break;\n        }\n        return $this;\n    }\n\n    /**\n     * get the relation type\n     *\n     * @access public\n     * @return int\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getType()\n    {\n        return $this->_type;\n    }\n\n    /**\n     * get relation entities\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Entity[]\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntities()\n    {\n        return array($this->_entity1, $this->_entity2);\n    }\n\n    /**\n     * relation to xml\n     *\n     * @access protected\n     * @param array $arrAttributes\n     * @param string $rootName\n     * @param bool $addOpenTag\n     * @param bool $addCdata\n     * @return string\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toXml(array $arrAttributes = array(), $rootName = 'relation', $addOpenTag=false, $addCdata=false)\n    {\n        $xml = '';\n        $eol = $this->getEol();\n        if ($rootName) {\n            $xml .= '<'.$rootName.'>'.$eol;\n        }\n        $entities = $this->getEntities();\n        $xml .= '<'.$entities[0]->getNameSingular().'_'.$entities[1]->getNameSingular().'>';\n        $xml .= $this->getType();\n        $xml .= '</'.$entities[0]->getNameSingular().'_'.$entities[1]->getNameSingular().'>'.$eol;\n        if ($rootName) {\n            $xml .= '</'.$rootName.'>'.$eol;\n        }\n        return $xml;\n    }\n\n    /**\n     * check if siblings can be listed in the entity view page\n     *\n     * @access public\n     * @param int $index\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getShowFrontendRelationSiblings($index)\n    {\n        if ($this->getType() != self::RELATION_TYPE_SIBLING) {\n            return false;\n        }\n        $index = !!$index;\n        $entities = $this->getEntities();\n        $e = $entities[$index];\n        return $e->getCreateView();\n    }\n\n    /**\n     * check if children can be listed in the parent view page\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getShowFrontendRelationChildren()\n    {\n        if ($this->getType() == self::RELATION_TYPE_CHILD) {\n            $index = 1;\n        } elseif ($this->getType() == self::RELATION_TYPE_PARENT) {\n            $index = 0;\n        } else {\n            return false;\n        }\n        $entities = $this->getEntities();\n        $e = $entities[$index];\n        return $e->getCreateView();\n    }\n\n    /**\n     * check if a relations has tree entities\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getHasTree()\n    {\n        return $this->_entity1->getIsTree() || $this->_entity2->getIsTree();\n    }\n\n    /**\n     * check if a relations does not have tree entities\n     *\n     * @access public\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getNotHasTree()\n    {\n        return !$this->getHasTree();\n    }\n\n    /**\n     * check if one of the entities behaves as tree\n     *\n     * @access public\n     * @param int $index\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityIsTree($index)\n    {\n        $entities = $this->getEntities();\n        return $entities[$index]->getIsTree();\n    }\n\n    /**\n     * check if one of the entities behaves as tree\n     *\n     * @access public\n     * @param int $index\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSiblingIsTree($index)\n    {\n        return $this->getEntityIsTree(1 - $index);\n    }\n\n    /**\n     * check if one of the entities does not behave as tree\n     *\n     * @access public\n     * @param int $index\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getSiblingIsNotTree($index)\n    {\n        return !$this->getSiblingIsTree($index);\n    }\n\n    /**\n     * check if entity has API\n     *\n     * @access public\n     * @param int $index\n     * @return bool\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getEntityHasApi($index)\n    {\n        $entities = $this->getEntities();\n        return $entities[$index]->getApi();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Source/Attribute/Scope.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * allowed attribute scopes\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Source_Attribute_Scope\n{\n    /**\n     * options\n     *\n     * @var null\n     */\n    protected $_options = null;\n    /**\n     * get options array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray($withEmpty = false)\n    {\n        if (is_null($this->_options)) {\n            $this->_options = array();\n            $this->_options[] = array(\n                'label' => Mage::helper('modulecreator')->__('Store View'),\n                'value' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE\n            );\n            $this->_options[] = array(\n                'label' => Mage::helper('modulecreator')->__('Website'),\n                'value' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE\n            );\n            $this->_options[] = array(\n                'label' => Mage::helper('modulecreator')->__('Global'),\n                'value' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL\n            );\n        }\n        $options = $this->_options;\n        if ($withEmpty) {\n            $options = array_merge(array(''=>''), $options);\n        }\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Source/Attribute/Type.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * allowed attribute types\n *\n * @category    Ultimate\n * @package        Ultimate_ModuleCreator\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Source_Attribute_Type\n{\n    /**\n     * options\n     *\n     * @var mixed\n     */\n    protected $_options = null;\n    /**\n     * get options array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray($withEmpty = false)\n    {\n        if (is_null($this->_options)) {\n            /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n            $helper = Mage::helper('modulecreator');\n            $types  = $helper->getAttributeTypes();\n            $groups = $helper->getAttributeTypeGroups();\n            foreach ($groups as $key=>$group) {\n                $this->_options[$key] = array('label'=>(string)$group->label, 'value'=>array());\n            }\n            foreach ($types as $type=>$values) {\n                $group = (string)$values->group;\n                if (!empty($group) && isset($this->_options[$group])) {\n                    $this->_options[$group]['value'][] = array('label'=>(string)$values->label, 'value'=>$type);\n                } else {\n                    $this->_options[] = array('label'=>(string)$values->label, 'value'=>$type);\n                }\n            }\n            $this->_options = array_values($this->_options);\n        }\n        $options = $this->_options;\n        if ($withEmpty) {\n            array_unshift($options, array('label'=>'', 'value'=>''));\n        }\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Source/Attribute/Value/Source.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * allowed attribute sources\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Source_Attribute_Value_Source\n{\n    /**\n     * options\n     *\n     * @var mixed\n     */\n    protected $_options = null;\n\n    /**\n     * get options array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray($withEmpty = false)\n    {\n        if (is_null($this->_options)) {\n            /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n            $helper = Mage::helper('modulecreator');\n            $options = $helper->getDropdownSubtypes(true);\n            $this->_options = array();\n            foreach ($options as $key=>$option) {\n                $this->_options[$key] = $option->label;\n            }\n        }\n        $options = $this->_options;\n        if ($withEmpty) {\n            $options = array_merge(array(''=>''), $options);\n        }\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Source/Codepool.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */ \n/**\n * code pool source model\n * \n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */ \nclass Ultimate_ModuleCreator_Model_Source_Codepool\n{\n    /**\n     * get the list of available code pools\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toOptionArray($withEmpty = false)\n    {\n        $options = array();\n        if ($withEmpty) {\n            $options[] = array(\n                'value'=>'',\n                'label'=>Mage::helper('modulecreator')->__('Select a codepool')\n            );\n        }\n        $options[] = array('value' => 'local',         'label'=>'local');\n        $options[] = array('value' => 'community',     'label'=>'community');\n        return $options;\n    }\n\n    /**\n     * get options as an array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAllOptions($withEmpty = true)\n    {\n        $options = array();\n        foreach ($this->toOptionArray($withEmpty) as $option) {\n            $options[$option['value']] = $option['label'];\n        }\n        return $options;\n    }\n\n    /**\n     * get options as an array - wrapper\n     *\n     * @param bool $withEmpty\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray($withEmpty = true)\n    {\n        return $this->getAllOptions($withEmpty);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Source/Entity/Layout.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * allowed entity layouts\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Source_Entity_Layout\n{\n    /**\n     * options\n     *\n     * @var mixed\n     */\n    protected $_options = null;\n    /**\n     * get options array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray($withEmpty = false)\n    {\n        if (is_null($this->_options)) {\n            /** @var Mage_Page_Model_Source_Layout $layoutModel */\n            $layoutModel = Mage::getSingleton('page/source_layout');\n            $_options    = $layoutModel->toOptionArray();\n            foreach ($_options as $option) {\n                $this->_options[$option['value']] = $option['label'];\n            }\n        }\n        $options = $this->_options;\n        if ($withEmpty) {\n            $options = array_merge(array(''=>''), $options);\n        }\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Source/Entity/Menu.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * available menus\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Source_Entity_Menu\n{\n    const NO_MENU       = 0;\n    const TOP_LINKS     = 1;\n    const CATEGORY_MENU = 2;\n    const FOOTER_LINKS  = 3;\n\n    /**\n     * options\n     *\n     * @var mixed\n     */\n    protected $_options = null;\n\n    /**\n     * get options array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray($withEmpty = false)\n    {\n        if (is_null($this->_options)) {\n            $this->_options[self::NO_MENU]       = Mage::helper('modulecreator')->__('Do not include in any menu');\n            $this->_options[self::TOP_LINKS]     = Mage::helper('modulecreator')\n                ->__('Include in top links. (near My account, Checkout, ...)');\n            $this->_options[self::CATEGORY_MENU] = Mage::helper('modulecreator')->__('Include in category menu');\n            $this->_options[self::FOOTER_LINKS]  = Mage::helper('modulecreator')->__('Include in footer links');\n        }\n        $options = $this->_options;\n        if ($withEmpty) {\n            $options = array_merge(array(''=>''), $options);\n        }\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Source/Entity/Type.php",
    "content": "<?php\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * allowed entity types\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Source_Entity_Type\n{\n    /**\n     * options\n     *\n     * @var mixed\n     */\n    protected $_options = null;\n\n    /**\n     * get options array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array|null\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray($withEmpty = false)\n    {\n        if (is_null($this->_options)) {\n            /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n            $helper = Mage::helper('modulecreator');\n            $types  = $helper->getEntityTypes();\n            foreach ($types as $type=>$values) {\n                $this->_options[$type] = Mage::helper('modulecreator')->__((string)$values->label);\n            }\n        }\n        $options = $this->_options;\n        if ($withEmpty) {\n            $options = array_merge(array(''=>''), $options);\n        }\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Source/Install.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * install source mode\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Model_Source_Install\n{\n    /**\n     * get the list of available install actions\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toOptionArray($withEmpty = false)\n    {\n        $options = array();\n        if ($withEmpty) {\n            $options[] = array(\n                'value'=>'',\n                'label'=>Mage::helper('modulecreator')->__('Select action')\n            );\n        }\n        $options[] = array(\n            'value' => '1',\n            'label'=>Mage::helper('modulecreator')->__('Install new extension on the current instance.')\n        );\n        $options[] = array(\n            'value' => '0',\n            'label'=>Mage::helper('modulecreator')->__('Create archive. I will install it later')\n        );\n        return $options;\n    }\n\n    /**\n     * get options as an array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function getAllOptions($withEmpty = true)\n    {\n        $options = array();\n        foreach ($this->toOptionArray($withEmpty) as $option) {\n            $options[$option['value']] = $option['label'];\n        }\n        return $options;\n    }\n\n    /**\n     * get options as an array - wrapper\n     *\n     * @param bool $withEmpty\n     * @return array\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function toArray($withEmpty = true)\n    {\n        return $this->getAllOptions($withEmpty);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/Model/Writer.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2012\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */ \n/**\n * Zip writer\n * \n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */   \nclass Ultimate_ModuleCreator_Model_Writer extends Mage_Connect_Package_Writer\n{\n    /**\n     * prefix for path\n     *\n     * @var string\n     */\n    protected $_pathPrefix = '';\n\n    /**\n     * set path prefix\n     *\n     * @param $pathPrefix\n     * @return $this\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setPathPrefix($pathPrefix)\n    {\n        $this->_pathPrefix = $pathPrefix;\n        return $this;\n    }\n\n    /**\n     * build the package\n     *\n     * @access public\n     * @return Ultimate_ModuleCreator_Model_Writer\n     * @see Mage_Connect_Package_Writer::composePackage()\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function composePackage()\n    {\n        @mkdir(self::PATH_TO_TEMPORARY_DIRECTORY, 0777, true);\n        $root = self::PATH_TO_TEMPORARY_DIRECTORY . basename($this->_namePackage);\n        @mkdir($root, 0777, true);\n        foreach ($this->_files as $file) {\n            if (is_dir($file) || is_file($file)) {\n                $fileName = basename($file);\n                $filePath = dirname($file);\n                if (substr($filePath, 0, strlen($this->_pathPrefix)) == $this->_pathPrefix) {\n                    $filePath = substr($filePath, strlen($this->_pathPrefix));\n                }\n                @mkdir($root . DS . $filePath, 0777, true);\n                if (is_file($file)) {\n                    copy($file, $root . DS . $filePath . DS . $fileName);\n                } else {\n                    @mkdir($root . DS . $filePath . $fileName, 0777);\n                }\n            }\n        }\n        $this->_temporaryPackageDir = $root;\n        return $this;\n    }\n\n    /**\n     * set the package name\n     *\n     * @access public\n     * @param string $name\n     * @return Ultimate_ModuleCreator_Model_Writer\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function setNamePackage($name)\n    {\n        $this->_namePackage = $name;\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/controllers/Adminhtml/ModulecreatorController.php",
    "content": "<?php \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n */\n/**\n * main admin controller\n *\n * @category    Ultimate\n * @package     Ultimate_ModuleCreator\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\n */\nclass Ultimate_ModuleCreator_Adminhtml_ModulecreatorController extends Mage_Adminhtml_Controller_Action\n{\n    /**\n     * default action\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function indexAction()\n    {\n        $this->_title(Mage::helper('modulecreator')->__('Ultimate module creator'));\n        $this->_getSession()->addNotice(\n            Mage::helper('modulecreator')->__(\n                'To delete a module from this list go to \"<strong>%s</strong>\" and remove the files \"<strong>%s</strong>\" and \"<strong>%s</strong>\" and folder \"<strong>%s</strong>\" if they exist. Replace <strong>Namespace_Module</strong> with the appropriate value for each module. There is no delete link in here for security reasons.',\n                Mage::getBaseDir('var').DS.'modulecreator',\n                'Namespace_Module.tgz',\n                'package/Namespace_Module.xml',\n                'package/Namespace_Module/'\n            )\n        );\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * grid action\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function gridAction()\n    {\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * new action\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function newAction()\n    {\n        $this->_forward('edit');\n    }\n\n    /**\n     * edit action\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function editAction()\n    {\n        $module = $this->_initModule();\n        $this->_title(Mage::helper('modulecreator')->__('Ultimate module creator'));\n        if ($module) {\n            $extensionName = $module->getNamespace().'_'.$module->getModuleName();\n            $this->_getSession()->addNotice(\n                Mage::helper('modulecreator')->__(\n                    'You are editing the module: %s',\n                    $extensionName\n                )\n            );\n            $this->_title($extensionName);\n        } else {\n            $this->_title(Mage::helper('modulecreator')->__('Add module'));\n        }\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * init module\n     *\n     * @access protected\n     * @return mixed\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _initModule()\n    {\n        $packageName = base64_decode(strtr($this->getRequest()->getParam('id'), '-_,', '+/='));\n        if ($packageName) {\n            try {\n                /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n                $helper      = Mage::helper('modulecreator');\n                $path        = $helper->getLocalPackagesPath();\n                $packageName = basename($packageName);\n                $xmlFile = $path . $packageName . '.xml';\n                if (file_exists($xmlFile) && is_readable($xmlFile)) {\n                    $xml = simplexml_load_file($xmlFile, 'Varien_Simplexml_Element');\n                    $module = $helper->loadModule($xml);\n                    Mage::register('current_module', $module);\n                    return $module;\n                }\n            } catch (Exception $e) {\n                Mage::logException($e);\n                $this->_getSession()->addError($e->getMessage());\n                $this->_redirect('*/*/index');\n            }\n        }\n        return false;\n    }\n\n    /**\n     * init a module from an array\n     *\n     * @access public\n     * @param array $data\n     * @return Ultimate_ModuleCreator_Model_Module\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    protected function _initModuleFromData($data)\n    {\n        $entitiesByIndex = array();\n        /** @var Ultimate_ModuleCreator_Model_Module $module */\n        $module = Mage::getModel('modulecreator/module');\n        if (isset($data['settings'])) {\n            $module->addData($data['settings']);\n        }\n        if (isset($data['entity'])) {\n            $entities = $data['entity'];\n            if (is_array($entities)) {\n                foreach ($entities as $key=>$entityData) {\n                    /** @var Ultimate_ModuleCreator_Model_Entity $entity */\n                    $entity = Mage::getModel('modulecreator/entity');\n                    $entity->addData($entityData);\n                    $entity->setIndex($key);\n                    if (isset($entityData['attributes']) && is_array($entityData['attributes'])) {\n                        if (isset($entityData['attributes']['is_name'])) {\n                            $isName = $entityData['attributes']['is_name'];\n                            unset($entityData['attributes']['is_name']);\n                            if (isset($entityData['attributes'][$isName])) {\n                                $entityData['attributes'][$isName]['is_name'] = 1;\n                            }\n                        }\n                        foreach ($entityData['attributes'] as $aKey=>$attributeData) {\n                            /** @var Ultimate_ModuleCreator_Model_Attribute $attribute */\n                            $attribute = Mage::getModel('modulecreator/attribute');\n                            $attribute->addData($attributeData);\n                            $attribute->setIndex($aKey);\n                            $entity->addAttribute($attribute);\n                        }\n                    }\n                    $module->addEntity($entity);\n                    $entitiesByIndex[$key] = $entity;\n                }\n            }\n            if (isset($data['relation'])) {\n                foreach($data['relation'] as $index => $values) {\n                    foreach ($values as $jndex=>$type) {\n                        if (isset($entitiesByIndex[$index]) && isset($entitiesByIndex[$jndex])) {\n                            /** @var Ultimate_ModuleCreator_Model_Relation $relation */\n                            $relation = Mage::getModel('modulecreator/relation');\n                            $relation->setEntities($entitiesByIndex[$index], $entitiesByIndex[$jndex], $type);\n                            $module->addRelation($relation);\n                        }\n                    }\n                }\n            }\n        }\n        return $module;\n    }\n\n    /**\n     * validate module before saving\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function validateAction()\n    {\n        try{\n            $response = new Varien_Object();\n            $module = $this->_initModuleFromData($this->getRequest()->getPost());\n            $errors = $module->validate();\n            if (count($errors) == 0) {\n                $messages = $module->buildModule();\n                $module->save();\n                $response->setError(false);\n            } else {\n                if (isset($errors[''])) {\n                    $response->setMessage(implode('<br />', $errors['']));\n                    unset($errors['']);\n                }\n                $response->setError(true);\n                $response->setAttributes($errors);\n            }\n        } catch (Exception $e){\n            $response->setError(true);\n            $response->setMessage($e->getMessage());\n        }\n        $this->getResponse()->setBody($response->toJson());\n    }\n\n    /**\n     * save module - actually only redirects the page\n     * the save was done in validateAction(). there is no need to process the request twice.\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function saveAction()\n    {\n        $this->_getSession()->addSuccess(\n            Mage::helper('modulecreator')->__('Your extension has been created!')\n        );\n        $module = $this->_initModuleFromData($this->getRequest()->getPost());\n        $redirectBack = $this->getRequest()->getParam('back', false);\n        if ($redirectBack) {\n            $this->_redirect(\n                '*/*/edit',\n                array(\n                    'id'    => strtr(base64_encode($module->getExtensionName()), '+/=', '-_,'),\n                    '_current'    => true\n                )\n            );\n        } else {\n            $this->_redirect('*/*/');\n        }\n    }\n\n    /**\n     * download module action\n     *\n     * @access public\n     * @return void\n     * @author Marius Strajeru <ultimate.module.creator@gmail.com>\n     */\n    public function downloadAction()\n    {\n        $what = $this->getRequest()->getParam('type');\n        $packageName = base64_decode(strtr($this->getRequest()->getParam('id'), '-_,', '+/='));\n        /** @var Ultimate_ModuleCreator_Helper_Data $helper */\n        $helper = Mage::helper('modulecreator');\n        $path   = $helper->getLocalModulesDir();\n        $namePrefix = '';\n        switch ($what) {\n            case 'config' :\n                $file = $path.'package'.DS.$packageName . '.xml';\n                break;\n            case 'list':\n                $file = $path.'package'.DS.$packageName . DS. 'files.log';\n                $namePrefix = $packageName.'_';\n                break;\n            case 'uninstall' :\n                $file = $path.'package'.DS.$packageName . DS. 'uninstall.sql';\n                $namePrefix = $packageName.'_';\n                break;\n            default:\n                $file = $path . $packageName . '.tgz';\n                break;\n        }\n        if (file_exists($file) && is_readable($file)) {\n            $content = file_get_contents($file);\n            $this->_prepareDownloadResponse($namePrefix.basename($file), $content);\n        } else {\n            $this->_getSession()->addError(\n                Mage::helper('modulecreator')->__(\n                    'Your extension archive was not created or is not readable'\n                )\n            );\n            $this->_redirect('*/*');\n        }\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/adminhtml.xml",
    "content": "<?xml version=\"1.0\"?>\n<!-- \n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category       Ultimate\n * @package        Ultimate_ModuleCreator\n * @copyright      Copyright (c) 2014\n * @license        http://opensource.org/licenses/mit-license.php MIT License\n */\n -->\n<config>\n    <acl>\n        <resources>\n            <admin>\n                <children>\n                    <system>\n                        <children>\n                            <config>\n                                <children>\n                                    <modulecreator translate=\"title\" module=\"modulecreator\">\n                                        <title>Ultimate module creator</title>\n                                    </modulecreator>\n                                </children>\n                            </config>\n                            <modulecreator translate=\"title\" module=\"modulecreator\">\n                                <title>Module creator</title>\n                                <sort_order>10</sort_order>\n                            </modulecreator>\n                        </children>\n                    </system>\n                </children>\n            </admin>\n        </resources>\n    </acl>\n    <menu>\n        <system>\n            <children>\n                <modulecreator translate=\"title\" module=\"modulecreator\">\n                    <title>Module creator</title>\n                    <sort_order>10</sort_order>\n                    <action>adminhtml/modulecreator</action>\n                    <depends>\n                        <module>Ultimate_ModuleCreator</module>\n                    </depends>\n                </modulecreator>\n            </children>\n        </system>\n    </menu>\n</config>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/config.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category   Ultimate\n * @package    Ultimate_ModuleCreator\n * @copyright  Copyright (c) 2014\n * @license    http://opensource.org/licenses/mit-license.php MIT License\n */\n -->\n<config>\n    <modules>\n        <Ultimate_ModuleCreator>\n            <version>1.9.6.0</version>\n            <build />\n        </Ultimate_ModuleCreator>\n    </modules>\n    <global>\n        <blocks>\n            <modulecreator>\n                <class>Ultimate_ModuleCreator_Block</class>\n            </modulecreator>\n        </blocks>\n        <helpers>\n            <modulecreator>\n                <class>Ultimate_ModuleCreator_Helper</class>\n            </modulecreator>\n        </helpers>\n        <models>\n            <modulecreator>\n                <class>Ultimate_ModuleCreator_Model</class>\n            </modulecreator>\n        </models>\n    </global>\n    <adminhtml>\n        <translate>\n            <modules>\n                <Ultimate_ModuleCreator>\n                    <files>\n                        <default>Ultimate_ModuleCreator.csv</default>\n                    </files>\n                </Ultimate_ModuleCreator>\n            </modules>\n        </translate>\n        <layout>\n            <updates>\n                <ultimate_modulecreator>\n                    <file>ultimate_modulecreator.xml</file>\n                </ultimate_modulecreator>\n            </updates>\n        </layout>\n    </adminhtml>\n    <admin>\n        <routers>\n            <adminhtml>\n                <args>\n                    <modules>\n                        <Ultimate_ModuleCreator before=\"Mage_Adminhtml\">Ultimate_ModuleCreator_Adminhtml</Ultimate_ModuleCreator>\n                    </modules>\n                </args>\n            </adminhtml>\n        </routers>\n    </admin>\n    <default>\n        <modulecreator>\n            <general>\n                <help>1</help>\n                <collapsed>1</collapsed>\n                <tooltips>1</tooltips>\n            </general>\n            <settings>\n                <namespace>Ultimate</namespace>\n                <codepool>local</codepool>\n                <install>0</install>\n                <version>1.0.0</version>\n                <system_tab_position>2000</system_tab_position>\n                <license><![CDATA[\n{{Namespace}}_{{Module}} extension\n\nNOTICE OF LICENSE\n\nThis source file is subject to the MIT License\nthat is bundled with this package in the file LICENSE.txt.\nIt is also available through the world-wide-web at this URL:\nhttp://opensource.org/licenses/mit-license.php\n\n@category       {{Namespace}}\n@package        {{Namespace}}_{{Module}}\n@copyright      Copyright (c) {{Y}}\n@license        http://opensource.org/licenses/mit-license.php MIT License\n]]></license>\n            </settings>\n            <entity>\n                <type>flat</type>\n                <is_tree>0</is_tree>\n                <store>1</store>\n                <add_created_to_grid>1</add_created_to_grid>\n                <add_updated_to_grid>1</add_updated_to_grid>\n                <search>1</search>\n                <api>0</api>\n                <rest>0</rest>\n                <create_frontend>1</create_frontend>\n                <create_list>1</create_list>\n                <list_template>two_columns_left</list_template>\n                <create_view>1</create_view>\n                <view_template>two_columns_left</view_template>\n                <add_seo>1</add_seo>\n                <url_rewrite>1</url_rewrite>\n                <rss>1</rss>\n                <widget>1</widget>\n                <allow_comment>1</allow_comment>\n                <manage_comment>1</manage_comment>\n                <link_product>0</link_product>\n                <show_on_product>1</show_on_product>\n                <show_products>1</show_products>\n                <product_attribute>0</product_attribute>\n                <product_attribute_scope>1</product_attribute_scope>\n                <link_category>0</link_category>\n                <show_on_category>1</show_on_category>\n                <show_category>1</show_category>\n                <category_attribute>0</category_attribute>\n                <category_attribute_scope>1</category_attribute_scope>\n                <product_attribute_group>General</product_attribute_group>\n                <category_attribute_group>General Information</category_attribute_group>\n            </entity>\n            <attribute>\n                <type>text</type>\n                <scope>0</scope>\n                <required>1</required>\n                <editor>0</editor>\n                <admin_grid>1</admin_grid>\n                <frontend>1</frontend>\n                <widget>1</widget>\n                <rss>1</rss>\n                <options_source>custom</options_source>\n            </attribute>\n        </modulecreator>\n    </default>\n</config>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/jstranslator.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n/**\n * Ultimate_ModuleCreator extension\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the MIT License\n * that is bundled with this package in the file LICENSE_UMC.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/mit-license.php\n *\n * @category   Ultimate\n * @package    Ultimate_ModuleCreator\n * @copyright  Copyright (c) 2014\n * @license    http://opensource.org/licenses/mit-license.php MIT License\n */\n -->\n<jstranslator>\n    <are-you-sure translate=\"message\" module=\"modulecreator\">\n        <message>Are you sure?</message>\n    </are-you-sure>\n    <remove-field-attribute translate=\"message\" module=\"modulecreator\">\n        <message>Remove field / attribute</message>\n    </remove-field-attribute>\n</jstranslator>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Catalog/Category/Tab/Entity/010_tree",
    "content": "<?php\n{{License}}\n/**\n * categories - {{entity}} relation edit block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Category_Tab_{{Entity}} extends {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Tree\n{\n    protected $_{{entity}}Ids = null;\n    protected $_selectedNodes = null;\n\n    /**\n     * constructor\n     * Specify template to use\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setTemplate('{{namespace}}_{{module}}/catalog/category/tab/{{entities}}.phtml');\n    }\n\n    /**\n     * Retrieve currently edited category\n     *\n     * @access public\n     * @return Mage_Catalog_Model_Entity\n     * {{qwertyuiop}}\n     */\n    public function getCategory()\n    {\n        return Mage::registry('current_category');\n    }\n\n    /**\n     * Return array with {{entitiesLabel}} IDs which the category is linked to\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function get{{Entities}}Ids()\n    {\n        if (is_null($this->_{{entities}}Ids)) {\n            ${{entities}} = Mage::helper('{{namespace}}_{{module}}/category')\n                ->getSelected{{Entities}}($this->getCategory());\n            $ids = array();\n            foreach (${{entities}} as ${{entity}}) {\n                $ids[] = ${{entity}}->getId();\n            }\n            $this->_{{entity}}Ids = $ids;\n        }\n        return $this->_{{entity}}Ids;\n    }\n\n    /**\n     * Forms string out of get{{Entity}}Ids()\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getIdsString()\n    {\n        return implode(',', $this->get{{Entities}}Ids());\n    }\n\n    /**\n     * Returns root node and sets 'checked' flag (if necessary)\n     *\n     * @access public\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRootNode()\n    {\n        $root = $this->getRoot();\n        if ($root && in_array($root->getId(), $this->get{{Entities}}Ids())) {\n            $root->setChecked(true);\n        }\n        return $root;\n    }\n\n    /**\n     * Returns root node\n     *\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}|null $parentNode{{Entity}}\n     * @param int  $recursionLevel\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRoot($parentNode{{Entity}} = null, $recursionLevel = 3)\n    {\n        if (!is_null($parentNode{{Entity}}) && $parentNode{{Entity}}->getId()) {\n            return $this->getNode($parentNode{{Entity}}, $recursionLevel);\n        }\n        $root = Mage::registry('{{entity}}_root');\n        if (is_null($root)) {\n            $rootId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n            $ids = $this->getSelected{{Entity}}PathIds($rootId);\n            $tree = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_tree')\n                ->loadByIds($ids, false, false);\n            if ($this->getCategory()) {\n                $tree->loadEnsuredNodes($this->getCategory(), $tree->getNodeById($rootId));\n            }\n            $tree->addCollectionData($this->get{{Entity}}Collection());\n            $root = $tree->getNodeById($rootId);\n            Mage::register('{{entity}}_root', $root);\n        }\n        return $root;\n    }\n\n    /**\n     * Returns array with configuration of current node\n     *\n     * @access public\n     * @param Varien_Data_Tree_Node $node\n     * @param int $level How deep is the node in the tree\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getNodeJson($node, $level = 1)\n    {\n        $item = parent::_getNodeJson($node, $level);\n        if ($this->_isParentSelected{{Entity}}($node)) {\n            $item['expanded'] = true;\n        }\n        if (in_array($node->getId(), $this->get{{Entities}}Ids())) {\n            $item['checked'] = true;\n        }\n        return $item;\n    }\n\n    /**\n     * Returns whether $node is a parent (not exactly direct) of a selected node\n     *\n     * @access public\n     * @param Varien_Data_Tree_Node $node\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _isParentSelected{{Entity}}($node)\n    {\n        $result = false;\n        // Contains string with all {{entityLabel}} IDs of children (not exactly direct) of the node\n        $allChildren = $node->getAllChildren();\n        if ($allChildren) {\n            $selected{{Entity}}Ids = $this->get{{Entity}}Ids();\n            $allChildrenArr = explode(',', $allChildren);\n            for ($i = 0, $cnt = count($selected{{Entity}}Ids); $i < $cnt; $i++) {\n                $isSelf = $node->getId() == $selected{{Entity}}Ids[$i];\n                if (!$isSelf && in_array($selected{{Entity}}Ids[$i], $allChildrenArr)) {\n                    $result = true;\n                    break;\n                }\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * Returns array with nodes those are selected (contain current {{entityLabel}})\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getSelectedNodes()\n    {\n        if ($this->_selectedNodes === null) {\n            $this->_selectedNodes = array();\n            $root = $this->getRoot();\n            foreach ($this->get{{Entity}}Ids() as ${{entity}}Id) {\n                if ($root) {\n                    $this->_selectedNodes[] = $root->getTree()->getNodeById(${{entity}}Id);\n                }\n            }\n        }\n        return $this->_selectedNodes;\n    }\n\n    /**\n     * Returns JSON-encoded array of {{entityLabel}} children\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}ChildrenJson(${{entity}}Id)\n    {\n        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id);\n        $node = $this->getRoot(${{entity}}, 1)->getTree()->getNodeById(${{entity}}Id);\n        if (!$node || !$node->hasChildren()) {\n            return '[]';\n        }\n        $children = array();\n        foreach ($node->getChildren() as $child) {\n            $children[] = $this->_getNodeJson($child);\n        }\n        return Mage::helper('core')->jsonEncode($children);\n    }\n\n    /**\n     * Returns URL for loading tree\n     *\n     * @access public\n     * @param null $expanded\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getLoadTreeUrl($expanded = null)\n    {\n        return $this->getUrl(\n            '*/{{module}}_{{entity}}_catalog_category/{{entities}}Json',\n            array('_current' => true)\n        );\n    }\n\n    /**\n     * Return distinct path ids of selected {{entityLabel}}\n     *\n     * @access public\n     * @param mixed $rootId Root {{entityLabel}} Id for context\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entity}}PathIds($rootId = false)\n    {\n        $ids = array();\n        ${{entity}}Ids = $this->get{{Entity}}Ids();\n        if (empty(${{entity}}Ids)) {\n            return array();\n        }\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection');\n        if ($rootId) {\n            $collection->addFieldToFilter('parent_id', $rootId);\n        } else {\n            $collection->addFieldToFilter('entity_id', array('in'=>${{entity}}Ids));\n        }\n\n        foreach ($collection as $item) {\n            if ($rootId && !in_array($rootId, $item->getPathIds())) {\n                continue;\n            }\n            foreach ($item->getPathIds() as $id) {\n                if (!in_array($id, $ids)) {\n                    $ids[] = $id;\n                }\n            }\n        }\n        return $ids;\n    }\n\n    /**\n     * Get node label\n     *\n     * @access public\n     * @param Varien_Object $node\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function buildNodeName($node)\n    {\n        $result = parent::buildNodeName($node);\n        $result .= '<a target=\"_blank\" href=\"'.\n            $this->getUrl('adminhtml/{{module}}_{{entity}}/index', array('id'=>$node->getId(), 'clear'=>1)).\n            '\"><em>'.$this->__(' - Edit').'</em></a>';\n        return $result;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Catalog/Category/Tab/Entity/020_not_tree",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} tab on category edit form\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Category_Tab_{{Entity}} extends Mage_Adminhtml_Block_Widget_Grid\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setId('catalog_category_{{entity}}');\n        $this->setDefaultSort('entity_id');\n        $this->setUseAjax(true);\n        if ($this->getCategory()->getId()) {\n            $this->setDefaultFilter(array('in_{{entities}}'=>1));\n        }\n    }\n\n    /**\n     * get current category\n     *\n     * @access public\n     * @return Mage_Catalog_Model_Category|null\n     * {{qwertyuiop}}\n     */\n    public function getCategory()\n    {\n        return Mage::registry('current_category');\n    }\n\n    /**\n     * prepare the collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Category_Tab_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepareCollection()\n    {\n        /* @var $collection {{Namespace}}_{{Module}}_Resource_{{Entity}}_Collection */\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection'){{additionalPrepareCollection}};\n        if ($this->getCategory()->getId()) {\n            $constraint = 'related.category_id='.$this->getCategory()->getId();\n        } else {\n            $constraint = 'related.category_id=0';\n        }\n        $collection->getSelect()->joinLeft(\n            array('related' => $collection->getTable('{{namespace}}_{{module}}/{{entity}}_category')),\n            'related.{{entity}}_id={{entityTableAlias}}.entity_id AND '.$constraint,\n            array('position')\n        );\n        $this->setCollection($collection);\n        parent::_prepareCollection();\n        return $this;\n    }\n\n    /**\n     * Prepare the columns\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Category_Tab_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepareColumns()\n    {\n        $this->addColumn(\n            'in_{{entities}}',\n            array(\n                'header_css_class' => 'a-center',\n                'type'   => 'checkbox',\n                'name'   => 'in_{{entities}}',\n                'values' => $this->_getSelected{{Entities}}(),\n                'align'  => 'center',\n                'index'  => 'entity_id'\n            )\n        );\n        $this->addColumn(\n            'entity_id',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('Id'),\n                'type'   => 'number',\n                'align'  => 'left',\n                'index'  => 'entity_id',\n            )\n        );\n        $this->addColumn(\n            '{{nameAttributeCode}}',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('{{nameAttributeLabel}}'),\n                'align'  => 'left',\n                'index'  => '{{nameAttributeCode}}',\n                'renderer' => '{{namespace}}_{{module}}/adminhtml_helper_column_renderer_relation',\n                'params' => array(\n                    'id' => 'getId'\n                ),\n                'base_link' => 'adminhtml/{{module}}_{{entity}}/edit',\n            )\n        );\n        $this->addColumn(\n            'position',\n            array(\n                'header'         => Mage::helper('{{namespace}}_{{module}}')->__('Position'),\n                'name'           => 'position',\n                'width'          => 60,\n                'type'           => 'number',\n                'validate_class' => 'validate-number',\n                'index'          => 'position',\n                'editable'       => true,\n            )\n        );\n        return parent::_prepareColumns();\n    }\n\n    /**\n     * Retrieve selected {{entities}}\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getSelected{{Entities}}()\n    {\n        ${{entities}} = $this->getCategory{{Entities}}();\n        if (!is_array(${{entities}})) {\n            ${{entities}} = array_keys($this->getSelected{{Entities}}());\n        }\n        return ${{entities}};\n    }\n\n    /**\n     * Retrieve selected {{entities}}\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entities}}()\n    {\n        ${{entities}} = array();\n        // used helper here in order not to override the category model\n        $selected = Mage::helper('{{namespace}}_{{module}}/category')->getSelected{{Entities}}(Mage::registry('current_category'));\n        if (!is_array($selected)) {\n            $selected = array();\n        }\n        foreach ($selected as ${{entity}}) {\n            ${{entities}}[${{entity}}->getId()] = array('position' => ${{entity}}->getPosition());\n        }\n        return ${{entities}};\n    }\n\n    /**\n     * get row url\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRowUrl($item)\n    {\n        return '#';\n    }\n\n    /**\n     * get grid url\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getGridUrl()\n    {\n        return $this->getUrl(\n            'adminhtml/{{module}}_{{entity}}_catalog_category/{{entities}}grid',\n            array(\n                'id'=>$this->getCategory()->getId()\n            )\n        );\n    }\n\n    /**\n     * Add filter\n     *\n     * @access protected\n     * @param object $column\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Category_Tab_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _addColumnFilterToCollection($column)\n    {\n        if ($column->getId() == 'in_{{entities}}') {\n            ${{entity}}Ids = $this->_getSelected{{Entities}}();\n            if (empty(${{entity}}Ids)) {\n                ${{entity}}Ids = 0;\n            }\n            if ($column->getFilter()->getValue()) {\n                $this->getCollection()->addFieldToFilter('entity_id', array('in'=>${{entity}}Ids));\n            } else {\n                if (${{entity}}Ids) {\n                    $this->getCollection()->addFieldToFilter('entity_id', array('nin'=>${{entity}}Ids));\n                }\n            }\n        } else {\n            parent::_addColumnFilterToCollection($column);\n        }\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Catalog/Product/Edit/Tab/Entity/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} tab on product edit form\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Catalog/Product/Edit/Tab/Entity/020_not_tree",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}} extends Mage_Adminhtml_Block_Widget_Grid\n{\n    /**\n     * Set grid params\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setId('{{entity}}_grid');\n        $this->setDefaultSort('position');\n        $this->setDefaultDir('ASC');\n        $this->setUseAjax(true);\n        if ($this->getProduct()->getId()) {\n            $this->setDefaultFilter(array('in_{{entities}}'=>1));\n        }\n    }\n\n    /**\n     * prepare the {{entity}} collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepareCollection()\n    {\n        /* @var $collection {{Namespace}}_{{Module}}_Resource_{{Entity}}_Collection */\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection'){{additionalPrepareCollection}};\n        if ($this->getProduct()->getId()) {\n            $constraint = 'related.product_id='.$this->getProduct()->getId();\n        } else {\n            $constraint = 'related.product_id=0';\n        }\n        $collection->getSelect()->joinLeft(\n            array('related' => $collection->getTable('{{namespace}}_{{module}}/{{entity}}_product')),\n            'related.{{entity}}_id={{entityTableAlias}}.entity_id AND '.$constraint,\n            array('position')\n        );\n        $this->setCollection($collection);\n        parent::_prepareCollection();\n        return $this;\n    }\n\n    /**\n     * prepare mass action grid\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepareMassaction()\n    {\n        return $this;\n    }\n\n    /**\n     * prepare the grid columns\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepareColumns()\n    {\n        $this->addColumn(\n            'in_{{entities}}',\n            array(\n                'header_css_class' => 'a-center',\n                'type'  => 'checkbox',\n                'name'  => 'in_{{entities}}',\n                'values'=> $this->_getSelected{{Entities}}(),\n                'align' => 'center',\n                'index' => 'entity_id'\n            )\n        );\n        $this->addColumn(\n            '{{nameAttributeCode}}',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('{{nameAttributeLabel}}'),\n                'align'  => 'left',\n                'index'  => '{{nameAttributeCode}}',\n                'renderer' => '{{namespace}}_{{module}}/adminhtml_helper_column_renderer_relation',\n                'params' => array(\n                    'id' => 'getId'\n                ),\n                'base_link' => 'adminhtml/{{module}}_{{entity}}/edit',\n            )\n        );\n        $this->addColumn(\n            'position',\n            array(\n                'header'         => Mage::helper('{{namespace}}_{{module}}')->__('Position'),\n                'name'           => 'position',\n                'width'          => 60,\n                'type'           => 'number',\n                'validate_class' => 'validate-number',\n                'index'          => 'position',\n                'editable'       => true,\n            )\n        );\n        return parent::_prepareColumns();\n    }\n\n    /**\n     * Retrieve selected {{entities}}\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getSelected{{Entities}}()\n    {\n        ${{entities}} = $this->getProduct{{Entities}}();\n        if (!is_array(${{entities}})) {\n            ${{entities}} = array_keys($this->getSelected{{Entities}}());\n        }\n        return ${{entities}};\n    }\n\n    /**\n     * Retrieve selected {{entities}}\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entities}}()\n    {\n        ${{entities}} = array();\n        // used helper here in order not to override the product model\n        $selected = Mage::helper('{{namespace}}_{{module}}/product')->getSelected{{Entities}}(Mage::registry('current_product'));\n        if (!is_array($selected)) {\n            $selected = array();\n        }\n        foreach ($selected as ${{entity}}) {\n            ${{entities}}[${{entity}}->getId()] = array('position' => ${{entity}}->getPosition());\n        }\n        return ${{entities}};\n    }\n\n    /**\n     * get row url\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRowUrl($item)\n    {\n        return '#';\n    }\n\n    /**\n     * get grid url\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getGridUrl()\n    {\n        return $this->getUrl(\n            '*/*/{{entities}}Grid',\n            array(\n                'id'=>$this->getProduct()->getId()\n            )\n        );\n    }\n\n    /**\n     * get the current product\n     *\n     * @access public\n     * @return Mage_Catalog_Model_Product\n     * {{qwertyuiop}}\n     */\n    public function getProduct()\n    {\n        return Mage::registry('current_product');\n    }\n\n    /**\n     * Add filter\n     *\n     * @access protected\n     * @param object $column\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _addColumnFilterToCollection($column)\n    {\n        if ($column->getId() == 'in_{{entities}}') {\n            ${{entity}}Ids = $this->_getSelected{{Entities}}();\n            if (empty(${{entity}}Ids)) {\n                ${{entity}}Ids = 0;\n            }\n            if ($column->getFilter()->getValue()) {\n                $this->getCollection()->addFieldToFilter('entity_id', array('in'=>${{entity}}Ids));\n            } else {\n                if (${{entity}}Ids) {\n                    $this->getCollection()->addFieldToFilter('entity_id', array('nin'=>${{entity}}Ids));\n                }\n            }\n        } else {\n            parent::_addColumnFilterToCollection($column);\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Catalog/Product/Edit/Tab/Entity/030_tree",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_Catalog_Product_Edit_Tab_{{Entity}} extends {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Tree\n{\n    protected $_{{entity}}Ids = null;\n    protected $_selectedNodes = null;\n\n    /**\n     * constructor\n     * Specify template to use\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setTemplate('{{namespace}}_{{module}}/catalog/product/edit/tab/{{entity}}.phtml');\n    }\n\n    /**\n     * Retrieve currently edited product\n     *\n     * @access public\n     * @return Mage_Catalog_Model_Product\n     * {{qwertyuiop}}\n     */\n    public function getProduct()\n    {\n        return Mage::registry('current_product');\n    }\n\n    /**\n     * Return array with {{entityLabel}} IDs which the product is assigned to\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Ids()\n    {\n        if (is_null($this->_{{entity}}Ids)) {\n            $selected{{Entities}} = Mage::helper('{{namespace}}_{{module}}/product')->getSelected{{Entities}}($this->getProduct());\n            $ids = array();\n            foreach ($selected{{Entities}} as ${{entity}}) {\n                $ids[] = ${{entity}}->getId();\n            }\n            $this->_{{entity}}Ids = $ids;\n        }\n        return $this->_{{entity}}Ids;\n    }\n\n    /**\n     * Forms string out of get{{Entity}}Ids()\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getIdsString()\n    {\n        return implode(',', $this->get{{Entity}}Ids());\n    }\n\n    /**\n     * Returns root node and sets 'checked' flag (if necessary)\n     *\n     * @access public\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRootNode()\n    {\n        $root = $this->getRoot();\n        if ($root && in_array($root->getId(), $this->get{{Entity}}Ids())) {\n            $root->setChecked(true);\n        }\n        return $root;\n    }\n\n    /**\n     * Returns root node\n     *\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}|null $parentNode{{Entity}}\n     * @param int  $recursionLevel\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRoot($parentNode{{Entity}} = null, $recursionLevel = 3)\n    {\n        if (!is_null($parentNode{{Entity}}) && $parentNode{{Entity}}->getId()) {\n            return $this->getNode($parentNode{{Entity}}, $recursionLevel);\n        }\n        $root = Mage::registry('{{entity}}_root');\n        if (is_null($root)) {\n            $rootId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n\n            $ids = $this->getSelected{{Entity}}PathIds($rootId);\n            $tree = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_tree')\n                ->loadByIds($ids, false, false);\n            if ($this->get{{Entity}}()) {\n                $tree->loadEnsuredNodes($this->get{{Entity}}(), $tree->getNodeById($rootId));\n            }\n            $tree->addCollectionData($this->get{{Entity}}Collection());\n            $root = $tree->getNodeById($rootId);\n            Mage::register('{{entity}}_root', $root);\n        }\n        return $root;\n    }\n\n    /**\n     * Returns array with configuration of current node\n     *\n     * @access protected\n     * @param Varien_Data_Tree_Node $node\n     * @param int $level How deep is the node in the tree\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getNodeJson($node, $level = 1)\n    {\n        $item = parent::_getNodeJson($node, $level);\n        if ($this->_isParentSelected{{Entity}}($node)) {\n            $item['expanded'] = true;\n        }\n        if (in_array($node->getId(), $this->get{{Entity}}Ids())) {\n            $item['checked'] = true;\n        }\n        return $item;\n    }\n\n    /**\n     * Returns whether $node is a parent (not exactly direct) of a selected node\n     *\n     * @access protected\n     * @param Varien_Data_Tree_Node $node\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _isParentSelected{{Entity}}($node)\n    {\n        $result = false;\n        // Contains string with all {{entityLabel}} IDs of children (not exactly direct) of the node\n        $allChildren = $node->getAllChildren();\n        if ($allChildren) {\n            $selected{{Entity}}Ids = $this->get{{Entity}}Ids();\n            $allChildrenArr = explode(',', $allChildren);\n            for ($i = 0, $cnt = count($selected{{Entity}}Ids); $i < $cnt; $i++) {\n                $isSelf = $node->getId() == $selected{{Entity}}Ids[$i];\n                if (!$isSelf && in_array($selected{{Entity}}Ids[$i], $allChildrenArr)) {\n                    $result = true;\n                    break;\n                }\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * Returns array with nodes those are selected (contain current product)\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getSelectedNodes()\n    {\n        if ($this->_selectedNodes === null) {\n            $this->_selectedNodes = array();\n            $root = $this->getRoot();\n            foreach ($this->get{{Entity}}Ids() as ${{entity}}Id) {\n                if ($root) {\n                    $this->_selectedNodes[] = $root->getTree()->getNodeById(${{entity}}Id);\n                }\n            }\n        }\n        return $this->_selectedNodes;\n    }\n\n    /**\n     * Returns JSON-encoded array of {{entityLabel}} children\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}ChildrenJson(${{entity}}Id)\n    {\n        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id);\n        $node = $this->getRoot(${{entity}}, 1)->getTree()->getNodeById(${{entity}}Id);\n        if (!$node || !$node->hasChildren()) {\n            return '[]';\n        }\n\n        $children = array();\n        foreach ($node->getChildren() as $child) {\n            $children[] = $this->_getNodeJson($child);\n        }\n        return Mage::helper('core')->jsonEncode($children);\n    }\n\n    /**\n     * Returns URL for loading tree\n     *\n     * @access public\n     * @param null $expanded\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getLoadTreeUrl($expanded = null)\n    {\n        return $this->getUrl('*/*/{{entities}}Json', array('_current' => true));\n    }\n\n    /**\n     * Return distinct path ids of selected {{entitiesLabel}}\n     *\n     * @access public\n     * @param mixed $rootId Root {{entityLabel}} Id for context\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entity}}PathIds($rootId = false)\n    {\n        $ids = array();\n        ${{entity}}Ids = $this->get{{Entity}}Ids();\n        if (empty(${{entity}}Ids)) {\n            return array();\n        }\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection');\n\n        if ($rootId) {\n            $collection->addFieldToFilter('parent_id', $rootId);\n        } else {\n            $collection->addFieldToFilter('entity_id', array('in'=>${{entity}}Ids));\n        }\n\n        foreach ($collection as $item) {\n            if ($rootId && !in_array($rootId, $item->getPathIds())) {\n                continue;\n            }\n            foreach ($item->getPathIds() as $id) {\n                if (!in_array($id, $ids)) {\n                    $ids[] = $id;\n                }\n            }\n        }\n        return $ids;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Catalog/Product/Edit/Tab/Entity/040_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}} extends Mage_Adminhtml_Block_Widget_Grid_Container\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        $this->_controller         = 'adminhtml_{{entity}}';\n        $this->_blockGroup         = '{{namespace}}_{{module}}';\n        parent::__construct();\n        $this->_headerText         = Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}');\n        $this->_updateButton('add', 'label', Mage::helper('{{namespace}}_{{module}}')->__('Add {{EntityLabel}}'));\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/020_eav",
    "content": "        $this->setTemplate('{{namespace}}_{{module}}/grid.phtml');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/030_footer",
    "content": "    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Abstract/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin block abstract\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Abstract extends Mage_Adminhtml_Block_Template\n{\n    /**\n     * get current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Entity\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('{{entity}}');\n    }\n\n    /**\n     * get current {{entityLabel}} id\n     *\n     * @access public\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Id()\n    {\n        if ($this->get{{Entity}}()) {\n            return $this->get{{Entity}}()->getId();\n        }\n        return null;\n    }\n\n    /**\n     * get current {{entityLabel}} {{nameAttributeLabel}}\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}{{EntityNameMagicCode}}()\n    {\n        return $this->get{{Entity}}()->get{{EntityNameMagicCode}}();\n    }\n\n    /**\n     * get current {{entityLabel}} path\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Path()\n    {\n        if ($this->get{{Entity}}()) {\n            return $this->get{{Entity}}()->getPath();\n        }\n        return Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n    }\n\n    /**\n     * check if there is a root {{entityLabel}}\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function hasRoot{{Entity}}()\n    {\n        $root = $this->getRoot();\n        if ($root && $root->getId()) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * get the root\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}|null $parentNode{{Entity}}\n     * @param int $recursionLevel\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRoot($parentNode{{Entity}} = null, $recursionLevel = 3)\n    {\n        if (!is_null($parentNode{{Entity}}) && $parentNode{{Entity}}->getId()) {\n            return $this->getNode($parentNode{{Entity}}, $recursionLevel);\n        }\n        $root = Mage::registry('root');\n        if (is_null($root)) {\n            $rootId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n            $tree = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_tree')\n                ->load(null, $recursionLevel);\n            if ($this->get{{Entity}}()) {\n                $tree->loadEnsuredNodes($this->get{{Entity}}(), $tree->getNodeById($rootId));\n            }\n            $tree->addCollectionData($this->get{{Entity}}Collection());\n            $root = $tree->getNodeById($rootId);\n            if ($root && $rootId != Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()) {\n                $root->setIsVisible(true);\n            } elseif ($root && $root->getId() == Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()) {\n                $root->set{{EntityNameMagicCode}}(Mage::helper('{{namespace}}_{{module}}')->__('Root'));\n            }\n            Mage::register('root', $root);\n        }\n        return $root;\n    }\n\n    /**\n     * Get and register {{entitiesLabel}} root by specified {{entitiesLabel}} IDs\n     *\n     * @accsess public\n     * @param array $ids\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRootByIds($ids)\n    {\n        $root = Mage::registry('root');\n        if (null === $root) {\n            ${{entity}}TreeResource = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_tree');\n            $ids     = ${{entity}}TreeResource->getExisting{{Entity}}IdsBySpecifiedIds($ids);\n            $tree   = ${{entity}}TreeResource->loadByIds($ids);\n            $rootId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n            $root   = $tree->getNodeById($rootId);\n            if ($root && $rootId != Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()) {\n                $root->setIsVisible(true);\n            } elseif ($root && $root->getId() == Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()) {\n                $root->setName(Mage::helper('{{namespace}}_{{module}}')->__('Root'));\n            }\n            $tree->addCollectionData($this->get{{Entity}}Collection());\n            Mage::register('root', $root);\n        }\n        return $root;\n    }\n\n    /**\n     * get specific node\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} $parentNode{{Entity}}\n     * @param $int $recursionLevel\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getNode($parentNode{{Entity}}, $recursionLevel = 2)\n    {\n        $tree = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_tree');\n        $nodeId     = $parentNode{{Entity}}->getId();\n        $parentId   = $parentNode{{Entity}}->getParentId();\n        $node = $tree->loadNode($nodeId);\n        $node->loadChildren($recursionLevel);\n        if ($node && $nodeId != Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()) {\n            $node->setIsVisible(true);\n        } elseif ($node && $node->getId() == Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()) {\n            $node->set{{EntityNameMagicCode}}(Mage::helper('{{namespace}}_{{module}}')->__('Root'));\n        }\n        $tree->addCollectionData($this->get{{Entity}}Collection());\n        return $node;\n    }\n\n    /**\n     * get url for saving data\n     *\n     * @access public\n     * @param array $args\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getSaveUrl(array $args = array())\n    {\n        $params = array('_current'=>true);\n        $params = array_merge($params, $args);\n        return $this->getUrl('*/*/save', $params);\n    }\n\n    /**\n     * get url for edit\n     *\n     * @access public\n     * @param array $args\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getEditUrl()\n    {\n        return $this->getUrl(\n            \"*/{{module}}_{{entity}}/edit\",\n            array('_current' => true, '_query'=>false, 'id' => null, 'parent' => null)\n        );\n    }\n\n    /**\n     * Return root ids\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getRootIds()\n    {\n        return array(Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id());\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Attribute/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin attribute block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute extends Mage_Adminhtml_Block_Widget_Grid_Container\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        $this->_controller = 'adminhtml_{{entity}}_attribute';\n        $this->_blockGroup = '{{namespace}}_{{module}}';\n        $this->_headerText = Mage::helper('{{namespace}}_{{module}}')->__('Manage {{EntityLabel}} Attributes');\n        parent::__construct();\n        $this->_updateButton(\n            'add',\n            'label',\n            Mage::helper('{{namespace}}_{{module}}')->__('Add New {{EntityLabel}} Attribute')\n        );\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Attribute/Edit/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} attribute edit block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Edit extends Mage_Adminhtml_Block_Widget_Form_Container\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        $this->_objectId = 'attribute_id';\n        $this->_controller = 'adminhtml_{{entity}}_attribute';\n        $this->_blockGroup = '{{namespace}}_{{module}}';\n\n        parent::__construct();\n        $this->_addButton(\n            'save_and_edit_button',\n            array(\n                'label'     => Mage::helper('{{namespace}}_{{module}}')->__('Save and Continue Edit'),\n                'onclick'   => 'saveAndContinueEdit()',\n                'class'     => 'save'\n            ),\n            100\n        );\n        $this->_updateButton(\n            'save',\n            'label',\n            Mage::helper('{{namespace}}_{{module}}')->__('Save {{EntityLabel}} Attribute')\n        );\n        $this->_updateButton('save', 'onclick', 'saveAttribute()');\n\n        if (!Mage::registry('entity_attribute')->getIsUserDefined()) {\n            $this->_removeButton('delete');\n        } else {\n            $this->_updateButton(\n                'delete',\n                'label',\n                Mage::helper('{{namespace}}_{{module}}')->__('Delete {{EntityLabel}} Attribute')\n            );\n        }\n    }\n\n    /**\n     * get the header text for the form\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getHeaderText()\n    {\n        if (Mage::registry('entity_attribute')->getId()) {\n            $frontendLabel = Mage::registry('entity_attribute')->getFrontendLabel();\n            if (is_array($frontendLabel)) {\n                $frontendLabel = $frontendLabel[0];\n            }\n            return Mage::helper('{{namespace}}_{{module}}')->__('Edit {{EntityLabel}} Attribute \"%s\"', $this->escapeHtml($frontendLabel));\n        } else {\n            return Mage::helper('{{namespace}}_{{module}}')->__('New {{EntityLabel}} Attribute');\n        }\n    }\n\n    /**\n     * get validation url for form\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getValidationUrl()\n    {\n        return $this->getUrl('*/*/validate', array('_current'=>true));\n    }\n\n    /**\n     * get save url for form\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getSaveUrl()\n    {\n        return $this->getUrl('*/'.$this->_controller.'/save', array('_current'=>true, 'back'=>null));\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Attribute/Edit/Form/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} attribute add/edit block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Edit_Form extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare form\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Edit_Form\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form(\n            array(\n                'id' => 'edit_form',\n                'action' => $this->getUrl('adminhtml/{{module}}_{{entity}}_attribute/save'),\n                'method' => 'post'\n            )\n        );\n        $form->setUseContainer(true);\n        $this->setForm($form);\n        return parent::_prepareForm();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Attribute/Edit/Tab/Main/010_content",
    "content": "<?php\n{{License}}\n/**\n * Adminhtml {{entityLabel}} attribute edit page main tab\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Edit_Tab_Main extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract\n{\n    /**\n     * Adding product form elements for editing attribute\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Edit_Tab_Main\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        parent::_prepareForm();\n        $attributeObject = $this->getAttributeObject();\n        $form = $this->getForm();\n        $fieldset = $form->getElement('base_fieldset');\n        $frontendInputElm = $form->getElement('frontend_input');\n        $additionalTypes = array(\n            array(\n                'value' => 'image',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Image')\n            ),\n            array(\n                'value' => 'file',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('File')\n            )\n        );\n        $response = new Varien_Object();\n        $response->setTypes(array());\n        Mage::dispatchEvent('adminhtml_{{entity}}_attribute_types', array('response'=>$response));\n        $_disabledTypes = array();\n        $_hiddenFields = array();\n        foreach ($response->getTypes() as $type) {\n            $additionalTypes[] = $type;\n            if (isset($type['hide_fields'])) {\n                $_hiddenFields[$type['value']] = $type['hide_fields'];\n            }\n            if (isset($type['disabled_types'])) {\n                $_disabledTypes[$type['value']] = $type['disabled_types'];\n            }\n        }\n        Mage::register('attribute_type_hidden_fields', $_hiddenFields);\n        Mage::register('attribute_type_disabled_types', $_disabledTypes);\n\n        $frontendInputValues = array_merge($frontendInputElm->getValues(), $additionalTypes);\n        $frontendInputElm->setValues($frontendInputValues);\n\n        $yesnoSource = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();\n\n        $scopes = array(\n            Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE   =>\n                Mage::helper('{{namespace}}_{{module}}')->__('Store View'),\n            Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE =>\n                Mage::helper('{{namespace}}_{{module}}')->__('Website'),\n            Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL  =>\n                Mage::helper('{{namespace}}_{{module}}')->__('Global'),\n        );\n\n        $fieldset->addField(\n            'is_global',\n            'select',\n            array(\n                'name'  => 'is_global',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Scope'),\n                'title' => Mage::helper('{{namespace}}_{{module}}')->__('Scope'),\n                'note'  => Mage::helper('{{namespace}}_{{module}}')->__('Declare attribute value saving scope'),\n                'values'=> $scopes\n            ),\n            'attribute_code'\n        );\n        $fieldset->addField(\n            'position',\n            'text',\n            array(\n                'name'  => 'position',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Position'),\n                'title' => Mage::helper('{{namespace}}_{{module}}')->__('Position'),\n                'note'  => Mage::helper('{{namespace}}_{{module}}')->__('Position in the admin form'),\n            ),\n            'is_global'\n        );\n        $fieldset->addField(\n            'note',\n            'textarea',\n            array(\n                'name'  => 'note',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Note'),\n                'title' => Mage::helper('{{namespace}}_{{module}}')->__('Note'),\n                'note'  => Mage::helper('{{namespace}}_{{module}}')->__('Text to appear below the input.'),\n            ),\n            'position'\n        );\n\n        $fieldset->removeField('is_unique');\n        // frontend properties fieldset\n        $fieldset = $form->addFieldset(\n            'front_fieldset',\n            array(\n                'legend'=>Mage::helper('{{namespace}}_{{module}}')->__('Frontend Properties')\n            )\n        );\n        $fieldset->addField(\n            'is_wysiwyg_enabled',\n            'select',\n            array(\n                'name' => 'is_wysiwyg_enabled',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Enable WYSIWYG'),\n                'title' => Mage::helper('{{namespace}}_{{module}}')->__('Enable WYSIWYG'),\n                'values' => $yesnoSource,\n            )\n        );\n        Mage::dispatchEvent(\n            '{{namespace}}_{{module}}_adminhtml_{{entity}}_attribute_edit_prepare_form',\n            array(\n                'form'      => $form,\n                'attribute' => $attributeObject\n            )\n        );\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Attribute/Edit/Tab/Options/010_content",
    "content": "<?php\n{{License}}\n/**\n * Adminhtml {{entityLabel}} attribute add/edit form options tab\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Edit_Tab_Options extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract\n{\n\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Attribute/Edit/Tabs/010_content",
    "content": "<?php\n{{License}}\n/**\n * Adminhtml {{entityLabel}} attribute edit page tabs\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setId('{{entity}}_attribute_tabs');\n        $this->setDestElementId('edit_form');\n        $this->setTitle(Mage::helper('{{namespace}}_{{module}}')->__('Attribute Information'));\n    }\n\n    /**\n     * add attribute tabs\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Adminhtml_{{Entity}}_Attribute_Edit_Tabs\n     * {{qwertyuiop}}\n     */\n    protected function _beforeToHtml()\n    {\n        $this->addTab(\n            'main',\n            array(\n                'label'     => Mage::helper('{{namespace}}_{{module}}')->__('Properties'),\n                'title'     => Mage::helper('{{namespace}}_{{module}}')->__('Properties'),\n                'content'   => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_attribute_edit_tab_main'\n                )\n                ->toHtml(),\n                'active'    => true\n            )\n        );\n        $this->addTab(\n            'labels',\n            array(\n                'label'     => Mage::helper('{{namespace}}_{{module}}')->__('Manage Label / Options'),\n                'title'     => Mage::helper('{{namespace}}_{{module}}')->__('Manage Label / Options'),\n                'content'   => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_attribute_edit_tab_options'\n                )\n                ->toHtml(),\n            )\n        );\n        return parent::_beforeToHtml();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Attribute/Grid/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} attributes grid\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Grid extends Mage_Eav_Block_Adminhtml_Attribute_Grid_Abstract\n{\n    /**\n     * Prepare {{entityLabel}} attributes grid collection object\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _prepareCollection()\n    {\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_attribute_collection')\n            ->addVisibleFilter();\n        $this->setCollection($collection);\n        return parent::_prepareCollection();\n    }\n\n    /**\n     * Prepare {{entity}} attributes grid columns\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Attribute_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _prepareColumns()\n    {\n        parent::_prepareColumns();\n        $this->addColumnAfter(\n            'is_global',\n            array(\n                'header'   => Mage::helper('{{namespace}}_{{module}}')->__('Scope'),\n                'sortable' => true,\n                'index'    => 'is_global',\n                'type'     => 'options',\n                'options'  => array(\n                    Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE   =>\n                        Mage::helper('{{namespace}}_{{module}}')->__('Store View'),\n                    Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE =>\n                        Mage::helper('{{namespace}}_{{module}}')->__('Website'),\n                    Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL  =>\n                        Mage::helper('{{namespace}}_{{module}}')->__('Global'),\n                ),\n                'align' => 'center',\n            ),\n            'is_user_defined'\n        );\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comments admin block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment extends Mage_Adminhtml_Block_Widget_Grid_Container\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        $this->_controller = 'adminhtml_{{entity}}_comment';\n        $this->_blockGroup = '{{namespace}}_{{module}}';\n        parent::__construct();\n        $this->_headerText = Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} Comments');\n        $this->_removeButton('add');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comment admin edit form\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Edit extends Mage_Adminhtml_Block_Widget_Form_Container\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->_blockGroup = '{{namespace}}_{{module}}';\n        $this->_controller = 'adminhtml_{{entity}}_comment';\n        $this->_updateButton(\n            'save',\n            'label',\n            Mage::helper('{{namespace}}_{{module}}')->__('Save {{EntityLabel}} comment')\n        );\n        $this->_updateButton(\n            'delete',\n            'label',\n            Mage::helper('{{namespace}}_{{module}}')->__('Delete {{EntityLabel}} comment')\n        );\n        $this->_addButton(\n            'saveandcontinue',\n            array(\n                'label'        => Mage::helper('{{namespace}}_{{module}}')->__('Save And Continue Edit'),\n                'onclick'    => 'saveAndContinueEdit()',\n                'class'        => 'save',\n            ),\n            -100\n        );\n        $this->_formScripts[] = \"\n            function saveAndContinueEdit() {\n                editForm.submit($('edit_form').action+'back/edit/');\n            }\n        \";\n    }\n\n    /**\n     * get the edit form header\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getHeaderText()\n    {\n        if (Mage::registry('comment_data') && Mage::registry('comment_data')->getId()) {\n            return Mage::helper('{{namespace}}_{{module}}')->__(\n                \"Edit {{EntityLabel}} comment '%s'\",\n                $this->escapeHtml(Mage::registry('comment_data')->getTitle())\n            );\n        }\n        return '';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/Form/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comment edit form\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Edit_Form extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare form\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Edit_Form\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form(\n            array(\n                'id'         => 'edit_form',\n                'action'     => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\n                'method'     => 'post',\n                'enctype'    => 'multipart/form-data'\n            )\n        );\n        $form->setUseContainer(true);\n        $this->setForm($form);\n        return parent::_prepareForm();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/Tab/Form/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comment edit form tab\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare the form\n     *\n     * @access protected\n     * @return {{Module}}_{{Entity}}_Block_Adminhtml_{{Entity}}_Comment_Edit_Tab_Form\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        ${{entity}} = Mage::registry('current_{{entity}}');\n        $comment    = Mage::registry('current_comment');\n        $form = new Varien_Data_Form();\n        $form->setHtmlIdPrefix('comment_');\n        $form->setFieldNameSuffix('comment');\n        $this->setForm($form);\n        $fieldset = $form->addFieldset(\n            'comment_form',\n            array('legend'=>Mage::helper('{{namespace}}_{{module}}')->__('Comment'))\n        );\n        $fieldset->addField(\n            '{{entity}}_id',\n            'hidden',\n            array(\n                'name'  => '{{entity}}_id',\n                'after_element_html' => '<a href=\"'.\n                    Mage::helper('adminhtml')->getUrl(\n                        'adminhtml/{{module}}_{{entity}}/edit',\n                        array(\n                            'id'=>${{entity}}->getId()\n                        )\n                    ).\n                    '\" target=\"_blank\">'.\n                    Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}').\n                    ' : '.${{entity}}->get{{EntityNameMagicCode}}().'</a>'\n            )\n        );\n        $fieldset->addField(\n            'title',\n            'text',\n            array(\n                'label'    => Mage::helper('{{namespace}}_{{module}}')->__('Title'),\n                'name'     => 'title',\n                'required' => true,\n                'class'    => 'required-entry',\n            )\n        );\n        $fieldset->addField(\n            'comment',\n            'textarea',\n            array(\n                'label'    => Mage::helper('{{namespace}}_{{module}}')->__('Comment'),\n                'name'     => 'comment',\n                'required' => true,\n                'class'    => 'required-entry',\n            )\n        );\n        $fieldset->addField(\n            'status',\n            'select',\n            array(\n                'label'    => Mage::helper('{{namespace}}_{{module}}')->__('Status'),\n                'name'     => 'status',\n                'required' => true,\n                'class'    => 'required-entry',\n                'values'   => array(\n                    array(\n                        'value' => {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_PENDING,\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('Pending'),\n                    ),\n                    array(\n                        'value' => {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_APPROVED,\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('Approved'),\n                    ),\n                    array(\n                        'value' => {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_REJECTED,\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('Rejected'),\n                    ),\n                ),\n            )\n        );\n        $configuration = array(\n             'label' => Mage::helper('{{namespace}}_{{module}}')->__('Poster name'),\n             'name'  => 'name',\n             'required'  => true,\n             'class' => 'required-entry',\n        );\n        if ($comment->getCustomerId()) {\n            $configuration['after_element_html'] = '<a href=\"'.\n                Mage::helper('adminhtml')->getUrl(\n                    'adminhtml/customer/edit',\n                    array(\n                        'id'=>$comment->getCustomerId()\n                    )\n                ).\n                '\" target=\"_blank\">'.\n                Mage::helper('{{namespace}}_{{module}}')->__('Customer profile').'</a>';\n        }\n        $fieldset->addField('name', 'text', $configuration);\n        $fieldset->addField(\n            'email',\n            'text',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Poster e-mail'),\n                'name'  => 'email',\n                'required'  => true,\n                'class' => 'required-entry',\n            )\n        );\n        $fieldset->addField(\n            'customer_id',\n            'hidden',\n            array(\n                'name'  => 'customer_id',\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/Tab/Form/020_stores",
    "content": "        if (Mage::app()->isSingleStoreMode()) {\n            $fieldset->addField(\n                'store_id',\n                'hidden',\n                array(\n                    'name'      => 'stores[]',\n                    'value'     => Mage::app()->getStore(true)->getId()\n                )\n            );\n            Mage::registry('current_comment')->setStoreId(Mage::app()->getStore(true)->getId());\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/Tab/Form/030_footer",
    "content": "        $form->addValues($this->getComment()->getData());\n        return parent::_prepareForm();\n    }\n\n    /**\n     * get the current comment\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment\n     */\n    public function getComment()\n    {\n        return Mage::registry('current_comment');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/Tab/Stores/010_content",
    "content": "<?php\n{{License}}\n/**\n * store selection tab\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Edit_Tab_Stores extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare the form\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Edit_Tab_Stores\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form();\n        $form->setFieldNameSuffix('comment');\n        $this->setForm($form);\n        $fieldset = $form->addFieldset(\n            '{{entity}}_comment_stores_form',\n            array('legend' => Mage::helper('{{namespace}}_{{module}}')->__('Store views'))\n        );\n        $field = $fieldset->addField(\n            'store_id',\n            'multiselect',\n            array(\n                'name'  => 'stores[]',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Store Views'),\n                'title' => Mage::helper('{{namespace}}_{{module}}')->__('Store Views'),\n                'required'  => true,\n                'values'=> Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),\n            )\n        );\n        $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');\n        $field->setRenderer($renderer);\n        $form->addValues(Mage::registry('current_comment')->getData());\n        return parent::_prepareForm();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/Tabs/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comment admin edit tabs\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs\n{\n    /**\n     * Initialize Tabs\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setId('{{entity}}_comment_tabs');\n        $this->setDestElementId('edit_form');\n        $this->setTitle(Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} Comment'));\n    }\n\n    /**\n     * before render html\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tabs\n     * {{qwertyuiop}}\n     */\n    protected function _beforeToHtml()\n    {\n        $this->addTab(\n            'form_{{entity}}_comment',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} comment'),\n                'title'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} comment'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_comment_edit_tab_form'\n                )\n                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/Tabs/020_stores",
    "content": "        if (!Mage::app()->isSingleStoreMode()) {\n            $this->addTab(\n                'form_store_{{entity}}_comment',\n                array(\n                    'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Store views'),\n                    'title'   => Mage::helper('{{namespace}}_{{module}}')->__('Store views'),\n                    'content' => $this->getLayout()->createBlock(\n                        '{{namespace}}_{{module}}/adminhtml_{{entity}}_comment_edit_tab_stores'\n                    )\n                    ->toHtml(),\n                )\n            );\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Edit/Tabs/030_footer",
    "content": "        return parent::_beforeToHtml();\n    }\n\n    /**\n     * Retrieve comment\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment\n     * {{qwertyuiop}}\n     */\n    public function getComment()\n    {\n        return Mage::registry('current_comment');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Grid/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comments admin grid block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Grid extends Mage_Adminhtml_Block_Widget_Grid\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setId('{{entity}}CommentGrid');\n        $this->setDefaultSort('ct_comment_id');\n        $this->setDefaultDir('DESC');\n        $this->setSaveParametersInSession(true);\n        $this->setUseAjax(true);\n    }\n\n    /**\n     * prepare collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _prepareCollection()\n    {\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_comment_{{entity}}_collection');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Grid/013_store_data",
    "content": "        $collection->addStoreData();\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Grid/016_prepare",
    "content": "        $this->setCollection($collection);\n        return parent::_prepareCollection();\n    }\n\n    /**\n     * prepare grid collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _prepareColumns()\n    {\n        $this->addColumn(\n            'ct_comment_id',\n            array(\n                'header'        => Mage::helper('{{namespace}}_{{module}}')->__('Id'),\n                'index'         => 'ct_comment_id',\n                'type'          => 'number',\n                'filter_index'  => 'ct.comment_id',\n            )\n        );\n        $this->addColumn(\n            '{{nameAttributeCode}}',\n            array(\n                'header'        => Mage::helper('{{namespace}}_{{module}}')->__('{{nameAttributeLabel}}'),\n                'index'         => '{{nameAttributeCode}}',\n                'filter_index'  => '{{commentFilterIndexPrefix}}{{nameAttributeCode}}',\n            )\n        );\n        $this->addColumn(\n            'ct_title',\n            array(\n                'header'        => Mage::helper('{{namespace}}_{{module}}')->__('Comment Title'),\n                'index'         => 'ct_title',\n                'filter_index'  => 'ct.title',\n            )\n        );\n        $this->addColumn(\n            'ct_name',\n            array(\n                'header'        => Mage::helper('{{namespace}}_{{module}}')->__('Poster name'),\n                'index'         => 'ct_name',\n                'filter_index'  => 'ct.name',\n            )\n        );\n        $this->addColumn(\n            'ct_email',\n            array(\n                'header'        => Mage::helper('{{namespace}}_{{module}}')->__('Poster email'),\n                'index'         => 'ct_email',\n                'filter_index'  => 'ct.email',\n            )\n        );\n        $this->addColumn(\n            'ct_status',\n            array(\n                'header'        => Mage::helper('{{namespace}}_{{module}}')->__('Status'),\n                'index'         => 'ct_status',\n                'filter_index'  => 'ct.status',\n                'type'          => 'options',\n                'options'       => array(\n                    {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_PENDING  =>\n                        Mage::helper('{{namespace}}_{{module}}')->__('Pending'),\n                    {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_APPROVED =>\n                        Mage::helper('{{namespace}}_{{module}}')->__('Approved'),\n                    {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_REJECTED =>\n                        Mage::helper('{{namespace}}_{{module}}')->__('Rejected'),\n                )\n            )\n        );\n        $this->addColumn(\n            'ct_created_at',\n            array(\n                'header'        => Mage::helper('{{namespace}}_{{module}}')->__('Created at'),\n                'index'         => 'ct_created_at',\n                'width'         => '120px',\n                'type'          => 'datetime',\n                'filter_index'  => 'ct.created_at',\n            )\n        );\n        $this->addColumn(\n            'ct_updated_at',\n            array(\n                'header'        => Mage::helper('{{namespace}}_{{module}}')->__('Updated at'),\n                'index'         => 'ct_updated_at',\n                'width'         => '120px',\n                'type'          => 'datetime',\n                'filter_index'  => 'ct.updated_at',\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Grid/020_stores",
    "content": "        if (!Mage::app()->isSingleStoreMode() && !$this->_isExport) {\n            $this->addColumn(\n                'stores',\n                array(\n                    'header'     => Mage::helper('{{namespace}}_{{module}}')->__('Store Views'),\n                    'index'      => 'stores',\n                    'type'       => 'store',\n                    'store_all'  => true,\n                    'store_view' => true,\n                    'sortable'   => false,\n                    'filter_condition_callback' => array($this, '_filterStoreCondition'),\n                )\n            );\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Grid/030_content",
    "content": "        $this->addColumn(\n            'action',\n            array(\n                'header'  => Mage::helper('{{namespace}}_{{module}}')->__('Action'),\n                'width'   => '100',\n                'type'    => 'action',\n                'getter'  => 'getCtCommentId',\n                'actions' => array(\n                    array(\n                        'caption' => Mage::helper('{{namespace}}_{{module}}')->__('Edit'),\n                        'url'     => array('base'=> '*/*/edit'),\n                        'field'   => 'id'\n                    )\n                ),\n                'filter'    => false,\n                'is_system' => true,\n                'sortable'  => false,\n            )\n        );\n        $this->addExportType('*/*/exportCsv', Mage::helper('{{namespace}}_{{module}}')->__('CSV'));\n        $this->addExportType('*/*/exportExcel', Mage::helper('{{namespace}}_{{module}}')->__('Excel'));\n        $this->addExportType('*/*/exportXml', Mage::helper('{{namespace}}_{{module}}')->__('XML'));\n        return parent::_prepareColumns();\n    }\n\n    /**\n     * prepare mass action\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _prepareMassaction()\n    {\n        $this->setMassactionIdField('ct_comment_id');\n        $this->setMassactionIdFilter('ct.comment_id');\n        $this->setMassactionIdFieldOnlyIndexValue(true);\n        $this->getMassactionBlock()->setFormFieldName('comment');\n        $this->getMassactionBlock()->addItem(\n            'delete',\n            array(\n                'label'=> Mage::helper('{{namespace}}_{{module}}')->__('Delete'),\n                'url'  => $this->getUrl('*/*/massDelete'),\n                'confirm'  => Mage::helper('{{namespace}}_{{module}}')->__('Are you sure?')\n            )\n        );\n        $this->getMassactionBlock()->addItem(\n            'status',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Change status'),\n                'url'   => $this->getUrl('*/*/massStatus', array('_current'=>true)),\n                'additional' => array(\n                    'status' => array(\n                            'name' => 'status',\n                            'type' => 'select',\n                            'class' => 'required-entry',\n                            'label' => Mage::helper('{{namespace}}_{{module}}')->__('Status'),\n                            'values' => array(\n                                {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_PENDING  =>\n                                    Mage::helper('{{namespace}}_{{module}}')->__('Pending'),\n                                {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_APPROVED =>\n                                    Mage::helper('{{namespace}}_{{module}}')->__('Approved'),\n                                {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_REJECTED =>\n                                    Mage::helper('{{namespace}}_{{module}}')->__('Rejected'),\n                            )\n                    )\n                )\n            )\n        );\n        return $this;\n    }\n\n    /**\n     * get the row url\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRowUrl($row)\n    {\n        return $this->getUrl('*/*/edit', array('id' => $row->getCtCommentId()));\n    }\n\n    /**\n     * get the grid url\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getGridUrl()\n    {\n        return $this->getUrl('*/*/grid', array('_current'=>true));\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Grid/040_store_filter",
    "content": "\n    /**\n     * filter store column\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_Collection $collection\n     * @param Mage_Adminhtml_Block_Widget_Grid_Column $column\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Comment_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _filterStoreCondition($collection, $column)\n    {\n        if (!$value = $column->getFilter()->getValue()) {\n            return;\n        }\n        $collection->setStoreFilter($value);\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Comment/Grid/050_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin edit form\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit extends Mage_Adminhtml_Block_Widget_Form_Container\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/020_tree",
    "content": "    public function __construct()\n    {\n        $this->_objectId    = 'entity_id';\n        $this->_blockGroup  = '{{namespace}}_{{module}}';\n        $this->_controller  = 'adminhtml_{{entity}}';\n        $this->_mode        = 'edit';\n        parent::__construct();\n        $this->setTemplate('{{namespace}}_{{module}}/{{entity}}/edit.phtml');\n    }\n}\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/030_not_tree",
    "content": "    public function __construct()\n    {\n        parent::__construct();\n        $this->_blockGroup = '{{namespace}}_{{module}}';\n        $this->_controller = 'adminhtml_{{entity}}';\n        $this->_updateButton(\n            'save',\n            'label',\n            Mage::helper('{{namespace}}_{{module}}')->__('Save {{EntityLabel}}')\n        );\n        $this->_updateButton(\n            'delete',\n            'label',\n            Mage::helper('{{namespace}}_{{module}}')->__('Delete {{EntityLabel}}')\n        );\n        $this->_addButton(\n            'saveandcontinue',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Save And Continue Edit'),\n                'onclick' => 'saveAndContinueEdit()',\n                'class'   => 'save',\n            ),\n            -100\n        );\n        $this->_formScripts[] = \"\n            function saveAndContinueEdit() {\n                editForm.submit($('edit_form').action+'back/edit/');\n            }\n        \";\n    }\n\n    /**\n     * get the edit form header\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getHeaderText()\n    {\n        if (Mage::registry('current_{{entity}}') && Mage::registry('current_{{entity}}')->getId()) {\n            return Mage::helper('{{namespace}}_{{module}}')->__(\n                \"Edit {{EntityLabel}} '%s'\",\n                $this->escapeHtml(Mage::registry('current_{{entity}}')->get{{EntityNameMagicCode}}())\n            );\n        } else {\n            return Mage::helper('{{namespace}}_{{module}}')->__('Add {{EntityLabel}}');\n        }\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Form/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} edit form\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Form/020_prepare_form",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare form\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form(\n            array(\n                'id'         => 'edit_form',\n                'action'     => $this->getUrl(\n                    '*/*/save',\n                    array(\n                        'id' => $this->getRequest()->getParam('id')\n                    )\n                ),\n                'method'     => 'post',\n                'enctype'    => 'multipart/form-data'\n            )\n        );\n        $form->setUseContainer(true);\n        $this->setForm($form);\n        return parent::_prepareForm();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Form/025_prepare_form_eav",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare form\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form(\n            array(\n                'id'         => 'edit_form',\n                'action'     => $this->getUrl(\n                    '*/*/save',\n                    array(\n                        'id' => $this->getRequest()->getParam('id'),\n                        'store' => $this->getRequest()->getParam('store')\n                    )\n                ),\n                'method'     => 'post',\n                'enctype'    => 'multipart/form-data'\n            )\n        );\n        $form->setUseContainer(true);\n        $this->setForm($form);\n        return parent::_prepareForm();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Form/030_tree_top",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form extends {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Abstract\n{\n    /**\n     * Additional buttons on {{entityLabel}} page\n     * @var array\n     */\n    protected $_additionalButtons = array();\n    /**\n     * constructor\n     *\n     * set template\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setTemplate('{{namespace}}_{{module}}/{{entity}}/edit/form.phtml');\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        ${{entity}} = $this->get{{Entity}}();\n        ${{entity}}Id = (int)${{entity}}->getId();\n        $this->setChild(\n            'tabs',\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tabs', 'tabs')\n        );\n        $this->setChild(\n            'save_button',\n            $this->getLayout()->createBlock('adminhtml/widget_button')\n                ->setData(\n                    array(\n                        'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Save {{EntityLabel}}'),\n                        'onclick' => \"{{entity}}Submit('\" . $this->getSaveUrl() . \"', true)\",\n                        'class'   => 'save'\n                    )\n                )\n        );\n        // Delete button\n        if (!in_array(${{entity}}Id, $this->getRootIds())) {\n            $this->setChild(\n                'delete_button',\n                $this->getLayout()->createBlock('adminhtml/widget_button')\n                    ->setData(\n                        array(\n                            'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Delete {{EntityLabel}}'),\n                            'onclick' => \"{{entity}}Delete('\" . $this->getUrl(\n                                '*/*/delete',\n                                array('_current' => true)\n                            )\n                            . \"', true, {${{entity}}Id})\",\n                            'class'   => 'delete'\n                        )\n                    )\n            );\n        }\n\n        // Reset button\n        $resetPath = ${{entity}} ? '*/*/edit' : '*/*/add';\n        $this->setChild(\n            'reset_button',\n            $this->getLayout()->createBlock('adminhtml/widget_button')\n                ->setData(\n                    array(\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('Reset'),\n                        'onclick'   => \"{{entity}}Reset('\".$this->getUrl(\n                            $resetPath,\n                            array('_current'=>true)\n                        )\n                        .\"',true)\"\n                    )\n                )\n        );\n        return parent::_prepareLayout();\n    }\n\n    /**\n     * get html for delete button\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getDeleteButtonHtml()\n    {\n        return $this->getChildHtml('delete_button');\n    }\n\n    /**\n     * get html for save button\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getSaveButtonHtml()\n    {\n        return $this->getChildHtml('save_button');\n    }\n\n    /**\n     * get html for reset button\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getResetButtonHtml()\n    {\n        return $this->getChildHtml('reset_button');\n    }\n\n    /**\n     * Retrieve additional buttons html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getAdditionalButtonsHtml()\n    {\n        $html = '';\n        foreach ($this->_additionalButtons as $childName) {\n            $html .= $this->getChildHtml($childName);\n        }\n        return $html;\n    }\n\n    /**\n     * Add additional button\n     *\n     * @param string $alias\n     * @param array $config\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form\n     * {{qwertyuiop}}\n     */\n    public function addAdditionalButton($alias, $config)\n    {\n        if (isset($config['name'])) {\n            $config['element_name'] = $config['name'];\n        }\n        $this->setChild(\n            $alias . '_button',\n            $this->getLayout()->createBlock('adminhtml/widget_button')->addData($config)\n        );\n        $this->_additionalButtons[$alias] = $alias . '_button';\n        return $this;\n    }\n\n    /**\n     * Remove additional button\n     *\n     * @access public\n     * @param string $alias\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Form\n     * {{qwertyuiop}}\n     */\n    public function removeAdditionalButton($alias)\n    {\n        if (isset($this->_additionalButtons[$alias])) {\n            $this->unsetChild($this->_additionalButtons[$alias]);\n            unset($this->_additionalButtons[$alias]);\n        }\n        return $this;\n    }\n\n    /**\n     * get html for tabs\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getTabsHtml()\n    {\n        return $this->getChildHtml('tabs');\n    }\n\n    /**\n     * get the form header\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getHeader()\n    {\n        if ($this->get{{Entity}}Id()) {\n            return $this->get{{Entity}}{{EntityNameMagicCode}}();\n        } else {\n            return Mage::helper('{{namespace}}_{{module}}')->__('New Root {{EntityLabel}}');\n        }\n    }\n\n    /**\n     * get the delete url\n     *\n     * @access public\n     * @param array $args\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getDeleteUrl(array $args = array())\n    {\n        $params = array('_current'=>true);\n        $params = array_merge($params, $args);\n        return $this->getUrl('*/*/delete', $params);\n    }\n\n    /**\n     * Return URL for refresh input element 'path' in form\n     *\n     * @access public\n     * @param array $args\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRefreshPathUrl(array $args = array())\n    {\n        $params = array('_current'=>true);\n        $params = array_merge($params, $args);\n        return $this->getUrl('*/*/refreshPath', $params);\n    }\n\n    /**\n     * check if request is ajax\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function isAjax()\n    {\n        return Mage::app()->getRequest()->isXmlHttpRequest() || Mage::app()->getRequest()->getParam('isAjax');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Form/040_product_relation",
    "content": "\n    /**\n     * get products json\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getProductsJson()\n    {\n        $products = $this->get{{Entity}}()->getSelectedProducts();\n        if (!empty($products)) {\n            $positions = array();\n            foreach ($products as $product) {\n                $positions[$product->getId()] = $product->getPosition();\n            }\n            return Mage::helper('core')->jsonEncode($positions);\n        }\n        return '{}';\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Form/050_entity_relation",
    "content": "\n    /**\n     * get {{siblingsLabel}} in json format\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Siblings}}Json()\n    {\n        ${{siblings}} = $this->get{{Entity}}()->getSelected{{Siblings}}();\n        if (!empty(${{siblings}})) {\n            $positions = array();\n            foreach (${{siblings}} as ${{sibling}}) {\n                $positions[${{sibling}}->getId()] = ${{sibling}}->getPosition();\n            }\n            return Mage::helper('core')->jsonEncode($positions);\n        }\n        return '{}';\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Form/060_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/010_top",
    "content": "<?php\n {{License}}\n/**\n * {{Entity}} admin edit tab attributes block\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n*/\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Attributes extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare the attributes for the form\n     *\n     * @access protected\n     * @return void\n     * @see Mage_Adminhtml_Block_Widget_Form::_prepareForm()\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form();\n        $form->setDataObject(Mage::registry('current_{{entity}}'));\n        $fieldset = $form->addFieldset(\n            'info',\n            array(\n                'legend' => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} Information'),\n                'class' => 'fieldset-wide',\n            )\n        );\n        $attributes = $this->getAttributes();\n        foreach ($attributes as $attribute) {\n            $attribute->setEntity(Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}'));\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/020_tree",
    "content": "        if ($this->getAddHiddenFields()) {\n            if (!$this->get{{Entity}}()->getId()) {\n                // path\n                if ($this->getRequest()->getParam('parent')) {\n                    $fieldset->addField(\n                        'path',\n                        'hidden',\n                        array(\n                            'name'  => 'path',\n                            'value' => $this->getRequest()->getParam('parent')\n                        )\n                    );\n                } else {\n                    $fieldset->addField(\n                        'path',\n                        'hidden',\n                        array(\n                            'name'  => 'path',\n                            'value' => 1\n                        )\n                    );\n                }\n            } else {\n                $fieldset->addField(\n                    'id',\n                    'hidden',\n                    array(\n                        'name'  => 'id',\n                        'value' => $this->get{{Entity}}()->getId()\n                    )\n                );\n                $fieldset->addField(\n                    'path',\n                    'hidden',\n                    array(\n                        'name'  => 'path',\n                        'value' => $this->get{{Entity}}()->getPath()\n                    )\n                );\n            }\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/021_default_values",
    "content": "        $this->_setFieldset($attributes, $fieldset, array());\n        $formValues = Mage::registry('current_{{entity}}')->getData();\n        if (!Mage::registry('current_{{entity}}')->getId()) {\n            foreach ($attributes as $attribute) {\n                if (!isset($formValues[$attribute->getAttributeCode()])) {\n                    $formValues[$attribute->getAttributeCode()] = $attribute->getDefaultValue();\n                }\n            }\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/022_default_values_tree",
    "content": "        //do not set default value for path\n        unset($formValues['path']);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/023_layout",
    "content": "        $form->addValues($formValues);\n        $form->setFieldNameSuffix('{{entity}}');\n        $this->setForm($form);\n    }\n\n    /**\n     * prepare layout\n     *\n     * @access protected\n     * @return void\n     * @see Mage_Adminhtml_Block_Widget_Form::_prepareLayout()\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        Varien_Data_Form::setElementRenderer(\n            $this->getLayout()->createBlock('adminhtml/widget_form_renderer_element')\n        );\n        Varien_Data_Form::setFieldsetRenderer(\n            $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset')\n        );\n        Varien_Data_Form::setFieldsetElementRenderer(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{module}}_renderer_fieldset_element')\n        );\n    }\n\n    /**\n     * get the additional element types for form\n     *\n     * @access protected\n     * @return array()\n     * @see Mage_Adminhtml_Block_Widget_Form::_getAdditionalElementTypes()\n     * {{qwertyuiop}}\n     */\n    protected function _getAdditionalElementTypes()\n    {\n        return array(\n            'file'     => Mage::getConfig()->getBlockClassName(\n                '{{namespace}}_{{module}}/adminhtml_{{entity}}_helper_file'\n            ),\n            'image'    => Mage::getConfig()->getBlockClassName(\n                '{{namespace}}_{{module}}/adminhtml_{{entity}}_helper_image'\n            ),\n            'textarea' => Mage::getConfig()->getBlockClassName(\n                'adminhtml/catalog_helper_form_wysiwyg'\n            )\n        );\n    }\n\n    /**\n     * get current entity\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/025_after_html_top",
    "content": "\n    /**\n     * get after element html\n     *\n     * @access protected\n     * @param Varien_Data_Form_Element_Abstract $element\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getAdditionalElementHtml($element)\n    {\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/026_after_html",
    "content": "        if ($element->getName() == '{{sibling}}_id') {\n            $html = '<a href=\"{#url}\" id=\"{{sibling}}_id_link\" target=\"_blank\"></a>';\n            $html .= '<script type=\"text/javascript\">\n            function change{{Sibling}}IdLink() {\n                if ($(\\'{{sibling}}_id\\').value == \\'\\') {\n                    $(\\'{{sibling}}_id_link\\').hide();\n                } else {\n                    $(\\'{{sibling}}_id_link\\').show();\n                    var url = \\''.$this->getUrl('adminhtml/{{module}}_{{sibling}}/edit', array('id'=>'{#id}', 'clear'=>1)).'\\';\n                    var text = \\''.Mage::helper('core')->escapeHtml($this->__('View {#name}')).'\\';\n                    var realUrl = url.replace(\\'{#id}\\', $(\\'{{sibling}}_id\\').value);\n                    $(\\'{{sibling}}_id_link\\').href = realUrl;\n                    $(\\'{{sibling}}_id_link\\').innerHTML = text.replace(\\'{#name}\\', $(\\'{{sibling}}_id\\').options[$(\\'{{sibling}}_id\\').selectedIndex].innerHTML);\n                }\n            }\n            $(\\'{{sibling}}_id\\').observe(\\'change\\', change{{Sibling}}IdLink);\n            change{{Sibling}}IdLink();\n            </script>';\n            return $html;\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/027_after_html_footer",
    "content": "        return '';\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/030_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Categories/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{entity}} - categories relation edit block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Categories extends Mage_Adminhtml_Block_Catalog_Category_Tree\n{\n    protected $_categoryIds = null;\n    protected $_selectedNodes = null;\n\n    /**\n     * constructor\n     *\n     * Specify template to use\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setTemplate('{{namespace}}_{{module}}/{{entity}}/edit/tab/categories.phtml');\n        $this->_withProductCount = false;\n    }\n\n    /**\n     * Retrieve currently edited {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n\n    /**\n     * Return array with categories IDs which the {{entityLabel}} is linked to\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getCategoryIds()\n    {\n        if (is_null($this->_categoryIds)) {\n            $categories = $this->get{{Entity}}()->getSelectedCategories();\n            $ids = array();\n            foreach ($categories as $category) {\n                $ids[] = $category->getId();\n            }\n            $this->_categoryIds = $ids;\n        }\n        return $this->_categoryIds;\n    }\n\n    /**\n     * Forms string out of getCategoryIds()\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getIdsString()\n    {\n        return implode(',', $this->getCategoryIds());\n    }\n\n    /**\n     * Returns root node and sets 'checked' flag (if necessary)\n     *\n     * @access public\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRootNode()\n    {\n        $root = $this->getRoot();\n        if ($root && in_array($root->getId(), $this->getCategoryIds())) {\n            $root->setChecked(true);\n        }\n        return $root;\n    }\n\n    /**\n     * Returns root node\n     *\n     * @param {{Namespace}}_{{Module}}_Model_Category|null $parentNodeCategory\n     * @param int  $recursionLevel\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRoot($parentNodeCategory = null, $recursionLevel = 3)\n    {\n        if (!is_null($parentNodeCategory) && $parentNodeCategory->getId()) {\n            return $this->getNode($parentNodeCategory, $recursionLevel);\n        }\n        $root = Mage::registry('category_root');\n        if (is_null($root)) {\n            $rootId = Mage_Catalog_Model_Category::TREE_ROOT_ID;\n            $ids = $this->getSelectedCategoryPathIds($rootId);\n            $tree = Mage::getResourceSingleton('catalog/category_tree')\n                ->loadByIds($ids, false, false);\n            if ($this->getCategory()) {\n                $tree->loadEnsuredNodes($this->getCategory(), $tree->getNodeById($rootId));\n            }\n            $tree->addCollectionData($this->getCategoryCollection());\n            $root = $tree->getNodeById($rootId);\n            Mage::register('category_root', $root);\n        }\n        return $root;\n    }\n\n    /**\n     * Returns array with configuration of current node\n     *\n     * @access public\n     * @param Varien_Data_Tree_Node $node\n     * @param int $level How deep is the node in the tree\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getNodeJson($node, $level = 1)\n    {\n        $item = parent::_getNodeJson($node, $level);\n        if ($this->_isParentSelectedCategory($node)) {\n            $item['expanded'] = true;\n        }\n        if (in_array($node->getId(), $this->getCategoryIds())) {\n            $item['checked'] = true;\n        }\n        return $item;\n    }\n\n    /**\n     * Returns whether $node is a parent (not exactly direct) of a selected node\n     *\n     * @access public\n     * @param Varien_Data_Tree_Node $node\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _isParentSelectedCategory($node)\n    {\n        $result = false;\n        // Contains string with all category IDs of children (not exactly direct) of the node\n        $allChildren = $node->getAllChildren();\n        if ($allChildren) {\n            $selectedCategoryIds = $this->getCategoryIds();\n            $allChildrenArr = explode(',', $allChildren);\n            for ($i = 0, $cnt = count($selectedCategoryIds); $i < $cnt; $i++) {\n                $isSelf = $node->getId() == $selectedCategoryIds[$i];\n                if (!$isSelf && in_array($selectedCategoryIds[$i], $allChildrenArr)) {\n                    $result = true;\n                    break;\n                }\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * Returns array with nodes those are selected (contain current {{entityLabel}})\n     *\n     * @return array\n     */\n    protected function _getSelectedNodes()\n    {\n        if ($this->_selectedNodes === null) {\n            $this->_selectedNodes = array();\n            $root = $this->getRoot();\n            foreach ($this->getCategoryIds() as $categoryId) {\n                if ($root) {\n                    $this->_selectedNodes[] = $root->getTree()->getNodeById($categoryId);\n                }\n            }\n        }\n        return $this->_selectedNodes;\n    }\n\n    /**\n     * Returns JSON-encoded array of category children\n     *\n     * @access public\n     * @param int $categoryId\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getCategoryChildrenJson($categoryId)\n    {\n        $category = Mage::getModel('catalog/category')->load($categoryId);\n        $node = $this->getRoot($category, 1)->getTree()->getNodeById($categoryId);\n        if (!$node || !$node->hasChildren()) {\n            return '[]';\n        }\n        $children = array();\n        foreach ($node->getChildren() as $child) {\n            $children[] = $this->_getNodeJson($child);\n        }\n        return Mage::helper('core')->jsonEncode($children);\n    }\n\n    /**\n     * Returns URL for loading tree\n     *\n     * @access public\n     * @param null $expanded\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getLoadTreeUrl($expanded = null)\n    {\n        return $this->getUrl('*/*/categoriesJson', array('_current' => true));\n    }\n\n    /**\n     * Return distinct path ids of selected category\n     *\n     * @access public\n     * @param mixed $rootId Root category Id for context\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelectedCategoryPathIds($rootId = false)\n    {\n        $ids = array();\n        $categoryIds = $this->getCategoryIds();\n        if (empty($categoryIds)) {\n            return array();\n        }\n        $collection = Mage::getResourceModel('catalog/category_collection');\n        if ($rootId) {\n            $collection->addFieldToFilter('parent_id', $rootId);\n        } else {\n            $collection->addFieldToFilter('entity_id', array('in'=>$categoryIds));\n        }\n\n        foreach ($collection as $item) {\n            if ($rootId && !in_array($rootId, $item->getPathIds())) {\n                continue;\n            }\n            foreach ($item->getPathIds() as $id) {\n                if (!in_array($id, $ids)) {\n                    $ids[] = $id;\n                }\n            }\n        }\n        return $ids;\n    }\n\n    /**\n     * Get node label\n     *\n     * @access public\n     * @param Varien_Object $node\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function buildNodeName($node)\n    {\n        $result = parent::buildNodeName($node);\n        $result .= '<a target=\"_blank\" href=\"'.\n            $this->getUrl(\n                'adminhtml/catalog_category/index',\n                array('id'=>$node->getId(), 'clear'=>1)\n            ).\n            '\"><em>'.$this->__(' - Edit').'</em></a>';\n        return $result;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} edit form tab\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare the form\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Form\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form();\n        $form->setHtmlIdPrefix('{{entity}}_');\n        $form->setFieldNameSuffix('{{entity}}');\n        $this->setForm($form);\n        $fieldset = $form->addFieldset(\n            '{{entity}}_form',\n            array('legend' => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'))\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/020_image",
    "content": "        $fieldset->addType(\n            'image',\n            Mage::getConfig()->getBlockClassName('{{namespace}}_{{module}}/adminhtml_{{entity}}_helper_image')\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/030_file",
    "content": "        $fieldset->addType(\n            'file',\n            Mage::getConfig()->getBlockClassName('{{namespace}}_{{module}}/adminhtml_{{entity}}_helper_file')\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/040_wysiwyg",
    "content": "        $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/050_wysiwyg_is_tree",
    "content": "        $fieldset->addType(\n            'editor',\n            Mage::getConfig()->getBlockClassName('{{namespace}}_{{module}}/adminhtml_helper_wysiwyg')\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/060_path_tree",
    "content": "        if (!$this->get{{Entity}}()->getId()) {\n            $parentId = $this->getRequest()->getParam('parent');\n            if (!$parentId) {\n                $parentId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n            }\n            $fieldset->addField(\n                'path',\n                'hidden',\n                array(\n                    'name'  => 'path',\n                    'value' => $parentId\n                )\n            );\n        } else {\n            $fieldset->addField(\n                'id',\n                'hidden',\n                array(\n                    'name'  => 'id',\n                    'value' => $this->get{{Entity}}()->getId()\n                )\n            );\n            $fieldset->addField(\n                'path',\n                'hidden',\n                array(\n                    'name'  => 'path',\n                    'value' => $this->get{{Entity}}()->getPath()\n                )\n            );\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/070_parents",
    "content": "        $values = Mage::getResourceModel('{{namespace}}_{{module}}/{{sibling}}_collection')\n            {{siblingToOptionArraySelect}}->toOptionArray();\n        array_unshift($values, array('label' => '', 'value' => ''));\n\n        $html = '<a href=\"{#url}\" id=\"{{entity}}_{{sibling}}_id_link\" target=\"_blank\"></a>';\n        $html .= '<script type=\"text/javascript\">\n            function change{{Sibling}}IdLink() {\n                if ($(\\'{{entity}}_{{sibling}}_id\\').value == \\'\\') {\n                    $(\\'{{entity}}_{{sibling}}_id_link\\').hide();\n                } else {\n                    $(\\'{{entity}}_{{sibling}}_id_link\\').show();\n                    var url = \\''.$this->getUrl('adminhtml/{{module}}_{{sibling}}/edit', array('id'=>'{#id}', 'clear'=>1)).'\\';\n                    var text = \\''.Mage::helper('core')->escapeHtml($this->__('View {#name}')).'\\';\n                    var realUrl = url.replace(\\'{#id}\\', $(\\'{{entity}}_{{sibling}}_id\\').value);\n                    $(\\'{{entity}}_{{sibling}}_id_link\\').href = realUrl;\n                    $(\\'{{entity}}_{{sibling}}_id_link\\').innerHTML = text.replace(\\'{#name}\\', $(\\'{{entity}}_{{sibling}}_id\\').options[$(\\'{{entity}}_{{sibling}}_id\\').selectedIndex].innerHTML);\n                }\n            }\n            $(\\'{{entity}}_{{sibling}}_id\\').observe(\\'change\\', change{{Sibling}}IdLink);\n            change{{Sibling}}IdLink();\n            </script>';\n\n        $fieldset->addField(\n            '{{sibling}}_id',\n            'select',\n            array(\n                'label'     => Mage::helper('{{namespace}}_{{module}}')->__('{{SiblingLabel}}'),\n                'name'      => '{{sibling}}_id',\n                'required'  => false,\n                'values'    => $values,\n                'after_element_html' => $html\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/080_attributes",
    "content": "{{attributePreElementText}}\n        $fieldset->addField(\n            '{{attributeCode}}',\n            '{{attributeFormType}}',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('{{attributeLabel}}'),\n                'name'  => '{{attributeCode}}',\n{{attributeFormOptions}}           )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/090_url_rewrite",
    "content": "        $fieldset->addField(\n            'url_key',\n            'text',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Url key'),\n                'name'  => 'url_key',\n                'note'  => Mage::helper('{{namespace}}_{{module}}')->__('Relative to Website Base URL')\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/100_status",
    "content": "        $fieldset->addField(\n            'status',\n            'select',\n            array(\n                'label'  => Mage::helper('{{namespace}}_{{module}}')->__('Status'),\n                'name'   => 'status',\n                'values' => array(\n                    array(\n                        'value' => 1,\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('Enabled'),\n                    ),\n                    array(\n                        'value' => 0,\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('Disabled'),\n                    ),\n                ),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/110_rss",
    "content": "        $fieldset->addField(\n            'in_rss',\n            'select',\n            array(\n                'label'  => Mage::helper('{{namespace}}_{{module}}')->__('Show in rss'),\n                'name'   => 'in_rss',\n                'values' => array(\n                    array(\n                        'value' => 1,\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('Yes'),\n                    ),\n                    array(\n                        'value' => 0,\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('No'),\n                    ),\n                ),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/120_stores",
    "content": "        if (Mage::app()->isSingleStoreMode()) {\n            $fieldset->addField(\n                'store_id',\n                'hidden',\n                array(\n                    'name'      => 'stores[]',\n                    'value'     => Mage::app()->getStore(true)->getId()\n                )\n            );\n            Mage::registry('current_{{entity}}')->setStoreId(Mage::app()->getStore(true)->getId());\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/130_allow_comment",
    "content": "        $fieldset->addField(\n            'allow_comment',\n            'select',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Allow Comments'),\n                'name'  => 'allow_comment',\n                'values'=> Mage::getModel('{{namespace}}_{{module}}/adminhtml_source_yesnodefault')->toOptionArray()\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/140_add_values_not_tree",
    "content": "        $formValues = Mage::registry('current_{{entity}}')->getDefaultValues();\r\n        if (!is_array($formValues)) {\r\n            $formValues = array();\r\n        }\r\n        if (Mage::getSingleton('adminhtml/session')->get{{Entity}}Data()) {\r\n            $formValues = array_merge($formValues, Mage::getSingleton('adminhtml/session')->get{{Entity}}Data());\r\n            Mage::getSingleton('adminhtml/session')->set{{Entity}}Data(null);\r\n        } elseif (Mage::registry('current_{{entity}}')) {\r\n            $formValues = array_merge($formValues, Mage::registry('current_{{entity}}')->getData());\r\n        }\r\n        $form->setValues($formValues);\r\n        return parent::_prepareForm();\r\n    }\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/150_add_values_tree",
    "content": "        $form->addValues($this->get{{Entity}}()->getData());\n        return parent::_prepareForm();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/160_get_entity_tree",
    "content": "\n    /**\n     * get the current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('{{entity}}');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Form/170_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Meta/010_content",
    "content": "<?php\n{{License}}\n/**\n * meta information tab\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Meta extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare the form\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Meta\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form();\n        $form->setFieldNameSuffix('{{entity}}');\n        $this->setForm($form);\n        $fieldset = $form->addFieldset(\n            '{{entity}}_meta_form',\n            array('legend' => Mage::helper('{{namespace}}_{{module}}')->__('Meta information'))\n        );\n        $fieldset->addField(\n            'meta_title',\n            'text',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Meta-title'),\n                'name'  => 'meta_title',\n            )\n        );\n        $fieldset->addField(\n            'meta_description',\n            'textarea',\n            array(\n                'name'      => 'meta_description',\n                'label'     => Mage::helper('{{namespace}}_{{module}}')->__('Meta-description'),\n              )\n        );\n        $fieldset->addField(\n            'meta_keywords',\n            'textarea',\n            array(\n                'name'      => 'meta_keywords',\n                'label'     => Mage::helper('{{namespace}}_{{module}}')->__('Meta-keywords'),\n            )\n        );\n        $form->addValues(Mage::registry('current_{{entity}}')->getData());\n        return parent::_prepareForm();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Product/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} - product relation edit block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product extends Mage_Adminhtml_Block_Widget_Grid\n{\n    /**\n     * Set grid params\n     *\n     * @access protected\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setId('product_grid');\n        $this->setDefaultSort('position');\n        $this->setDefaultDir('ASC');\n        $this->setUseAjax(true);\n        if ($this->get{{Entity}}()->getId()) {\n            $this->setDefaultFilter(array('in_products'=>1));\n        }\n    }\n\n    /**\n     * prepare the product collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product\n     * {{qwertyuiop}}\n     */\n    protected function _prepareCollection()\n    {\n        /* @var $collection Mage_Catalog_Model_Resource_Product_Collection */\n        $collection = Mage::getResourceModel('catalog/product_collection');\n        $collection->addAttributeToSelect('price');\n        $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;\n        $collection->joinAttribute('product_name', 'catalog_product/name', 'entity_id', null, 'left', $adminStore);\n        if ($this->get{{Entity}}()->getId()) {\n            $constraint = '{{table}}.{{entity}}_id='.$this->get{{Entity}}()->getId();\n        } else {\n            $constraint = '{{table}}.{{entity}}_id=0';\n        }\n        $collection->joinField(\n            'position',\n            '{{namespace}}_{{module}}/{{entity}}_product',\n            'position',\n            'product_id=entity_id',\n            $constraint,\n            'left'\n        );\n        $this->setCollection($collection);\n        parent::_prepareCollection();\n        return $this;\n    }\n\n    /**\n     * prepare mass action grid\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product\n     * {{qwertyuiop}}\n     */\n    protected function _prepareMassaction()\n    {\n        return $this;\n    }\n\n    /**\n     * prepare the grid columns\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product\n     * {{qwertyuiop}}\n     */\n    protected function _prepareColumns()\n    {\n        $this->addColumn(\n            'in_products',\n            array(\n                'header_css_class'  => 'a-center',\n                'type'  => 'checkbox',\n                'name'  => 'in_products',\n                'values'=> $this->_getSelectedProducts(),\n                'align' => 'center',\n                'index' => 'entity_id'\n            )\n        );\n        $this->addColumn(\n            'product_name',\n            array(\n                'header'    => Mage::helper('catalog')->__('Name'),\n                'align'     => 'left',\n                'index'     => 'product_name',\n                'renderer'  => '{{namespace}}_{{module}}/adminhtml_helper_column_renderer_relation',\n                'params'    => array(\n                    'id'    => 'getId'\n                ),\n                'base_link' => 'adminhtml/catalog_product/edit',\n            )\n        );\n        $this->addColumn(\n            'sku',\n            array(\n                'header' => Mage::helper('catalog')->__('SKU'),\n                'align'  => 'left',\n                'index'  => 'sku',\n            )\n        );\n        $this->addColumn(\n            'price',\n            array(\n                'header'        => Mage::helper('catalog')->__('Price'),\n                'type'          => 'currency',\n                'width'         => '1',\n                'currency_code' => (string)Mage::getStoreConfig(\n                    Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE\n                ),\n                'index'         => 'price'\n            )\n        );\n        $this->addColumn(\n            'position',\n            array(\n                'header'         => Mage::helper('catalog')->__('Position'),\n                'name'           => 'position',\n                'width'          => 60,\n                'type'           => 'number',\n                'validate_class' => 'validate-number',\n                'index'          => 'position',\n                'editable'       => true,\n            )\n        );\n    }\n\n    /**\n     * Retrieve selected products\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getSelectedProducts()\n    {\n        $products = $this->get{{Entity}}Products();\n        if (!is_array($products)) {\n            $products = array_keys($this->getSelectedProducts());\n        }\n        return $products;\n    }\n\n    /**\n     * Retrieve selected products\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelectedProducts()\n    {\n        $products = array();\n        $selected = Mage::registry('current_{{entity}}')->getSelectedProducts();\n        if (!is_array($selected)) {\n            $selected = array();\n        }\n        foreach ($selected as $product) {\n            $products[$product->getId()] = array('position' => $product->getPosition());\n        }\n        return $products;\n    }\n\n    /**\n     * get row url\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_Product\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRowUrl($item)\n    {\n        return '#';\n    }\n\n    /**\n     * get grid url\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getGridUrl()\n    {\n        return $this->getUrl(\n            '*/*/productsGrid',\n            array(\n                'id' => $this->get{{Entity}}()->getId()\n            )\n        );\n    }\n\n    /**\n     * get the current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n\n    /**\n     * Add filter\n     *\n     * @access protected\n     * @param object $column\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Product\n     * {{qwertyuiop}}\n     */\n    protected function _addColumnFilterToCollection($column)\n    {\n        // Set custom filter for in product flag\n        if ($column->getId() == 'in_products') {\n            $productIds = $this->_getSelectedProducts();\n            if (empty($productIds)) {\n                $productIds = 0;\n            }\n            if ($column->getFilter()->getValue()) {\n                $this->getCollection()->addFieldToFilter('entity_id', array('in' => $productIds));\n            } else {\n                if ($productIds) {\n                    $this->getCollection()->addFieldToFilter('entity_id', array('nin' => $productIds));\n                }\n            }\n        } else {\n            parent::_addColumnFilterToCollection($column);\n        }\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Sibling/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{entity}} - {{sibling}} relation edit block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Sibling/020_not_tree",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}} extends Mage_Adminhtml_Block_Widget_Grid\n{\n    /**\n     * Set grid params\n     *\n     * @access protected\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setId('{{sibling}}_grid');\n        $this->setDefaultSort('position');\n        $this->setDefaultDir('ASC');\n        $this->setUseAjax(true);\n        if ($this->get{{Entity}}()->getId()) {\n            $this->setDefaultFilter(array('in_{{siblings}}' => 1));\n        }\n    }\n\n    /**\n     * prepare the {{siblingLabel}} collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepareCollection()\n    {\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{sibling}}_collection'){{siblingAdditionalPrepareCollection}};\n        if ($this->get{{Entity}}()->getId()) {\n            $constraint = 'related.{{entity}}_id='.$this->get{{Entity}}()->getId();\n        } else {\n            $constraint = 'related.{{entity}}_id=0';\n        }\n        $collection->getSelect()->joinLeft(\n            array('related' => $collection->getTable('{{namespace}}_{{module}}/{{entity}}_{{sibling}}')),\n            'related.{{sibling}}_id={{siblingTableAlias}}.entity_id AND '.$constraint,\n            array('position')\n        );\n        $this->setCollection($collection);\n        parent::_prepareCollection();\n        return $this;\n    }\n\n    /**\n     * prepare mass action grid\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepareMassaction()\n    {\n        return $this;\n    }\n\n    /**\n     * prepare the grid columns\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepareColumns()\n    {\n        $this->addColumn(\n            'in_{{siblings}}',\n            array(\n                'header_css_class'  => 'a-center',\n                'type'              => 'checkbox',\n                'name'              => 'in_{{siblings}}',\n                'values'            => $this->_getSelected{{Siblings}}(),\n                'align'             => 'center',\n                'index'             => 'entity_id'\n            )\n        );\n        $this->addColumn(\n            '{{siblingNameAttribute}}',\n            array(\n                'header'    => Mage::helper('{{namespace}}_{{module}}')->__('{{siblingNameAttributeLabel}}'),\n                'align'     => 'left',\n                'index'     => '{{siblingNameAttribute}}',\n                'renderer'  => '{{namespace}}_{{module}}/adminhtml_helper_column_renderer_relation',\n                'params'    => array(\n                    'id'    => 'getId'\n                ),\n                'base_link' => 'adminhtml/{{module}}_{{sibling}}/edit',\n            )\n        );\n        $this->addColumn(\n            'position',\n            array(\n                'header'         => Mage::helper('{{namespace}}_{{module}}')->__('Position'),\n                'name'           => 'position',\n                'width'          => 60,\n                'type'           => 'number',\n                'validate_class' => 'validate-number',\n                'index'          => 'position',\n                'editable'       => true,\n            )\n        );\n    }\n\n    /**\n     * Retrieve selected {{siblingsLabel}}\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getSelected{{Siblings}}()\n    {\n        ${{siblings}} = $this->get{{Entity}}{{Siblings}}();\n        if (!is_array(${{siblings}})) {\n            ${{siblings}} = array_keys($this->getSelected{{Siblings}}());\n        }\n        return ${{siblings}};\n    }\n\n    /**\n     * Retrieve selected {{siblingsLabels}}\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Siblings}}()\n    {\n        ${{siblings}} = array();\n        $selected = Mage::registry('current_{{entity}}')->getSelected{{Siblings}}();\n        if (!is_array($selected)) {\n            $selected = array();\n        }\n        foreach ($selected as ${{sibling}}) {\n            ${{siblings}}[${{sibling}}->getId()] = array('position' => ${{sibling}}->getPosition());\n        }\n        return ${{siblings}};\n    }\n\n    /**\n     * get row url\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Sibling}}\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRowUrl($item)\n    {\n        return '#';\n    }\n\n    /**\n     * get grid url\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getGridUrl()\n    {\n        return $this->getUrl(\n            '*/*/{{siblings}}Grid',\n            array(\n                'id' => $this->get{{Entity}}()->getId()\n            )\n        );\n    }\n\n    /**\n     * get the current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n\n    /**\n     * Add filter\n     *\n     * @access protected\n     * @param object $column\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    protected function _addColumnFilterToCollection($column)\n    {\n        // Set custom filter for in product flag\n        if ($column->getId() == 'in_{{siblings}}') {\n            ${{sibling}}Ids = $this->_getSelected{{Siblings}}();\n            if (empty(${{sibling}}Ids)) {\n                ${{sibling}}Ids = 0;\n            }\n            if ($column->getFilter()->getValue()) {\n                $this->getCollection()->addFieldToFilter('entity_id', array('in'=>${{sibling}}Ids));\n            } else {\n                if (${{sibling}}Ids) {\n                    $this->getCollection()->addFieldToFilter('entity_id', array('nin'=>${{sibling}}Ids));\n                }\n            }\n        } else {\n            parent::_addColumnFilterToCollection($column);\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Sibling/030_tree",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_{{Sibling}} extends {{Namespace}}_{{Module}}_Block_Adminhtml_{{Sibling}}_Tree\n{\n    protected $_{{sibling}}Ids = null;\n    protected $_selectedNodes = null;\n\n    /**\n     * constructor\n     * Specify template to use\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setTemplate('{{namespace}}_{{module}}/{{entity}}/edit/tab/{{sibling}}.phtml');\n    }\n\n    /**\n     * Retrieve currently edited {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n\n    /**\n     * Return array with {{siblingsLabel}} IDs which the {{entityLabel}} is linked to\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function get{{Sibling}}Ids()\n    {\n        if (is_null($this->_{{sibling}}Ids)) {\n            ${{siblings}} = $this->get{{Entity}}()->getSelected{{Siblings}}();\n            $ids = array();\n            foreach (${{siblings}} as ${{sibling}}) {\n                $ids[] = ${{sibling}}->getId();\n            }\n            $this->_{{sibling}}Ids = $ids;\n        }\n        return $this->_{{sibling}}Ids;\n    }\n\n    /**\n     * Forms string out of get{{Sibling}}Ids()\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getIdsString()\n    {\n        return implode(',', $this->get{{Sibling}}Ids());\n    }\n\n    /**\n     * Returns root node and sets 'checked' flag (if necessary)\n     *\n     * @access public\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRootNode()\n    {\n        $root = $this->getRoot();\n        if ($root && in_array($root->getId(), $this->get{{Sibling}}Ids())) {\n            $root->setChecked(true);\n        }\n        return $root;\n    }\n\n    /**\n     * Returns root node\n     *\n     * @param {{Namespace}}_{{Module}}_Model_{{Sibling}}|null $parentNode{{Sibling}}\n     * @param int  $recursionLevel\n     * @return Varien_Data_Tree_Node\n     * {{qwertyuiop}}\n     */\n    public function getRoot($parentNode{{Sibling}} = null, $recursionLevel = 3)\n    {\n        if (!is_null($parentNode{{Sibling}}) && $parentNode{{Sibling}}->getId()) {\n            return $this->getNode($parentNode{{Sibling}}, $recursionLevel);\n        }\n        $root = Mage::registry('{{sibling}}_root');\n        if (is_null($root)) {\n            $rootId = Mage::helper('{{namespace}}_{{module}}/{{sibling}}')->getRoot{{Sibling}}Id();\n            $ids    = $this->getSelected{{Sibling}}PathIds($rootId);\n            $tree   = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{sibling}}_tree')\n                ->loadByIds($ids, false, false);\n            if ($this->get{{Sibling}}()) {\n                $tree->loadEnsuredNodes($this->get{{Sibling}}(), $tree->getNodeById($rootId));\n            }\n            $tree->addCollectionData($this->get{{Sibling}}Collection());\n            $root = $tree->getNodeById($rootId);\n            Mage::register('{{sibling}}_root', $root);\n        }\n        return $root;\n    }\n\n    /**\n     * Returns array with configuration of current node\n     *\n     * @access public\n     * @param Varien_Data_Tree_Node $node\n     * @param int $level How deep is the node in the tree\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getNodeJson($node, $level = 1)\n    {\n        $item = parent::_getNodeJson($node, $level);\n        if ($this->_isParentSelected{{Sibling}}($node)) {\n            $item['expanded'] = true;\n        }\n        if (in_array($node->getId(), $this->get{{Sibling}}Ids())) {\n            $item['checked'] = true;\n        }\n        return $item;\n    }\n\n    /**\n     * Returns whether $node is a parent (not exactly direct) of a selected node\n     *\n     * @access public\n     * @param Varien_Data_Tree_Node $node\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _isParentSelected{{Sibling}}($node)\n    {\n        $result = false;\n        // Contains string with all {{siblingLabel}} IDs of children (not exactly direct) of the node\n        $allChildren = $node->getAllChildren();\n        if ($allChildren) {\n            $selected{{Sibling}}Ids = $this->get{{Sibling}}Ids();\n            $allChildrenArr = explode(',', $allChildren);\n            for ($i = 0, $cnt = count($selected{{Sibling}}Ids); $i < $cnt; $i++) {\n                $isSelf = $node->getId() == $selected{{Sibling}}Ids[$i];\n                if (!$isSelf && in_array($selected{{Sibling}}Ids[$i], $allChildrenArr)) {\n                    $result = true;\n                    break;\n                }\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * Returns array with nodes those are selected (contain current {{entityLabel}})\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getSelectedNodes()\n    {\n        if ($this->_selectedNodes === null) {\n            $this->_selectedNodes = array();\n            $root = $this->getRoot();\n            foreach ($this->get{{Sibling}}Ids() as ${{sibling}}Id) {\n                if ($root) {\n                    $this->_selectedNodes[] = $root->getTree()->getNodeById(${{sibling}}Id);\n                }\n            }\n        }\n        return $this->_selectedNodes;\n    }\n\n    /**\n     * Returns JSON-encoded array of {{siblingsLabel}} children\n     *\n     * @access public\n     * @param int ${{sibling}}Id\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Sibling}}ChildrenJson(${{sibling}}Id)\n    {\n        ${{sibling}} = Mage::getModel('{{namespace}}_{{module}}/{{sibling}}')->load(${{sibling}}Id);\n        $node = $this->getRoot(${{sibling}}, 1)->getTree()->getNodeById(${{sibling}}Id);\n        if (!$node || !$node->hasChildren()) {\n            return '[]';\n        }\n        $children = array();\n        foreach ($node->getChildren() as $child) {\n            $children[] = $this->_getNodeJson($child);\n        }\n        return Mage::helper('core')->jsonEncode($children);\n    }\n\n    /**\n     * Returns URL for loading tree\n     *\n     * @access public\n     * @param null $expanded\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getLoadTreeUrl($expanded = null)\n    {\n        return $this->getUrl('*/*/{{siblings}}Json', array('_current' => true));\n    }\n\n    /**\n     * Return distinct path ids of selected {{siblingsLabel}}\n     *\n     * @access public\n     * @param mixed $rootId Root {{siblingLabel}} Id for context\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Sibling}}PathIds($rootId = false)\n    {\n        $ids = array();\n        ${{sibling}}Ids = $this->get{{Sibling}}Ids();\n        if (empty(${{sibling}}Ids)) {\n            return array();\n        }\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{sibling}}_collection');\n        if ($rootId) {\n            $collection->addFieldToFilter('parent_id', $rootId);\n        } else {\n            $collection->addFieldToFilter('entity_id', array('in' => ${{sibling}}Ids));\n        }\n\n        foreach ($collection as $item) {\n            if ($rootId && !in_array($rootId, $item->getPathIds())) {\n                continue;\n            }\n            foreach ($item->getPathIds() as $id) {\n                if (!in_array($id, $ids)) {\n                    $ids[] = $id;\n                }\n            }\n        }\n        return $ids;\n    }\n\n    /**\n     * Get node label\n     *\n     * @access public\n     * @param Varien_Object $node\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function buildNodeName($node)\n    {\n        $result = parent::buildNodeName($node);\n        $result .= '<a target=\"_blank\" href=\"'.\n            $this->getUrl(\n                'adminhtml/{{module}}_{{sibling}}/index',\n                array(\n                    'id'    => $node->getId(),\n                    'clear' => 1\n                )\n            ).\n            '\"><em>'.$this->__(' - Edit').'</em></a>';\n        return $result;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Sibling/040_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tab/Stores/010_content",
    "content": "<?php\n{{License}}\n/**\n * store selection tab\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Stores extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * prepare the form\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tab_Stores\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form();\n        $form->setFieldNameSuffix('{{entity}}');\n        $this->setForm($form);\n        $fieldset = $form->addFieldset(\n            '{{entity}}_stores_form',\n            array('legend' => Mage::helper('{{namespace}}_{{module}}')->__('Store views'))\n        );\n        $field = $fieldset->addField(\n            'store_id',\n            'multiselect',\n            array(\n                'name'     => 'stores[]',\n                'label'    => Mage::helper('{{namespace}}_{{module}}')->__('Store Views'),\n                'title'    => Mage::helper('{{namespace}}_{{module}}')->__('Store Views'),\n                'required' => true,\n                'values'   => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),\n            )\n        );\n        $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');\n        $field->setRenderer($renderer);\n        $form->addValues(Mage::registry('current_{{entity}}')->getData());\n        return parent::_prepareForm();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin edit tabs\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs\n{\n    /**\n     * Initialize Tabs\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/020_flat_not_tree_prepare",
    "content": "        parent::__construct();\n        $this->setId('{{entity}}_tabs');\n        $this->setDestElementId('edit_form');\n        $this->setTitle(Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'));\n    }\n\n    /**\n     * before render html\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tabs\n     * {{qwertyuiop}}\n     */\n    protected function _beforeToHtml()\n    {\n        $this->addTab(\n            'form_{{entity}}',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'),\n                'title'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_form'\n                )\n                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/030_flat_tree_prepare",
    "content": "        $this->setId('{{entity}}_info_tabs');\n        $this->setDestElementId('{{entity}}_tab_content');\n        $this->setTitle(Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'));\n        $this->setTemplate('widget/tabshoriz.phtml');\n    }\n\n    /**\n     * Prepare Layout Content\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tabs\n     */\n    protected function _prepareLayout()\n    {\n        $this->addTab(\n            'form_{{entity}}',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'),\n                'title'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_form'\n                )\n                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/040_eav_prepare_top",
    "content": "        parent::__construct();\n        $this->setId('{{entity}}_info_tabs');\n        $this->setDestElementId('edit_form');\n        $this->setTitle(Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} Information'));\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tabs\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        ${{entity}} = $this->get{{Entity}}();\n        $entity = Mage::getModel('eav/entity_type')\n            ->load('{{namespace}}_{{module}}_{{entity}}', 'entity_type_code');\n        $attributes = Mage::getResourceModel('eav/entity_attribute_collection')\n                ->setEntityTypeFilter($entity->getEntityTypeId());\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/042_eav_tree_prepare_top",
    "content": "        parent::__construct();\n        $this->setId('{{entity}}_info_tabs');\n        $this->setDestElementId('{{entity}}_tab_content');\n        $this->setTitle(Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} Information'));\n        $this->setTemplate('widget/tabshoriz.phtml');\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Edit_Tabs\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        ${{entity}} = $this->get{{Entity}}();\n        $entity = Mage::getModel('eav/entity_type')\n            ->load('{{namespace}}_{{module}}_{{entity}}', 'entity_type_code');\n        $attributes = Mage::getResourceModel('eav/entity_attribute_collection')\n                ->setEntityTypeFilter($entity->getEntityTypeId());\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/043_eav_seo_prepare",
    "content": "        $attributes->addFieldToFilter(\n            'attribute_code',\n            array(\n                'nin' => array('meta_title', 'meta_description', 'meta_keywords')\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/047_eav_prepare_bottom",
    "content": "        $attributes->getSelect()->order('additional_table.position', 'ASC');\n\n        $this->addTab(\n            'info',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} Information'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_attributes'\n                )\n                ->setAttributes($attributes)\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/048_eav_prepare_bottom_tree",
    "content": "                ->setAddHiddenFields(true)\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/049_eav_prepare_real_bottom",
    "content": "                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/050_seo",
    "content": "        $this->addTab(\n            'form_meta_{{entity}}',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Meta'),\n                'title'   => Mage::helper('{{namespace}}_{{module}}')->__('Meta'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_meta'\n                )\n                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/055_seo_eav",
    "content": "        $seoAttributes = Mage::getResourceModel('eav/entity_attribute_collection')\n            ->setEntityTypeFilter($entity->getEntityTypeId())\n            ->addFieldToFilter(\n                'attribute_code',\n                array(\n                    'in' => array('meta_title', 'meta_description', 'meta_keywords')\n                )\n            );\n        $seoAttributes->getSelect()->order('additional_table.position', 'ASC');\n\n        $this->addTab(\n            'meta',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Meta'),\n                'title'   => Mage::helper('{{namespace}}_{{module}}')->__('Meta'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_attributes'\n                )\n                ->setAttributes($seoAttributes)\n                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/060_stores",
    "content": "        if (!Mage::app()->isSingleStoreMode()) {\n            $this->addTab(\n                'form_store_{{entity}}',\n                array(\n                    'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Store views'),\n                    'title'   => Mage::helper('{{namespace}}_{{module}}')->__('Store views'),\n                    'content' => $this->getLayout()->createBlock(\n                        '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_stores'\n                    )\n                    ->toHtml(),\n                )\n            );\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/070_relation_not_tree",
    "content": "        $this->addTab(\n            '{{siblings}}',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('{{SiblingsLabel}}'),\n                'url'   => $this->getUrl('*/*/{{siblings}}', array('_current' => true)),\n                'class' => 'ajax'\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/080_relation_tree",
    "content": "        $this->addTab(\n            '{{siblings}}',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('{{SiblingsLabel}}'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}',\n                    '{{entity}}.{{sibling}}.grid'\n                )\n                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/090_product_relation_not_tree",
    "content": "        $this->addTab(\n            'products',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Associated products'),\n                'url'   => $this->getUrl('*/*/products', array('_current' => true)),\n                'class' => 'ajax'\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/100_product_relation_tree",
    "content": "        $this->addTab(\n            'products',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Associated Products'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_product',\n                    '{{entity}}.product.grid'\n                )\n                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/110_category_relation_not_tree",
    "content": "        $this->addTab(\n            'categories',\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Associated categories'),\n                'url'   => $this->getUrl('*/*/categories', array('_current' => true)),\n                'class' => 'ajax'\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/120_category_relation_tree",
    "content": "        $this->addTab(\n            'categories',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Associated Categories'),\n                'content' => $this->getLayout()->createBlock(\n                    '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_categories',\n                    '{{entity}}.category.tree'\n                )\n                ->toHtml(),\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/130_end_prepare_not_tree",
    "content": "        return parent::_beforeToHtml();\r\n    }\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/140_end_prepare_tree",
    "content": "        return parent::_beforeToHtml();\r\n    }\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Edit/Tabs/150_footer",
    "content": "\n    /**\n     * Retrieve {{entityLabel}} entity\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin grid block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid extends Mage_Adminhtml_Block_Widget_Grid\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setId('{{entity}}Grid');\n        $this->setDefaultSort('entity_id');\n        $this->setDefaultDir('ASC');\n        $this->setSaveParametersInSession(true);\n        $this->setUseAjax(true);\n    }\n\n    /**\n     * prepare collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _prepareCollection()\n    {\n        $collection = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n            ->getCollection(){{entityCollectionAttributes}};\n        {{entityAdminJoin}}\n        $this->setCollection($collection);\n        return parent::_prepareCollection();\n    }\n\n    /**\n     * prepare grid collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _prepareColumns()\n    {\n        $this->addColumn(\n            'entity_id',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('Id'),\n                'index'  => 'entity_id',\n                'type'   => 'number'\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/020_parents",
    "content": "        $this->addColumn(\n            '{{sibling}}_id',\n            array(\n                'header'    => Mage::helper('{{namespace}}_{{module}}')->__('{{SiblingLabel}}'),\n                'index'     => '{{sibling}}_id',\n                'type'      => 'options',\n                'options'   => Mage::getResourceModel('{{namespace}}_{{module}}/{{sibling}}_collection')\n                    {{siblingToOptionArraySelect}}->toOptionHash(),\n                'renderer'  => '{{namespace}}_{{module}}/adminhtml_helper_column_renderer_parent',\n                'params'    => array(\n                    'id'    => 'get{{Sibling}}Id'\n                ),{{siblingParentStaticParams}}\n                'base_link' => 'adminhtml/{{module}}_{{sibling}}/edit'\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/030_name_attribute",
    "content": "        $this->addColumn(\n            '{{nameAttributeCode}}',\n            array(\n                'header'    => Mage::helper('{{namespace}}_{{module}}')->__('{{nameAttributeLabel}}'),\n                'align'     => 'left',\n                'index'     => '{{nameAttributeCode}}',\n            )\n        );\n        {{nameAttributeGridEav}}\n        $this->addColumn(\n            'status',\n            array(\n                'header'  => Mage::helper('{{namespace}}_{{module}}')->__('Status'),\n                'index'   => 'status',\n                'type'    => 'options',\n                'options' => array(\n                    '1' => Mage::helper('{{namespace}}_{{module}}')->__('Enabled'),\n                    '0' => Mage::helper('{{namespace}}_{{module}}')->__('Disabled'),\n                )\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/040_grid_attributes",
    "content": "        $this->addColumn(\n            '{{attributeCode}}',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('{{attributeLabel}}'),\n                'index'  => '{{attributeCode}}',{{attributeColumnOptions}}\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/050_url_rewrite",
    "content": "        $this->addColumn(\n            'url_key',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('URL key'),\n                'index'  => 'url_key',\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/060_stores",
    "content": "        if (!Mage::app()->isSingleStoreMode() && !$this->_isExport) {\n            $this->addColumn(\n                'store_id',\n                array(\n                    'header'     => Mage::helper('{{namespace}}_{{module}}')->__('Store Views'),\n                    'index'      => 'store_id',\n                    'type'       => 'store',\n                    'store_all'  => true,\n                    'store_view' => true,\n                    'sortable'   => false,\n                    'filter_condition_callback'=> array($this, '_filterStoreCondition'),\n                )\n            );\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/070_created_at",
    "content": "        $this->addColumn(\n            'created_at',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('Created at'),\n                'index'  => 'created_at',\n                'width'  => '120px',\n                'type'   => 'datetime',\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/080_updated_at",
    "content": "        $this->addColumn(\n            'updated_at',\n            array(\n                'header'    => Mage::helper('{{namespace}}_{{module}}')->__('Updated at'),\n                'index'     => 'updated_at',\n                'width'     => '120px',\n                'type'      => 'datetime',\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/090_columns_footer",
    "content": "        $this->addColumn(\n            'action',\n            array(\n                'header'  =>  Mage::helper('{{namespace}}_{{module}}')->__('Action'),\n                'width'   => '100',\n                'type'    => 'action',\n                'getter'  => 'getId',\n                'actions' => array(\n                    array(\n                        'caption' => Mage::helper('{{namespace}}_{{module}}')->__('Edit'),\n                        'url'     => array('base'=> '*/*/edit'),\n                        'field'   => 'id'\n                    )\n                ),\n                'filter'    => false,\n                'is_system' => true,\n                'sortable'  => false,\n            )\n        );\n        $this->addExportType('*/*/exportCsv', Mage::helper('{{namespace}}_{{module}}')->__('CSV'));\n        $this->addExportType('*/*/exportExcel', Mage::helper('{{namespace}}_{{module}}')->__('Excel'));\n        $this->addExportType('*/*/exportXml', Mage::helper('{{namespace}}_{{module}}')->__('XML'));\n        return parent::_prepareColumns();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/100_eav_functions",
    "content": "\n    /**\n     * get the selected store\n     *\n     * @access protected\n     * @return Mage_Core_Model_Store\n     * {{qwertyuiop}}\n     */\n    protected function _getStore()\n    {\n        $storeId = (int) $this->getRequest()->getParam('store', 0);\n        return Mage::app()->getStore($storeId);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/110_mass_action_top",
    "content": "\n    /**\n     * prepare mass action\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _prepareMassaction()\n    {\n        $this->setMassactionIdField('entity_id');\n        $this->getMassactionBlock()->setFormFieldName('{{entity}}');\n        $this->getMassactionBlock()->addItem(\n            'delete',\n            array(\n                'label'=> Mage::helper('{{namespace}}_{{module}}')->__('Delete'),\n                'url'  => $this->getUrl('*/*/massDelete'),\n                'confirm'  => Mage::helper('{{namespace}}_{{module}}')->__('Are you sure?')\n            )\n        );\n        $this->getMassactionBlock()->addItem(\n            'status',\n            array(\n                'label'      => Mage::helper('{{namespace}}_{{module}}')->__('Change status'),\n                'url'        => $this->getUrl('*/*/massStatus', array('_current'=>true)),\n                'additional' => array(\n                    'status' => array(\n                        'name'   => 'status',\n                        'type'   => 'select',\n                        'class'  => 'required-entry',\n                        'label'  => Mage::helper('{{namespace}}_{{module}}')->__('Status'),\n                        'values' => array(\n                            '1' => Mage::helper('{{namespace}}_{{module}}')->__('Enabled'),\n                            '0' => Mage::helper('{{namespace}}_{{module}}')->__('Disabled'),\n                        )\n                    )\n                )\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/120_mass_action_flags",
    "content": "        $this->getMassactionBlock()->addItem(\n            '{{attributeCode}}',\n            array(\n                'label'      => Mage::helper('{{namespace}}_{{module}}')->__('Change {{attributeLabel}}'),\n                'url'        => $this->getUrl('*/*/mass{{AttributeMagicCode}}', array('_current'=>true)),\n                'additional' => array(\n                    'flag_{{attributeCode}}' => array(\n                        'name'   => 'flag_{{attributeCode}}',\n                        'type'   => 'select',\n                        'class'  => 'required-entry',\n                        'label'  => Mage::helper('{{namespace}}_{{module}}')->__('{{attributeLabel}}'),\n                        'values' => {{massActionValues}}\n                    )\n                )\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/130_mass_action_parents",
    "content": "        $values = Mage::getResourceModel('{{namespace}}_{{module}}/{{sibling}}_collection')->toOptionHash();\n        $values = array_reverse($values, true);\n        $values[''] = '';\n        $values = array_reverse($values, true);\n        $this->getMassactionBlock()->addItem(\n            '{{sibling}}_id',\n            array(\n                'label'      => Mage::helper('{{namespace}}_{{module}}')->__('Change {{SiblingLabel}}'),\n                'url'        => $this->getUrl('*/*/mass{{Sibling}}Id', array('_current'=>true)),\n                'additional' => array(\n                    'flag_{{sibling}}_id' => array(\n                        'name'   => 'flag_{{sibling}}_id',\n                        'type'   => 'select',\n                        'class'  => 'required-entry',\n                        'label'  => Mage::helper('{{namespace}}_{{module}}')->__('{{SiblingLabel}}'),\n                        'values' => $values\n                    )\n                )\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/140_collection_end",
    "content": "        return $this;\n    }\n\n    /**\n     * get the row url\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRowUrl($row)\n    {\n        return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n    }\n\n    /**\n     * get the grid url\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getGridUrl()\n    {\n        return $this->getUrl('*/*/grid', array('_current'=>true));\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/145_collection_walk",
    "content": "\n    /**\n     * after collection load\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _afterLoadCollection()\n    {\n        $this->getCollection()->walk('afterLoad');\n        parent::_afterLoadCollection();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/150_store_filter",
    "content": "\n    /**\n     * filter store column\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection $collection\n     * @param Mage_Adminhtml_Block_Widget_Grid_Column $column\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Grid\n     * {{qwertyuiop}}\n     */\n    protected function _filterStoreCondition($collection, $column)\n    {\n        if (!$value = $column->getFilter()->getValue()) {\n            return;\n        }\n        $collection->addStoreFilter($value);\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Grid/160_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Helper/File/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} file field renderer helper\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Helper_File extends Varien_Data_Form_Element_Abstract\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @param array $data\n     * {{qwertyuiop}}\n     */\n    public function __construct($data)\n    {\n        parent::__construct($data);\n        $this->setType('file');\n    }\n\n    /**\n     * get element html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getElementHtml()\n    {\n        $html = '';\n        $this->addClass('input-file');\n        $html .= parent::getElementHtml();\n        if ($this->getValue()) {\n            $url = $this->_getUrl();\n            if (!preg_match(\"/^http\\:\\/\\/|https\\:\\/\\//\", $url)) {\n                $url = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getFileBaseUrl() . $url;\n            }\n            $html .= '<br /><a href=\"'.$url.'\">'.$this->_getUrl().'</a> ';\n        }\n        $html .= $this->_getDeleteCheckbox();\n        return $html;\n    }\n\n    /**\n     * get the delete checkbox HTML\n     *\n     * @access protected\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getDeleteCheckbox()\n    {\n        $html = '';\n        if ($this->getValue()) {\n            $label = Mage::helper('{{namespace}}_{{module}}')->__('Delete File');\n            $html .= '<span class=\"delete-image\">';\n            $html .= '<input type=\"checkbox\" name=\"'.\n                parent::getName().'[delete]\" value=\"1\" class=\"checkbox\" id=\"'.\n                $this->getHtmlId().'_delete\"'.($this->getDisabled() ? ' disabled=\"disabled\"': '').'/>';\n            $html .= '<label for=\"'.$this->getHtmlId().'_delete\"'.($this->getDisabled() ? ' class=\"disabled\"' : '').'>';\n            $html .= $label.'</label>';\n            $html .= $this->_getHiddenInput();\n            $html .= '</span>';\n        }\n        return $html;\n    }\n\n    /**\n     * get the hidden input\n     *\n     * @access protected\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getHiddenInput()\n    {\n        return '<input type=\"hidden\" name=\"'.parent::getName().'[value]\" value=\"'.$this->getValue().'\" />';\n    }\n\n    /**\n     * get the file url\n     *\n     * @access protected\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getUrl()\n    {\n        return $this->getValue();\n    }\n\n    /**\n     * get the name\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getName()\n    {\n        return $this->getData('name');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Helper/Image/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} image field renderer helper\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Helper_Image extends Varien_Data_Form_Element_Image\n{\n    /**\n     * get the url of the image\n     *\n     * @access protected\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getUrl()\n    {\n        $url = false;\n        if ($this->getValue()) {\n            $url = Mage::helper('{{namespace}}_{{module}}/{{entity}}_image')->getImageBaseUrl().\n                $this->getValue();\n        }\n        return $url;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Tree/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin tree block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Tree extends {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Abstract\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setTemplate('{{namespace}}_{{module}}/{{entity}}/tree.phtml');\n        $this->setUseAjax(true);\n        $this->_withProductCount = true;\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Tree\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        $addUrl = $this->getUrl(\n            \"*/*/add\",\n            array(\n                '_current'=>true,\n                'id'=>null,\n                '_query' => false\n            )\n        );\n\n        $this->setChild(\n            'add_sub_button',\n            $this->getLayout()->createBlock('adminhtml/widget_button')\n                ->setData(\n                    array(\n                        'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Add Child {{EntityLabel}}'),\n                        'onclick' => \"addNew('\".$addUrl.\"', false)\",\n                        'class'   => 'add',\n                        'id'      => 'add_child_{{entity}}_button',\n                        'style'   => $this->canAddChild() ? '' : 'display: none;'\n                    )\n                )\n        );\n\n        $this->setChild(\n            'add_root_button',\n            $this->getLayout()->createBlock('adminhtml/widget_button')\n                ->setData(\n                    array(\n                        'label'   => Mage::helper('{{namespace}}_{{module}}')->__('Add Root {{EntityLabel}}'),\n                        'onclick' => \"addNew('\".$addUrl.\"', true)\",\n                        'class'   => 'add',\n                        'id'      => 'add_root_{{entity}}_button'\n                    )\n                )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Tree/020_store_switcher",
    "content": "        $this->setChild(\n            'store_switcher',\n            $this->getLayout()->createBlock('adminhtml/store_switcher')\n                ->setSwitchUrl(\n                    $this->getUrl(\n                        '*/*/*',\n                        array(\n                            '_current' =>true,\n                            '_query'=>false,\n                            'store'=>null\n                        )\n                    )\n                )\n                ->setTemplate('store/switcher/enhanced.phtml')\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Tree/030_content",
    "content": "        return parent::_prepareLayout();\n    }\n\n    /**\n     * get the {{entityLabel}} collection\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Collection()\n    {\n        $collection = $this->getData('{{entity}}_collection');\n        if (is_null($collection)) {\n            $collection = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->getCollection();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Tree/040_eav",
    "content": "            $collection->addAttributeToSelect('{{nameAttributeCode}}')->addAttributeToSelect('status');\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Tree/050_methods",
    "content": "            $this->setData('{{entity}}_collection', $collection);\n        }\n        return $collection;\n    }\n\n    /**\n     * get html for add root button\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getAddRootButtonHtml()\n    {\n        return $this->getChildHtml('add_root_button');\n    }\n\n    /**\n     * get html for add child button\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getAddSubButtonHtml()\n    {\n        return $this->getChildHtml('add_sub_button');\n    }\n\n    /**\n     * get html for expand button\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getExpandButtonHtml()\n    {\n        return $this->getChildHtml('expand_button');\n    }\n\n    /**\n     * get html for add collapse button\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getCollapseButtonHtml()\n    {\n        return $this->getChildHtml('collapse_button');\n    }\n\n    /**\n     * get url for tree load\n     *\n     * @access public\n     * @param mxed $expanded\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getLoadTreeUrl($expanded=null)\n    {\n        $params = array('_current' => true, 'id' => null, 'store' => null);\n        if ((is_null($expanded) &&\n            Mage::getSingleton('admin/session')->get{{Entity}}IsTreeWasExpanded()) ||\n            $expanded == true) {\n            $params['expand_all'] = true;\n        }\n        return $this->getUrl('*/*/{{entities}}Json', $params);\n    }\n\n    /**\n     * get url for loading nodes\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getNodesUrl()\n    {\n        return $this->getUrl('*/{{module}}_{{entities}}/jsonTree');\n    }\n\n    /**\n     * check if tree is expanded\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getIsWasExpanded()\n    {\n        return Mage::getSingleton('admin/session')->get{{Entity}}IsTreeWasExpanded();\n    }\n\n    /**\n     * get url for moving {{entityLabel}}\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getMoveUrl()\n    {\n        return $this->getUrl('*/{{module}}_{{entity}}/move');\n    }\n\n    /**\n     * get the tree as json\n     *\n     * @access public\n     * @param mixed $parentNode{{Entity}}\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getTree($parentNode{{Entity}} = null)\n    {\n        $rootArray = $this->_getNodeJson($this->getRoot($parentNode{{Entity}}));\n        $tree = isset($rootArray['children']) ? $rootArray['children'] : array();\n        return $tree;\n    }\n\n    /**\n     * get the tree as json\n     *\n     * @access public\n     * @param mixed $parentNode{{Entity}}\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getTreeJson($parentNode{{Entity}} = null)\n    {\n        $rootArray = $this->_getNodeJson($this->getRoot($parentNode{{Entity}}));\n        $json = Mage::helper('core')->jsonEncode(isset($rootArray['children']) ? $rootArray['children'] : array());\n        return $json;\n    }\n\n    /**\n     * Get JSON of array of {{entitiesLabel}}, that are breadcrumbs for specified {{entityLabel}} path\n     *\n     * @access public\n     * @param string $path\n     * @param string $javascriptVarName\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getBreadcrumbsJavascript($path, $javascriptVarName)\n    {\n        if (empty($path)) {\n            return '';\n        }\n\n        ${{entities}} = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_tree')\n            ->loadBreadcrumbsArray($path);\n        if (empty(${{entities}})) {\n            return '';\n        }\n        foreach (${{entities}} as $key => ${{entity}}) {\n            ${{entities}}[$key] = $this->_getNodeJson(${{entity}});\n        }\n        return\n            '<script type=\"text/javascript\">'\n            . $javascriptVarName . ' = ' . Mage::helper('core')->jsonEncode(${{entities}}) . ';'\n            . ($this->canAddChild() ? '$(\"add_child_{{entity}}_button\").show();' : '$(\"add_child_{{entity}}_button\").hide();')\n            . '</script>';\n    }\n\n    /**\n     * Get JSON of a tree node or an associative array\n     *\n     * @access protected\n     * @param Varien_Data_Tree_Node|array $node\n     * @param int $level\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getNodeJson($node, $level = 0)\n    {\n        // create a node from data array\n        if (is_array($node)) {\n            $node = new Varien_Data_Tree_Node($node, 'entity_id', new Varien_Data_Tree);\n        }\n        $item = array();\n        $item['text'] = $this->buildNodeName($node);\n        $item['id']   = $node->getId();\n        $item['path'] = $node->getData('path');\n        $item['cls']  = 'folder';\n        if ($node->getStatus()) {\n            $item['cls'] .= ' active-category';\n        } else {\n            $item['cls'] .= ' no-active-category';\n        }\n        $item['allowDrop'] = true;\n        $item['allowDrag'] = true;\n        if ((int)$node->getChildrenCount()>0) {\n            $item['children'] = array();\n        }\n        $isParent = $this->_isParentSelected{{Entity}}($node);\n        if ($node->hasChildren()) {\n            $item['children'] = array();\n            if (!($this->getUseAjax() && $node->getLevel() > 1 && !$isParent)) {\n                foreach ($node->getChildren() as $child) {\n                    $item['children'][] = $this->_getNodeJson($child, $level+1);\n                }\n            }\n        }\n        if ($isParent || $node->getLevel() < 1) {\n            $item['expanded'] = true;\n        }\n        return $item;\n    }\n\n    /**\n     * Get node label\n     *\n     * @access public\n     * @param Varien_Object $node\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function buildNodeName($node)\n    {\n        $result = $this->escapeHtml($node->get{{EntityNameMagicCode}}());\n        return $result;\n    }\n\n    /**\n     * check if entity is movable\n     *\n     * @access protected\n     * @param Varien_Object $node\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _is{{Entity}}Moveable($node)\n    {\n        return true;\n    }\n\n    /**\n     * check if parent is selected\n     *\n     * @access protected\n     * @param Varien_Object $node\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _isParentSelected{{Entity}}($node)\n    {\n        if ($node && $this->get{{Entity}}()) {\n            $pathIds = $this->get{{Entity}}()->getPathIds();\n            if (in_array($node->getId(), $pathIds)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Check if page loaded by outside link to {{entityLabel}} edit\n     *\n     * @access public\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function isClearEdit()\n    {\n        return (bool) $this->getRequest()->getParam('clear');\n    }\n\n    /**\n     * Check availability of adding root {{entityLabel}}\n     *\n     * @access public\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function canAddRoot{{Entity}}()\n    {\n        return true;\n    }\n\n    /**\n     * Check availability of adding child {{entityLabel}}\n     *\n     * @access public\n     * @return boolean\n     */\n    public function canAddChild()\n    {\n        return true;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Tree/060_store_switcher_block",
    "content": "\n    /**\n     * get store switcher html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getStoreSwitcherHtml()\n    {\n        return $this->getChildHtml('store_switcher');\n    }\n\n    /**\n     * get current store\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getStore()\n    {\n        $storeId = (int) $this->getRequest()->getParam('store');\n        return Mage::app()->getStore($storeId);\n    }\n\n    /**\n     * get switch url\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getSwitchTreeUrl()\n    {\n        return $this->getUrl(\n            \"*/{{module}}_{{entity}}/tree\",\n            array(\n                '_current'=>true,\n                'store'=>null,\n                '_query'=>false,\n                'id'=>null,\n                'parent'=>null\n            )\n        );\n    }\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Tree/070_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin widget chooser\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/020_not_tree",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser extends Mage_Adminhtml_Block_Widget_Grid\n{\n    /**\n     * Block construction, prepare grid params\n     *\n     * @access public\n     * @param array $arguments Object data\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct($arguments=array())\n    {\n        parent::__construct($arguments);\n        $this->setDefaultSort('entity_id');\n        $this->setDefaultDir('ASC');\n        $this->setUseAjax(true);\n        $this->setDefaultFilter(array('chooser_status' => '1'));\n    }\n\n    /**\n     * Prepare chooser element HTML\n     *\n     * @access public\n     * @param Varien_Data_Form_Element_Abstract $element Form Element\n     * @return Varien_Data_Form_Element_Abstract\n     * {{qwertyuiop}}\n     */\n    public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)\n    {\n        $uniqId = Mage::helper('core')->uniqHash($element->getId());\n        $sourceUrl = $this->getUrl(\n            '*/{{module}}_{{entity}}_widget/chooser',\n            array('uniq_id' => $uniqId)\n        );\n        $chooser = $this->getLayout()->createBlock('widget/adminhtml_widget_chooser')\n            ->setElement($element)\n            ->setTranslationHelper($this->getTranslationHelper())\n            ->setConfig($this->getConfig())\n            ->setFieldsetId($this->getFieldsetId())\n            ->setSourceUrl($sourceUrl)\n            ->setUniqId($uniqId);\n        if ($element->getValue()) {\n            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($element->getValue());\n            if (${{entity}}->getId()) {\n                $chooser->setLabel(${{entity}}->get{{EntityNameMagicCode}}());\n            }\n        }\n        $element->setData('after_element_html', $chooser->toHtml());\n        return $element;\n    }\n\n    /**\n     * Grid Row JS Callback\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRowClickCallback()\n    {\n        $chooserJsObject = $this->getId();\n        $js = '\n            function (grid, event) {\n                var trElement = Event.findElement(event, \"tr\");\n                var {{entity}}Id = trElement.down(\"td\").innerHTML.replace(/^\\s+|\\s+$/g,\"\");\n                var {{entity}}Title = trElement.down(\"td\").next().innerHTML;\n                '.$chooserJsObject.'.setElementValue({{entity}}Id);\n                '.$chooserJsObject.'.setElementLabel({{entity}}Title);\n                '.$chooserJsObject.'.close();\n            }\n        ';\n        return $js;\n    }\n\n    /**\n     * Prepare a static blocks collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser\n     * {{qwertyuiop}}\n     */\n    protected function _prepareCollection()\n    {\n        $collection = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->getCollection();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/030_not_tree_eav",
    "content": "        $collection->addAttributeToSelect('{{nameAttributeCode}}');\r\n        $collection->addAttributeToSelect('status');\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/040_not_tree_content",
    "content": "        $this->setCollection($collection);\n        return parent::_prepareCollection();\n    }\n\n    /**\n     * Prepare columns for the a grid\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser\n     * {{qwertyuiop}}\n     */\n    protected function _prepareColumns()\n    {\n        $this->addColumn(\n            'chooser_id',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('Id'),\n                'align'  => 'right',\n                'index'  => 'entity_id',\n                'type'   => 'number',\n                'width'  => 50\n            )\n        );\n\n        $this->addColumn(\n            'chooser_{{nameAttributeCode}}',\n            array(\n                'header' => Mage::helper('{{namespace}}_{{module}}')->__('{{nameAttributeLabel}}'),\n                'align'  => 'left',\n                'index'  => '{{nameAttributeCode}}',\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/050_not_tree_store",
    "content": "        if (!Mage::app()->isSingleStoreMode()) {\n            $this->addColumn(\n                'store_id',\n                array(\n                    'header'     => Mage::helper('{{namespace}}_{{module}}')->__('Store Views'),\n                    'index'      => 'store_id',\n                    'type'       => 'store',\n                    'store_all'  => true,\n                    'store_view' => true,\n                    'sortable'   => false,\n                )\n            );\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/060_not_tree_footer",
    "content": "        $this->addColumn(\n            'chooser_status',\n            array(\n                'header'  => Mage::helper('{{namespace}}_{{module}}')->__('Status'),\n                'index'   => 'status',\n                'type'    => 'options',\n                'options' => array(\n                    0 => Mage::helper('{{namespace}}_{{module}}')->__('Disabled'),\n                    1 => Mage::helper('{{namespace}}_{{module}}')->__('Enabled')\n                ),\n            )\n        );\n        return parent::_prepareColumns();\n    }\n\n    /**\n     * get url for grid\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getGridUrl()\n    {\n        return $this->getUrl(\n            'adminhtml/{{module}}_{{entity}}_widget/chooser',\n            array('_current' => true)\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/070_not_tree_flat",
    "content": "\n    /**\n     * after collection load\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser\n     * {{qwertyuiop}}\n     */\n    protected function _afterLoadCollection()\n    {\n        $this->getCollection()->walk('afterLoad');\n        parent::_afterLoadCollection();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/080_tree",
    "content": "class {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser extends {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Tree\n{\n    protected $_selected{{Entities}} = array();\n\n    /**\n     * Block construction\n     * Defines tree template and init tree params\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this->setTemplate('{{namespace}}_{{module}}/{{entity}}/widget/tree.phtml');\n    }\n\n    /**\n     * Setter\n     *\n     * @access public\n     * @param array $selected{{Entities}}\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser\n     * {{qwertyuiop}}\n     */\n    public function setSelected{{Entities}}($selected{{Entities}})\n    {\n        $this->_selected{{Entities}} = $selected{{Entities}};\n        return $this;\n    }\n\n    /**\n     * Getter\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entities}}()\n    {\n        return $this->_selected{{Entities}};\n    }\n\n    /**\n     * Prepare chooser element HTML\n     *\n     * @access public\n     * @param Varien_Data_Form_Element_Abstract $element Form Element\n     * @return Varien_Data_Form_Element_Abstract\n     * {{qwertyuiop}}\n     */\n    public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)\n    {\n        $uniqId = Mage::helper('core')->uniqHash($element->getId());\n        $sourceUrl = $this->getUrl(\n            '*/{{module}}_{{entity}}_widget/chooser',\n            array('uniq_id' => $uniqId, 'use_massaction' => false)\n        );\n        $chooser = $this->getLayout()->createBlock('widget/adminhtml_widget_chooser')\n            ->setElement($element)\n            ->setTranslationHelper($this->getTranslationHelper())\n            ->setConfig($this->getConfig())\n            ->setFieldsetId($this->getFieldsetId())\n            ->setSourceUrl($sourceUrl)\n            ->setUniqId($uniqId);\n        $value = $element->getValue();\n        ${{entity}}Id = false;\n        if ($value) {\n            ${{entity}}Id = $value;\n        }\n        if (${{entity}}Id) {\n            $label = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id)\n                ->get{{EntityNameMagicCode}}();\n            $chooser->setLabel($label);\n        }\n        $element->setData('after_element_html', $chooser->toHtml());\n        return $element;\n    }\n\n    /**\n     * onClick listener js function\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getNodeClickListener()\n    {\n        if ($this->getData('node_click_listener')) {\n            return $this->getData('node_click_listener');\n        }\n        if ($this->getUseMassaction()) {\n            $js = '\n                function (node, e) {\n                    if (node.ui.toggleCheck) {\n                        node.ui.toggleCheck(true);\n                    }\n                }\n            ';\n        } else {\n            $chooserJsObject = $this->getId();\n            $js = '\n                function (node, e) {\n                    '.$chooserJsObject.'.setElementValue(node.attributes.id);\n                    '.$chooserJsObject.'.setElementLabel(node.text);\n                    '.$chooserJsObject.'.close();\n                }\n            ';\n        }\n        return $js;\n    }\n\n    /**\n     * Get JSON of a tree node or an associative array\n     *\n     * @access protected\n     * @param Varien_Data_Tree_Node|array $node\n     * @param int $level\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getNodeJson($node, $level = 0)\n    {\n        $item = parent::_getNodeJson($node, $level);\n        if (in_array($node->getId(), $this->getSelected{{Entities}}())) {\n            $item['checked'] = true;\n        }\n        return $item;\n    }\n\n    /**\n     * Tree JSON source URL\n     *\n     * @access public\n     * @param mixed $expanded\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getLoadTreeUrl($expanded=null)\n    {\n        return $this->getUrl(\n            '*/{{module}}_{{entity}}_widget/{{entities}}Json',\n            array(\n                '_current'=>true,\n                'uniq_id' => $this->getId(),\n                'use_massaction' => $this->getUseMassaction()\n            )\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Entity/Widget/Chooser/090_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Helper/Column/Renderer/Parent/010_content",
    "content": "<?php\n{{License}}\n/**\n * parent entities column renderer\n * @category   {{Namespace}}\n * @package    {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_Helper_Column_Renderer_Parent extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Options\n{\n    /**\n     * render the column\n     *\n     * @access public\n     * @param Varien_Object $row\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function render(Varien_Object $row)\n    {\n        $base = $this->getColumn()->getBaseLink();\n        if (!$base) {\n            return parent::render($row);\n        }\n        $paramsData = $this->getColumn()->getData('params');\n        $params = array();\n        if (is_array($paramsData)) {\n            foreach ($paramsData as $name=>$getter) {\n                if (is_callable(array($row, $getter))) {\n                    $params[$name] = call_user_func(array($row, $getter));\n                }\n            }\n        }\n        $staticParamsData = $this->getColumn()->getData('static');\n        if (is_array($staticParamsData)) {\n            foreach ($staticParamsData as $key=>$value) {\n                $params[$key] = $value;\n            }\n        }\n        $options = $this->getColumn()->getOptions();\n        $showMissingOptionValues = (bool)$this->getColumn()->getShowMissingOptionValues();\n        if (!empty($options) && is_array($options)) {\n            $value = $row->getData($this->getColumn()->getIndex());\n            if (is_array($value)) {\n                $res = array();\n                foreach ($value as $item) {\n                    if (isset($options[$item])) {\n                        $res[] = '<a href=\"'.$this->getUrl($base, $params).'\" target=\"_blank\">'.\n                            $this->escapeHtml($options[$item]).\n                            '</a>';\n                    } elseif ($showMissingOptionValues) {\n                        $res[] = '<a href=\"'.$this->getUrl($base, $params).'\" target=\"_blank\">'.\n                            $this->escapeHtml($item).\n                            '</a>';\n                    }\n                }\n                return implode('<br />', $res);\n            } elseif (isset($options[$value])) {\n                return '<a href=\"'.$this->getUrl($base, $params).'\" target=\"_blank\">'.\n                    $this->escapeHtml($options[$value]).\n                    '</a>';\n            } elseif (in_array($value, $options)) {\n                return '<a href=\"'.$this->getUrl($base, $params).'\" target=\"_blank\">'.\n                    $this->escapeHtml($value).\n                    '</a>';\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Helper/Column/Renderer/Relation/010_content",
    "content": "<?php\n{{License}}\n/**\n * related entities column renderer\n * @category   {{Namespace}}\n * @package    {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_Helper_Column_Renderer_Relation extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text\n{\n    /**\n     * render the column\n     *\n     * @access public\n     * @param Varien_Object $row\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function render(Varien_Object $row)\n    {\n        $base = $this->getColumn()->getBaseLink();\n        if (!$base) {\n            return parent::render($row);\n        }\n        $paramsData = $this->getColumn()->getData('params');\n        $params = array();\n        if (is_array($paramsData)) {\n            foreach ($paramsData as $name=>$getter) {\n                if (is_callable(array($row, $getter))) {\n                    $params[$name] = call_user_func(array($row, $getter));\n                }\n            }\n        }\n        $staticParamsData = $this->getColumn()->getData('static');\n        if (is_array($staticParamsData)) {\n            foreach ($staticParamsData as $key=>$value) {\n                $params[$key] = $value;\n            }\n        }\n        return '<a href=\"'.$this->getUrl($base, $params).'\" target=\"_blank\">'.$this->_getValue($row).'</a>';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Helper/Wysiwyg/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{Module}} textarea attribute WYSIWYG button\n * @category   {{Namespace}}\n * @package    {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_Helper_Wysiwyg extends Varien_Data_Form_Element_Textarea\n{\n    /**\n     * Retrieve additional html and put it at the end of element html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getAfterElementHtml()\n    {\n        $html = parent::getAfterElementHtml();\n        $disabled = ($this->getDisabled() || $this->getReadonly());\n        $html .= Mage::getSingleton('core/layout')\n            ->createBlock(\n                'adminhtml/widget_button',\n                '',\n                array(\n                    'label'   => Mage::helper('catalog')->__('WYSIWYG Editor'),\n                    'type'=> 'button',\n                    'disabled' => $disabled,\n                    'class' => ($disabled) ? 'disabled btn-wysiwyg' : 'btn-wysiwyg',\n                    'onclick' => 'catalogWysiwygEditor.open(\\''.\n                        Mage::helper('adminhtml')->getUrl('*/*/wysiwyg').'\\', \\''.\n                        $this->getHtmlId().'\\')'\n                )\n            )\n            ->toHtml();\n        return $html;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Module/Helper/Form/Wysiwyg/Content/010_content",
    "content": "<?php\n{{License}}\n/**\n * wysiwyg helper\n * @category   {{Namespace}}\n * @package    {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Module}}_Helper_Form_Wysiwyg_Content extends Mage_Adminhtml_Block_Widget_Form\n{\n    /**\n     * Prepare form.\n     * Adding editor field to render\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Module}}_Helper_Form_Wysiwyg_Content\n     * {{qwertyuiop}}\n     */\n    protected function _prepareForm()\n    {\n        $form = new Varien_Data_Form(\n            array(\n                'id'     => 'wysiwyg_edit_form',\n                'action' => $this->getData('action'),\n                'method' => 'post'\n            )\n        );\n        $config['document_base_url']     = $this->getData('store_media_url');\n        $config['store_id']              = $this->getData('store_id');\n        $config['add_variables']         = false;\n        $config['add_widgets']           = false;\n        $config['add_directives']        = true;\n        $config['use_container']         = true;\n        $config['container_class']       = 'hor-scroll';\n\n        $editorConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig($config);\n        $editorConfig->setData(\n            'files_browser_window_url',\n            Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index')\n        );\n        $form->addField(\n            $this->getData('editor_element_id'),\n            'editor',\n            array(\n                'name'       => 'content',\n                'style'      => 'width:725px;height:460px',\n                'required'   => true,\n                'force_load' => true,\n                'config'     => $editorConfig\n            )\n        );\n        $this->setForm($form);\n        return parent::_prepareForm();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Adminhtml/Module/Renderer/Fieldset/Element/010_content",
    "content": "<?php\n{{License}}\n/**\n * fieldset element renderer\n * @category   {{Namespace}}\n * @package    {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Adminhtml_{{Module}}_Renderer_Fieldset_Element extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element\n{\n    /**\n     * Initialize block template\n     *\n     * @access protected\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->setTemplate('{{namespace}}_{{module}}/form/renderer/fieldset/element.phtml');\n    }\n\n    /**\n     * Retrieve data object related with form\n     *\n     * @access public\n     * @return mixed\n     * {{qwertyuiop}}\n     */\n    public function getDataObject()\n    {\n        return $this->getElement()->getForm()->getDataObject();\n    }\n\n    /**\n     * Retrieve associated with element attribute object\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_Eav_Attribute\n     * {{qwertyuiop}}\n     */\n    public function getAttribute()\n    {\n        return $this->getElement()->getEntityAttribute();\n    }\n\n    /**\n     * Retrieve associated attribute code\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getAttributeCode()\n    {\n        return $this->getAttribute()->getAttributeCode();\n    }\n\n    /**\n     * Check \"Use default\" checkbox display availability\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function canDisplayUseDefault()\n    {\n        if ($attribute = $this->getAttribute()) {\n            if (!$this->isScopeGlobal($attribute)\n                && $this->getDataObject()\n                && $this->getDataObject()->getId()\n                && $this->getDataObject()->getStoreId()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Check default value usage fact\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function usedDefault()\n    {\n        $defaultValue = $this->getDataObject()->getAttributeDefaultValue($this->getAttribute()->getAttributeCode());\n        return $defaultValue === false;\n    }\n\n    /**\n     * Disable field in default value using case\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Module}}_Renderer_Fieldset_Element\n     * {{qwertyuiop}}\n     */\n    public function checkFieldDisable()\n    {\n        if ($this->canDisplayUseDefault() && $this->usedDefault()) {\n            $this->getElement()->setDisabled(true);\n        }\n        return $this;\n    }\n\n    /**\n     * Retrieve label of attribute scope\n     * GLOBAL | WEBSITE | STORE\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getScopeLabel()\n    {\n        $html = '';\n        $attribute = $this->getElement()->getEntityAttribute();\n        if (!$attribute || Mage::app()->isSingleStoreMode()) {\n            return $html;\n        }\n        if ($this->isScopeGlobal($attribute)) {\n            $html.= Mage::helper('{{namespace}}_{{module}}')->__('[GLOBAL]');\n        } elseif ($this->isScopeWebsite($attribute)) {\n            $html.= Mage::helper('{{namespace}}_{{module}}')->__('[WEBSITE]');\n        } elseif ($this->isScopeStore($attribute)) {\n            $html.= Mage::helper('{{namespace}}_{{module}}')->__('[STORE VIEW]');\n        }\n        return $html;\n    }\n\n    /**\n     * Retrieve element label html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getElementLabelHtml()\n    {\n        return $this->getElement()->getLabelHtml();\n    }\n\n    /**\n     * Retrieve element html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getElementHtml()\n    {\n        return $this->getElement()->getElementHtml();\n    }\n\n    /**\n     * check if an attribute is global\n     *\n     * @access public\n     * @param Mage_Eav_Model_Entity_Attribute $attribute\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function isScopeGlobal($attribute)\n    {\n        return $attribute->getIsGlobal() == 1;\n    }\n\n    /**\n     * check if an attribute has website scope\n     *\n     * @access public\n     * @param Mage_Eav_Model_Entity_Attribute $attribute\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function isScopeWebsite($attribute)\n    {\n        return $attribute->getIsGlobal() == 2;\n    }\n\n    /**\n     * check if an attribute has store view scope\n     *\n     * @access public\n     * @param Mage_Eav_Model_Entity_Attribute $attribute\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function isScopeStore($attribute)\n    {\n        return !$this->isScopeGlobal($attribute) && !$this->isScopeWebsite($attribute);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Category/List/Entity/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} list on category page block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Catalog_Category_List_{{Entity}} extends Mage_Core_Block_Template\n{\n    /**\n     * get the list of {{entitiesLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Collection()\n    {\n        if (!$this->hasData('{{entity}}_collection')) {\n            $category = Mage::registry('current_category');\n            $collection = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_collection')\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Category/List/Entity/020_store",
    "content": "                ->addStoreFilter(Mage::app()->getStore())\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Category/List/Entity/030_eav",
    "content": "                ->setStoreId(Mage::app()->getStore()->getId())\n                ->addAttributeToSelect('*')\n                ->addAttributeToFilter('status', 1)\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Category/List/Entity/040_not_eav",
    "content": "                ->addFieldToFilter('status', 1)\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Category/List/Entity/050_footer",
    "content": "                ->addCategoryFilter($category);\n            $collection->getSelect()->order('related_category.position', 'ASC');\n            $this->setData('{{entity}}_collection', $collection);\n        }\n        return $this->getData('{{entity}}_collection');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Product/List/Entity/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} list on product page block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Catalog_Product_List_{{Entity}} extends Mage_Catalog_Block_Product_Abstract\n{\n    /**\n     * get the list of {{entitiesLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Collection()\n    {\n        if (!$this->hasData('{{entity}}_collection')) {\n            $product = Mage::registry('product');\n            $collection = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_collection')\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Product/List/Entity/020_store",
    "content": "                ->addStoreFilter(Mage::app()->getStore())\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Product/List/Entity/030_eav",
    "content": "                ->setStoreId(Mage::app()->getStore()->getId())\n                ->addAttributeToSelect('{{nameAttributeCode}}', 1)\n                ->addAttributeToFilter('status', 1)\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Product/List/Entity/040_not_eav",
    "content": "                ->addFieldToFilter('status', 1)\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Catalog/Product/List/Entity/050_footer",
    "content": "                ->addProductFilter($product);\n            $collection->getSelect()->order('related_product.position', 'ASC');\n            $this->setData('{{entity}}_collection', $collection);\n        }\n        return $this->getData('{{entity}}_collection');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Catalog/Category/List/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} category list\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Catalog_Category_List extends Mage_Core_Block_Template\n{\n    /**\n     * get the list of products\n     *\n     * @access public\n     * @return Mage_Catalog_Model_Resource_Category_Collection\n     * {{qwertyuiop}}\n     */\n    public function getCategoryCollection()\n    {\n        $collection = $this->get{{Entity}}()->getSelectedCategoriesCollection();\n        $collection->addAttributeToSelect('name');\n        $collection->getSelect()->order('related.position');\n        $collection->addAttributeToFilter('is_active', 1);\n        return $collection;\n    }\n\n    /**\n     * get current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Catalog/Product/List/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} product list\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Catalog_Product_List extends Mage_Core_Block_Template\n{\n    /**\n     * get the list of products\n     *\n     * @access public\n     * @return Mage_Catalog_Model_Resource_Product_Collection\n     * {{qwertyuiop}}\n     */\n    public function getProductCollection()\n    {\n        $collection = $this->get{{Entity}}()->getSelectedProductsCollection();\n        $collection->addAttributeToSelect('name');\n        $collection->addUrlRewrite();\n        $collection->getSelect()->order('related.position');\n        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);\n        Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);\n        return $collection;\n    }\n\n    /**\n     * get current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Child/List/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} {{SiblingsLabel}} list block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_{{Sibling}}_List extends {{Namespace}}_{{Module}}_Block_{{Sibling}}_List\n{\n    /**\n     * initialize\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        ${{entity}} = $this->get{{Entity}}();\n        if (${{entity}}) {\n            $this->get{{Siblings}}()->addFieldToFilter('{{entity}}_id', ${{entity}}->getId());\n        }\n    }\n\n    /**\n     * prepare the layout - actually do nothing\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_{{Sibling}}_List\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        return $this;\n    }\n\n    /**\n     * get the current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Children/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} children list block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Children extends {{Namespace}}_{{Module}}_Block_{{Entity}}_List\n{\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_Children\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        $this->get{{Entities}}()->addFieldToFilter('parent_id', $this->getCurrent{{Entity}}()->getId());\n        return $this;\n    }\n\n    /**\n     * get the current {{entityLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function getCurrent{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Comment/Form/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comment form block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Comment_Form extends Mage_Core_Block_Template\n{\n    /**\n     * initialize\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        $customerSession = Mage::getSingleton('customer/session');\n        parent::__construct();\n        $data =  Mage::getSingleton('customer/session')->get{{Entity}}CommentFormData(true);\n        $data = new Varien_Object($data);\n        // add logged in customer name as nickname\n        if (!$data->getName()) {\n            $customer = $customerSession->getCustomer();\n            if ($customer && $customer->getId()) {\n                $data->setName($customer->getFirstname());\n                $data->setEmail($customer->getEmail());\n            }\n        }\n        $this->setAllowWriteCommentFlag(\n            $customerSession->isLoggedIn() ||\n            Mage::getStoreConfigFlag('{{namespace}}_{{module}}/{{entity}}/allow_guest_comment')\n        );\n        if (!$this->getAllowWriteCommentFlag()) {\n            $this->setLoginLink(\n                Mage::getUrl(\n                    'customer/account/login/',\n                    array(\n                        Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME => Mage::helper('core')->urlEncode(\n                            Mage::getUrl('*/*/*', array('_current' => true)) .\n                            '#comment-form'\n                        )\n                    )\n                )\n            );\n        }\n        $this->setCommentData($data);\n    }\n\n    /**\n     * get current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n\n    /**\n     * get form action\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getAction()\n    {\n        return Mage::getUrl(\n            '{{namespace}}_{{module}}/{{entity}}/commentpost',\n            array('id' => $this->get{{Entity}}()->getId())\n        );\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Comment/List/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comment list block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Comment_List extends Mage_Core_Block_Template\n{\n    /**\n     * initialize\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        ${{entity}} = $this->get{{Entity}}();\n        $comments = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_comment_collection')\n            ->addFieldToFilter('{{entity}}_id', ${{entity}}->getId())\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Comment/List/020_stores",
    "content": "            ->addStoreFilter(Mage::app()->getStore())\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Comment/List/030_footer",
    "content": "             ->addFieldToFilter('status', 1);\n        $comments->setOrder('created_at', 'asc');\n        $this->setComments($comments);\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_Comment_List\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        parent::_prepareLayout();\n        $pager = $this->getLayout()->createBlock(\n            'page/html_pager',\n            '{{namespace}}_{{module}}.{{entity}}.html.pager'\n        )\n        ->setCollection($this->getComments());\n        $this->setChild('pager', $pager);\n        $this->getComments()->load();\n        return $this;\n    }\n\n    /**\n     * get the pager html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getPagerHtml()\n    {\n        return $this->getChildHtml('pager');\n    }\n    /**\n     * get the current {{entityLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Customer/Comment/List/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} customer comments list\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Customer_Comment_List extends Mage_Customer_Block_Account_Dashboard\n{\n    /**\n     * {{Entity}} comments collection\n     *\n     * @var {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     */\n    protected $_collection;\n\n    /**\n     * Initializes collection\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->_collection = Mage::getResourceModel(\n            '{{namespace}}_{{module}}/{{entity}}_comment_{{entity}}_collection'\n        );\n        $this->_collection\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Customer/Comment/List/020_store",
    "content": "            ->setStoreFilter(Mage::app()->getStore()->getId(), true)\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Customer/Comment/List/030_filter_eav",
    "content": "            ->addAttributeToFilter('status', 1) //only active\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Customer/Comment/List/040_filter_flat",
    "content": "            ->addFieldToFilter('main_table.status', 1) //only active\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Customer/Comment/List/050_footer",
    "content": "\n            ->addStatusFilter({{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_APPROVED) //only approved comments\n            ->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId()) //only my comments\n            ->setDateOrder();\n    }\n\n    /**\n     * Gets collection items count\n     *\n     * @access public\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function count()\n    {\n        return $this->_collection->getSize();\n    }\n\n    /**\n     * Get html code for toolbar\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getToolbarHtml()\n    {\n        return $this->getChildHtml('toolbar');\n    }\n\n    /**\n     * Initializes toolbar\n     *\n     * @access protected\n     * @return Mage_Core_Block_Abstract\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        $toolbar = $this->getLayout()->createBlock('page/html_pager', 'customer_{{entity}}_comments.toolbar')\n            ->setCollection($this->getCollection());\n\n        $this->setChild('toolbar', $toolbar);\n        return parent::_prepareLayout();\n    }\n\n    /**\n     * Get collection\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _getCollection()\n    {\n        return $this->_collection;\n    }\n\n    /**\n     * Get collection\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function getCollection()\n    {\n        return $this->_getCollection();\n    }\n\n    /**\n     * Get review link\n     *\n     * @access public\n     * @param mixed $comment\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getCommentLink($comment)\n    {\n        if ($comment instanceof Varien_Object) {\n            $comment = $comment->getCtCommentId();\n        }\n        return Mage::getUrl(\n            '{{namespace}}_{{module}}/{{entity}}_customer_comment/view/',\n            array('id' => $comment)\n        );\n    }\n\n    /**\n     * Get product link\n     *\n     * @access public\n     * @param mixed $comment\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Link($comment)\n    {\n        return $comment->get{{Entity}}Url();\n    }\n\n    /**\n     * Format date in short format\n     *\n     * @access public\n     * @param $date\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function dateFormat($date)\n    {\n        return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Customer/Comment/View/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} customer comments list\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Customer_Comment_View extends Mage_Customer_Block_Account_Dashboard\n{\n    /**\n     * get current comment\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment\n     * {{qwertyuiop}}\n     */\n    public function getComment()\n    {\n        return Mage::registry('current_comment');\n    }\n\n    /**\n     * get current {{entityLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/List/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} list block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_List extends Mage_Core_Block_Template\n{\n    /**\n     * initialize\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function _construct()\n    {\n        parent::_construct();\n        ${{entities}} = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection')\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/List/020_stores",
    "content": "                         ->addStoreFilter(Mage::app()->getStore())\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/List/030_attributes",
    "content": "                         ->setStoreId(Mage::app()->getStore()->getId())\n                         ->addAttributeToSelect('*')\n                         ->addAttributeToFilter('status', 1);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/List/040_status",
    "content": "                         ->addFieldToFilter('status', 1);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/List/050_not_tree",
    "content": "        ${{entities}}->setOrder('{{nameAttributeCode}}', 'asc');\n        $this->set{{Entities}}(${{entities}});\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_List\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        parent::_prepareLayout();\n        $pager = $this->getLayout()->createBlock(\n            'page/html_pager',\n            '{{namespace}}_{{module}}.{{entity}}.html.pager'\n        )\n        ->setCollection($this->get{{Entities}}());\n        $this->setChild('pager', $pager);\n        $this->get{{Entities}}()->load();\n        return $this;\n    }\n\n    /**\n     * get the pager html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getPagerHtml()\n    {\n        return $this->getChildHtml('pager');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/List/060_tree_flat",
    "content": "        ;\n        ${{entities}}->getSelect()->order('{{entityTableAlias}}.position');\n        $this->set{{Entities}}(${{entities}});\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_List\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        parent::_prepareLayout();\n        $this->get{{Entities}}()->addFieldToFilter('level', 1);\n        if ($this->_getDisplayMode() == 0) {\n            $pager = $this->getLayout()->createBlock(\n                'page/html_pager',\n                '{{namespace}}_{{module}}.{{entities}}.html.pager'\n            )\n            ->setCollection($this->get{{Entities}}());\n            $this->setChild('pager', $pager);\n            $this->get{{Entities}}()->load();\n        }\n        return $this;\n    }\n\n    /**\n     * get the pager html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getPagerHtml()\n    {\n        return $this->getChildHtml('pager');\n    }\n\n    /**\n     * get the display mode\n     *\n     * @access protected\n     * @return int\n     * {{qwertyuiop}}\n     */\n    protected function _getDisplayMode()\n    {\n        return Mage::getStoreConfigFlag('{{namespace}}_{{module}}/{{entity}}/tree');\n    }\n\n    /**\n     * draw {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * @param int $level\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function draw{{Entity}}(${{entity}}, $level = 0)\n    {\n        $html = '';\n        $recursion = $this->getRecursion();\n        if ($recursion !== '0' && $level >= $recursion) {\n            return '';\n        }\n        $storeIds = Mage::getResourceSingleton(\n            '{{namespace}}_{{module}}/{{entity}}'\n        )\n        ->lookupStoreIds(${{entity}}->getId());\n        $validStoreIds = array(0, Mage::app()->getStore()->getId());\n        if (!array_intersect($storeIds, $validStoreIds)) {\n            return '';\n        }\n        if (!${{entity}}->getStatus()) {\n            return '';\n        }\n        $children = ${{entity}}->getChildren{{Entities}}();\n        $activeChildren = array();\n        if ($recursion == 0 || $level < $recursion-1) {\n            foreach ($children as $child) {\n                $childStoreIds = Mage::getResourceSingleton(\n                    '{{namespace}}_{{module}}/{{entity}}'\n                )\n                ->lookupStoreIds($child->getId());\n                $validStoreIds = array(0, Mage::app()->getStore()->getId());\n                if (!array_intersect($childStoreIds, $validStoreIds)) {\n                    continue;\n                }\n                if ($child->getStatus()) {\n                    $activeChildren[] = $child;\n                }\n            }\n        }\n        $html .= '<li>';\n        $html .= {{nameHtml}};\n        if (count($activeChildren) > 0) {\n            $html .= '<ul>';\n            foreach ($children as $child) {\n                $html .= $this->draw{{Entity}}($child, $level+1);\n            }\n            $html .= '</ul>';\n        }\n        $html .= '</li>';\n        return $html;\n    }\n\n    /**\n     * get recursion\n     *\n     * @access public\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getRecursion()\n    {\n        if (!$this->hasData('recursion')) {\n            $this->setData('recursion', Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/recursion'));\n        }\n        return $this->getData('recursion');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/List/070_tree_eav",
    "content": "        ;\n        ${{entities}}->getSelect()->order('{{entityTableAlias}}.position');\n        $this->set{{Entities}}(${{entities}});\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_List\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        parent::_prepareLayout();\n        $this->get{{Entities}}()->addFieldToFilter('level', 1);\n        if ($this->_getDisplayMode() == 0) {\n            $pager = $this->getLayout()->createBlock(\n                'page/html_pager',\n                '{{namespace}}_{{module}}.{{entities}}.html.pager'\n            )\n            ->setCollection($this->get{{Entities}}());\n            $this->setChild('pager', $pager);\n            $this->get{{Entities}}()->load();\n        }\n        return $this;\n    }\n\n    /**\n     * get the pager html\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getPagerHtml()\n    {\n        return $this->getChildHtml('pager');\n    }\n\n    /**\n     * get the display mode\n     *\n     * @access protected\n     * @return int\n     * {{qwertyuiop}}\n     */\n    protected function _getDisplayMode()\n    {\n        return Mage::getStoreConfigFlag('{{namespace}}_{{module}}/{{entity}}/tree');\n    }\n\n    /**\n     * draw {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * @param int $level\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function draw{{Entity}}(${{entity}}, $level = 0)\n    {\n        $html = '';\n        $recursion = $this->getRecursion();\n        if ($recursion !== '0' && $level >= $recursion) {\n            return '';\n        }\n        if (!${{entity}}->getStatus()) {\n            return '';\n        }\n        ${{entity}}->setStoreId(Mage::app()->getStore()->getId());\n        $children = ${{entity}}->getChildren{{Entities}}()->addAttributeToSelect('*');\n        $activeChildren = array();\n        if ($recursion == 0 || $level < $recursion-1) {\n            foreach ($children as $child) {\n                if ($child->getStatus()) {\n                    $activeChildren[] = $child;\n                }\n            }\n        }\n        $html .= '<li>';\n        $html .= {{nameHtml}};\n        if (count($activeChildren) > 0) {\n            $html .= '<ul>';\n            foreach ($children as $child) {\n                $html .= $this->draw{{Entity}}($child, $level+1);\n            }\n            $html .= '</ul>';\n        }\n        $html .= '</li>';\n        return $html;\n    }\n\n    /**\n     * get recursion\n     *\n     * @access public\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getRecursion()\n    {\n        if (!$this->hasData('recursion')) {\n            $this->setData('recursion', Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/recursion'));\n        }\n        return $this->getData('recursion');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/List/080_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Rss/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} RSS block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Rss extends Mage_Rss_Block_Abstract\n{\n    /**\n     * Cache tag constant for feed reviews\n     *\n     * @var string\n     */\n    const CACHE_TAG = 'block_html_{{module}}_{{entity}}_rss';\n\n    /**\n     * constructor\n     *\n     * @access protected\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->setCacheTags(array(self::CACHE_TAG));\n        /*\n         * setting cache to save the rss for 10 minutes\n         */\n        $this->setCacheKey('{{namespace}}_{{module}}_{{entity}}_rss');\n        $this->setCacheLifetime(600);\n    }\n\n    /**\n     * toHtml method\n     *\n     * @access protected\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _toHtml()\n    {\n        $url    = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->get{{Entities}}Url();\n        $title  = Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}');\n        $rssObj = Mage::getModel('rss/rss');\n        $data  = array(\n            'title'       => $title,\n            'description' => $title,\n            'link'        => $url,\n            'charset'     => 'UTF-8',\n        );\n        $rssObj->_addHeader($data);\n        $collection = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->getCollection()\n            ->addFieldToFilter('status', 1)\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Rss/020_stores",
    "content": "            ->addStoreFilter(Mage::app()->getStore())\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Rss/025_eav",
    "content": "            ->addAttributeToSelect('*')\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Rss/030_content",
    "content": "            ->{{filterMethod}}('in_rss', 1)\n            ->setOrder('created_at');\n        $collection->load();\n        foreach ($collection as $item) {\n            $description = '<p>';\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Rss/035_tree",
    "content": "            if (!$item->getStatusPath()) {\n                continue;\n            }"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Rss/040_attributes",
    "content": "{{attributeRssText}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Rss/050_footer",
    "content": "            $description .= '</p>';\n            $data = array(\n                'title'       => $item->get{{EntityNameMagicCode}}(),\n                'link'        => $item->get{{Entity}}Url(),\n                'description' => $description\n            );\n            $rssObj->_addEntry($data);\n        }\n        return $rssObj->createRssXml();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Sibling/List/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} {{SiblingsLabel}} list block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_{{Sibling}}_List extends {{Namespace}}_{{Module}}_Block_{{Sibling}}_List\n{\n    /**\n     * initialize\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        ${{entity}} = $this->get{{Entity}}();\n         if (${{entity}}) {\n             $this->get{{Siblings}}()->add{{Entity}}Filter(${{entity}}->getId());\n             $this->get{{Siblings}}()->unshiftOrder('related_{{entity}}.position', 'ASC');\n         }\n    }\n\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_{{Sibling}}_List\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        return $this;\n    }\n\n    /**\n     * get the current {{entity}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/View/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} view block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_View extends Mage_Core_Block_Template\n{\n    /**\n     * get the current {{entityLabel}}\n     *\n     * @access public\n     * @return mixed ({{Namespace}}_{{Module}}_Model_{{Entity}}|null)\n     * {{qwertyuiop}}\n     */\n    public function getCurrent{{Entity}}()\n    {\n        return Mage::registry('current_{{entity}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Widget/Link/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} link widget block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_Link extends {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_View\n{\n    protected $_htmlTemplate = '{{namespace}}_{{module}}/{{entity}}/widget/link.phtml';\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Widget/Subtree/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} subtree block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_Subtree extends {{Namespace}}_{{Module}}_Block_{{Entity}}_List implements\n    Mage_Widget_Block_Interface\n{\n    protected $_template = '{{namespace}}_{{module}}/{{entity}}/widget/subtree.phtml';\n    /**\n     * prepare the layout\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_Subtree\n     * {{qwertyuiop}}\n     */\n    protected function _prepareLayout()\n    {\n        $this->get{{Entities}}()->addFieldToFilter('entity_id', $this->get{{Entity}}Id());\n        return $this;\n    }\n\n    /**\n     * get the display mode\n     *\n     * @access protected\n     * @return int\n     * {{qwertyuiop}}\n     */\n    protected function _getDisplayMode()\n    {\n        return 1;\n    }\n\n    /**\n     * get the element id\n     *\n     * @access protected\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getUniqueId()\n    {\n        if (!$this->getData('uniq_id')) {\n            $this->setData('uniq_id', uniqid('subtree'));\n        }\n        return $this->getData('uniq_id');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Widget/View/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} widget block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_View extends Mage_Core_Block_Template implements\n    Mage_Widget_Block_Interface\n{\n    protected $_htmlTemplate = '{{namespace}}_{{module}}/{{entity}}/widget/view.phtml';\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Widget/View/020_not_tree",
    "content": "\n    /**\n     * Prepare a for widget\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_View\n     * {{qwertyuiop}}\n     */\n    protected function _beforeToHtml()\n    {\n        parent::_beforeToHtml();\n        ${{entity}}Id = $this->getData('{{entity}}_id');\n        if (${{entity}}Id) {\n            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n                ->setStoreId(Mage::app()->getStore()->getId())\n                ->load(${{entity}}Id);\n            if (${{entity}}->getStatus()) {\n                $this->setCurrent{{Entity}}(${{entity}});\n                $this->setTemplate($this->_htmlTemplate);\n            }\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Widget/View/030_tree",
    "content": "\n    /**\n     * Prepare a for widget\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_{{Entity}}_Widget_View\n     * {{qwertyuiop}}\n     */\n    protected function _beforeToHtml()\n    {\n        parent::_beforeToHtml();\n        ${{entity}}Id = $this->getData('{{entity}}_id');\n        if (${{entity}}Id) {\n            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n                ->setStoreId(Mage::app()->getStore()->getId())\n                ->load(${{entity}}Id);\n            if (${{entity}}->getStatusPath()) {\n                $this->setCurrent{{Entity}}(${{entity}});\n                $this->setTemplate($this->_htmlTemplate);\n            }\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Entity/Widget/View/040_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Block/Rss/010_content",
    "content": "<?php \n{{License}}\n/**\n * {{Module}} RSS block\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Block_Rss extends Mage_Core_Block_Template\n{\n    /**\n     * RSS feeds for this block\n     */\n    protected $_feeds = array();\n\n    /**\n     * add a new feed\n     *\n     * @access public\n     * @param string $label\n     * @param string $url\n     * @param bool $prepare\n     * @return {{Namespace}}_{{Module}}_Block_Rss\n     * {{qwertyuiop}}\n     */\n    public function addFeed($label, $url, $prepare = false)\n    {\n        $link = ($prepare ? $this->getUrl($url) : $url);\n        $feed = new Varien_Object();\n        $feed->setLabel($label);\n        $feed->setUrl($link);\n        $this->_feeds[$link] = $feed;\n        return $this;\n    }\n\n    /**\n     * get the current feeds\n     *\n     * @access public\n     * @return array()\n     * {{qwertyuiop}}\n     */\n    public function getFeeds()\n    {\n        return $this->_feeds;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Controller/Adminhtml/Module/010_content",
    "content": "<?php\n{{License}}\n/**\n * module base admin controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Controller_Adminhtml_{{Module}} extends Mage_Adminhtml_Controller_Action\n{\n    /**\n     * upload file and get the uploaded name\n     *\n     * @access public\n     * @param string $input\n     * @param string $destinationFolder\n     * @param array $data\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _uploadAndGetName($input, $destinationFolder, $data)\n    {\n        try {\n            if (isset($data[$input]['delete'])) {\n                return '';\n            } else {\n                $uploader = new Varien_File_Uploader($input);\n                $uploader->setAllowRenameFiles(true);\n                $uploader->setFilesDispersion(true);\n                $uploader->setAllowCreateFolders(true);\n                $result = $uploader->save($destinationFolder);\n                return $result['file'];\n            }\n        } catch (Exception $e) {\n            if ($e->getCode() != Varien_File_Uploader::TMP_NAME_EMPTY) {\n                throw $e;\n            } else {\n                if (isset($data[$input]['value'])) {\n                    return $data[$input]['value'];\n                }\n            }\n        }\n        return '';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Controller/Router/010_top",
    "content": "<?php \n{{License}}\n/**\n * Router\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract\n{\n    /**\n     * init routes\n     *\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return {{Namespace}}_{{Module}}_Controller_Router\n     * {{qwertyuiop}}\n     */\n    public function initControllerRouters($observer)\n    {\n        $front = $observer->getEvent()->getFront();\n        $front->addRouter('{{namespace}}_{{module}}', $this);\n        return $this;\n    }\n\n    /**\n     * Validate and match entities and modify request\n     *\n     * @access public\n     * @param Zend_Controller_Request_Http $request\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function match(Zend_Controller_Request_Http $request)\n    {\n        if (!Mage::isInstalled()) {\n            Mage::app()->getFrontController()->getResponse()\n                ->setRedirect(Mage::getUrl('install'))\n                ->sendResponse();\n            exit;\n        }\n        $urlKey = trim($request->getPathInfo(), '/');\n        $check = array();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Controller/Router/020_entity",
    "content": "        $check['{{entity}}'] = new Varien_Object(\n            array(\n                'prefix'        => Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/url_prefix'),\n                'suffix'        => Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/url_suffix'),\n                'list_key'      => Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/url_rewrite_list'),\n                'list_action'   => 'index',\n                'model'         =>'{{namespace}}_{{module}}/{{entity}}',\n                'controller'    => '{{entity}}',\n                'action'        => 'view',\n                'param'         => 'id',\n                'check_path'    => {{isTree}}\n            )\n        );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Controller/Router/030_footer",
    "content": "        foreach ($check as $key=>$settings) {\n            if ($settings->getListKey()) {\n                if ($urlKey == $settings->getListKey()) {\n                    $request->setModuleName('{{frontKey}}')\n                        ->setControllerName($settings->getController())\n                        ->setActionName($settings->getListAction());\n                    $request->setAlias(\n                        Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,\n                        $urlKey\n                    );\n                    return true;\n                }\n            }\n            if ($settings['prefix']) {\n                $parts = explode('/', $urlKey);\n                if ($parts[0] != $settings['prefix'] || count($parts) != 2) {\n                    continue;\n                }\n                $urlKey = $parts[1];\n            }\n            if ($settings['suffix']) {\n                $urlKey = substr($urlKey, 0, -strlen($settings['suffix']) - 1);\n            }\n            $model = Mage::getModel($settings->getModel());\n            $id = $model->checkUrlKey($urlKey, Mage::app()->getStore()->getId());\n            if ($id) {\n                if ($settings->getCheckPath() && !$model->load($id)->getStatusPath()) {\n                    continue;\n                }\n                $request->setModuleName('{{frontKey}}')\n                    ->setControllerName($settings->getController())\n                    ->setActionName($settings->getAction())\n                    ->setParam($settings->getParam(), $id);\n                $request->setAlias(\n                    Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,\n                    $urlKey\n                );\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Category/010_top",
    "content": "<?php\n{{License}}\n/**\n * Category helper\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Helper_Category extends {{Namespace}}_{{Module}}_Helper_Data\n{\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Category/020_content",
    "content": "\n    /**\n     * get the selected {{entitiesLabel}} for a category\n     *\n     * @access public\n     * @param Mage_Catalog_Model_Category $category\n     * @return array()\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entities}}(Mage_Catalog_Model_Category $category)\n    {\n        if (!$category->hasSelected{{Entities}}()) {\n            ${{entities}} = array();\n            foreach ($this->getSelected{{Entities}}Collection($category) as ${{entity}}) {\n                ${{entities}}[] = ${{entity}};\n            }\n            $category->setSelected{{Entities}}(${{entities}});\n        }\n        return $category->getData('selected_{{entities}}');\n    }\n\n    /**\n     * get {{entityLabel}} collection for a category\n     *\n     * @access public\n     * @param Mage_Catalog_Model_Category $category\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entities}}Collection(Mage_Catalog_Model_Category $category)\n    {\n        $collection = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_collection')\n            ->addCategoryFilter($category);\n        return $collection;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Category/030_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Data/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{Module}} default helper\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Helper_Data extends Mage_Core_Helper_Abstract\n{\n    /**\n     * convert array to options\n     *\n     * @access public\n     * @param $options\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function convertOptions($options)\n    {\n        $converted = array();\n        foreach ($options as $option) {\n            if (isset($option['value']) && !is_array($option['value']) &&\n                isset($option['label']) && !is_array($option['label'])) {\n                $converted[$option['value']] = $option['label'];\n            }\n        }\n        return $converted;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/010_top",
    "content": "<?php \n{{License}}\n/**\n * {{EntityLabel}} helper\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Helper_{{Entity}} extends Mage_Core_Helper_Abstract\n{\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/020_create_list",
    "content": "\n    /**\n     * get the url to the {{entitiesLabel}} list page\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entities}}Url()\n    {\n        if ($listKey = Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/url_rewrite_list')) {\n            return Mage::getUrl('', array('_direct'=>$listKey));\n        }\n        return Mage::getUrl('{{namespace}}_{{module}}/{{entity}}/index');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/030_breadcrumbs",
    "content": "\n    /**\n     * check if breadcrumbs can be used\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function getUseBreadcrumbs()\n    {\n        return Mage::getStoreConfigFlag('{{namespace}}_{{module}}/{{entity}}/breadcrumbs');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/040_tree",
    "content": "    const {{ENTITY}}_ROOT_ID = 1;\n    /**\n     * get the root id\n     *\n     * @access public\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getRoot{{Entity}}Id()\n    {\n        return self::{{ENTITY}}_ROOT_ID;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/050_rss",
    "content": "\n    /**\n     * check if the rss for {{entityLabel}} is enabled\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function isRssEnabled()\n    {\n        return  Mage::getStoreConfigFlag('rss/config/active') &&\n            Mage::getStoreConfigFlag('{{namespace}}_{{module}}/{{entity}}/rss');\n    }\n\n    /**\n     * get the link to the {{entityLabel}} rss list\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getRssUrl()\n    {\n        return Mage::getUrl('{{namespace}}_{{module}}/{{entity}}/rss');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/060_file",
    "content": "\n    /**\n     * get base files dir\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getFileBaseDir()\n    {\n        return Mage::getBaseDir('media').DS.'{{entity}}'.DS.'file';\n    }\n\n    /**\n     * get base file url\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getFileBaseUrl()\n    {\n        return Mage::getBaseUrl('media').'{{entity}}'.'/'.'file';\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/070_eav",
    "content": "\n    /**\n     * get {{entity}} attribute source model\n     *\n     * @access public\n     * @param string $inputType\n     * @return mixed (string|null)\n     * {{qwertyuiop}}\n     */\n     public function getAttributeSourceModelByInputType($inputType)\n     {\n         $inputTypes = $this->getAttributeInputTypes();\n         if (!empty($inputTypes[$inputType]['source_model'])) {\n             return $inputTypes[$inputType]['source_model'];\n         }\n         return null;\n     }\n\n    /**\n     * get attribute input types\n     *\n     * @access public\n     * @param string $inputType\n     * @return array()\n     * {{qwertyuiop}}\n     */\n    public function getAttributeInputTypes($inputType = null)\n    {\n        $inputTypes = array(\n            'multiselect' => array(\n                'backend_model' => 'eav/entity_attribute_backend_array',\n                'source_model' => 'eav/entity_attribute_source_table'\n            ),\n            'boolean'     => array(\n                'source_model'  => 'eav/entity_attribute_source_boolean'\n            ),\n            'file'          => array(\n                'backend_model' => '{{namespace}}_{{module}}/{{entity}}_attribute_backend_file'\n            ),\n            'image'          => array(\n                'backend_model' => '{{namespace}}_{{module}}/{{entity}}_attribute_backend_image'\n            ),\n        );\n\n        if (is_null($inputType)) {\n            return $inputTypes;\n        } else if (isset($inputTypes[$inputType])) {\n            return $inputTypes[$inputType];\n        }\n        return array();\n    }\n\n    /**\n     * get {{entity}} attribute backend model\n     *\n     * @access public\n     * @param string $inputType\n     * @return mixed (string|null)\n     * {{qwertyuiop}}\n     */\n    public function getAttributeBackendModelByInputType($inputType)\n    {\n        $inputTypes = $this->getAttributeInputTypes();\n        if (!empty($inputTypes[$inputType]['backend_model'])) {\n            return $inputTypes[$inputType]['backend_model'];\n        }\n        return null;\n    }\n\n    /**\n     * filter attribute content\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param string $attributeHtml\n     * @param string @attributeName\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function {{entity}}Attribute(${{entity}}, $attributeHtml, $attributeName)\n    {\n        $attribute = Mage::getSingleton('eav/config')->getAttribute(\n            {{Namespace}}_{{Module}}_Model_{{Entity}}::ENTITY,\n            $attributeName\n        );\n        if ($attribute && $attribute->getId() && !$attribute->getIsWysiwygEnabled()) {\n            if ($attribute->getFrontendInput() == 'textarea') {\n                $attributeHtml = nl2br($attributeHtml);\n            }\n        }\n        if ($attribute->getIsWysiwygEnabled()) {\n            $attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);\n        }\n        return $attributeHtml;\n    }\n\n    /**\n     * get the template processor\n     *\n     * @access protected\n     * @return Mage_Catalog_Model_Template_Filter\n     * {{qwertyuiop}}\n     */\n    protected function _getTemplateProcessor()\n    {\n        if (null === $this->_templateProcessor) {\n            $this->_templateProcessor = Mage::helper('catalog')->getPageTemplateProcessor();\n        }\n        return $this->_templateProcessor;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/080_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Entity/Image/010_content",
    "content": "<?php \n{{License}}\n/**\n * {{EntityLabel}} image helper\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Helper_{{Entity}}_Image extends {{Namespace}}_{{Module}}_Helper_Image_Abstract\n{\n    /**\n     * image placeholder\n     * @var string\n     */\n    protected $_placeholder = 'images/placeholder/{{entity}}.jpg';\n    /**\n     * image subdir\n     * @var string\n     */\n    protected $_subdir      = '{{entity}}';\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Image/Abstract/010_content",
    "content": "<?php\n{{License}}\n/**\n * abstract image helper\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nabstract class {{Namespace}}_{{Module}}_Helper_Image_Abstract extends Mage_Core_Helper_Data\n{\n    /**\n     * path to image placeholder\n     * override in child\n     * @var string\n     */\n    protected $_placeholder     = '';\n\n    /**\n     * subdirectory to save imaves\n     * override in child\n     * @var string\n     */\n    protected $_subdir          = '';\n\n    /**\n     * image processor\n     * @var null|Varien_Image_Adapter_Gd2\n     */\n    protected $_imageProcessor     = null;\n\n    /**\n     * image to process\n     * @var unknown_type\n     */\n    protected $_image             = null;\n\n    /**\n     * error message\n     * @var string\n     */\n    protected $_openError         = \"\";\n\n    /**\n     * keep image frame\n     * @var bool\n     */\n    protected $_keepFrame       = false;\n\n    /**\n     * keep image aspect ratio\n     * @var bool\n     */\n    protected $_keepAspectRatio = true;\n\n    /**\n     * constrain image\n     * @var bool\n     */\n    protected $_constrainOnly   = true;\n\n    /**\n     * addaptive resize - crop\n     * https://github.com/wearefarm/magento-adaptive-resize/blob/master/README.md\n     * @var bool\n     */\n    protected $_adaptiveResize  = 'center'; // false|center|top|bottom\n\n    /**\n     * image width\n     * @var mixed(null|int)\n     */\n    protected $_width           = null;\n\n    /**\n     * image height\n     * @var mixed(null|int)\n     */\n    protected $_height          = null;\n\n    /**\n     * image resize needed\n     * @var mixed (null|array)\n     */\n    protected $_scheduledResize = null;\n\n    /**\n     * image is resized\n     * @var bool\n     */\n    protected $_resized         = false;\n\n    /**\n     * addaptive resize positions\n     * https://github.com/wearefarm/magento-adaptive-resize/blob/master/README.md\n     * @var array\n     */\n    protected $_adaptiveResizePositions = array(\n        'center' => array(0.5,0.5),\n        'top'    => array(1,0),\n        'bottom' => array(0,1)\n    );\n\n    /**\n     * resized image folder name\n     * @var string\n     */\n    protected $_resizeFolderName = 'cache';\n\n    /**\n     * get the image base dir\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getImageBaseDir()\n    {\n        return Mage::getBaseDir('media').DS.$this->_subdir.DS.'image';\n    }\n\n    /**\n     * get the image url for object\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getImageBaseUrl()\n    {\n        return Mage::getBaseUrl('media').$this->_subdir.'/'.'image';\n    }\n\n    /**\n     * init image\n     *\n     * @access public\n     * @param Varien_Object $object\n     * @param string $imageField\n     * @return {{Namespace}}_{{Module}}_Helper_Image_Abstract\n     * {{qwertyuiop}}\n     */\n    public function init(Varien_Object $object, $imageField = 'image')\n    {\n        $this->_imageProcessor = null;\n        $this->_image = $object->getDataUsingMethod($imageField);\n        if (!$this->_image) {\n            $this->_image = '/'.$this->_placeholder;\n        }\n        $this->_width = null;\n        $this->_height = null;\n        $this->_scheduledResize = false;\n        $this->_resized = false;\n        $this->_adaptiveResize = 'center';\n\n        try {\n            $this->_getImageProcessor()->open($this->getImageBaseDir().$this->_image);\n        } catch (Exception $e) {\n            $this->_openError = $e->getMessage();\n            try {\n                $this->_getImageProcessor()->open(Mage::getDesign()->getSkinUrl($this->_placeholder));\n                $this->_image = '/'.$this->_placeholder;\n            } catch(Exception $e) {\n                $this->_openError .= \"\\n\".$e->getMessage();\n                $this->_image = null;\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * get the image processor\n     *\n     * @access protected\n     * @return Varien_Image_Adapter_Gd2\n     * {{qwertyuiop}}\n     */\n    protected function _getImageProcessor()\n    {\n        if (is_null($this->_imageProcessor)) {\n            $this->_imageProcessor = Varien_Image_Adapter::factory('GD2');\n            $this->_imageProcessor->keepFrame($this->_keepFrame);\n            $this->_imageProcessor->keepAspectRatio($this->_keepAspectRatio);\n            $this->_imageProcessor->constrainOnly($this->_constrainOnly);\n        }\n        return $this->_imageProcessor;\n    }\n\n    /**\n     * Get/set keepAspectRatio\n     *\n     * @access public\n     * @param bool $value\n     * @return mixed(bool|{{Namespace}}_{{Module}}_Helper_Image_Abstract)\n     * {{qwertyuiop}}\n     */\n    public function keepAspectRatio($value = null)\n    {\n        if (null !== $value) {\n            $this->_getImageProcessor()->keepAspectRatio($value);\n            return $this;\n        } else {\n            return $this->_getImageProcessor()->keepAspectRatio();\n        }\n    }\n\n    /**\n     * Get/set keepFrame\n     *\n     * @access public\n     * @param bool $value\n     * @return mixed(bool|{{Namespace}}_{{Module}}_Helper_Image_Abstract)\n     * {{qwertyuiop}}\n     */\n    public function keepFrame($value = null)\n    {\n        if (null !== $value) {\n            $this->_getImageProcessor()->keepFrame($value);\n            return $this;\n        } else {\n            return $this->_getImageProcessor()->keepFrame();\n        }\n    }\n\n    /**\n     * Get/set keepTransparency\n     *\n     * @access public\n     * @param bool $value\n     * @return mixed(bool|{{Namespace}}_{{Module}}_Helper_Image_Abstract)\n     * {{qwertyuiop}}\n     */\n    public function keepTransparency($value = null)\n    {\n        if (null !== $value) {\n            $this->_getImageProcessor()->keepTransparency($value);\n            return $this;\n        } else {\n            return $this->_getImageProcessor()->keepTransparency();\n        }\n    }\n\n    /**\n     * Get/set adaptiveResize\n     *\n     * @access public\n     * @param bool|string $value\n     * @return mixed(bool|{{Namespace}}_{{Module}}_Helper_Image_Abstract)\n     * https://github.com/wearefarm/magento-adaptive-resize/blob/master/README.md\n     * {{qwertyuiop}}\n     */\n    public function adaptiveResize($value = null)\n    {\n        if (null !== $value) {\n            $this->_adaptiveResize = $value;\n            if ($value) {\n                $this->keepFrame(false);\n            }\n            return $this;\n        } else {\n            return $this->_adaptiveResize;\n        }\n    }\n\n    /**\n     * Get/set constrainOnly\n     *\n     * @access public\n     * @param bool $value\n     * @return mixed(bool|{{Namespace}}_{{Module}}_Helper_Image_Abstract)\n     * {{qwertyuiop}}\n     */\n    public function constrainOnly($value = null)\n    {\n       if (null !== $value) {\n            $this->_getImageProcessor()->constrainOnly($value);\n            return $this;\n       } else {\n            return $this->_getImageProcessor()->constrainOnly();\n       }\n    }\n\n    /**\n     * Get/set quality, values in percentage from 0 to 100\n     *\n     * @access public\n     * @param int $value\n     * @return mixed(bool|{{Namespace}}_{{Module}}_Helper_Image_Abstract)\n     * {{qwertyuiop}}\n     */\n    public function quality($value = null)\n    {\n        if (null !== $value) {\n            $this->_getImageProcessor()->quality($value);\n            return $this;\n        } else {\n            return $this->_getImageProcessor()->quality();\n        }\n    }\n\n    /**\n     * Get/set keepBackgroundColor\n     *\n     * @access public\n     * @param array $value\n     * @return mixed(bool|{{Namespace}}_{{Module}}_Helper_Image_Abstract)\n     * {{qwertyuiop}}\n     */\n    public function backgroundColor($value = null)\n    {\n        if (null !== $value) {\n            $this->_getImageProcessor()-> backgroundColor($value);\n            return $this;\n        } else {\n            return $this->_getImageProcessor()-> backgroundColor();\n        }\n    }\n\n    /**\n     * resize image\n     *\n     * @access public\n     * @param int $width - defaults to null\n     * @param int $height - defaults to null\n     * @return {{Namespace}}_{{Module}}_Helper_Image_Abstract\n     * {{qwertyuiop}}\n     */\n    public function resize($width = null, $height = null)\n    {\n        $this->_scheduledResize = true;\n        $this->_width  = $width;\n        $this->_height = $height;\n        return $this;\n    }\n\n    /**\n     * get destination image prefix\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Helper_Image_Abstract\n     * {{qwertyuiop}}\n     */\n    protected function _getDestinationImagePrefix()\n    {\n        if (!$this->_image) {\n            return $this;\n        }\n        $imageRealPath = \"\";\n        if ($this->_scheduledResize) {\n            $width  = $this->_width;\n            $height = $this->_height;\n            $adaptive   = $this->adaptiveResize();\n            $keepFrame  = $this->keepFrame();\n            $keepAspectRatio= $this->keepAspectRatio();\n            $constrainOnly  = $this->constrainOnly();\n            $imageRealPath = $width.'x'.$height;\n            $options = \"\";\n\n            if (!$keepAspectRatio) {\n                $imageRealPath .= '-exact';\n            } else {\n                if (!$keepFrame && $width && $height && ($adaptive !== false)) {\n                    $adaptive = strtolower(trim($adaptive));\n                    if (isset($this->_adaptiveResizePositions[$adaptive])) {\n                        $imageRealPath .= '-'.$adaptive;\n                    }\n                }\n            }\n            if ($keepFrame) {\n                $imageRealPath .= '-frame';\n                $_backgroundColor = $this->backgroundColor();\n                if ($_backgroundColor) {\n                    $imageRealPath .= '-'.implode('-', $_backgroundColor);\n                }\n            }\n            if (!$constrainOnly) {\n                $imageRealPath .= '-zoom';\n            }\n        }\n        return $imageRealPath;\n    }\n\n    /**\n     * get image destination path\n     *\n     * @access protected\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getDestinationPath()\n    {\n        if (!$this->_image) {\n            return $this;\n        }\n        if ($this->_scheduledResize) {\n            return $this->getImageBaseDir().DS.$this->_resizeFolderName.DS.$this->_getDestinationImagePrefix().DS.$this->_image;\n        } else {\n            return $this->getImageBaseDir().DS.$this->_image;\n        }\n    }\n\n    /**\n     * get image url\n     *\n     * @access protected\n     * @return mixed (string|bool)\n     * {{qwertyuiop}}\n     */\n    protected function _getImageUrl()\n    {\n        if (!$this->_image) {\n            return false;\n        }\n        if ($this->_scheduledResize) {\n            return  $this->getImageBaseUrl().'/'.$this->_resizeFolderName.'/'.$this->_getDestinationImagePrefix().$this->_image;\n        } else {\n           return  $this->getImageBaseUrl().$this->_image;\n        }\n    }\n\n    /**\n     * resize image\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Helper_Image_Abstract\n     * {{qwertyuiop}}\n     */\n    protected function _doResize()\n    {\n        if (!$this->_image || !$this->_scheduledResize || $this->_resized) {\n            return $this;\n        }\n        $this->_resized = true; //mark as resized\n        $width = $this->_width;\n        $height = $this->_height;\n        $adaptive = $width && $height &&\n                    $this->keepAspectRatio() && !$this->keepFrame() &&\n                    ($this->adaptiveResize() !== false);\n        $adaptivePosition = false;\n        if ($adaptive) {\n            $adaptive = strtolower(trim($this->adaptiveResize()));\n            if (isset($this->_adaptiveResizePositions[$adaptive])) {\n                $adaptivePosition = $this->_adaptiveResizePositions[$adaptive];\n            }\n        }\n        $processor = $this->_getImageProcessor();\n\n        if (!$adaptivePosition) {\n            $processor->resize($width, $height);\n            return $this;\n        }\n        //make adaptive resize\n        //https://github.com/wearefarm/magento-adaptive-resize/blob/master/README.md\n        $currentRatio = $processor->getOriginalWidth() / $processor->getOriginalHeight();\n        $targetRatio  = $width / $height;\n        if ($targetRatio > $currentRatio) {\n            $processor->resize($width, null);\n        } else {\n            $processor->resize(null, $height);\n        }\n        $diffWidth  = $processor->getOriginalWidth() - $width;\n        $diffHeight = $processor->getOriginalHeight() - $height;\n        if ($diffWidth || $diffHeight) {\n            $processor->crop(\n                floor($diffHeight * $adaptivePosition[0]), //top rate\n                floor($diffWidth / 2),\n                ceil($diffWidth / 2),\n                ceil($diffHeight *  $adaptivePosition[1]) //bottom rate\n            );\n        }\n        return $this;\n    }\n\n    /**\n     * to string - no need for cache expire because the image names will be different\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function __toString()\n    {\n        try {\n            if (!$this->_image) {\n                throw new Exception($this->_openError);\n            }\n            $imageRealPath = $this->_getDestinationPath();\n            if (!file_exists($imageRealPath)) {\n                $this->_doResize();\n                $this->_getImageProcessor()->save($imageRealPath);\n            }\n            return $this->_getImageUrl();\n        } catch (Exception $e) {\n            Mage::logException($e);\n            return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAnFBMVEUAAAAAAAAAAAAAAAC0tLS4uLi0tLT6+vrx8fHo6Ojj4OC+mpq7UE2wXlqzOTGtHwza2dnGaWeiJxDV0dGNJhari4uqeHi/W1edTkevSkWWNCOLEQiXEgbExMXbiorTgH+NT0a4RD+XIxTPFwm7BQHYAwHJAwDLd3aWcXDKV03JODOjNyunLCS6JQ6nCQO/q6viqKjFREOYQTrQIiHNANNfAAAAB3RSTlMCPiYZ3uvFTohbPwAAAURJREFUOMuVk9dygzAQRW3jeGUhikQvDtUl7uX//y0b4bGMCDPJAV64Z+5Ko9HkLxizEYynMCW/A9OXsETI8xkRSPeNNpDnOyZo5dChCe8pAUJ04Qd65bzYXilIaSiYrPhEisoEiS5YvOCVbdt8G1kDATGjbWV5QC7HiDNzKFCb2/J3wqKIVcuBEDImi60vxo5JEvYEQCFmB0/mt5sdHhNLF+CQHGS+3+Ok2k8HQprVAPf944E51JkuAMRZdrk7m7WDuZfncV9Awiz3uxzlcx5qAgHq5067kXkgzj7VBCSoz63YYX/stCKAQQNAKdrmJITTbERJJErojMA/Net1c/IDPBxK6cJ424WE7so0LXcuoauV585nk5fQh5AVgDvvBqgGBRaA+yFztcheAfWoytUIJbhd/3iDykcWuZhpl3eqYUz+wTdj6SFVkjRnJQAAAABJRU5ErkJggg==';\n        }\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Product/010_top",
    "content": "<?php\n{{License}}\n/**\n * Product helper\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Helper_Product extends {{Namespace}}_{{Module}}_Helper_Data\n{\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Product/020_content",
    "content": "\n    /**\n     * get the selected {{entitiesLabel}} for a product\n     *\n     * @access public\n     * @param Mage_Catalog_Model_Product $product\n     * @return array()\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entities}}(Mage_Catalog_Model_Product $product)\n    {\n        if (!$product->hasSelected{{Entities}}()) {\n            ${{entities}} = array();\n            foreach ($this->getSelected{{Entities}}Collection($product) as ${{entity}}) {\n                ${{entities}}[] = ${{entity}};\n            }\n            $product->setSelected{{Entities}}(${{entities}});\n        }\n        return $product->getData('selected_{{entities}}');\n    }\n\n    /**\n     * get {{entityLabel}} collection for a product\n     *\n     * @access public\n     * @param Mage_Catalog_Model_Product $product\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Entities}}Collection(Mage_Catalog_Model_Product $product)\n    {\n        $collection = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_collection')\n            ->addProductFilter($product);\n        return $collection;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Helper/Product/030_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/010_top",
    "content": "<?php\n{{License}}\n/**\n * Adminhtml observer\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Adminhtml_Observer\n{\n    /**\n     * check if tab can be added\n     *\n     * @access protected\n     * @param Mage_Catalog_Model_Product $product\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _canAddTab($product)\n    {\n        if ($product->getId()) {\n            return true;\n        }\n        if (!$product->getAttributeSetId()) {\n            return false;\n        }\n        $request = Mage::app()->getRequest();\n        if ($request->getParam('type') == 'configurable') {\n            if ($request->getParam('attributes')) {\n                return true;\n            }\n        }\n        return false;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/020_entity_product",
    "content": "\n    /**\n     * add the {{entityLabel}} tab to products\n     *\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer\n     * {{qwertyuiop}}\n     */\n    public function addProduct{{Entity}}Block($observer)\n    {\n        $block = $observer->getEvent()->getBlock();\n        $product = Mage::registry('product');\n        if ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs && $this->_canAddTab($product)) {\n            $block->addTab(\n                '{{entities}}',\n                array(\n                    'label' => Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'),\n                    'url'   => Mage::helper('adminhtml')->getUrl(\n                        'adminhtml/{{module}}_{{entity}}_catalog_product/{{entities}}',\n                        array('_current' => true)\n                    ),\n                    'class' => 'ajax',\n                )\n            );\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/030_entity_product_save",
    "content": "\n    /**\n     * save {{entityLabel}} - product relation\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer\n     * {{qwertyuiop}}\n     */\n    public function saveProduct{{Entity}}Data($observer)\n    {\n        $post = Mage::app()->getRequest()->getPost('{{entities}}', -1);\n        if ($post != '-1') {\n            $post = Mage::helper('adminhtml/js')->decodeGridSerializedInput($post);\n            $product = Mage::registry('product');\n            ${{entity}}Product = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_product')\n                ->saveProductRelation($product, $post);\n        }\n        return $this;\n    }"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/040_entity_product_save_tree",
    "content": "\n    /**\n     * save {{entity}} - product relation\n     *\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer\n     * {{qwertyuiop}}\n     */\n    public function saveProduct{{Entity}}Data($observer)\n    {\n        $post = Mage::app()->getRequest()->getPost('{{entity}}_ids', -1);\n        if ($post != '-1') {\n            $post = explode(',', $post);\n            $post = array_unique($post);\n            $product = $observer->getEvent()->getProduct();\n            Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_product')\n                ->saveProductRelation($product, $post);\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/050_entity_category",
    "content": "\n    /**\n     * add the {{entity}} tab to categories\n     *\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer\n     * {{qwertyuiop}}\n     */\n    public function addCategory{{Entity}}Block($observer)\n    {\n        $tabs = $observer->getEvent()->getTabs();\n        $content = $tabs->getLayout()->createBlock(\n            '{{namespace}}_{{module}}/adminhtml_catalog_category_tab_{{entity}}',\n            'category.{{entity}}.grid'\n        )->toHtml();\n        $serializer = $tabs->getLayout()->createBlock(\n            'adminhtml/widget_grid_serializer',\n            'category.{{entity}}.grid.serializer'\n        );\n        $serializer->initSerializerBlock(\n            'category.{{entity}}.grid',\n            'getSelected{{Entities}}',\n            '{{entities}}',\n            'category_{{entities}}'\n        );\n        $serializer->addColumnInputName('position');\n        $content .= $serializer->toHtml();\n        $tabs->addTab(\n            '{{entity}}',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'),\n                'content' => $content,\n            )\n        );\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/055_entity_category_tree",
    "content": "\n    /**\n     * add the {{entityLabel}} tab to categories\n     *\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer\n     * {{qwertyuiop}}\n     */\n    public function addCategory{{Entity}}Block($observer)\n    {\n        $tabs = $observer->getEvent()->getTabs();\n        $content = $tabs->getLayout()->createBlock(\n            '{{namespace}}_{{module}}/adminhtml_catalog_category_tab_{{entity}}',\n            'category.{{entity}}.grid'\n        )->toHtml();\n        $tabs->addTab(\n            '{{entity}}',\n            array(\n                'label'   => Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'),\n                'content' => $content,\n            )\n        );\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/060_entity_category_save",
    "content": "\n    /**\n     * save {{entityLabel}} - category relation\n     *\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer\n     * {{qwertyuiop}}\n     */\n    public function saveCategory{{Entity}}Data($observer)\n    {\n        $post = Mage::app()->getRequest()->getPost('{{entities}}', -1);\n        if ($post != '-1') {\n            $post = Mage::helper('adminhtml/js')->decodeGridSerializedInput($post);\n            $category = Mage::registry('category');\n            ${{entity}}Category = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_category')\n                ->saveCategoryRelation($category, $post);\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/070_entity_category_save_tree",
    "content": "\n    /**\n     * save {{entityLabel}} - category relation\n     *\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Observer\n     * {{qwertyuiop}}\n     */\n    public function saveCategory{{Entity}}Data($observer)\n    {\n        $post = Mage::app()->getRequest()->getPost('{{entity}}_ids', -1);\n        if ($post != '-1') {\n            $post = explode(',', $post);\n            $post = array_unique($post);\n            $category = $observer->getEvent()->getCategory();\n            Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_category')\n                ->saveCategoryRelation($category, $post);\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Observer/080_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Search/Entity/010_content",
    "content": "<?php\n{{License}}\n/**\n * Admin search model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Adminhtml_Search_{{Entity}} extends Varien_Object\n{\n    /**\n     * Load search results\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Adminhtml_Search_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function load()\n    {\n        $arr = array();\n        if (!$this->hasStart() || !$this->hasLimit() || !$this->hasQuery()) {\n            $this->setResults($arr);\n            return $this;\n        }\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection')\n            ->{{filterMethod}}('{{nameAttributeCode}}', array('like' => $this->getQuery().'%'))\n            ->setCurPage($this->getStart())\n            ->setPageSize($this->getLimit())\n            ->load();\n        foreach ($collection->getItems() as ${{entity}}) {\n            $arr[] = array(\n                'id'          => '{{entity}}/1/'.${{entity}}->getId(),\n                'type'        => Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'),\n                'name'        => ${{entity}}->get{{EntityNameMagicCode}}(),\n                'description' => ${{entity}}->get{{EntityNameMagicCode}}(),\n                'url' => Mage::helper('adminhtml')->getUrl(\n                    '*/{{module}}_{{entity}}/edit',\n                    array('id'=>${{entity}}->getId())\n                ),\n            );\n        }\n        $this->setResults($arr);\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Adminhtml/Source/Yesnodefault/010_content",
    "content": "<?php\n{{License}}\n/**\n * Admin source yes/no/default model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Adminhtml_Source_Yesnodefault extends Mage_Eav_Model_Entity_Attribute_Source_Abstract\n{\n    const YES = 1;\n    const NO = 0;\n    const USE_DEFAULT = 2;\n\n    /**\n     * get possible values\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function toOptionArray()\n    {\n        return array(\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Use default config'),\n                'value' => self::USE_DEFAULT\n            ),\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Yes'),\n                'value' => self::YES\n            ),\n            array(\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('No'),\n                'value' => self::NO\n            )\n        );\n    }\n\n    /**\n     * Get list of all available values\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getAllOptions()\n    {\n        return $this->toOptionArray();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} REST API model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Api2_{{Entity}} extends Mage_Api2_Model_Resource\n{\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/020_eav",
    "content": "\n    /**\n     * Get available attributes of API resource\n     *\n     * @access public\n     * @param string $userType\n     * @param string $operation\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getAvailableAttributes($userType, $operation)\n    {\n        $attributes = $this->getAvailableAttributesFromConfig();\n        $entityType = Mage::getModel('eav/entity_type')->loadByCode('{{namespace}}_{{module}}_{{entity}}');\n        $entityOnlyAttrs = $this->getEntityOnlyAttributes($userType, $operation);\n        foreach ($entityType->getAttributeCollection() as $attribute) {\n            if ($attribute->getIsVisible()) {\n                $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel();\n            }\n        }\n        $excludedAttrs = $this->getExcludedAttributes($userType, $operation);\n        $includedAttrs = $this->getIncludedAttributes($userType, $operation);\n        foreach ($attributes as $code => $label) {\n            if (in_array($code, $excludedAttrs) || ($includedAttrs && !in_array($code, $includedAttrs))) {\n                unset($attributes[$code]);\n            }\n            if (in_array($code, $entityOnlyAttrs)) {\n                $attributes[$code] .= ' *';\n            }\n        }\n        return $attributes;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/030_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} abstract REST API handler model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nabstract class {{Namespace}}_{{Module}}_Model_Api2_{{Entity}}_Rest extends {{Namespace}}_{{Module}}_Model_Api2_{{Entity}}\n{\n    /**\n     * current {{entityLabel}}\n     */\n    protected $_{{entity}};\n\n    /**\n     * retrieve entity\n     *\n     * @access protected\n     * @return array|mixed\n     * {{qwertyuiop}}\n     */\n    protected function _retrieve() {\n        ${{entity}} = $this->_get{{Entity}}();\n        $this->_prepare{{Entity}}ForResponse(${{entity}});\n        return ${{entity}}->getData();\n    }\n\n    /**\n     * get collection\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _retrieveCollection() {\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection'){{allAttributesToCollection}};{{restCollectionStoreId}}\n        $entityOnlyAttributes = $this->getEntityOnlyAttributes(\n            $this->getUserType(),\n            Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ\n        );\n        $availableAttributes = array_keys($this->getAvailableAttributes(\n            $this->getUserType(),\n            Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ)\n        );\n        $collection->{{filterMethod}}('status', array('eq' => 1));\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/015_tree_filter",
    "content": "        $collection->{{filterMethod}}('entity_id', array('neq'=>Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()));\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/020_store_collection",
    "content": "        $store = $this->_getStore();\n        $collection->addStoreFilter($store->getId());\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/030_collection_center",
    "content": "        $this->_applyCollectionModifiers($collection);\n        ${{entities}} = $collection->load();\n        ${{entities}}->walk('afterLoad');\n        foreach (${{entities}} as ${{entity}}) {\n            $this->_set{{Entity}}(${{entity}});\n            $this->_prepare{{Entity}}ForResponse(${{entity}});\n        }\n        ${{entities}}Array = ${{entities}}->toArray();{{restCollectionCleanup}}\n        return ${{entities}}Array;\n    }\n\n    /**\n     * prepare {{entityLabel}} for response\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _prepare{{Entity}}ForResponse({{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}) {\n        ${{entity}}Data = ${{entity}}->getData();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/040_url",
    "content": "        if ($this->getActionType() == self::ACTION_TYPE_ENTITY) {\n            ${{entity}}Data['url'] = ${{entity}}->get{{Entity}}Url();\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/050_center",
    "content": "    }\n\n    /**\n     * create {{entityLabel}}\n     *\n     * @access protected\n     * @param array $data\n     * @return string|void\n     * {{qwertyuiop}}\n     */\n    protected function _create(array $data) {\n        $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED);\n    }\n\n    /**\n     * update {{entityLabel}}\n     *\n     * @access protected\n     * @param array $data\n     * {{qwertyuiop}}\n     */\n    protected function _update(array $data) {\n        $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED);\n    }\n\n    /**\n     * delete {{entityLabel}}\n     *\n     * @access protected\n     * {{qwertyuiop}}\n     */\n    protected function _delete() {\n        $this->_critical(self::RESOURCE_METHOD_NOT_ALLOWED);\n    }\n\n    /**\n     * delete current {{entityLabel}}\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _set{{Entity}}({{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}) {\n        $this->_{{entity}} = ${{entity}};\n    }\n\n    /**\n     * get current {{entityLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _get{{Entity}}() {\n        if (is_null($this->_{{entity}})) {\n            ${{entity}}Id = $this->getRequest()->getParam('id');\n            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/060_eav",
    "content": "            $storeId = $this->_getStore()->getId();\n            ${{entity}}->setStoreId($storeId);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/070_load",
    "content": "            ${{entity}}->load(${{entity}}Id);\n            if (!(${{entity}}->getId())) {\n                $this->_critical(self::RESOURCE_NOT_FOUND);\n            }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/080_store",
    "content": "            if ($this->_getStore()->getId()) {\n                $isValidStore = count(array_intersect(array(0, $this->_getStore()->getId()), ${{entity}}->getStoreId()));\n                if (!$isValidStore) {\n                    $this->_critical(self::RESOURCE_NOT_FOUND);\n                }\n            }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/090_footer",
    "content": "            $this->_{{entity}} = ${{entity}};\r\n        }\r\n        return $this->_{{entity}};\r\n    }\r\n}\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/Admin/V1/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} REST API admin handler\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Api2_{{Entity}}_Rest_Admin_V1 extends {{Namespace}}_{{Module}}_Model_Api2_{{Entity}}_Rest\n{\n\n    /**\n     * Remove specified keys from associative or indexed array\n     *\n     * @access protected\n     * @param array $array\n     * @param array $keys\n     * @param bool $dropOrigKeys if true - return array as indexed array\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _filterOutArrayKeys(array $array, array $keys, $dropOrigKeys = false) {\n        $isIndexedArray = is_array(reset($array));\n        if ($isIndexedArray) {\n            foreach ($array as &$value) {\n                if (is_array($value)) {\n                    $value = array_diff_key($value, array_flip($keys));\n                }\n            }\n            if ($dropOrigKeys) {\n                $array = array_values($array);\n            }\n            unset($value);\n        } else {\n            $array = array_diff_key($array, array_flip($keys));\n        }\n        return $array;\n    }\n\n    /**\n     * Retrieve list of {{entitiesLabel}}\n     *\n     * @access protected\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _retrieveCollection() {\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection'){{allAttributesToCollection}};{{restCollectionStoreId}}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/Admin/V1/020_tree_filter",
    "content": "        $collection->{{filterMethod}}('entity_id', array('neq'=>Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()));\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/Admin/V1/030_footer",
    "content": "        $entityOnlyAttributes = $this->getEntityOnlyAttributes($this->getUserType(),\r\n            Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ);\r\n        $availableAttributes = array_keys($this->getAvailableAttributes($this->getUserType(),\r\n            Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ));\r\n        $this->_applyCollectionModifiers($collection);\r\n        ${{entities}} = $collection->load();\r\n\r\n        foreach (${{entities}} as ${{entity}}) {\r\n            $this->_set{{Entity}}(${{entity}});\r\n            $this->_prepare{{Entity}}ForResponse(${{entity}});\r\n        }\r\n        ${{entities}}Array = ${{entities}}->toArray();{{restCollectionCleanup}}\r\n        return ${{entities}}Array;\r\n    }\r\n\r\n    /**\r\n     * Delete {{entityLabel}} by its ID\r\n     *\r\n     * @access protected\r\n     * @throws Mage_Api2_Exception\r\n     * {{qwertyuiop}}\r\n     */\r\n    protected function _delete() {\r\n        ${{entity}} = $this->_get{{Entity}}();\r\n        try {\r\n            ${{entity}}->delete();\r\n        } catch (Mage_Core_Exception $e) {\r\n            $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);\r\n        } catch (Exception $e) {\r\n            $this->_critical(self::RESOURCE_INTERNAL_ERROR);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Create {{entityLabel}}\r\n     *\r\n     * @access protected\r\n     * @param array $data\r\n     * @return string\r\n     * {{qwertyuiop}}\r\n     */\r\n    protected function _create(array $data) {\r\n        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->setData($data);\r\n        try {\r\n            ${{entity}}->save();\r\n        }\r\n        catch (Mage_Core_Exception $e) {\r\n            $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);\r\n        } catch (Exception $e) {\r\n            $this->_critical(self::RESOURCE_UNKNOWN_ERROR);\r\n        }\r\n        return $this->_getLocation(${{entity}}->getId());\r\n    }\r\n\r\n    /**\r\n     * Update {{entityLabel}} by its ID\r\n     *\r\n     * @access protected\r\n     * @param array $data\r\n     * {{qwertyuiop}}\r\n     */\r\n    protected function _update(array $data) {\r\n        ${{entity}} = $this->_get{{Entity}}();\r\n        ${{entity}}->addData($data);\r\n        try {\r\n            ${{entity}}->save();\r\n        } catch (Mage_Core_Exception $e) {\r\n            $this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);\r\n        } catch (Exception $e) {\r\n            $this->_critical(self::RESOURCE_UNKNOWN_ERROR);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Set additional data before {{entityLabel}} save\r\n     *\r\n     * @access protected\r\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} $entity\r\n     * @param array ${{entity}}Data\r\n     * {{qwertyuiop}}\r\n     */\r\n    protected function _prepareDataForSave($product, $productData) {\r\n        //add your data processing algorithm here if needed\r\n    }\r\n}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/Customer/V1/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} REST API customer handler\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Api2_{{Entity}}_Rest_Customer_V1 extends {{Namespace}}_{{Module}}_Model_Api2_{{Entity}}_Rest\n{\n    /**\n     * current customer\n     * @var Mage_Customer_Model_Customer\n     */\n    protected $_customer;\n\n    /**\n     * get the current customer\n     *\n     * @access protected\n     * @return Mage_Customer_Model_Customer\n     * {{qwertyuiop}}\n     */\n    protected function _getCustomer() {\n        if (is_null($this->_customer)) {\n            $customer = Mage::getModel('customer/customer')->load($this->getApiUser()->getUserId());\n            if (!$customer->getId()) {\n                $this->_critical('Customer not found.', Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);\n            }\n            $this->_customer = $customer;\n        }\n        return $this->_customer;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Api2/Entity/Rest/Guest/V1/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} REST API guest handler\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Api2_{{Entity}}_Rest_Guest_V1 extends {{Namespace}}_{{Module}}_Model_Api2_{{Entity}}_Rest\n{\n\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Attribute/010_content",
    "content": "<?php\n{{License}}\n/**\n * attribute model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Attribute extends Mage_Eav_Model_Entity_Attribute\n{\n    const SCOPE_STORE       = 0;\n    const SCOPE_GLOBAL      = 1;\n    const SCOPE_WEBSITE     = 2;\n\n    const MODULE_NAME       = '{{Namespace}}_{{Module}}';\n    const ENTITY            = '{{namespace}}_{{module}}_eav_attribute';\n\n    /**\n     * Event prefix\n     *\n     * @var string\n     */\n    protected $_eventPrefix = '{{namespace}}_{{module}}_entity_attribute';\n\n    /**\n     * Event object name\n     *\n     * @var string\n     */\n    protected $_eventObject = 'attribute';\n\n    /**\n     * Array with labels\n     *\n     * @var array\n     */\n    static protected $_labels = null;\n\n    /**\n     * constructor\n     *\n     * @access protected\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/attribute');\n    }\n\n    /**\n     * Processing object before save data\n     *\n     * @access protected\n     * @throws Mage_Core_Exception\n     * @return Mage_Core_Model_Abstract\n     * {{qwertyuiop}}\n     */\n    protected function _beforeSave()\n    {\n        $this->setData('modulePrefix', self::MODULE_NAME);\n        if (isset($this->_origData['is_global'])) {\n            if (!isset($this->_data['is_global'])) {\n                $this->_data['is_global'] = self::SCOPE_GLOBAL;\n            }\n        }\n        if ($this->getFrontendInput() == 'textarea') {\n            if ($this->getIsWysiwygEnabled()) {\n                $this->setIsHtmlAllowedOnFront(1);\n            }\n        }\n        return parent::_beforeSave();\n    }\n\n    /**\n     * Processing object after save data\n     *\n     * @access protected\n     * @return Mage_Core_Model_Abstract\n     * {{qwertyuiop}}\n     */\n    protected function _afterSave()\n    {\n        /**\n         * Fix saving attribute in admin\n         */\n        Mage::getSingleton('eav/config')->clear();\n        return parent::_afterSave();\n    }\n\n    /**\n     * Return is attribute global\n     *\n     * @access public\n     * @return integer\n     * {{qwertyuiop}}\n     */\n    public function getIsGlobal()\n    {\n        return $this->_getData('is_global');\n    }\n\n    /**\n     * Retrieve attribute is global scope flag\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function isScopeGlobal()\n    {\n        return $this->getIsGlobal() == self::SCOPE_GLOBAL;\n    }\n\n    /**\n     * Retrieve attribute is website scope website\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function isScopeWebsite()\n    {\n        return $this->getIsGlobal() == self::SCOPE_WEBSITE;\n    }\n\n    /**\n     * Retrieve attribute is store scope flag\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function isScopeStore()\n    {\n        return !$this->isScopeGlobal() && !$this->isScopeWebsite();\n    }\n\n    /**\n     * Retrieve store id\n     *\n     * @access public\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getStoreId()\n    {\n        $dataObject = $this->getDataObject();\n        if ($dataObject) {\n            return $dataObject->getStoreId();\n        }\n        return $this->getData('store_id');\n    }\n    /**\n     * Retrieve source model\n     *\n     * @access public\n     * @return Mage_Eav_Model_Entity_Attribute_Source_Abstract\n     * {{qwertyuiop}}\n     */\n    public function getSourceModel()\n    {\n        $model = $this->getData('source_model');\n        if (empty($model)) {\n            if ($this->getBackendType() == 'int' && $this->getFrontendInput() == 'select') {\n                return $this->_getDefaultSourceModel();\n            }\n        }\n        return $model;\n    }\n\n\n    /**\n     * Retrieve not translated frontend label\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getFrontendLabel()\n    {\n        return $this->_getData('frontend_label');\n    }\n\n    /**\n     * Get Attribute translated label for store\n     *\n     * @access protected\n     * @deprecated\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _getLabelForStore()\n    {\n        return $this->getFrontendLabel();\n    }\n\n    /**\n     * Initialize store Labels for attributes\n     *\n     * @access public\n     * @param mixed $storeId\n     * @deprecated\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public static function initLabels($storeId = null)\n    {\n        if (is_null(self::$_labels)) {\n            if (is_null($storeId)) {\n                $storeId = Mage::app()->getStore()->getId();\n            }\n            $attributeLabels = array();\n            $attributes = Mage::getResourceSingleton('catalog/product')->getAttributesByCode();\n            foreach ($attributes as $attribute) {\n                if (strlen($attribute->getData('frontend_label')) > 0) {\n                    $attributeLabels[] = $attribute->getData('frontend_label');\n                }\n            }\n            self::$_labels = Mage::app()->getTranslator()\n                ->getResource()\n                ->getTranslationArrayByStrings($attributeLabels, $storeId);\n        }\n    }\n\n    /**\n     * Get default attribute source model\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function _getDefaultSourceModel()\n    {\n        return 'eav/entity_attribute_source_table';\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Attribute/Source/Country/010_content",
    "content": "<?php\n{{License}}\n/**\n * country attribute source model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Attribute_Source_Country extends Mage_Eav_Model_Entity_Attribute_Source_Abstract\n{\n    /**\n     * Get list of all available countries\n     *\n     * @access public\n     * @return mixed\n     * {{qwertyuiop}}\n     */\n    public function getAllOptions()\n    {\n        $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode();\n        if (Mage::app()->useCache('config') && $cache = Mage::app()->loadCache($cacheKey)) {\n            $options = unserialize($cache);\n        } else {\n            $collection = Mage::getModel('directory/country')->getResourceCollection();\n            $options = $collection->toOptionArray();\n            if (Mage::app()->useCache('config')) {\n                Mage::app()->saveCache(serialize($options), $cacheKey, array('config'));\n            }\n        }\n        return $options;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}} extends {{EntityParentModel}}\n{\n    /**\n     * Entity code.\n     * Can be used as part of method name for entity processing\n     */\n    const ENTITY    = '{{namespace}}_{{module}}_{{entity}}';\n    const CACHE_TAG = '{{namespace}}_{{module}}_{{entity}}';\n\n    /**\n     * Prefix of model events names\n     *\n     * @var string\n     */\n    protected $_eventPrefix = '{{namespace}}_{{module}}_{{entity}}';\n\n    /**\n     * Parameter name in event\n     *\n     * @var string\n     */\n    protected $_eventObject = '{{entity}}';\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/020_var_sibling",
    "content": "    protected $_{{sibling}}Instance = null;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/030_var_product_relation",
    "content": "    protected $_productInstance = null;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/040_var_category_relation",
    "content": "    protected $_categoryInstance = null;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/050_construct",
    "content": "\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function _construct()\n    {\n        parent::_construct();\n        $this->_init('{{namespace}}_{{module}}/{{entity}}');\n    }\n\n    /**\n     * before save {{entityLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeSave()\n    {\n        parent::_beforeSave();\n        $now = Mage::getSingleton('core/date')->gmtDate();\n        if ($this->isObjectNew()) {\n            $this->setCreatedAt($now);\n        }\n        $this->setUpdatedAt($now);\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/060_url",
    "content": "\n    /**\n     * get the url to the {{entityLabel}} details page\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Url()\n    {\n        return Mage::getUrl('{{namespace}}_{{module}}/{{entity}}/view', array('id'=>$this->getId()));\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/070_url_rewrite",
    "content": "\n    /**\n     * get the url to the {{entityLabel}} details page\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}Url()\n    {\n        if ($this->getUrlKey()) {\n            $urlKey = '';\n            if ($prefix = Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/url_prefix')) {\n                $urlKey .= $prefix.'/';\n            }\n            $urlKey .= $this->getUrlKey();\n            if ($suffix = Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/url_suffix')) {\n                $urlKey .= '.'.$suffix;\n            }\n            return Mage::getUrl('', array('_direct'=>$urlKey));\n        }\n        return Mage::getUrl('{{namespace}}_{{module}}/{{entity}}/view', array('id'=>$this->getId()));\n    }\n\n    /**\n     * check URL key\n     *\n     * @access public\n     * @param string $urlKey\n     * @param bool $active\n     * @return mixed\n     * {{qwertyuiop}}\n     */\n    public function checkUrlKey($urlKey, $active = true)\n    {\n        return $this->_getResource()->checkUrlKey($urlKey, $active);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/080_editors",
    "content": "\n    /**\n     * get the {{entityLabel}} {{attributeLabel}}\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{AttributeMagicCode}}()\n    {\n        ${{attributeCode}} = $this->getData('{{attributeCode}}');\n        $helper = Mage::helper('cms');\n        $processor = $helper->getBlockTemplateProcessor();\n        $html = $processor->filter(${{attributeCode}});\n        return $html;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/090_after_save_top",
    "content": "\n    /**\n     * save {{entityLabel}} relation\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _afterSave()\n    {\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/100_after_save_product",
    "content": "        $this->getProductInstance()->save{{Entity}}Relation($this);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/110_after_save_category",
    "content": "        $this->getCategoryInstance()->save{{Entity}}Relation($this);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/120_after_save_sibling",
    "content": "        $this->get{{Sibling}}Instance()->save{{Entity}}Relation($this);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/130_after_save_footer",
    "content": "        return parent::_afterSave();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/140_product_relation",
    "content": "\n    /**\n     * get product relation model\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Product\n     * {{qwertyuiop}}\n     */\n    public function getProductInstance()\n    {\n        if (!$this->_productInstance) {\n            $this->_productInstance = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}_product');\n        }\n        return $this->_productInstance;\n    }\n\n    /**\n     * get selected products array\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelectedProducts()\n    {\n        if (!$this->hasSelectedProducts()) {\n            $products = array();\n            foreach ($this->getSelectedProductsCollection() as $product) {\n                $products[] = $product;\n            }\n            $this->setSelectedProducts($products);\n        }\n        return $this->getData('selected_products');\n    }\n\n    /**\n     * Retrieve collection selected products\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Resource_{{Entity}}_Product_Collection\n     * {{qwertyuiop}}\n     */\n    public function getSelectedProductsCollection()\n    {\n        $collection = $this->getProductInstance()->getProductCollection($this);\n        return $collection;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/150_category_relation",
    "content": "\n    /**\n     * get category relation model\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Category\n     * {{qwertyuiop}}\n     */\n    public function getCategoryInstance()\n    {\n        if (!$this->_categoryInstance) {\n            $this->_categoryInstance = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}_category');\n        }\n        return $this->_categoryInstance;\n    }\n\n    /**\n     * get selected categories array\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelectedCategories()\n    {\n        if (!$this->hasSelectedCategories()) {\n            $categories = array();\n            foreach ($this->getSelectedCategoriesCollection() as $category) {\n                $categories[] = $category;\n            }\n            $this->setSelectedCategories($categories);\n        }\n        return $this->getData('selected_categories');\n    }\n\n    /**\n     * Retrieve collection selected categories\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Resource_{{Entity}}_Category_Collection\n     * {{qwertyuiop}}\n     */\n    public function getSelectedCategoriesCollection()\n    {\n        $collection = $this->getCategoryInstance()->getCategoryCollection($this);\n        return $collection;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/160_sibling_relation",
    "content": "\n    /**\n     * get {{siblingLabel}} relation model\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    public function get{{Sibling}}Instance()\n    {\n        if (!$this->_{{sibling}}Instance) {\n            $this->_{{sibling}}Instance = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}_{{sibling}}');\n        }\n        return $this->_{{sibling}}Instance;\n    }\n\n    /**\n     * get selected {{siblingsLabel}} array\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Siblings}}()\n    {\n        if (!$this->hasSelected{{Siblings}}()) {\n            ${{siblings}} = array();\n            foreach ($this->getSelected{{Siblings}}Collection() as ${{sibling}}) {\n                ${{siblings}}[] = ${{sibling}};\n            }\n            $this->setSelected{{Siblings}}(${{siblings}});\n        }\n        return $this->getData('selected_{{siblings}}');\n    }\n\n    /**\n     * Retrieve collection selected {{siblingsLabel}}\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_{{Sibling}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Siblings}}Collection()\n    {\n        $collection = $this->get{{Sibling}}Instance()->get{{Siblings}}Collection($this);\n        return $collection;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/163_children_relation",
    "content": "\n    /**\n     * Retrieve {{siblingsLabel}} collection\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Sibling}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function getSelected{{Siblings}}Collection()\n    {\n        if (!$this->hasData('_{{sibling}}_collection')) {\n            if (!$this->getId()) {\n                return new Varien_Data_Collection();\n            } else {\n                $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{sibling}}_collection'){{siblingAllAttributesToCollection}}\n                        ->{{siblingFilterMethod}}('{{entity}}_id', $this->getId());\n                $this->setData('_{{sibling}}_collection', $collection);\n            }\n        }\n        return $this->getData('_{{sibling}}_collection');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/165_parent_relation",
    "content": "\n    /**\n     * Retrieve parent {{siblingsLabel}}\n     *\n     * @access public\n     * @return null|{{Namespace}}_{{Module}}_Model_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    public function getParent{{Sibling}}()\n    {\n        if (!$this->hasData('_parent_{{sibling}}')) {\n            if (!$this->get{{Sibling}}Id()) {\n                return null;\n            } else {\n                ${{sibling}} = Mage::getModel('{{namespace}}_{{module}}/{{sibling}}'){{siblingLoadStoreId}}\n                    ->load($this->get{{Sibling}}Id());\n                if (${{sibling}}->getId()) {\n                    $this->setData('_parent_{{sibling}}', ${{sibling}});\n                } else {\n                    $this->setData('_parent_{{sibling}}', null);\n                }\n            }\n        }\n        return $this->getData('_parent_{{sibling}}');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/170_tree",
    "content": "\n    /**\n     * get the tree model\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     * {{qwertyuiop}}\n     */\n    public function getTreeModel()\n    {\n        return Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_tree');\n    }\n\n    /**\n     * get tree model instance\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     * {{qwertyuiop}}\n     */\n    public function getTreeModelInstance()\n    {\n        if (is_null($this->_treeModel)) {\n            $this->_treeModel = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}_tree');\n        }\n        return $this->_treeModel;\n    }\n\n    /**\n     * Move {{entityLabel}}\n     *\n     * @access public\n     * @param   int $parentId new parent {{entityLabel}} id\n     * @param   int $after{{Entity}}Id {{entityLabel}} id after which we have put current {{entityLabel}}\n     * @return  {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function move($parentId, $after{{Entity}}Id)\n    {\n        $parent = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($parentId);\n        if (!$parent->getId()) {\n            Mage::throwException(\n                Mage::helper('{{namespace}}_{{module}}')->__(\n                    '{{EntityLabel}} move operation is not possible: the new parent {{entityLabel}} was not found.'\n                )\n            );\n        }\n        if (!$this->getId()) {\n            Mage::throwException(\n                Mage::helper('{{namespace}}_{{module}}')->__(\n                    '{{EntityLabel}} move operation is not possible: the current {{entityLabel}} was not found.'\n                )\n            );\n        } elseif ($parent->getId() == $this->getId()) {\n            Mage::throwException(\n                Mage::helper('{{namespace}}_{{module}}')->__(\n                    '{{EntityLabel}} move operation is not possible: parent {{entityLabel}} is equal to child {{entityLabel}}.'\n                )\n            );\n        }\n        $this->setMoved{{Entity}}Id($this->getId());\n        $eventParams = array(\n            $this->_eventObject => $this,\n            'parent'            => $parent,\n            '{{entity}}_id'     => $this->getId(),\n            'prev_parent_id'    => $this->getParentId(),\n            'parent_id'         => $parentId\n        );\n        $moveComplete = false;\n        $this->_getResource()->beginTransaction();\n        try {\n            $this->getResource()->changeParent($this, $parent, $after{{Entity}}Id);\n            $this->_getResource()->commit();\n            $this->setAffected{{Entity}}Ids(array($this->getId(), $this->getParentId(), $parentId));\n            $moveComplete = true;\n        } catch (Exception $e) {\n            $this->_getResource()->rollBack();\n            throw $e;\n        }\n        if ($moveComplete) {\n            Mage::app()->cleanCache(array(self::CACHE_TAG));\n        }\n        return $this;\n    }\n\n    /**\n     * Get the parent {{entityLabel}}\n     *\n     * @access public\n     * @return  {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function getParent{{Entity}}()\n    {\n        if (!$this->hasData('parent_{{entity}}')) {\n            $this->setData(\n                'parent_{{entity}}',\n                Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($this->getParentId())\n            );\n        }\n        return $this->_getData('parent_{{entity}}');\n    }\n\n    /**\n     * Get the parent id\n     *\n     * @access public\n     * @return  int\n     * {{qwertyuiop}}\n     */\n    public function getParentId()\n    {\n        $parentIds = $this->getParentIds();\n        return intval(array_pop($parentIds));\n    }\n\n    /**\n     * Get all parent {{entitiesLabel}} ids\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getParentIds()\n    {\n        return array_diff($this->getPathIds(), array($this->getId()));\n    }\n\n    /**\n     * Get all {{entitiesLabel}} children\n     *\n     * @access public\n     * @param bool $asArray\n     * @return mixed (array|string)\n     * {{qwertyuiop}}\n     */\n    public function getAllChildren($asArray = false)\n    {\n        $children = $this->getResource()->getAllChildren($this);\n        if ($asArray) {\n            return $children;\n        } else {\n            return implode(',', $children);\n        }\n    }\n\n    /**\n     * Get all {{entitiesLabel}} children\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getChild{{Entities}}()\n    {\n        return implode(',', $this->getResource()->getChildren($this, false));\n    }\n\n    /**\n     * check the id\n     *\n     * @access public\n     * @param int $id\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function checkId($id)\n    {\n        return $this->_getResource()->checkId($id);\n    }\n\n    /**\n     * Get array {{entitiesLabel}} ids which are part of {{entityLabel}} path\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getPathIds()\n    {\n        $ids = $this->getData('path_ids');\n        if (is_null($ids)) {\n            $ids = explode('/', $this->getPath());\n            $this->setData('path_ids', $ids);\n        }\n        return $ids;\n    }\n\n    /**\n     * Retrieve level\n     *\n     * @access public\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getLevel()\n    {\n        if (!$this->hasLevel()) {\n            return count(explode('/', $this->getPath())) - 1;\n        }\n        return $this->getData('level');\n    }\n\n    /**\n     * Verify {{entityLabel}} ids\n     *\n     * @access public\n     * @param array $ids\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function verifyIds(array $ids)\n    {\n        return $this->getResource()->verifyIds($ids);\n    }\n\n    /**\n     * check if {{entityLabel}} has children\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function hasChildren()\n    {\n        return $this->_getResource()->getChildrenAmount($this) > 0;\n    }\n\n    /**\n     * check if {{entityLabel}} can be deleted\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeDelete()\n    {\n        if ($this->getResource()->isForbiddenToDelete($this->getId())) {\n            Mage::throwException(Mage::helper('{{namespace}}_{{module}}')->__(\"Can't delete root {{entityLabel}}.\"));\n        }\n        return parent::_beforeDelete();\n    }\n\n    /**\n     * get the {{entitiesLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} $parent\n     * @param int $recursionLevel\n     * @param bool $sorted\n     * @param bool $asCollection\n     * @param bool $toLoad\n     * {{qwertyuiop}}\n     */\n    public function get{{Entities}}($parent, $recursionLevel = 0, $sorted=false, $asCollection=false, $toLoad=true)\n    {\n        return $this->getResource()->get{{Entities}}($parent, $recursionLevel, $sorted, $asCollection, $toLoad);\n    }\n\n    /**\n     * Return parent {{entitiesLabel}} of current {{entityLabel}}\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getParent{{Entities}}()\n    {\n        return $this->getResource()->getParent{{Entities}}($this);\n    }\n\n    /**\n     * Return children {{entitiesLabel}} of current {{entityLabel}}\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getChildren{{Entities}}()\n    {\n        return $this->getResource()->getChildren{{Entities}}($this);\n    }\n\n    /**\n     * check if parents are enabled\n     *\n     * @access public\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function getStatusPath()\n    {\n        $parents = $this->getParent{{Entities}}();\n        $rootId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n        foreach ($parents as $parent) {\n            if ($parent->getId() == $rootId) {\n                continue;\n            }\n            if (!$parent->getStatus()) {\n                return false;\n            }\n        }\n        return $this->getStatus();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/175_eav_default_attribute_set",
    "content": "\n    /**\n     * Retrieve default attribute set id\n     *\n     * @access public\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getDefaultAttributeSetId()\n    {\n        return $this->getResource()->getEntityType()->getDefaultAttributeSetId();\n    }\n\n    /**\n     * get attribute text value\n     *\n     * @access public\n     * @param $attributeCode\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getAttributeText($attributeCode)\n    {\n        $text = $this->getResource()\n            ->getAttribute($attributeCode)\n            ->getSource()\n            ->getOptionText($this->getData($attributeCode));\n        if (is_array($text)) {\n            return implode(', ', $text);\n        }\n        return $text;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/180_allow_comment",
    "content": "\n    /**\n     * check if comments are allowed\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getAllowComments()\n    {\n        if ($this->getData('allow_comment') == {{Namespace}}_{{Module}}_Model_Adminhtml_Source_Yesnodefault::NO) {\n            return false;\n        }\n        if ($this->getData('allow_comment') == {{Namespace}}_{{Module}}_Model_Adminhtml_Source_Yesnodefault::YES) {\n            return true;\n        }\n        return Mage::getStoreConfigFlag('{{namespace}}_{{module}}/{{entity}}/allow_comment');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/190_default_values",
    "content": "\n    /**\n     * get default values\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getDefaultValues()\n    {\n        $values = array();\n        $values['status'] = 1;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/200_default_values_rss",
    "content": "        $values['in_rss'] = 1;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/210_default_values_comment",
    "content": "        $values['allow_comment'] = {{Namespace}}_{{Module}}_Model_Adminhtml_Source_Yesnodefault::USE_DEFAULT;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/215_default_attribute_values",
    "content": "{{defaultAttributeValues}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/220_footer",
    "content": "        return $values;\n    }\n    {{multiselectMethods}}\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/010_top",
    "content": "<?php\n{{License}}\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Api extends Mage_Api_Model_Resource_Abstract\n{\n{{defaultApiAttributes}}\n\n    /**\n     * init {{entityLabel}}\n     *\n     * @access protected\n     * @param ${{entity}}Id\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _init{{Entity}}(${{entity}}Id)\n    {\n        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id);\n        if (!${{entity}}->getId()) {\n            $this->_fault('{{entity}}_not_exists');\n        }\n        return ${{entity}};\n    }\n\n    /**\n     * get {{entitiesLabel}}\n     *\n     * @access public\n     * @param mixed $filters\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function items($filters = null)\n    {\n        $collection = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->getCollection()"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/013_eav",
    "content": "\n            ->addAttributeToSelect('*')"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/014_tree_filter",
    "content": "\n            ->{{filterMethod}}(\n                'entity_id',\n                array(\n                    'neq'=>Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()\n                )\n            )"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/016_content",
    "content": ";\n        $apiHelper = Mage::helper('api');\n        $filters = $apiHelper->parseFilters($filters);\n        try {\n            foreach ($filters as $field => $value) {\n                $collection->addFieldToFilter($field, $value);\n            }\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('filters_invalid', $e->getMessage());\n        }\n        $result = array();\n        foreach ($collection as ${{entity}}) {\n            $result[] = $this->_getApiData(${{entity}});\n        }\n        return $result;\n    }\n\n    /**\n     * Add {{entityLabel}}\n     *\n     * @access public\n     * @param array $data\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function add($data)\n    {\n        try {\n            if (is_null($data)) {\n                throw new Exception(Mage::helper('{{namespace}}_{{module}}')->__(\"Data cannot be null\"));\n            }\n            $data = (array)$data;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/017_add_eav",
    "content": "            if (isset($data['additional_attributes']) && is_array($data['additional_attributes'])) {\n                foreach ($data['additional_attributes'] as $key=>$value) {\n                    $data[$key] = $value;\n                }\n                unset($data['additional_attributes']);\n            }\n            $data['attribute_set_id'] = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->getDefaultAttributeSetId();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/018_add_end",
    "content": "            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n                ->setData((array)$data)\n                ->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        } catch (Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return ${{entity}}->getId();\n    }\n\n    /**\n     * Change existing {{entityLabel}} information\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param array $data\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function update(${{entity}}Id, $data)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        try {\n            $data = (array)$data;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/019_update_eav",
    "content": "            if (isset($data['additional_attributes']) && is_array($data['additional_attributes'])) {\r\n                foreach ($data['additional_attributes'] as $key=>$value) {\r\n                    $data[$key] = $value;\r\n                }\r\n                unset($data['additional_attributes']);\r\n            }\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/020_update_footer",
    "content": "            ${{entity}}->addData($data);\n            ${{entity}}->save();\n        }\n        catch (Mage_Core_Exception $e) {\n            $this->_fault('save_error', $e->getMessage());\n        }\n\n        return true;\n    }\n\n    /**\n     * remove {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function remove(${{entity}}Id)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        try {\n            ${{entity}}->delete();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('remove_error', $e->getMessage());\n        }\n        return true;\n    }\n\n    /**\n     * get info\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function info(${{entity}}Id)\n    {\n        $result = array();\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        $result = $this->_getApiData(${{entity}});\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/024_product_relation_info",
    "content": "        //related products\n        $result['products'] = array();\n        $relatedProductsCollection = ${{entity}}->getSelectedProductsCollection();\n        foreach ($relatedProductsCollection as $product) {\n            $result['products'][$product->getId()] = $product->getPosition();\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/030_category_relation_info",
    "content": "        //related categories\n        $result['categories'] = array();\n        $relatedCategoriesCollection = ${{entity}}->getSelectedCategoriesCollection();\n        foreach ($relatedCategoriesCollection as $category) {\n            $result['categories'][$category->getId()] = $category->getPosition();\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/040_sibling_info",
    "content": "        //related {{siblings}}\n        $result['{{siblings}}'] = array();\n        $related{{Siblings}}Collection = ${{entity}}->getSelected{{Siblings}}Collection();\n        foreach ($related{{Siblings}}Collection as ${{sibling}}) {\n            $result['{{siblings}}'][${{sibling}}->getId()] = ${{sibling}}->getPosition();\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/050_info_footer",
    "content": "        return $result;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/060_tree",
    "content": "\n    /**\n     * Move {{entityLabel}} in tree\n     *\n     * @param int ${{entity}}Id\n     * @param int $parentId\n     * @param int $afterId\n     * @return boolean\n     */\n    public function move(${{entity}}Id, $parentId, $afterId = null)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        $parent{{Entity}} = $this->_init{{Entity}}($parentId);\n        if ($afterId === null && $parent{{Entity}}->hasChildren()) {\n            $parentChildren = $parent{{Entity}}->getChild{{Entities}}();\n            $afterId = array_pop(explode(',', $parentChildren));\n        }\n        if ( strpos($parent{{Entity}}->getPath(), ${{entity}}->getPath()) === 0) {\n            $this->_fault(\n                'not_moved',\n                Mage::helper('{{namespace}}_{{module}}')->__(\"Cannot move parent inside {{entityLabel}}\")\n            );\n        }\n        try {\n            ${{entity}}->move($parentId, $afterId);\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('not_moved', $e->getMessage());\n        }\n        return true;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/070_product_relation",
    "content": "    /**\n     * Assign product to {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param int $productId\n     * @param int $position\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function assignProduct(${{entity}}Id, $productId, $position = null)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        $positions    = array();\n        $products     = ${{entity}}->getSelectedProducts();\n        foreach ($products as $product) {\n            $positions[$product->getId()] = array('position'=>$product->getPosition());\n        }\n        $product = Mage::getModel('catalog/product')->load($productId);\n        if (!$product->getId()) {\n            $this->_fault('product_not_exists');\n        }\n        $positions[$productId]['position'] = $position;\n        ${{entity}}->setProductsData($positions);\n        try {\n            ${{entity}}->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n\n    /**\n     * remove product from {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param int $productId\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function unassignProduct(${{entity}}Id, $productId)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        $positions    = array();\n        $products     = ${{entity}}->getSelectedProducts();\n        foreach ($products as $product) {\n            $positions[$product->getId()] = array('position'=>$product->getPosition());\n        }\n        unset($positions[$productId]);\n        ${{entity}}->setProductsData($positions);\n        try {\n            ${{entity}}->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/080_category_relation",
    "content": "\n    /**\n     * Assign category to {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param int $categoryId\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function assignCategory(${{entity}}Id, $categoryId)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        $category   = Mage::getModel('catalog/category')->load($categoryId);\n        if (!$category->getId()) {\n            $this->_fault('category_not_exists');\n        }\n        $categories = ${{entity}}->getSelectedCategories();\n        $categoryIds = array();\n        foreach ($categories as $category) {\n            $categoryIds[] = $category->getId();\n        }\n        $categoryIds[] = $categoryId;\n        ${{entity}}->setCategoriesData($categoryIds);\n        try {\n            ${{entity}}->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n\n    /**\n     * remove category from {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param int $categoryId\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function unassignCategory(${{entity}}Id, $categoryId)\n    {\n        ${{entity}}    = $this->_init{{Entity}}(${{entity}}Id);\n        $categories    = ${{entity}}->getSelectedCategories();\n        $categoryIds   = array();\n        foreach ($categories as $key=>$category) {\n            if ($category->getId() != $categoryId) {\n                $categoryIds[] = $category->getId();\n            }\n        }\n        ${{entity}}->setCategoriesData($categoryIds);\n        try {\n            ${{entity}}->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/090_sibling_relation",
    "content": "\n    /**\n     * Assign {{siblingLabel}} to {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param int ${{sibling}}Id\n     * @param int $position\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function assign{{Sibling}}(${{entity}}Id, ${{sibling}}Id, $position = null)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        $positions    = array();\n        ${{siblings}}     = ${{entity}}->getSelected{{Siblings}}();\n        foreach (${{siblings}} as ${{sibling}}) {\n            ${{siblings}}[${{sibling}}->getId()] = array('position'=>${{sibling}}->getPosition());\n        }\n        ${{sibling}} = Mage::getModel('{{namespace}}_{{module}}/{{sibling}}')->load(${{sibling}}Id);\n        if (!${{sibling}}->getId()) {\n            $this->_fault('{{entity}}_{{sibling}}_not_exists');\n        }\n        $positions[${{sibling}}Id]['position'] = $position;\n        ${{sibling}}->set{{Siblings}}Data($positions);\n        try {\n            ${{sibling}}->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n\n    /**\n     * remove {{siblingLabel}} from {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param int ${{sibling}}Id\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function unassign{{Sibling}}(${{entity}}Id, ${{sibling}}Id)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        $positions    = array();\n        ${{siblings}}     = ${{entity}}->getSelected{{Siblings}}();\n        foreach (${{siblings}} as ${{sibling}}) {\n            ${{siblings}}[${{sibling}}->getId()] = array('position'=>${{sibling}}->getPosition());\n        }\n        unset($positions[${{sibling}}Id]);\n        ${{entity}}->set{{Siblings}}Data($positions);\n        try {\n            ${{entity}}->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/095_sibling_relation_tree",
    "content": "\n    /**\n     * Assign {{siblingLabel}} to {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param int ${{sibling}}Id\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function assign{{Sibling}}(${{entity}}Id, ${{sibling}}Id)\n    {\n        ${{entity}} = $this->_init{{Entity}}(${{entity}}Id);\n        ${{sibling}}   = Mage::getModel('{{namespace}}_{{module}}/{{sibling}}')->load(${{sibling}}Id);\n        if (!${{sibling}}->getId()) {\n            $this->_fault('{{sibling}}_not_exists');\n        }\n        ${{siblings}} = ${{entity}}->getSelected{{Siblings}}();\n        ${{sibling}}Ids = array();\n        foreach (${{siblings}} as ${{sibling}}) {\n            ${{sibling}}Ids[] = ${{sibling}}->getId();\n        }\n        ${{sibling}}Ids[] = ${{sibling}}Id;\n        ${{entity}}->set{{Siblings}}Data(${{sibling}}Ids);\n        try {\n            ${{entity}}->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n\n    /**\n     * remove {{siblingLabel}} from {{entityLabel}}\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @param int ${{sibling}}Id\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function unassign{{Sibling}}(${{entity}}Id, ${{sibling}}Id)\n    {\n        ${{entity}}      = $this->_init{{Entity}}(${{entity}}Id);\n        ${{siblings}}    = ${{entity}}->getSelected{{Siblings}}();\n        ${{sibling}}Ids  = array();\n        foreach (${{siblings}} as $key=>${{sibling}}) {\n            if (${{sibling}}->getId() != ${{sibling}}Id) {\n                ${{sibling}}Ids[] = ${{sibling}}->getId();\n            }\n        }\n        ${{entity}}->set{{Siblings}}Data(${{sibling}}Ids);\n        try {\n            ${{entity}}->save();\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/097_get_attributes",
    "content": "\n    /**\n     * Get list of additional attributes which are not in default create/update list\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getAdditionalAttributes()\n    {\n        $entity = Mage::getModel('eav/entity_type')->load('{{namespace}}_{{module}}_{{entity}}', 'entity_type_code');\n        $attributes = Mage::getResourceModel('eav/entity_attribute_collection')\n            ->setEntityTypeFilter($entity->getEntityTypeId());\n        $result = array();\n        foreach ($attributes as $attribute) {\n            if (!in_array($attribute->getAttributeCode(), $this->_defaultAttributeList)) {\n                if ($attribute->getIsGlobal() == {{Namespace}}_{{Module}}_Model_Attribute::SCOPE_GLOBAL) {\n                    $scope = 'global';\n                } elseif ($attribute->getIsGlobal() == {{Namespace}}_{{Module}}_Model_Attribute::SCOPE_WEBSITE) {\n                    $scope = 'website';\n                } else {\n                    $scope = 'store';\n                }\n\n                $result[] = array(\n                    'attribute_id' => $attribute->getId(),\n                    'code'         => $attribute->getAttributeCode(),\n                    'type'         => $attribute->getFrontendInput(),\n                    'required'     => $attribute->getIsRequired(),\n                    'scope'        => $scope\n                );\n            }\n        }\n\n        return $result;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/098_get_api_data_flat",
    "content": "\n    /**\n     * get data for api\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return array()\n     * {{qwertyuiop}}\n     */\n    protected function _getApiData({{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}})\n    {\n        return ${{entity}}->getData();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/099_get_api_data_eav",
    "content": "\n    /**\n     * get data for api\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return array()\n     * {{qwertyuiop}}\n     */\n    protected function _getApiData({{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}})\n    {\n        $data = array();\n        $additional = array();\n        $additionalAttributes = $this->getAdditionalAttributes();\n        $additionalByCode = array();\n        foreach ($additionalAttributes as $attribute) {\n            $additionalByCode[] = $attribute['code'];\n        }\n        foreach (${{entity}}->getData() as $key=>$value) {\n            if (!in_array($key, $additionalByCode)) {\n                $data[$key] = $value;\n            } else {\n                $additional[] = array('key'=>$key, 'value'=>$value);\n            }\n        }\n        if (!empty($additional)) {\n            $data['additional_attributes'] = $additional;\n        }\n        return $data;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/100_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/V2/010_top",
    "content": "<?php\n{{License}}\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Api_V2 extends {{Namespace}}_{{Module}}_Model_{{Entity}}_Api\n{\n    /**\n     * {{EntityLabel}} info\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return object\n     * {{qwertyuiop}}\n     */\n    public function info(${{entity}}Id)\n    {\n        $result = parent::info(${{entity}}Id);\n        $result = Mage::helper('api')->wsiArrayPacker($result);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/V2/020_product_relation",
    "content": "        foreach ($result->products as $key => $value) {\r\n            $result->products[$key] = array('key' => $key, 'value' => $value);\r\n        }\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/V2/030_category_relation",
    "content": "        foreach ($result->categories as $key => $value) {\n            $result->categories[$key] = array('key' => $key, 'value' => $value);\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/V2/040_sibling_relation",
    "content": "        foreach ($result->{{siblings}} as $key => $value) {\n            $result->{{siblings}}[$key] = array('key' => $key, 'value' => $value);\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Api/V2/050_footer",
    "content": "        return $result;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Attribute/Api/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} attribute API model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Attribute_Api extends Mage_Catalog_Model_Api_Resource\n{\n    /**\n     * {{EntityLabel}} entity type id\n     *\n     * @var int\n     */\n    protected $_entityTypeId;\n\n    /**\n     * Constructor. Initializes default values.\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        $this->_storeIdSessionField = '{{entity}}_store_id';\n        $this->_entityTypeId = Mage::getModel('eav/entity')->setType('{{namespace}}_{{module}}_{{entity}}')\n            ->getTypeId();\n    }\n\n    /**\n     * Retrieve attributes\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function items()\n    {\n        $attributes = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_attribute_collection');\n        $result = array();\n        foreach ($attributes as $attribute) {\n            if ($this->_isAllowedAttribute($attribute)) {\n                if (!$attribute->getId() || $attribute->getIsGlobal() == {{Namespace}}_{{Module}}_Model_Attribute::SCOPE_GLOBAL) {\n                    $scope = 'global';\n                } elseif ($attribute->getIsGlobal() == {{Namespace}}_{{Module}}_Model_Attribute::SCOPE_WEBSITE) {\n                    $scope = 'website';\n                } else {\n                    $scope = 'store';\n                }\n\n                $result[] = array(\n                    'attribute_id' => $attribute->getId(),\n                    'code'         => $attribute->getAttributeCode(),\n                    'type'         => $attribute->getFrontendInput(),\n                    'required'     => $attribute->getIsRequired(),\n                    'scope'        => $scope\n                );\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * Retrieve attribute options\n     *\n     * @access public\n     * @param int $attributeId\n     * @param string|int $store\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function options($attributeId, $store = null)\n    {\n        $storeId = $this->_getStoreId($store);\n        $attribute = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n            ->setStoreId($storeId)\n            ->getResource()\n            ->getAttribute($attributeId);\n        if (!$attribute) {\n            $this->_fault('not_exists');\n        }\n        $options = array();\n        if ($attribute->usesSource()) {\n            foreach ($attribute->getSource()->getAllOptions() as $optionId => $optionValue) {\n                if (is_array($optionValue)) {\n                    $options[] = $optionValue;\n                } else {\n                    $options[] = array(\n                        'value' => $optionId,\n                        'label' => $optionValue\n                    );\n                }\n            }\n        }\n        return $options;\n    }\n\n    /**\n     * Retrieve list of possible attribute types\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function types()\n    {\n        $types = Mage::getModel('eav/adminhtml_system_config_source_inputtype')->toOptionArray();\n        $additionalTypes = array(\n            array(\n                'value' => 'image',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('Image')\n            ),\n            array(\n                'value' => 'file',\n                'label' => Mage::helper('{{namespace}}_{{module}}')->__('File')\n            )\n        );\n        return array_merge($types, $additionalTypes);\n    }\n\n    /**\n     * Create new product attribute\n     *\n     * @access public\n     * @param array $data input data\n     * @return integer\n     * {{qwertyuiop}}\n     */\n    public function create($data)\n    {\n        $model = Mage::getModel('{{namespace}}_{{module}}/resource_eav_attribute');\n        $helper = Mage::helper('{{namespace}}_{{module}}/{{entity}}');\n\n        if (empty($data['attribute_code']) || !is_array($data['frontend_label'])) {\n            $this->_fault('invalid_parameters');\n        }\n\n        //validate attribute_code\n        if (!preg_match('/^[a-z][a-z_0-9]{0,254}$/', $data['attribute_code'])) {\n            $this->_fault('invalid_code');\n        }\n\n        //validate frontend_input\n        $allowedTypes = array();\n        foreach ($this->types() as $type) {\n            $allowedTypes[] = $type['value'];\n        }\n        if (!in_array($data['frontend_input'], $allowedTypes)) {\n            $this->_fault('invalid_frontend_input');\n        }\n\n        $data['source_model'] = $helper->getAttributeSourceModelByInputType($data['frontend_input']);\n        $data['backend_model'] = $helper->getAttributeBackendModelByInputType($data['frontend_input']);\n        if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) {\n            $data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);\n        }\n\n        $this->_prepareDataForSave($data);\n\n        $model->addData($data);\n        $model->setEntityTypeId($this->_entityTypeId);\n        $model->setIsUserDefined(1);\n        $model->setIsVisible(1);\n\n        try {\n            $model->save();\n            // clear translation cache because attribute labels are stored in translation\n            Mage::app()->cleanCache(array(Mage_Core_Model_Translate::CACHE_TAG));\n        } catch (Exception $e) {\n            $this->_fault('unable_to_save', $e->getMessage());\n        }\n\n        return (int) $model->getId();\n    }\n\n    /**\n     * Update product attribute\n     *\n     * @access public\n     * @param string|integer $attribute attribute code or ID\n     * @param array $data\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function update($attribute, $data)\n    {\n        $model = $this->_getAttribute($attribute);\n        if ($model->getEntityTypeId() != $this->_entityTypeId) {\n            $this->_fault('can_not_edit');\n        }\n        $data['attribute_code'] = $model->getAttributeCode();\n        $data['is_user_defined'] = $model->getIsUserDefined();\n        $data['frontend_input'] = $model->getFrontendInput();\n\n        $this->_prepareDataForSave($data);\n\n        $model->addData($data);\n        try {\n            $model->save();\n            // clear translation cache because attribute labels are stored in translation\n            Mage::app()->cleanCache(array(Mage_Core_Model_Translate::CACHE_TAG));\n            return true;\n        } catch (Exception $e) {\n            $this->_fault('unable_to_save', $e->getMessage());\n        }\n    }\n\n    /**\n     * Remove attribute\n     *\n     * @access public\n     * @param integer|string $attribute attribute ID or code\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function remove($attribute)\n    {\n        $model = $this->_getAttribute($attribute);\n        if ($model->getEntityTypeId() != $this->_entityTypeId) {\n            $this->_fault('can_not_delete');\n        }\n        try {\n            $model->delete();\n            return true;\n        } catch (Exception $e) {\n            $this->_fault('can_not_delete', $e->getMessage());\n        }\n    }\n\n    /**\n     * Get full information about attribute with list of options\n     *\n     * @access pubic\n     * @param integer|string $attribute attribute ID or code\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function info($attribute)\n    {\n        $model = $this->_getAttribute($attribute);\n        if ($model->isScopeGlobal()) {\n            $scope = 'global';\n        } elseif ($model->isScopeWebsite()) {\n            $scope = 'website';\n        } else {\n            $scope = 'store';\n        }\n        $frontendLabels = array(\n            array(\n                'store_id' => 0,\n                'label'    => $model->getFrontendLabel()\n            )\n        );\n        foreach ($model->getStoreLabels() as $storeId => $label) {\n            $frontendLabels[] = array(\n                'store_id' => $storeId,\n                'label'    => $label\n            );\n        }\n        $result = array(\n            'attribute_id'   => $model->getId(),\n            'attribute_code' => $model->getAttributeCode(),\n            'frontend_input' => $model->getFrontendInput(),\n            'default_value'  => $model->getDefaultValue(),\n            'is_unique'      => $model->getIsUnique(),\n            'is_required'    => $model->getIsRequired(),\n            'frontend_label' => $frontendLabels\n        );\n        // set additional fields to different types\n        switch ($model->getFrontendInput()) {\n            case 'text':\n                $result['additional_fields'] = array(\n                    'frontend_class' => $model->getFrontendClass(),\n                );\n                break;\n            case 'textarea':\n                $result['additional_fields'] = array(\n                    'is_wysiwyg_enabled' => $model->getIsWysiwygEnabled(),\n                );\n                break;\n            case 'date':\n            default:\n                $result['additional_fields'] = array();\n                break;\n        }\n\n        // set options\n        $options = $this->options($model->getId());\n        // remove empty first element\n        if ($model->getFrontendInput() != 'boolean') {\n            array_shift($options);\n        }\n\n        if (count($options) > 0) {\n            $result['options'] = $options;\n        }\n\n        return $result;\n    }\n\n    /**\n     * Add option to select or multiselect attribute\n     *\n     * @access public\n     * @param  integer|string $attribute attribute ID or code\n     * @param  array $data\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function addOption($attribute, $data)\n    {\n        $model = $this->_getAttribute($attribute);\n        if (!$model->usesSource()) {\n            $this->_fault('invalid_frontend_input');\n        }\n\n        /** @var $helperCatalog Mage_Catalog_Helper_Data */\n        $helperCatalog = Mage::helper('catalog');\n\n        $optionLabels = array();\n        foreach ($data['label'] as $label) {\n            $storeId = $label['store_id'];\n            $labelText = $helperCatalog->stripTags($label['value']);\n            if (is_array($storeId)) {\n                foreach ($storeId as $multiStoreId) {\n                    $optionLabels[$multiStoreId] = $labelText;\n                }\n            } else {\n                $optionLabels[$storeId] = $labelText;\n            }\n        }\n        $modelData = array(\n            'option' => array(\n                'value' => array(\n                    'option_1' => $optionLabels\n                ),\n                'order' => array(\n                    'option_1' => (int) $data['order']\n                )\n            )\n        );\n        $model->addData($modelData);\n        try {\n            $model->save();\n        } catch (Exception $e) {\n            $this->_fault('unable_to_add_option', $e->getMessage());\n        }\n\n        return true;\n    }\n\n    /**\n     * Remove option from select or multiselect attribute\n     *\n     * @access public\n     * @param  integer|string $attribute attribute ID or code\n     * @param  integer $optionId option to remove ID\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function removeOption($attribute, $optionId)\n    {\n        $model = $this->_getAttribute($attribute);\n        if (!$model->usesSource()) {\n            $this->_fault('invalid_frontend_input');\n        }\n        $modelData = array(\n            'option' => array(\n                'value' => array(\n                    $optionId => array()\n                ),\n                'delete' => array(\n                    $optionId => '1'\n                )\n            )\n        );\n        $model->addData($modelData);\n        try {\n            $model->save();\n        } catch (Exception $e) {\n            $this->_fault('unable_to_remove_option', $e->getMessage());\n        }\n\n        return true;\n    }\n\n    /**\n     * Prepare request input data for saving\n     *\n     * @access protected\n     * @param array $data input data\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _prepareDataForSave(&$data)\n    {\n        /** @var $helperCatalog Mage_Catalog_Helper_Data */\n        $helperCatalog = Mage::helper('catalog');\n\n        if ($data['scope'] == 'global') {\n            $data['is_global'] = Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL;\n        } else if ($data['scope'] == 'website') {\n            $data['is_global'] = Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE;\n        } else {\n            $data['is_global'] = Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE;\n        }\n        // set frontend labels array with store_id as keys\n        if (isset($data['frontend_label']) && is_array($data['frontend_label'])) {\n            $labels = array();\n            foreach ($data['frontend_label'] as $label) {\n                $storeId = $label['store_id'];\n                $labelText = $helperCatalog->stripTags($label['label']);\n                $labels[$storeId] = $labelText;\n            }\n            $data['frontend_label'] = $labels;\n        }\n        // set additional fields\n        if (isset($data['additional_fields']) && is_array($data['additional_fields'])) {\n            $data = array_merge($data, $data['additional_fields']);\n            unset($data['additional_fields']);\n        }\n        //default value\n        if (!empty($data['default_value'])) {\n            $data['default_value'] = $helperCatalog->stripTags($data['default_value']);\n        }\n    }\n\n    /**\n     * Load model by attribute ID or code\n     *\n     * @param integer|string $attribute\n     * @return Mage_Catalog_Model_Resource_Eav_Attribute\n     * {{qwertyuiop}}\n     */\n    protected function _getAttribute($attribute)\n    {\n        $model = Mage::getResourceModel('{{namespace}}_{{module}}/eav_attribute')\n            ->setEntityTypeId($this->_entityTypeId);\n\n        if (is_numeric($attribute)) {\n            $model->load(intval($attribute));\n        } else {\n            $model->load($attribute, 'attribute_code');\n        }\n\n        if (!$model->getId()) {\n            $this->_fault('not_exists');\n        }\n\n        return $model;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Attribute/Api/V2/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} attribute API V2 model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Attribute_Api_V2 extends {{Namespace}}_{{Module}}_Model_{{Entity}}_Attribute_Api\n{\n    /**\n     * Create new {{entityLabel}} attribute\n     *\n     * @access public\n     * @param array $data input data\n     * @return integer\n     * {{qwertyuiop}}\n     */\n    public function create($data)\n    {\n        $helper = Mage::helper('api');\n        $helper->v2AssociativeArrayUnpacker($data);\n        Mage::helper('api')->toArray($data);\n        return parent::create($data);\n    }\n\n    /**\n     * Update product attribute\n     *\n     * @access public\n     * @param string|integer $attribute attribute code or ID\n     * @param array $data\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function update($attribute, $data)\n    {\n        $helper = Mage::helper('api');\n        $helper->v2AssociativeArrayUnpacker($data);\n        Mage::helper('api')->toArray($data);\n        return parent::update($attribute, $data);\n    }\n\n    /**\n     * Add option to select or multiselect attribute\n     *\n     * @access public\n     * @param  integer|string $attribute attribute ID or code\n     * @param  array $data\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function addOption($attribute, $data)\n    {\n        Mage::helper('api')->toArray($data);\n        return parent::addOption($attribute, $data);\n    }\n\n    /**\n     * Get full information about attribute with list of options\n     *\n     * @access public\n     * @param integer|string $attribute attribute ID or code\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function info($attribute)\n    {\n        $result = parent::info($attribute);\n        if (!empty($result['additional_fields'])) {\n            $keys = array_keys($result['additional_fields']);\n            foreach ($keys as $key) {\n                $result['additional_fields'][] = array(\n                    'key'   => $key,\n                    'value' => $result['additional_fields'][$key]\n                );\n                unset($result['additional_fields'][$key]);\n            }\n        }\n        return $result;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Attribute/Backend/File/010_content",
    "content": "<?php\n{{License}}\n/**\n * Admin backend source model for files\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Attribute_Backend_File extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract\n{\n\n    /**\n     * Save uploaded file and set its name to {{entityLabel}} object\n     *\n     * @access public\n     * @param Varien_Object $object\n     * @return null\n     * {{qwertyuiop}}\n     */\n    public function afterSave($object)\n    {\n        $value = $object->getData($this->getAttribute()->getName());\n        if (is_array($value) && !empty($value['delete'])) {\n            $object->setData($this->getAttribute()->getName(), '');\n            $this->getAttribute()->getEntity()\n                ->saveAttribute($object, $this->getAttribute()->getName());\n            return;\n        }\n\n        $path = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getFileBaseDir();\n\n        try {\n            $uploader = new Varien_File_Uploader($this->getAttribute()->getName());\n            //set allowed file extensions if you need\n            //$uploader->setAllowedExtensions(array('mp4', 'mov', 'f4v', 'flv'));\n            $uploader->setAllowRenameFiles(true);\n            $uploader->setFilesDispersion(true);\n            $result = $uploader->save($path);\n            $object->setData($this->getAttribute()->getName(), $result['file']);\n            $this->getAttribute()->getEntity()->saveAttribute($object, $this->getAttribute()->getName());\n        } catch (Exception $e) {\n            if ($e->getCode() != 666) {\n                //throw $e;\n            }\n            return;\n        }\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Attribute/Backend/Image/010_content",
    "content": "<?php\n{{License}}\n/**\n * Admin backend source model for images\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Attribute_Backend_Image extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract\n{\n\n    /**\n     * Save uploaded file and set its name to {{entityLabel}} object\n     *\n     * @access public\n     * @param Varien_Object $object\n     * @return null\n     * {{qwertyuiop}}\n     */\n    public function afterSave($object)\n    {\n        $value = $object->getData($this->getAttribute()->getName());\n        if (is_array($value) && !empty($value['delete'])) {\n            $object->setData($this->getAttribute()->getName(), '');\n            $this->getAttribute()->getEntity()\n                ->saveAttribute($object, $this->getAttribute()->getName());\n            return;\n        }\n\n        $path = Mage::helper('{{namespace}}_{{module}}/{{entity}}_image')->getImageBaseDir();\n\n        try {\n            $uploader = new Varien_File_Uploader($this->getAttribute()->getName());\n            $uploader->setAllowRenameFiles(true);\n            $uploader->setFilesDispersion(true);\n            $result = $uploader->save($path);\n            $object->setData($this->getAttribute()->getName(), $result['file']);\n            $this->getAttribute()->getEntity()->saveAttribute($object, $this->getAttribute()->getName());\n        } catch (Exception $e) {\n            if ($e->getCode() != 666) {\n                //throw $e;\n            }\n            return;\n        }\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Attribute/Backend/Urlkey/010_content",
    "content": "<?php\n{{License}}\n/**\n * Admin backend source model for url key\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Attribute_Backend_Urlkey extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract\n{\n    /**\n     * Before save\n     *\n     * @access public\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Attribute_Backend_Urlkey\n     * {{qwertyuiop}}\n     */\n    public function beforeSave($object)\n    {\n        $attributeName = $this->getAttribute()->getName();\n        $urlKey = $object->getData($attributeName);\n        if ($urlKey == '') {\n            $urlKey = $object->get{{EntityNameMagicCode}}();\n        }\n        $urlKey = $this->formatUrlKey($urlKey);\n        $validKey = false;\n        while (!$validKey) {\n            $entityId = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}')\n                ->checkUrlKey($urlKey, $object->getStoreId(), false);\n            if ($entityId == $object->getId() || empty($entityId)) {\n                $validKey = true;\n            } else {\n                $parts = explode('-', $urlKey);\n                $last = $parts[count($parts) - 1];\n                if (!is_numeric($last)) {\n                    $urlKey = $urlKey.'-1';\n                } else {\n                    $suffix = '-'.($last + 1);\n                    unset($parts[count($parts) - 1]);\n                    $urlKey = implode('-', $parts).$suffix;\n                }\n            }\n        }\n        $object->setData($attributeName, $urlKey);\n        return $this;\n    }\n\n    /**\n     * format url key\n     *\n     * @access public\n     * @param string $str\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function formatUrlKey($str)\n    {\n        $urlKey = preg_replace('#[^0-9a-z]+#i', '-', Mage::helper('catalog/product_url')->format($str));\n        $urlKey = strtolower($urlKey);\n        $urlKey = trim($urlKey, '-');\n        return $urlKey;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Attribute/Source/Attributecode/010_content",
    "content": "<?php\n{{License}}\n/**\n * Admin source model for {{attributeLabel}}\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Attribute_Source_{{AttributeCodeForFile}} extends Mage_Eav_Model_Entity_Attribute_Source_Table\n{\n    /**\n     * get possible values\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @param bool $defaultValues\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getAllOptions($withEmpty = true, $defaultValues = false)\n    {\n{{attributeOptions}}\n    }\n\n    /**\n     * get options as array\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getOptionsArray($withEmpty = true)\n    {\n        $options = array();\n        foreach ($this->getAllOptions($withEmpty) as $option) {\n            $options[$option['value']] = $option['label'];\n        }\n        return $options;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Attribute/Source/Attributecode/020_eav",
    "content": "\n    /**\n     * get option text\n     *\n     * @access public\n     * @param mixed $value\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getOptionText($value)\n    {\n        $options = $this->getOptionsArray();\n        if (!is_array($value)) {\n            $value = explode(',', $value);\n        }\n        $texts = array();\n        foreach ($value as $v) {\n            if (isset($options[$v])) {\n                $texts[] = $options[$v];\n            }\n        }\n        return implode(', ', $texts);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Attribute/Source/Attributecode/030_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Category/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} category model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Category extends Mage_Core_Model_Abstract\n{\n    /**\n     * Initialize resource\n     *\n     * @access protected\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_category');\n    }\n\n    /**\n     * Save data for {{entityLabel}}-category relation\n     *\n     * @access public\n     * @param  {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Category\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}})\n    {\n        $data = ${{entity}}->getCategoriesData();\n        if (!is_null($data)) {\n            $this->_getResource()->save{{Entity}}Relation(${{entity}}, $data);\n        }\n        return $this;\n    }\n\n    /**\n     * get categories for {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category_Collection\n     * {{qwertyuiop}}\n     */\n    public function getCategoryCollection(${{entity}})\n    {\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_category_collection')\n            ->add{{Entity}}Filter(${{entity}});\n        return $collection;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Comment/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comment model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment extends Mage_Core_Model_Abstract\n{\n    const STATUS_PENDING  = 0;\n    const STATUS_APPROVED = 1;\n    const STATUS_REJECTED = 2;\n    /**\n     * Entity code.\n     * Can be used as part of method name for entity processing\n     */\n    const ENTITY    = '{{namespace}}_{{module}}_{{entity}}_comment';\n    const CACHE_TAG = '{{namespace}}_{{module}}_{{entity}}_comment';\n    /**\n     * Prefix of model events names\n     * @var string\n     */\n    protected $_eventPrefix = '{{namespace}}_{{module}}_{{entity}}_comment';\n\n    /**\n     * Parameter name in event\n     * @var string\n     */\n    protected $_eventObject = 'comment';\n\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function _construct()\n    {\n        parent::_construct();\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_comment');\n    }\n\n    /**\n     * before save {{entityLabel}} comment\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment\n     * {{qwertyuiop}}\n     */\n    protected function _beforeSave()\n    {\n        parent::_beforeSave();\n        $now = Mage::getSingleton('core/date')->gmtDate();\n        if ($this->isObjectNew()) {\n            $this->setCreatedAt($now);\n        }\n        $this->setUpdatedAt($now);\n        return $this;\n    }\n\n    /**\n     * validate comment\n     *\n     * @access public\n     * @return array|bool\n     * {{qwertyuiop}}\n     */\n    public function validate()\n    {\n        $errors = array();\n\n        if (!Zend_Validate::is($this->getTitle(), 'NotEmpty')) {\n            $errors[] = Mage::helper('review')->__('Comment title can\\'t be empty');\n        }\n\n        if (!Zend_Validate::is($this->getName(), 'NotEmpty')) {\n            $errors[] = Mage::helper('review')->__('Your name can\\'t be empty');\n        }\n\n        if (!Zend_Validate::is($this->getComment(), 'NotEmpty')) {\n            $errors[] = Mage::helper('review')->__('Comment can\\'t be empty');\n        }\n\n        if (empty($errors)) {\n            return true;\n        }\n        return $errors;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Comment/Api/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comment model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment_Api extends Mage_Api_Model_Resource_Abstract\n{\n    /**\n     * get {{entitiesLabel}} comments\n     *\n     * @access public\n     * @param mixed $filters\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function items($filters = null)\n    {\n        $collection = Mage::getModel('{{namespace}}_{{module}}/{{entity}}_comment')->getCollection();\n        $apiHelper = Mage::helper('api');\n        $filters = $apiHelper->parseFilters($filters);\n        try {\n            foreach ($filters as $field => $value) {\n                $collection->addFieldToFilter($field, $value);\n            }\n        } catch (Mage_Core_Exception $e) {\n            $this->_fault('filters_invalid', $e->getMessage());\n        }\n        $result = array();\n        foreach ($collection as ${{entity}}) {\n            $result[] = ${{entity}}->getData();\n        }\n        return $result;\n    }\n\n    /**\n     * update comment status\n     *\n     * @access public\n     * @param mixed $filters\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function updateStatus($commentId, $status)\n    {\n        $comment = Mage::getModel('{{namespace}}_{{module}}/{{entity}}_comment')->load($commentId);\n        if (!$comment->getId()) {\n            $this->_fault('not_exists');\n        }\n        try {\n            $comment->setStatus($status)->save();\n        }\n        catch (Mage_Core_Exception $e) {\n            $this->_fault('data_invalid', $e->getMessage());\n        }\n        return true;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Comment/Api/V2/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} API comment model  V2\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment_Api_V2 extends {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment_Api\n{\n\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Product/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} product model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Product extends Mage_Core_Model_Abstract\n{\n    /**\n     * Initialize resource\n     *\n     * @access protected\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_product');\n    }\n\n    /**\n     * Save data for {{entityLabel}}-product relation\n     * @access public\n     * @param  {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Product\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}})\n    {\n        $data = ${{entity}}->getProductsData();\n        if (!is_null($data)) {\n            $this->_getResource()->save{{Entity}}Relation(${{entity}}, $data);\n        }\n        return $this;\n    }\n\n    /**\n     * get products for {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product_Collection\n     * {{qwertyuiop}}\n     */\n    public function getProductCollection(${{entity}})\n    {\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_product_collection')\n            ->add{{Entity}}Filter(${{entity}});\n        return $collection;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Sibling/010_content",
    "content": "<?php \n{{License}}\n/**\n * {{EntityLabel}} {{siblingLabel}} model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_{{Sibling}} extends Mage_Core_Model_Abstract\n{\n    /**\n     * Initialize resource\n     *\n     * @access protected\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_{{sibling}}');\n    }\n\n    /**\n     * Save data for {{entityLabel}} - {{siblingLabel}} relation\n     * @access public\n     * @param  {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}})\n    {\n        $data = ${{entity}}->get{{Siblings}}Data();\n        if (!is_null($data)) {\n            $this->_getResource()->save{{Entity}}Relation(${{entity}}, $data);\n        }\n        return $this;\n    }\n\n    /**\n     * get {{siblingsLabel}} for {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function get{{Siblings}}Collection(${{entity}})\n    {\n        $collection = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_{{sibling}}_collection')\n            ->add{{Entity}}Filter(${{entity}});\n        return $collection;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Source/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} source model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_{{Entity}}_Source extends Mage_Eav_Model_Entity_Attribute_Source_Abstract\n{\n    /**\n     * Get all options\n     *\n     * @access public\n     * @param bool $withEmpty\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getAllOptions($withEmpty = false)\n    {\n        if (is_null($this->_options)) {\n            $this->_options = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection')\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Source/020_eav",
    "content": "            ->addAttributeToSelect('{{nameAttributeCode}}')"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Entity/Source/030_footer",
    "content": "            ->load()\n            ->toOptionArray();\n        }\n        $options = $this->_options;\n        if ($withEmpty) {\n            array_unshift($options, array('value'=>'', 'label'=>''));\n        }\n        return $options;\n    }\n\n    /**\n     * Get a text for option value\n     *\n     * @access public\n     * @param string|integer $value\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getOptionText($value)\n    {\n        $options = $this->getAllOptions(false);\n        foreach ($options as $item) {\n            if ($item['value'] == $value) {\n                return $item['label'];\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Convert to options array\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function toOptionArray()\n    {\n        return $this->getAllOptions();\n    }\n\n    /**\n     * Retrieve flat column definition\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getFlatColums()\n    {\n        $attributeCode = $this->getAttribute()->getAttributeCode();\n        $column = array(\n            'unsigned'  => true,\n            'default'   => null,\n            'extra'     => null\n        );\n        if (Mage::helper('core')->useDbCompatibleMode()) {\n            $column['type']     = 'int';\n            $column['is_null']  = true;\n        } else {\n            $column['type']     = Varien_Db_Ddl_Table::TYPE_INTEGER;\n            $column['nullable'] = true;\n            $column['comment']  = $attributeCode . ' {{EntityLabel}} column';\n        }\n        return array($attributeCode => $column);\n    }\n\n    /**\n     * Retrieve Select for update attribute value in flat table\n     *\n     * @access public\n     * @param   int $store\n     * @return  Varien_Db_Select|null\n     * {{qwertyuiop}}\n     */\n    public function getFlatUpdateSelect($store)\n    {\n        return Mage::getResourceModel('eav/entity_attribute_option')\n            ->getFlatUpdateSelect($this->getAttribute(), $store, false);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Observer/010_top",
    "content": "<?php\n{{License}}\n/**\n * Frontend observer\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Observer\n{\n    /**\n     * add items to main menu\n     *\n     * @access public\n     * @param Varien_Event_Observer $observer\n     * @return array()\n     * {{qwertyuiop}}\n     */\n    public function addItemsToTopmenuItems($observer)\n    {\n        $menu = $observer->getMenu();\n        $tree = $menu->getTree();\n        $action = Mage::app()->getFrontController()->getAction()->getFullActionName();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Observer/020_entity",
    "content": "        ${{entity}}NodeId = '{{entity}}';\n        $data = array(\n            'name' => Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'),\n            'id' => ${{entity}}NodeId,\n            'url' => Mage::helper('{{namespace}}_{{module}}/{{entity}}')->get{{Entities}}Url(),\n            'is_active' => ($action == '{{namespace}}_{{module}}_{{entity}}_index' || $action == '{{namespace}}_{{module}}_{{entity}}_view')\n        );\n        ${{entity}}Node = new Varien_Data_Tree_Node($data, 'id', $tree, $menu);\n        $menu->addChild(${{entity}}Node);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Observer/030_footer",
    "content": "        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Attribute/010_content",
    "content": "<?php\n{{License}}\n/**\n * Attribute model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_Attribute extends Mage_Eav_Model_Resource_Entity_Attribute\n{\n    /**\n     * after saving the attribute\n     *\n     * @access protected\n     * @param Mage_Core_Model_Abstract $object\n     * @return  {{Namespace}}_{{Module}}_Model_Resource_Attribute\n     * {{qwertyuiop}}\n     */\n    protected  function _afterSave(Mage_Core_Model_Abstract $object)\n    {\n        $setup       = Mage::getModel('eav/entity_setup', 'core_write');\n        $entityType  = $object->getEntityTypeId();\n        $setId       = $setup->getDefaultAttributeSetId($entityType);\n        $groupId     = $setup->getDefaultAttributeGroupId($entityType);\n        $attributeId = $object->getId();\n        $sortOrder   = $object->getPosition();\n\n        $setup->addAttributeToGroup($entityType, $setId, $groupId, $attributeId, $sortOrder);\n        return parent::_afterSave($object);\n    }\n}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Eav/Attribute/010_content",
    "content": "<?php\n{{License}}\n/**\n * Attribute resource model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_Eav_Attribute extends Mage_Eav_Model_Entity_Attribute\n{\n    const MODULE_NAME   = '{{Namespace}}_{{Module}}';\n    const ENTITY        = '{{namespace}}_{{module}}_eav_attribute';\n\n    protected $_eventPrefix = '{{namespace}}_{{module}}_entity_attribute';\n    protected $_eventObject = 'attribute';\n\n    /**\n     * Array with labels\n     *\n     * @var array\n     */\n    static protected $_labels = null;\n\n    /**\n     * constructor\n     *\n     * @access protected\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/attribute');\n    }\n\n    /**\n     * check if scope is store view\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function isScopeStore()\n    {\n        return $this->getIsGlobal() == Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE;\n    }\n\n    /**\n     * check if scope is website\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function isScopeWebsite()\n    {\n        return $this->getIsGlobal() == Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE;\n    }\n\n    /**\n     * check if scope is global\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function isScopeGlobal()\n    {\n        return (!$this->isScopeStore() && !$this->isScopeWebsite());\n    }\n\n    /**\n     * get backend input type\n     *\n     * @access public\n     * @param string $type\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getBackendTypeByInput($type)\n    {\n        switch ($type) {\n            case 'file':\n                //intentional fallthrough\n            case 'image':\n                return 'varchar';\n                break;\n            case 'multiselect':\n                return 'text';\n                break;\n            default:\n                return parent::getBackendTypeByInput($type);\n            break;\n        }\n    }\n\n    /**\n     * don't delete system attributes\n     *\n     * @access public\n     * @param string $type\n     * @return string\n     * {{qwertyuiop}}\n     */\n    protected function _beforeDelete()\n    {\n        if (!$this->getIsUserDefined()) {\n            throw new Mage_Core_Exception(\n                Mage::helper('{{namespace}}_{{module}}')->__('This attribute is not deletable')\n            );\n        }\n        return parent::_beforeDelete();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} resource model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}} extends {{ResourceModelParent}}\n{\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/020_tree_var",
    "content": "    /**\n     * {{EntityLabel}} tree object\n     * @var Varien_Data_Tree_Db\n     */\n    protected $_tree;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/030_constructor",
    "content": "\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}', 'entity_id');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/032_eav_construct",
    "content": "{{RelationsResourceTablesDeclare}}\n\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        $resource = Mage::getSingleton('core/resource');\n        $this->setType('{{namespace}}_{{module}}_{{entity}}')\n            ->setConnection(\n                $resource->getConnection('{{entity}}_read'),\n                $resource->getConnection('{{entity}}_write')\n            );\n{{RelationsResourceTables}}\n    }\n\n    /**\n     * wrapper for main table getter\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getMainTable()\n    {\n        return $this->getEntityTable();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/037_store",
    "content": "\n    /**\n     * Get store ids to which specified item is assigned\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function lookupStoreIds(${{entity}}Id)\n    {\n        $adapter = $this->_getReadAdapter();\n        $select  = $adapter->select()\n            ->from($this->getTable('{{namespace}}_{{module}}/{{entity}}_store'), 'store_id')\n            ->where('{{entity}}_id = ?', (int)${{entity}}Id);\n        return $adapter->fetchCol($select);\n    }\n\n    /**\n     * Perform operations after object load\n     *\n     * @access public\n     * @param Mage_Core_Model_Abstract $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _afterLoad(Mage_Core_Model_Abstract $object)\n    {\n        if ($object->getId()) {\n            $stores = $this->lookupStoreIds($object->getId());\n            $object->setData('store_id', $stores);\n        }\n        return parent::_afterLoad($object);\n    }\n\n    /**\n     * Retrieve select object for load object data\n     *\n     * @param string $field\n     * @param mixed $value\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} $object\n     * @return Zend_Db_Select\n     */\n    protected function _getLoadSelect($field, $value, $object)\n    {\n        $select = parent::_getLoadSelect($field, $value, $object);\n        if ($object->getStoreId()) {\n            $storeIds = array(Mage_Core_Model_App::ADMIN_STORE_ID, (int)$object->getStoreId());\n            $select->join(\n                array('{{module}}_{{entity}}_store' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_store')),\n                $this->getMainTable() . '.entity_id = {{module}}_{{entity}}_store.{{entity}}_id',\n                array()\n            )\n            ->where('{{module}}_{{entity}}_store.store_id IN (?)', $storeIds)\n            ->order('{{module}}_{{entity}}_store.store_id DESC')\n            ->limit(1);\n        }\n        return $select;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/040_not_tree",
    "content": "\n    /**\n     * Assign {{entityLabel}} to store views\n     *\n     * @access protected\n     * @param Mage_Core_Model_Abstract $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _afterSave(Mage_Core_Model_Abstract $object)\n    {\n        $oldStores = $this->lookupStoreIds($object->getId());\n        $newStores = (array)$object->getStores();\n        if (empty($newStores)) {\n            $newStores = (array)$object->getStoreId();\n        }\n        $table  = $this->getTable('{{namespace}}_{{module}}/{{entity}}_store');\n        $insert = array_diff($newStores, $oldStores);\n        $delete = array_diff($oldStores, $newStores);\n        if ($delete) {\n            $where = array(\n                '{{entity}}_id = ?' => (int) $object->getId(),\n                'store_id IN (?)' => $delete\n            );\n            $this->_getWriteAdapter()->delete($table, $where);\n        }\n        if ($insert) {\n            $data = array();\n            foreach ($insert as $storeId) {\n                $data[] = array(\n                    '{{entity}}_id'  => (int) $object->getId(),\n                    'store_id' => (int) $storeId\n                );\n            }\n            $this->_getWriteAdapter()->insertMultiple($table, $data);\n        }\n        return parent::_afterSave($object);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/045_before_save_multiple",
    "content": "\n    /**\n     * process multiple select fields\n     *\n     * @access protected\n     * @param Mage_Core_Model_Abstract $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeSave(Mage_Core_Model_Abstract $object)\n    {\n        {{multipleSelectConvert}}return parent::_beforeSave($object);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/050_tree",
    "content": "\n    /**\n     * Retrieve {{entityLabel}} tree object\n     *\n     * @access protected\n     * @return Varien_Data_Tree_Db\n     * {{qwertyuiop}}\n     */\n    protected function _getTree()\n    {\n        if (!$this->_tree) {\n            $this->_tree = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_tree')->load();\n        }\n        return $this->_tree;\n    }\n\n    /**\n     * Process {{entityLabel}} data before delete\n     * update children count for parent {{entityLabel}}\n     * delete child {{entitiesLabel}}\n     *\n     * @access protected\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeDelete({{beforeSaveParam}} $object)\n    {\n        parent::_beforeDelete($object);\n        /**\n         * Update children count for all parent {{entitiesLabel}}\n         */\n        $parentIds = $object->getParentIds();\n        if ($parentIds) {\n            $childDecrease = $object->getChildrenCount() + 1; // +1 is itself\n            $data = array('children_count' => new Zend_Db_Expr('children_count - ' . $childDecrease));\n            $where = array('entity_id IN(?)' => $parentIds);\n            $this->_getWriteAdapter()->update($this->getMainTable(), $data, $where);\n        }\n        $this->deleteChildren($object);\n        return $this;\n    }\n\n    /**\n     * Delete children {{entitiesLabel}} of specific {{entityLabel}}\n     *\n     * @access public\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function deleteChildren(Varien_Object $object)\n    {\n        $adapter = $this->_getWriteAdapter();\n        $pathField = $adapter->quoteIdentifier('path');\n        $select = $adapter->select()\n            ->from($this->getMainTable(), array('entity_id'))\n            ->where($pathField . ' LIKE :c_path');\n        $childrenIds = $adapter->fetchCol($select, array('c_path' => $object->getPath() . '/%'));\n        if (!empty($childrenIds)) {\n            $adapter->delete(\n                $this->getMainTable(),\n                array('entity_id IN (?)' => $childrenIds)\n            );\n        }\n        /**\n         * Add deleted children ids to object\n         * This data can be used in after delete event\n         */\n        $object->setDeletedChildrenIds($childrenIds);\n        return $this;\n    }\n\n    /**\n     * Process {{entityLabel}} data after save {{entityLabel}} object\n     *\n     * @access protected\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _afterSave({{beforeSaveParam}} $object)\n    {\n        if (substr($object->getPath(), -1) == '/') {\n            $object->setPath($object->getPath() . $object->getId());\n            $this->_savePath($object);\n        }\n\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/052_tree_store",
    "content": "        $oldStores = $this->lookupStoreIds($object->getId());\n        $newStores = (array)$object->getStores();\n        if (empty($newStores)) {\n            $newStores = (array)$object->getStoreId();\n        }\n        $table  = $this->getTable('{{namespace}}_{{module}}/{{entity}}_store');\n        $insert = array_diff($newStores, $oldStores);\n        $delete = array_diff($oldStores, $newStores);\n        if ($delete) {\n            $where = array(\n                '{{entity}}_id = ?' => (int) $object->getId(),\n                'store_id IN (?)' => $delete\n            );\n            $this->_getWriteAdapter()->delete($table, $where);\n        }\n        if ($insert) {\n            $data = array();\n            foreach ($insert as $storeId) {\n                $data[] = array(\n                    '{{entity}}_id'  => (int) $object->getId(),\n                    'store_id' => (int) $storeId\n                );\n            }\n            $this->_getWriteAdapter()->insertMultiple($table, $data);\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/053_tree_after",
    "content": "        return parent::_afterSave($object);\n    }\n\n    /**\n     * Update path field\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _savePath($object)\n    {\n        if ($object->getId()) {\n            $this->_getWriteAdapter()->update(\n                $this->getMainTable(),\n                array('path' => $object->getPath()),\n                array('entity_id = ?' => $object->getId())\n            );\n        }\n        return $this;\n    }\n\n    /**\n     * Get maximum position of child {{entitiesLabel}} by specific tree path\n     *\n     * @access protected\n     * @param string $path\n     * @return int\n     * {{qwertyuiop}}\n     */\n    protected function _getMaxPosition($path)\n    {\n        $adapter = $this->getReadConnection();\n        $positionField = $adapter->quoteIdentifier('position');\n        $level   = count(explode('/', $path));\n        $bind = array(\n            'c_level' => $level,\n            'c_path'  => $path . '/%'\n        );\n        $select  = $adapter->select()\n            ->from($this->getMainTable(), 'MAX(' . $positionField . ')')\n            ->where($adapter->quoteIdentifier('path') . ' LIKE :c_path')\n            ->where($adapter->quoteIdentifier('level') . ' = :c_level');\n\n        $position = $adapter->fetchOne($select, $bind);\n        if (!$position) {\n            $position = 0;\n        }\n        return $position;\n    }\n\n    /**\n     * Get children {{entitiesLabel}} count\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getChildrenCount(${{entity}}Id)\n    {\n        $select = $this->_getReadAdapter()->select()\n            ->from($this->getMainTable(), 'children_count')\n            ->where('entity_id = :entity_id');\n        $bind = array('entity_id' => ${{entity}}Id);\n        return $this->_getReadAdapter()->fetchOne($select, $bind);\n    }\n\n    /**\n     * Check if {{entityLabel}} id exist\n     *\n     * @access public\n     * @param int $entityId\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function checkId($entityId)\n    {\n        $select = $this->_getReadAdapter()->select()\n            ->from($this->getMainTable(), 'entity_id')\n            ->where('entity_id = :entity_id');\n        $bind =  array('entity_id' => $entityId);\n        return $this->_getReadAdapter()->fetchOne($select, $bind);\n    }\n\n    /**\n     * Check array of {{entitiesLabel}} identifiers\n     *\n     * @access public\n     * @param array $ids\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function verifyIds(array $ids)\n    {\n        if (empty($ids)) {\n            return array();\n        }\n        $select = $this->_getReadAdapter()->select()\n            ->from($this->getMainTable(), 'entity_id')\n            ->where('entity_id IN(?)', $ids);\n\n        return $this->_getReadAdapter()->fetchCol($select);\n    }\n\n    /**\n     * Get count of active/not active children {{entitiesLabel}}\n     *\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param bool $isActiveFlag\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getChildrenAmount(${{entity}}, $isActiveFlag = true)\n    {\n        $bind = array(\n            'active_flag'  => $isActiveFlag,\n            'c_path'   => ${{entity}}->getPath() . '/%'\n        );\n        $select = $this->_getReadAdapter()->select()\n            ->from(array('m' => $this->getMainTable()), array('COUNT(m.entity_id)'))\n            ->where('m.path LIKE :c_path')\n            ->where('status' . ' = :active_flag');\n        return $this->_getReadAdapter()->fetchOne($select, $bind);\n    }\n\n    /**\n     * Return parent {{entitiesLabel}} of {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getParent{{Entities}}(${{entity}})\n    {\n        $pathIds = array_reverse(explode('/', ${{entity}}->getPath()));\n        ${{entities}} = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection')\n            ->addFieldToFilter('entity_id', array('in' => $pathIds))\n            ->load()\n            ->getItems();\n        return ${{entities}};\n    }\n\n    /**\n     * Return child {{entitiesLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function getChildren{{Entities}}(${{entity}})\n    {\n        $collection = ${{entity}}->getCollection();\n        $collection\n            ->addIdFilter(${{entity}}->getChild{{Entities}}())\n            ->setOrder('position', Varien_Db_Select::SQL_ASC)\n            ->load();\n        return $collection;\n    }\n    /**\n     * Return children ids of {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param boolean $recursive\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getChildren(${{entity}}, $recursive = true)\n    {\n        $bind = array(\n            'c_path'   => ${{entity}}->getPath() . '/%'\n        );\n        $select = $this->_getReadAdapter()->select()\n            ->from(array('m' => $this->getMainTable()), 'entity_id')\n            ->where('status = ?', 1)\n            ->where($this->_getReadAdapter()->quoteIdentifier('path') . ' LIKE :c_path');\n        if (!$recursive) {\n            $select->where($this->_getReadAdapter()->quoteIdentifier('level') . ' <= :c_level');\n            $bind['c_level'] = ${{entity}}->getLevel() + 1;\n        }\n        return $this->_getReadAdapter()->fetchCol($select, $bind);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/055_tree_eav",
    "content": "\n    /**\n     * Retrieve {{entityLabel}} tree object\n     *\n     * @access protected\n     * @return Varien_Data_Tree_Db\n     * {{qwertyuiop}}\n     */\n    protected function _getTree()\n    {\n        if (!$this->_tree) {\n            $this->_tree = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_tree')->load();\n        }\n        return $this->_tree;\n    }\n\n    /**\n     * Process {{entityLabel}} data before delete\n     * update children count for parent {{entityLabel}}\n     * delete child {{entitiesLabel}}\n     *\n     * @access protected\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeDelete({{beforeSaveParam}} $object)\n    {\n        parent::_beforeDelete($object);\n        /**\n         * Update children count for all parent {{entitiesLabel}}\n         */\n        $parentIds = $object->getParentIds();\n        if ($parentIds) {\n            $childDecrease = $object->getChildrenCount() + 1; // +1 is itself\n            $data = array('children_count' => new Zend_Db_Expr('children_count - ' . $childDecrease));\n            $where = array('entity_id IN(?)' => $parentIds);\n            $this->_getWriteAdapter()->update($this->getMainTable(), $data, $where);\n        }\n        $this->deleteChildren($object);\n        return $this;\n    }\n\n    /**\n     * Delete children {{entitiesLabel}} of specific {{entityLabel}}\n     *\n     * @access public\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function deleteChildren(Varien_Object $object)\n    {\n        $adapter = $this->_getWriteAdapter();\n        $pathField = $adapter->quoteIdentifier('path');\n        $select = $adapter->select()\n            ->from($this->getMainTable(), array('entity_id'))\n            ->where($pathField . ' LIKE :c_path');\n        $childrenIds = $adapter->fetchCol($select, array('c_path' => $object->getPath() . '/%'));\n        if (!empty($childrenIds)) {\n            $adapter->delete(\n                $this->getMainTable(),\n                array('entity_id IN (?)' => $childrenIds)\n            );\n        }\n        /**\n         * Add deleted children ids to object\n         * This data can be used in after delete event\n         */\n        $object->setDeletedChildrenIds($childrenIds);\n        return $this;\n    }\n\n    /**\n     * Process {{entityLabel}} data after save {{entityLabel}} object\n     *\n     * @access protected\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _afterSave({{beforeSaveParam}} $object)\n    {\n        if (substr($object->getPath(), -1) == '/') {\n            $object->setPath($object->getPath() . $object->getId());\n            $this->_savePath($object);\n        }\n        return parent::_afterSave($object);\n    }\n\n    /**\n     * Update path field\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _savePath($object)\n    {\n        if ($object->getId()) {\n            $this->_getWriteAdapter()->update(\n                $this->getMainTable(),\n                array('path' => $object->getPath()),\n                array('entity_id = ?' => $object->getId())\n            );\n        }\n        return $this;\n    }\n\n    /**\n     * Get maximum position of child {{entitiesLabel}} by specific tree path\n     *\n     * @access protected\n     * @param string $path\n     * @return int\n     * {{qwertyuiop}}\n     */\n    protected function _getMaxPosition($path)\n    {\n        $adapter = $this->getReadConnection();\n        $positionField = $adapter->quoteIdentifier('position');\n        $level   = count(explode('/', $path));\n        $bind = array(\n            'c_level' => $level,\n            'c_path'  => $path . '/%'\n        );\n        $select  = $adapter->select()\n            ->from($this->getMainTable(), 'MAX(' . $positionField . ')')\n            ->where($adapter->quoteIdentifier('path') . ' LIKE :c_path')\n            ->where($adapter->quoteIdentifier('level') . ' = :c_level');\n\n        $position = $adapter->fetchOne($select, $bind);\n        if (!$position) {\n            $position = 0;\n        }\n        return $position;\n    }\n\n    /**\n     * Get children {{entitiesLabel}} count\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getChildrenCount(${{entity}}Id)\n    {\n        $select = $this->_getReadAdapter()->select()\n            ->from($this->getMainTable(), 'children_count')\n            ->where('entity_id = :entity_id');\n        $bind = array('entity_id' => ${{entity}}Id);\n        return $this->_getReadAdapter()->fetchOne($select, $bind);\n    }\n\n    /**\n     * Check if {{entityLabel}} id exist\n     *\n     * @access public\n     * @param int $entityId\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function checkId($entityId)\n    {\n        $select = $this->_getReadAdapter()->select()\n            ->from($this->getMainTable(), 'entity_id')\n            ->where('entity_id = :entity_id');\n        $bind =  array('entity_id' => $entityId);\n        return $this->_getReadAdapter()->fetchOne($select, $bind);\n    }\n\n    /**\n     * Check array of {{entitiesLabel}} identifiers\n     *\n     * @access public\n     * @param array $ids\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function verifyIds(array $ids)\n    {\n        if (empty($ids)) {\n            return array();\n        }\n        $select = $this->_getReadAdapter()->select()\n            ->from($this->getMainTable(), 'entity_id')\n            ->where('entity_id IN(?)', $ids);\n\n        return $this->_getReadAdapter()->fetchCol($select);\n    }\n\n    /**\n     * Get count of active/not active children {{entitiesLabel}}\n     *\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param bool $isActiveFlag\n     * @return int\n     * {{qwertyuiop}}\n     */\n    public function getChildrenAmount(${{entity}}, $isActiveFlag = true)\n    {\n        $bind = array(\n            'active_flag'  => $isActiveFlag,\n            'c_path'   => ${{entity}}->getPath() . '/%'\n        );\n        $select = $this->_getReadAdapter()->select()\n            ->from(array('m' => $this->getMainTable()), array('COUNT(m.entity_id)'))\n            ->where('m.path LIKE :c_path')\n            ->where('status' . ' = :active_flag');\n        return $this->_getReadAdapter()->fetchOne($select, $bind);\n    }\n\n    /**\n     * Return parent {{entitiesLabel}} of {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getParent{{Entities}}(${{entity}})\n    {\n        $pathIds = array_reverse(explode('/', ${{entity}}->getPath()));\n        ${{entities}} = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_collection')\n            ->addAttributeToFilter('entity_id', array('in' => $pathIds))\n            ->addAttributeToSelect('*');\n        return ${{entities}};\n    }\n\n    /**\n     * Return child {{entitiesLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function getChildren{{Entities}}(${{entity}})\n    {\n        $collection = ${{entity}}->getCollection();\n        $collection\n            ->addAttributeToFilter('status', 1)\n            ->addIdFilter(${{entity}}->getChild{{Entities}}())\n            ->setOrder('position', Varien_Db_Select::SQL_ASC);\n        return $collection;\n    }\n\n    /**\n     * Return children ids of {{entityLabel}}\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param boolean $recursive\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getChildren(${{entity}}, $recursive = true)\n    {\n        $attributeId  = (int)$this->_getStatusAttributeId();\n        $backendTable = $this->getTable(array($this->getEntityTablePrefix(), 'int'));\n        $adapter      = $this->_getReadAdapter();\n        $checkSql     = $adapter->getCheckSql('c.value_id > 0', 'c.value', 'd.value');\n        $bind = array(\n            'attribute_id' => $attributeId,\n            'store_id'     => ${{entity}}->getStoreId(),\n            'scope'        => 1,\n            'c_path'       => ${{entity}}->getPath() . '/%'\n        );\n        $select = $this->_getReadAdapter()->select()\n            ->from(array('m' => $this->getEntityTable()), 'entity_id')\n            ->joinLeft(\n                array('d' => $backendTable),\n                'd.attribute_id = :attribute_id AND d.store_id = 0 AND d.entity_id = m.entity_id',\n                array()\n            )\n            ->joinLeft(\n                array('c' => $backendTable),\n                'c.attribute_id = :attribute_id AND c.store_id = :store_id AND c.entity_id = m.entity_id',\n                array()\n            )\n            ->where($checkSql . ' = :scope')\n            ->where($adapter->quoteIdentifier('path') . ' LIKE :c_path');\n        if (!$recursive) {\n            $select->where($adapter->quoteIdentifier('level') . ' <= :c_level');\n            $bind['c_level'] = ${{entity}}->getLevel() + 1;\n        }\n\n        return $adapter->fetchCol($select, $bind);\n    }\n\n    protected $_statusAttributeId = null;\n\n    /**\n     * Get \"is_active\" attribute identifier\n     *\n     * @access protected\n     * @return int\n     * {{qwertyuiop}}\n     */\n    protected function _getStatusAttributeId()\n    {\n        if ($this->_statusAttributeId === null) {\n            $bind = array(\n                '{{namespace}}_{{module}}_{{entity}}' => {{Namespace}}_{{Module}}_Model_{{Entity}}::ENTITY,\n                'status'        => 'status',\n            );\n            $select = $this->_getReadAdapter()->select()\n                ->from(array('a'=>$this->getTable('eav/attribute')), array('attribute_id'))\n                ->join(array('t'=>$this->getTable('eav/entity_type')), 'a.entity_type_id = t.entity_type_id')\n                ->where('entity_type_code = :{{namespace}}_{{module}}_{{entity}}')\n                ->where('attribute_code = :status');\n\n            $this->_statusAttributeId = $this->_getReadAdapter()->fetchOne($select, $bind);\n        }\n        return $this->_statusAttributeId;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/060_tree_before_save_no_url_rewrite",
    "content": "\n    /**\n     * Process {{entityLabel}} data before saving\n     * prepare path and increment children count for parent {{entitiesLabel}}\n     *\n     * @access protected\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeSave({{beforeSaveParam}} $object)\n    {\n        parent::_beforeSave($object);\n        if (!$object->getChildrenCount()) {\n            $object->setChildrenCount(0);\n        }\n        if ($object->getLevel() === null) {\n            $object->setLevel(1);\n        }\n        if (!$object->getId() && !$object->getInitialSetupFlag()) {\n            $object->setPosition($this->_getMaxPosition($object->getPath()) + 1);\n            $path  = explode('/', $object->getPath());\n            $level = count($path);\n            $object->setLevel($level);\n            if ($level) {\n                $object->setParentId($path[$level - 1]);\n            }\n            $object->setPath($object->getPath() . '/');\n            $toUpdateChild = explode('/', $object->getPath());\n            $this->_getWriteAdapter()->update(\n                $this->getMainTable(),\n                array('children_count'  => new Zend_Db_Expr('children_count+1')),\n                array('entity_id IN(?)' => $toUpdateChild)\n            );\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/070_eav_tree_before_save_url_rewrite",
    "content": "\n    /**\n     * Process {{entityLabel}} data before saving\n     * prepare path and increment children count for parent {{entitiesLabel}}\n     *\n     * @access protected\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeSave({{beforeSaveParam}} $object)\n    {\n        parent::_beforeSave($object);\n        if (!$object->getChildrenCount()) {\n            $object->setChildrenCount(0);\n        }\n        if ($object->getLevel() === null) {\n            $object->setLevel(1);\n        }\n        if (!$object->getId() && !$object->getInitialSetupFlag()) {\n            $object->setPosition($this->_getMaxPosition($object->getPath()) + 1);\n            $path  = explode('/', $object->getPath());\n            $level = count($path);\n            $object->setLevel($level);\n            if ($level) {\n                $object->setParentId($path[$level - 1]);\n            }\n            $object->setPath($object->getPath() . '/');\n            $toUpdateChild = explode('/', $object->getPath());\n            $this->_getWriteAdapter()->update(\n                $this->getMainTable(),\n                array('children_count'  => new Zend_Db_Expr('children_count+1')),\n                array('entity_id IN(?)' => $toUpdateChild)\n            );\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/080_tree_before_save_url_rewrite",
    "content": "\n    /**\n     * Process {{entityLabel}} data before saving\n     * prepare path and increment children count for parent {{entitiesLabel}}\n     *\n     * @access protected\n     * @param Varien_Object $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeSave({{beforeSaveParam}} $object)\n    {\n        {{multipleSelectConvert}}if (!$object->getInitialSetupFlag()) {\n            $urlKey = $object->getData('url_key');\n            if ($urlKey == '') {\n                $urlKey = $object->get{{EntityNameMagicCode}}();\n            }\n            $urlKey = $this->formatUrlKey($urlKey);\n            $validKey = false;\n            while (!$validKey) {\n                $entityId = $this->checkUrlKey($urlKey, $object->getStoreId(), false);\n                if ($entityId == $object->getId() || empty($entityId)) {\n                    $validKey = true;\n                } else {\n                    $parts = explode('-', $urlKey);\n                    $last = $parts[count($parts) - 1];\n                    if (!is_numeric($last)) {\n                        $urlKey = $urlKey.'-1';\n                    } else {\n                        $suffix = '-'.($last + 1);\n                        unset($parts[count($parts) - 1]);\n                        $urlKey = implode('-', $parts).$suffix;\n                    }\n                }\n            }\n            $object->setData('url_key', $urlKey);\n        }\n        parent::_beforeSave($object);\n        if (!$object->getChildrenCount()) {\n            $object->setChildrenCount(0);\n        }\n        if ($object->getLevel() === null) {\n            $object->setLevel(1);\n        }\n        if (!$object->getId() && !$object->getInitialSetupFlag()) {\n            $object->setPosition($this->_getMaxPosition($object->getPath()) + 1);\n            $path  = explode('/', $object->getPath());\n            $level = count($path);\n            $object->setLevel($level);\n            if ($level) {\n                $object->setParentId($path[$level - 1]);\n            }\n            $object->setPath($object->getPath() . '/');\n            $toUpdateChild = explode('/', $object->getPath());\n            $this->_getWriteAdapter()->update(\n                $this->getMainTable(),\n                array('children_count'  => new Zend_Db_Expr('children_count+1')),\n                array('entity_id IN(?)' => $toUpdateChild)\n            );\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/090_content",
    "content": "\n    /**\n     * Retrieve {{entitiesLabel}}\n     *\n     * @access public\n     * @param integer $parent\n     * @param integer $recursionLevel\n     * @param boolean|string $sorted\n     * @param boolean $asCollection\n     * @param boolean $toLoad\n     * @return Varien_Data_Tree_Node_Collection|{{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function get{{Entities}}(\n        $parent,\n        $recursionLevel = 0,\n        $sorted = false,\n        $asCollection = false,\n        $toLoad = true\n    )\n    {\n        $tree = Mage::getResourceModel('{{namespace}}_{{module}}/{{entity}}_tree');\n        $nodes = $tree->loadNode($parent)\n            ->loadChildren($recursionLevel)\n            ->getChildren();\n        $tree->addCollectionData(null, $sorted, $parent, $toLoad, true);\n        if ($asCollection) {\n            return $tree->getCollection();\n        }\n        return $nodes;\n    }\n\n    /**\n     * Return all children ids of {{entity}} (with {{entity}} id)\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getAllChildren(${{entity}})\n    {\n        $children = $this->getChildren(${{entity}});\n        $myId = array(${{entity}}->getId());\n        $children = array_merge($myId, $children);\n        return $children;\n    }\n\n    /**\n     * Check {{entityLabel}} is forbidden to delete.\n     *\n     * @access public\n     * @param integer ${{entity}}Id\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    public function isForbiddenToDelete(${{entity}}Id)\n    {\n        return (${{entity}}Id == Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id());\n    }\n\n    /**\n     * Get {{entityLabel}} path value by its id\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function get{{Entity}}PathById(${{entity}}Id)\n    {\n        $select = $this->getReadConnection()->select()\n            ->from($this->getMainTable(), array('path'))\n            ->where('entity_id = :entity_id');\n        $bind = array('entity_id' => (int)${{entity}}Id);\n        return $this->getReadConnection()->fetchOne($select, $bind);\n    }\n\n    /**\n     * Move {{entityLabel}} to another parent node\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} $newParent\n     * @param null|int $after{{Entity}}Id\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    public function changeParent(\n        {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}},\n        {{Namespace}}_{{Module}}_Model_{{Entity}} $newParent,\n        $after{{Entity}}Id = null\n    )\n    {\n        $childrenCount  = $this->getChildrenCount(${{entity}}->getId()) + 1;\n        $table          = $this->getMainTable();\n        $adapter        = $this->_getWriteAdapter();\n        $levelFiled     = $adapter->quoteIdentifier('level');\n        $pathField      = $adapter->quoteIdentifier('path');\n\n        /**\n         * Decrease children count for all old {{entityLabel}} parent {{entitiesLabel}}\n         */\n        $adapter->update(\n            $table,\n            array('children_count' => new Zend_Db_Expr('children_count - ' . $childrenCount)),\n            array('entity_id IN(?)' => ${{entity}}->getParentIds())\n        );\n        /**\n         * Increase children count for new {{entityLabel}} parents\n         */\n        $adapter->update(\n            $table,\n            array('children_count' => new Zend_Db_Expr('children_count + ' . $childrenCount)),\n            array('entity_id IN(?)' => $newParent->getPathIds())\n        );\n\n        $position = $this->_processPositions(${{entity}}, $newParent, $after{{Entity}}Id);\n\n        $newPath  = sprintf('%s/%s', $newParent->getPath(), ${{entity}}->getId());\n        $newLevel = $newParent->getLevel() + 1;\n        $levelDisposition = $newLevel - ${{entity}}->getLevel();\n\n        /**\n         * Update children nodes path\n         */\n        $adapter->update(\n            $table,\n            array(\n                'path' => new Zend_Db_Expr(\n                    'REPLACE(' . $pathField . ','.\n                    $adapter->quote(${{entity}}->getPath() . '/'). ', '.$adapter->quote($newPath . '/').')'\n                ),\n                'level' => new Zend_Db_Expr($levelFiled . ' + ' . $levelDisposition)\n            ),\n            array($pathField . ' LIKE ?' => ${{entity}}->getPath() . '/%')\n        );\n        /**\n         * Update moved {{entityLabel}} data\n         */\n        $data = array(\n            'path'  => $newPath,\n            'level' => $newLevel,\n            'position'  =>$position,\n            'parent_id' =>$newParent->getId()\n        );\n        $adapter->update($table, $data, array('entity_id = ?' => ${{entity}}->getId()));\n        // Update {{entityLabel}} object to new data\n        ${{entity}}->addData($data);\n        return $this;\n    }\n\n    /**\n     * Process positions of old parent {{entityLabel}} children and new parent {{entityLabel}} children.\n     * Get position for moved {{entityLabel}}\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} $newParent\n     * @param null|int $after{{Entity}}Id\n     * @return int\n     * {{qwertyuiop}}\n     */\n    protected function _processPositions(${{entity}}, $newParent, $after{{Entity}}Id)\n    {\n        $table  = $this->getMainTable();\n        $adapter= $this->_getWriteAdapter();\n        $positionField  = $adapter->quoteIdentifier('position');\n\n        $bind = array(\n            'position' => new Zend_Db_Expr($positionField . ' - 1')\n        );\n        $where = array(\n            'parent_id = ?' => ${{entity}}->getParentId(),\n            $positionField . ' > ?' => ${{entity}}->getPosition()\n        );\n        $adapter->update($table, $bind, $where);\n\n        /**\n         * Prepare position value\n         */\n        if ($after{{Entity}}Id) {\n            $select = $adapter->select()\n                ->from($table, 'position')\n                ->where('entity_id = :entity_id');\n            $position = $adapter->fetchOne($select, array('entity_id' => $after{{Entity}}Id));\n            $bind = array(\n                'position' => new Zend_Db_Expr($positionField . ' + 1')\n            );\n            $where = array(\n                'parent_id = ?' => $newParent->getId(),\n                $positionField . ' > ?' => $position\n            );\n            $adapter->update($table, $bind, $where);\n        } elseif ($after{{Entity}}Id !== null) {\n            $position = 0;\n            $bind = array(\n                'position' => new Zend_Db_Expr($positionField . ' + 1')\n            );\n            $where = array(\n                'parent_id = ?' => $newParent->getId(),\n                $positionField . ' > ?' => $position\n            );\n            $adapter->update($table, $bind, $where);\n        } else {\n            $select = $adapter->select()\n                ->from($table, array('position' => new Zend_Db_Expr('MIN(' . $positionField. ')')))\n                ->where('parent_id = :parent_id');\n            $position = $adapter->fetchOne($select, array('parent_id' => $newParent->getId()));\n        }\n        $position += 1;\n        return $position;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/100_url_rewrite",
    "content": "\n    /**\n     * check url key\n     *\n     * @access public\n     * @param string $urlKey\n     * @param int $storeId\n     * @param bool $active\n     * @return mixed\n     * {{qwertyuiop}}\n     */\n    public function checkUrlKey($urlKey, $storeId, $active = true)\n    {\n        $stores = array(Mage_Core_Model_App::ADMIN_STORE_ID, $storeId);\n        $select = $this->_initCheckUrlKeySelect($urlKey, $stores);\n        if ($active) {\n            $select->where('e.status = ?', $active);\n        }\n        $select->reset(Zend_Db_Select::COLUMNS)\n            ->columns('e.entity_id')\n            ->limit(1);\n\n        return $this->_getReadAdapter()->fetchOne($select);\n    }\n\n    /**\n     * Check for unique URL key\n     *\n     * @access public\n     * @param Mage_Core_Model_Abstract $object\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function getIsUniqueUrlKey(Mage_Core_Model_Abstract $object)\n    {\n        if (Mage::app()->isSingleStoreMode() || !$object->hasStores()) {\n            $stores = array(Mage_Core_Model_App::ADMIN_STORE_ID);\n        } else {\n            $stores = (array)$object->getData('stores');\n        }\n        $select = $this->_initCheckUrlKeySelect($object->getData('url_key'), $stores);\n        if ($object->getId()) {\n            $select->where('e.entity_id <> ?', $object->getId());\n        }\n        if ($this->_getWriteAdapter()->fetchRow($select)) {\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * Check if the URL key is numeric\n     *\n     * @access public\n     * @param Mage_Core_Model_Abstract $object\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function isNumericUrlKey(Mage_Core_Model_Abstract $object)\n    {\n        return preg_match('/^[0-9]+$/', $object->getData('url_key'));\n    }\n\n    /**\n     * Check if the URL key is valid\n     *\n     * @access public\n     * @param Mage_Core_Model_Abstract $object\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function isValidUrlKey(Mage_Core_Model_Abstract $object)\n    {\n        return preg_match('/^[a-z0-9][a-z0-9_\\/-]+(\\.[a-z0-9_-]+)?$/', $object->getData('url_key'));\n    }\n\n    /**\n     * format string as url key\n     *\n     * @access public\n     * @param string $str\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function formatUrlKey($str)\n    {\n        $urlKey = preg_replace('#[^0-9a-z]+#i', '-', Mage::helper('catalog/product_url')->format($str));\n        $urlKey = strtolower($urlKey);\n        $urlKey = trim($urlKey, '-');\n        return $urlKey;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/103_url_rewrite_store",
    "content": "\n    /**\n     * init the check select\n     *\n     * @access protected\n     * @param string $urlKey\n     * @param array $store\n     * @return Zend_Db_Select\n     * {{qwertyuiop}}\n     */\n    protected function _initCheckUrlKeySelect($urlKey, $store)\n    {\n        $select = $this->_getReadAdapter()->select()\n            ->from(array('e' => $this->getMainTable()))\n            ->join(\n                array('es' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_store')),\n                'e.entity_id = es.{{entity}}_id',\n                array())\n            ->where('e.url_key = ?', $urlKey)\n            ->where('es.store_id IN (?)', $store);\n        return $select;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/107_url_rewrite_no_store",
    "content": "\n    /**\n     * init the check select\n     *\n     * @access protected\n     * @param string $urlKey\n     * @param array $store\n     * @return Zend_Db_Select\n     * {{qwertyuiop}}\n     */\n    protected function _initCheckUrlKeySelect($urlKey, $store)\n    {\n        $select = $this->_getReadAdapter()->select()\n            ->from(array('e' => $this->getMainTable()))\n            ->where('e.url_key = ?', $urlKey);\n        return $select;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/110_url_rewrite_before_save_not_tree",
    "content": "\n    /**\n     * validate before saving\n     *\n     * @access protected\n     * @param $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _beforeSave(Mage_Core_Model_Abstract $object)\n    {\n        {{multipleSelectConvert}}$urlKey = $object->getData('url_key');\n        if ($urlKey == '') {\n            $urlKey = $object->get{{EntityNameMagicCode}}();\n        }\n        $urlKey = $this->formatUrlKey($urlKey);\n        $validKey = false;\n        while (!$validKey) {\n            $entityId = $this->checkUrlKey($urlKey, $object->getStoreId(), false);\n            if ($entityId == $object->getId() || empty($entityId)) {\n                $validKey = true;\n            } else {\n                $parts = explode('-', $urlKey);\n                $last = $parts[count($parts) - 1];\n                if (!is_numeric($last)) {\n                    $urlKey = $urlKey.'-1';\n                } else {\n                    $suffix = '-'.($last + 1);\n                    unset($parts[count($parts) - 1]);\n                    $urlKey = implode('-', $parts).$suffix;\n                }\n            }\n        }\n        $object->setData('url_key', $urlKey);\n        return parent::_beforeSave($object);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/120_url_rewrite_eav",
    "content": "\n    /**\n     * check url key\n     *\n     * @access public\n     * @param string $urlKey\n     * @param bool $active\n     * @return mixed\n     * {{qwertyuiop}}\n     */\n    public function checkUrlKey($urlKey, $storeId, $active = true)\n    {\n        $stores = array(Mage_Core_Model_App::ADMIN_STORE_ID, $storeId);\n        $select = $this->_initCheckUrlKeySelect($urlKey, $stores);\n        if (!$select) {\n            return false;\n        }\n        $select->reset(Zend_Db_Select::COLUMNS)\n            ->columns('e.entity_id')\n            ->limit(1);\n        return $this->_getReadAdapter()->fetchOne($select);\n    }\n\n    /**\n     * init the check select\n     *\n     * @access protected\n     * @param string $urlKey\n     * @param array $store\n     * @return Zend_Db_Select\n     * {{qwertyuiop}}\n     */\n    protected function _initCheckUrlKeySelect($urlKey, $store)\n    {\n        $urlRewrite = Mage::getModel('eav/config')->getAttribute('{{namespace}}_{{module}}_{{entity}}', 'url_key');\n        if (!$urlRewrite || !$urlRewrite->getId()) {\n            return false;\n        }\n        $table = $urlRewrite->getBackend()->getTable();\n        $select = $this->_getReadAdapter()->select()\n            ->from(array('e' => $table))\n            ->where('e.attribute_id = ?', $urlRewrite->getId())\n            ->where('e.value = ?', $urlKey)\n            ->where('e.store_id IN (?)', $store)\n            ->order('e.store_id DESC');\n        return $select;\n    }\n\n    /**\n     * Check for unique URL key\n     *\n     * @access public\n     * @param Mage_Core_Model_Abstract $object\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    public function getIsUniqueUrlKey(Mage_Core_Model_Abstract $object)\n    {\n        if (Mage::app()->isSingleStoreMode() || !$object->hasStores()) {\n            $stores = array(Mage_Core_Model_App::ADMIN_STORE_ID);\n        } else {\n            $stores = (array)$object->getData('stores');\n        }\n        $select = $this->_initCheckUrlKeySelect($object->getData('url_key'), $stores);\n        if ($object->getId()) {\n            $select->where('e.entity_id <> ?', $object->getId());\n        }\n        if ($this->_getWriteAdapter()->fetchRow($select)) {\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * Check if the URL key is numeric\n     *\n     * @access public\n     * @param Mage_Core_Model_Abstract $object\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function isNumericUrlKey(Mage_Core_Model_Abstract $object)\n    {\n        return preg_match('/^[0-9]+$/', $object->getData('url_key'));\n    }\n\n    /**\n     * Check if the URL key is valid\n     *\n     * @access public\n     * @param Mage_Core_Model_Abstract $object\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function isValidUrlKey(Mage_Core_Model_Abstract $object)\n    {\n        return preg_match('/^[a-z0-9][a-z0-9_\\/-]+(\\.[a-z0-9_-]+)?$/', $object->getData('url_key'));\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/130_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Attribute/Collection/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} attribute collection model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Attribute_Collection extends Mage_Eav_Model_Resource_Entity_Attribute_Collection\n{\n    /**\n     * init attribute select\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Attribute_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _initSelect()\n    {\n        $this->getSelect()->from(array('main_table' => $this->getResource()->getMainTable()))\n            ->where(\n                'main_table.entity_type_id=?',\n                Mage::getModel('eav/entity')->setType('{{namespace}}_{{module}}_{{entity}}')->getTypeId()\n            )\n            ->join(\n                array('additional_table' => $this->getTable('{{namespace}}_{{module}}/eav_attribute')),\n                'additional_table.attribute_id=main_table.attribute_id'\n            );\n        return $this;\n    }\n\n    /**\n     * set entity type filter\n     *\n     * @access public\n     * @param string $typeId\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Attribute_Collection\n     * {{qwertyuiop}}\n     */\n    public function setEntityTypeFilter($typeId)\n    {\n        return $this;\n    }\n\n    /**\n     * Specify filter by \"is_visible\" field\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Attribute_Collection\n     * {{qwertyuiop}}\n     */\n    public function addVisibleFilter()\n    {\n        return $this->addFieldToFilter('additional_table.is_visible', 1);\n    }\n\n    /**\n     * Specify filter by \"is_editable\" field\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Attribute_Collection\n     * {{qwertyuiop}}\n     */\n    public function addEditableFilter()\n    {\n        return $this->addFieldToFilter('additional_table.is_editable', 1);\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Category/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} - Categories relation model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category extends Mage_Core_Model_Resource_Db_Abstract\n{\n    /**\n     * initialize resource model\n     *\n     * @access protected\n     * @return void\n     * @see Mage_Core_Model_Resource_Abstract::_construct()\n     * {{qwertyuiop}}\n     */\n    protected function  _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_category', 'rel_id');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Category/020_not_tree",
    "content": "\n    /**\n     * Save {{entityLabel}} - category relations\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}}, $data)\n    {\n        if (!is_array($data)) {\n            $data = array();\n        }\n        $deleteCondition = $this->_getWriteAdapter()->quoteInto('{{entity}}_id=?', ${{entity}}->getId());\n        $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);\n\n        foreach ($data as $categoryId) {\n            if (!empty($categoryId)) {\n                $insert = array(\n                    '{{entity}}_id' => ${{entity}}->getId(),\n                    'category_id'   => $categoryId,\n                    'position'      => 1\n                );\n                $this->_getWriteAdapter()->insertOnDuplicate($this->getMainTable(), $insert, array_keys($insert));\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Save  category - {{entityLabel}} relations\n     *\n     * @access public\n     * @param Mage_Catalog_Model_Category $category\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category\n     * {{qwertyuiop}}\n     */\n    public function saveCategoryRelation($category, $data)\n    {\n        if (!is_array($data)) {\n            $data = array();\n        }\n        $deleteCondition = $this->_getWriteAdapter()->quoteInto('category_id=?', $category->getId());\n        $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);\n\n        foreach ($data as ${{entity}}Id => $info) {\n            $this->_getWriteAdapter()->insert(\n                $this->getMainTable(),\n                array(\n                    '{{entity}}_id' => ${{entity}}Id,\n                    'category_id'   => $category->getId(),\n                    'position'      => @$info['position']\n                )\n            );\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Category/030_tree",
    "content": "\n    /**\n     * Save {{entityLabel}} - category relations\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}}, $data)\n    {\n        if (!is_array($data)) {\n            $data = array();\n        }\n        $deleteCondition = $this->_getWriteAdapter()->quoteInto('{{entity}}_id=?', ${{entity}}->getId());\n        $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);\n\n        foreach ($data as $categoryId) {\n            if (!empty($categoryId)) {\n                $insert = array(\n                    '{{entity}}_id' => ${{entity}}->getId(),\n                    'category_id'   => $categoryId,\n                    'position'      => 1\n                );\n                $this->_getWriteAdapter()->insertOnDuplicate($this->getMainTable(), $insert, array_keys($insert));\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Save  category - {{entityLabel}} relations\n     *\n     * @access public\n     * @param Mage_Catalog_Model_Category $category\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category\n     * {{qwertyuiop}}\n     */\n    public function saveCategoryRelation($category, ${{entity}}Ids)\n    {\n\n        $old{{Entities}} = Mage::helper('{{namespace}}_{{module}}/category')->getSelected{{Entities}}($category);\n        $old{{Entity}}Ids = array();\n        foreach ($old{{Entities}} as ${{entity}}) {\n            $old{{Entity}}Ids[] = ${{entity}}->getId();\n        }\n        $insert = array_diff(${{entity}}Ids, $old{{Entity}}Ids);\n        $delete = array_diff($old{{Entity}}Ids, ${{entity}}Ids);\n        $write = $this->_getWriteAdapter();\n        if (!empty($insert)) {\n            $data = array();\n            foreach ($insert as ${{entity}}Id) {\n                if (empty(${{entity}}Id)) {\n                    continue;\n                }\n                $data[] = array(\n                    '{{entity}}_id' => (int)${{entity}}Id,\n                    'category_id'  => (int)$category->getId(),\n                    'position'=> 1\n                );\n            }\n            if ($data) {\n                $write->insertMultiple($this->getMainTable(), $data);\n            }\n        }\n        if (!empty($delete)) {\n            foreach ($delete as ${{entity}}Id) {\n                $where = array(\n                    'category_id = ?'   => (int)$category->getId(),\n                    '{{entity}}_id = ?' => (int)${{entity}}Id,\n                );\n                $write->delete($this->getMainTable(), $where);\n            }\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Category/040_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Category/Collection/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} - Category relation resource model collection\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category_Collection extends Mage_Catalog_Model_Resource_Category_Collection\n{\n    /**\n     * remember if fields have been joined\n     *\n     * @var bool\n     */\n    protected $_joinedFields = false;\n\n    /**\n     * join the link table\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category_Collection\n     * {{qwertyuiop}}\n     */\n    public function joinFields()\n    {\n        if (!$this->_joinedFields) {\n            $this->getSelect()->join(\n                array('related' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_category')),\n                'related.category_id = e.entity_id',\n                array('position')\n            );\n            $this->_joinedFields = true;\n        }\n        return $this;\n    }\n\n    /**\n     * add {{entityLabel}} filter\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} | int ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Category_Collection\n     * {{qwertyuiop}}\n     */\n    public function add{{Entity}}Filter(${{entity}})\n    {\n        if (${{entity}} instanceof {{Namespace}}_{{Module}}_Model_{{Entity}}) {\n            ${{entity}} = ${{entity}}->getId();\n        }\n        if (!$this->_joinedFields) {\n            $this->joinFields();\n        }\n        $this->getSelect()->where('related.{{entity}}_id = ?', ${{entity}});\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} collection resource model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection extends {{ResourceCollectionParent}}\n{\n    protected $_joinedFields = array();\n\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        parent::_construct();\n        $this->_init('{{namespace}}_{{module}}/{{entity}}');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/020_top_store",
    "content": "        $this->_map['fields']['store'] = 'store_table.store_id';\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/030_content",
    "content": "    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/040_store",
    "content": "\n    /**\n     * Add filter by store\n     *\n     * @access public\n     * @param int|Mage_Core_Model_Store $store\n     * @param bool $withAdmin\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addStoreFilter($store, $withAdmin = true)\n    {\n        if (!isset($this->_joinedFields['store'])) {\n            if ($store instanceof Mage_Core_Model_Store) {\n                $store = array($store->getId());\n            }\n            if (!is_array($store)) {\n                $store = array($store);\n            }\n            if ($withAdmin) {\n                $store[] = Mage_Core_Model_App::ADMIN_STORE_ID;\n            }\n            $this->addFilter('store', array('in' => $store), 'public');\n            $this->_joinedFields['store'] = true;\n        }\n        return $this;\n    }\n\n    /**\n     * Join store relation table if there is store filter\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _renderFiltersBefore()\n    {\n        if ($this->getFilter('store')) {\n            $this->getSelect()->join(\n                array('store_table' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_store')),\n                'main_table.entity_id = store_table.{{entity}}_id',\n                array()\n            )\n            ->group('main_table.entity_id');\n            /*\n             * Allow analytic functions usage because of one field grouping\n             */\n            $this->_useAnalyticFunction = true;\n        }\n        return parent::_renderFiltersBefore();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/050_tree",
    "content": "\n    /**\n     * Add Id filter\n     *\n     * @access public\n     * @param array ${{entity}}Ids\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addIdFilter(${{entity}}Ids)\n    {\n        if (is_array(${{entity}}Ids)) {\n            if (empty(${{entity}}Ids)) {\n                $condition = '';\n            } else {\n                $condition = array('in' => ${{entity}}Ids);\n            }\n        } elseif (is_numeric(${{entity}}Ids)) {\n            $condition = ${{entity}}Ids;\n        } elseif (is_string(${{entity}}Ids)) {\n            $ids = explode(',', ${{entity}}Ids);\n            if (empty($ids)) {\n                $condition = ${{entity}}Ids;\n            } else {\n                $condition = array('in' => $ids);\n            }\n        }\n        $this->addFieldToFilter('entity_id', $condition);\n        return $this;\n    }\n\n    /**\n     * Add {{entityLabel}} path filter\n     *\n     * @access public\n     * @param string $regexp\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addPathFilter($regexp)\n    {\n        $this->addFieldToFilter('path', array('regexp' => $regexp));\n        return $this;\n    }\n\n    /**\n     * Add {{entityLabel}} path filter\n     *\n     * @access public\n     * @param array|string $paths\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addPathsFilter($paths)\n    {\n        if (!is_array($paths)) {\n            $paths = array($paths);\n        }\n        $write  = $this->getResource()->getWriteConnection();\n        $cond   = array();\n        foreach ($paths as $path) {\n            $cond[] = $write->quoteInto('e.path LIKE ?', \"$path%\");\n        }\n        if ($cond) {\n            $this->getSelect()->where(join(' OR ', $cond));\n        }\n        return $this;\n    }\n\n    /**\n     * Add {{entityLabel}} level filter\n     *\n     * @access public\n     * @param int|string $level\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addLevelFilter($level)\n    {\n        $this->addFieldToFilter('level', array('lteq' => $level));\n        return $this;\n    }\n\n    /**\n     * Add root {{entityLabel}} filter\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     */\n    public function addRootLevelFilter()\n    {\n        $this->addFieldToFilter('path', array('neq' => '1'));\n        $this->addLevelFilter(1);\n        return $this;\n    }\n\n    /**\n     * Add order field\n     *\n     * @access public\n     * @param string $field\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     */\n    public function addOrderField($field)\n    {\n        $this->setOrder($field, self::SORT_ORDER_ASC);\n        return $this;\n    }\n\n    /**\n     * Add active {{entityLabel}} filter\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     */\n    public function addStatusFilter($status = 1)\n    {\n        $this->addFieldToFilter('status', $status);\n        return $this;\n    }\n\n    /**\n     * get {{entitiesLabel}} as array\n     *\n     * @access protected\n     * @param string $valueField\n     * @param string $labelField\n     * @param array $additional\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _toOptionArray($valueField='entity_id', $labelField='{{nameAttributeCode}}', $additional=array())\n    {\n        $res = array();\n        $additional['value'] = $valueField;\n        $additional['label'] = $labelField;\n\n        foreach ($this as $item) {\n            if ($item->getId() == Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()) {\n                continue;\n            }\n            foreach ($additional as $code => $field) {\n                $data[$code] = $item->getData($field);\n            }\n            $res[] = $data;\n        }\n        return $res;\n    }\n\n    /**\n     * get options hash\n     *\n     * @access protected\n     * @param string $valueField\n     * @param string $labelField\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _toOptionHash($valueField='entity_id', $labelField='{{nameAttributeCode}}')\n    {\n        $res = array();\n        foreach ($this as $item) {\n            if ($item->getId() == Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id()) {\n                continue;\n            }\n            $res[$item->getData($valueField)] = $item->getData($labelField);\n        }\n        return $res;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/060_not_tree",
    "content": "\n    /**\n     * get {{entitiesLabel}} as array\n     *\n     * @access protected\n     * @param string $valueField\n     * @param string $labelField\n     * @param array $additional\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _toOptionArray($valueField='entity_id', $labelField='{{nameAttributeCode}}', $additional=array())\n    {\n        {{toOptionAddition}}return parent::_toOptionArray($valueField, $labelField, $additional);\n    }\n\n    /**\n     * get options hash\n     *\n     * @access protected\n     * @param string $valueField\n     * @param string $labelField\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _toOptionHash($valueField='entity_id', $labelField='{{nameAttributeCode}}')\n    {\n        {{toOptionAddition}}return parent::_toOptionHash($valueField, $labelField);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/070_product_relation",
    "content": "\n    /**\n     * add the product filter to collection\n     *\n     * @access public\n     * @param mixed (Mage_Catalog_Model_Product|int) $product\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addProductFilter($product)\n    {\n        if ($product instanceof Mage_Catalog_Model_Product) {\n            $product = $product->getId();\n        }\n        if (!isset($this->_joinedFields['product'])) {\n            $this->getSelect()->join(\n                array('related_product' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_product')),\n                'related_product.{{entity}}_id = {{entityTableAlias}}.entity_id',\n                array('position')\n            );\n            $this->getSelect()->where('related_product.product_id = ?', $product);\n            $this->_joinedFields['product'] = true;\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/080_category_relation",
    "content": "\n    /**\n     * add the category filter to collection\n     *\n     * @access public\n     * @param mixed (Mage_Catalog_Model_Category|int) $category\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addCategoryFilter($category)\n    {\n        if ($category instanceof Mage_Catalog_Model_Category) {\n            $category = $category->getId();\n        }\n        if (!isset($this->_joinedFields['category'])) {\n            $this->getSelect()->join(\n                array('related_category' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_category')),\n                'related_category.{{entity}}_id = {{entityTableAlias}}.entity_id',\n                array('position')\n            );\n            $this->getSelect()->where('related_category.category_id = ?', $category);\n            $this->_joinedFields['category'] = true;\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/090_sibling_relation",
    "content": "\n    /**\n     * add the {{sibling}} filter to collection\n     *\n     * @access public\n     * @param mixed ({{Namespace}}_{{Module}}_Model_{{Sibling}}|int) ${{sibling}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function add{{Sibling}}Filter(${{sibling}})\n    {\n        if (${{sibling}} instanceof {{Namespace}}_{{Module}}_Model_{{Sibling}}) {\n            ${{sibling}} = ${{sibling}}->getId();\n        }\n        if (!isset($this->_joinedFields['{{sibling}}'])) {\n            $this->getSelect()->join(\n                array('related_{{sibling}}' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_{{sibling}}')),\n                'related_{{sibling}}.{{entity}}_id = {{entityTableAlias}}.entity_id',\n                array('position')\n            );\n            $this->getSelect()->where('related_{{sibling}}.{{sibling}}_id = ?', ${{sibling}});\n            $this->_joinedFields['{{sibling}}'] = true;\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Collection/100_footer",
    "content": "\n    /**\n     * Get SQL for get record count.\n     * Extra GROUP BY strip added.\n     *\n     * @access public\n     * @return Varien_Db_Select\n     * {{qwertyuiop}}\n     */\n    public function getSelectCountSql()\n    {\n        $countSelect = parent::getSelectCountSql();\n        $countSelect->reset(Zend_Db_Select::GROUP);\n        return $countSelect;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comments resource model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment extends Mage_Core_Model_Resource_Db_Abstract\n{\n    /**\n     * constructor\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_comment', 'comment_id');\n    }\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/020_store",
    "content": "\n    /**\n     * Get store ids to which specified item is assigned\n     *\n     * @access public\n     * @param int ${{entity}}Id\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function lookupStoreIds($commentId)\n    {\n        $adapter = $this->_getReadAdapter();\n        $select  = $adapter->select()\n            ->from($this->getTable('{{namespace}}_{{module}}/{{entity}}_comment_store'), 'store_id')\n            ->where('comment_id = ?', (int)$commentId);\n        return $adapter->fetchCol($select);\n    }\n\n    /**\n     * Perform operations after object load\n     *\n     * @access public\n     * @param Mage_Core_Model_Abstract $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment\n     * {{qwertyuiop}}\n     */\n    protected function _afterLoad(Mage_Core_Model_Abstract $object)\n    {\n        if ($object->getId()) {\n            $stores = $this->lookupStoreIds($object->getId());\n            $object->setData('store_id', $stores);\n        }\n        return parent::_afterLoad($object);\n    }\n\n    /**\n     * Retrieve select object for load object data\n     *\n     * @param string $field\n     * @param mixed $value\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment $object\n     * @return Zend_Db_Select\n     */\n    protected function _getLoadSelect($field, $value, $object)\n    {\n        $select = parent::_getLoadSelect($field, $value, $object);\n        if ($object->getStoreId()) {\n            $storeIds = array(Mage_Core_Model_App::ADMIN_STORE_ID, (int)$object->getStoreId());\n            $select->join(\n                array('{{module}}_{{entity}}_comment_store' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_comment_store')),\n                $this->getMainTable() . '.comment_id = {{module}}_{{entity}}_comment_store.comment_id',\n                array()\n            )\n            ->where('{{module}}_{{entity}}_comment_store.store_id IN (?)', $storeIds)\n            ->order('{{module}}_{{entity}}_comment_store.store_id DESC')\n            ->limit(1);\n        }\n        return $select;\n    }\n\n    /**\n     * Assign {{entityLabel}} comments to store views\n     *\n     * @access protected\n     * @param Mage_Core_Model_Abstract $object\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment\n     * {{qwertyuiop}}\n     */\n    protected function _afterSave(Mage_Core_Model_Abstract $object)\n    {\n        $oldStores = $this->lookupStoreIds($object->getId());\n        $newStores = (array)$object->getStores();\n        if (empty($newStores)) {\n            $newStores = (array)$object->getStoreId();\n        }\n        $table  = $this->getTable('{{namespace}}_{{module}}/{{entity}}_comment_store');\n        $insert = array_diff($newStores, $oldStores);\n        $delete = array_diff($oldStores, $newStores);\n        if ($delete) {\n            $where = array(\n                'comment_id = ?'  => (int) $object->getId(),\n                'store_id IN (?)' => $delete\n            );\n            $this->_getWriteAdapter()->delete($table, $where);\n        }\n        if ($insert) {\n            $data = array();\n            foreach ($insert as $storeId) {\n                $data[] = array(\n                    'comment_id'  => (int) $object->getId(),\n                    'store_id'    => (int) $storeId\n                );\n            }\n            $this->_getWriteAdapter()->insertMultiple($table, $data);\n        }\n        return parent::_afterSave($object);\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/030_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Collection/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comments collection resource model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract\n{\n    protected $_joinedFields = array();\n\n    /**\n     * constructor\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function _construct()\n    {\n        parent::_construct();\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_comment');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Collection/020_top_store",
    "content": "        $this->_map['fields']['store'] = 'store_table.store_id';\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Collection/030_content",
    "content": "    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Collection/040_store",
    "content": "\n    /**\n     * Add filter by store\n     *\n     * @access public\n     * @param int|Mage_Core_Model_Store $store\n     * @param bool $withAdmin\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_Collection\n     * {{qwertyuiop}}\n     */\n    public function addStoreFilter($store, $withAdmin = true)\n    {\n        if (!isset($this->_joinedFields['store'])) {\n            if ($store instanceof Mage_Core_Model_Store) {\n                $store = array($store->getId());\n            }\n            if (!is_array($store)) {\n                $store = array($store);\n            }\n            if ($withAdmin) {\n                $store[] = Mage_Core_Model_App::ADMIN_STORE_ID;\n            }\n            $this->addFilter('store', array('in' => $store), 'public');\n            $this->_joinedFields['store'] = true;\n        }\n        return $this;\n    }\n\n    /**\n     * Join store relation table if there is store filter\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _renderFiltersBefore()\n    {\n        if ($this->getFilter('store')) {\n            $this->getSelect()->join(\n                array('store_table' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_comment_store')),\n                'main_table.comment_id = store_table.comment_id',\n                array()\n            )\n            ->group('main_table.comment_id');\n            /*\n             * Allow analytic functions usage because of one field grouping\n             */\n            $this->_useAnalyticFunction = true;\n        }\n        return parent::_renderFiltersBefore();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Collection/050_footer",
    "content": "\n    /**\n     * Get SQL for get record count.\n     * Extra GROUP BY strip added.\n     *\n     * @access public\n     * @return Varien_Db_Select\n     * {{qwertyuiop}}\n     */\n    public function getSelectCountSql()\n    {\n        $countSelect = parent::getSelectCountSql();\n        $countSelect->reset(Zend_Db_Select::GROUP);\n        return $countSelect;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comments resource collection model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection extends {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n{\n    /**\n     * Entities alias\n     *\n     * @var array\n     */\n    protected $_entitiesAlias        = array();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/020_store_var",
    "content": "\n    /**\n     * Comment store table\n     *\n     * @var string\n     */\n    protected $_commentStoreTable;\n\n    /**\n     * Add store data flag\n     *\n     * @var boolean\n     */\n    protected $_addStoreDataFlag     = false;\n\n    /**\n     * Filter by stores for the collection\n     *\n     * @var array\n     */\n    protected $_storesIds           = array();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/030_construct",
    "content": "\n    /**\n     * construct\n     *\n     * @access protected\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}');\n        $this->_setIdFieldName('comment_id');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/040_construct_store",
    "content": "        $this->_commentStoreTable = Mage::getSingleton('core/resource')\n            ->getTableName('{{namespace}}_{{module}}/{{entity}}_comment_store');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/050_content",
    "content": "    }\n\n    /**\n     * init select\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _initSelect()\n    {\n        parent::_initSelect();\n        $this->_joinFields();\n        return $this;\n    }\n\n    /**\n     * Add customer filter\n     *\n     * @access public\n     * @param int $customerId\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addCustomerFilter($customerId)\n    {\n        $this->getSelect()->where('ct.customer_id = ?', $customerId);\n        return $this;\n    }\n\n    /**\n     * Add entity filter\n     *\n     * @access public\n     * @param int $entityId\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addEntityFilter($entityId)\n    {\n        $this->getSelect()->where('ct.{{entity}}_id = ?', $entityId);\n        return $this;\n    }\n\n    /**\n     * Add status filter\n     *\n     * @access public\n     * @param mixed $status\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addStatusFilter($status = 1)\n    {\n        $this->getSelect()->where('ct.status = ?', $status);\n        return $this;\n    }\n\n    /**\n     * Set date order\n     *\n     * @access public\n     * @param string $dir\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function setDateOrder($dir = 'DESC')\n    {\n        $this->setOrder('ct.created_at', $dir);\n        return $this;\n    }\n\n    /**\n     * join fields to entity\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _joinFields()\n    {\n        $commentTable = Mage::getSingleton('core/resource')\n            ->getTableName('{{namespace}}_{{module}}/{{entity}}_comment');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/060_eav_title",
    "content": "        $this->addAttributeToSelect('{{nameAttributeCode}}');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/070_more_content",
    "content": "        $this->getSelect()->join(\n            array('ct' => $commentTable),\n            'ct.{{entity}}_id = {{entityTableAlias}}.entity_id',\n            array(\n                'ct_title'      => 'title',\n                'ct_comment_id' => 'comment_id',\n                'ct_name'       => 'name',\n                'ct_status'     => 'status',\n                'ct_email'      => 'email',\n                'ct_created_at' => 'created_at',\n                'ct_updated_at' => 'updated_at'\n            )\n        );\n        return $this;\n    }\n\n    /**\n     * Retrieve all ids for collection\n     *\n     * @access public\n     * @param mixed $limit\n     * @param mixed $offset\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getAllIds($limit = null, $offset = null)\n    {\n        $idsSelect = clone $this->getSelect();\n        $idsSelect->reset(Zend_Db_Select::ORDER);\n        $idsSelect->reset(Zend_Db_Select::LIMIT_COUNT);\n        $idsSelect->reset(Zend_Db_Select::LIMIT_OFFSET);\n        $idsSelect->reset(Zend_Db_Select::COLUMNS);\n        $idsSelect->columns('ct.comment_id');\n        return $this->getConnection()->fetchCol($idsSelect);\n    }\n\n    /**\n     * Retrieves column values\n     *\n     * @access public\n     * @param string $colName\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getColumnValues($colName)\n    {\n        $col = array();\n        foreach ($this->getItems() as $item) {\n            $col[] = $item->getData($colName);\n        }\n        return $col;\n    }\n    /**\n     * Render SQL for retrieve product count\n     *\n     * @access public\n     * @return string\n     * {{qwertyuiop}}\n     */\n    public function getSelectCountSql()\n    {\n        $select = parent::getSelectCountSql();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/073_select_count_store",
    "content": "        $this->_applyStoresFilterToSelect($select);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/075_select_sql",
    "content": "        $select->reset(Zend_Db_Select::COLUMNS)\n            ->columns('COUNT({{entityTableAlias}}.entity_id)')\n            ->reset(Zend_Db_Select::HAVING);\n\n        return $select;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/080_store_top",
    "content": "\n    /**\n     * Adds store filter into array\n     *\n     * @access public\n     * @param mixed $storeId\n     * @param bool $withAdmin\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addStoreFilter($storeId = null, $withAdmin = true)\n    {\n        if (is_null($storeId)) {\n            $storeId = $this->getStoreId();\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/090_flat_store",
    "content": "        parent::addStoreFilter($storeId, $withAdmin);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/100_store",
    "content": "        if (!is_array($storeId)) {\n            $storeId = array($storeId);\n        }\n        if (!empty($this->_storesIds)) {\n            $this->_storesIds = array_intersect($this->_storesIds, $storeId);\n        } else {\n            $this->_storesIds = $storeId;\n        }\n\n        return $this;\n    }\n\n    /**\n     * Adds specific store id into array\n     *\n     * @access public\n     * @param array $storeId\n     * @param bool $withAdmin\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function setStoreFilter($storeId, $withAdmin = false)\n    {\n        if (is_array($storeId) && isset($storeId['eq'])) {\n            $storeId = array_shift($storeId);\n        }\n\n        if (!is_array($storeId)) {\n            $storeId = array($storeId);\n        }\n\n        if (!empty($this->_storesIds)) {\n            $this->_storesIds = array_intersect($this->_storesIds, $storeId);\n        } else {\n            $this->_storesIds = $storeId;\n        }\n        if ($withAdmin) {\n            $this->_storesIds = array_merge($this->_storesIds, array(0));\n        }\n        return $this;\n    }\n\n    /**\n     * Applies all store filters in one place to prevent multiple joins in select\n     *\n     * @access protected\n     * @param null|Zend_Db_Select $select\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _applyStoresFilterToSelect(Zend_Db_Select $select = null)\n    {\n        $adapter = $this->getConnection();\n        $storesIds = $this->_storesIds;\n        if (is_null($select)) {\n            $select = $this->getSelect();\n        }\n\n        if (is_array($storesIds) && (count($storesIds) == 1)) {\n            $storesIds = array_shift($storesIds);\n        }\n\n        if (is_array($storesIds) && !empty($storesIds)) {\n            $inCond = $adapter->prepareSqlCondition('store.store_id', array('in' => $storesIds));\n            $select->join(\n                array('store' => $this->_commentStoreTable),\n                'ct.comment_id=store.comment_id AND ' . $inCond,\n                array()\n            )\n            ->group('ct.comment_id');\n\n            $this->_useAnalyticFunction = true;\n        } elseif (!empty($storesIds)) {\n            $select->join(\n                array('store' => $this->_commentStoreTable),\n                $adapter->quoteInto('ct.comment_id=store.comment_id AND store.store_id = ?', (int)$storesIds),\n                array()\n            );\n        }\n        return $this;\n    }\n\n    /**\n     * Add stores data\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function addStoreData()\n    {\n        $this->_addStoreDataFlag = true;\n        return $this;\n    }\n    /**\n     * Action after load\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _afterLoad()\n    {\n        parent::_afterLoad();\n        if ($this->_addStoreDataFlag) {\n            $this->_addStoreData();\n        }\n        return $this;\n    }\n\n    /**\n     * Add store data\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    protected function _addStoreData()\n    {\n        $adapter = $this->getConnection();\n        $commentIds = $this->getColumnValues('ct_comment_id');\n        $storesToComments = array();\n        if (count($commentIds)>0) {\n            $commentIdCondition = $this->_getConditionSql('comment_id', array('in' => $commentIds));\n            $select = $adapter->select()\n                ->from($this->_commentStoreTable)\n                ->where($commentIdCondition);\n            $result = $adapter->fetchAll($select);\n            foreach ($result as $row) {\n                if (!isset($storesToComments[$row['comment_id']])) {\n                    $storesToComments[$row['comment_id']] = array();\n                }\n                $storesToComments[$row['comment_id']][] = $row['store_id'];\n            }\n        }\n\n        foreach ($this as $item) {\n            if (isset($storesToComments[$item->getCtCommentId()])) {\n                $item->setData('stores', $storesToComments[$item->getCtCommentId()]);\n            } else {\n                $item->setData('stores', array());\n            }\n        }\n        return $this;\n    }\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/110_filter",
    "content": "\n    /**\n     * Add attribute to filter\n     *\n     * @access public\n     * @param Mage_Eav_Model_Entity_Attribute_Abstract|string $attribute\n     * @param array $condition\n     * @param string $joinType\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Comment_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function {{filterMethod}}($attribute, $condition = null, $joinType = 'inner')\n    {\n        switch($attribute) {\n            case 'ct.comment_id':\n            case 'ct.created_at':\n            case 'ct.status':\n            case 'ct.title':\n            case 'ct.name':\n            case 'ct.email':\n            case 'ct.comment':\n            case 'ct.updated_at':\n                $conditionSql = $this->_getConditionSql($attribute, $condition);\n                $this->getSelect()->where($conditionSql);\n                break;\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/120_store_filter",
    "content": "            case 'stores':\n                $this->setStoreFilter($condition);\n                break;\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Comment/Entity/Collection/130_footer",
    "content": "            default:\n                parent::{{filterMethod}}($attribute, $condition, $joinType);\n                break;\n        }\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Product/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} - product relation model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product extends Mage_Core_Model_Resource_Db_Abstract\n{\n    /**\n     * initialize resource model\n     *\n     * @access protected\n     * @see Mage_Core_Model_Resource_Abstract::_construct()\n     * {{qwertyuiop}}\n     */\n    protected function  _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_product', 'rel_id');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Product/020_not_tree",
    "content": "    /**\n     * Save {{entityLabel}} - product relations\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}}, $data)\n    {\n        if (!is_array($data)) {\n            $data = array();\n        }\n        $deleteCondition = $this->_getWriteAdapter()->quoteInto('{{entity}}_id=?', ${{entity}}->getId());\n        $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);\n\n        foreach ($data as $productId => $info) {\n            $this->_getWriteAdapter()->insert(\n                $this->getMainTable(),\n                array(\n                    '{{entity}}_id' => ${{entity}}->getId(),\n                    'product_id'    => $productId,\n                    'position'      => @$info['position']\n                )\n            );\n        }\n        return $this;\n    }\n\n    /**\n     * Save  product - {{entityLabel}} relations\n     *\n     * @access public\n     * @param Mage_Catalog_Model_Product $prooduct\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product\n     * {{qwertyuiop}}\n     */\n    public function saveProductRelation($product, $data)\n    {\n        if (!is_array($data)) {\n            $data = array();\n        }\n        $deleteCondition = $this->_getWriteAdapter()->quoteInto('product_id=?', $product->getId());\n        $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);\n\n        foreach ($data as ${{entity}}Id => $info) {\n            $this->_getWriteAdapter()->insert(\n                $this->getMainTable(),\n                array(\n                    '{{entity}}_id' => ${{entity}}Id,\n                    'product_id'    => $product->getId(),\n                    'position'      => @$info['position']\n                )\n            );\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Product/030_tree",
    "content": "\n    /**\n     * Save {{entityLabel}} - product relations\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}}, $data)\n    {\n        if (!is_array($data)) {\n            $data = array();\n        }\n        $deleteCondition = $this->_getWriteAdapter()->quoteInto('{{entity}}_id=?', ${{entity}}->getId());\n        $this->_getWriteAdapter()->delete($this->getMainTable(), $deleteCondition);\n\n        foreach ($data as $productId => $info) {\n            $this->_getWriteAdapter()->insert(\n                $this->getMainTable(),\n                array(\n                    '{{entity}}_id' => ${{entity}}->getId(),\n                    'product_id'    => $productId,\n                    'position'      => @$info['position']\n                )\n            );\n        }\n        return $this;\n    }\n\n    /**\n     * Save  product - {{entityLabel}} relations\n     *\n     * @access public\n     * @param Mage_Catalog_Model_Product $prooduct\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product\n     * {{qwertyuiop}}\n     */\n    public function saveProductRelation($product, ${{entity}}Ids)\n    {\n        $old{{Entities}} = Mage::helper('{{namespace}}_{{module}}/product')->getSelected{{Entities}}($product);\n        $old{{Entity}}Ids = array();\n        foreach ($old{{Entities}} as ${{entity}}) {\n            $old{{Entity}}Ids[] = ${{entity}}->getId();\n        }\n        $insert = array_diff(${{entity}}Ids, $old{{Entity}}Ids);\n        $delete = array_diff($old{{Entity}}Ids, ${{entity}}Ids);\n        $write = $this->_getWriteAdapter();\n        if (!empty($insert)) {\n            $data = array();\n            foreach ($insert as ${{entity}}Id) {\n                if (empty(${{entity}}Id)) {\n                    continue;\n                }\n                $data[] = array(\n                    '{{entity}}_id' => (int)${{entity}}Id,\n                    'product_id'  => (int)$product->getId(),\n                    'position'=> 1\n                );\n            }\n            if ($data) {\n                $write->insertMultiple($this->getMainTable(), $data);\n            }\n        }\n        if (!empty($delete)) {\n            foreach ($delete as ${{entity}}Id) {\n                $where = array(\n                    'product_id = ?'  => (int)$product->getId(),\n                    '{{entity}}_id = ?' => (int)${{entity}}Id,\n                );\n                $write->delete($this->getMainTable(), $where);\n            }\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Product/040_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Product/Collection/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} - product relation resource model collection\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product_Collection extends Mage_Catalog_Model_Resource_Product_Collection\n{\n    /**\n     * remember if fields have been joined\n     *\n     * @var bool\n     */\n    protected $_joinedFields = false;\n\n    /**\n     * join the link table\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product_Collection\n     * {{qwertyuiop}}\n     */\n    public function joinFields()\n    {\n        if (!$this->_joinedFields) {\n            $this->getSelect()->join(\n                array('related' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_product')),\n                'related.product_id = e.entity_id',\n                array('position')\n            );\n            $this->_joinedFields = true;\n        }\n        return $this;\n    }\n\n    /**\n     * add {{entityLabel}} filter\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} | int ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Product_Collection\n     * {{qwertyuiop}}\n     */\n    public function add{{Entity}}Filter(${{entity}})\n    {\n        if (${{entity}} instanceof {{Namespace}}_{{Module}}_Model_{{Entity}}) {\n            ${{entity}} = ${{entity}}->getId();\n        }\n        if (!$this->_joinedFields ) {\n            $this->joinFields();\n        }\n        $this->getSelect()->where('related.{{entity}}_id = ?', ${{entity}});\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Sibling/010_top",
    "content": "<?php \n{{License}}\n/**\n * {{EntityLabel}} - {{SiblingLabel}} relation model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}} extends Mage_Core_Model_Resource_Db_Abstract\n{\n    /**\n     * initialize resource model\n     *\n     * @access protected\n     * @return void\n     * @see Mage_Core_Model_Resource_Abstract::_construct()\n     * {{qwertyuiop}}\n     */\n    protected function  _construct()\n    {\n        $this->_init('{{namespace}}_{{module}}/{{entity}}_{{sibling}}', 'rel_id');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Sibling/020_save_relation",
    "content": "\n    /**\n     * Save {{entityLabel}} - {{siblingLabel}} relations\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}}, $data)\n    {\n        if (!is_array($data)) {\n            $data = array();\n        }\n\n        $adapter = $this->_getWriteAdapter();\n        $bind    = array(\n            ':{{entity}}_id'    => (int)${{entity}}->getId(),\n        );\n        $select = $adapter->select()\n            ->from($this->getMainTable(), array('rel_id', '{{sibling}}_id'))\n            ->where('{{entity}}_id = :{{entity}}_id');\n\n        $related   = $adapter->fetchPairs($select, $bind);\n        $deleteIds = array();\n        foreach ($related as $relId => ${{sibling}}Id) {\n            if (!isset($data[${{sibling}}Id])) {\n                $deleteIds[] = (int)$relId;\n            }\n        }\n        if (!empty($deleteIds)) {\n            $adapter->delete(\n                $this->getMainTable(),\n                array('rel_id IN (?)' => $deleteIds)\n            );\n        }\n\n        foreach ($data as ${{sibling}}Id => $info) {\n            $adapter->insertOnDuplicate(\n                $this->getMainTable(),\n                array(\n                    '{{entity}}_id'      => ${{entity}}->getId(),\n                    '{{sibling}}_id'     => ${{sibling}}Id,\n                    'position'      => @$info['position']\n                ),\n                array('position')\n            );\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Sibling/030_save_relation_tree",
    "content": "\n    /**\n     * Save {{entityLabel}} - {{siblingLabel}} relations\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} ${{entity}}\n     * @param array $data\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}\n     * {{qwertyuiop}}\n     */\n    public function save{{Entity}}Relation(${{entity}}, ${{sibling}}Ids)\n    {\n        if (is_null(${{sibling}}Ids)) {\n            return $this;\n        }\n        $old{{Siblings}} = ${{entity}}->getSelected{{Siblings}}();\n        $old{{Sibling}}Ids = array();\n        foreach ($old{{Siblings}} as ${{sibling}}) {\n            $old{{Sibling}}Ids[] = ${{sibling}}->getId();\n        }\n        $insert = array_diff(${{sibling}}Ids, $old{{Sibling}}Ids);\n        $delete = array_diff($old{{Sibling}}Ids, ${{sibling}}Ids);\n        $write = $this->_getWriteAdapter();\n        if (!empty($insert)) {\n            $data = array();\n            foreach ($insert as ${{sibling}}Id) {\n                if (empty(${{sibling}}Id)) {\n                    continue;\n                }\n                $data[] = array(\n                    '{{sibling}}_id' => (int)${{sibling}}Id,\n                    '{{entity}}_id'  => (int)${{entity}}->getId(),\n                    'position'=> 1\n                );\n            }\n            if ($data) {\n                $write->insertMultiple($this->getMainTable(), $data);\n            }\n        }\n        if (!empty($delete)) {\n            foreach ($delete as ${{sibling}}Id) {\n                $where = array(\n                    '{{entity}}_id = ?'  => (int)${{entity}}->getId(),\n                    '{{sibling}}_id = ?' => (int)${{sibling}}Id,\n                );\n                $write->delete($this->getMainTable(), $where);\n            }\n        }\n        return $this;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Sibling/040_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Sibling/Collection/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} - {{SiblingLabel}} relation resource model collection\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}_Collection extends {{Namespace}}_{{Module}}_Model_Resource_{{Sibling}}_Collection\n{\n    /**\n     * remember if fields have been joined\n     * @var bool\n     */\n    protected $_joinedFields = false;\n\n    /**\n     * join the link table\n     *\n     * @access public\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function joinFields()\n    {\n        if (!$this->_joinedFields) {\n            $this->getSelect()->join(\n                array('related' => $this->getTable('{{namespace}}_{{module}}/{{entity}}_{{sibling}}')),\n                'related.{{sibling}}_id = {{siblingTableAlias}}.entity_id',\n                array('position')\n            );\n            $this->_joinedFields = true;\n        }\n        return $this;\n    }\n\n    /**\n     * add {{entity}} filter\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_{{Entity}} | int ${{entity}}\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_{{Sibling}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function add{{Entity}}Filter(${{entity}})\n    {\n        if (${{entity}} instanceof {{Namespace}}_{{Module}}_Model_{{Entity}}) {\n            ${{entity}} = ${{entity}}->getId();\n        }\n        if (!$this->_joinedFields) {\n            $this->joinFields();\n        }\n        $this->getSelect()->where('related.{{entity}}_id = ?', ${{entity}});\n        return $this;\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Tree/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} tree resource model\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree extends Varien_Data_Tree_Dbp\n{\n    const ID_FIELD        = 'entity_id';\n    const PATH_FIELD      = 'path';\n    const ORDER_FIELD     = 'order';\n    const LEVEL_FIELD     = 'level';\n\n    /**\n     * {{EntitiesLabel}} resource collection\n     *\n     * @var {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     */\n    protected $_collection;\n    protected $_storeId;\n\n    /**\n     * Inactive {{entitiesLabel}} ids\n     * @var array\n     */\n\n    protected $_inactive{{Entity}}Ids  = null;\n\n    /**\n     * Initialize tree\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function __construct()\n    {\n        $resource = Mage::getSingleton('core/resource');\n        parent::__construct(\n            $resource->getConnection('{{namespace}}_{{module}}_write'),\n            $resource->getTableName('{{namespace}}_{{module}}/{{entity}}'),\n            array(\n                Varien_Data_Tree_Dbp::ID_FIELD    => 'entity_id',\n                Varien_Data_Tree_Dbp::PATH_FIELD  => 'path',\n                Varien_Data_Tree_Dbp::ORDER_FIELD => 'position',\n                Varien_Data_Tree_Dbp::LEVEL_FIELD => 'level',\n            )\n        );\n    }\n\n    /**\n     * Get {{entitiesLabel}} collection\n     *\n     * @access public\n     * @param boolean $sorted\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     * {{qwertyuiop}}\n     */\n    public function getCollection($sorted = false)\n    {\n        if (is_null($this->_collection)) {\n            $this->_collection = $this->_getDefaultCollection($sorted);\n        }\n        return $this->_collection;\n    }\n    /**\n     * set the collection\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection $collection\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     */\n    public function setCollection($collection)\n    {\n        if (!is_null($this->_collection)) {\n            destruct($this->_collection);\n        }\n        $this->_collection = $collection;\n        return $this;\n    }\n    /**\n     * get the default collection\n     *\n     * @access protected\n     * @param boolean $sorted\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection\n     */\n    protected function _getDefaultCollection($sorted = false)\n    {\n        $collection = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->getCollection();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Tree/020_eav",
    "content": "        $collection->addAttributeToSelect('{{nameAttributeCode}}');\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Tree/030_content",
    "content": "        if ($sorted) {\n            if (is_string($sorted)) {\n                $collection->setOrder($sorted);\n            } else {\n                $collection->setOrder('{{nameAttributeCode}}');\n            }\n        }\n        return $collection;\n    }\n\n    /**\n     * Executing parents move method and cleaning cache after it\n     *\n     * @access public\n     * @param unknown_type ${{entity}}\n     * @param unknown_type $newParent\n     * @param unknown_type $prevNode\n     * {{qwertyuiop}}\n     */\n    public function move(${{entity}}, $newParent, $prevNode = null)\n    {\n        Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}')\n            ->move(${{entity}}->getId(), $newParent->getId());\n        parent::move(${{entity}}, $newParent, $prevNode);\n        $this->_afterMove(${{entity}}, $newParent, $prevNode);\n    }\n\n    /**\n     * Move tree after\n     *\n     * @access protected\n     * @param unknown_type ${{entity}}\n     * @param Varien_Data_Tree_Node $newParent\n     * @param Varien_Data_Tree_Node $prevNode\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     */\n    protected function _afterMove(${{entity}}, $newParent, $prevNode)\n    {\n        Mage::app()->cleanCache(array({{Namespace}}_{{Module}}_Model_{{Entity}}::CACHE_TAG));\n        return $this;\n    }\n\n    /**\n     * Load whole {{entityLabel}} tree, that will include specified {{entitiesLabel}} ids.\n     *\n     * @access public\n     * @param array $ids\n     * @param bool $addCollectionData\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     * {{qwertyuiop}}\n     */\n    public function loadByIds($ids, $addCollectionData = true)\n    {\n        $levelField = $this->_conn->quoteIdentifier('level');\n        $pathField  = $this->_conn->quoteIdentifier('path');\n        // load first two levels, if no ids specified\n        if (empty($ids)) {\n            $select = $this->_conn->select()\n                ->from($this->_table, 'entity_id')\n                ->where($levelField . ' <= 2');\n            $ids = $this->_conn->fetchCol($select);\n        }\n        if (!is_array($ids)) {\n            $ids = array($ids);\n        }\n        foreach ($ids as $key => $id) {\n            $ids[$key] = (int)$id;\n        }\n        // collect paths of specified IDs and prepare to collect all their parents and neighbours\n        $select = $this->_conn->select()\n            ->from($this->_table, array('path', 'level'))\n            ->where('entity_id IN (?)', $ids);\n        $where = array($levelField . '=0' => true);\n\n        foreach ($this->_conn->fetchAll($select) as $item) {\n            $pathIds  = explode('/', $item['path']);\n            $level = (int)$item['level'];\n            while ($level > 0) {\n                $pathIds[count($pathIds) - 1] = '%';\n                $path = implode('/', $pathIds);\n                $where[\"$levelField=$level AND $pathField LIKE '$path'\"] = true;\n                array_pop($pathIds);\n                $level--;\n            }\n        }\n        $where = array_keys($where);\n\n        // get all required records\n        if ($addCollectionData) {\n            $select = $this->_createCollectionDataSelect();\n        } else {\n            $select = clone $this->_select;\n            $select->order($this->_orderField . ' ' . Varien_Db_Select::SQL_ASC);\n        }\n        $select->where(implode(' OR ', $where));\n\n        // get array of records and add them as nodes to the tree\n        $arrNodes = $this->_conn->fetchAll($select);\n        if (!$arrNodes) {\n            return false;\n        }\n        $childrenItems = array();\n        foreach ($arrNodes as $key => $nodeInfo) {\n            $pathToParent = explode('/', $nodeInfo[$this->_pathField]);\n            array_pop($pathToParent);\n            $pathToParent = implode('/', $pathToParent);\n            $childrenItems[$pathToParent][] = $nodeInfo;\n        }\n        $this->addChildNodes($childrenItems, '', null);\n        return $this;\n    }\n\n    /**\n     * Load array of {{entityLabel}} parents\n     *\n     * @access public\n     * @param string $path\n     * @param bool $addCollectionData\n     * @param bool $withRootNode\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function loadBreadcrumbsArray($path, $addCollectionData = true, $withRootNode = false)\n    {\n        $pathIds = explode('/', $path);\n        if (!$withRootNode) {\n            array_shift($pathIds);\n        }\n        $result = array();\n        if (!empty($pathIds)) {\n            if ($addCollectionData) {\n                $select = $this->_createCollectionDataSelect(false);\n            } else {\n                $select = clone $this->_select;\n            }\n            $select\n                ->where('{{entityTableAlias}}.entity_id IN(?)', $pathIds)\n                ->order($this->_conn->getLengthSql('{{entityTableAlias}}.path') . ' ' . Varien_Db_Select::SQL_ASC);\n            $result = $this->_conn->fetchAll($select);\n        }\n        return $result;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Tree/040_flat_collection",
    "content": "\n    /**\n     * Obtain select for {{entitiesLabel}}\n     * By default everything from entity table is selected\n     * + name\n     *\n     * @access public\n     * @param bool $sorted\n     * @param array $optionalAttributes\n     * @return Zend_Db_Select\n     * {{qwertyuiop}}\n     */\n    protected function _createCollectionDataSelect($sorted = true)\n    {\n        $select = $this->_getDefaultCollection($sorted ? $this->_orderField : false)->getSelect();\n        ${{entities}}Table = Mage::getSingleton('core/resource')\n            ->getTableName('{{namespace}}_{{module}}/{{entity}}');\n        $subConcat = $this->_conn->getConcatSql(array('{{entityTableAlias}}.path', $this->_conn->quote('/%')));\n        $subSelect = $this->_conn->select()\n            ->from(array('see' => ${{entities}}Table), null)\n            ->where('see.entity_id = {{entityTableAlias}}.entity_id')\n            ->orWhere('see.path LIKE ?', $subConcat);\n        return $select;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Tree/050_eav_collection",
    "content": "\n    /**\n     * Obtain select for {{entitiesLabel}} with attributes.\n     * By default everything from entity table is selected\n     * + name, status\n     *\n     * @param bool $sorted\n     * @param array $optionalAttributes\n     * @return Zend_Db_Select\n     * {{qwertyuiop}}\n     */\n    protected function _createCollectionDataSelect($sorted = true, $optionalAttributes = array())\n    {\n        $select = $this->_getDefaultCollection($sorted ? $this->_orderField : false)\n            ->getSelect();\n        // add attributes to select\n        $attributes = array('{{nameAttributeCode}}', 'status');\n        if ($optionalAttributes) {\n            $attributes = array_unique(array_merge($attributes, $optionalAttributes));\n        }\n        foreach ($attributes as $attributeCode) {\n            /* @var $attribute Mage_Eav_Model_Entity_Attribute */\n            $attribute = Mage::getResourceSingleton('{{namespace}}_{{module}}/{{entity}}')->getAttribute($attributeCode);\n            // join non-static attribute table\n            if (!$attribute->getBackend()->isStatic()) {\n                $tableDefault   = sprintf('d_%s', $attributeCode);\n                $tableStore     = sprintf('s_%s', $attributeCode);\n                $valueExpr      = $this->_conn\n                    ->getCheckSql(\"{$tableStore}.value_id > 0\", \"{$tableStore}.value\", \"{$tableDefault}.value\");\n\n                $select\n                    ->joinLeft(\n                        array($tableDefault => $attribute->getBackend()->getTable()),\n                        sprintf(\n                            '%1$s.entity_id=e.entity_id AND %1$s.attribute_id=%2$d'.\n                            ' AND %1$s.entity_type_id=e.entity_type_id AND %1$s.store_id=%3$d',\n                            $tableDefault,\n                            $attribute->getId(),\n                            Mage_Core_Model_App::ADMIN_STORE_ID\n                        ),\n                        array($attributeCode => 'value')\n                    )\n                    ->joinLeft(\n                        array($tableStore => $attribute->getBackend()->getTable()),\n                        sprintf(\n                            '%1$s.entity_id=e.entity_id AND %1$s.attribute_id=%2$d'.\n                            ' AND %1$s.entity_type_id=e.entity_type_id AND %1$s.store_id=%3$d',\n                            $tableStore,\n                            $attribute->getId(),\n                            $this->getStoreId()\n                        ),\n                        array($attributeCode => $valueExpr)\n                    );\n            }\n        }\n        return $select;\n    }\n\n    /**\n     * Set store Id\n     *\n     * @access public\n     * @param integer $storeId\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     * {{qwertyuiop}}\n     */\n    public function setStoreId($storeId)\n    {\n        $this->_storeId = $storeId;\n        return $this;\n    }\n\n    /**\n     * Return store id\n     *\n     * @access public\n     * @return integer\n     * {{qwertyuiop}}\n     */\n    public function getStoreId()\n    {\n        if ($this->_storeId === null) {\n            return Mage::app()->getStore()->getId();\n        }\n        return $this->_storeId;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Entity/Tree/060_footer",
    "content": "\n    /**\n     * Get real existing {{entityLabel}} ids by specified ids\n     *\n     * @access public\n     * @param array $ids\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getExisting{{Entity}}IdsBySpecifiedIds($ids)\n    {\n        if (empty($ids)) {\n            return array();\n        }\n        if (!is_array($ids)) {\n            $ids = array($ids);\n        }\n        $select = $this->_conn->select()\n            ->from($this->_table, array('entity_id'))\n            ->where('entity_id IN (?)', $ids);\n        return $this->_conn->fetchCol($select);\n    }\n\n    /**\n     * add collection data\n     *\n     * @access public\n     * @param {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection $collection\n     * @param boolean $sorted\n     * @param array $exclude\n     * @param boolean $toLoad\n     * @param boolean $onlyActive\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     * {{qwertyuiop}}\n     */\n    public function addCollectionData(\n        $collection = null,\n        $sorted = false,\n        $exclude = array(),\n        $toLoad = true,\n        $onlyActive = false\n    )\n    {\n        if (is_null($collection)) {\n            $collection = $this->getCollection($sorted);\n        } else {\n            $this->setCollection($collection);\n        }\n        if (!is_array($exclude)) {\n            $exclude = array($exclude);\n        }\n        $nodeIds = array();\n        foreach ($this->getNodes() as $node) {\n            if (!in_array($node->getId(), $exclude)) {\n                $nodeIds[] = $node->getId();\n            }\n        }\n        $collection->addIdFilter($nodeIds);\n        if ($onlyActive) {\n            $disabledIds = $this->_getDisabledIds($collection);\n            if ($disabledIds) {\n                $collection->{{filterMethod}}('entity_id', array('nin' => $disabledIds));\n            }\n            $collection->{{filterMethod}}('status', 1);\n        }\n        if ($toLoad) {\n            $collection->load();\n            foreach ($collection as ${{entity}}) {\n                if ($this->getNodeById(${{entity}}->getId())) {\n                    $this->getNodeById(${{entity}}->getId())->addData(${{entity}}->getData());\n                }\n            }\n            foreach ($this->getNodes() as $node) {\n                if (!$collection->getItemById($node->getId()) && $node->getParent()) {\n                    $this->removeNode($node);\n                }\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Add inactive {{entitiesLabel}} ids\n     *\n     * @access public\n     * @param unknown_type $ids\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     * {{qwertyuiop}}\n     */\n    public function addInactive{{Entity}}Ids($ids)\n    {\n        if (!is_array($this->_inactive{{Entity}}Ids)) {\n            $this->_initInactive{{Entity}}Ids();\n        }\n        $this->_inactive{{Entity}}Ids = array_merge($ids, $this->_inactive{{Entity}}Ids);\n        return $this;\n    }\n\n    /**\n     * Retrieve inactive {{entitiesLabel}} ids\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Tree\n     * {{qwertyuiop}}\n     */\n    protected function _initInactive{{Entity}}Ids()\n    {\n        $this->_inactive{{Entity}}Ids = array();\n        return $this;\n    }\n    /**\n     * Retrieve inactive {{entitiesLabel}} ids\n     *\n     * @access public\n     * @return array\n     * {{qwertyuiop}}\n     */\n    public function getInactive{{Entity}}Ids()\n    {\n        if (!is_array($this->_inactive{{Entity}}Ids)) {\n            $this->_initInactive{{Entity}}Ids();\n        }\n        return $this->_inactive{{Entity}}Ids;\n    }\n\n    /**\n     * Return disable {{entityLabel}} ids\n     *\n     * @access protected\n     * @param {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection $collection\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getDisabledIds($collection)\n    {\n        $this->_inactiveItems = $this->getInactive{{Entity}}Ids();\n        $this->_inactiveItems = array_merge(\n            $this->_getInactiveItemIds($collection),\n            $this->_inactiveItems\n        );\n        $allIds = $collection->getAllIds();\n        $disabledIds = array();\n\n        foreach ($allIds as $id) {\n            $parents = $this->getNodeById($id)->getPath();\n            foreach ($parents as $parent) {\n                if (!$this->_getItemIsActive($parent->getId())) {\n                    $disabledIds[] = $id;\n                    continue;\n                }\n            }\n        }\n        return $disabledIds;\n    }\n\n    /**\n     * Retrieve inactive {{entityLabel}} item ids\n     *\n     * @access protecte\n     * @param {{Namespace}}_{{Module}}_Model_Resource_{{Entity}}_Collection $collection\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _getInactiveItemIds($collection)\n    {\n        $filter = $collection->getAllIdsSql();\n        $table = Mage::getSingleton('core/resource')->getTable('{{namespace}}_{{module}}/{{entity}}');\n        $bind = array(\n            'cond' => 0,\n        );\n        $select = $this->_conn->select()\n            ->from(array('d'=>$table), array('d.entity_id'))\n            ->where('d.entity_id IN (?)', new Zend_Db_Expr($filter))\n            ->where('status = :cond');\n        return $this->_conn->fetchCol($select, $bind);\n    }\n\n    /**\n     * Check is {{entityLabel}} items active\n     *\n     * @access protecte\n     * @param int $id\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    protected function _getItemIsActive($id)\n    {\n        if (!in_array($id, $this->_inactiveItems)) {\n            return true;\n        }\n        return false;\n    }\n}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Setup/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{Module}} setup\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Model_Resource_Setup extends {{ResourceSetup}}\n{\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Setup/020_eav_top",
    "content": "\n    /**\n     * get the default entities for {{module}} module - used at installation\n     *\n     * @access public\n     * @return array()\n     * {{qwertyuiop}}\n     */\n    public function getDefaultEntities()\n    {\n        $entities = array();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Setup/030_eav",
    "content": "        $entities['{{namespace}}_{{module}}_{{entity}}'] = array(\n            'entity_model'                  => '{{namespace}}_{{module}}/{{entity}}',\n            'attribute_model'               => '{{namespace}}_{{module}}/resource_eav_attribute',\n            'table'                         => '{{namespace}}_{{module}}/{{entity}}',\n            'additional_attribute_table'    => '{{namespace}}_{{module}}/eav_attribute',\n            'entity_attribute_collection'   => '{{namespace}}_{{module}}/{{entity}}_attribute_collection',\n            'attributes'                    => array(\n{{entityAttributesSetup}}\n                )\n         );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Setup/040_eav_footer",
    "content": "        return $entities;\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/Model/Resource/Setup/050_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/AttributeController/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin attribute controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Adminhtml_{{Module}}_{{Entity}}_AttributeController extends Mage_Adminhtml_Controller_Action\n{\n    protected $_entityTypeId;\n\n    /**\n     * predispatch\n     *\n     * @accees public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function preDispatch()\n    {\n        parent::preDispatch();\n        $this->_entityTypeId = Mage::getModel('eav/entity')\n            ->setType({{Namespace}}_{{Module}}_Model_{{Entity}}::ENTITY)\n            ->getTypeId();\n    }\n\n    /**\n     * init action\n     *\n     * @accees protected\n     * @return {{Namespace}}_{{Module}}_Adminhtml_{{Entity}}_AttributeController\n     * {{qwertyuiop}}\n     */\n    protected function _initAction()\n    {\n        $this->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('Attributes'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('Manage Attributes'));\n\n        $this->loadLayout()\n            ->_setActiveMenu('{{selectedMenuPath}}_attributes')\n            ->_addBreadcrumb(\n                Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}'),\n                Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}}')\n            )\n            ->_addBreadcrumb(\n                Mage::helper('{{namespace}}_{{module}}')->__('Manage {{EntityLabel}} Attributes'),\n                Mage::helper('{{namespace}}_{{module}}')->__('Manage {{EntityLabel}} Attributes')\n            );\n        return $this;\n    }\n\n    /**\n     * default action\n     *\n     * @accees public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function indexAction()\n    {\n        $this->_initAction()->renderLayout();\n    }\n\n    /**\n     * add attribute action\n     *\n     * @accees public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function newAction()\n    {\n        $this->_forward('edit');\n    }\n\n    /**\n     * edit attribute action\n     *\n     * @accees public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function editAction()\n    {\n        $id = $this->getRequest()->getParam('attribute_id');\n        $model = Mage::getModel('{{namespace}}_{{module}}/resource_eav_attribute')\n            ->setEntityTypeId($this->_entityTypeId);\n        if ($id) {\n            $model->load($id);\n            if (! $model->getId()) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('This {{entityLabel}} attribute no longer exists')\n                );\n                $this->_redirect('*/*/');\n                return;\n            }\n            // entity type check\n            if ($model->getEntityTypeId() != $this->_entityTypeId) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('This {{entityLabel}} attribute cannot be edited.')\n                );\n                $this->_redirect('*/*/');\n                return;\n            }\n        }\n        // set entered data if was error when we do save\n        $data = Mage::getSingleton('adminhtml/session')->getAttributeData(true);\n        if (! empty($data)) {\n            $model->addData($data);\n        }\n        Mage::register('entity_attribute', $model);\n        $this->_initAction();\n        $this->_title($id ? $model->getName() : Mage::helper('{{namespace}}_{{module}}')->__('New {{EntityLabel}} Attribute'));\n        $item = $id ? Mage::helper('{{namespace}}_{{module}}')->__('Edit {{EntityLabel}} Attribute')\n                    : Mage::helper('{{namespace}}_{{module}}')->__('New {{EntityLabel}} Attribute');\n        $this->_addBreadcrumb($item, $item);\n        $this->renderLayout();\n    }\n\n    /**\n     * validate attribute action\n     *\n     * @accees public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function validateAction()\n    {\n        $response = new Varien_Object();\n        $response->setError(false);\n\n        $attributeCode  = $this->getRequest()->getParam('attribute_code');\n        $attributeId    = $this->getRequest()->getParam('attribute_id');\n        $attribute      = Mage::getModel('{{namespace}}_{{module}}/attribute')\n            ->loadByCode($this->_entityTypeId, $attributeCode);\n        if ($attribute->getId() && !$attributeId) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Attribute with the same code already exists')\n            );\n            $this->_initLayoutMessages('adminhtml/session');\n            $response->setError(true);\n            $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml());\n        }\n        $this->getResponse()->setBody($response->toJson());\n    }\n\n    /**\n     * Filter post data\n     *\n     * @access protected\n     * @param array $data\n     * @return array\n     * {{qwertyuiop}}\n     */\n    protected function _filterPostData($data)\n    {\n        if ($data) {\n            $helper = Mage::helper('{{namespace}}_{{module}}');\n            //labels\n            foreach ($data['frontend_label'] as & $value) {\n                if ($value) {\n                    $value = $helper->stripTags($value);\n                }\n            }\n            //options\n            if (!empty($data['option']['value'])) {\n                foreach ($data['option']['value'] as &$options) {\n                    foreach ($options as &$label) {\n                        $label = $helper->stripTags($label);\n                    }\n                }\n            }\n            //default value\n            if (!empty($data['default_value'])) {\n                $data['default_value'] = $helper->stripTags($data['default_value']);\n            }\n            if (!empty($data['default_value_text'])) {\n                $data['default_value_text'] = $helper->stripTags($data['default_value_text']);\n            }\n            if (!empty($data['default_value_textarea'])) {\n                $data['default_value_textarea'] = $helper->stripTags($data['default_value_textarea']);\n            }\n        }\n        return $data;\n    }\n\n    /**\n     * save attribute action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function saveAction()\n    {\n        $data = $this->getRequest()->getPost();\n        if ($data) {\n            $session      = Mage::getSingleton('adminhtml/session');\n            $redirectBack = $this->getRequest()->getParam('back', false);\n            $model        = Mage::getModel('{{namespace}}_{{module}}/resource_eav_attribute');\n            $helper       = Mage::helper('{{namespace}}_{{module}}/{{entity}}');\n            $id           = $this->getRequest()->getParam('attribute_id');\n            //validate attribute_code\n            if (isset($data['attribute_code'])) {\n                $validatorAttrCode = new Zend_Validate_Regex(array('pattern' => '/^[a-z_0-9]{1,255}$/'));\n                if (!$validatorAttrCode->isValid($data['attribute_code'])) {\n                    $session->addError(\n                        Mage::helper('{{namespace}}_{{module}}')->__(\n                            'Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.'\n                        )\n                    );\n                    $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true));\n                    return;\n                }\n            }\n            if ($id) {\n                $model->load($id);\n                if (!$model->getId()) {\n                    $session->addError(\n                        Mage::helper('{{namespace}}_{{module}}')->__('This attribute no longer exists')\n                    );\n                    $this->_redirect('*/*/');\n                    return;\n                }\n\n                // entity type check\n                if ($model->getEntityTypeId() != $this->_entityTypeId) {\n                    $session->addError(\n                        Mage::helper('{{namespace}}_{{module}}')->__('This attribute cannot be updated.')\n                    );\n                    $session->setAttributeData($data);\n                    $this->_redirect('*/*/');\n                    return;\n                }\n\n                $data['attribute_code']  = $model->getAttributeCode();\n                $data['is_user_defined'] = $model->getIsUserDefined();\n                $data['frontend_input']  = $model->getFrontendInput();\n            } else {\n                $data['source_model']  = $helper->getAttributeSourceModelByInputType($data['frontend_input']);\n                $data['backend_model'] = $helper->getAttributeBackendModelByInputType($data['frontend_input']);\n            }\n\n            if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) {\n                $data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);\n            }\n            $defaultValueField = $model->getDefaultValueByInput($data['frontend_input']);\n            if ($defaultValueField) {\n                $data['default_value'] = $this->getRequest()->getParam($defaultValueField);\n            }\n            //filter\n            $data = $this->_filterPostData($data);\n            $model->addData($data);\n            if (!$id) {\n                $model->setEntityTypeId($this->_entityTypeId);\n                $model->setIsUserDefined(1);\n                $model->setIsVisible(1);\n            }\n            try {\n                $model->save();\n                $session->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('The {{entityLabel}} attribute has been saved.')\n                );\n                /**\n                 * Clear translation cache because attribute labels are stored in translation\n                 */\n                Mage::app()->cleanCache(array(Mage_Core_Model_Translate::CACHE_TAG));\n                $session->setAttributeData(false);\n                if ($redirectBack) {\n                    $this->_redirect('*/*/edit', array('attribute_id' => $model->getId(), '_current'=>true));\n                } else {\n                    $this->_redirect('*/*/', array());\n                }\n                return;\n            } catch (Exception $e) {\n                $session->addError($e->getMessage());\n                $session->setAttributeData($data);\n                $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true));\n                return;\n            }\n        }\n        $this->_redirect('*/*/');\n    }\n\n    /**\n     * delete attribute action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function deleteAction()\n    {\n        if ($id = $this->getRequest()->getParam('attribute_id')) {\n            $model = Mage::getModel('{{namespace}}_{{module}}/resource_eav_attribute');\n            // entity type check\n            $model->load($id);\n            if ($model->getEntityTypeId() != $this->_entityTypeId) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('This attribute cannot be deleted.')\n                );\n                $this->_redirect('*/*/');\n                return;\n            }\n            try {\n                $model->delete();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('The {{entityLabel}} attribute has been deleted.')\n                );\n                $this->_redirect('*/*/');\n                return;\n            }\n            catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n                $this->_redirect('*/*/edit', array('attribute_id' => $this->getRequest()->getParam('attribute_id')));\n                return;\n            }\n        }\n        Mage::getSingleton('adminhtml/session')->addError(\n            Mage::helper('{{namespace}}_{{module}}')->__('Unable to find an attribute to delete.')\n        );\n        $this->_redirect('*/*/');\n    }\n\n    /**\n     * check access\n     *\n     * @access protected\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _isAllowed()\n    {\n        return Mage::getSingleton('admin/session')->isAllowed('{{selectedMenuPath}}_attributes');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/Catalog/CategoryController/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} - category controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nrequire_once (\"Mage/Adminhtml/controllers/Catalog/CategoryController.php\");\nclass {{Namespace}}_{{Module}}_Adminhtml_{{ModuleFolder}}_{{Entity}}_Catalog_CategoryController extends Mage_Adminhtml_Catalog_CategoryController\n{\n    /**\n     * construct\n     *\n     * @access protected\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        // Define module dependent translate\n        $this->setUsedModuleName('{{Namespace}}_{{Module}}');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/Catalog/CategoryController/020_not_tree",
    "content": "\n    /**\n     * {{entities}} grid in the catalog page\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}gridAction()\n    {\n        $this->_initCategory();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('category.edit.tab.{{entity}}')\n            ->setCategory{{Entities}}($this->getRequest()->getPost('category_{{entities}}', null));\n        $this->renderLayout();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/Catalog/CategoryController/030_tree",
    "content": "\n    /**\n     * get child {{entitiesLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}JsonAction()\n    {\n        $this->_initCategory();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_catalog_category_edit_{{entity}}')\n                ->get{{Entity}}ChildrenJson($this->getRequest()->getParam('{{entity}}'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/Catalog/CategoryController/040_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/Catalog/ProductController/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} - product controller\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nrequire_once (\"Mage/Adminhtml/controllers/Catalog/ProductController.php\");\nclass {{Namespace}}_{{Module}}_Adminhtml_{{ModuleFolder}}_{{Entity}}_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController\n{\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/Catalog/ProductController/020_not_tree",
    "content": "    /**\n     * construct\n     *\n     * @access protected\n     * @return void\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        // Define module dependent translate\n        $this->setUsedModuleName('{{Namespace}}_{{Module}}');\n    }\n\n    /**\n     * {{entitiesLabel}} in the catalog page\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}Action()\n    {\n        $this->_initProduct();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('product.edit.tab.{{entity}}')\n            ->setProduct{{Entities}}($this->getRequest()->getPost('product_{{entities}}', null));\n        $this->renderLayout();\n    }\n\n    /**\n     * {{entitiesLabel}} grid in the catalog page\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}GridAction()\n    {\n        $this->_initProduct();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('product.edit.tab.{{entity}}')\n            ->setProduct{{Entities}}($this->getRequest()->getPost('product_{{entities}}', null));\n        $this->renderLayout();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/Catalog/ProductController/030_tree",
    "content": "\n    /**\n     * {{entitiesLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}Action()\n    {\n        $this->_initProduct();\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * {{entitiesLabel}} json action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}JsonAction()\n    {\n        $product = $this->_initProduct();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock(\n                '{{namespace}}_{{module}}/adminhtml_catalog_product_edit_tab_{{entity}}'\n            )\n            ->get{{Entity}}ChildrenJson($this->getRequest()->getParam('{{entity}}'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/Catalog/ProductController/040_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/CommentController/010_content",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Adminhtml_{{ModuleFolder}}_{{Entity}}_CommentController extends Mage_Adminhtml_Controller_Action\n{\n    /**\n     * init the comment\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment\n     * {{qwertyuiop}}\n     */\n    protected function _initComment()\n    {\n        $commentId  = (int) $this->getRequest()->getParam('id');\n        $comment    = Mage::getModel('{{namespace}}_{{module}}/{{entity}}_comment');\n        if ($commentId) {\n            $comment->load($commentId);\n        }\n        Mage::register('current_comment', $comment);\n        return $comment;\n    }\n\n    /**\n     * default action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function indexAction()\n    {\n        $this->loadLayout();\n        $this->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{module_menu}}'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('Comments'));\n        $this->renderLayout();\n    }\n\n    /**\n     * grid action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function gridAction()\n    {\n        $this->loadLayout()->renderLayout();\n    }\n\n    /**\n     * edit comment - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function editAction()\n    {\n        $commentId    = $this->getRequest()->getParam('id');\n        $comment      = $this->_initComment();\n        if (!$comment->getId()) {\n            $this->_getSession()->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('This comment no longer exists.')\n            );\n            $this->_redirect('*/*/');\n            return;\n        }\n        $data = Mage::getSingleton('adminhtml/session')->getFormData(true);\n        if (!empty($data)) {\n            $comment->setData($data);\n        }\n        Mage::register('comment_data', $comment);\n        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($comment->get{{Entity}}Id());\n        Mage::register('current_{{entity}}', ${{entity}});\n        $this->loadLayout();\n        $this->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{module_menu}}'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('Comments'))\n             ->_title($comment->getTitle());\n        $this->renderLayout();\n    }\n\n    /**\n     * save {{entityLabel}} - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function saveAction()\n    {\n        if ($data = $this->getRequest()->getPost('comment')) {\n            try {\n                $comment = $this->_initComment();\n                $comment->addData($data);\n                if (!$comment->getCustomerId()) {\n                    $comment->unsCustomerId();\n                }\n                $comment->save();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('Comment was successfully saved')\n                );\n                Mage::getSingleton('adminhtml/session')->setFormData(false);\n                if ($this->getRequest()->getParam('back')) {\n                    $this->_redirect('*/*/edit', array('id' => $comment->getId()));\n                    return;\n                }\n                $this->_redirect('*/*/');\n                return;\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n                Mage::getSingleton('adminhtml/session')->setFormData($data);\n                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n                return;\n            }\n            catch (Exception $e) {\n                Mage::logException($e);\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was a problem saving the comment.')\n                );\n                Mage::getSingleton('adminhtml/session')->setFormData($data);\n                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n                return;\n            }\n        }\n        Mage::getSingleton('adminhtml/session')->addError(\n            Mage::helper('{{namespace}}_{{module}}')->__('Unable to find comment to save.')\n        );\n        $this->_redirect('*/*/');\n    }\n\n    /**\n     * delete comment - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function deleteAction()\n    {\n        if ( $this->getRequest()->getParam('id') > 0) {\n            try {\n                $comment = Mage::getModel('{{namespace}}_{{module}}/{{entity}}_comment');\n                $comment->setId($this->getRequest()->getParam('id'))->delete();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('Comment was successfully deleted.')\n                );\n                $this->_redirect('*/*/');\n                return;\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n            } catch (Exception $e) {\n                Mage::logException($e);\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error deleting the comment.')\n                );\n                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n                return;\n            }\n        }\n        Mage::getSingleton('adminhtml/session')->addError(\n            Mage::helper('{{namespace}}_{{module}}')->__('Could not find comment to delete.')\n        );\n        $this->_redirect('*/*/');\n    }\n\n    /**\n     * mass delete comments - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function massDeleteAction()\n    {\n        $commentIds = $this->getRequest()->getParam('comment');\n        if (!is_array($commentIds)) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Please select comments to delete.')\n            );\n        } else {\n            try {\n                foreach ($commentIds as $commentId) {\n                    $comment = Mage::getModel('{{namespace}}_{{module}}/{{entity}}_comment');\n                    $comment->setId($commentId)->delete();\n                }\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__(\n                        'Total of %d comments were successfully deleted.',\n                        count($commentIds)\n                    )\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n            } catch (Exception $e) {\n                Mage::logException($e);\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error deleting comments.')\n                );\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n\n    /**\n     * mass status change - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function massStatusAction()\n    {\n        $commentIds = $this->getRequest()->getParam('comment');\n        if (!is_array($commentIds)) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Please select comments.')\n            );\n        } else {\n            try {\n                foreach ($commentIds as $commentId) {\n                    $comment = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}_comment')->load($commentId)\n                         ->setStatus($this->getRequest()->getParam('status'))\n                         ->setIsMassupdate(true)\n                         ->save();\n                }\n                $this->_getSession()->addSuccess(\n                    $this->__('Total of %d comments were successfully updated.', count($commentIds))\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error updating comments.')\n                );\n                Mage::logException($e);\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n\n    /**\n     * export as csv - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportCsvAction()\n    {\n        $fileName   = '{{entity}}_comments.csv';\n        $content    = $this->getLayout()->createBlock(\n            '{{namespace}}_{{module}}/adminhtml_{{entity}}_comment_grid'\n        )\n        ->getCsv();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * export as MsExcel - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportExcelAction()\n    {\n        $fileName   = '{{entity}}_comments.xls';\n        $content    = $this->getLayout()->createBlock(\n            '{{namespace}}_{{module}}/adminhtml_{{entity}}_comment_grid'\n        )\n        ->getExcelFile();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * export as xml - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportXmlAction()\n    {\n        $fileName   = '{{entity}}_comments.xml';\n        $content    = $this->getLayout()->createBlock(\n            '{{namespace}}_{{module}}/adminhtml_{{entity}}_comment_grid'\n        )\n        ->getXml();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * check access\n     *\n     * @access protected\n     * @return bool\n     * {{qwertyuiop}}\n     */\n    protected function _isAllowed()\n    {\n        return Mage::getSingleton('admin/session')->isAllowed('{{selectedMenuPath}}_comments');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/WidgetController/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin widget controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Adminhtml_{{ModuleFolder}}_{{Entity}}_WidgetController extends Mage_Adminhtml_Controller_Action\n{\n    /**\n     * Chooser Source action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function chooserAction()\n    {\n        $uniqId = $this->getRequest()->getParam('uniq_id');\n        $grid = $this->getLayout()->createBlock(\n            '{{namespace}}_{{module}}/adminhtml_{{entity}}_widget_chooser',\n            '',\n            array(\n                'id' => $uniqId,\n            )\n        );\n        $this->getResponse()->setBody($grid->toHtml());\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/WidgetController/020_tree",
    "content": "\n    /**\n     * {{entitiesLabel}} json action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}JsonAction()\n    {\n        if (${{entity}}Id = (int) $this->getRequest()->getPost('id')) {\n            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id);\n            if (${{entity}}->getId()) {\n                Mage::register('{{entity}}', ${{entity}});\n                Mage::register('current_{{entity}}', ${{entity}});\n            }\n            $this->getResponse()->setBody(\n                $this->_get{{Entity}}TreeBlock()->getTreeJson(${{entity}})\n            );\n        }\n    }\n\n    /**\n     * get {{entityLabel}} tree block\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Block_Adminhtml_{{Entity}}_Widget_Chooser\n     * {{qwertyuiop}}\n     */\n    protected function _get{{Entity}}TreeBlock()\n    {\n        return $this->getLayout()->createBlock(\n            '{{namespace}}_{{module}}/adminhtml_{{entity}}_widget_chooser',\n            '',\n            array(\n                'id' => $this->getRequest()->getParam('uniq_id'),\n                'use_massaction' => $this->getRequest()->getParam('use_massaction', false)\n            )\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/Entity/WidgetController/030_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Adminhtml_{{ModuleFolder}}_{{Entity}}Controller extends Mage_Adminhtml_Controller_Action\n{\n    /**\n     * constructor - set the used module name\n     *\n     * @access protected\n     * @return void\n     * @see Mage_Core_Controller_Varien_Action::_construct()\n     * {{qwertyuiop}}\n     */\n    protected function _construct()\n    {\n        $this->setUsedModuleName('{{Namespace}}_{{Module}}');\n    }\n\n    /**\n     * init the {{entityLabel}}\n     *\n     * @access protected \n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _init{{Entity}}()\n    {\n        $this->_title($this->__('{{module_menu}}'))\n             ->_title($this->__('Manage {{EntitiesLabel}}'));\n\n        ${{entity}}Id  = (int) $this->getRequest()->getParam('id');\n        ${{entity}}    = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n            ->setStoreId($this->getRequest()->getParam('store', 0));\n\n        if (${{entity}}Id) {\n            ${{entity}}->load(${{entity}}Id);\n        }\n        Mage::register('current_{{entity}}', ${{entity}});\n        return ${{entity}};\n    }\n\n    /**\n     * default action for {{entity}} controller\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function indexAction()\n    {\n        $this->_title($this->__('{{module_menu}}'))\n             ->_title($this->__('Manage {{EntitiesLabel}}'));\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * new {{entity}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function newAction()\n    {\n        $this->_forward('edit');\n    }\n\n    /**\n     * edit {{entity}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function editAction()\n    {\n        ${{entity}}Id  = (int) $this->getRequest()->getParam('id');\n        ${{entity}}    = $this->_init{{Entity}}();\n        if (${{entity}}Id && !${{entity}}->getId()) {\n            $this->_getSession()->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('This {{entityLabel}} no longer exists.')\n            );\n            $this->_redirect('*/*/');\n            return;\n        }\n        if ($data = Mage::getSingleton('adminhtml/session')->get{{Entity}}Data(true)) {\n            ${{entity}}->setData($data);\n        }\n        $this->_title(${{entity}}->get{{EntityNameMagicCode}}());\n        Mage::dispatchEvent(\n            '{{namespace}}_{{module}}_{{entity}}_edit_action',\n            array('{{entity}}' => ${{entity}})\n        );\n        $this->loadLayout();\n        if (${{entity}}->getId()) {\n            if (!Mage::app()->isSingleStoreMode() && ($switchBlock = $this->getLayout()->getBlock('store_switcher'))) {\n                $switchBlock->setDefaultStoreName(Mage::helper('{{namespace}}_{{module}}')->__('Default Values'))\n                    ->setWebsiteIds(${{entity}}->getWebsiteIds())\n                    ->setSwitchUrl(\n                        $this->getUrl(\n                            '*/*/*',\n                            array(\n                                '_current'=>true,\n                                'active_tab'=>null,\n                                'tab' => null,\n                                'store'=>null\n                            )\n                        )\n                    );\n            }\n        } else {\n            $this->getLayout()->getBlock('left')->unsetChild('store_switcher');\n        }\n        $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);\n        $this->renderLayout();\n    }\n\n    /**\n     * save {{entityLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function saveAction()\n    {\n        $storeId        = $this->getRequest()->getParam('store');\n        $redirectBack   = $this->getRequest()->getParam('back', false);\n        ${{entity}}Id   = $this->getRequest()->getParam('id');\n        $isEdit         = (int)($this->getRequest()->getParam('id') != null);\n        $data = $this->getRequest()->getPost();\n        if ($data) {\n            ${{entity}}     = $this->_init{{Entity}}();\n            ${{entity}}Data = $this->getRequest()->getPost('{{entity}}', array());\n            ${{entity}}->addData(${{entity}}Data);\n            ${{entity}}->setAttributeSetId(${{entity}}->getDefaultAttributeSetId());\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/020_save_product_relation",
    "content": "                $products = $this->getRequest()->getPost('products', -1);\n                if ($products != -1) {\n                    ${{entity}}->setProductsData(\n                        Mage::helper('adminhtml/js')->decodeGridSerializedInput($products)\n                    );\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/030_save_category_relation",
    "content": "                $categories = $this->getRequest()->getPost('category_ids', -1);\n                if ($categories != -1) {\n                    $categories = explode(',', $categories);\n                    $categories = array_unique($categories);\n                    ${{entity}}->setCategoriesData($categories);\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/040_sibling_save",
    "content": "            if (isset($data['{{siblings}}'])) {\n                ${{entity}}->set{{Siblings}}Data(\n                    Mage::helper('adminhtml/js')->decodeGridSerializedInput($data['{{siblings}}'])\n                );\n            }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/045_sibling_save_tree",
    "content": "                ${{siblings}} = $this->getRequest()->getPost('{{sibling}}_ids', -1);\n                if (${{siblings}} != -1) {\n                    ${{siblings}} = explode(',', ${{siblings}});\n                    ${{siblings}} = array_unique(${{siblings}});\n                    ${{entity}}->set{{Siblings}}Data(${{siblings}});\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/050_middle",
    "content": "            if ($useDefaults = $this->getRequest()->getPost('use_default')) {\n                foreach ($useDefaults as $attributeCode) {\n                    ${{entity}}->setData($attributeCode, false);\n                }\n            }\n            try {\n                ${{entity}}->save();\n                ${{entity}}Id = ${{entity}}->getId();\n                $this->_getSession()->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} was saved')\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::logException($e);\n                $this->_getSession()->addError($e->getMessage())\n                    ->set{{Entity}}Data(${{entity}}Data);\n                $redirectBack = true;\n            } catch (Exception $e) {\n                Mage::logException($e);\n                $this->_getSession()->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('Error saving {{entityLabel}}')\n                )\n                ->set{{Entity}}Data(${{entity}}Data);\n                $redirectBack = true;\n            }\n        }\n        if ($redirectBack) {\n            $this->_redirect(\n                '*/*/edit',\n                array(\n                    'id'    => ${{entity}}Id,\n                    '_current'=>true\n                )\n            );\n        } else {\n            $this->_redirect('*/*/', array('store'=>$storeId));\n        }\n    }\n\n    /**\n     * delete {{entityLabel}}\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function deleteAction()\n    {\n        if ($id = $this->getRequest()->getParam('id')) {\n            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($id);\n            try {\n                ${{entity}}->delete();\n                $this->_getSession()->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('The {{entitiesLabel}} has been deleted.')\n                );\n            } catch (Exception $e) {\n                $this->_getSession()->addError($e->getMessage());\n            }\n        }\n        $this->getResponse()->setRedirect(\n            $this->getUrl('*/*/', array('store'=>$this->getRequest()->getParam('store')))\n        );\n    }\n\n    /**\n     * mass delete {{entitiesLabel}}\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function massDeleteAction()\n    {\n        ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');\n        if (!is_array(${{entity}}Ids)) {\n            $this->_getSession()->addError($this->__('Please select {{entitiesLabel}}.'));\n        } else {\n            try {\n                foreach (${{entity}}Ids as ${{entity}}Id) {\n                    ${{entity}} = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id);\n                    Mage::dispatchEvent(\n                        '{{namespace}}_{{module}}_controller_{{entity}}_delete',\n                        array('{{entity}}' => ${{entity}})\n                    );\n                    ${{entity}}->delete();\n                }\n                $this->_getSession()->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('Total of %d record(s) have been deleted.', count(${{entity}}Ids))\n                );\n            } catch (Exception $e) {\n                $this->_getSession()->addError($e->getMessage());\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n\n    /**\n     * mass status change - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function massStatusAction()\n    {\n        ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');\n        if (!is_array(${{entity}}Ids)) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Please select {{entitiesLabel}}.')\n            );\n        } else {\n            try {\n                foreach (${{entity}}Ids as ${{entity}}Id) {\n                ${{entity}} = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id)\n                    ->setStatus($this->getRequest()->getParam('status'))\n                    ->setIsMassupdate(true)\n                    ->save();\n                }\n                $this->_getSession()->addSuccess(\n                    $this->__('Total of %d {{entitiesLabel}} were successfully updated.', count(${{entity}}Ids))\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error updating {{entitiesLabel}}.')\n                );\n                Mage::logException($e);\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n\n    /**\n     * grid action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function gridAction()\n    {\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * restrict access\n     *\n     * @access protected\n     * @return bool\n     * @see Mage_Adminhtml_Controller_Action::_isAllowed()\n     * {{qwertyuiop}}\n     */\n    protected function _isAllowed()\n    {\n        return Mage::getSingleton('admin/session')->isAllowed('{{selectedMenuPath}}');\n    }\n\n    /**\n     * Export {{entities}} in CSV format\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportCsvAction()\n    {\n        $fileName   = '{{entities}}.csv';\n        $content    = $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_grid')\n            ->getCsvFile();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * Export {{entitiesLabel}} in Excel format\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportExcelAction()\n    {\n        $fileName   = '{{entity}}.xls';\n        $content    = $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_grid')\n            ->getExcelFile();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * Export {{entitiesLabel}} in XML format\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportXmlAction()\n    {\n        $fileName   = '{{entity}}.xml';\n        $content    = $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_grid')\n            ->getXml();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * wysiwyg editor action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function wysiwygAction()\n    {\n        $elementId     = $this->getRequest()->getParam('element_id', md5(microtime()));\n        $storeId       = $this->getRequest()->getParam('store_id', 0);\n        $storeMediaUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n\n        $content = $this->getLayout()->createBlock(\n            '{{namespace}}_{{module}}/adminhtml_{{module}}_helper_form_wysiwyg_content',\n            '',\n            array(\n                'editor_element_id' => $elementId,\n                'store_id'          => $storeId,\n                'store_media_url'   => $storeMediaUrl,\n            )\n        );\n        $this->getResponse()->setBody($content->toHtml());\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/060_mass_action",
    "content": "\n    /**\n     * mass {{attributeLabel}} change\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function mass{{AttributeMagicCode}}Action()\n    {\n        ${{entity}}Ids = (array)$this->getRequest()->getParam('{{entity}}');\n        $storeId       = (int)$this->getRequest()->getParam('store', 0);\n        $flag          = (int)$this->getRequest()->getParam('flag_{{attributeCode}}');\n        if ($flag == 2) {\n            $flag = 0;\n        }\n        try {\n            foreach (${{entity}}Ids as ${{entity}}Id) {\n                ${{entity}} = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}')\n                    ->setStoreId($storeId)\n                    ->load(${{entity}}Id);\n                ${{entity}}->set{{AttributeMagicCode}}($flag)->save();\n            }\n            $this->_getSession()->addSuccess(\n                Mage::helper('{{namespace}}_{{module}}')->__('Total of %d record(s) have been updated.', count(${{entity}}Ids))\n            );\n        } catch (Mage_Core_Model_Exception $e) {\n            $this->_getSession()->addError($e->getMessage());\n        } catch (Mage_Core_Exception $e) {\n            $this->_getSession()->addError($e->getMessage());\n        } catch (Exception $e) {\n            $this->_getSession()->addException(\n                $e,\n                Mage::helper('{{namespace}}_{{module}}')->__('An error occurred while updating the {{entitiesLabel}}.')\n            );\n        }\n        $this->_redirect('*/*/', array('store'=> $storeId));\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/065_mass_parents",
    "content": "\n    /**\n     * mass {{siblingLabel}} change - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function mass{{Sibling}}IdAction()\n    {\n        ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');\n        if (!is_array(${{entity}}Ids)) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Please select {{entitiesLabel}}.')\n            );\n        } else {\n            try {\n                foreach (${{entity}}Ids as ${{entity}}Id) {\n                ${{entity}} = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id)\n                    ->set{{Sibling}}Id($this->getRequest()->getParam('flag_{{sibling}}_id'))\n                    ->setIsMassupdate(true)\n                    ->save();\n                }\n                $this->_getSession()->addSuccess(\n                    $this->__('Total of %d {{entitiesLabel}} were successfully updated.', count(${{entity}}Ids))\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error updating {{entitiesLabel}}.')\n                );\n                Mage::logException($e);\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/070_product_relation_actions",
    "content": "\n    /**\n     * get grid of products action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function productsAction()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('{{entity}}.edit.tab.product')\n            ->set{{Entity}}Products($this->getRequest()->getPost('{{entity}}_products', null));\n        $this->renderLayout();\n    }\n\n    /**\n     * get grid of products action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function productsgridAction()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('{{entity}}.edit.tab.product')\n            ->set{{Entity}}Products($this->getRequest()->getPost('{{entity}}_products', null));\n        $this->renderLayout();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/080_category_relation_actions",
    "content": "\n    /**\n     * get categories action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function categoriesAction()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * get child categories action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function categoriesJsonAction()\n    {\n        $this->_init{{Entity}}();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_categories')\n                ->getCategoryChildrenJson($this->getRequest()->getParam('category'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/090_sibling_grid",
    "content": "\n    /**\n     * {{siblingsLabel}} on the current {{entityLabel}}\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}Action()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('{{namespace}}_{{module}}.{{entity}}.edit.tab.{{sibling}}')\n            ->set{{Entity}}{{Siblings}}($this->getRequest()->getPost('{{siblings}}', null));\n        $this->renderLayout();\n    }\n\n    /**\n     * {{siblingsLabel}} on the current {{entityLabel}}\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}GridAction()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('{{namespace}}_{{module}}.{{entity}}.edit.tab.{{sibling}}')\n            ->set{{Entity}}{{Siblings}}($this->getRequest()->getPost('{{siblings}}', null));\n        $this->renderLayout();\n    }"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/100_sibling_actions_tree",
    "content": "\n    /**\n     * get {{siblingsLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}Action()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * get child {{siblingsLabel}}  action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}JsonAction()\n    {\n        $this->_init{{Entity}}();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}')\n                ->get{{Sibling}}ChildrenJson($this->getRequest()->getParam('{{sibling}}'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/110_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Adminhtml_{{Module}}_{{Entity}}Controller extends Mage_Adminhtml_Controller_Action\n{\n    /**\n     * Initialize requested {{entityLabel}} and put it into registry.\n     * Root {{entityLabel}} can be returned, if inappropriate store/{{entityLabel}} is specified\n     *\n     * @access protected\n     * @param bool $getRootInstead\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _init{{Entity}}($getRootInstead = false)\n    {\n        $this->_title($this->__('{{module_menu}}'))\n             ->_title($this->__('Manage {{EntitiesLabel}}'));\n        ${{entity}}Id = (int) $this->getRequest()->getParam('id', false);\n        $storeId    = (int) $this->getRequest()->getParam('store');\n        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}');\n        ${{entity}}->setStoreId($storeId);\n\n        if (${{entity}}Id) {\n            ${{entity}}->load(${{entity}}Id);\n            if ($storeId) {\n                $rootId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n                if (!in_array($rootId, ${{entity}}->getPathIds())) {\n                    // load root {{entityLabel}} instead wrong one\n                    if ($getRootInstead) {\n                        ${{entity}}->load($rootId);\n                    } else {\n                        $this->_redirect('*/*/', array('_current'=>true, 'id'=>null));\n                        return false;\n                    }\n                }\n            }\n        }\n\n        if ($activeTabId = (string) $this->getRequest()->getParam('active_tab_id')) {\n            Mage::getSingleton('admin/session')->set{{Entity}}ActiveTabId($activeTabId);\n        }\n\n        Mage::register('{{entity}}', ${{entity}});\n        Mage::register('current_{{entity}}', ${{entity}});\n        Mage::getSingleton('cms/wysiwyg_config')->setStoreId($this->getRequest()->getParam('store'));\n        return ${{entity}};\n    }\n\n    /**\n     * index action\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function indexAction()\n    {\n        $this->_forward('edit');\n    }\n\n    /**\n     * Add new {{entityLabel}} form\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function addAction()\n    {\n        Mage::getSingleton('admin/session')->uns{{Entity}}ActiveTabId();\n        $this->_forward('edit');\n    }\n\n    /**\n     * Edit {{entityLabel}} page\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function editAction()\n    {\n        $params['_current'] = true;\n        $redirect = false;\n\n        $storeId = (int) $this->getRequest()->getParam('store');\n        $parentId = (int) $this->getRequest()->getParam('parent');\n        $_prevStoreId = Mage::getSingleton('admin/session')\n            ->get{{Entity}}LastViewedStore(true);\n\n        if (!empty($_prevStoreId) && !$this->getRequest()->getQuery('isAjax')) {\n            $params['store'] = $_prevStoreId;\n            $redirect = true;\n        }\n\n        ${{entity}}Id = (int) $this->getRequest()->getParam('id');\n        $_prev{{Entity}}Id = Mage::getSingleton('admin/session')\n            ->getLastEdited{{Entity}}(true);\n\n\n        if ($_prev{{Entity}}Id\n            && !$this->getRequest()->getQuery('isAjax')\n            && !$this->getRequest()->getParam('clear')) {\n             $this->getRequest()->setParam('id', $_prev{{Entity}}Id);\n        }\n\n        if ($redirect) {\n            $this->_redirect('*/*/edit', $params);\n            return;\n        }\n\n        if ($storeId && !${{entity}}Id && !$parentId) {\n            $store = Mage::app()->getStore($storeId);\n            $_prev{{Entity}}Id = (int)Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n            $this->getRequest()->setParam('id', $_prev{{Entity}}Id);\n        }\n\n        if (!(${{entity}} = $this->_init{{Entity}}())) {\n            return;\n        }\n\n        $this->_title(${{entity}}Id ? ${{entity}}->getName() : $this->__('New {{EntityLabel}}'));\n\n        $data = Mage::getSingleton('adminhtml/session')->get{{Entity}}Data(true);\n        if (isset($data['{{entity}}'])) {\n            ${{entity}}->addData($data['{{entity}}']);\n        }\n\n        /**\n         * Build response for ajax request\n         */\n        if ($this->getRequest()->getQuery('isAjax')) {\n            $breadcrumbsPath = ${{entity}}->getPath();\n            if (empty($breadcrumbsPath)) {\n                $breadcrumbsPath = Mage::getSingleton('admin/session')->get{{Entity}}DeletedPath(true);\n                if (!empty($breadcrumbsPath)) {\n                    $breadcrumbsPath = explode('/', $breadcrumbsPath);\n                    if (count($breadcrumbsPath) <= 1) {\n                        $breadcrumbsPath = '';\n                    } else {\n                        array_pop($breadcrumbsPath);\n                        $breadcrumbsPath = implode('/', $breadcrumbsPath);\n                    }\n                }\n            }\n\n            Mage::getSingleton('admin/session')\n                ->set{{Entity}}LastViewedStore($this->getRequest()->getParam('store'));\n            Mage::getSingleton('admin/session')\n                ->setLastEdited{{Entity}}(${{entity}}->getId());\n            $this->loadLayout();\n\n            $eventResponse = new Varien_Object(\n                array(\n                    'content' => $this->getLayout()->getBlock('{{entity}}.edit')->getFormHtml()\n                        . $this->getLayout()->getBlock('{{entity}}.tree')\n                        ->getBreadcrumbsJavascript($breadcrumbsPath, 'editing{{Entity}}Breadcrumbs'),\n                    'messages' => $this->getLayout()->getMessagesBlock()->getGroupedHtml(),\n                )\n            );\n\n            Mage::dispatchEvent(\n                '{{entity}}_prepare_ajax_response',\n                array(\n                    'response' => $eventResponse,\n                    'controller' => $this\n                )\n            );\n\n            $this->getResponse()->setBody(\n                Mage::helper('core')->jsonEncode($eventResponse->getData())\n            );\n\n            return;\n        }\n\n        $this->loadLayout();\n        $this->_setActiveMenu('{{selectedMenuPath}}');\n        $this->getLayout()->getBlock('head')->setCanLoadExtJs(true)\n            ->setContainerCssClass('{{entities}}');\n\n        $this->_addBreadcrumb(\n            Mage::helper('{{namespace}}_{{module}}')->__('Manage {{EntitiesLabel}}'),\n            Mage::helper('catalog')->__('Manage {{EntitiesLabel}}')\n        );\n\n        $block = $this->getLayout()->getBlock('catalog.wysiwyg.js');\n        if ($block) {\n            $block->setStoreId($storeId);\n        }\n\n        $this->renderLayout();\n    }\n\n    /**\n     * WYSIWYG editor action for ajax request\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function wysiwygAction()\n    {\n        $elementId = $this->getRequest()->getParam('element_id', md5(microtime()));\n        $storeId = $this->getRequest()->getParam('store_id', 0);\n        $storeMediaUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n\n        $content = $this->getLayout()->createBlock(\n            'adminhtml/catalog_helper_form_wysiwyg_content',\n            '',\n            array(\n                'editor_element_id' => $elementId,\n                'store_id'          => $storeId,\n                'store_media_url'   => $storeMediaUrl,\n            )\n        );\n\n        $this->getResponse()->setBody($content->toHtml());\n    }\n\n    /**\n     * Get tree node (Ajax version)\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}JsonAction()\n    {\n        if ($this->getRequest()->getParam('expand_all')) {\n            Mage::getSingleton('admin/session')->set{{Entity}}IsTreeWasExpanded(true);\n        } else {\n            Mage::getSingleton('admin/session')->set{{Entity}}IsTreeWasExpanded(false);\n        }\n        if (${{entity}}Id = (int) $this->getRequest()->getPost('id')) {\n            $this->getRequest()->setParam('id', ${{entity}}Id);\n\n            if (!${{entity}} = $this->_init{{Entity}}()) {\n                return;\n            }\n            $this->getResponse()->setBody(\n                $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_tree')\n                    ->getTreeJson(${{entity}})\n            );\n        }\n    }\n\n    /**\n     * {{EntityLabel}} save\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function saveAction()\n    {\n        if (!${{entity}} = $this->_init{{Entity}}()) {\n            return;\n        }\n\n        $storeId = $this->getRequest()->getParam('store');\n        $refreshTree = 'false';\n        if ($data = $this->getRequest()->getPost()) {\n            ${{entity}}->addData($data['{{entity}}']);\n            if (!${{entity}}->getId()) {\n                $parentId = $this->getRequest()->getParam('parent');\n                if (!$parentId) {\n                    $parentId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n                }\n                $parent{{Entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($parentId);\n                ${{entity}}->setPath($parent{{Entity}}->getPath());\n            }\n\n            /**\n             * Process \"Use Config Settings\" checkboxes\n             */\n            if ($useConfig = $this->getRequest()->getPost('use_config')) {\n                foreach ($useConfig as $attributeCode) {\n                    ${{entity}}->setData($attributeCode, null);\n                }\n            }\n\n            ${{entity}}->setAttributeSetId(${{entity}}->getDefaultAttributeSetId());\n\n            Mage::dispatchEvent(\n                '{{namespace}}_{{module}}_{{entity}}_prepare_save',\n                array(\n                    '{{entity}}' => ${{entity}},\n                    'request' => $this->getRequest()\n                )\n            );\n\n            ${{entity}}->setData(\"use_post_data_config\", $this->getRequest()->getPost('use_config'));\n\n            try {\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/020_product_data",
    "content": "                $products = $this->getRequest()->getPost('{{entity}}_products', -1);\n                if ($products != -1) {\n                    $productData = array();\n                    parse_str($products, $productData);\n                    $products = array();\n                    foreach ($productData as $id => $position) {\n                        $products[$id]['position'] = $position;\n                    }\n                    ${{entity}}->setProductsData($productData);\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/030_category_data",
    "content": "                $categories = $this->getRequest()->getPost('category_ids', -1);\n                if ($categories != -1) {\n                    $categories = explode(',', $categories);\n                    $categories = array_unique($categories);\n                    ${{entity}}->setCategoriesData($categories);\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/040_sibling_data",
    "content": "                ${{siblings}} = $this->getRequest()->getPost('{{entity}}_{{siblings}}', -1);\n                if (${{siblings}} != -1) {\n                    ${{sibling}}Data = array();\n                    parse_str(${{siblings}}, ${{sibling}}Data);\n                    foreach (${{sibling}}Data as $id => $position) {\n                        ${{sibling}}[$id]['position'] = $position;\n                    }\n                    ${{entity}}->set{{Siblings}}Data(${{sibling}}Data);\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/045_sibling_data_tree",
    "content": "                ${{siblings}} = $this->getRequest()->getPost('{{sibling}}_ids', -1);\n                if (${{siblings}} != -1) {\n                    ${{siblings}} = explode(',', ${{siblings}});\n                    ${{siblings}} = array_unique(${{siblings}});\n                    ${{entity}}->set{{Siblings}}Data(${{siblings}});\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/050_real_save",
    "content": "                /**\n                 * Check \"Use Default Value\" checkboxes values\n                 */\n                if ($useDefaults = $this->getRequest()->getPost('use_default')) {\n                    foreach ($useDefaults as $attributeCode) {\n                        ${{entity}}->setData($attributeCode, false);\n                    }\n                }\n\n                /**\n                 * Unset $_POST['use_config'] before save\n                 */\n                ${{entity}}->unsetData('use_post_data_config');\n\n                ${{entity}}->save();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('The {{entityLabel}} has been saved.')\n                );\n                $refreshTree = 'true';\n            } catch (Exception $e) {\n                $this->_getSession()->addError($e->getMessage())\n                    ->set{{Entity}}Data($data);\n                $refreshTree = 'false';\n            }\n        }\n        $url = $this->getUrl('*/*/edit', array('_current' => true, 'id' => ${{entity}}->getId()));\n        $this->getResponse()->setBody(\n            '<script type=\"text/javascript\">parent.updateContent(\"' . $url . '\", {}, '.$refreshTree.');</script>'\n        );\n    }\n\n    /**\n     * Move {{entityLabel}} action\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function moveAction()\n    {\n        ${{entity}} = $this->_init{{Entity}}();\n        if (!${{entity}}) {\n            $this->getResponse()->setBody(\n                Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} move error')\n            );\n            return;\n        }\n        $parentNodeId   = $this->getRequest()->getPost('pid', false);\n        $prevNodeId     = $this->getRequest()->getPost('aid', false);\n\n        try {\n            ${{entity}}->move($parentNodeId, $prevNodeId);\n            $this->getResponse()->setBody(\"SUCCESS\");\n        } catch (Mage_Core_Exception $e) {\n            $this->getResponse()->setBody($e->getMessage());\n        } catch (Exception $e) {\n            $this->getResponse()->setBody(\n                Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} move error')\n            );\n            Mage::logException($e);\n        }\n\n    }\n\n    /**\n     * Delete {{entityLabel}} action\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function deleteAction()\n    {\n        if ($id = (int) $this->getRequest()->getParam('id')) {\n            try {\n                ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($id);\n                Mage::dispatchEvent(\n                    '{{namespace}}_{{module}}_controller_{{entity}}_delete',\n                    array('{{entity}}' => ${{entity}})\n                );\n\n                Mage::getSingleton('admin/session')->set{{Entity}}DeletedPath(${{entity}}->getPath());\n\n                ${{entity}}->delete();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('The {{entityLabel}} has been deleted.')\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n                $this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=>true)));\n                return;\n            } catch (Exception $e) {\n                Mage::logException($e);\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('An error occurred while trying to delete the {{entityLabel}}.')\n                );\n                $this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=>true)));\n                return;\n            }\n        }\n        $this->getResponse()->setRedirect($this->getUrl('*/*/', array('_current'=>true, 'id'=>null)));\n    }\n\n    /**\n     * Tree Action\n     * Retrieve {{entityLabel}} tree\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function treeAction()\n    {\n        $storeId = (int) $this->getRequest()->getParam('store');\n        ${{entity}}Id = (int) $this->getRequest()->getParam('id');\n\n        if ($storeId) {\n            if (!${{entity}}Id) {\n                $store = Mage::app()->getStore($storeId);\n                $rootId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n                $this->getRequest()->setParam('id', $rootId);\n            }\n        }\n\n        ${{entity}} = $this->_init{{Entity}}();\n\n        $block = $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_tree');\n        $root  = $block->getRoot();\n        $this->getResponse()->setBody(\n            Mage::helper('core')->jsonEncode(\n                array(\n                    'data' => $block->getTree(),\n                    'parameters' => array(\n                        'text'         => $block->buildNodeName($root),\n                        'draggable'    => false,\n                        'allowDrop'    => ($root->getIsVisible()) ? true : false,\n                        'id'           => (int) $root->getId(),\n                        'expanded'     => (int) $block->getIsWasExpanded(),\n                        'store_id'     => (int) $block->getStore()->getId(),\n                        '{{entity}}_id' => (int) ${{entity}}->getId(),\n                        'root_visible' => (int) $root->getIsVisible()\n                    )\n                )\n            )\n        );\n    }\n\n   /**\n    * Build response for refresh input element 'path' in form\n    *\n    * @access public\n    * {{qwertyuiop}}\n    */\n    public function refreshPathAction()\n    {\n        if ($id = (int) $this->getRequest()->getParam('id')) {\n            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($id);\n            $this->getResponse()->setBody(\n                Mage::helper('core')->jsonEncode(\n                    array(\n                       'id' => $id,\n                       'path' => ${{entity}}->getPath(),\n                    )\n                )\n            );\n        }\n    }\n\n    /**\n     * Check if admin has permissions to visit related pages\n     *\n     * @access protected\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    protected function _isAllowed()\n    {\n        return Mage::getSingleton('admin/session')->isAllowed('{{selectedMenuPath}}');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/060_product_relation_action",
    "content": "\n    /**\n     * get the products grid\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function productsgridAction()\n    {\n        if (!${{entity}} = $this->_init{{Entity}}()) {\n            return;\n        }\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock(\n                '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_product',\n                '{{entity}}.product.grid'\n            )\n            ->toHtml()\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/070_category_relation_action",
    "content": "\n    /**\n     * get child categories action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function categoriesJsonAction()\n    {\n        $this->_init{{Entity}}();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_categories')\n                ->getCategoryChildrenJson($this->getRequest()->getParam('category'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/080_sibling_actions",
    "content": "\n    /**\n     * get child {{siblingsLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}gridAction()\n    {\n        if (!${{entity}} = $this->_init{{Entity}}()) {\n            return;\n        }\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock(\n                '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}',\n                '{{entity}}.{{sibling}}.grid'\n            )\n            ->toHtml()\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerEavTree/090_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Adminhtml_{{ModuleFolder}}_{{Entity}}Controller extends {{Namespace}}_{{Module}}_Controller_Adminhtml_{{Module}}\n{\n    /**\n     * init the {{entityLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     */\n    protected function _init{{Entity}}()\n    {\n        ${{entity}}Id  = (int) $this->getRequest()->getParam('id');\n        ${{entity}}    = Mage::getModel('{{namespace}}_{{module}}/{{entity}}');\n        if (${{entity}}Id) {\n            ${{entity}}->load(${{entity}}Id);\n        }\n        Mage::register('current_{{entity}}', ${{entity}});\n        return ${{entity}};\n    }\n\n    /**\n     * default action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function indexAction()\n    {\n        $this->loadLayout();\n        $this->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{module_menu}}'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'));\n        $this->renderLayout();\n    }\n\n    /**\n     * grid action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function gridAction()\n    {\n        $this->loadLayout()->renderLayout();\n    }\n\n    /**\n     * edit {{entityLabel}} - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function editAction()\n    {\n        ${{entity}}Id    = $this->getRequest()->getParam('id');\n        ${{entity}}      = $this->_init{{Entity}}();\n        if (${{entity}}Id && !${{entity}}->getId()) {\n            $this->_getSession()->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('This {{entityLabel}} no longer exists.')\n            );\n            $this->_redirect('*/*/');\n            return;\n        }\n        $data = Mage::getSingleton('adminhtml/session')->get{{Entity}}Data(true);\n        if (!empty($data)) {\n            ${{entity}}->setData($data);\n        }\n        Mage::register('{{entity}}_data', ${{entity}});\n        $this->loadLayout();\n        $this->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{module_menu}}'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'));\n        if (${{entity}}->getId()) {\n            $this->_title(${{entity}}->get{{EntityNameMagicCode}}());\n        } else {\n            $this->_title(Mage::helper('{{namespace}}_{{module}}')->__('Add {{entityLabel}}'));\n        }\n        if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n            $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n        }\n        $this->renderLayout();\n    }\n\n    /**\n     * new {{entityLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function newAction()\n    {\n        $this->_forward('edit');\n    }\n\n    /**\n     * save {{entityLabel}} - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function saveAction()\n    {\n        if ($data = $this->getRequest()->getPost('{{entity}}')) {\n            try {{{filterEntityDates}}\n                ${{entity}} = $this->_init{{Entity}}();\n                ${{entity}}->addData($data);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/020_upload_image",
    "content": "                ${{attributeMagicCode}}Name = $this->_uploadAndGetName(\n                    '{{attributeCode}}',\n                    Mage::helper('{{namespace}}_{{module}}/{{entity}}_image')->getImageBaseDir(),\n                    $data\n                );\n                ${{entity}}->setData('{{attributeCode}}', ${{attributeMagicCode}}Name);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/030_upload_files",
    "content": "                ${{attributeMagicCode}}Name = $this->_uploadAndGetName(\n                    '{{attributeCode}}',\n                    Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getFileBaseDir(),\n                    $data\n                );\n                ${{entity}}->setData('{{attributeCode}}', ${{attributeMagicCode}}Name);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/040_save_product_relation",
    "content": "                $products = $this->getRequest()->getPost('products', -1);\n                if ($products != -1) {\n                    ${{entity}}->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/050_save_category_relation",
    "content": "                $categories = $this->getRequest()->getPost('category_ids', -1);\n                if ($categories != -1) {\n                    $categories = explode(',', $categories);\n                    $categories = array_unique($categories);\n                    ${{entity}}->setCategoriesData($categories);\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/060_save_sibling_relation",
    "content": "                ${{siblings}} = $this->getRequest()->getPost('{{siblings}}', -1);\n                if (${{siblings}} != -1) {\n                    ${{entity}}->set{{Siblings}}Data(\n                        Mage::helper('adminhtml/js')->decodeGridSerializedInput(${{siblings}})\n                    );\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/070_save_sibling_relation_tree",
    "content": "                ${{siblings}} = $this->getRequest()->getPost('{{sibling}}_ids', -1);\n                if (${{siblings}} != -1) {\n                    ${{siblings}} = explode(',', ${{siblings}});\n                    ${{siblings}} = array_unique(${{siblings}});\n                    ${{entity}}->set{{Siblings}}Data(${{siblings}});\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/080_save",
    "content": "                ${{entity}}->save();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} was successfully saved')\n                );\n                Mage::getSingleton('adminhtml/session')->setFormData(false);\n                if ($this->getRequest()->getParam('back')) {\n                    $this->_redirect('*/*/edit', array('id' => ${{entity}}->getId()));\n                    return;\n                }\n                $this->_redirect('*/*/');\n                return;\n            } catch (Mage_Core_Exception $e) {\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/090_exception_upload",
    "content": "                if (isset($data['{{attributeCode}}']['value'])) {\n                    $data['{{attributeCode}}'] = $data['{{attributeCode}}']['value'];\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/100_exception",
    "content": "                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n                Mage::getSingleton('adminhtml/session')->set{{Entity}}Data($data);\n                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n                return;\n            } catch (Exception $e) {\n                Mage::logException($e);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/110_center",
    "content": "                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was a problem saving the {{entityLabel}}.')\n                );\n                Mage::getSingleton('adminhtml/session')->set{{Entity}}Data($data);\n                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n                return;\n            }\n        }\n        Mage::getSingleton('adminhtml/session')->addError(\n            Mage::helper('{{namespace}}_{{module}}')->__('Unable to find {{entityLabel}} to save.')\n        );\n        $this->_redirect('*/*/');\n    }\n\n    /**\n     * delete {{entityLabel}} - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function deleteAction()\n    {\n        if ( $this->getRequest()->getParam('id') > 0) {\n            try {\n                ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}');\n                ${{entity}}->setId($this->getRequest()->getParam('id'))->delete();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} was successfully deleted.')\n                );\n                $this->_redirect('*/*/');\n                return;\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error deleting {{entityLabel}}.')\n                );\n                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n                Mage::logException($e);\n                return;\n            }\n        }\n        Mage::getSingleton('adminhtml/session')->addError(\n            Mage::helper('{{namespace}}_{{module}}')->__('Could not find {{entityLabel}} to delete.')\n        );\n        $this->_redirect('*/*/');\n    }\n\n    /**\n     * mass delete {{entityLabel}} - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function massDeleteAction()\n    {\n        ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');\n        if (!is_array(${{entity}}Ids)) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Please select {{entitiesLabel}} to delete.')\n            );\n        } else {\n            try {\n                foreach (${{entity}}Ids as ${{entity}}Id) {\n                    ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}');\n                    ${{entity}}->setId(${{entity}}Id)->delete();\n                }\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('Total of %d {{entitiesLabel}} were successfully deleted.', count(${{entity}}Ids))\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error deleting {{entitiesLabel}}.')\n                );\n                Mage::logException($e);\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n\n    /**\n     * mass status change - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function massStatusAction()\n    {\n        ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');\n        if (!is_array(${{entity}}Ids)) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Please select {{entitiesLabel}}.')\n            );\n        } else {\n            try {\n                foreach (${{entity}}Ids as ${{entity}}Id) {\n                ${{entity}} = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id)\n                            ->setStatus($this->getRequest()->getParam('status'))\n                            ->setIsMassupdate(true)\n                            ->save();\n                }\n                $this->_getSession()->addSuccess(\n                    $this->__('Total of %d {{entitiesLabel}} were successfully updated.', count(${{entity}}Ids))\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error updating {{entitiesLabel}}.')\n                );\n                Mage::logException($e);\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/120_mass_update",
    "content": "\n    /**\n     * mass {{attributeLabel}} change - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function mass{{AttributeMagicCode}}Action()\n    {\n        ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');\n        if (!is_array(${{entity}}Ids)) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Please select {{entitiesLabel}}.')\n            );\n        } else {\n            try {\n                foreach (${{entity}}Ids as ${{entity}}Id) {\n                    ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id)\n                        ->set{{AttributeMagicCode}}($this->getRequest()->getParam('flag_{{attributeCode}}'))\n                        ->setIsMassupdate(true)\n                        ->save();\n                }\n                $this->_getSession()->addSuccess(\n                    $this->__('Total of %d {{entitiesLabel}} were successfully updated.', count(${{entity}}Ids))\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error updating {{entitiesLabel}}.')\n                );\n                Mage::logException($e);\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/130_mass_parents",
    "content": "\n    /**\n     * mass {{siblingLabel}} change - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function mass{{Sibling}}IdAction()\n    {\n        ${{entity}}Ids = $this->getRequest()->getParam('{{entity}}');\n        if (!is_array(${{entity}}Ids)) {\n            Mage::getSingleton('adminhtml/session')->addError(\n                Mage::helper('{{namespace}}_{{module}}')->__('Please select {{entitiesLabel}}.')\n            );\n        } else {\n            try {\n                foreach (${{entity}}Ids as ${{entity}}Id) {\n                ${{entity}} = Mage::getSingleton('{{namespace}}_{{module}}/{{entity}}')->load(${{entity}}Id)\n                    ->set{{Sibling}}Id($this->getRequest()->getParam('flag_{{sibling}}_id'))\n                    ->setIsMassupdate(true)\n                    ->save();\n                }\n                $this->_getSession()->addSuccess(\n                    $this->__('Total of %d {{entitiesLabel}} were successfully updated.', count(${{entity}}Ids))\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('There was an error updating {{entitiesLabel}}.')\n                );\n                Mage::logException($e);\n            }\n        }\n        $this->_redirect('*/*/index');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/140_product_relation_actions",
    "content": "\n    /**\n     * get grid of products action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function productsAction()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('{{entity}}.edit.tab.product')\n            ->set{{Entity}}Products($this->getRequest()->getPost('{{entity}}_products', null));\n        $this->renderLayout();\n    }\n\n    /**\n     * get grid of products action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function productsgridAction()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('{{entity}}.edit.tab.product')\n            ->set{{Entity}}Products($this->getRequest()->getPost('{{entity}}_products', null));\n        $this->renderLayout();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/150_category_relation_actions",
    "content": "\n    /**\n     * get categories action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function categoriesAction()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * get child categories action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function categoriesJsonAction()\n    {\n        $this->_init{{Entity}}();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_categories')\n                ->getCategoryChildrenJson($this->getRequest()->getParam('category'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/160_sibling_actions",
    "content": "\n    /**\n     * get {{siblingsLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}Action()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('{{namespace}}_{{module}}.{{entity}}.edit.tab.{{sibling}}')\n            ->set{{Entity}}{{Siblings}}($this->getRequest()->getPost('{{entity}}_{{siblings}}', null));\n        $this->renderLayout();\n    }\n\n    /**\n     * get {{siblingsLabel}} grid  action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}gridAction()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->getLayout()->getBlock('{{namespace}}_{{module}}.{{entity}}.edit.tab.{{sibling}}')\n            ->set{{Entity}}{{Siblings}}($this->getRequest()->getPost('{{entity}}_{{siblings}}', null));\n        $this->renderLayout();\n    }"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/170_sibling_actions_tree",
    "content": "\n    /**\n     * get {{siblingsLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}Action()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * get child {{siblingsLabel}}  action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}JsonAction()\n    {\n        $this->_init{{Entity}}();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}')\n                ->get{{Sibling}}ChildrenJson($this->getRequest()->getParam('{{sibling}}'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/180_footer",
    "content": "\n    /**\n     * export as csv - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportCsvAction()\n    {\n        $fileName   = '{{entity}}.csv';\n        $content    = $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_grid')\n            ->getCsv();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * export as MsExcel - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportExcelAction()\n    {\n        $fileName   = '{{entity}}.xls';\n        $content    = $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_grid')\n            ->getExcelFile();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * export as xml - action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function exportXmlAction()\n    {\n        $fileName   = '{{entity}}.xml';\n        $content    = $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_grid')\n            ->getXml();\n        $this->_prepareDownloadResponse($fileName, $content);\n    }\n\n    /**\n     * Check if admin has permissions to visit related pages\n     *\n     * @access protected\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    protected function _isAllowed()\n    {\n        return Mage::getSingleton('admin/session')->isAllowed('{{selectedMenuPath}}');\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} admin controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_Adminhtml_{{ModuleFolder}}_{{Entity}}Controller extends {{Namespace}}_{{Module}}_Controller_Adminhtml_{{Module}}\n{\n    /**\n     * init {{entityLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _init{{Entity}}()\n    {\n        ${{entity}}Id = (int) $this->getRequest()->getParam('id', false);\n        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}');\n        if (${{entity}}Id) {\n            ${{entity}}->load(${{entity}}Id);\n        } else {\n            ${{entity}}->setData(${{entity}}->getDefaultValues());\n        }\n        if ($activeTabId = (string) $this->getRequest()->getParam('active_tab_id')) {\n            Mage::getSingleton('admin/session')->set{{Entity}}ActiveTabId($activeTabId);\n        }\n        Mage::register('{{entity}}', ${{entity}});\n        Mage::register('current_{{entity}}', ${{entity}});\n        return ${{entity}};\n    }\n\n    /**\n     * default action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function indexAction()\n    {\n        $this->_forward('edit');\n    }\n\n    /**\n     * Add new {{entityLabel}} form\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function addAction()\n    {\n        Mage::getSingleton('admin/session')->uns{{Entity}}ActiveTabId();\n        $this->_forward('edit');\n    }\n\n    /**\n     * Edit {{entityLabel}} page\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function editAction()\n    {\n        $params['_current'] = true;\n        $redirect = false;\n        $parentId = (int) $this->getRequest()->getParam('parent');\n        ${{entity}}Id = (int) $this->getRequest()->getParam('id');\n        $_prev{{Entity}}Id = Mage::getSingleton('admin/session')->getLastEdited{{Entity}}(true);\n        if ($_prev{{Entity}}Id &&\n            !$this->getRequest()->getQuery('isAjax') &&\n            !$this->getRequest()->getParam('clear')) {\n            $this->getRequest()->setParam('id', $_prev{{Entity}}Id);\n        }\n        if ($redirect) {\n            $this->_redirect('*/*/edit', $params);\n            return;\n        }\n        if (!(${{entity}} = $this->_init{{Entity}}())) {\n            return;\n        }\n        $this->_title(${{entity}}Id ? ${{entity}}->get{{EntityNameMagicCode}}() : $this->__('New {{EntityLabel}}'));\n        $data = Mage::getSingleton('adminhtml/session')->get{{Entity}}Data(true);\n        if (isset($data['{{entity}}'])) {\n            ${{entity}}->addData($data['{{entity}}']);\n        }\n        if ($this->getRequest()->getQuery('isAjax')) {\n            $breadcrumbsPath = ${{entity}}->getPath();\n            if (empty($breadcrumbsPath)) {\n                $breadcrumbsPath = Mage::getSingleton('admin/session')->get{{Entity}}DeletedPath(true);\n                if (!empty($breadcrumbsPath)) {\n                    $breadcrumbsPath = explode('/', $breadcrumbsPath);\n                    if (count($breadcrumbsPath) <= 1) {\n                        $breadcrumbsPath = '';\n                    } else {\n                        array_pop($breadcrumbsPath);\n                        $breadcrumbsPath = implode('/', $breadcrumbsPath);\n                    }\n                }\n            }\n            Mage::getSingleton('admin/session')->setLastEdited{{Entity}}(${{entity}}->getId());\n            $this->loadLayout();\n            $eventResponse = new Varien_Object(\n                array(\n                    'content' => $this->getLayout()->getBlock('{{entity}}.edit')->getFormHtml().\n                        $this->getLayout()->getBlock('{{entity}}.tree')->getBreadcrumbsJavascript(\n                            $breadcrumbsPath,\n                            'editing{{Entity}}Breadcrumbs'\n                        ),\n                    'messages' => $this->getLayout()->getMessagesBlock()->getGroupedHtml(),\n                )\n            );\n            $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($eventResponse->getData()));\n            return;\n        }\n        $this->loadLayout();\n        $this->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{module_menu}}'))\n             ->_title(Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'));\n        $this->_setActiveMenu('{{selectedMenuPath}}');\n        $this->getLayout()->getBlock('head')->setCanLoadExtJs(true)\n            ->setContainerCssClass('{{entity}}');\n\n        $this->_addBreadcrumb(\n            Mage::helper('{{namespace}}_{{module}}')->__('Manage {{EntitiesLabel}}'),\n            Mage::helper('{{namespace}}_{{module}}')->__('Manage {{EntitiesLabel}}')\n        );\n        if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n            $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n        }\n        $this->renderLayout();\n    }\n\n    /**\n     * Get tree node (Ajax version)\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{entities}}JsonAction()\n    {\n        if ($this->getRequest()->getParam('expand_all')) {\n            Mage::getSingleton('admin/session')->set{{Entity}}IsTreeWasExpanded(true);\n        } else {\n            Mage::getSingleton('admin/session')->set{{Entity}}IsTreeWasExpanded(false);\n        }\n        if (${{entity}}Id = (int) $this->getRequest()->getPost('id')) {\n            $this->getRequest()->setParam('id', ${{entity}}Id);\n            if (!${{entity}} = $this->_init{{Entity}}()) {\n                return;\n            }\n            $this->getResponse()->setBody(\n                $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_tree')\n                    ->getTreeJson(${{entity}})\n            );\n        }\n    }\n\n    /**\n     * Move {{entityLabel}} action\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function moveAction()\n    {\n        ${{entity}} = $this->_init{{Entity}}();\n        if (!${{entity}}) {\n            $this->getResponse()->setBody(\n                Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} move error')\n            );\n            return;\n        }\n        $parentNodeId   = $this->getRequest()->getPost('pid', false);\n        $prevNodeId = $this->getRequest()->getPost('aid', false);\n        try {\n            ${{entity}}->move($parentNodeId, $prevNodeId);\n            $this->getResponse()->setBody(\"SUCCESS\");\n        } catch (Mage_Core_Exception $e) {\n            $this->getResponse()->setBody($e->getMessage());\n        } catch (Exception $e) {\n            $this->getResponse()->setBody(\n                Mage::helper('{{namespace}}_{{module}}')->__('{{EntityLabel}} move error')\n            );\n            Mage::logException($e);\n        }\n    }\n\n    /**\n     * Tree Action\n     * Retrieve {{entityLabel}} tree\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function treeAction()\n    {\n        ${{entity}}Id = (int) $this->getRequest()->getParam('id');\n        ${{entity}} = $this->_init{{Entity}}();\n        $block = $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_tree');\n        $root  = $block->getRoot();\n        $this->getResponse()->setBody(\n            Mage::helper('core')->jsonEncode(\n                array(\n                    'data' => $block->getTree(),\n                    'parameters' => array(\n                        'text'          => $block->buildNodeName($root),\n                        'draggable'     => false,\n                        'allowDrop'     => ($root->getIsVisible()) ? true : false,\n                        'id'            => (int) $root->getId(),\n                        'expanded'      => (int) $block->getIsWasExpanded(),\n                        '{{entity}}_id' => (int) ${{entity}}->getId(),\n                        'root_visible'  => (int) $root->getIsVisible()\n                    )\n                )\n            )\n        );\n    }\n\n    /**\n     * Build response for refresh input element 'path' in form\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function refreshPathAction()\n    {\n        if ($id = (int) $this->getRequest()->getParam('id')) {\n            ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($id);\n            $this->getResponse()->setBody(\n                Mage::helper('core')->jsonEncode(\n                    array(\n                       'id' => $id,\n                       'path' => ${{entity}}->getPath(),\n                    )\n                )\n            );\n        }\n    }\n\n    /**\n     * Delete {{entityLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function deleteAction()\n    {\n        if ($id = (int) $this->getRequest()->getParam('id')) {\n            try {\n                ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($id);\n                Mage::getSingleton('admin/session')->set{{Entity}}DeletedPath(${{entity}}->getPath());\n\n                ${{entity}}->delete();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('The {{entityLabel}} has been deleted.')\n                );\n            } catch (Mage_Core_Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n                $this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=>true)));\n                return;\n            } catch (Exception $e) {\n                Mage::getSingleton('adminhtml/session')->addError(\n                    Mage::helper('{{namespace}}_{{module}}')->__('An error occurred while trying to delete the {{entityLabel}}.')\n                );\n                $this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=>true)));\n                Mage::logException($e);\n                return;\n            }\n        }\n        $this->getResponse()->setRedirect($this->getUrl('*/*/', array('_current'=>true, 'id'=>null)));\n    }\n\n    /**\n     * Check if admin has permissions to visit related pages\n     *\n     * @access protected\n     * @return boolean\n     * {{qwertyuiop}}\n     */\n    protected function _isAllowed()\n    {\n        return Mage::getSingleton('admin/session')->isAllowed('{{selectedMenuPath}}');\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/020_wysiwyg",
    "content": "\n    /**\n     * wyisiwyg action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function wysiwygAction()\n    {\n        $elementId = $this->getRequest()->getParam('element_id', md5(microtime()));\n        $storeMediaUrl = Mage::app()->getStore(0)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n\n        $content = $this->getLayout()->createBlock(\n            'adminhtml/catalog_helper_form_wysiwyg_content',\n            '',\n            array(\n                'editor_element_id' => $elementId,\n                'store_id'          => 0,\n                'store_media_url'   => $storeMediaUrl,\n            )\n        );\n        $this->getResponse()->setBody($content->toHtml());\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/030_save",
    "content": "\n    /**\n     * {{EntityLabel}} save action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function saveAction()\n    {\n        if (!${{entity}} = $this->_init{{Entity}}()) {\n            return;\n        }\n        $refreshTree = 'false';\n        if ($data = $this->getRequest()->getPost('{{entity}}')) {{{filterEntityDates3}}\n            ${{entity}}->addData($data);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/040_upload_image",
    "content": "                ${{attributeMagicCode}}Name = $this->_uploadAndGetName(\n                    '{{attributeCode}}',\n                    Mage::helper('{{namespace}}_{{module}}/{{entity}}_image')->getImageBaseDir(),\n                    $data\n                );\n                ${{entity}}->setData('{{attributeCode}}', ${{attributeMagicCode}}Name);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/050_upload_file",
    "content": "                ${{attributeMagicCode}}Name = $this->_uploadAndGetName(\n                    '{{attributeCode}}',\n                    Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getFileBaseDir(),\n                    $data\n                );\n                ${{entity}}->setData('{{attributeCode}}', ${{attributeMagicCode}}Name);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/060_save_continue",
    "content": "            if (!${{entity}}->getId()) {\n                $parentId = $this->getRequest()->getParam('parent');\n                if (!$parentId) {\n                    $parentId = Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id();\n                }\n                $parent{{Entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')->load($parentId);\n                ${{entity}}->setPath($parent{{Entity}}->getPath());\n            }\n            try {\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/070_product_data",
    "content": "                $products = $this->getRequest()->getPost('{{entity}}_products', -1);\n                if ($products != -1) {\n                    $productData = array();\n                    parse_str($products, $productData);\n                    $products = array();\n                    foreach ($productData as $id => $position) {\n                        $products[$id]['position'] = $position;\n                    }\n                    ${{entity}}->setProductsData($productData);\n                }\n\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/080_category_data",
    "content": "                $categories = $this->getRequest()->getPost('category_ids', -1);\n                if ($categories != -1) {\n                    $categories = explode(',', $categories);\n                    $categories = array_unique($categories);\n                    ${{entity}}->setCategoriesData($categories);\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/090_sibling_data",
    "content": "                ${{siblings}} = $this->getRequest()->getPost('{{entity}}_{{siblings}}', -1);\n                if (${{siblings}} != -1) {\n                    ${{sibling}}Data = array();\n                    parse_str(${{siblings}}, ${{sibling}}Data);\n                    foreach (${{sibling}}Data as $id => $position) {\n                        ${{sibling}}[$id]['position'] = $position;\n                    }\n                    ${{entity}}->set{{Siblings}}Data(${{sibling}}Data);\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/095_sibling_data_tree",
    "content": "                ${{siblings}} = $this->getRequest()->getPost('{{sibling}}_ids', -1);\n                if (${{siblings}} != -1) {\n                    ${{siblings}} = explode(',', ${{siblings}});\n                    ${{siblings}} = array_unique(${{siblings}});\n                    ${{entity}}->set{{Siblings}}Data(${{siblings}});\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/100_real_save",
    "content": "                ${{entity}}->save();\n                Mage::getSingleton('adminhtml/session')->addSuccess(\n                    Mage::helper('{{namespace}}_{{module}}')->__('The {{entityLabel}} has been saved.')\n                );\n                $refreshTree = 'true';\n            }\n            catch (Exception $e) {\n                $this->_getSession()->addError($e->getMessage())->set{{Entity}}Data($data);\n                Mage::logException($e);\n                $refreshTree = 'false';\n            }\n        }\n        $url = $this->getUrl('*/*/edit', array('_current' => true, 'id' => ${{entity}}->getId()));\n        $this->getResponse()->setBody(\n            '<script type=\"text/javascript\">parent.updateContent(\"' . $url . '\", {}, '.$refreshTree.');</script>'\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/110_product_relation_action",
    "content": "\n    /**\n     * get the products grid\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function productsgridAction()\n    {\n        if (!${{entity}} = $this->_init{{Entity}}()) {\n            return;\n        }\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock(\n                '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_product',\n                '{{entity}}.product.grid'\n            )\n            ->toHtml()\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/120_category_relation_action",
    "content": "\n    /**\n     * get child categories action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function categoriesJsonAction()\n    {\n        $this->_init{{Entity}}();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_categories')\n                ->getCategoryChildrenJson($this->getRequest()->getParam('category'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/130_sibling_actions",
    "content": "\n    /**\n     * get {{siblingsLabel}} grid action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}gridAction()\n    {\n        if (!${{entity}} = $this->_init{{Entity}}()) {\n            return;\n        }\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock(\n                '{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}',\n                '{{entity}}.{{sibling}}.grid'\n            )\n            ->toHtml()\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/135_sibling_actions_tree",
    "content": "\n    /**\n     * get {{siblingsLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}Action()\n    {\n        $this->_init{{Entity}}();\n        $this->loadLayout();\n        $this->renderLayout();\n    }\n\n    /**\n     * get child {{siblingsLabel}}  action\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function {{siblings}}JsonAction()\n    {\n        $this->_init{{Entity}}();\n        $this->getResponse()->setBody(\n            $this->getLayout()->createBlock('{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}')\n                ->get{{Sibling}}ChildrenJson($this->getRequest()->getParam('{{sibling}}'))\n        );\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/140_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Entity/Customer/CommentController/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} comments controller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_{{Entity}}_Customer_CommentController extends Mage_Core_Controller_Front_Action\n{\n    /**\n     * Action predispatch\n     * Check customer authentication for some actions\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function preDispatch()\n    {\n        parent::preDispatch();\n        if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n            $this->setFlag('', self::FLAG_NO_DISPATCH, true);\n        }\n    }\n\n    /**\n     * List comments\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function indexAction()\n    {\n        $this->loadLayout();\n        $this->_initLayoutMessages('catalog/session');\n        $this->_initLayoutMessages('customer/session');\n        $this->_initLayoutMessages('checkout/session');\n        if ($navigationBlock = $this->getLayout()->getBlock('customer_account_navigation')) {\n            $navigationBlock->setActive('{{namespace}}_{{module}}/{{entity}}_customer_comment/');\n        }\n        if ($block = $this->getLayout()->getBlock('{{entity}}_customer_comment_list')) {\n            $block->setRefererUrl($this->_getRefererUrl());\n        }\n\n        $this->getLayout()->getBlock('head')->setTitle($this->__('My {{EntityLabel}} Comments'));\n\n        $this->renderLayout();\n    }\n\n    /**\n     * View comment\n     *\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function viewAction()\n    {\n        $commentId = $this->getRequest()->getParam('id');\n        $comment = Mage::getModel('{{namespace}}_{{module}}/{{entity}}_comment')->load($commentId);\n        if (!$comment->getId() ||\n            $comment->getCustomerId() != Mage::getSingleton('customer/session')->getCustomerId() ||\n            $comment->getStatus() != {{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_APPROVED) {\n            $this->_forward('no-route');\n            return;\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Entity/Customer/CommentController/020_entity_eav",
    "content": "        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n            ->setStoreId(Mage::app()->getStore()->getId())\n            ->load($comment->get{{Entity}}Id());\n        if (!${{entity}}->getId() || ${{entity}}->getStatus() != 1) {\n            $this->_forward('no-route');\n            return;\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Entity/Customer/CommentController/030_entity_flat",
    "content": "        ${{entity}} = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n            ->load($comment->get{{Entity}}Id());\n        if (!${{entity}}->getId() || ${{entity}}->getStatus() != 1) {\n            $this->_forward('no-route');\n            return;\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Entity/Customer/CommentController/040_store",
    "content": "        $stores = array(Mage::app()->getStore()->getId(), 0);\n        if (count(array_intersect($stores, $comment->getStoreId())) == 0) {\n            $this->_forward('no-route');\n            return;\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Entity/Customer/CommentController/050_entity_flat_store",
    "content": "        if (count(array_intersect($stores, ${{entity}}->getStoreId())) == 0) {\n            $this->_forward('no-route');\n            return;\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/Entity/Customer/CommentController/060_footer",
    "content": "        Mage::register('current_comment', $comment);\n        Mage::register('current_{{entity}}', ${{entity}});\n        $this->loadLayout();\n        $this->_initLayoutMessages('catalog/session');\n        $this->_initLayoutMessages('customer/session');\n        $this->_initLayoutMessages('checkout/session');\n        if ($navigationBlock = $this->getLayout()->getBlock('customer_account_navigation')) {\n            $navigationBlock->setActive('{{namespace}}_{{module}}/{{entity}}_customer_comment/');\n        }\n        if ($block = $this->getLayout()->getBlock('customer_{{entity}}_comment')) {\n            $block->setRefererUrl($this->_getRefererUrl());\n        }\n        $this->getLayout()->getBlock('head')->setTitle($this->__('My {{EntityLabel}} Comments'));\n        $this->renderLayout();\n    }\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{EntityLabel}} front contrller\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\nclass {{Namespace}}_{{Module}}_{{Entity}}Controller extends Mage_Core_Controller_Front_Action\n{\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/020_list",
    "content": "\n    /**\n      * default action\n      *\n      * @access public\n      * @return void\n      * {{qwertyuiop}}\n      */\n    public function indexAction()\n    {\n        $this->loadLayout();\n        $this->_initLayoutMessages('catalog/session');\n        $this->_initLayoutMessages('customer/session');\n        $this->_initLayoutMessages('checkout/session');\n        if (Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getUseBreadcrumbs()) {\n            if ($breadcrumbBlock = $this->getLayout()->getBlock('breadcrumbs')) {\n                $breadcrumbBlock->addCrumb(\n                    'home',\n                    array(\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('Home'),\n                        'link'  => Mage::getUrl(),\n                    )\n                );\n                $breadcrumbBlock->addCrumb(\n                    '{{entities}}',\n                    array(\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'),\n                        'link'  => '',\n                    )\n                );\n            }\n        }\n        $headBlock = $this->getLayout()->getBlock('head');\n        if ($headBlock) {\n            $headBlock->addLinkRel('canonical', Mage::helper('{{namespace}}_{{module}}/{{entity}}')->get{{Entities}}Url());\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/030_list_seo",
    "content": "        if ($headBlock) {\n            $headBlock->setTitle(Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/meta_title'));\n            $headBlock->setKeywords(Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/meta_keywords'));\n            $headBlock->setDescription(Mage::getStoreConfig('{{namespace}}_{{module}}/{{entity}}/meta_description'));\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/040_list_footer",
    "content": "        $this->renderLayout();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/050_view",
    "content": "\n    /**\n     * init {{EntityLabel}}\n     *\n     * @access protected\n     * @return {{Namespace}}_{{Module}}_Model_{{Entity}}\n     * {{qwertyuiop}}\n     */\n    protected function _init{{Entity}}()\n    {\n        ${{entity}}Id   = $this->getRequest()->getParam('id', 0);\n        ${{entity}}     = Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\n            ->setStoreId(Mage::app()->getStore()->getId())\n            ->load(${{entity}}Id);\n        if (!${{entity}}->getId()) {\n            return false;\n        } elseif (!${{entity}}->getStatus()) {\n            return false;\n        }\n        return ${{entity}};\n    }\n\n    /**\n     * view {{entityLabel}} action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function viewAction()\n    {\n        ${{entity}} = $this->_init{{Entity}}();\n        if (!${{entity}}) {\n            $this->_forward('no-route');\n            return;\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/060_view_tree",
    "content": "        if (!${{entity}}->getStatusPath()) {\n            $this->_forward('no-route');\n            return;\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/070_view2",
    "content": "        Mage::register('current_{{entity}}', ${{entity}});\n        $this->loadLayout();\n        $this->_initLayoutMessages('catalog/session');\n        $this->_initLayoutMessages('customer/session');\n        $this->_initLayoutMessages('checkout/session');\n        if ($root = $this->getLayout()->getBlock('root')) {\n            $root->addBodyClass('{{module}}-{{entity}} {{module}}-{{entity}}' . ${{entity}}->getId());\n        }\n        if (Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getUseBreadcrumbs()) {\n            if ($breadcrumbBlock = $this->getLayout()->getBlock('breadcrumbs')) {\n                $breadcrumbBlock->addCrumb(\n                    'home',\n                    array(\n                        'label'    => Mage::helper('{{namespace}}_{{module}}')->__('Home'),\n                        'link'     => Mage::getUrl(),\n                    )\n                );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/080_breadcrumbs",
    "content": "                $breadcrumbBlock->addCrumb(\n                    '{{entities}}',\n                    array(\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'),\n                        'link'  => Mage::helper('{{namespace}}_{{module}}/{{entity}}')->get{{Entities}}Url(),\n                    )\n                );\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/090_breadcrumbs_tree",
    "content": "                $breadcrumbBlock->addCrumb(\n                    '{{entities}}',\n                    array(\n                        'label' => Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}'),\n                        'link'  => Mage::helper('{{namespace}}_{{module}}/{{entity}}')->get{{Entities}}Url(),\n                    )\n                );\n                $parents = ${{entity}}->getParent{{Entities}}();\n                foreach ($parents as $parent) {\n                    if ($parent->getId() != Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRoot{{Entity}}Id() &&\n                        $parent->getId() != ${{entity}}->getId()) {\n                        $breadcrumbBlock->addCrumb(\n                            '{{entity}}-'.$parent->getId(),\n                            array(\n                                'label'    => $parent->get{{EntityNameMagicCode}}(),\n                                'link'    => $link = $parent->get{{Entity}}Url(),\n                            )\n                        );\n                    }\n                }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/100_breadcrumbs_footer",
    "content": "                $breadcrumbBlock->addCrumb(\n                    '{{entity}}',\n                    array(\n                        'label' => ${{entity}}->get{{EntityNameMagicCode}}(),\n                        'link'  => '',\n                    )\n                );\n            }\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/105_view_canonical",
    "content": "        $headBlock = $this->getLayout()->getBlock('head');\n        if ($headBlock) {\n            $headBlock->addLinkRel('canonical', ${{entity}}->get{{Entity}}Url());\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/110_view_seo",
    "content": "        if ($headBlock) {\n            if (${{entity}}->getMetaTitle()) {\n                $headBlock->setTitle(${{entity}}->getMetaTitle());\n            } else {\n                $headBlock->setTitle(${{entity}}->get{{EntityNameMagicCode}}());\n            }\n            $headBlock->setKeywords(${{entity}}->getMetaKeywords());\n            $headBlock->setDescription(${{entity}}->getMetaDescription());\n        }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/120_view_footer",
    "content": "        $this->renderLayout();\r\n    }\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/130_rss",
    "content": "\n    /**\n     * {{entitiesLabel}} rss list action\n     *\n     * @access public\n     * @return void\n     * {{qwertyuiop}}\n     */\n    public function rssAction()\n    {\n        if (Mage::helper('{{namespace}}_{{module}}/{{entity}}')->isRssEnabled()) {\n            $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8');\n            $this->loadLayout(false);\n            $this->renderLayout();\n        } else {\n            $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found');\n            $this->getResponse()->setHeader('Status', '404 File not found');\n            $this->_forward('nofeed', 'index', 'rss');\n        }\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/140_comment",
    "content": "\n    /**\n     * Submit new comment action\n     * @access public\n     * {{qwertyuiop}}\n     */\n    public function commentpostAction()\n    {\n        $data   = $this->getRequest()->getPost();\n        ${{entity}} = $this->_init{{Entity}}();\n        $session    = Mage::getSingleton('core/session');\n        if (${{entity}}) {\n            if (${{entity}}->getAllowComments()) {\n                if ((Mage::getSingleton('customer/session')->isLoggedIn() ||\n                    Mage::getStoreConfigFlag('{{namespace}}_{{module}}/{{entity}}/allow_guest_comment'))) {\n                    $comment  = Mage::getModel('{{namespace}}_{{module}}/{{entity}}_comment')->setData($data);\n                    $validate = $comment->validate();\n                    if ($validate === true) {\n                        try {\n                            $comment->set{{Entity}}Id(${{entity}}->getId())\n                                ->setStatus({{Namespace}}_{{Module}}_Model_{{Entity}}_Comment::STATUS_PENDING)\n                                ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n                                ->setStores(array(Mage::app()->getStore()->getId()))\n                                ->save();\n                            $session->addSuccess($this->__('Your comment has been accepted for moderation.'));\n                        } catch (Exception $e) {\n                            $session->set{{Entity}}CommentData($data);\n                            $session->addError($this->__('Unable to post the comment.'));\n                        }\n                    } else {\n                        $session->set{{Entity}}CommentData($data);\n                        if (is_array($validate)) {\n                            foreach ($validate as $errorMessage) {\n                                $session->addError($errorMessage);\n                            }\n                        } else {\n                            $session->addError($this->__('Unable to post the comment.'));\n                        }\n                    }\n                } else {\n                    $session->addError($this->__('Guest comments are not allowed'));\n                }\n            } else {\n                $session->addError($this->__('This {{entityLabel}} does not allow comments'));\n            }\n        }\n        $this->_redirectReferer();\n    }\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/controllers/EntityController/150_footer",
    "content": "}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/data/namespace_module_setup/data-install/010_top",
    "content": "<?php\n{{License}}\n /*\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/data/namespace_module_setup/data-install/020_entity",
    "content": "Mage::getModel('{{namespace}}_{{module}}/{{entity}}')\r\n    ->load(1)\r\n    ->setParentId(0)\r\n    ->setPath(1)\r\n    ->setLevel(0)\r\n    ->setPosition(0)\r\n    ->setChildrenCount(0)\r\n    ->set{{EntityNameMagicCode}}('ROOT')\r\n    ->setInitialSetupFlag(true){{EntityAttributeSetId}}\r\n    ->save();\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/adminhtml/010_content",
    "content": "<?xml version=\"1.0\"?>\r\n{{License}}\r\n<config>\r\n    <acl>\r\n        <resources>\r\n            <admin>\r\n                <children>\r\n                    <system>\r\n                        <children>\r\n                            <config>\r\n                                <children>\r\n                                    <{{namespace}}_{{module}} translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                                        <title>{{Module}}</title>\r\n                                    </{{namespace}}_{{module}}>\r\n                                </children>\r\n                            </config>\r\n                        </children>\r\n                    </system>\r\n{{menuAcl}}\r\n                </children>\r\n            </admin>\r\n        </resources>\r\n    </acl>\r\n    <menu>\r\n{{menuItemsXml}}\r\n    </menu>\r\n</config>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/010_top",
    "content": "<?xml version=\"1.0\"?>\r\n{{License}}\r\n<config>\r\n    <api>\r\n        <resources>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/020_entity_api",
    "content": "            <{{module}}_{{entity}} translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                <title>{{EntityLabel}} API</title>\r\n                <model>{{namespace}}_{{module}}/{{entity}}_api</model>\r\n                <acl>{{module}}/{{entity}}</acl>\r\n                <methods>\r\n                    <list translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                        <title>Retrieve list of {{entitiesLabel}}</title>\r\n                        <method>items</method>\r\n                        <acl>{{module}}/{{entity}}/list</acl>\r\n                    </list>\r\n                    <info translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                        <title>Retrieve {{entityLabel}} info</title>\r\n                        <acl>{{module}}/{{entity}}/info</acl>\r\n                    </info>\r\n                    <add translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                        <title>Add {{entityLabel}}</title>\r\n                        <acl>{{module}}/{{entity}}/add</acl>\r\n                    </add>\r\n                    <update translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                        <title>Update {{entityLabel}}</title>\r\n                        <acl>{{module}}/{{entity}}/update</acl>\r\n                    </update>\r\n                    <remove translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                        <title>Remove {{entityLabel}}</title>\r\n                        <acl>{{module}}/{{entity}}/remove</acl>\r\n                    </remove>\r\n{{entityApiAdditional}}</methods>\r\n                <faults module=\"{{namespace}}_{{module}}\">\r\n                    <{{entity}}_not_exists>\r\n                        <code>101</code>\r\n                        <message>Requested {{entityLabel}} does not exist.</message>\r\n                    </{{entity}}_not_exists>\r\n                    <invalid_data>\r\n                        <code>102</code>\r\n                        <message>Provided data is invalid.</message>\r\n                    </invalid_data>\r\n                    <save_error>\r\n                        <code>103</code>\r\n                        <message>Error while saving {{entityLabel}}. Details in error message.</message>\r\n                    </save_error>\r\n                    <remove_error>\r\n                        <code>104</code>\r\n                        <message>Error while removing {{entityLabel}}. Details in error message.</message>\r\n                    </remove_error>\r\n{{entityApiFaults}}</faults>\r\n            </{{module}}_{{entity}}>{{entityApiAdditionalSettings}}\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/030_resource_alias",
    "content": "        </resources>\r\n        <resources_alias>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/040_entity_resource_alias",
    "content": "            <{{entity}}>{{module}}_{{entity}}</{{entity}}>{{entityApiResourcesAlias}}\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/050_v2",
    "content": "        </resources_alias>\r\n        <v2>\r\n            <resources_function_prefix>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/060_v2_entity",
    "content": "                <{{entity}}>{{module}}{{Entity}}</{{entity}}>{{entityApiResourcesAliasV2}}\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/070_acl",
    "content": "            </resources_function_prefix>\r\n        </v2>\r\n        <acl>\r\n            <resources>\r\n                <{{namespace}}_{{module}} translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                    <title>{{Module}}</title>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/080_acl_entity",
    "content": "                    <{{entity}} translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                        <title>{{EntityLabel}}</title>\r\n                        <sort_order>{{position}}</sort_order>\r\n                        <list translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                            <title>List</title>\r\n                        </list>\r\n                        <info translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                            <title>Info</title>\r\n                        </info>\r\n                        <add translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                            <title>Add</title>\r\n                        </add>\r\n                        <update translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                            <title>Update</title>\r\n                        </update>\r\n                        <remove translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                            <title>Remove</title>\r\n                        </remove>\r\n{{entityAdditionalApiAcl}}</{{entity}}>{{subEntitiesAcl}}\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api/090_footer",
    "content": "                </{{namespace}}_{{module}}>\r\n            </resources>\r\n        </acl>\r\n    </api>\r\n</config>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/api2/010_content",
    "content": "<?xml version=\"1.0\"?>\r\n{{License}}\r\n<config>\r\n    <api2>\r\n        <resource_groups>\r\n            <{{namespace}}_{{module}} translate=\"title\" module=\"{{namespace}}_{{module}}\">\r\n                <title>{{Module}}</title>\r\n                <sort_order>120</sort_order>\r\n                <children>\r\n{{RestResourceGroupsChildren}}\r\n                </children>\r\n            </{{namespace}}_{{module}}>\r\n        </resource_groups>\r\n        <resources>\r\n{{RestResources}}\r\n        </resources>\r\n    </api2>\r\n</config>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/010_top",
    "content": "<?xml version=\"1.0\"?>\r\n{{License}}\r\n<config>\r\n    <modules>\r\n        <{{Namespace}}_{{Module}}>\r\n            <version>{{version}}</version>\r\n        </{{Namespace}}_{{Module}}>\r\n    </modules>\r\n    <global>\r\n        <resources>\r\n            <{{namespace}}_{{module}}_setup>\r\n                <setup>\r\n                    <module>{{Namespace}}_{{Module}}</module>\r\n                    <class>{{Namespace}}_{{Module}}_Model_Resource_Setup</class>\r\n                </setup>\r\n            </{{namespace}}_{{module}}_setup>\r\n        </resources>\r\n        <blocks>\r\n            <{{namespace}}_{{module}}>\r\n                <class>{{Namespace}}_{{Module}}_Block</class>\r\n            </{{namespace}}_{{module}}>\r\n        </blocks>\r\n        <helpers>\r\n            <{{namespace}}_{{module}}>\r\n                <class>{{Namespace}}_{{Module}}_Helper</class>\r\n            </{{namespace}}_{{module}}>\r\n        </helpers>\r\n        <models>\r\n            <{{namespace}}_{{module}}>\r\n                <class>{{Namespace}}_{{Module}}_Model</class>\r\n                <resourceModel>{{namespace}}_{{module}}_resource</resourceModel>\r\n            </{{namespace}}_{{module}}>\r\n            <{{namespace}}_{{module}}_resource>\r\n                <class>{{Namespace}}_{{Module}}_Model_Resource</class>\r\n                <entities>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/020_tables",
    "content": "                    <{{entity}}>\r\n                        <table>{{namespace}}_{{module}}_{{entity}}</table>\r\n                    </{{entity}}>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/030_store_tables",
    "content": "                    <{{entity}}_store>\r\n                        <table>{{namespace}}_{{module}}_{{entity}}_store</table>\r\n                    </{{entity}}_store>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/040_siblings_table",
    "content": "                    <{{entity}}_{{sibling}}>\r\n                        <table>{{namespace}}_{{module}}_{{entity}}_{{sibling}}</table>\r\n                    </{{entity}}_{{sibling}}>\r\n                    <{{sibling}}_{{entity}}>\r\n                        <table>{{namespace}}_{{module}}_{{entity}}_{{sibling}}</table>\r\n                    </{{sibling}}_{{entity}}>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/050_product_relation_table",
    "content": "                    <{{entity}}_product>\r\n                        <table>{{namespace}}_{{module}}_{{entity}}_product</table>\r\n                    </{{entity}}_product>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/060_category_relation_table",
    "content": "                    <{{entity}}_category>\r\n                        <table>{{namespace}}_{{module}}_{{entity}}_category</table>\r\n                    </{{entity}}_category>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/070_comment_table",
    "content": "                    <{{entity}}_comment>\r\n                        <table>{{namespace}}_{{module}}_{{entity}}_comment</table>\r\n                    </{{entity}}_comment>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/080_comment_store_table",
    "content": "                    <{{entity}}_comment_store>\r\n                        <table>{{namespace}}_{{module}}_{{entity}}_comment_store</table>\r\n                    </{{entity}}_comment_store>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/090_eav_attribute",
    "content": "                    <eav_attribute>\r\n                        <table>{{namespace}}_{{module}}_eav_attribute</table>\r\n                    </eav_attribute>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/100_global",
    "content": "                </entities>\r\n            </{{namespace}}_{{module}}_resource>\r\n        </models>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/110_url_rewrite",
    "content": "        <events>\r\n            <controller_front_init_routers>\r\n                <observers>\r\n                    <{{namespace}}_{{module}}>\r\n                        <class>{{Namespace}}_{{Module}}_Controller_Router</class>\r\n                        <method>initControllerRouters</method>\r\n                    </{{namespace}}_{{module}}>\r\n                </observers>\r\n            </controller_front_init_routers>\r\n        </events>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/120_adminhtml",
    "content": "    </global>\r\n    <adminhtml>\r\n        <layout>\r\n            <updates>\r\n                <{{namespace}}_{{module}}>\r\n                    <file>{{namespace}}_{{module}}.xml</file>\r\n                </{{namespace}}_{{module}}>\r\n            </updates>\r\n        </layout>\r\n        <translate>\r\n            <modules>\r\n                <{{Namespace}}_{{Module}}>\r\n                    <files>\r\n                        <default>{{Namespace}}_{{Module}}.csv</default>\r\n                    </files>\r\n                </{{Namespace}}_{{Module}}>\r\n            </modules>\r\n        </translate>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/130_relation_events_top",
    "content": "        <events>\r\n            <core_block_abstract_prepare_layout_after>\r\n                <observers>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/140_relation_product_top",
    "content": "                    <{{namespace}}_{{module}}_{{entity}}_product>\r\n                        <type>singleton</type>\r\n                        <class>{{namespace}}_{{module}}/adminhtml_observer</class>\r\n                        <method>addProduct{{Entity}}Block</method>\r\n                    </{{namespace}}_{{module}}_{{entity}}_product>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/150_relation_events_middle",
    "content": "                </observers>\r\n            </core_block_abstract_prepare_layout_after>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/160_relation_category_top",
    "content": "            <adminhtml_catalog_category_tabs>\r\n                <observers>\r\n                    <{{namespace}}_{{module}}_{{entity}}_category>\r\n                        <type>singleton</type>\r\n                        <class>{{namespace}}_{{module}}/adminhtml_observer</class>\r\n                        <method>addCategory{{Entity}}Block</method>\r\n                    </{{namespace}}_{{module}}_{{entity}}_category>\r\n                </observers>\r\n            </adminhtml_catalog_category_tabs>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/170_relation_product_bottom_start",
    "content": "            <catalog_product_save_after>\r\n                <observers>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/180_relation_product_bottom",
    "content": "                    <{{namespace}}_{{module}}_{{entity}}_product>\r\n                        <type>singleton</type>\r\n                        <class>{{namespace}}_{{module}}/adminhtml_observer</class>\r\n                        <method>saveProduct{{Entity}}Data</method>\r\n                    </{{namespace}}_{{module}}_{{entity}}_product>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/190_relation_product_bottom_end",
    "content": "                </observers>\r\n            </catalog_product_save_after>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/200_relation_category_bottom_start",
    "content": "            <catalog_category_save_after>\r\n                <observers>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/210_relation_category_bottom",
    "content": "                    <{{namespace}}_{{module}}_{{entity}}_category>\r\n                        <type>singleton</type>\r\n                        <class>{{namespace}}_{{module}}/adminhtml_observer</class>\r\n                        <method>saveCategory{{Entity}}Data</method>\r\n                    </{{namespace}}_{{module}}_{{entity}}_category>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/220_relation_category_bottom_end",
    "content": "                </observers>\r\n            </catalog_category_save_after>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/230_relation_events_bottom",
    "content": "        </events>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/240_global_search_top",
    "content": "        <global_search>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/250_global_search_entity",
    "content": "            <{{entity}}>\r\n                <class>{{namespace}}_{{module}}/adminhtml_search_{{entity}}</class>\r\n                <acl>{{namespace}}_{{module}}</acl>\r\n            </{{entity}}>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/260_global_search_footer",
    "content": "        </global_search>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/270_admin",
    "content": "    </adminhtml>\r\n    <admin>\r\n        <routers>\r\n            <adminhtml>\r\n                <args>\r\n                    <modules>\r\n                        <{{Namespace}}_{{Module}} before=\"Mage_Adminhtml\">{{Namespace}}_{{Module}}_Adminhtml</{{Namespace}}_{{Module}}>\r\n                    </modules>\r\n                </args>\r\n            </adminhtml>\r\n        </routers>\r\n    </admin>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/280_frontend",
    "content": "    <frontend>{{categoryMenuEvent}}\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/284_router",
    "content": "        <routers>\r\n            <{{namespace}}_{{module}}>\r\n                <use>standard</use>\r\n                <args>\r\n                    <module>{{Namespace}}_{{Module}}</module>\r\n                    <frontName>{{frontKey}}</frontName>\r\n                </args>\r\n            </{{namespace}}_{{module}}>\r\n        </routers>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/287_frontend_footer",
    "content": "        <layout>\r\n            <updates>\r\n                <{{namespace}}_{{module}}>\r\n                    <file>{{namespace}}_{{module}}.xml</file>\r\n                </{{namespace}}_{{module}}>\r\n            </updates>\r\n        </layout>\r\n        <translate>\r\n            <modules>\r\n                <{{Namespace}}_{{Module}}>\r\n                    <files>\r\n                        <default>{{Namespace}}_{{Module}}.csv</default>\r\n                    </files>\r\n                </{{Namespace}}_{{Module}}>\r\n            </modules>\r\n        </translate>\r\n    </frontend>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/290_default_top",
    "content": "    <default>\r\n        <{{namespace}}_{{module}}>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/300_default",
    "content": "            {{entity_default_config}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/310_default_footer",
    "content": "        </{{namespace}}_{{module}}>\r\n    </default>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/config/320_footer",
    "content": "</config>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/system/010_top",
    "content": "<?xml version=\"1.0\"?>\r\n{{License}} \r\n<config>\r\n    <tabs>\r\n        <{{namespace}} translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n            <label>{{SystemTabName}}</label>\r\n            <sort_order>{{systemTabPosition}}</sort_order>\r\n        </{{namespace}}>\r\n    </tabs>\r\n    <sections>\r\n        <{{namespace}}_{{module}} translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n            <class>separator-top</class>\r\n            <label>{{module_menu}}</label>\r\n            <tab>{{namespace}}</tab>\r\n            <frontend_type>text</frontend_type>\r\n            <sort_order>100</sort_order>\r\n            <show_in_default>1</show_in_default>\r\n            <show_in_website>1</show_in_website>\r\n            <show_in_store>1</show_in_store>\r\n            <groups>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/system/020_entity",
    "content": "                <{{entity}} translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n                    <label>{{EntityLabel}}</label>\r\n                    <frontend_type>text</frontend_type>\r\n                    <sort_order>{{position}}</sort_order>\r\n                    <show_in_default>1</show_in_default>\r\n                    <show_in_website>1</show_in_website>\r\n                    <show_in_store>1</show_in_store>\r\n                    <fields>\r\n{{systemAttributes}}\r\n                    </fields>\r\n                </{{entity}}>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/system/030_footer",
    "content": "            </groups>\r\n        </{{namespace}}_{{module}}>\r\n    </sections>\r\n</config>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/widget/010_top",
    "content": "<?xml version=\"1.0\"?>\r\n{{License}}\r\n<widgets>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/widget/020_entity",
    "content": "    <{{module}}_{{entity}}_view type=\"{{namespace}}_{{module}}/{{entity}}_widget_view\" translate=\"name description\" module=\"{{namespace}}_{{module}}\">\r\n        <name>{{EntityLabel}} view</name>\r\n        <description>{{EntityLabel}} view widget</description>\r\n        <is_email_compatible>0</is_email_compatible>\r\n        <parameters>\r\n            <{{entity}}_id type=\"complex\" translate=\"label\">\r\n                <visible>1</visible>\r\n                <required>1</required>\r\n                <label>{{EntityLabel}}</label>\r\n                <type>label</type>\r\n                <helper_block>\r\n                    <type>{{namespace}}_{{module}}/adminhtml_{{entity}}_widget_chooser</type>\r\n                    <data>\r\n                        <button translate=\"open\">\r\n                            <open>Select {{EntityLabel}}</open>\r\n                        </button>\r\n                    </data>\r\n                </helper_block>\r\n                <sort_order>120</sort_order>\r\n            </{{entity}}_id>\r\n        </parameters>\r\n    </{{module}}_{{entity}}_view>\r\n    <{{module}}_{{entity}}_link type=\"{{namespace}}_{{module}}/{{entity}}_widget_link\" translate=\"name description\" module=\"{{namespace}}_{{module}}\">\r\n        <name>{{EntityLabel}} link</name>\r\n        <description>{{EntityLabel}} link widget</description>\r\n        <is_email_compatible>0</is_email_compatible>\r\n        <parameters>\r\n            <{{entity}}_id type=\"complex\" translate=\"label\">\r\n                <visible>1</visible>\r\n                <required>1</required>\r\n                <label>{{EntityLabel}}</label>\r\n                <type>label</type>\r\n                <helper_block>\r\n                    <type>{{namespace}}_{{module}}/adminhtml_{{entity}}_widget_chooser</type>\r\n                    <data>\r\n                        <button translate=\"open\">\r\n                            <open>Select {{EntityLabel}}</open>\r\n                        </button>\r\n                    </data>\r\n                </helper_block>\r\n                <sort_order>130</sort_order>\r\n            </{{entity}}_id>\r\n        </parameters>\r\n    </{{module}}_{{entity}}_link>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/widget/030_tree",
    "content": "    <{{module}}_{{entity}}_subtree type=\"{{namespace}}_{{module}}/{{entity}}_widget_subtree\" translate=\"name description\" module=\"{{namespace}}_{{module}}\">\r\n        <name>{{EntityLabel}} subtree</name>\r\n        <description>{{EntityLabel}} subtree widget</description>\r\n        <is_email_compatible>0</is_email_compatible>\r\n        <parameters>\r\n            <{{entity}}_id type=\"complex\" translate=\"label\">\r\n                <visible>1</visible>\r\n                <required>1</required>\r\n                <label>{{EntityLabel}}</label>\r\n                <type>label</type>\r\n                <helper_block>\r\n                    <type>{{namespace}}_{{module}}/adminhtml_{{entity}}_widget_chooser</type>\r\n                    <data>\r\n                        <button translate=\"open\">\r\n                            <open>Select {{EntityLabel}}</open>\r\n                        </button>\r\n                    </data>\r\n                </helper_block>\r\n                <sort_order>10</sort_order>\r\n            </{{entity}}_id>\r\n            <recursion type=\"complex\" translate=\"label\">\r\n                <visible>1</visible>\r\n                <required>1</required>\r\n                <value>0</value>\r\n                <label>Levels to show (0 for all)</label>\r\n                <type>text</type>\r\n                <sort_order>20</sort_order>\r\n            </recursion>\r\n        </parameters>\r\n    </{{module}}_{{entity}}_subtree>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/widget/040_footer",
    "content": "</widgets>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/010_top",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<definitions xmlns:typens=\"urn:{{var wsdl.name}}\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"\r\n    xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns=\"http://schemas.xmlsoap.org/wsdl/\"\r\n    name=\"{{var wsdl.name}}\" targetNamespace=\"urn:{{var wsdl.name}}\">\r\n    <types>\r\n        <schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"urn:Magento\">\r\n            <import namespace=\"http://schemas.xmlsoap.org/soap/encoding/\" schemaLocation=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/020_entity_types",
    "content": "            <complexType name=\"{{module}}{{Entity}}ListEntity\">\r\n                <all>\r\n                    <element name=\"entity_id\" type=\"xsd:string\" minOccurs=\"1\" />\r\n{{entityWsdlAttributes}}\r\n                    <element name=\"created_at\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"updated_at\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}ListEntityArray\">\r\n                <complexContent>\r\n                    <restriction base=\"soapenc:Array\">\r\n                        <attribute ref=\"soapenc:arrayType\" wsdl:arrayType=\"typens:{{module}}{{Entity}}ListEntity[]\" />\r\n                    </restriction>\r\n                </complexContent>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AddEntity\">\r\n                <all>\r\n{{entityWsdlAttributesForAdd}}\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}UpdateEntity\">\r\n                <all>\r\n{{entityWsdlAttributesForAdd}}\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}InfoEntity\">\r\n                <all>\r\n                    <element name=\"entity_id\" type=\"xsd:string\" minOccurs=\"1\" />\r\n{{entityWsdlAttributes}}\r\n                    <element name=\"created_at\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"updated_at\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                </all>\r\n            </complexType>\r\n{{entityWsdlRelationTypes}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/023_entity_comment_types",
    "content": "            <complexType name=\"{{module}}{{Entity}}CommentListEntity\">\r\n                <all>\r\n                    <element name=\"comment_id\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"{{entity}}_id\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"title\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"comment\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"status\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"customer_id\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"name\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"email\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"created_at\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                    <element name=\"updated_at\" type=\"xsd:string\" minOccurs=\"1\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}CommentListEntityArray\">\r\n                <complexContent>\r\n                    <restriction base=\"soapenc:Array\">\r\n                        <attribute ref=\"soapenc:arrayType\" wsdl:arrayType=\"typens:{{module}}{{Entity}}CommentListEntity[]\" />\r\n                    </restriction>\r\n                </complexContent>\r\n            </complexType>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/026_entity_attribute_types",
    "content": "            <complexType name=\"{{module}}{{Entity}}AdditionalAttributesEntity\">\r\n                <all>\r\n                    <element name=\"multi_data\" type=\"typens:associativeMultiArray\" minOccurs=\"0\" />\r\n                    <element name=\"single_data\" type=\"typens:associativeArray\" minOccurs=\"0\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeOptionEntity\">\r\n                <all>\r\n                    <element name=\"label\" type=\"xsd:string\"/>\r\n                    <element name=\"value\" type=\"xsd:string\"/>\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeOptionEntityArray\">\r\n                <complexContent>\r\n                    <restriction base=\"soapenc:Array\">\r\n                        <attribute ref=\"soapenc:arrayType\" wsdl:arrayType=\"typens:{{module}}{{Entity}}AttributeOptionEntity[]\"/>\r\n                    </restriction>\r\n                </complexContent>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeOptionLabelEntity\">\r\n                <all>\r\n                    <element name=\"store_id\" type=\"typens:ArrayOfString\" />\r\n                    <element name=\"value\" type=\"xsd:string\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeOptionLabelArray\">\r\n                <complexContent>\r\n                    <restriction base=\"soapenc:Array\">\r\n                        <attribute ref=\"soapenc:arrayType\" wsdl:arrayType=\"typens:{{module}}{{Entity}}AttributeOptionLabelEntity[]\"/>\r\n                    </restriction>\r\n                </complexContent>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}RequestAttributes\">\r\n                <all>\r\n                    <element name=\"attributes\" type=\"typens:ArrayOfString\" minOccurs=\"0\"/>\r\n                    <element name=\"additional_attributes\" type=\"typens:ArrayOfString\" minOccurs=\"0\"/>\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeFrontendLabelEntity\">\r\n                <all>\r\n                    <element name=\"store_id\" type=\"xsd:string\" />\r\n                    <element name=\"label\" type=\"xsd:string\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeFrontendLabelArray\">\r\n                <complexContent>\r\n                    <restriction base=\"soapenc:Array\">\r\n                        <attribute ref=\"soapenc:arrayType\" wsdl:arrayType=\"typens:{{module}}{{Entity}}AttributeFrontendLabelEntity[]\"/>\r\n                    </restriction>\r\n                </complexContent>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeEntityToCreate\">\r\n                <all>\r\n                    <element name=\"attribute_code\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <element name=\"frontend_input\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <element name=\"scope\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <element name=\"default_value\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <element name=\"is_required\" type=\"xsd:int\" minOccurs=\"0\" />\r\n                    <element name=\"additional_fields\" type=\"typens:associativeArray\" minOccurs=\"0\"/>\r\n                    <element name=\"frontend_label\" type=\"typens:{{module}}{{Entity}}AttributeFrontendLabelArray\" minOccurs=\"1\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeEntityToUpdate\">\r\n                <all>\r\n                    <element name=\"scope\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <element name=\"default_value\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <element name=\"is_required\" type=\"xsd:int\" minOccurs=\"0\" />\r\n                    <element name=\"additional_fields\" type=\"typens:associativeArray\" minOccurs=\"0\"/>\r\n                    <element name=\"frontend_label\" type=\"typens:{{module}}{{Entity}}AttributeFrontendLabelArray\" minOccurs=\"1\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeEntity\">\r\n                <all>\r\n                    <element name=\"attribute_id\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <element name=\"attribute_code\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <element name=\"frontend_input\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <element name=\"scope\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <element name=\"default_value\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <element name=\"is_required\" type=\"xsd:int\" minOccurs=\"0\" />\r\n                    <element name=\"additional_fields\" type=\"typens:associativeArray\" minOccurs=\"0\"/>\r\n                    <element name=\"options\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntityArray\" minOccurs=\"0\"/>\r\n                    <element name=\"frontend_label\" type=\"typens:{{module}}{{Entity}}AttributeFrontendLabelArray\" minOccurs=\"1\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeOptionLabelEntity\">\r\n                <all>\r\n                    <element name=\"store_id\" type=\"typens:ArrayOfString\" />\r\n                    <element name=\"value\" type=\"xsd:string\" />\r\n                </all>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeOptionLabelArray\">\r\n                <complexContent>\r\n                    <restriction base=\"soapenc:Array\">\r\n                        <attribute ref=\"soapenc:arrayType\" wsdl:arrayType=\"typens:{{module}}{{Entity}}AttributeOptionLabelEntity[]\"/>\r\n                    </restriction>\r\n                </complexContent>\r\n            </complexType>\r\n            <complexType name=\"{{module}}{{Entity}}AttributeOptionEntityToAdd\">\r\n                <all>\r\n                    <element name=\"label\" type=\"typens:{{module}}{{Entity}}AttributeOptionLabelArray\" />\r\n                    <element name=\"order\" type=\"xsd:int\" />\r\n                    <element name=\"is_default\" type=\"xsd:int\" />\r\n                </all>\r\n            </complexType>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/030_schema_footer",
    "content": "        </schema>\r\n    </types>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/040_entity_messages",
    "content": "    <message name=\"{{module}}{{Entity}}ListRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\" />\r\n        <part name=\"filters\" type=\"typens:filters\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}ListResponse\">\r\n        <part name=\"result\" type=\"typens:{{module}}{{Entity}}ListEntityArray\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}InfoRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\" />\r\n        <part name=\"{{entity}}Id\" type=\"xsd:string\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}InfoResponse\">\r\n        <part name=\"result\" type=\"typens:{{module}}{{Entity}}InfoEntity\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AddRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\" />\r\n        <part name=\"data\" type=\"typens:{{module}}{{Entity}}AddEntity\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AddResponse\">\r\n        <part name=\"result\" type=\"xsd:int\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}UpdateRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\" />\r\n        <part name=\"{{entity}}Id\" type=\"xsd:string\" />\r\n        <part name=\"data\" type=\"typens:{{module}}{{Entity}}UpdateEntity\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}UpdateResponse\">\r\n        <part name=\"result\" type=\"xsd:boolean\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}RemoveRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\" />\r\n        <part name=\"{{entity}}Id\" type=\"xsd:string\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}RemoveResponse\">\r\n        <part name=\"result\" type=\"xsd:boolean\" />\r\n    </message>\r\n{{entityWsdlMessages}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/043_entity_comment_messages",
    "content": "    <message name=\"{{module}}{{Entity}}CommentListRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\" />\r\n        <part name=\"filters\" type=\"typens:filters\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}CommentListResponse\">\r\n        <part name=\"result\" type=\"typens:{{module}}{{Entity}}CommentListEntityArray\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}CommentUpdateStatusRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\" />\r\n        <part name=\"commentId\" type=\"xsd:string\" />\r\n        <part name=\"status\" type=\"xsd:string\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}CommentUpdateStatusResponse\">\r\n        <part name=\"result\" type=\"xsd:int\" />\r\n    </message>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/046_entity_attribute_messages",
    "content": "    <message name=\"{{module}}{{Entity}}ListOfAdditionalAttributesRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}ListOfAdditionalAttributesResponse\">\r\n        <part name=\"result\" type=\"typens:{{module}}{{Entity}}AttributeEntityArray\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeCurrentStoreRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n        <part name=\"storeView\" type=\"xsd:string\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeCurrentStoreResponse\">\r\n        <part name=\"storeView\" type=\"xsd:int\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeListRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeListResponse\">\r\n        <part name=\"result\" type=\"typens:{{module}}{{Entity}}AttributeEntityArray\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeOptionsRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n        <part name=\"attributeId\" type=\"xsd:string\"/>\r\n        <part name=\"storeView\" type=\"xsd:string\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeOptionsResponse\">\r\n        <part name=\"result\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntityArray\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeTypesRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeTypesResponse\">\r\n        <part name=\"result\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntityArray\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeCreateRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n        <part name=\"data\" type=\"typens:{{module}}{{Entity}}AttributeEntityToCreate\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeCreateResponse\">\r\n        <part name=\"result\" type=\"xsd:int\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeRemoveRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n        <part name=\"attribute\" type=\"xsd:string\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeRemoveResponse\">\r\n        <part name=\"result\" type=\"xsd:boolean\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeInfoRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n        <part name=\"attribute\" type=\"xsd:string\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeInfoResponse\">\r\n        <part name=\"result\" type=\"typens:{{module}}{{Entity}}AttributeEntity\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeUpdateRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n        <part name=\"attribute\" type=\"xsd:string\"/>\r\n        <part name=\"data\" type=\"typens:{{module}}{{Entity}}AttributeEntityToUpdate\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeUpdateResponse\">\r\n        <part name=\"result\" type=\"xsd:boolean\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeAddOptionRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n        <part name=\"attribute\" type=\"xsd:string\"/>\r\n        <part name=\"data\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntityToAdd\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeAddOptionResponse\">\r\n        <part name=\"result\" type=\"xsd:boolean\" />\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeRemoveOptionRequest\">\r\n        <part name=\"sessionId\" type=\"xsd:string\"/>\r\n        <part name=\"attribute\" type=\"xsd:string\"/>\r\n        <part name=\"optionId\" type=\"xsd:string\"/>\r\n    </message>\r\n    <message name=\"{{module}}{{Entity}}AttributeRemoveOptionResponse\">\r\n        <part name=\"result\" type=\"xsd:boolean\" />\r\n    </message>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/050_porttype_top",
    "content": "    <portType name=\"{{var wsdl.handler}}PortType\">\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/060_porttype_entity",
    "content": "        <operation name=\"{{module}}{{Entity}}List\">\r\n            <documentation>Retrieve list of {{entityLabel}}</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}ListRequest\" />\r\n            <output message=\"typens:{{module}}{{Entity}}ListResponse\" />\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}Info\">\r\n            <documentation>Retrieve {{entityLabel}} info</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}InfoRequest\" />\r\n            <output message=\"typens:{{module}}{{Entity}}InfoResponse\" />\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}Add\">\r\n            <documentation>Add {{entityLabel}}</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AddRequest\" />\r\n            <output message=\"typens:{{module}}{{Entity}}AddResponse\" />\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}Update\">\r\n            <documentation>Update {{entityLabel}}</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}UpdateRequest\" />\r\n            <output message=\"typens:{{module}}{{Entity}}UpdateResponse\" />\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}Remove\">\r\n            <documentation>Remove {{entityLabel}}</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}RemoveRequest\" />\r\n            <output message=\"typens:{{module}}{{Entity}}RemoveResponse\" />\r\n        </operation>\r\n{{entityWsdlPortTypeRelation}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/063_porttype_entity_comment",
    "content": "        <operation name=\"{{module}}{{Entity}}CommentList\">\r\n            <documentation>Retrieve list of {{entityLabel}} comments</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}CommentListRequest\" />\r\n            <output message=\"typens:{{module}}{{Entity}}CommentListResponse\" />\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}CommentUpdateStatus\">\r\n            <documentation>Change {{entityLabel}} comment status</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}CommentUpdateStatusRequest\" />\r\n            <output message=\"typens:{{module}}{{Entity}}CommentUpdateStatusResponse\" />\r\n        </operation>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/066_porttype_entity_attribute",
    "content": "        <operation name=\"{{module}}{{Entity}}ListOfAdditionalAttributes\">\r\n            <documentation>Get list of additional attributes which are not in default create/update list</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeCurrentStore\">\r\n            <documentation>Set/Get current store view</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeCurrentStoreRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeCurrentStoreResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}ListOfAdditionalAttributes\">\r\n            <documentation>Get list of additional attributes which are not in default create/update list</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeList\">\r\n            <documentation>Retrieve {{entityLabel}} attribute list</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeListRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeListResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeOptions\">\r\n            <documentation>Retrieve {{entityLabel}} attribute options</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeOptionsRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeOptionsResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeTypes\">\r\n            <documentation>Get list of possible {{entityLabel}} attribute types</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeTypesRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeTypesResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeCreate\">\r\n            <documentation>Create new {{entityLabel}} attribute</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeCreateRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeCreateResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeRemove\">\r\n            <documentation>Delete {{entityLabel}} attribute</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeRemoveRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeRemoveResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeInfo\">\r\n            <documentation>Get full information about {{entityLabel}} attribute with list of options</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeInfoRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeInfoResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeUpdate\">\r\n            <documentation>Update {{entityLabel}} attribute</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeUpdateRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeUpdateResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeAddOption\">\r\n            <documentation>Add option to {{entityLabel}} attribute</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeAddOptionRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeAddOptionResponse\"/>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeRemoveOption\">\r\n            <documentation>Remove option from {{entityLabel}} attribute</documentation>\r\n            <input message=\"typens:{{module}}{{Entity}}AttributeRemoveOptionRequest\"/>\r\n            <output message=\"typens:{{module}}{{Entity}}AttributeRemoveOptionResponse\"/>\r\n        </operation>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/070_porttype_footer",
    "content": "    </portType>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/080_binding_top",
    "content": "    <binding name=\"{{var wsdl.handler}}Binding\" type=\"typens:{{var wsdl.handler}}PortType\">\r\n        <soap:binding style=\"rpc\" transport=\"http://schemas.xmlsoap.org/soap/http\" />\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/090_entity_binding",
    "content": "        <operation name=\"{{module}}{{Entity}}List\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}Info\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}Add\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}Update\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}Remove\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n{{entityWsdlRelationBinding}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/093_entity_binding_comment",
    "content": "        <operation name=\"{{module}}{{Entity}}CommentList\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}CommentUpdateStatus\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/096_entity_binding_attribute",
    "content": "        <operation name=\"{{module}}{{Entity}}ListOfAdditionalAttributes\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\"/>\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"/>\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"/>\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeCurrentStore\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeList\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeOptions\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeTypes\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeCreate\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeUpdate\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeRemove\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeInfo\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeAddOption\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n        <operation name=\"{{module}}{{Entity}}AttributeRemoveOption\">\r\n            <soap:operation soapAction=\"urn:{{var wsdl.handler}}Action\" />\r\n            <input>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </input>\r\n            <output>\r\n                <soap:body namespace=\"urn:{{var wsdl.name}}\" use=\"encoded\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\r\n            </output>\r\n        </operation>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsdl/100_footer",
    "content": "    </binding>\r\n    <service name=\"{{var wsdl.name}}Service\">\r\n        <port name=\"{{var wsdl.handler}}Port\" binding=\"typens:{{var wsdl.handler}}Binding\">\r\n            <soap:address location=\"{{var wsdl.url}}\" />\r\n        </port>\r\n    </service>\r\n</definitions>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/010_top",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<wsdl:definitions xmlns:typens=\"urn:{{var wsdl.name}}\"\r\n     xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n     xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"\r\n     xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\r\n     xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\"\r\n     name=\"{{var wsdl.name}}\"\r\n     targetNamespace=\"urn:{{var wsdl.name}}\">\r\n    <wsdl:types>\r\n        <xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"urn:{{var wsdl.name}}\">\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/020_entity_types",
    "content": "            <xsd:complexType name=\"{{module}}{{Entity}}EntityArray\">\r\n                <xsd:sequence>\r\n                    <xsd:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"complexObjectArray\" type=\"typens:{{module}}{{Entity}}Entity\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}Entity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"entity_id\" type=\"xsd:string\" />\r\n{{entityWsiAttributes}}\r\n                    <xsd:element name=\"created_at\" type=\"xsd:string\" />\r\n                    <xsd:element name=\"updated_at\" type=\"xsd:string\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AddEntity\">\r\n                <xsd:sequence>\r\n{{entityWsiAttributesForAdd}}\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}UpdateEntity\">\r\n                <xsd:sequence>\r\n{{entityWsiAttributesForAdd}}\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}InfoEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"entity_id\" type=\"xsd:string\" />\r\n{{entityWsiAttributes}}\r\n                    <xsd:element name=\"created_at\" type=\"xsd:string\" />\r\n                    <xsd:element name=\"updated_at\" type=\"xsd:string\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n{{entityWsiRelationTypes}}\r\n            <xsd:element name=\"{{module}}{{Entity}}ListRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"filters\" type=\"typens:filters\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}ListResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"result\" type=\"typens:{{module}}{{Entity}}EntityArray\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}InfoRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"{{entity}}Id\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}InfoResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"typens:{{module}}{{Entity}}InfoEntity\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AddRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"data\" type=\"typens:{{module}}{{Entity}}AddEntity\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AddResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:int\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}UpdateRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"{{entity}}Id\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"data\" type=\"typens:{{module}}{{Entity}}UpdateEntity\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}UpdateResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:boolean\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}RemoveRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                    <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"{{entity}}Id\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}RemoveResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:boolean\" />\r\n                    </xsd:sequence>\r\n                 </xsd:complexType>\r\n            </xsd:element>\r\n{{entityWsiRelationParamTypes}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/023_entity_comment_types",
    "content": "            <xsd:complexType name=\"{{module}}{{Entity}}CommentListEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"comment_id\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"{{entity}}_id\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"title\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"status\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"customer_id\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"name\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"email\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"created_at\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"updated_at\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}CommentListEntityArray\">\r\n                <xsd:sequence>\r\n                    <xsd:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"complexObjectArray\" type=\"typens:{{module}}{{Entity}}CommentListEntity\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:element name=\"{{module}}{{Entity}}CommentListRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"filters\" type=\"typens:filters\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}CommentListResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"result\" type=\"typens:{{module}}{{Entity}}CommentListEntityArray\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}CommentUpdateStatusRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"commentId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"status\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}CommentUpdateStatusResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"result\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/026_entity_attribute_types",
    "content": "            <xsd:complexType name=\"{{module}}{{Entity}}AttributeEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"attribute_id\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"code\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"type\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"scope\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"required\" type=\"xsd:int\" minOccurs=\"0\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeEntityArray\">\r\n                <xsd:sequence>\r\n                    <xsd:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"complexObjectArray\" type=\"typens:{{module}}{{Entity}}AttributeEntity\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeEntityInfo\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"attribute_id\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"code\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"type\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"scope\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"required\" type=\"xsd:int\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"frontend_label\" type=\"typens:{{module}}{{Entity}}AttributeFrontendLabelArray\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"additional_fields\" type=\"typens:associativeArray\" minOccurs=\"0\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"label\" type=\"xsd:string\" />\r\n                    <xsd:element name=\"value\" type=\"xsd:string\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionEntityArray\">\r\n                <xsd:sequence>\r\n                    <xsd:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"complexObjectArray\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntity\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AdditionalAttributesEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"multi_data\" type=\"typens:associativeMultiArray\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"single_data\" type=\"typens:associativeArray\" minOccurs=\"0\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"label\" type=\"xsd:string\"/>\r\n                    <xsd:element name=\"value\" type=\"xsd:string\"/>\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionEntityArray\">\r\n                <xsd:sequence>\r\n                    <xsd:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"complexObjectArray\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntity\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionLabelEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"store_id\" type=\"typens:ArrayOfString\" />\r\n                    <xsd:element name=\"value\" type=\"xsd:string\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionLabelArray\">\r\n                <xsd:sequence>\r\n                    <xsd:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"complexObjectArray\" type=\"typens:{{module}}{{Entity}}AttributeOptionLabelEntity\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}RequestAttributes\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"attributes\" type=\"typens:ArrayOfString\" minOccurs=\"0\"/>\r\n                    <xsd:element name=\"additional_attributes\" type=\"typens:ArrayOfString\" minOccurs=\"0\"/>\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeFrontendLabelEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"store_id\" type=\"xsd:string\" />\r\n                    <xsd:element name=\"label\" type=\"xsd:string\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeFrontendLabelArray\">\r\n                <xsd:sequence>\r\n                    <xsd:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"complexObjectArray\" type=\"typens:{{module}}{{Entity}}AttributeFrontendLabelEntity\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeEntityToCreate\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"attribute_code\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"frontend_input\" type=\"xsd:string\" minOccurs=\"1\" maxOccurs=\"1\" />\r\n                    <xsd:element name=\"scope\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"default_value\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"is_required\" type=\"xsd:int\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"additional_fields\" type=\"typens:associativeArray\" minOccurs=\"0\"/>\r\n                    <xsd:element name=\"frontend_label\" type=\"typens:{{module}}{{Entity}}AttributeFrontendLabelArray\" minOccurs=\"1\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeEntityToUpdate\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"scope\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"default_value\" type=\"xsd:string\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"is_required\" type=\"xsd:int\" minOccurs=\"0\" />\r\n                    <xsd:element name=\"additional_fields\" type=\"typens:associativeArray\" minOccurs=\"0\"/>\r\n                    <xsd:element name=\"frontend_label\" type=\"typens:{{module}}{{Entity}}AttributeFrontendLabelArray\" minOccurs=\"1\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionLabelEntity\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"store_id\" type=\"typens:ArrayOfString\" />\r\n                    <xsd:element name=\"value\" type=\"xsd:string\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionLabelArray\">\r\n                <xsd:sequence>\r\n                    <xsd:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"complexObjectArray\" type=\"typens:{{module}}{{Entity}}AttributeOptionLabelEntity\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n            <xsd:complexType name=\"{{module}}{{Entity}}AttributeOptionEntityToAdd\">\r\n                <xsd:sequence>\r\n                    <xsd:element name=\"label\" type=\"typens:{{module}}{{Entity}}AttributeOptionLabelArray\" />\r\n                    <xsd:element name=\"order\" type=\"xsd:int\" />\r\n                    <xsd:element name=\"is_default\" type=\"xsd:int\" />\r\n                </xsd:sequence>\r\n            </xsd:complexType>\r\n\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeCurrentStoreRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"store\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeCurrentStoreResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:int\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeListRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeListResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"result\" type=\"typens:{{module}}{{Entity}}AttributeEntityArray\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeOptionsRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"attributeId\" type=\"xsd:int\" />\r\n                        <xsd:element minOccurs=\"0\" maxOccurs=\"1\" name=\"store\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeOptionsResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntityArray\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeCreateRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"data\" type=\"typens:{{module}}{{Entity}}AttributeEntityToCreate\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeCreateResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeTypesRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeTypesResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"data\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntityArray\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n\r\n            <xsd:element name=\"{{module}}{{Entity}}ListOfAdditionalAttributesRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}ListOfAdditionalAttributesResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"data\" type=\"typens:{{module}}{{Entity}}AttributeEntityArray\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeUpdateRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"attribute\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"data\" type=\"typens:{{module}}{{Entity}}AttributeEntityToUpdate\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeUpdateResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeRemoveRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"attribute\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeRemoveResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeInfoRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"attribute\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeInfoResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"typens:{{module}}{{Entity}}AttributeEntity\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeAddOptionRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"attribute\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"data\" type=\"typens:{{module}}{{Entity}}AttributeOptionEntityToAdd\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeAddOptionResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeRemoveOptionRequestParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"sessionId\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"attribute\" type=\"xsd:string\" />\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"optionId\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n            <xsd:element name=\"{{module}}{{Entity}}AttributeRemoveOptionResponseParam\">\r\n                <xsd:complexType>\r\n                    <xsd:sequence>\r\n                        <xsd:element minOccurs=\"1\" maxOccurs=\"1\" name=\"result\" type=\"xsd:string\" />\r\n                    </xsd:sequence>\r\n                </xsd:complexType>\r\n            </xsd:element>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/030_schema_footer",
    "content": "        </xsd:schema>\r\n    </wsdl:types>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/040_entity_messages",
    "content": "    <wsdl:message name=\"{{module}}{{Entity}}ListRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}ListRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}ListResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}ListResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}InfoRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}InfoRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}InfoResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}InfoResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AddRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AddRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AddResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AddResponseParam\"/>\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}UpdateRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}UpdateRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}UpdateResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}UpdateResponseParam\"/>\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}RemoveRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}RemoveRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}RemoveResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}RemoveResponseParam\" />\r\n    </wsdl:message>\r\n{{entityWsiRelationMessages}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/043_entity_comment_messages",
    "content": "    <wsdl:message name=\"{{module}}{{Entity}}CommentListRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}CommentListRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}CommentListResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}CommentListResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}CommentUpdateStatusRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}CommentUpdateStatusRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}CommentUpdateStatusResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}CommentUpdateStatusResponseParam\" />\r\n    </wsdl:message>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/046_entity_attribute_messages",
    "content": "    <wsdl:message name=\"{{module}}{{Entity}}ListOfAdditionalAttributesRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}ListOfAdditionalAttributesResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeCurrentStoreRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeCurrentStoreRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeCurrentStoreResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeCurrentStoreResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeListRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeListRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeListResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeListResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeOptionsRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeOptionsRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeOptionsResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeOptionsResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeTypesRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeTypesRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeTypesResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeTypesResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeCreateRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeCreateRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeCreateResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeCreateResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeRemoveRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeRemoveRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeRemoveResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeRemoveResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeInfoRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeInfoRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeInfoResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeInfoResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeUpdateRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeUpdateRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeUpdateResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeUpdateResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeAddOptionRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeAddOptionRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeAddOptionResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeAddOptionResponseParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeRemoveOptionRequest\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeRemoveOptionRequestParam\" />\r\n    </wsdl:message>\r\n    <wsdl:message name=\"{{module}}{{Entity}}AttributeRemoveOptionResponse\">\r\n        <wsdl:part name=\"parameters\" element=\"typens:{{module}}{{Entity}}AttributeRemoveOptionResponseParam\" />\r\n    </wsdl:message>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/050_porttype_top",
    "content": "    <wsdl:portType name=\"{{var wsdl.handler}}PortType\">\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/060_porttype_entity",
    "content": "        <wsdl:operation name=\"{{module}}{{Entity}}List\">\r\n            <wsdl:documentation>Retrieve list of {{entitiesLabel}}</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}ListRequest\" />\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}ListResponse\" />\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}Info\">\r\n            <wsdl:documentation>Retrieve {{entityLabel}} info</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}InfoRequest\" />\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}InfoResponse\" />\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}Add\">\r\n            <wsdl:documentation>Add {{entityLabel}}</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AddRequest\" />\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AddResponse\" />\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}Update\">\r\n            <wsdl:documentation>Update {{entityLabel}}</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}UpdateRequest\" />\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}UpdateResponse\" />\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}Remove\">\r\n            <wsdl:documentation>Remove {{entityLabel}}</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}RemoveRequest\" />\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}RemoveResponse\" />\r\n        </wsdl:operation>\r\n{{entityWsiPortTypeRelation}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/063_porttype_entity_comment",
    "content": "        <wsdl:operation name=\"{{module}}{{Entity}}CommentList\">\r\n            <wsdl:documentation>Retrieve list of {{entityLabel}} comments</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}CommentListRequest\" />\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}CommentListResponse\" />\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}CommentUpdateStatus\">\r\n            <wsdl:documentation>Change {{entityLabel}} comment status</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}CommentUpdateStatusRequest\" />\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}CommentUpdateStatusResponse\" />\r\n        </wsdl:operation>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/066_porttype_entity_attribute",
    "content": "        <wsdl:operation name=\"{{module}}{{Entity}}ListOfAdditionalAttributes\">\r\n            <wsdl:documentation>Get list of additional attributes which are not in default create/update list</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeCurrentStore\">\r\n            <wsdl:documentation>Set/Get current store view</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeCurrentStoreRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeCurrentStoreResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}ListOfAdditionalAttributes\">\r\n            <wsdl:documentation>Get list of additional attributes which are not in default create/update list</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}ListOfAdditionalAttributesResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeList\">\r\n            <wsdl:documentation>Retrieve {{entityLabel}} attribute list</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeListRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeListResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeOptions\">\r\n            <wsdl:documentation>Retrieve {{entityLabel}} attribute options</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeOptionsRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeOptionsResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeTypes\">\r\n            <wsdl:documentation>Get list of possible {{entityLabel}} attribute types</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeTypesRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeTypesResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeCreate\">\r\n            <wsdl:documentation>Create new {{entityLabel}} attribute</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeCreateRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeCreateResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeRemove\">\r\n            <wsdl:documentation>Delete {{entityLabel}} attribute</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeRemoveRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeRemoveResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeInfo\">\r\n            <wsdl:documentation>Get full information about {{entityLabel}} attribute with list of options</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeInfoRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeInfoResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeUpdate\">\r\n            <wsdl:documentation>Update {{entityLabel}} attribute</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeUpdateRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeUpdateResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeAddOption\">\r\n            <wsdl:documentation>Add option to {{entityLabel}} attribute</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeAddOptionRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeAddOptionResponse\"/>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeRemoveOption\">\r\n            <wsdl:documentation>Remove option from {{entityLabel}} attribute</wsdl:documentation>\r\n            <wsdl:input message=\"typens:{{module}}{{Entity}}AttributeRemoveOptionRequest\"/>\r\n            <wsdl:output message=\"typens:{{module}}{{Entity}}AttributeRemoveOptionResponse\"/>\r\n        </wsdl:operation>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/070_porttype_footer",
    "content": "    </wsdl:portType>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/080_binding_top",
    "content": "    <wsdl:binding name=\"{{var wsdl.handler}}Binding\" type=\"typens:{{var wsdl.handler}}PortType\">\r\n        <soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\" />\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/090_entity_binding",
    "content": "        <wsdl:operation name=\"{{module}}{{Entity}}List\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}Info\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}Add\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}Update\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}Remove\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n{{entityWsiRelationBinding}}"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/093_entity_binding_comment",
    "content": "        <wsdl:operation name=\"{{module}}{{Entity}}CommentList\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}CommentUpdateStatus\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/096_entity_binding_attribute",
    "content": "        <wsdl:operation name=\"{{module}}{{Entity}}ListOfAdditionalAttributes\">\r\n            <soap:operation soapAction=\"\"/>\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeCurrentStore\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeList\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeOptions\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeTypes\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeCreate\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeUpdate\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeRemove\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeInfo\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeAddOption\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n        <wsdl:operation name=\"{{module}}{{Entity}}AttributeRemoveOption\">\r\n            <soap:operation soapAction=\"\" />\r\n            <wsdl:input>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:input>\r\n            <wsdl:output>\r\n                <soap:body use=\"literal\" />\r\n            </wsdl:output>\r\n        </wsdl:operation>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/etc/wsi/100_footer",
    "content": "    </wsdl:binding>\r\n    <wsdl:service name=\"{{var wsdl.name}}Service\">\r\n        <wsdl:port name=\"{{var wsdl.handler}}Port\" binding=\"typens:{{var wsdl.handler}}Binding\">\r\n            <soap:address location=\"{{var wsdl.url}}\" />\r\n        </wsdl:port>\r\n    </wsdl:service>\r\n</wsdl:definitions>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/010_top",
    "content": "<?php\n{{License}}\n/**\n * {{Module}} module install script\n *\n * @category    {{Namespace}}\n * @package     {{Namespace}}_{{Module}}\n * {{qwertyuiopp}}\n */\n$this->startSetup();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/020_entity_flat",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/{{entity}}'))\n    ->addColumn(\n        'entity_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'identity'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        '{{EntityLabel}} ID'\n    )\n{{attributeDdlSql}}\n    ->addColumn(\n        'updated_at',\n        Varien_Db_Ddl_Table::TYPE_TIMESTAMP,\n        null,\n        array(),\n        '{{EntityLabel}} Modification Time'\n    )\n    ->addColumn(\n        'created_at',\n        Varien_Db_Ddl_Table::TYPE_TIMESTAMP,\n        null,\n        array(),\n        '{{EntityLabel}} Creation Time'\n    ) {{fksDdl}}\n    ->setComment('{{EntityLabel}} Table');\n$this->getConnection()->createTable($table);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/030_entity_store",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/{{entity}}_store'))\n    ->addColumn(\n        '{{entity}}_id',\n        Varien_Db_Ddl_Table::TYPE_SMALLINT,\n        null,\n        array(\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        '{{EntityLabel}} ID'\n    )\n    ->addColumn(\n        'store_id',\n        Varien_Db_Ddl_Table::TYPE_SMALLINT,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        'Store ID'\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}_store',\n            array('store_id')\n        ),\n        array('store_id')\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_store',\n            '{{entity}}_id',\n            '{{namespace}}_{{module}}/{{entity}}',\n            'entity_id'\n        ),\n        '{{entity}}_id',\n        $this->getTable('{{namespace}}_{{module}}/{{entity}}'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_store',\n            'store_id',\n            'core/store',\n            'store_id'\n        ),\n        'store_id',\n        $this->getTable('core/store'),\n        'store_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->setComment('{{EntitiesLabel}} To Store Linkage Table');\n$this->getConnection()->createTable($table);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/040_entity_eav",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/{{entity}}'))\n    ->addColumn(\n        'entity_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'identity'  => true,\n            'unsigned'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        'Entity ID'\n    )\n    ->addColumn(\n        'entity_type_id',\n        Varien_Db_Ddl_Table::TYPE_SMALLINT,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        'Entity Type ID'\n    )\n    ->addColumn(\n        'attribute_set_id',\n        Varien_Db_Ddl_Table::TYPE_SMALLINT,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        'Attribute Set ID'\n    )\n{{attributeDdlSql}}\n    ->addColumn(\n        'created_at',\n        Varien_Db_Ddl_Table::TYPE_TIMESTAMP,\n        null, array(),\n        'Creation Time'\n    )\n    ->addColumn(\n        'updated_at',\n        Varien_Db_Ddl_Table::TYPE_TIMESTAMP,\n        null,\n        array(),\n        'Update Time'\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}',\n            array('entity_type_id')\n        ),\n        array('entity_type_id')\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}',\n            array('attribute_set_id')\n        ),\n        array('attribute_set_id')\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}',\n            'attribute_set_id',\n            'eav/attribute_set',\n            'attribute_set_id'\n        ),\n        'attribute_set_id',\n        $this->getTable('eav/attribute_set'),\n        'attribute_set_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}',\n            'entity_type_id',\n            'eav/entity_type',\n            'entity_type_id'\n        ),\n        'entity_type_id',\n        $this->getTable('eav/entity_type'),\n        'entity_type_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->setComment('{{EntityLabel}} Table');\n$this->getConnection()->createTable($table);\n\n${{entity}}Eav = array();\n${{entity}}Eav['int'] = array(\n    'type'      => Varien_Db_Ddl_Table::TYPE_INTEGER,\n    'length'    => null,\n    'comment'   => '{{EntityLabel}} Datetime Attribute Backend Table'\n);\n\n${{entity}}Eav['varchar'] = array(\n    'type'      => Varien_Db_Ddl_Table::TYPE_TEXT,\n    'length'    => 255,\n    'comment'   => '{{EntityLabel}} Varchar Attribute Backend Table'\n);\n\n${{entity}}Eav['text'] = array(\n    'type'      => Varien_Db_Ddl_Table::TYPE_TEXT,\n    'length'    => '64k',\n    'comment'   => '{{EntityLabel}} Text Attribute Backend Table'\n);\n\n${{entity}}Eav['datetime'] = array(\n    'type'      => Varien_Db_Ddl_Table::TYPE_DATETIME,\n    'length'    => null,\n    'comment'   => '{{EntityLabel}} Datetime Attribute Backend Table'\n);\n\n${{entity}}Eav['decimal'] = array(\n    'type'      => Varien_Db_Ddl_Table::TYPE_DECIMAL,\n    'length'    => '12,4',\n    'comment'   => '{{EntityLabel}} Datetime Attribute Backend Table'\n);\n\nforeach (${{entity}}Eav as $type => $options) {\n    $table = $this->getConnection()\n        ->newTable($this->getTable(array('{{namespace}}_{{module}}/{{entity}}', $type)))\n        ->addColumn(\n            'value_id',\n            Varien_Db_Ddl_Table::TYPE_INTEGER,\n            null,\n            array(\n                'identity'  => true,\n                'nullable'  => false,\n                'primary'   => true,\n            ),\n            'Value ID'\n        )\n        ->addColumn(\n            'entity_type_id',\n            Varien_Db_Ddl_Table::TYPE_SMALLINT,\n            null,\n            array(\n                'unsigned'  => true,\n                'nullable'  => false,\n                'default'   => '0',\n            ),\n            'Entity Type ID'\n        )\n        ->addColumn(\n            'attribute_id',\n            Varien_Db_Ddl_Table::TYPE_SMALLINT,\n            null,\n            array(\n                'unsigned'  => true,\n                'nullable'  => false,\n                'default'   => '0',\n            ),\n            'Attribute ID'\n        )\n        ->addColumn(\n            'store_id',\n            Varien_Db_Ddl_Table::TYPE_SMALLINT,\n            null,\n            array(\n                'unsigned'  => true,\n                'nullable'  => false,\n                'default'   => '0',\n            ),\n            'Store ID'\n        )\n        ->addColumn(\n            'entity_id',\n            Varien_Db_Ddl_Table::TYPE_INTEGER,\n            null,\n            array(\n                'unsigned'  => true,\n                'nullable'  => false,\n                'default'   => '0',\n            ),\n            'Entity ID'\n        )\n        ->addColumn(\n            'value',\n            $options['type'],\n            $options['length'], array(),\n            'Value'\n        )\n        ->addIndex(\n            $this->getIdxName(\n                array('{{namespace}}_{{module}}/{{entity}}', $type),\n                array('entity_id', 'attribute_id', 'store_id'),\n                Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE\n            ),\n            array('entity_id', 'attribute_id', 'store_id'),\n            array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)\n        )\n        ->addIndex(\n            $this->getIdxName(\n                array('{{namespace}}_{{module}}/{{entity}}', $type),\n                array('store_id')\n            ),\n            array('store_id')\n        )\n        ->addIndex(\n            $this->getIdxName(\n                array('{{namespace}}_{{module}}/{{entity}}', $type),\n                array('entity_id')\n            ),\n            array('entity_id')\n        )\n        ->addIndex(\n            $this->getIdxName(\n                array('{{namespace}}_{{module}}/{{entity}}', $type),\n                array('attribute_id')\n            ),\n            array('attribute_id')\n        )\n        ->addForeignKey(\n            $this->getFkName(\n                array('{{namespace}}_{{module}}/{{entity}}', $type),\n                'attribute_id',\n                'eav/attribute',\n                'attribute_id'\n            ),\n            'attribute_id',\n            $this->getTable('eav/attribute'),\n            'attribute_id',\n            Varien_Db_Ddl_Table::ACTION_CASCADE,\n            Varien_Db_Ddl_Table::ACTION_CASCADE\n        )\n        ->addForeignKey(\n            $this->getFkName(\n                array('{{namespace}}_{{module}}/{{entity}}', $type),\n                'entity_id',\n                '{{namespace}}_{{module}}/{{entity}}',\n                'entity_id'\n            ),\n            'entity_id',\n            $this->getTable('{{namespace}}_{{module}}/{{entity}}'),\n            'entity_id',\n            Varien_Db_Ddl_Table::ACTION_CASCADE,\n            Varien_Db_Ddl_Table::ACTION_CASCADE\n        )\n        ->addForeignKey(\n            $this->getFkName(\n                array('{{namespace}}_{{module}}/{{entity}}', $type),\n                'store_id',\n                'core/store',\n                'store_id'\n            ),\n            'store_id',\n            $this->getTable('core/store'),\n            'store_id',\n            Varien_Db_Ddl_Table::ACTION_CASCADE,\n            Varien_Db_Ddl_Table::ACTION_CASCADE\n        )\n        ->setComment($options['comment']);\n    $this->getConnection()->createTable($table);\n}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/050_product_relation",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/{{entity}}_product'))\n    ->addColumn(\n        'rel_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'identity'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        'Relation ID'\n    )\n    ->addColumn(\n        '{{entity}}_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        '{{EntityLabel}} ID'\n    )\n    ->addColumn(\n        'product_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        'Product ID'\n    )\n    ->addColumn(\n        'position',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        'Position'\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}_product',\n            array('product_id')\n        ),\n        array('product_id')\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_product',\n            '{{entity}}_id',\n            '{{namespace}}_{{module}}/{{entity}}',\n            'entity_id'\n        ),\n        '{{entity}}_id',\n        $this->getTable('{{namespace}}_{{module}}/{{entity}}'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_product',\n            'product_id',\n            'catalog/product',\n            'entity_id'\n        ),\n        'product_id',\n        $this->getTable('catalog/product'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}_product',\n            array('{{entity}}_id', 'product_id'),\n            Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE\n        ),\n        array('{{entity}}_id', 'product_id'),\n        array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)\n    )\n    ->setComment('{{EntityLabel}} to Product Linkage Table');\n$this->getConnection()->createTable($table);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/060_category_relation",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/{{entity}}_category'))\n    ->addColumn(\n        'rel_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'identity'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        'Relation ID'\n    )\n    ->addColumn(\n        '{{entity}}_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        '{{EntityLabel}} ID'\n    )\n    ->addColumn(\n        'category_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        'Category ID'\n    )\n    ->addColumn(\n        'position',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        'Position'\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}_category',\n            array('category_id')\n        ),\n        array('category_id')\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_category',\n            '{{entity}}_id',\n            '{{namespace}}_{{module}}/{{entity}}',\n            'entity_id'\n        ),\n        '{{entity}}_id',\n        $this->getTable('{{namespace}}_{{module}}/{{entity}}'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_category',\n            'category_id',\n            'catalog/category',\n            'entity_id'\n        ),\n        'category_id',\n        $this->getTable('catalog/category'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}_category',\n            array('{{entity}}_id', 'category_id'),\n            Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE\n        ),\n        array('{{entity}}_id', 'category_id'),\n        array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)\n    )\n    ->setComment('{{EntityLabel}} to Category Linkage Table');\n$this->getConnection()->createTable($table);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/070_comments",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/{{entity}}_comment'))\n    ->addColumn(\n        'comment_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'identity'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        '{{EntityLabel}} Comment ID'\n    )\n    ->addColumn(\n        '{{entity}}_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array('nullable' => false),\n        '{{EntityLabel}} ID'\n    )\n    ->addColumn(\n        'title',\n        Varien_Db_Ddl_Table::TYPE_TEXT,\n        255,\n        array('nullable' => false),\n        'Comment Title'\n    )\n    ->addColumn(\n        'comment',\n        Varien_Db_Ddl_Table::TYPE_TEXT,\n        '64k',\n        array('nullable' => false),\n        'Comment'\n    )\n    ->addColumn(\n        'status',\n        Varien_Db_Ddl_Table::TYPE_SMALLINT,\n        null,\n        array('nullable' => false),\n        'Comment status'\n    )\n    ->addColumn(\n        'customer_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array('nullable' => true),\n        'Customer id'\n    )\n    ->addColumn(\n        'name',\n        Varien_Db_Ddl_Table::TYPE_TEXT,\n        255,\n        array('nullable' => false),\n        'Customer name'\n    )\n    ->addColumn(\n        'email',\n        Varien_Db_Ddl_Table::TYPE_TEXT,\n        255,\n        array('nullable' => false),\n        'Customer email'\n    )\n    ->addColumn(\n        'updated_at',\n        Varien_Db_Ddl_Table::TYPE_TIMESTAMP,\n        null,\n        array(),\n        '{{EntityLabel}} Comment Modification Time'\n    )\n    ->addColumn(\n        'created_at',\n        Varien_Db_Ddl_Table::TYPE_TIMESTAMP,\n        null,\n        array(),\n        '{{EntityLabel}} Comment Creation Time'\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_comment',\n            '{{entity}}_id',\n            '{{namespace}}_{{module}}/{{entity}}',\n            'entity_id'\n        ),\n        '{{entity}}_id',\n        $this->getTable('{{namespace}}_{{module}}/{{entity}}'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_comment',\n            'customer_id',\n            'customer/entity',\n            'entity_id'\n        ),\n        'customer_id',\n        $this->getTable('customer/entity'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_SET_NULL,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->setComment('{{EntityLabel}} Comments Table');\n$this->getConnection()->createTable($table);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/080_comments_store",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/{{entity}}_comment_store'))\n    ->addColumn(\n        'comment_id',\n        Varien_Db_Ddl_Table::TYPE_SMALLINT,\n        null,\n        array(\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        'Comment ID'\n    )\n    ->addColumn(\n        'store_id',\n        Varien_Db_Ddl_Table::TYPE_SMALLINT,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        'Store ID'\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}_comment_store',\n            array('store_id')\n        ),\n        array('store_id')\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_comment_store',\n            'comment_id',\n            '{{namespace}}_{{module}}/{{entity}}_comment',\n            'comment_id'\n        ),\n        'comment_id',\n        $this->getTable('{{namespace}}_{{module}}/{{entity}}_comment'),\n        'comment_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_comment_store',\n            'store_id',\n            'core/store',\n            'store_id'\n        ),\n        'store_id',\n        $this->getTable('core/store'),\n        'store_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->setComment('{{EntitiesLabel}} Comments To Store Linkage Table');\n$this->getConnection()->createTable($table);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/090_sibling_relation",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/{{entity}}_{{sibling}}'))\n    ->addColumn(\n        'rel_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'identity'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        'Relation ID'\n    )\n    ->addColumn(\n        '{{entity}}_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        '{{EntityLabel}} ID'\n    )\n    ->addColumn(\n        '{{sibling}}_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'unsigned'  => true,\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        '{{SiblingLabel}} ID'\n    )\n    ->addColumn(\n        'position',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'nullable'  => false,\n            'default'   => '0',\n        ),\n        'Position'\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_{{sibling}}',\n            '{{entity}}_id',\n            '{{namespace}}_{{module}}/{{entity}}',\n            'entity_id'\n        ),\n        '{{entity}}_id',\n        $this->getTable('{{namespace}}_{{module}}/{{entity}}'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addForeignKey(\n        $this->getFkName(\n            '{{namespace}}_{{module}}/{{entity}}_{{sibling}}',\n            '{{sibling}}_id',\n            '{{namespace}}_{{module}}/{{entity}}',\n            'entity_id'\n        ),\n        '{{sibling}}_id',\n        $this->getTable('{{namespace}}_{{module}}/{{sibling}}'),\n        'entity_id',\n        Varien_Db_Ddl_Table::ACTION_CASCADE,\n        Varien_Db_Ddl_Table::ACTION_CASCADE\n    )\n    ->addIndex(\n        $this->getIdxName(\n            '{{namespace}}_{{module}}/{{entity}}_{{sibling}}',\n            array('{{entity}}_id', '{{sibling}}_id'),\n            Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE\n        ),\n        array('{{entity}}_id', '{{sibling}}_id'),\n        array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)\n    )\n    ->setComment('{{EntityLabel}} to {{SiblingLabel}} Linkage Table');\n$this->getConnection()->createTable($table);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/100_has_eav",
    "content": "$table = $this->getConnection()\n    ->newTable($this->getTable('{{namespace}}_{{module}}/eav_attribute'))\n    ->addColumn(\n        'attribute_id',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(\n            'identity'  => true,\n            'nullable'  => false,\n            'primary'   => true,\n        ),\n        'Attribute ID'\n    )\n    ->addColumn(\n        'is_global',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(),\n        'Attribute scope'\n    )\n    ->addColumn(\n        'position',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(),\n        'Attribute position'\n    )\n    ->addColumn(\n        'is_wysiwyg_enabled',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(),\n        'Attribute uses WYSIWYG'\n    )\n    ->addColumn(\n        'is_visible',\n        Varien_Db_Ddl_Table::TYPE_INTEGER,\n        null,\n        array(),\n        'Attribute is visible'\n    )\n    ->setComment('{{Module}} attribute table');\n$this->getConnection()->createTable($table);\n\n$this->installEntities();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/110_product_attribute",
    "content": "$this->addAttribute(\n    'catalog_product',\n    '{{productAttributeCode}}',\n    array(\n        {{productAttributeGroup}}'backend'           => '',\n        'frontend'          => '',\n        'class'             => '',\n        'default'           => '',\n        'label'             => '{{EntityLabel}}',\n        'input'             => 'select',\n        'type'              => 'int',\n        'source'            => '{{namespace}}_{{module}}/{{entity}}_source',\n        'global'            => {{entityProductAttributeScope}},\n        'is_visible'        => 1,\n        'required'          => 0,\n        'searchable'        => 0,\n        'filterable'        => 0,\n        'unique'            => 0,\n        'comparable'        => 0,\n        'visible_on_front'  => 0,\n        'user_defined'      => 1,\n    )\n);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/120_category_attribute",
    "content": "$this->addAttribute(\n    'catalog_category',\n    '{{categoryAttributeCode}}',\n    array(\n        {{categoryAttributeGroup}}'backend'           => '',\n        'frontend'          => '',\n        'class'             => '',\n        'default'           => '',\n        'label'             => '{{EntityLabel}}',\n        'input'             => 'select',\n        'type'              => 'int',\n        'source'            => '{{namespace}}_{{module}}/{{entity}}_source',\n        'global'            => {{entityCategoryAttributeScope}},\n        'required'          => 0,\n        'unique'            => 0,\n        'user_defined'      => 1,\n    )\n);\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/125_eav_options_default",
    "content": "{{eavOptionsDefaults}}\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/code/sql/namespace_module_setup/install/130_footer",
    "content": "$this->endSetup();\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/010_top",
    "content": "<?xml version=\"1.0\"?>\n{{License}} \n<layout>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/020_entity_not_tree",
    "content": "    <adminhtml_{{module}}_{{entity}}_index>\r\n        <reference name=\"menu\">\r\n            <action method=\"setActive\">\r\n                <menupath>{{selectedMenuPath}}</menupath>\r\n            </action>\r\n        </reference>\r\n        <reference name=\"content\">\r\n{{adminIndexContent}}\r\n        </reference>\r\n    </adminhtml_{{module}}_{{entity}}_index>\r\n    <adminhtml_{{module}}_{{entity}}_grid>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_grid\" name=\"{{entity}}_grid\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_grid>\r\n    <!-- {{Entity}} add/edit action -->\r\n    <adminhtml_{{module}}_{{entity}}_edit>\r\n        <update handle=\"editor\"/>\r\n        <reference name=\"menu\">\r\n            <action method=\"setActive\">\r\n                <menupath>{{selectedMenuPath}}</menupath>\r\n            </action>\r\n        </reference>\r\n        <reference name=\"content\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_edit\" name=\"{{entity}}_edit\"></block>\r\n        </reference>\r\n        <reference name=\"left\">\r\n            {{entityEditLayoutLeft}}<block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tabs\" name=\"{{entity}}_tabs\"></block>\r\n        </reference>{{entityLayoutAdditional}}\r\n    </adminhtml_{{module}}_{{entity}}_edit>\r\n\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/023_eav",
    "content": "            <block type=\"adminhtml/store_switcher\" name=\"store_switcher\" before=\"-\"></block>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/027_entity_not_tree_footer",
    "content": ""
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/028_entity_edit_eav",
    "content": ""
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/029_edit_footer",
    "content": ""
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/030_relation_product",
    "content": "    <adminhtml_{{module}}_{{entity}}_catalog_product_{{entities}}>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_catalog_product_edit_tab_{{entity}}\" name=\"product.edit.tab.{{entity}}\"/>\r\n            <block type=\"adminhtml/widget_grid_serializer\" name=\"{{entity}}_grid_serializer\">\r\n                <reference name=\"{{entity}}_grid_serializer\">\r\n                    <action method=\"initSerializerBlock\">\r\n                        <grid_block_name>product.edit.tab.{{entity}}</grid_block_name>\r\n                        <data_callback>getSelected{{Entities}}</data_callback>\r\n                        <hidden_input_name>{{entities}}</hidden_input_name>\r\n                        <reload_param_name>product_{{entities}}</reload_param_name>\r\n                    </action>\r\n                    <action method=\"addColumnInputName\">\r\n                        <input_name>position</input_name>\r\n                    </action>\r\n                </reference>\r\n            </block>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_catalog_product_{{entities}}>\r\n    <adminhtml_{{module}}_{{entity}}_catalog_product_{{entities}}grid>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_catalog_product_edit_tab_{{entity}}\" name=\"product.edit.tab.{{entity}}\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_catalog_product_{{entities}}grid>\r\n    <adminhtml_{{module}}_{{entity}}_products>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_product\" name=\"{{entity}}.edit.tab.product\"/>\r\n            <block type=\"adminhtml/widget_grid_serializer\" name=\"product_grid_serializer\">\r\n                <reference name=\"product_grid_serializer\">\r\n                    <action method=\"initSerializerBlock\">\r\n                        <grid_block_name>{{entity}}.edit.tab.product</grid_block_name>\r\n                            <data_callback>getSelectedProducts</data_callback>\r\n                            <hidden_input_name>products</hidden_input_name>\r\n                            <reload_param_name>{{entity}}_products</reload_param_name>\r\n                    </action>\r\n                    <action method=\"addColumnInputName\">\r\n                        <input_name>position</input_name>\r\n                    </action>\r\n                </reference>\r\n            </block>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_products>\r\n    <adminhtml_{{module}}_{{entity}}_productsgrid>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_product\" name=\"{{entity}}.edit.tab.product\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_productsgrid>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/040_relation_category",
    "content": "    <adminhtml_{{module}}_{{entity}}_categories>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_categories\" name=\"{{entity}}.edit.tab.categories\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_categories>\r\n    <adminhtml_{{module}}_{{entity}}_catalog_category_{{entities}}grid>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_catalog_category_tab_{{entity}}\" name=\"category.edit.tab.{{entity}}\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_catalog_category_{{entities}}grid>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/050_relation_sibling",
    "content": "    <adminhtml_{{module}}_{{entity}}_{{siblings}}>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}\" name=\"{{namespace}}_{{module}}.{{entity}}.edit.tab.{{sibling}}\"/>\r\n            <block type=\"adminhtml/widget_grid_serializer\" name=\"{{sibling}}_grid_serializer\">\r\n                <reference name=\"{{sibling}}_grid_serializer\">\r\n                    <action method=\"initSerializerBlock\">\r\n                        <grid_block_name>{{namespace}}_{{module}}.{{entity}}.edit.tab.{{sibling}}</grid_block_name>\r\n                            <data_callback>getSelected{{Siblings}}</data_callback>\r\n                            <hidden_input_name>{{siblings}}</hidden_input_name>\r\n                            <reload_param_name>{{entity}}_{{siblings}}</reload_param_name>\r\n                    </action>\r\n                    <action method=\"addColumnInputName\">\r\n                        <input_name>position</input_name>\r\n                    </action>\r\n                </reference>\r\n            </block>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_{{siblings}}>\r\n    <adminhtml_{{module}}_{{entity}}_{{siblings}}grid>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_edit_tab_{{sibling}}\" name=\"{{namespace}}_{{module}}.{{entity}}.edit.tab.{{sibling}}\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_{{siblings}}grid>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/060_entity_tree",
    "content": "    <adminhtml_{{module}}_{{entity}}_edit>\r\n        <update handle=\"editor\"/>{{entityLayoutAdditional}}\r\n        <reference name=\"left\">\r\n            <block name=\"{{entity}}.tree\" type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_tree\" />\r\n        </reference>\r\n        <reference name=\"content\">\r\n            <block name=\"{{entity}}.edit\" type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_edit\" template=\"{{namespace}}_{{module}}/{{entity}}/edit.phtml\" />\r\n        </reference>\r\n        <reference name=\"js\">\r\n            <block type=\"core/template\" template=\"catalog/wysiwyg/js.phtml\" name=\"catalog.wysiwyg.js\" />\r\n        </reference>\r\n    </adminhtml_{{module}}_{{entity}}_edit>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/070_relation_product_tree",
    "content": "    <adminhtml_{{module}}_{{entity}}_catalog_product_{{entities}}>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_catalog_product_edit_tab_{{entity}}\" name=\"catalog.product.edit.tab.{{entities}}\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_catalog_product_{{entities}}>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/080_relation_category_tree",
    "content": "    <!-- Implement category relation -->\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/090_relation_sibling_tree",
    "content": "    <adminhtml_{{module}}_{{sibling}}_{{entities}}>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{sibling}}_edit_tab_{{entity}}\" name=\"{{sibling}}.edit.tab.{{entity}}\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{sibling}}_{{entities}}>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/100_eav_attribute_edit",
    "content": "    <adminhtml_{{module}}_{{entity}}_attribute_index>\r\n        <reference name=\"content\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_attribute\" name=\"attribute_grid\"></block>\r\n        </reference>\r\n    </adminhtml_{{module}}_{{entity}}_attribute_index>\r\n    <adminhtml_{{module}}_{{entity}}_attribute_edit>\r\n        <reference name=\"left\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_attribute_edit_tabs\" name=\"attribute_edit_tabs\"></block>\r\n        </reference>\r\n        <reference name=\"content\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_attribute_edit\" name=\"attribute_edit_content\"></block>\r\n        </reference>\r\n        <reference name=\"js\">\r\n            <block type=\"adminhtml/template\" name=\"attribute_edit_js\" template=\"{{namespace}}_{{module}}/attribute/js.phtml\">\r\n                <action method=\"setMainEntityName\"><name>{{entity}}</name></action>\r\n            </block>\r\n        </reference>\r\n    </adminhtml_{{module}}_{{entity}}_attribute_edit>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/110_comment",
    "content": "    <adminhtml_{{module}}_{{entity}}_comment_index>\r\n        <reference name=\"menu\">\r\n            <action method=\"setActive\">\r\n                <menupath>{{selectedMenuPath}}_comment</menupath>\r\n            </action>\r\n        </reference>\r\n        <reference name=\"content\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_comment\" name=\"{{entity}}_comment_grid\"/>\r\n        </reference>\r\n    </adminhtml_{{module}}_{{entity}}_comment_index>\r\n    <adminhtml_{{module}}_{{entity}}_comment_grid>\r\n        <block type=\"core/text_list\" name=\"root\" output=\"toHtml\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_comment_grid\" name=\"{{entity}}_comment_grid\"/>\r\n        </block>\r\n    </adminhtml_{{module}}_{{entity}}_comment_grid>\r\n    <adminhtml_{{module}}_{{entity}}_comment_edit>\r\n        <update handle=\"editor\"/>\r\n        <reference name=\"menu\">\r\n            <action method=\"setActive\">\r\n                <menupath>{{selectedMenuPath}}_comment</menupath>\r\n            </action>\r\n        </reference>\r\n        <reference name=\"content\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_comment_edit\" name=\"{{entity}}_comment_edit\"></block>\r\n        </reference>\r\n        <reference name=\"left\">\r\n            <block type=\"{{namespace}}_{{module}}/adminhtml_{{entity}}_comment_edit_tabs\" name=\"{{entity}}_comment_tabs\"></block>\r\n        </reference>\r\n    </adminhtml_{{module}}_{{entity}}_comment_edit>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/layout/namespace_module/120_footer",
    "content": "</layout>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/attribute/js/010_content",
    "content": "<?php\n{{License}}\n?>\n<script type=\"text/javascript\">\n//<![CDATA[\nfunction saveAndContinueEdit() {\n    disableElements('save');\n    var activeTab = <?php echo $this->getMainEntityName()?>_attribute_tabsJsTabs.activeTab.id;\n    if (editForm.submit($('edit_form').action+'back/edit/tab/' + activeTab) == false) {\n        enableElements('save');\n     }\n    varienGlobalEvents.attachEventHandler('formValidateAjaxComplete', function () {\n        enableElements('save');\n    });\n}\n\nfunction saveAttribute() {\n    disableElements('save');\n    if (editForm.submit() == false) {\n        enableElements('save');\n    }\n    varienGlobalEvents.attachEventHandler('formValidateAjaxComplete', function () {\n        enableElements('save');\n    });\n}\n\nfunction toggleApplyVisibility(select) {\n    if ($(select).value == 1) {\n        $(select).next('select').removeClassName('no-display');\n        $(select).next('select').removeClassName('ignore-validate');\n\n    } else {\n        $(select).next('select').addClassName('no-display');\n        $(select).next('select').addClassName('ignore-validate');\n        var options = $(select).next('select').options;\n        for( var i=0; i < options.length; i++) {\n            options[i].selected = false;\n        }\n    }\n}\n\nfunction checkOptionsPanelVisibility() {\n    if ($('matage-options-panel')) {\n        var panel = $('matage-options-panel');\n        if ($('frontend_input') && ($('frontend_input').value=='select' || $('frontend_input').value=='multiselect')) {\n            panel.show();\n        } else {\n            panel.hide();\n        }\n    }\n}\n\nfunction bindAttributeInputType()\n{\n    checkOptionsPanelVisibility();\n    switchDefaultValueField();\n    checkIsConfigurableVisibility();\n    if ($('frontend_input') && ($('frontend_input').value=='select' || $('frontend_input').value=='multiselect' || $('frontend_input').value=='price')) {\n        if ($('is_filterable') && !$('is_filterable').getAttribute('readonly')) {\n            $('is_filterable').disabled = false;\n        }\n        if ($('is_filterable_in_search') && !$('is_filterable_in_search').getAttribute('readonly')) {\n            $('is_filterable_in_search').disabled = false;\n        }\n        if ($('backend_type') && $('backend_type').options) {\n            for(var i=0;i<$('backend_type').options.length;i++) {\n                if ($('backend_type').options[i].value=='int') $('backend_type').selectedIndex = i;\n            }\n        }\n    } else {\n        if ($('is_filterable')) {\n            $('is_filterable').selectedIndex=0;\n            $('is_filterable').disabled = true;\n        }\n        if ($('is_filterable_in_search')) {\n            $('is_filterable_in_search').disabled = true;\n        }\n    }\n\n    if ($('frontend_input') && ($('frontend_input').value=='multiselect'\n        || $('frontend_input').value=='gallery'\n        || $('frontend_input').value=='textarea')) {\n        if ($('used_for_sort_by')) {\n            $('used_for_sort_by').disabled = true;\n        }\n    } else {\n        if ($('used_for_sort_by') && !$('used_for_sort_by').getAttribute('readonly')) {\n            $('used_for_sort_by').disabled = false;\n        }\n    }\n\n    setRowVisibility('is_wysiwyg_enabled', false);\n    if ($('frontend_input').value=='textarea') {\n        setRowVisibility('is_wysiwyg_enabled', true);\n        $('frontend_class').value = '';\n        $('frontend_class').disabled = true;\n    } else if ($('frontend_input').value=='text') {\n        if (!$('frontend_class').getAttribute('readonly')) {\n            $('frontend_class').disabled = false;\n        }\n    } else {\n        $('frontend_class').value = '';\n        $('frontend_class').disabled = true;\n    }\n\n    switchIsFilterable();\n}\n\nfunction switchIsFilterable()\n{\n    if ($('is_filterable')) {\n        if ($('is_filterable').selectedIndex == 0) {\n            $('position').disabled = true;\n        } else {\n            if (!$('position').getAttribute('readonly')) {\n                $('position').disabled = false;\n            }\n        }\n    }\n}\n\nfunction switchDefaultValueField()\n{\n    if (!$('frontend_input')) {\n        return;\n    }\n\n    var currentValue = $('frontend_input').value;\n\n    var defaultValueTextVisibility = false;\n    var defaultValueTextareaVisibility = false;\n    var defaultValueDateVisibility = false;\n    var defaultValueYesnoVisibility = false;\n    var scopeVisibility = true;\n\n    switch (currentValue) {\n        case 'select':\n            optionDefaultInputType = 'radio';\n            break;\n\n        case 'multiselect':\n            optionDefaultInputType = 'checkbox';\n            break;\n\n        case 'date':\n            defaultValueDateVisibility = true;\n            break;\n\n        case 'boolean':\n            defaultValueYesnoVisibility = true;\n            break;\n\n        case 'textarea':\n            defaultValueTextareaVisibility = true;\n            break;\n\n        case 'image':\n            defaultValueTextVisibility = false;\n            break;\n        case 'file':\n            defaultValueTextVisibility = false;\n            break;\n        default:\n            defaultValueTextVisibility = true;\n            break;\n    }\n\n\n    switch (currentValue) {\n        case 'image':\n        case 'file':\n            $('front_fieldset').previous().hide();\n            $('front_fieldset').hide();\n\n            setRowVisibility('is_required', false);\n            setRowVisibility('is_unique', false);\n            setRowVisibility('frontend_class', false);\n        break;\n\n        <?php foreach (Mage::helper('catalog')->getAttributeHiddenFields() as $type=>$fields): ?>\n            case '<?php echo $type; ?>':\n                <?php foreach ($fields as $one): ?>\n                    <?php if ($one == '_front_fieldset'): ?>\n                        $('front_fieldset').previous().hide();\n                        $('front_fieldset').hide();\n                    <?php elseif ($one == '_default_value'): ?>\n                        defaultValueTextVisibility =\n                        defaultValueTextareaVisibility =\n                        defaultValueDateVisibility =\n                        defaultValueYesnoVisibility = false;\n                    <?php elseif ($one == '_scope'): ?>\n                        scopeVisibility = false;\n                    <?php else: ?>\n                        setRowVisibility('<?php echo $one; ?>', false);\n                    <?php endif; ?>\n                <?php endforeach; ?>\n            break;\n        <?php endforeach; ?>\n\n        default:\n            $('front_fieldset').previous().show();\n            $('front_fieldset').show();\n            setRowVisibility('is_required', true);\n            setRowVisibility('is_unique', true);\n            setRowVisibility('frontend_class', true);\n            setRowVisibility('is_configurable', true);\n        break;\n    }\n\n    setRowVisibility('default_value_text', defaultValueTextVisibility);\n    setRowVisibility('default_value_textarea', defaultValueTextareaVisibility);\n    setRowVisibility('default_value_date', defaultValueDateVisibility);\n    setRowVisibility('default_value_yesno', defaultValueYesnoVisibility);\n    setRowVisibility('is_global', scopeVisibility);\n\n    var elems = document.getElementsByName('default[]');\n    for (var i = 0; i < elems.length; i++) {\n        elems[i].type = optionDefaultInputType;\n    }\n}\n\nfunction setRowVisibility(id, isVisible)\n{\n    if ($(id)) {\n        var td = $(id).parentNode;\n        var tr = $(td.parentNode);\n\n        if (isVisible) {\n            tr.show();\n        } else {\n            tr.blur();\n            tr.hide();\n        }\n    }\n}\n\nfunction checkIsConfigurableVisibility()\n{\n    if (!$('is_configurable') || !$('is_global') || !$('frontend_input')) return;\n    if ($F('is_global')==1 && $F('frontend_input')=='select') {\n        setRowVisibility('is_configurable', true);\n    } else {\n        setRowVisibility('is_configurable', false);\n    }\n}\n\nfunction updateRequriedOptions()\n{\n    if ($F('frontend_input')=='select' && $F('is_required')==1) {\n        $('option-count-check').addClassName('required-options-count');\n    } else {\n        $('option-count-check').removeClassName('required-options-count');\n    }\n}\n\nif ($('frontend_input')) {\n    Event.observe($('frontend_input'), 'change', updateRequriedOptions);\n    Event.observe($('frontend_input'), 'change', bindAttributeInputType);\n    Event.observe($('is_global'), 'change', checkIsConfigurableVisibility);\n}\n\nif ($('is_filterable')) {\n    Event.observe($('is_filterable'), 'change', switchIsFilterable);\n}\n\nif ($('is_required')) {\n    Event.observe($('is_required'), 'change', updateRequriedOptions);\n}\nbindAttributeInputType();\n//]]>\n</script>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/catalog/category/tab/entities/010_content",
    "content": "<?php\n{{License}}\n?>\n<div class=\"entry-edit\">\n    <div class=\"entry-edit-head\">\n        <h4 class=\"icon-head head-edit-form fieldset-legend\">\n            <?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}') ?>\n        </h4>\n    </div>\n    <fieldset id=\"grop_fields\">\n        <input type=\"hidden\" name=\"{{entity}}_ids\" id=\"category_{{entities}}\" value=\"<?php echo $this->getIdsString() ?>\">\n        <div id=\"category-{{entities}}\" class=\"tree\"></div>\n    </fieldset>\n</div>\n<?php if ($this->getRootNode() && $this->getRootNode()->hasChildren()): ?>\n<script type=\"text/javascript\">\n    Ext.EventManager.onDocumentReady(function() {\n        var {{entity}}Loader = new Ext.tree.TreeLoader({\n           dataUrl: '<?php echo $this->getLoadTreeUrl()?>'\n        });\n        {{entity}}Loader.createNode = function(config) {\n            config.uiProvider = Ext.tree.CheckboxNodeUI;\n            var node;\n            if (config.children && !config.children.length) {\n                delete(config.children);\n                node = new Ext.tree.AsyncTreeNode(config);\n            } else {\n                node = new Ext.tree.TreeNode(config);\n            }\n            return node;\n        };\n        {{entity}}Loader.on(\"beforeload\", function(treeLoader, node) {\n            treeLoader.baseParams.{{entity}} = node.attributes.id;\n        });\n\n        {{entity}}Loader.on(\"load\", function(treeLoader, node, config) {\n            varienWindowOnload();\n        });\n        var tree = new Ext.tree.TreePanel('category-{{entities}}', {\n            animate:true,\n            loader: {{entity}}Loader,\n            enableDD:false,\n            containerScroll: true,\n            rootUIProvider: Ext.tree.CheckboxNodeUI,\n            selModel: new Ext.tree.CheckNodeMultiSelectionModel(),\n            rootVisible: '<?php echo $this->getRootNode()->getIsVisible() ?>'\n        });\n        tree.on('check', function(node) {\n            if (node.attributes.checked) {\n                {{entity}}Add(node.id);\n            } else {\n                {{entity}}Remove(node.id);\n            }\n            varienElementMethods.setHasChanges(node.getUI().checkbox);\n        }, tree);\n        var root = new Ext.tree.TreeNode({\n            text: '<?php echo $this->jsQuoteEscape($this->getRootNode()->getName()) ?>',\n            draggable:false,\n            checked:'<?php echo $this->getRootNode()->getChecked() ?>',\n            id:'<?php echo $this->getRootNode()->getId() ?>',\n            disabled: <?php echo ($this->getRootNode()->getDisabled() ? 'true' : 'false') ?>,\n            uiProvider: Ext.tree.CheckboxNodeUI\n        });\n        tree.setRootNode(root);\n        bild{{Entity}}Tree(root, <?php echo $this->getTreeJson() ?>);\n        tree.addListener('click', {{entity}}Click.createDelegate(this));\n        tree.render();\n        root.expand();\n    });\n    function bild{{Entity}}Tree(parent, config) {\n        if (!config) {\n            return null;\n        }\n        if (parent && config && config.length) {\n            for (var i = 0; i < config.length; i++) {\n                config[i].uiProvider = Ext.tree.CheckboxNodeUI;\n                var node;\n                var _node = Object.clone(config[i]);\n                if (_node.children && !_node.children.length) {\n                    delete(_node.children);\n                    node = new Ext.tree.AsyncTreeNode(_node);\n\n                } else {\n                    node = new Ext.tree.TreeNode(config[i]);\n                }\n                parent.appendChild(node);\n                node.loader = node.getOwnerTree().loader;\n                if (config[i].children) {\n                    bild{{Entity}}Tree(node, config[i].children);\n                }\n            }\n        }\n    }\n    function {{entity}}Click(node, e) {\n        if (node.disabled) {\n            return;\n        }\n        node.getUI().check(!node.getUI().checked());\n        varienElementMethods.setHasChanges(Event.element(e), e);\n    };\n    function {{entity}}Add(id) {\n        var ids = $('category_{{entities}}').value.split(',');\n        ids.push(id);\n        $('category_{{entities}}').value = ids.join(',');\n    }\n    function {{entity}}Remove(id) {\n        var ids = $('category_{{entities}}').value.split(',');\n        while (-1 != ids.indexOf(id)) {\n            ids.splice(ids.indexOf(id), 1);\n        }\n        $('category_{{entities}}').value = ids.join(',');\n    }\n</script>\n<?php endif; ?>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/catalog/product/edit/tab/entity/010_content",
    "content": "<?php\n{{License}}\n?>\n<div class=\"entry-edit\">\n    <div class=\"entry-edit-head\">\n        <h4 class=\"icon-head head-edit-form fieldset-legend\">\n            <?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}') ?>\n        </h4>\n    </div>\n    <fieldset id=\"grop_fields\">\n        <input type=\"hidden\" name=\"{{entity}}_ids\" id=\"product_{{entities}}\" value=\"<?php echo $this->getIdsString() ?>\">\n        <div id=\"product-{{entities}}\" class=\"tree\"></div>\n    </fieldset>\n</div>\n<?php if ($this->getRootNode() && $this->getRootNode()->hasChildren()): ?>\n<script type=\"text/javascript\">\n    Ext.EventManager.onDocumentReady(function() {\n        var {{entity}}Loader = new Ext.tree.TreeLoader({\n           dataUrl: '<?php echo $this->getLoadTreeUrl()?>'\n        });\n\n        {{entity}}Loader.createNode = function(config) {\n            config.uiProvider = Ext.tree.CheckboxNodeUI;\n            var node;\n            if (config.children && !config.children.length) {\n                delete(config.children);\n                node = new Ext.tree.AsyncTreeNode(config);\n            } else {\n                node = new Ext.tree.TreeNode(config);\n            }\n            return node;\n        };\n        {{entity}}Loader.on(\"beforeload\", function(treeLoader, node) {\n            treeLoader.baseParams.{{entity}} = node.attributes.id;\n        });\n        {{entity}}Loader.on(\"load\", function(treeLoader, node, config) {\n            varienWindowOnload();\n        });\n        var tree = new Ext.tree.TreePanel('product-{{entities}}', {\n            animate:true,\n            loader: {{entity}}Loader,\n            enableDD:false,\n            containerScroll: true,\n            rootUIProvider: Ext.tree.CheckboxNodeUI,\n            selModel: new Ext.tree.CheckNodeMultiSelectionModel(),\n            rootVisible: '<?php echo $this->getRootNode()->getIsVisible() ?>'\n        });\n        tree.on('check', function(node) {\n            if (node.attributes.checked) {\n                {{entity}}Add(node.id);\n            } else {\n                {{entity}}Remove(node.id);\n            }\n            varienElementMethods.setHasChanges(node.getUI().checkbox);\n        }, tree);\n\n        var root = new Ext.tree.TreeNode({\n            text: '<?php echo $this->jsQuoteEscape($this->getRootNode()->getName()) ?>',\n            draggable:false,\n            checked:'<?php echo $this->getRootNode()->getChecked() ?>',\n            id:'<?php echo $this->getRootNode()->getId() ?>',\n            disabled: <?php echo ($this->getRootNode()->getDisabled() ? 'true' : 'false') ?>,\n            uiProvider: Ext.tree.CheckboxNodeUI\n        });\n        tree.setRootNode(root);\n        bild{{Entity}}Tree(root, <?php echo $this->getTreeJson() ?>);\n        tree.addListener('click', {{entity}}Click.createDelegate(this));\n        // render the tree\n        tree.render();\n        root.expand();\n    });\n    function bild{{Entity}}Tree(parent, config) {\n        if (!config) {\n            return null;\n        }\n        if (parent && config && config.length) {\n            for (var i = 0; i < config.length; i++) {\n                config[i].uiProvider = Ext.tree.CheckboxNodeUI;\n                var node;\n                var _node = Object.clone(config[i]);\n                if (_node.children && !_node.children.length) {\n                    delete(_node.children);\n                    node = new Ext.tree.AsyncTreeNode(_node);\n                } else {\n                    node = new Ext.tree.TreeNode(config[i]);\n                }\n                parent.appendChild(node);\n                node.loader = node.getOwnerTree().loader;\n                if (config[i].children) {\n                    bild{{Entity}}Tree(node, config[i].children);\n                }\n            }\n        }\n    }\n    function {{entity}}Click(node, e) {\n        if (node.disabled) {\n            return;\n        }\n        node.getUI().check(!node.getUI().checked());\n        varienElementMethods.setHasChanges(Event.element(e), e);\n    };\n    function {{entity}}Add(id) {\n        var ids = $('product_{{entities}}').value.split(',');\n        ids.push(id);\n        $('product_{{entities}}').value = ids.join(',');\n    }\n    function {{entity}}Remove(id) {\n        var ids = $('product_{{entities}}').value.split(',');\n        while (-1 != ids.indexOf(id)) {\n            ids.splice(ids.indexOf(id), 1);\n        }\n        $('product_{{entities}}').value = ids.join(',');\n    }\n</script>\n<?php endif; ?>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/010_content",
    "content": "<?php\r\n{{License}}\r\n?>\r\n<div id=\"{{entity}}-edit-container\" class=\"category-content\">\r\n    <?php echo $this->getChildHtml('form') ?>\r\n</div>\r\n<script type=\"text/javascript\">\r\n//<![CDATA[\r\n    function {{entity}}Reset(url,useAjax) {\r\n        if (useAjax) {\r\n            var params = {active_tab_id:false};\r\n            updateContent(url, params);\r\n        } else {\r\n            location.href = url;\r\n        }\r\n    }\r\n    function {{entity}}Delete(url, useAjax, {{entity}}Id) {\r\n        if (confirm('<?php echo Mage::helper('{{namespace}}_{{module}}')->__('Are you sure?') ?>')) {\r\n            if (useAjax) {\r\n                tree.nodeForDelete = {{entity}}Id;\r\n                updateContent(url, {}, true);\r\n            } else {\r\n                location.href = url;\r\n            }\r\n        }\r\n    }\r\n    function updateContent(url, params, refreshTree) {\r\n        if (!params) {\r\n            params = {};\r\n        }\r\n        if (!params.form_key) {\r\n            params.form_key = FORM_KEY;\r\n        }\r\n        toolbarToggle.stop();\r\n        var {{entity}}Container = $('{{entity}}-edit-container');\r\n        var messagesContainer = $('messages');\r\n        var thisObj = this;\r\n        new Ajax.Request(url + (url.match(new RegExp('\\\\?')) ? '&isAjax=true' : '?isAjax=true' ), {\r\n            parameters:  params,\r\n            evalScripts: true,\r\n            onComplete: function () {\r\n                setTimeout(function() {\r\n                    try {\r\n                        if (refreshTree) {\r\n                            thisObj.refreshTreeArea();\r\n                        }\r\n                        toolbarToggle.start();\r\n                    }\r\n                    catch (e) {\r\n                        alert(e.message);\r\n                    };\r\n                }, 25);\r\n            },\r\n            onSuccess: function(transport) {\r\n                try {\r\n                    if (transport.responseText.isJSON()) {\r\n                        var response = transport.responseText.evalJSON();\r\n                        var needUpdate = true;\r\n                        if (response.error) {\r\n                            alert(response.message);\r\n                            needUpdate = false;\r\n                        }\r\n                        if (response.ajaxExpired && response.ajaxRedirect) {\r\n                            setLocation(response.ajaxRedirect);\r\n                            needUpdate = false;\r\n                        }\r\n                        if (needUpdate) {\r\n                            if (response.content) {\r\n                                $({{entity}}Container).update(response.content);\r\n                            }\r\n                            if (response.messages) {\r\n                                $(messagesContainer).update(response.messages);\r\n                            }\r\n                        }\r\n                    } else {\r\n                        $({{entity}}Container).update(transport.responseText);\r\n                    }\r\n                }\r\n                catch (e) {\r\n                    $({{entity}}Container).update(transport.responseText);\r\n                }\r\n            }\r\n        });\r\n    }\r\n    function refreshTreeArea(transport) {\r\n        if (tree && window.editing{{Entity}}Breadcrumbs) {\r\n            if (tree.nodeForDelete) {\r\n                var node = tree.getNodeById(tree.nodeForDelete);\r\n                tree.nodeForDelete = false;\r\n                if (node) {\r\n                    node.parentNode.removeChild(node);\r\n                    tree.currentNodeId = false;\r\n                }\r\n            } else if (tree.addNodeTo) {\r\n                var parent = tree.getNodeById(tree.addNodeTo);\r\n                tree.addNodeTo = false;\r\n                if (parent) {\r\n                    var node = new Ext.tree.AsyncTreeNode(editing{{Entity}}Breadcrumbs[editing{{Entity}}Breadcrumbs.length - 1]);\r\n                    node.loaded = true;\r\n                    tree.currentNodeId = node.id;\r\n                    parent.appendChild(node);\r\n                    if (parent.expanded) {\r\n                        tree.selectCurrentNode();\r\n                    } else {\r\n                        var timer;\r\n                        parent.expand();\r\n                        var f = function() {\r\n                            if (parent.expanded) {\r\n                                clearInterval(timer);\r\n                                tree.selectCurrentNode();\r\n                            }\r\n                        };\r\n                        timer = setInterval(f, 200);\r\n                    }\r\n                }\r\n            }\r\n            for (var i = 0; i < editing{{Entity}}Breadcrumbs.length; i++) {\r\n                var node = tree.getNodeById(editing{{Entity}}Breadcrumbs[i].id);\r\n                if (node) {\r\n                    node.setText(editing{{Entity}}Breadcrumbs[i].text);\r\n                }\r\n            }\r\n        }\r\n    }\r\n    function displayLoadingMask() {\r\n        var loaderArea = $$('#html-body .wrapper')[0];\r\n        Position.clone($(loaderArea), $('loading-mask'), {offsetLeft:-2});\r\n        toggleSelectsUnderBlock($('loading-mask'), false);\r\n        Element.show('loading-mask');\r\n    }\r\n//]]>\r\n</script>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/form/010_top",
    "content": "<?php\r\n{{License}}\r\n?>\r\n<div class=\"content-header\">\r\n    <h3 class=\"icon-head head-categories\">\r\n        <?php echo $this->escapeHtml($this->getHeader()) . ($this->get{{Entity}}Id() ? ' (' . Mage::helper('{{namespace}}_{{module}}')->__('ID: %s', $this->get{{Entity}}Id()) . ')' : '') ?>\r\n    </h3>\r\n    <p class=\"content-buttons form-buttons\">\r\n        <?php echo $this->getResetButtonHtml() ?>\r\n        <?php if ($this->get{{Entity}}Id()): ?>\r\n            <?php echo $this->getDeleteButtonHtml() ?>\r\n        <?php endif; ?>\r\n        <?php echo $this->getAdditionalButtonsHtml(); ?>\r\n        <?php echo $this->getSaveButtonHtml() ?>\r\n    </p>\r\n</div>\r\n<?php echo $this->getTabsHtml() ?>\r\n<iframe name=\"iframeSave\" style=\"display:none; width:100%;\" src=\"<?php echo $this->getJsUrl() ?>blank.html\"></iframe>\r\n<form target=\"iframeSave\" id=\"{{entity}}_edit_form\" action=\"<?php echo $this->getSaveUrl() ?>\" method=\"post\" enctype=\"multipart/form-data\">\r\n    <div class=\"no-display\">\r\n        <input type=\"hidden\" name=\"isIframe\" value=\"1\" />\r\n        <input name=\"form_key\" type=\"hidden\" value=\"<?php echo $this->getFormKey() ?>\" />\r\n        <input type=\"hidden\" name=\"active_tab_id\" id=\"active_tab_id\" value=\"\" />\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/form/020_product_hidden",
    "content": "        <input type=\"hidden\" name=\"{{entity}}_products\" id=\"in_{{entity}}_products\" value=\"\" />\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/form/030_category_hidden",
    "content": "        <input type=\"hidden\" name=\"{{entity}}_categories\" id=\"in_{{entity}}_categories\" value=\"\" />\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/form/040_sibling_hidden",
    "content": "        <input type=\"hidden\" name=\"{{entity}}_{{siblings}}\" id=\"in_{{entity}}_{{siblings}}\" value=\"\" />\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/form/050_content",
    "content": "    </div>\r\n    <div id=\"{{entity}}_tab_content\"></div>\r\n</form>\r\n<script type=\"text/javascript\">\r\n//<![CDATA[\r\n    {{entity}}Form = new varienForm('{{entity}}_edit_form');\r\n    {{entity}}Form.submit= function (url) {\r\n        this.errorSections = $H({});\r\n        this.canShowError = true;\r\n        this.submitUrl = url;\r\n        if (this.validator && this.validator.validate()) {\r\n            if (this.validationUrl) {\r\n                this._validate();\r\n            } else {\r\n                if (this.isSubmitted) {\r\n                    return false;\r\n                }\r\n                this.isSubmitted = true;\r\n                this._submit();\r\n            }\r\n            displayLoadingMask();\r\n            return true;\r\n        }\r\n        return false;\r\n    };\r\n    {{entity}}Form.refreshPath = function () {\r\n        {{entity}}Id = this.get{{Entity}}Id();\r\n        if (!{{entity}}Id) {\r\n            return false;\r\n        }\r\n        var refreshPathSuccess = function(transport) {\r\n            if (transport.responseText.isJSON()) {\r\n                response = transport.responseText.evalJSON()\r\n                if (response.error) {\r\n                    alert(response.message);\r\n                } else {\r\n                    if ({{entity}}Form.get{{Entity}}Id() == response['id']) {\r\n                        {{entity}}Form.set{{Entity}}Path(response['path']);\r\n                    }\r\n                }\r\n            }\r\n        };\r\n        new Ajax.Request(\r\n            '<?php echo $this->getRefreshPathUrl() ?>',\r\n            {\r\n                method: 'POST',\r\n                evalScripts: true,\r\n                onSuccess: refreshPathSuccess\r\n            }\r\n        );\r\n    };\r\n\r\n    {{entity}}Form.get{{Entity}}Id = function () {\r\n        collection = $(this.formId).getInputs('hidden', '{{entity}}[id]');\r\n        if (collection.size() > 0) {\r\n            return collection.first().value;\r\n        }\r\n        return false;\r\n    };\r\n    {{entity}}Form.set{{Entity}}Path = function (path) {\r\n        collection = $(this.formId).getInputs('hidden', '{{entity}}[path]');\r\n        if (collection.size() > 0) {\r\n            return collection.first().value = path;\r\n        }\r\n    };\r\n    function {{entity}}Submit(url, useAjax) {\r\n        var activeTab = $('active_tab_id');\r\n        if (activeTab) {\r\n            if (activeTab.tabsJsObject && activeTab.tabsJsObject.activeTab) {\r\n                activeTab.value = activeTab.tabsJsObject.activeTab.id;\r\n            }\r\n        }\r\n        var params = {};\r\n        var fields = $('{{entity}}_edit_form').getElementsBySelector('input', 'select');\r\n        for(var i=0;i<fields.length;i++) {\r\n            if (!fields[i].name) {\r\n                continue;\r\n            }\r\n            params[fields[i].name] = fields[i].getValue();\r\n        }\r\n        var {{entity}}Id = params['{{entity}}[id]'] ? params['{{entity}}[id]'] : 0;\r\n        var isCreating = {{entity}}Id == 0;\r\n        var path = params['{{entity}}[path]'].split('/');\r\n        var parentId = path.pop();\r\n        if (parentId == {{entity}}Id) {\r\n            parentId = path.pop();\r\n        }\r\n        if (isCreating) {\r\n            if (!tree.currentNodeId) {\r\n                tree.currentNodeId = parentId;\r\n            }\r\n            tree.addNodeTo = parentId;\r\n        } else {\r\n            var currentNode = tree.getNodeById({{entity}}Id);\r\n            var oldClass = 'active-category';\r\n            var newClass = 'active-category';\r\n            if (currentNode) {\r\n                if (parseInt(params['{{entity}}[status]'])) {\r\n                    var oldClass = 'no-active-category';\r\n                    var newClass = 'active-category';\r\n                } else {\r\n                    var oldClass = 'active-category';\r\n                    var newClass = 'no-active-category';\r\n                }\r\n                Element.removeClassName(currentNode.ui.wrap.firstChild, oldClass);\r\n                Element.addClassName(currentNode.ui.wrap.firstChild, newClass);\r\n            }\r\n        }\r\n        {{entity}}Form.submit();\r\n    }\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/form/060_product_relation",
    "content": "    <?php if (($block = $this->getLayout()->getBlock('{{entity}}.product.grid')) && ($_gridJsObject=$block->getJsObjectName())): ?>\r\n        var {{entity}}Products = $H(<?php echo $this->getProductsJson() ?>);\r\n        $('in_{{entity}}_products').value = {{entity}}Products.toQueryString();\r\n        function register{{Entity}}Product(grid, element, checked) {\r\n        if (checked) {\r\n            if (element.positionElement) {\r\n                element.positionElement.disabled = false;\r\n                {{entity}}Products.set(element.value, element.positionElement.value);\r\n            }\r\n        } else {\r\n            if (element.positionElement) {\r\n                element.positionElement.disabled = true;\r\n            }\r\n            {{entity}}Products.unset(element.value);\r\n        }\r\n        $('in_{{entity}}_products').value = {{entity}}Products.toQueryString();\r\n            grid.reloadParams = {'selected_products[]':{{entity}}Products.keys()};\r\n        }\r\n        function {{entity}}ProductRowClick(grid, event) {\r\n            var trElement = Event.findElement(event, 'tr');\r\n            var isInput   = Event.element(event).tagName == 'INPUT';\r\n            if (trElement) {\r\n                var checkbox = Element.getElementsBySelector(trElement, 'input');\r\n                if (checkbox[0]) {\r\n                    var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;\r\n                    <?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);\r\n                }\r\n            }\r\n        }\r\n        function positionChange(event) {\r\n            var element = Event.element(event);\r\n            if (element && element.checkboxElement && element.checkboxElement.checked) {\r\n            {{entity}}Products.set(element.checkboxElement.value, element.value);\r\n                $('in_{{entity}}_products').value = {{entity}}Products.toQueryString();\r\n            }\r\n        }\r\n        var tabIndex = 1000;\r\n        function {{entity}}ProductRowInit(grid, row) {\r\n            var checkbox = $(row).getElementsByClassName('checkbox')[0];\r\n            var position = $(row).getElementsByClassName('input-text')[0];\r\n            if (checkbox && position) {\r\n                checkbox.positionElement = position;\r\n                position.checkboxElement = checkbox;\r\n                position.disabled = !checkbox.checked;\r\n                position.tabIndex = tabIndex++;\r\n                Event.observe(position, 'keyup', positionChange);\r\n            }\r\n        }\r\n        <?php echo $_gridJsObject ?>.rowClickCallback = {{entity}}ProductRowClick;\r\n        <?php echo $_gridJsObject ?>.initRowCallback = {{entity}}ProductRowInit;\r\n        <?php echo $_gridJsObject ?>.checkboxCheckCallback = register{{Entity}}Product;\r\n        <?php echo $_gridJsObject ?>.rows.each(function(row) {\r\n            {{entity}}ProductRowInit(<?php echo $_gridJsObject ?>, row)\r\n        });\r\n    <?php endif; ?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/form/070_sibling_relations",
    "content": "    <?php if (($block = $this->getLayout()->getBlock('{{entity}}.{{sibling}}.grid')) && ($_gridJsObject=$block->getJsObjectName())): ?>\r\n    var {{entity}}{{Siblings}} = $H(<?php echo $this->get{{Siblings}}Json() ?>);\r\n    $('in_{{entity}}_{{siblings}}').value = {{entity}}{{Siblings}}.toQueryString();\r\n    function register{{Entity}}{{Sibling}}(grid, element, checked) {\r\n        if (checked) {\r\n            if (element.positionElement) {\r\n                element.positionElement.disabled = false;\r\n                {{entity}}{{Siblings}}.set(element.value, element.positionElement.value);\r\n            }\r\n        } else {\r\n            if (element.positionElement) {\r\n                element.positionElement.disabled = true;\r\n            }\r\n            {{entity}}{{Siblings}}.unset(element.value);\r\n        }\r\n        $('in_{{entity}}_{{siblings}}').value = {{entity}}{{Siblings}}.toQueryString();\r\n            grid.reloadParams = {'selected_{{siblings}}[]':{{entity}}{{Siblings}}.keys()\r\n        };\r\n    }\r\n    function {{entity}}{{Sibling}}RowClick(grid, event) {\r\n        var trElement = Event.findElement(event, 'tr');\r\n        var isInput   = Event.element(event).tagName == 'INPUT';\r\n        if (trElement) {\r\n            var checkbox = Element.getElementsBySelector(trElement, 'input');\r\n            if (checkbox[0]) {\r\n                var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;\r\n                <?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);\r\n            }\r\n        }\r\n    }\r\n    function position{{Sibling}}Change(event) {\r\n        var element = Event.element(event);\r\n        if (element && element.checkboxElement && element.checkboxElement.checked) {\r\n            {{entity}}{{Siblings}}.set(element.checkboxElement.value, element.value);\r\n            $('in_{{entity}}_{{siblings}}').value = {{entity}}{{Siblings}}.toQueryString();\r\n        }\r\n    }\r\n    var tabIndex = 1000;\r\n    function {{entity}}{{Sibling}}RowInit(grid, row) {\r\n        var checkbox = $(row).getElementsByClassName('checkbox')[0];\r\n        var position = $(row).getElementsByClassName('input-text')[0];\r\n        if (checkbox && position) {\r\n            checkbox.positionElement = position;\r\n            position.checkboxElement = checkbox;\r\n            position.disabled = !checkbox.checked;\r\n            position.tabIndex = tabIndex++;\r\n            Event.observe(position, 'keyup', position{{Sibling}}Change);\r\n        }\r\n    }\r\n    <?php echo $_gridJsObject ?>.rowClickCallback = {{entity}}{{Sibling}}RowClick;\r\n    <?php echo $_gridJsObject ?>.initRowCallback = {{entity}}{{Sibling}}RowInit;\r\n    <?php echo $_gridJsObject ?>.checkboxCheckCallback = register{{Entity}}{{Sibling}};\r\n    <?php echo $_gridJsObject ?>.rows.each(function(row) {\r\n        {{entity}}{{Sibling}}RowInit(<?php echo $_gridJsObject ?>, row)\r\n    });\r\n    <?php endif; ?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/form/080_footer",
    "content": "    <?php if ($this->isAjax() && ($block = $this->getLayout()->getBlock('tabs')) && ($_tabsJsObject=$block->getJsObjectName())): ?>\r\n        <?php echo $_tabsJsObject ?>.moveTabContentInDest();\r\n        if (<?php echo $_tabsJsObject ?>.activeTab) {\r\n            $('active_tab_id').value = <?php echo $_tabsJsObject ?>.activeTab.id;\r\n        }\r\n        $('active_tab_id').tabsJsObject = <?php echo $_tabsJsObject ?>;\r\n    <?php endif; ?>\r\n//]]>\r\n</script>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/tab/categories/010_content",
    "content": "<?php\r\n{{License}}\r\n?>\r\n<div class=\"entry-edit\">\r\n    <div class=\"entry-edit-head\">\r\n        <h4 class=\"icon-head head-edit-form fieldset-legend\">\r\n            <?php echo Mage::helper('{{namespace}}_{{module}}')->__('Categories') ?>\r\n        </h4>\r\n    </div>\r\n    <fieldset id=\"grop_fields\">\r\n        <input type=\"hidden\" name=\"category_ids\" id=\"{{entity}}_categories\" value=\"<?php echo $this->getIdsString() ?>\">\r\n        <div id=\"{{entity}}-categories\" class=\"tree\"></div>\r\n    </fieldset>\r\n</div>\r\n<?php if ($this->getRootNode() && $this->getRootNode()->hasChildren()): ?>\r\n<script type=\"text/javascript\">\r\n    Ext.EventManager.onDocumentReady(function() {\r\n        var categoryLoader = new Ext.tree.TreeLoader({\r\n           dataUrl: '<?php echo $this->getLoadTreeUrl()?>'\r\n        });\r\n        categoryLoader.createNode = function(config) {\r\n            config.uiProvider = Ext.tree.CheckboxNodeUI;\r\n            var node;\r\n            if (config.children && !config.children.length) {\r\n                delete(config.children);\r\n                node = new Ext.tree.AsyncTreeNode(config);\r\n            } else {\r\n                node = new Ext.tree.TreeNode(config);\r\n            }\r\n            return node;\r\n        };\r\n        categoryLoader.on(\"beforeload\", function(treeLoader, node) {\r\n            treeLoader.baseParams.category = node.attributes.id;\r\n        });\r\n\r\n        categoryLoader.on(\"load\", function(treeLoader, node, config) {\r\n            varienWindowOnload();\r\n        });\r\n        var tree = new Ext.tree.TreePanel('{{entity}}-categories', {\r\n            animate:true,\r\n            loader: categoryLoader,\r\n            enableDD:false,\r\n            containerScroll: true,\r\n            rootUIProvider: Ext.tree.CheckboxNodeUI,\r\n            selModel: new Ext.tree.CheckNodeMultiSelectionModel(),\r\n            rootVisible: '<?php echo $this->getRootNode()->getIsVisible() ?>'\r\n        });\r\n        tree.on('check', function(node) {\r\n            if (node.attributes.checked) {\r\n                categoryAdd(node.id);\r\n            } else {\r\n                categoryRemove(node.id);\r\n            }\r\n            varienElementMethods.setHasChanges(node.getUI().checkbox);\r\n        }, tree);\r\n        var root = new Ext.tree.TreeNode({\r\n            text: '<?php echo $this->jsQuoteEscape($this->getRootNode()->getName()) ?>',\r\n            draggable:false,\r\n            checked:'<?php echo $this->getRootNode()->getChecked() ?>',\r\n            id:'<?php echo $this->getRootNode()->getId() ?>',\r\n            disabled: <?php echo ($this->getRootNode()->getDisabled() ? 'true' : 'false') ?>,\r\n            uiProvider: Ext.tree.CheckboxNodeUI\r\n        });\r\n        tree.setRootNode(root);\r\n        bildCategoryTree(root, <?php echo $this->getTreeJson() ?>);\r\n        tree.addListener('click', categoryClick.createDelegate(this));\r\n        tree.render();\r\n        root.expand();\r\n    });\r\n    function bildCategoryTree(parent, config) {\r\n        if (!config) {\r\n            return null;\r\n        }\r\n        if (parent && config && config.length) {\r\n            for (var i = 0; i < config.length; i++) {\r\n                config[i].uiProvider = Ext.tree.CheckboxNodeUI;\r\n                var node;\r\n                var _node = Object.clone(config[i]);\r\n                if (_node.children && !_node.children.length) {\r\n                    delete(_node.children);\r\n                    node = new Ext.tree.AsyncTreeNode(_node);\r\n\r\n                } else {\r\n                    node = new Ext.tree.TreeNode(config[i]);\r\n                }\r\n                parent.appendChild(node);\r\n                node.loader = node.getOwnerTree().loader;\r\n                if (config[i].children) {\r\n                    bildCategoryTree(node, config[i].children);\r\n                }\r\n            }\r\n        }\r\n    }\r\n    function categoryClick(node, e) {\r\n        if (node.disabled) {\r\n            return;\r\n        }\r\n        node.getUI().check(!node.getUI().checked());\r\n        varienElementMethods.setHasChanges(Event.element(e), e);\r\n    };\r\n    function categoryAdd(id) {\r\n        var ids = $('{{entity}}_categories').value.split(',');\r\n        ids.push(id);\r\n        $('{{entity}}_categories').value = ids.join(',');\r\n    }\r\n    function categoryRemove(id) {\r\n        var ids = $('{{entity}}_categories').value.split(',');\r\n        while (-1 != ids.indexOf(id)) {\r\n            ids.splice(ids.indexOf(id), 1);\r\n        }\r\n        $('{{entity}}_categories').value = ids.join(',');\r\n    }\r\n</script>\r\n<?php endif; ?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/edit/tab/sibling/010_content",
    "content": "<?php\r\n{{License}}\r\n?>\r\n<div class=\"entry-edit\">\r\n    <div class=\"entry-edit-head\">\r\n        <h4 class=\"icon-head head-edit-form fieldset-legend\">\r\n            <?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{SiblingsLabel}}') ?>\r\n        </h4>\r\n    </div>\r\n    <fieldset id=\"grop_fields\">\r\n        <input type=\"hidden\" name=\"{{sibling}}_ids\" id=\"{{entity}}_{{siblings}}\" value=\"<?php echo $this->getIdsString() ?>\">\r\n        <div id=\"{{entity}}-{{siblings}}\" class=\"tree\"></div>\r\n    </fieldset>\r\n</div>\r\n<?php if ($this->getRootNode() && $this->getRootNode()->hasChildren()): ?>\r\n<script type=\"text/javascript\">\r\n    Ext.EventManager.onDocumentReady(function() {\r\n        var {{sibling}}Loader = new Ext.tree.TreeLoader({\r\n           dataUrl: '<?php echo $this->getLoadTreeUrl()?>'\r\n        });\r\n        {{sibling}}Loader.createNode = function(config) {\r\n            config.uiProvider = Ext.tree.CheckboxNodeUI;\r\n            var node;\r\n            if (config.children && !config.children.length) {\r\n                delete(config.children);\r\n                node = new Ext.tree.AsyncTreeNode(config);\r\n            } else {\r\n                node = new Ext.tree.TreeNode(config);\r\n            }\r\n            return node;\r\n        };\r\n        {{sibling}}Loader.on(\"beforeload\", function(treeLoader, node) {\r\n            treeLoader.baseParams.{{sibling}} = node.attributes.id;\r\n        });\r\n\r\n        {{sibling}}Loader.on(\"load\", function(treeLoader, node, config) {\r\n            varienWindowOnload();\r\n        });\r\n        var tree = new Ext.tree.TreePanel('{{entity}}-{{siblings}}', {\r\n            animate:true,\r\n            loader: {{sibling}}Loader,\r\n            enableDD:false,\r\n            containerScroll: true,\r\n            rootUIProvider: Ext.tree.CheckboxNodeUI,\r\n            selModel: new Ext.tree.CheckNodeMultiSelectionModel(),\r\n            rootVisible: '<?php echo $this->getRootNode()->getIsVisible() ?>'\r\n        });\r\n        tree.on('check', function(node) {\r\n            if (node.attributes.checked) {\r\n                {{sibling}}Add(node.id);\r\n            } else {\r\n                {{sibling}}Remove(node.id);\r\n            }\r\n            varienElementMethods.setHasChanges(node.getUI().checkbox);\r\n        }, tree);\r\n        var root = new Ext.tree.TreeNode({\r\n            text: '<?php echo $this->jsQuoteEscape($this->getRootNode()->get{{SiblingNameMagicCode}}()) ?>',\r\n            draggable:false,\r\n            checked:'<?php echo $this->getRootNode()->getChecked() ?>',\r\n            id:'<?php echo $this->getRootNode()->getId() ?>',\r\n            disabled: <?php echo ($this->getRootNode()->getDisabled() ? 'true' : 'false') ?>,\r\n            uiProvider: Ext.tree.CheckboxNodeUI\r\n        });\r\n        tree.setRootNode(root);\r\n        bild{{Sibling}}Tree(root, <?php echo $this->getTreeJson() ?>);\r\n        tree.addListener('click', {{sibling}}Click.createDelegate(this));\r\n        tree.render();\r\n        root.expand();\r\n    });\r\n    function bild{{Sibling}}Tree(parent, config) {\r\n        if (!config) {\r\n            return null;\r\n        }\r\n        if (parent && config && config.length) {\r\n            for (var i = 0; i < config.length; i++) {\r\n                config[i].uiProvider = Ext.tree.CheckboxNodeUI;\r\n                var node;\r\n                var _node = Object.clone(config[i]);\r\n                if (_node.children && !_node.children.length) {\r\n                    delete(_node.children);\r\n                    node = new Ext.tree.AsyncTreeNode(_node);\r\n\r\n                } else {\r\n                    node = new Ext.tree.TreeNode(config[i]);\r\n                }\r\n                parent.appendChild(node);\r\n                node.loader = node.getOwnerTree().loader;\r\n                if (config[i].children) {\r\n                    bild{{Sibling}}Tree(node, config[i].children);\r\n                }\r\n            }\r\n        }\r\n    }\r\n    function {{sibling}}Click(node, e) {\r\n        if (node.disabled) {\r\n            return;\r\n        }\r\n        node.getUI().check(!node.getUI().checked());\r\n        varienElementMethods.setHasChanges(Event.element(e), e);\r\n    };\r\n    function {{sibling}}Add(id) {\r\n        var ids = $('{{entity}}_{{siblings}}').value.split(',');\r\n        ids.push(id);\r\n        $('{{entity}}_{{siblings}}').value = ids.join(',');\r\n    }\r\n    function {{sibling}}Remove(id) {\r\n        var ids = $('{{entity}}_{{siblings}}').value.split(',');\r\n        while (-1 != ids.indexOf(id)) {\r\n            ids.splice(ids.indexOf(id), 1);\r\n        }\r\n        $('{{entity}}_{{siblings}}').value = ids.join(',');\r\n    }\r\n</script>\r\n<?php endif; ?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/tree/010_not_eav",
    "content": "<?php \r\n{{License}}\r\n?>\r\n<div class=\"categories-side-col\">\r\n    <div class=\"content-header\">\r\n        <h3 class=\"icon-head head-{{entities}}\">\r\n            <?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}') ?>\r\n        </h3>\r\n        <?php if ($this->getRoot()): ?>\r\n            <?php echo $this->getAddRootButtonHtml() ?><br />\r\n            <?php echo $this->getAddSubButtonHtml() ?>\r\n        <?php endif; ?>\r\n    </div>\r\n    <div class=\"tree-actions\">\r\n        <?php if ($this->getRoot()): ?>\r\n            <a href=\"#\" onclick=\"tree.collapseTree(); return false;\">\r\n                <?php echo Mage::helper('{{namespace}}_{{module}}')->__('Collapse All'); ?>\r\n            </a>\r\n            <span class=\"separator\">|</span>\r\n            <a href=\"#\" onclick=\"tree.expandTree(); return false;\">\r\n                <?php echo Mage::helper('{{namespace}}_{{module}}')->__('Expand All'); ?>\r\n            </a>\r\n        <?php endif; ?>\r\n    </div>\r\n    <?php if ($this->getRoot()): ?>\r\n        <div class=\"tree-holder\">\r\n            <div id=\"tree-div\" style=\"width:100%; overflow:auto;\"></div>\r\n        </div>\r\n</div>\r\n<script type=\"text/javascript\">\r\n//<![CDATA[\r\n    var tree;\r\n    /**\r\n     * Fix ext compatibility with prototype 1.6\r\n     */\r\n    Ext.lib.Event.getTarget = function(e) {\r\n        var ee = e.browserEvent || e;\r\n        return ee.target ? Event.element(ee) : null;\r\n    };\r\n    Ext.tree.TreePanel.Enhanced = function(el, config) {\r\n        Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);\r\n    };\r\n    Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {\r\n        loadTree : function(config, firstLoad) {\r\n            var parameters = config['parameters'];\r\n            var data = config['data'];\r\n            if ((typeof parameters['root_visible']) != 'undefined') {\r\n                this.rootVisible = parameters['root_visible']*1;\r\n            }\r\n            var root = new Ext.tree.TreeNode(parameters);\r\n            this.nodeHash = {};\r\n            this.setRootNode(root);\r\n            if (firstLoad) {\r\n                this.addListener('click', this.{{entity}}Click);\r\n                this.addListener('beforenodedrop', {{entity}}Move.createDelegate(this));\r\n            }\r\n            this.loader.build{{Entity}}Tree(root, data);\r\n            this.el.dom.innerHTML = '';\r\n            // render the tree\r\n            this.render();\r\n            if (parameters['expanded']) {\r\n                this.expandAll();\r\n            } else {\r\n                root.expand();\r\n            }\r\n            var selectedNode = this.getNodeById(parameters['{{entity}}_id']);\r\n            if (selectedNode) {\r\n                this.currentNodeId = parameters['{{entity}}_id'];\r\n            }\r\n            this.selectCurrentNode();\r\n        },\r\n        request : function(url, params) {\r\n            if (!params) {\r\n                if ({{entity}}_info_tabsJsTabs.activeTab) {\r\n                    var params = {active_tab_id:{{entity}}_info_tabsJsTabs.activeTab.id};\r\n                } else {\r\n                    var params = {};\r\n                }\r\n            }\r\n            if (!params.form_key) {\r\n                params.form_key = FORM_KEY;\r\n            }\r\n            var result = new Ajax.Request(\r\n                url + (url.match(new RegExp('\\\\?')) ? '&isAjax=true' : '?isAjax=true' ),\r\n                {\r\n                       parameters:  params,\r\n                       method:  'post'\r\n                }\r\n            );\r\n            return result;\r\n        },\r\n        selectCurrentNode : function() {\r\n            if (this.currentNodeId) {\r\n                var selectedNode = this.getNodeById(this.currentNodeId);\r\n                if ((typeof selectedNode.attributes.path)!='undefined') {\r\n                    var path = selectedNode.attributes.path;\r\n                    path = '0/'+path;\r\n                    this.selectPath(path);\r\n                } else {\r\n                    this.getSelectionModel().select(selectedNode);\r\n                }\r\n            }\r\n        },\r\n        collapseTree : function() {\r\n            this.collapseAll();\r\n            this.selectCurrentNode();\r\n            if (!this.collapsed) {\r\n                this.collapsed = true;\r\n                this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(false) ?>';\r\n                this.request(this.loader.dataUrl, false);\r\n            }\r\n        },\r\n        expandTree : function() {\r\n            this.expandAll();\r\n            if (this.collapsed) {\r\n                this.collapsed = false;\r\n                this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(true) ?>';\r\n                this.request(this.loader.dataUrl, false);\r\n            }\r\n        },\r\n        {{entity}}Click : function(node, e) {\r\n            var baseUrl = '<?php echo $this->getEditUrl() ?>';\r\n            var urlExt = 'id/'+node.id+'/';\r\n            var url = parseSidUrl(baseUrl, urlExt);\r\n            this.currentNodeId = node.id;\r\n            if (!this.useAjax) {\r\n                setLocation(url);\r\n                return;\r\n            }\r\n            if ({{entity}}_info_tabsJsTabs.activeTab) {\r\n                var params = {active_tab_id:{{entity}}_info_tabsJsTabs.activeTab.id};\r\n            }\r\n            updateContent(url, params);\r\n        }\r\n    });\r\n    function reRenderTree(event) {\r\n        if (tree && event) {\r\n            var obj = event.target;\r\n            if ($('add_root_{{entity}}_button')) {\r\n                $('add_root_{{entity}}_button').show();\r\n            }\r\n            // retain current selected {{entityLabel}} id\r\n            var url = tree.switchTreeUrl;\r\n            // load from cache\r\n            // load from ajax\r\n            new Ajax.Request(url + (url.match(new RegExp('\\\\?')) ? '&isAjax=true' : '?isAjax=true' ), {\r\n                parameters : {form_key: FORM_KEY},\r\n                method : 'post',\r\n                onComplete : function(transport) {\r\n                    var response = eval('(' + transport.responseText + ')');\r\n                    if (!response['parameters']) {\r\n                        return false;\r\n                    }\r\n                    _renderNewTree(response);\r\n                }\r\n            });\r\n        } else {\r\n            _renderNewTree();\r\n        }\r\n    }\r\n    function _renderNewTree(config) {\r\n        if (!config) {\r\n            var config = defaultLoadTreeParams;\r\n        }\r\n        if (tree) {\r\n            tree.purgeListeners();\r\n            tree.el.dom.innerHTML = '';\r\n        }\r\n        tree = new Ext.tree.TreePanel.Enhanced('tree-div', newTreeParams);\r\n        tree.loadTree(config, true);\r\n        // try to select current {{entityLabel}}\r\n        var selectedNode = tree.getNodeById(config.parameters.{{entity}}_id);\r\n        if (selectedNode) {\r\n            tree.currentNodeId = config.parameters.{{entity}}_id;\r\n        }\r\n        tree.selectCurrentNode();\r\n        // update content area\r\n        var url = tree.editUrl;\r\n        <?php if ($this->isClearEdit()):?>\r\n        if (selectedNode) {\r\n            url = url + 'id/' + config.parameters.{{entity}}_id;\r\n        }\r\n        <?php endif;?>\r\n        updateContent(url);\r\n    }\r\n    Ext.onReady(function() {\r\n    {{entity}}Loader = new Ext.tree.TreeLoader({\r\n       dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'\r\n    });\r\n    {{entity}}Loader.createNode = function(config) {\r\n        var node;\r\n        var _node = Object.clone(config);\r\n        if (config.children && !config.children.length) {\r\n            delete(config.children);\r\n            node = new Ext.tree.AsyncTreeNode(config);\r\n        } else {\r\n            node = new Ext.tree.TreeNode(config);\r\n        }\r\n        return node;\r\n    };\r\n    {{entity}}Loader.build{{Entity}}Tree = function(parent, config) {\r\n        if (!config) {\r\n            return null;\r\n        }\r\n        if (parent && config && config.length) {\r\n            for (var i = 0; i < config.length; i++) {\r\n                var node;\r\n                var _node = Object.clone(config[i]);\r\n                if (_node.children && !_node.children.length) {\r\n                    delete(_node.children);\r\n                    node = new Ext.tree.AsyncTreeNode(_node);\r\n                } else {\r\n                    node = new Ext.tree.TreeNode(config[i]);\r\n                }\r\n                parent.appendChild(node);\r\n                node.loader = node.getOwnerTree().loader;\r\n                if (_node.children) {\r\n                    this.build{{Entity}}Tree(node, _node.children);\r\n                }\r\n            }\r\n        }\r\n    };\r\n    {{entity}}Loader.buildHash = function(node) {\r\n        var hash = {};\r\n        hash = this.toArray(node.attributes);\r\n        if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {\r\n            hash['children'] = new Array;\r\n            for (var i = 0, len = node.childNodes.length; i < len; i++) {\r\n                if (!hash['children']) {\r\n                    hash['children'] = new Array;\r\n                }\r\n                hash['children'].push(this.buildHash(node.childNodes[i]));\r\n            }\r\n        }\r\n        return hash;\r\n    };\r\n    {{entity}}Loader.toArray = function(attributes) {\r\n        var data = {form_key: FORM_KEY};\r\n        for (var key in attributes) {\r\n            var value = attributes[key];\r\n            data[key] = value;\r\n        }\r\n        return data;\r\n    };\r\n    {{entity}}Loader.on(\"beforeload\", function(treeLoader, node) {\r\n        treeLoader.baseParams.id = node.attributes.id;\r\n        treeLoader.baseParams.form_key = FORM_KEY;\r\n    });\r\n    {{entity}}Loader.on(\"load\", function(treeLoader, node, config) {\r\n        varienWindowOnload();\r\n    });\r\n    newTreeParams = {\r\n        animate : false,\r\n        loader  : {{entity}}Loader,\r\n        enableDD: true,\r\n        containerScroll : true,\r\n        selModel: new Ext.tree.CheckNodeMultiSelectionModel(),\r\n        rootVisible : false,\r\n        useAjax : <?php echo $this->getUseAjax() ?>,\r\n        switchTreeUrl   : '<?php echo $this->getSwitchTreeUrl() ?>',\r\n        editUrl : '<?php echo $this->getEditUrl() ?>',\r\n        currentNodeId   : <?php echo (int) $this->get{{Entity}}Id() ?>\r\n    };\r\n    defaultLoadTreeParams = {\r\n        parameters : {\r\n            text: '<?php echo htmlentities($this->getRoot()->get{{EntityNameMagicCode}}()) ?>',\r\n            draggable   : false,\r\n            allowDrop   : true,\r\n            id  : <?php echo (int) $this->getRoot()->getId() ?>,\r\n            expanded: <?php echo (int) $this->getIsWasExpanded() ?>,\r\n            {{entity}}_id : <?php echo (int) $this->get{{Entity}}Id() ?>\r\n        },\r\n        data : <?php echo $this->getTreeJson() ?>\r\n    };\r\n    reRenderTree();\r\n});\r\n\r\n    function addNew(url, isRoot) {\r\n        if (isRoot) {\r\n            tree.currentNodeId = tree.root.id;\r\n        }\r\n        url+= 'parent/'+tree.currentNodeId;\r\n        updateContent(url);\r\n    }\r\n    function {{entity}}Move(obj) {\r\n        var data = {id: obj.dropNode.id, form_key: FORM_KEY};\r\n        data.point = obj.point;\r\n        switch (obj.point) {\r\n            case 'above' :\r\n                data.pid = obj.target.parentNode.id;\r\n                data.paid = obj.dropNode.parentNode.id;\r\n                if (obj.target.previousSibling) {\r\n                    data.aid = obj.target.previousSibling.id;\r\n                } else {\r\n                    data.aid = 0;\r\n                }\r\n                break;\r\n            case 'below' :\r\n                data.pid = obj.target.parentNode.id;\r\n                data.aid = obj.target.id;\r\n                break;\r\n            case 'append' :\r\n                data.pid = obj.target.id;\r\n                data.paid = obj.dropNode.parentNode.id;\r\n                if (obj.target.lastChild) {\r\n                    data.aid = obj.target.lastChild.id;\r\n                } else {\r\n                    data.aid = 0;\r\n                }\r\n                break;\r\n            default :\r\n                obj.cancel = true;\r\n                return obj;\r\n        }\r\n        var success = function(o) {\r\n            try {\r\n                if (o.responseText) {\r\n                    if (o.responseText==='SUCCESS') {\r\n                        {{entity}}Form.refreshPath();\r\n                    } else {\r\n                        alert(o.responseText);\r\n                        location.reload();\r\n                    }\r\n                }\r\n            }\r\n            catch(e) {}\r\n        };\r\n        var failure = function(o) {\r\n            try {\r\n                console.log(o.statusText);\r\n            } catch (e2) {\r\n                alert(o.statusText);\r\n            }\r\n            location.reload();\r\n        };\r\n        var pd = [];\r\n        for(var key in data) {\r\n            pd.push(encodeURIComponent(key), \"=\", encodeURIComponent(data[key]), \"&\");\r\n        }\r\n        pd.splice(pd.length-1,1);\r\n        new Ajax.Request(\r\n            '<?php echo $this->getMoveUrl() ?>',\r\n            {\r\n                method: 'POST',\r\n                parameters: pd.join(\"\"),\r\n                onSuccess : success,\r\n                onFailure : failure\r\n            }\r\n        );\r\n    }\r\n//]]>\r\n</script>\r\n<?php endif; ?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/tree/020_eav",
    "content": "<?php\r\n{{License}}\r\n?>\r\n<div class=\"categories-side-col\">\r\n    <div class=\"content-header\">\r\n        <h3 class=\"icon-head head-{{entities}}\">\r\n            <?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}') ?>\r\n        </h3>\r\n        <?php if ($this->getRoot()): ?>\r\n            <?php echo $this->getAddRootButtonHtml() ?><br />\r\n            <?php echo $this->getAddSubButtonHtml() ?>\r\n        <?php endif; ?>\r\n    </div>\r\n    <?php echo $this->getStoreSwitcherHtml();?>\r\n    <div class=\"tree-actions\">\r\n        <?php if ($this->getRoot()): ?>\r\n            <a href=\"#\" onclick=\"tree.collapseTree(); return false;\">\r\n                <?php echo Mage::helper('{{namespace}}_{{module}}')->__('Collapse All'); ?>\r\n            </a>\r\n            <span class=\"separator\">|</span>\r\n            <a href=\"#\" onclick=\"tree.expandTree(); return false;\">\r\n                <?php echo Mage::helper('{{namespace}}_{{module}}')->__('Expand All'); ?>\r\n            </a>\r\n        <?php endif; ?>\r\n    </div>\r\n    <?php if ($this->getRoot()): ?>\r\n        <div class=\"tree-holder\">\r\n            <div id=\"tree-div\" style=\"width:100%; overflow:auto;\"></div>\r\n        </div>\r\n</div>\r\n<script type=\"text/javascript\">\r\n//<![CDATA[\r\n    var tree;\r\n    /**\r\n     * Fix ext compatibility with prototype 1.6\r\n     */\r\n    Ext.lib.Event.getTarget = function(e) {\r\n        var ee = e.browserEvent || e;\r\n        return ee.target ? Event.element(ee) : null;\r\n    };\r\n\r\n    Ext.tree.TreePanel.Enhanced = function(el, config)\r\n    {\r\n        Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);\r\n    };\r\n\r\n    Ext.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {\r\n\r\n        loadTree : function(config, firstLoad)\r\n        {\r\n            var parameters = config['parameters'];\r\n            var data = config['data'];\r\n\r\n            this.storeId = parameters['store_id'];\r\n\r\n            if ( this.storeId != 0 && $('add_root_{{entity}}_button')) {\r\n                $('add_root_{{entity}}_button').hide();\r\n            }\r\n\r\n            if ((typeof parameters['root_visible']) != 'undefined') {\r\n                this.rootVisible = parameters['root_visible']*1;\r\n            }\r\n\r\n            var root = new Ext.tree.TreeNode(parameters);\r\n\r\n            this.nodeHash = {};\r\n            this.setRootNode(root);\r\n\r\n            if (firstLoad) {\r\n                this.addListener('click', this.{{entity}}Click);\r\n                this.addListener('beforenodedrop', {{entity}}Move.createDelegate(this));\r\n            }\r\n\r\n            this.loader.build{{Entity}}Tree(root, data);\r\n            this.el.dom.innerHTML = '';\r\n            // render the tree\r\n            this.render();\r\n            if (parameters['expanded']) {\r\n                this.expandAll();\r\n            } else {\r\n                root.expand();\r\n            }\r\n\r\n            var selectedNode = this.getNodeById(parameters['{{entity}}_id']);\r\n            if (selectedNode) {\r\n                this.currentNodeId = parameters['{{entity}}_id'];\r\n            }\r\n            this.selectCurrentNode();\r\n        },\r\n\r\n        request : function(url, params)\r\n        {\r\n            if (!params) {\r\n                if ({{entity}}_info_tabsJsTabs.activeTab) {\r\n                    var params = {active_tab_id:{{entity}}_info_tabsJsTabs.activeTab.id};\r\n                } else {\r\n                    var params = {};\r\n                }\r\n            }\r\n            if (!params.form_key) {\r\n                params.form_key = FORM_KEY;\r\n            }\r\n            var result = new Ajax.Request(\r\n                url + (url.match(new RegExp('\\\\?')) ? '&isAjax=true' : '?isAjax=true' ),\r\n                {\r\n                   parameters:  params,\r\n                   method:      'post'\r\n                }\r\n            );\r\n\r\n            return result;\r\n        },\r\n\r\n        selectCurrentNode : function()\r\n        {\r\n            if (this.currentNodeId) {\r\n                var selectedNode = this.getNodeById(this.currentNodeId);\r\n                if ((typeof selectedNode.attributes.path)!='undefined') {\r\n                    var path = selectedNode.attributes.path;\r\n                    if (!this.storeId) {\r\n                        path = '0/'+path;\r\n                    }\r\n                    this.selectPath(path);\r\n                } else {\r\n                    this.getSelectionModel().select(selectedNode);\r\n                }\r\n            }\r\n        },\r\n\r\n        collapseTree : function()\r\n        {\r\n            this.collapseAll();\r\n\r\n            this.selectCurrentNode();\r\n\r\n            if (!this.collapsed) {\r\n                this.collapsed = true;\r\n                this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(false) ?>';\r\n                this.request(this.loader.dataUrl, false);\r\n            }\r\n        },\r\n\r\n        expandTree : function()\r\n        {\r\n            this.expandAll();\r\n            if (this.collapsed) {\r\n                this.collapsed = false;\r\n                this.loader.dataUrl = '<?php echo $this->getLoadTreeUrl(true) ?>';\r\n                this.request(this.loader.dataUrl, false);\r\n            }\r\n        },\r\n\r\n        {{entity}}Click : function(node, e)\r\n        {\r\n            var baseUrl = '<?php echo $this->getEditUrl() ?>';\r\n            var urlExt = (this.storeId?'store/'+this.storeId+'/':'')+'id/'+node.id+'/';\r\n            var url = parseSidUrl(baseUrl, urlExt);\r\n\r\n            this.currentNodeId = node.id;\r\n            if (!this.useAjax) {\r\n                setLocation(url);\r\n                return;\r\n            }\r\n            if ({{entity}}_info_tabsJsTabs.activeTab) {\r\n                var params = {active_tab_id:{{entity}}_info_tabsJsTabs.activeTab.id};\r\n            }\r\n            updateContent(url, params);\r\n        }\r\n    });\r\n\r\n    function reRenderTree(event, switcher)\r\n    {\r\n        // re-render tree by store switcher\r\n        if (tree && event) {\r\n            var obj = event.target;\r\n            var newStoreId = obj.value * 1;\r\n            var storeParam = newStoreId ? 'store/'+newStoreId + '/' : '';\r\n\r\n            if (obj.switchParams) {\r\n                storeParam += obj.switchParams;\r\n            }\r\n            if (switcher.useConfirm) {\r\n                if (!confirm(\"<?php echo $this->__('Please confirm site switching. All data that hasn\\'t been saved will be lost.') ?>\")) {\r\n                    obj.value = '<?php echo (int) $this->getStoreId() ?>';\r\n                    return false;\r\n                }\r\n            }\r\n\r\n            if ($('add_root_{{entity}}_button')) {\r\n                if (newStoreId == 0) {\r\n                    $('add_root_{{entity}}_button').show();\r\n                } else {\r\n                    $('add_root_{{entity}}_button').hide();\r\n                }\r\n            }\r\n\r\n            // retain current selected {{entityLabel}} id\r\n            storeParam = storeParam + 'id/' + tree.currentNodeId + '/';\r\n            var url = tree.switchTreeUrl + storeParam;\r\n\r\n            // load from cache\r\n            // load from ajax\r\n            new Ajax.Request(url + (url.match(new RegExp('\\\\?')) ? '&isAjax=true' : '?isAjax=true' ), {\r\n                parameters : {store: newStoreId, form_key: FORM_KEY},\r\n                method     : 'post',\r\n                onComplete : function(transport) {\r\n                    var response = eval('(' + transport.responseText + ')');\r\n                    if (!response['parameters']) {\r\n                        return false;\r\n                    }\r\n\r\n                    _renderNewTree(response, storeParam);\r\n                }\r\n            });\r\n        } else {\r\n            _renderNewTree();\r\n        }\r\n    }\r\n\r\n    function _renderNewTree(config, storeParam)\r\n    {\r\n        if (!config) {\r\n            var config = defaultLoadTreeParams;\r\n        }\r\n        if (tree) {\r\n            tree.purgeListeners();\r\n            tree.el.dom.innerHTML = '';\r\n        }\r\n        tree = new Ext.tree.TreePanel.Enhanced('tree-div', newTreeParams);\r\n        tree.loadTree(config, true);\r\n\r\n        // try to select current {{entityLabel}}\r\n        var selectedNode = tree.getNodeById(config.parameters.{{entity}}_id);\r\n        if (selectedNode) {\r\n            tree.currentNodeId = config.parameters.{{entity}}_id;\r\n        }\r\n        tree.selectCurrentNode();\r\n\r\n        // update content area\r\n        var url = tree.editUrl;\r\n        if (storeParam) {\r\n            url = url + storeParam;\r\n        }\r\n        <?php if ($this->isClearEdit()):?>\r\n        if (selectedNode) {\r\n            url = url + 'id/' + config.parameters.{{entity}}_id;\r\n        }\r\n        <?php endif;?>\r\n        updateContent(url);\r\n    }\r\n\r\n    Ext.onReady(function()\r\n    {\r\n        {{entity}}Loader = new Ext.tree.TreeLoader({\r\n           dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'\r\n        });\r\n\r\n        {{entity}}Loader.createNode = function(config) {\r\n            var node;\r\n            var _node = Object.clone(config);\r\n            if (config.children && !config.children.length) {\r\n                delete(config.children);\r\n                node = new Ext.tree.AsyncTreeNode(config);\r\n            } else {\r\n                node = new Ext.tree.TreeNode(config);\r\n            }\r\n\r\n            return node;\r\n        };\r\n\r\n        {{entity}}Loader.build{{Entity}}Tree = function(parent, config)\r\n        {\r\n            if (!config) return null;\r\n\r\n            if (parent && config && config.length) {\r\n                for (var i = 0; i < config.length; i++) {\r\n                    var node;\r\n                    var _node = Object.clone(config[i]);\r\n                    if (_node.children && !_node.children.length) {\r\n                        delete(_node.children);\r\n                        node = new Ext.tree.AsyncTreeNode(_node);\r\n                    } else {\r\n                        node = new Ext.tree.TreeNode(config[i]);\r\n                    }\r\n                    parent.appendChild(node);\r\n                    node.loader = node.getOwnerTree().loader;\r\n                    if (_node.children) {\r\n                        this.build{{Entity}}Tree(node, _node.children);\r\n                    }\r\n                }\r\n            }\r\n        };\r\n\r\n        {{entity}}Loader.buildHash = function(node)\r\n        {\r\n            var hash = {};\r\n\r\n            hash = this.toArray(node.attributes);\r\n\r\n            if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {\r\n                hash['children'] = new Array;\r\n\r\n                for (var i = 0, len = node.childNodes.length; i < len; i++) {\r\n                    if (!hash['children']) {\r\n                        hash['children'] = new Array;\r\n                    }\r\n                    hash['children'].push(this.buildHash(node.childNodes[i]));\r\n                }\r\n            }\r\n\r\n            return hash;\r\n        };\r\n\r\n        {{entity}}Loader.toArray = function(attributes) {\r\n            var data = {form_key: FORM_KEY};\r\n            for (var key in attributes) {\r\n                var value = attributes[key];\r\n                data[key] = value;\r\n            }\r\n\r\n            return data;\r\n        };\r\n\r\n        {{entity}}Loader.on(\"beforeload\", function(treeLoader, node) {\r\n            treeLoader.baseParams.id = node.attributes.id;\r\n            treeLoader.baseParams.store = node.attributes.store;\r\n            treeLoader.baseParams.form_key = FORM_KEY;\r\n        });\r\n\r\n        {{entity}}Loader.on(\"load\", function(treeLoader, node, config) {\r\n            varienWindowOnload();\r\n        });\r\n\r\n        if ((typeof varienStoreSwitcher)!='undefined') {\r\n            varienStoreSwitcher.storeSelectorClickCallback = reRenderTree;\r\n        }\r\n\r\n        newTreeParams = {\r\n            animate         : false,\r\n            loader          : {{entity}}Loader,\r\n            enableDD        : true,\r\n            containerScroll : true,\r\n            selModel        : new Ext.tree.CheckNodeMultiSelectionModel(),\r\n            rootVisible     : '<?php echo $this->getRoot()->getIsVisible() ?>',\r\n            useAjax         : <?php echo $this->getUseAjax() ?>,\r\n            switchTreeUrl   : '<?php echo $this->getSwitchTreeUrl() ?>',\r\n            editUrl         : '<?php echo $this->getEditUrl() ?>',\r\n            currentNodeId   : <?php echo (int) $this->get{{Entity}}Id() ?>\r\n        };\r\n\r\n        defaultLoadTreeParams = {\r\n            parameters : {\r\n                text        : '<?php echo htmlentities($this->getRoot()->getName()) ?>',\r\n                draggable   : false,\r\n                allowDrop   : <?php if ($this->getRoot()->getIsVisible()): ?>true<?php else : ?>false<?php endif; ?>,\r\n                id          : <?php echo (int) $this->getRoot()->getId() ?>,\r\n                expanded    : <?php echo (int) $this->getIsWasExpanded() ?>,\r\n                store_id    : <?php echo (int) $this->getStore()->getId() ?>,\r\n                {{entity}}_id : <?php echo (int) $this->get{{Entity}}Id() ?>\r\n            },\r\n            data : <?php echo $this->getTreeJson() ?>\r\n        };\r\n\r\n        reRenderTree();\r\n    });\r\n\r\n    function addNew(url, isRoot)\r\n    {\r\n        if (isRoot) {\r\n            tree.currentNodeId = tree.root.id;\r\n        }\r\n\r\n        if (/store\\/\\d+/.test(url)) {\r\n            url = url.replace(/store\\/\\d+/, \"store/\" + tree.storeId);\r\n        } else {\r\n            url+= \"store/\" + tree.storeId + \"/\";\r\n        }\r\n\r\n        url+= 'parent/'+tree.currentNodeId;\r\n        updateContent(url);\r\n    }\r\n\r\n    function {{entity}}Move(obj)\r\n    {\r\n        var data = {id: obj.dropNode.id, form_key: FORM_KEY};\r\n\r\n        data.point = obj.point;\r\n        switch (obj.point) {\r\n            case 'above' :\r\n                data.pid = obj.target.parentNode.id;\r\n                data.paid = obj.dropNode.parentNode.id;\r\n                if (obj.target.previousSibling) {\r\n                    data.aid = obj.target.previousSibling.id;\r\n                } else {\r\n                    data.aid = 0;\r\n                }\r\n                break;\r\n            case 'below' :\r\n                data.pid = obj.target.parentNode.id;\r\n                data.aid = obj.target.id;\r\n            break;\r\n            case 'append' :\r\n                data.pid = obj.target.id;\r\n                data.paid = obj.dropNode.parentNode.id;\r\n                if (obj.target.lastChild) {\r\n                    data.aid = obj.target.lastChild.id;\r\n                } else {\r\n                    data.aid = 0;\r\n                }\r\n            break;\r\n            default :\r\n                obj.cancel = true;\r\n                return obj;\r\n        }\r\n\r\n        var success = function(o) {\r\n            try {\r\n                if (o.responseText) {\r\n                    if (o.responseText==='SUCCESS') {\r\n                        {{entity}}Form.refreshPath();\r\n                    } else {\r\n                        alert(o.responseText);\r\n                        location.reload();\r\n                    }\r\n                }\r\n            } catch(e) { }\r\n        };\r\n\r\n        var failure = function(o) {\r\n            try {\r\n                console.log(o.statusText);\r\n            } catch (e2) {\r\n                alert(o.statusText);\r\n            }\r\n            location.reload();\r\n        };\r\n\r\n        var pd = [];\r\n        for(var key in data) {\r\n            pd.push(encodeURIComponent(key), \"=\", encodeURIComponent(data[key]), \"&\");\r\n        }\r\n        pd.splice(pd.length-1,1);\r\n        new Ajax.Request(\r\n            '<?php echo $this->getMoveUrl() ?>',\r\n            {\r\n                method:     'POST',\r\n                parameters: pd.join(\"\"),\r\n                onSuccess : success,\r\n                onFailure : failure\r\n            }\r\n        );\r\n    }\r\n//]]>\r\n</script>\r\n<?php endif; ?>\r\n\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/entity/widget/tree/010_content",
    "content": "<?php\r\n{{License}}\r\n?>\r\n<?php $_divId = 'tree' . $this->getId() ?>\r\n<div id=\"<?php echo $_divId ?>\" class=\"tree\"></div>\r\n<script type=\"text/javascript\">\r\n//<![CDATA[\r\nvar tree<?php echo $this->getId() ?>;\r\nvar useMassaction = <?php echo $this->getUseMassaction()?1:0; ?>;\r\nExt.tree.TreePanel.Enhanced = function(el, config) {\r\n    Ext.tree.TreePanel.Enhanced.superclass.constructor.call(this, el, config);\r\n};\r\nExt.extend(Ext.tree.TreePanel.Enhanced, Ext.tree.TreePanel, {\r\n    loadTree : function(config, firstLoad) {\r\n        var parameters = config['parameters'];\r\n        var data = config['data'];\r\n        if ((typeof parameters['root_visible']) != 'undefined') {\r\n            this.rootVisible = parameters['root_visible']*1;\r\n        }\r\n        var root = new Ext.tree.TreeNode(parameters);\r\n        this.nodeHash = {};\r\n        this.setRootNode(root);\r\n        if (firstLoad) {\r\n        <?php if ($this->getNodeClickListener()): ?>\r\n            this.addListener('click', <?php echo $this->getNodeClickListener() ?>.createDelegate(this));\r\n        <?php endif; ?>\r\n        }\r\n        this.loader.build{{Entity}}Tree(root, data);\r\n        this.el.dom.innerHTML = '';\r\n        this.render();\r\n    }\r\n});\r\n\r\nExt.onReady(function() {\r\n    var emptyNodeAdded = <?php echo ($this->getWithEmptyNode() ? 'false' : 'true') ?>;\r\n    var {{entity}}Loader = new Ext.tree.TreeLoader({\r\n       dataUrl: '<?php echo $this->getLoadTreeUrl() ?>'\r\n    });\r\n\r\n    {{entity}}Loader.build{{Entity}}Tree = function(parent, config) {\r\n        if (!config) {\r\n            return null;\r\n        }\r\n        if (parent && config && config.length) {\r\n            for (var i = 0; i < config.length; i++) {\r\n                var node;\r\n                if (useMassaction) {\r\n                    config[i].uiProvider = Ext.tree.CheckboxNodeUI;\r\n                }\r\n                var _node = Object.clone(config[i]);\r\n\r\n                if (!emptyNodeAdded) {\r\n                    var empty = Object.clone(_node);\r\n                    empty.text = '<?php echo $this->__('None') ?>';\r\n                    empty.children = [];\r\n                    empty.id = 'none';\r\n                    empty.path = '1/none';\r\n                    empty.cls = 'leaf';\r\n                    parent.appendChild(new Ext.tree.TreeNode(empty));\r\n                    emptyNodeAdded = true;\r\n                }\r\n\r\n                if (_node.children && !_node.children.length) {\r\n                    delete(_node.children);\r\n                    node = new Ext.tree.AsyncTreeNode(_node);\r\n                } else {\r\n                    node = new Ext.tree.TreeNode(config[i]);\r\n                }\r\n                parent.appendChild(node);\r\n                node.loader = node.getOwnerTree().loader;\r\n                node.loader = node.getOwnerTree().loader;\r\n                if (_node.children) {\r\n                    this.build{{Entity}}Tree(node, _node.children);\r\n                }\r\n            }\r\n        }\r\n    };\r\n\r\n    {{entity}}Loader.createNode = function(config) {\r\n        var node;\r\n        if (useMassaction) {\r\n            config.uiProvider = Ext.tree.CheckboxNodeUI;\r\n        }\r\n        var _node = Object.clone(config);\r\n        if (config.children && !config.children.length) {\r\n            delete(config.children);\r\n            node = new Ext.tree.AsyncTreeNode(config);\r\n        } else {\r\n            node = new Ext.tree.TreeNode(config);\r\n        }\r\n        return node;\r\n    };\r\n\r\n    {{entity}}Loader.buildHash = function(node) {\r\n        var hash = {};\r\n\r\n        hash = this.toArray(node.attributes);\r\n\r\n        if (node.childNodes.length>0 || (node.loaded==false && node.loading==false)) {\r\n            hash['children'] = new Array;\r\n\r\n            for (var i = 0, len = node.childNodes.length; i < len; i++) {\r\n                if (!hash['children']) {\r\n                    hash['children'] = new Array;\r\n                }\r\n                hash['children'].push(this.buildHash(node.childNodes[i]));\r\n            }\r\n        }\r\n\r\n        return hash;\r\n    };\r\n\r\n    {{entity}}Loader.toArray = function(attributes) {\r\n        var data = {};\r\n        for (var key in attributes) {\r\n            var value = attributes[key];\r\n            data[key] = value;\r\n        }\r\n        return data;\r\n    };\r\n\r\n    {{entity}}Loader.on(\"beforeload\", function(treeLoader, node) {\r\n        treeLoader.baseParams.id = node.attributes.id;\r\n    });\r\n\r\n    tree<?php echo $this->getId() ?> = new Ext.tree.TreePanel.Enhanced('<?php echo $_divId ?>', {\r\n        animate:  false,\r\n        loader:   {{entity}}Loader,\r\n        enableDD: false,\r\n        containerScroll:  true,\r\n        rootVisible:  '<?php echo $this->getRoot()->getIsVisible() ?>',\r\n        useAjax:  true,\r\n        currentNodeId:<?php echo (int) $this->get{{Entity}}Id() ?>,\r\n        addNodeTo:false\r\n    });\r\n\r\n    if (useMassaction) {\r\n        tree<?php echo $this->getId() ?>.on('check', function(node) {\r\n            $('<?php echo $_divId; ?>').fire('node:changed', {node:node});\r\n        }, tree<?php echo $this->getId() ?>);\r\n    }\r\n\r\n    // set the root node\r\n    var parameters = {\r\n        text:'Psw',\r\n        draggable:   false,\r\n        id: <?php echo (int) $this->getRoot()->getId() ?>,\r\n        expanded:   <?php echo (int) $this->getIsWasExpanded() ?>,\r\n        {{entity}}_id:     <?php echo (int) $this->get{{Entity}}Id() ?>\r\n    };\r\n\r\n    tree<?php echo $this->getId() ?>.loadTree({parameters:parameters, data:<?php echo $this->getTreeJson() ?>},true);\r\n\r\n});\r\n//]]>\r\n</script>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/form/renderer/fieldset/element/010_content",
    "content": "<?php\r\n{{License}}\r\n?>\r\n<?php $_element = $this->getElement() ?>\r\n<?php $this->checkFieldDisable() ?>\r\n\r\n<?php if ($_element->getType()=='hidden'): ?>\r\n<tr>\r\n    <td class=\"hidden\" colspan=\"100\"><?php echo trim($_element->getElementHtml()) ?></td>\r\n</tr>\r\n<?php else: ?>\r\n<tr>\r\n    <td class=\"label\"><?php echo trim($this->getElementLabelHtml()) ?></td>\r\n    <td class=\"value\">\r\n        <?php echo trim($this->getElementHtml()) ?>\r\n        <?php if ($_element->getNote()) : ?>\r\n            <p class=\"note\"><?php echo $_element->getNote() ?></p>\r\n        <?php endif; ?>\r\n    </td>\r\n    <td class=\"scope-label\"><span class=\"nobr\"><?php echo $this->getScopeLabel() ?></span></td>\r\n    <?php if ($this->canDisplayUseDefault()): ?>\r\n    <td class=\"value use-default\">\r\n        <input <?php if ($_element->getReadonly()):?> disabled=\"disabled\"<?php endif; ?> type=\"checkbox\" name=\"use_default[]\" id=\"<?php echo $_element->getHtmlId() ?>_default\"<?php if ($this->usedDefault()): ?> checked=\"checked\"<?php endif; ?> onclick=\"toggleValueElements(this, this.parentNode.parentNode)\" value=\"<?php echo $this->getAttributeCode() ?>\"/>\r\n        <label for=\"<?php echo $_element->getHtmlId() ?>_default\" class=\"normal\"><?php echo Mage::helper('{{namespace}}_{{module}}')->__('Use Default Value') ?></label>\r\n    </td>\r\n    <?php endif; ?>\r\n</tr>\r\n<?php endif; ?>"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/adminhtml/template/namespace_module/grid/010_content",
    "content": "<?php\r\n{{License}}\r\n?>\r\n<div class=\"content-header\">\r\n<table cellspacing=\"0\">\r\n    <tr>\r\n        <td style=\"width:50%;\"><h3 class=\"icon-head <?php echo $this->getHeadClass();?>\"><?php echo $this->getHeaderText(); ?></h3></td>\r\n        <td class=\"a-right\">\r\n            <?php echo $this->getButtonsHtml() ?>\r\n        </td>\r\n    </tr>\r\n</table>\r\n</div>\r\n<?php if ( !Mage::app()->isSingleStoreMode() ): ?>\r\n    <?php echo $this->getChildHtml('store_switcher');?>\r\n<?php endif;?>\r\n<div>\r\n    <?php echo $this->getGridHtml() ?>\r\n</div>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/010_top",
    "content": "<?xml version=\"1.0\"?>\r\n{{License}}\r\n<layout>{{defaultLayoutHandle}}\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/020_comment",
    "content": "    <customer_account>\r\n        <reference name=\"customer_account_navigation\">{{customerCommentLinks}}        </reference>\r\n    </customer_account>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/060_list",
    "content": "    <{{namespace}}_{{module}}_{{entity}}_index translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n        <label>{{EntitiesLabel}} list</label>\r\n        <update handle=\"page_{{listLayout}}\" />\r\n{{referenceHead}}<reference name=\"content\">\r\n            <block type=\"{{namespace}}_{{module}}/{{entity}}_list\" name=\"{{entity}}_list\" template=\"{{namespace}}_{{module}}/{{entity}}/list.phtml\" />\r\n        </reference>\r\n    </{{namespace}}_{{module}}_{{entity}}_index>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/070_view",
    "content": "    <{{namespace}}_{{module}}_{{entity}}_view translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n        <label>{{EntityLabel}} view page</label>\r\n        <update handle=\"page_{{viewLayout}}\" />\r\n{{referenceHead}}<reference name=\"content\">\r\n            <block type=\"{{namespace}}_{{module}}/{{entity}}_view\" name=\"{{entity}}_view\" template=\"{{namespace}}_{{module}}/{{entity}}/view.phtml\" />\r\n{{EntityViewRelationLayout}}</reference>\r\n    </{{namespace}}_{{module}}_{{entity}}_view>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/080_entity_rss",
    "content": "    <{{namespace}}_{{module}}_{{entity}}_rss translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n        <label>{{EntitiesLabel}} rss feed</label>\r\n        <block type=\"{{namespace}}_{{module}}/{{entity}}_rss\" output=\"toHtml\" name=\"{{namespace}}_{{module}}.{{entity}}.rss\" />\r\n    </{{namespace}}_{{module}}_{{entity}}_rss>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/090_rss_top",
    "content": "    <rss_index_index>\r\n        <reference name=\"content\">\r\n            <block type=\"{{namespace}}_{{module}}/rss\" name=\"{{module}}.rss\" template=\"{{namespace}}_{{module}}/rss.phtml\">\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/100_rss",
    "content": "                <action method=\"addFeed\" ifconfig=\"{{namespace}}_{{module}}/{{entity}}/rss\" translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n                    <label>{{EntitiesLabel}}</label>\r\n                    <url helper=\"{{namespace}}_{{module}}/{{entity}}/getRssUrl\" />\r\n                </action>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/110_rss_footer",
    "content": "            </block>\r\n        </reference>\r\n    </rss_index_index>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/120_relation_product",
    "content": "    <catalog_product_view>\r\n        <reference name=\"product.info\">\r\n{{productViewLayout}}        </reference>\r\n    </catalog_product_view>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/130_relation_category",
    "content": "    <{{namespace}}_{{module}}_category>\r\n        <reference name=\"content\">\r\n{{categoryViewLayout}}        </reference>\r\n    </{{namespace}}_{{module}}_category>\r\n    <catalog_category_default>\r\n        <update handle=\"{{namespace}}_{{module}}_category\" />\r\n    </catalog_category_default>\r\n    <catalog_category_layered>\r\n        <update handle=\"{{namespace}}_{{module}}_category\" />\r\n    </catalog_category_layered>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/135_entity_comment",
    "content": "    <{{namespace}}_{{module}}_{{entity}}_customer_comment_index translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n        <label>My {{EntitiesLabel}} comments</label>\r\n        <update handle=\"customer_account\"/>\r\n        <reference name=\"my.account.wrapper\">\r\n            <block type=\"{{namespace}}_{{module}}/{{entity}}_customer_comment_list\" name=\"customer_{{entity}}_comments\" template=\"{{namespace}}_{{module}}/{{entity}}/customer/comment/list.phtml\"/>\r\n        </reference>\r\n    </{{namespace}}_{{module}}_{{entity}}_customer_comment_index>\r\n    <{{namespace}}_{{module}}_{{entity}}_customer_comment_view translate=\"label\" module=\"{{namespace}}_{{module}}\">\r\n        <label>My {{EntitiesLabel}} comment view</label>\r\n        <update handle=\"customer_account\"/>\r\n        <reference name=\"my.account.wrapper\">\r\n            <block type=\"{{namespace}}_{{module}}/{{entity}}_customer_comment_view\" name=\"customer_{{entity}}_comment\" template=\"{{namespace}}_{{module}}/{{entity}}/customer/comment/view.phtml\"/>\r\n        </reference>\r\n    </{{namespace}}_{{module}}_{{entity}}_customer_comment_view>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/layout/namespace_module/140_footer",
    "content": "</layout>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/catalog/category/list/entity/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} list template on product page\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php ${{entities}} = $this->get{{Entity}}Collection();?>\r\n<?php if (${{entities}} && ${{entities}}->count() > 0) :?>\r\n<div class=\"box-collateral box-{{entities}} box-up-sell\">\r\n    <h2>{{EntitiesLabel}}</h2>\r\n    <?php foreach (${{entities}} as $_{{entity}}) : ?>\r\n        <div class=\"item\">\r\n{{entityHtmlLink}}\r\n        </div>\r\n    <?php endforeach; ?>\r\n</div>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/catalog/product/list/entity/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} list template on product page\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php ${{entities}} = $this->get{{Entity}}Collection();?>\r\n<?php if (${{entities}} && ${{entities}}->count() > 0) :?>\r\n<div class=\"box-collateral box-{{entities}} box-up-sell\">\r\n    <?php foreach (${{entities}} as $_{{entity}}) : ?>\r\n        <div class=\"item\">\r\n{{entityHtmlLink}}\r\n        </div>\r\n    <?php endforeach; ?>\r\n</div>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/catalog/category/list/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} category list template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $categories = $this->getCategoryCollection();?>\r\n<?php if ($categories->count() > 0) :?>\r\n<h2><?php echo Mage::helper('catalog')->__('Categories');?></h2>\r\n<div class=\"box-collateral box-products box-up-sell\">\r\n    <?php foreach ($categories as $category) : ?>\r\n        <div class=\"item\">\r\n            <a href=\"<?php echo $category->getUrl()?>\">\r\n                <?php echo $category->getName();?>\r\n            </a><br />\r\n        </div>\r\n    <?php endforeach; ?>\r\n</div>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/catalog/product/list/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} product list template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $products = $this->getProductCollection();?>\r\n<?php if ($products->count() > 0) :?>\r\n<h2><?php echo Mage::helper('catalog')->__('Products');?></h2>\r\n<div class=\"box-collateral box-products box-up-sell\">\r\n    <?php foreach ($products as $product) : ?>\r\n        <div class=\"item\">\r\n            <a href=\"<?php echo $product->getProductUrl()?>\">\r\n                <?php echo $product->getName();?><br />\r\n            </a>\r\n        </div>\r\n    <?php endforeach; ?>\r\n</div>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/child/list/010_content",
    "content": "<?php \r\n{{License}}\r\n/**\r\n * {{Entity}} {{SiblingLabel}} list template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_{{siblings}} = $this->get{{Siblings}}(); ?>\r\n<?php if ($_{{siblings}}->getSize() > 0) :?>\r\n<div class=\"{{sibling}}-title\">\r\n    <h2><?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{SiblingsLabel}}') ?></h2>\r\n</div>\r\n<div class=\"{{siblings}}-list-container\">\r\n    <?php foreach ($_{{siblings}} as $_{{sibling}}) : ?>\r\n        <div class=\"{{sibling}}-list-item\">\r\n{{SiblingListItem}}\r\n        </div>\r\n    <?php endforeach;?>\r\n</div>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/children/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} children list template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_{{entities}} = $this->get{{Entities}}(); ?>\r\n<?php if ($_{{entities}}->getSize() > 0) :?>\r\n    <div class=\"page-title {{entity}}-title\">\r\n        <h2><?php echo $this->getCurrent{{Entity}}()->get{{EntityNameMagicCode}}(); ?>:<?php echo $this->__('Children')?></h2>\r\n    </div>\r\n    <?php if ($this->_getDisplayMode() == 0) : ?>\r\n        <div class=\"{{entity}}-list-container\">\r\n            <?php foreach ($_{{entities}} as $_{{entity}}) : ?>\r\n                <div class=\"{{entity}}-list-item\">\r\n                    <a href=\"<?php echo $_{{entity}}->get{{Entity}}Url();?>\" title=\"<?php echo $this->escapeHtml($_{{entity}}->get{{EntityNameMagicCode}}()) ?>\">\r\n                        <?php echo $_{{entity}}->get{{EntityNameMagicCode}}(); ?>\r\n                    </a>\r\n                </div>\r\n            <?php endforeach;?>\r\n        </div>\r\n    <?php else : ?>\r\n        <ul id=\"{{entities}}-list\">\r\n            <?php foreach ($_{{entities}} as $_{{entity}}) : ?>\r\n                <?php echo $this->draw{{Entity}}($_{{entity}});?>\r\n            <?php endforeach;?>\r\n        </ul>\r\n        <script type=\"text/javascript\">\r\n            {{module}}Tree('{{entities}}-list');\r\n        </script>\r\n    <?php endif;?>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/comment/form/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} comments form template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $data = $this->getCommentData();?>\r\n<div class=\"form-add\">\r\n    <h2><?php echo $this->__('Write Your Comment') ?></h2>\r\n    <?php if ($this->getAllowWriteCommentFlag()): ?>\r\n        <form action=\"<?php echo $this->getAction() ?>\" method=\"post\" id=\"comment-form\">\r\n            <fieldset>\r\n                <ul class=\"form-list\">\r\n                    <li>\r\n                        <label for=\"nickname_field\" class=\"required\"><em>*</em><?php echo $this->__('Nickname') ?></label>\r\n                        <div class=\"input-box\">\r\n                            <input type=\"text\" name=\"name\" id=\"name_field\" class=\"input-text required-entry\" value=\"<?php echo $this->escapeHtml($data->getName()) ?>\" />\r\n                        </div>\r\n                    </li>\r\n                    <li>\r\n                        <label for=\"nickname_field\" class=\"required\"><em>*</em><?php echo $this->__('E-mail') ?></label>\r\n                        <div class=\"input-box\">\r\n                            <input type=\"text\" name=\"email\" id=\"email_field\" class=\"input-text required-entry validate-email\" value=\"<?php echo $this->escapeHtml($data->getEmail()) ?>\" />\r\n                        </div>\r\n                    </li>\r\n                    <li>\r\n                        <label for=\"title_field\" class=\"required\"><em>*</em><?php echo $this->__('Comment title') ?></label>\r\n                        <div class=\"input-box\">\r\n                            <input type=\"text\" name=\"title\" id=\"title_field\" class=\"input-text required-entry\" value=\"<?php echo $this->escapeHtml($data->getTitle()) ?>\" />\r\n                        </div>\r\n                    </li>\r\n                    <li>\r\n                        <label for=\"review_field\" class=\"required\"><em>*</em><?php echo $this->__('Comment') ?></label>\r\n                        <div class=\"input-box\">\r\n                            <textarea name=\"comment\" id=\"comment_field\" cols=\"5\" rows=\"3\" class=\"required-entry\"><?php echo $this->escapeHtml($data->getComment()) ?></textarea>\r\n                        </div>\r\n                    </li>\r\n                </ul>\r\n            </fieldset>\r\n            <div class=\"buttons-set\">\r\n                <button type=\"submit\" title=\"<?php echo $this->__('Submit Comment') ?>\" class=\"button\"><span><span><?php echo $this->__('Submit Comment') ?></span></span></button>\r\n            </div>\r\n        </form>\r\n        <script type=\"text/javascript\">var commentForm = new VarienForm('comment-form');</script>\r\n    <?php else: ?>\r\n    <p class=\"review-nologged\" id=\"comment-form\">\r\n        <?php echo $this->__('Only registered users can write comments. Please, <a href=\"%s\">log in</a> or <a href=\"%s\">register</a>', $this->getLoginLink(), Mage::helper('customer')->getRegisterUrl()) ?>\r\n    </p>\r\n    <?php endif ?>\r\n</div>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/comment/list/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} comments list template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_{{entity}} = $this->get{{Entity}}()?>\r\n<?php if ($_{{entity}}->getAllowComments()) : ?>\r\n    <?php $_comments = $this->getComments(); ?>\r\n    <?php if (count($_comments)) : ?>\r\n        <div class=\"box-collateral box-reviews\" id=\"{{entity}}-reviews\">\r\n            <h2><?php echo $this->__('Comments for: %s', $_{{entity}}->get{{EntityNameMagicCode}}()) ?></h2>\r\n            <?php echo $this->getPagerHtml() ?>\r\n            <dl>\r\n                <?php foreach ($_comments as $_comment):?>\r\n                <dt>\r\n                    <div class=\"author\"><?php echo $this->__('On %s %s wrote:', $this->formatDate($_comment->getCreatedAt(), 'long'), $this->escapeHtml($_comment->getName()))?></div>\r\n                    <strong><?php echo $this->escapeHtml($_comment->getTitle()) ?></strong>\r\n                </dt>\r\n                <dd>\r\n                    <?php echo nl2br($this->escapeHtml($_comment->getComment())) ?>\r\n                </dd>\r\n                <?php endforeach; ?>\r\n            </dl>\r\n            <?php echo $this->getPagerHtml() ?>\r\n        </div>\r\n    <?php endif;?>\r\n    <?php echo $this->getChildHtml('comment_form') ?>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/customer/comment/list/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * customer {{EntitiesLabel}} comments template\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>\r\n<div class=\"page-title\">\r\n    <h1><?php echo $this->__('My {{EntitiesLabel}} Comments') ?></h1>\r\n</div>\r\n<?php if ( $this->getCollection() && $this->count()): ?>\r\n    <?php echo $this->getToolbarHtml() ?>\r\n    <table class=\"data-table\" id=\"my-{{entity}}-comments-table\">\r\n        <col width=\"1\" />\r\n        <col width=\"1\" />\r\n        <col />\r\n        <col width=\"1\" />\r\n        <tbody>\r\n            <?php foreach ($this->getCollection() as $_comment): ?>\r\n            <tr>\r\n                <td><span class=\"nobr\"><?php echo $this->dateFormat($_comment->getCtCreatedAt()); ?></span></td>\r\n                <td><h2 class=\"product-name\"><a href=\"<?php echo $this->get{{Entity}}Link($_comment) ?>\"><?php echo $this->escapeHtml($_comment->get{{EntityNameMagicCode}}()) ?></a></h2></td>\r\n                <td><?php echo Mage::helper('core')->escapeHtml($_comment->getCtTitle()) ?></td>\r\n                <td><a href=\"<?php echo $this->getCommentLink($_comment) ?>\" class=\"nobr\"><?php echo $this->__('View Details') ?></a></td>\r\n            </tr>\r\n            <?php endforeach; ?>\r\n        </tbody>\r\n    </table>\r\n    <script type=\"text/javascript\">decorateTable('my-{{entity}}-comments-table')</script>\r\n    <?php echo $this->getToolbarHtml() ?>\r\n<?php else: ?>\r\n    <p><?php echo $this->__('You have submitted no comments for {{entitiesLabel}}.') ?></p>\r\n<?php endif; ?>\r\n<div class=\"buttons-set\">\r\n    <p class=\"back-link\"><a href=\"<?php echo $this->escapeUrl($this->getBackUrl()) ?>\"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>\r\n</div>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/customer/comment/view/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * customer {{EntitiesLabel}} comments view\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>\r\n<div class=\"page-title\">\r\n    <h1><?php echo $this->getComment()->getTitle() ?></h1>\r\n</div>\r\n<div class=\"comment-view\">\r\n    <h2>\r\n        <a class=\"product-name\" href=\"<?php echo $this->get{{Entity}}()->get{{Entity}}Url()?>\">\r\n            <?php echo $this->get{{Entity}}()->get{{EntityNameMagicCode}}()?>\r\n        </a>\r\n    </h2>\r\n    <div class=\"comment-date\">\r\n        <?php echo $this->__('On %s you wrote:', $this->formatDate($this->getComment()->getCreatedAt(), Mage_Core_Model_Locale::FORMAT_TYPE_FULL))?>\r\n    </div>\r\n    <div>\r\n        <?php echo Mage::helper('core')->escapeHtml($this->getComment()->getComment());?>\r\n    </div>\r\n    <div class=\"buttons-set\">\r\n        <p class=\"back-link\"><a href=\"<?php echo $this->escapeUrl($this->getBackUrl()) ?>\"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>\r\n    </div>\r\n</div>"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/list/010_top",
    "content": "<?php \r\n{{License}}\r\n/**\r\n * {{EntityLabel}} list template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>\r\n<?php $_{{entities}} = $this->get{{Entities}}(); ?>\r\n<div class=\"page-title {{entity}}-title\">\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/list/020_rss_link",
    "content": "    <?php if (Mage::helper('{{namespace}}_{{module}}/{{entity}}')->isRssEnabled()) : ?>\r\n        <a href=\"<?php echo Mage::helper('{{namespace}}_{{module}}/{{entity}}')->getRssUrl();?>\" class=\"link-rss\"><?php echo Mage::helper('{{namespace}}_{{module}}')->__('Subscribe to RSS Feed')?></a>\r\n    <?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/list/030_footer",
    "content": "    <h1><?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}') ?></h1>\r\n</div>\r\n<?php if ($_{{entities}}->getSize() > 0) :?>\r\n    <?php echo $this->getPagerHtml(); ?>\r\n    <div class=\"{{entity}}-list-container\">\r\n    <?php foreach ($_{{entities}} as $_{{entity}}) : ?>\r\n        <div class=\"{{entity}}-list-item\">\r\n{{entityHtmlLink}}\r\n        </div>\r\n    <?php endforeach;?>\r\n    </div>\r\n    <?php echo $this->getPagerHtml(); ?>\r\n<?php else : ?>\r\n    <?php echo Mage::helper('{{namespace}}_{{module}}')->__('There are no {{entitiesLabel}} at this moment');?>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/list/040_footer_is_tree",
    "content": "    <h1><?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{EntitiesLabel}}') ?></h1>\r\n</div>\r\n<?php if ($_{{entities}}->getSize() > 0) :?>\r\n    <?php if ($this->_getDisplayMode() == 0) : ?>\r\n        <?php echo $this->getPagerHtml(); ?>\r\n        <div class=\"{{entity}}-list-container\">\r\n            <?php foreach ($_{{entities}} as $_{{entity}}) : ?>\r\n                <div class=\"{{entity}}-list-item\">\r\n{{entityHtmlLink}}\r\n                </div>\r\n            <?php endforeach;?>\r\n        </div>\r\n        <?php echo $this->getPagerHtml(); ?>\r\n    <?php else : ?>\r\n        <ul id=\"{{entities}}-list\">\r\n            <?php foreach ($_{{entities}} as $_{{entity}}) : ?>\r\n                <?php echo $this->draw{{Entity}}($_{{entity}});?>\r\n            <?php endforeach;?>\r\n        </ul>\r\n        <script type=\"text/javascript\">\r\n            {{module}}Tree('{{entities}}-list');\r\n        </script>\r\n    <?php endif;?>\r\n<?php else : ?>\r\n    <?php echo Mage::helper('{{namespace}}_{{module}}')->__('There are no {{entitiesLabel}} at this moment');?>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/sibling/list/010_content",
    "content": "<?php \r\n{{License}}\r\n/**\r\n * {{Entity}} {{SiblingLabel}} list template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_{{siblings}} = $this->get{{Siblings}}(); ?>\r\n<?php if ($_{{siblings}}->getSize() > 0) :?>\r\n<div class=\"page-title {{sibling}}-title\">\r\n    <h2><?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{SiblingsLabel}}') ?></h2>\r\n</div>\r\n<div class=\"{{siblings}}-list-container\">\r\n    <?php foreach ($_{{siblings}} as $_{{sibling}}) : ?>\r\n        <div class=\"{{sibling}}-list-item\">\r\n{{SiblingListItem}}\r\n        </div>\r\n    <?php endforeach;?>\r\n</div>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/view/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} view template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_{{entity}} = $this->getCurrent{{Entity}}();?>\r\n<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>\r\n<div class=\"page-title {{entity}}-title\">\r\n    <h1><?php echo $_{{entity}}->get{{EntityNameMagicCode}}(); ?></h1>\r\n</div>\r\n<div class=\"{{entity}}-view\">\r\n{{EntityViewAttributes}}\r\n</div>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/widget/link/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} link widget template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_{{entity}} = $this->getCurrent{{Entity}}();?>\r\n<?php if ($_{{entity}}) :?>\r\n    <div class=\"{{entity}}-widget-link\">\r\n        <a href=\"<?php echo $_{{entity}}->get{{Entity}}Url()?>\"><?php echo $_{{entity}}->get{{EntityNameMagicCode}}()?></a>\r\n    </div>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/widget/subtree/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} subtree template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_{{entities}} = $this->get{{Entities}}(); ?>\r\n<?php if ($_{{entities}}->getSize() > 0) :?>\r\n    <script type=\"text/javascript\" src=\"<?php echo $this->getSkinUrl('js/{{namespace}}_{{module}}/tree.js')?>\"></script>\r\n    <ul id=\"<?php echo $this->getUniqueId()?>\">\r\n        <?php foreach ($_{{entities}} as $_{{entity}}) : ?>\r\n            <?php echo $this->draw{{Entity}}($_{{entity}});?>\r\n        <?php endforeach;?>\r\n    </ul>\r\n    <script type=\"text/javascript\">\r\n        {{module}}Tree('<?php echo $this->getUniqueId()?>');\r\n    </script>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/entity/widget/view/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{EntityLabel}} view widget template\r\n *\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_{{entity}} = $this->getCurrent{{Entity}}();?>\r\n<?php if ($_{{entity}}) :?>\r\n    <div class=\"{{entity}}-widget-view\">\r\n        <h3><?php echo $_{{entity}}->get{{EntityNameMagicCode}}()?></h3>\r\n        <div>\r\n{{EntityViewWidgetAttributes}}\r\n        </div>\r\n    </div>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/design/frontend/template/namespace_module/rss/010_content",
    "content": "<?php\r\n{{License}}\r\n/**\r\n * {{module}} rss feeds block\r\n * @category    {{Namespace}}\r\n * @package     {{Namespace}}_{{Module}}\r\n * {{qwertyuiopp}}\r\n */\r\n?>\r\n<?php $_feeds = $this->getFeeds();?>\r\n<?php if ($_feeds): ?>\r\n<table class=\"data-table rss-table\" id=\"rss-table-{{module}}\" style=\"margin-top:20px\">\r\n    <col />\r\n    <col width=\"1\" />\r\n    <thead>\r\n        <tr>\r\n            <th colspan=\"2\"><?php echo Mage::helper('{{namespace}}_{{module}}')->__('{{Module}} Feeds') ?></th>\r\n        </tr>\r\n    </thead>\r\n    <tbody>\r\n        <?php foreach ($_feeds as $_feed): ?>\r\n        <tr>\r\n            <td><?php echo $_feed->getLabel() ?></td>\r\n            <td><a href=\"<?php echo $_feed->getUrl() ?>\" class=\"link-rss\"><?php echo Mage::helper('{{namespace}}_{{module}}')->__('Get Feed'); ?></a></td>\r\n        </tr>\r\n        <?php endforeach; ?>\r\n    </tbody>\r\n</table>\r\n<?php endif; ?>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/etc/modules/Namespace_Module/010_content",
    "content": "<?xml version=\"1.0\"?>\r\n{{License}}\r\n<config>\r\n    <modules>\r\n        <{{Namespace}}_{{Module}}>\r\n            <active>true</active>\r\n            <codePool>{{codepool}}</codePool>\r\n            <depends>\r\n{{depends}}             </depends>\r\n        </{{Namespace}}_{{Module}}>\r\n    </modules>\r\n</config>\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/010_global",
    "content": "\"Yes\",\"Yes\"\r\n\"No\",\"No\"\r\n\"Save And Continue Edit\",\"Save And Continue Edit\"\r\n\"Id\",\"Id\"\r\n\"Action\",\"Action\"\r\n\"Edit\",\"Edit\"\r\n\"CSV\",\"CSV\"\r\n\"Excel\",\"Excel\"\r\n\"XML\",\"XML\"\r\n\"Delete\",\"Delete\"\r\n\"Are you sure?\",\"Are you sure?\"\r\n\"Home\",\"Home\"\r\n\"None\",\"None\"\r\n\"Store views\",\"Store views\"\r\n\"Status\",\"Status\"\r\n\"Enabled\",\"Enabled\"\r\n\"Disabled\",\"Disabled\"\r\n\"Change status\",\"Change status\"\r\n\"Reset\",\"Reset\"\r\n\"Created at\",\"Created at\"\r\n\"Updated at\",\"Updated at\"\r\n\"Total of %d record(s) have been deleted.\",\"Total of %d record(s) have been deleted.\"\r\n\"Total of %d record(s) have been updated.\",\"Total of %d record(s) have been updated.\"\r\n\"Home\",\"Home\"\r\n\"WYSIWYG Editor\",\"WYSIWYG Editor\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/020_entity",
    "content": "\"{{EntityLabel}}\",\"{{EntityLabel}}\"\r\n\"Save {{EntityLabel}}\",\"Save {{EntityLabel}}\"\r\n\"Delete {{EntityLabel}}\",\"Delete {{EntityLabel}}\"\r\n\"Edit {{EntityLabel}} '%s'\",\"Edit {{EntityLabel}} '%s'\"\r\n\"Add {{EntityLabel}}\",\"Add {{EntityLabel}}\"\r\n\"{{EntitiesLabel}}\",\"{{EntitiesLabel}}\"\r\n\"This {{entityLabel}} no longer exists.\",\"This {{entityLabel}} no longer exists.\"\r\n\"{{EntityLabel}} was successfully saved\",\"{{EntityLabel}} was successfully saved\"\r\n\"There was a problem saving the {{entityLabel}}.\",\"There was a problem saving the {{entityLabel}}.\"\r\n\"Unable to find {{entityLabel}} to save.\",\"Unable to find {{entityLabel}} to save.\"\r\n\"{{EntityLabel}} was successfully deleted.\",\"{{EntityLabel}} was successfully deleted.\"\r\n\"There was an error deleting {{entityLabel}}.\",\"There was an error deleting {{entityLabel}}.\"\r\n\"Could not find {{entityLabel}} to delete.\",\"Could not find {{entityLabel}} to delete.\"\r\n\"Please select {{entitiesLabel}} to delete.\",\"Please select {{entitiesLabel}} to delete.\"\r\n\"Total of %d {{entitiesLabel}} were successfully deleted.\",\"Total of %d {{entitiesLabel}} were successfully deleted.\"\r\n\"There was an error deleting {{entitiesLabel}}.\",\"There was an error deleting {{entitiesLabel}}.\"\r\n\"Total of %d {{entitiesLabel}} were successfully updated.\",\"Total of %d {{entitiesLabel}} were successfully updated.\"\r\n\"There was an error updating {{entitiesLabel}}.\",\"There was an error updating {{entitiesLabel}}.\"\r\n\"Please select {{entitiesLabel}}.\",\"Please select {{entitiesLabel}}.\"\r\n\"{{nameAttributeLabel}}\",\"{{nameAttributeLabel}}\"\r\n\"{{EntityLabel}} was saved\",\"{{EntityLabel}} was saved\"\r\n\"Error saving {{entityLabel}}\",\"Error saving {{entityLabel}}\"\r\n\"The {{entitiesLabel}} has been deleted.\",\"The {{entitiesLabel}} has been deleted.\"\r\n\"An error occurred while updating the {{entitiesLabel}}.\",\"An error occurred while updating the {{entitiesLabel}}.\"\r\n\"There was an error deleting {{entitiesLabel}}.\",\"There was an error deleting {{entitiesLabel}}.\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/030_attribute",
    "content": "\"{{attributeLabel}}\",\"{{attributeLabel}}\"\r\n\"{{attributeNote}}\",\"{{attributeNote}}\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/040_rss",
    "content": "\"Show in rss\",\"Show in rss\"\r\n\"Enable rss\",\"Enable rss\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/050_seo",
    "content": "\"Meta-title\",\"Meta-title\"\r\n\"Meta-description\",\"Meta-description\"\r\n\"Meta-keywords\",\"Meta-keywords\"\r\n\"Meta information\",\"Meta information\"\r\n\"Meta\",\"Meta\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/060_attribute_yesno",
    "content": "\"Change {{attributeLabel}}\",\"Change {{attributeLabel}}\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/070_file",
    "content": "\"Delete File\",\"Delete File\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/080_product_relation",
    "content": "\"Associated products\",\"Associated products\"\r\n\"Position\",\"Position\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/090_category_relation",
    "content": "\"Associated categories\",\"Associated categories\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/100_relations",
    "content": "\"Position\",\"Position\"\r\n\"Change {{SiblingLabel}}\",\"Change {{SiblingLabel}}\"\r\n\" - Edit\",\" - Edit\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/110_tree",
    "content": "\"Collapse All\",\"Collapse All\"\r\n\"Expand All\",\"Expand All\"\r\n\"ID: %s\",\"ID: %s\"\r\n\"Display as tree\",\"Display as tree\"\r\n\"Root\",\"Root\"\r\n\"Levels to show (0 for all)\",\"Levels to show (0 for all)\"\r\n\"Recursion level\",\"Recursion level\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/120_tree_entity",
    "content": "\"New Root {{EntityLabel}}\",\"New Root {{EntityLabel}}\"\r\n\"Add Child {{EntityLabel}}\",\"Add Child {{EntityLabel}}\"\r\n\"Add Root {{EntityLabel}}\",\"Add Root {{EntityLabel}}\"\r\n\"New {{EntityLabel}}\",\"New {{EntityLabel}}\"\r\n\"Manage {{EntitiesLabel}}\",\"Manage {{EntitiesLabel}}\"\r\n\"{{EntityLabel}} move error\",\"{{EntityLabel}} move error\"\r\n\"An error occurred while trying to delete the {{entityLabel}}.\",\"An error occurred while trying to delete the {{entityLabel}}.\"\r\n\"The {{entityLabel}} has been saved.\",\"The {{entityLabel}} has been saved.\"\r\n\"{{EntityLabel}} move operation is not possible: the new parent {{entityLabel}} was not found.\",\"{{EntityLabel}} move operation is not possible: the new parent {{entityLabel}} was not found.\"\r\n\"{{EntityLabel}} move operation is not possible: the current {{entityLabel}} was not found.\",\"{{EntityLabel}} move operation is not possible: the current {{entityLabel}} was not found.\"\r\n\"{{EntityLabel}} move operation is not possible: parent {{entityLabel}} is equal to child {{entityLabel}}.\",\"{{EntityLabel}} move operation is not possible: parent {{entityLabel}} is equal to child {{entityLabel}}.\"\r\n\"Can't delete root {{entityLabel}}.\",\"Can't delete root {{entityLabel}}.\"\r\n\"{{EntityLabel}} subtree\",\"{{EntityLabel}} subtree\"\r\n\"{{EntityLabel}} subtree widget\",\"{{EntityLabel}} subtree widget\"\r\n\"Select {{EntityLabel}}\",\"Select {{EntityLabel}}\"\r\n\"{{EntityLabel}} move operation is not possible: the new parent {{entityLabel}} was not found.\",\"{{EntityLabel}} move operation is not possible: the new parent {{entityLabel}} was not found.\"\r\n\"{{EntityLabel}} move operation is not possible: the current {{entityLabel}} was not found.\",\"{{EntityLabel}} move operation is not possible: the current {{entityLabel}} was not found.\"\r\n\"{{EntityLabel}} move operation is not possible: parent {{entityLabel}} is equal to child {{entityLabel}}.\",\"{{EntityLabel}} move operation is not possible: parent {{entityLabel}} is equal to child {{entityLabel}}.\"\r\n\"Can't delete root {{entityLabel}}.\",\"Can't delete root {{entityLabel}}.\"\r\n\"An error occurred while trying to delete the {{entityLabel}}.\",\"An error occurred while trying to delete the {{entityLabel}}.\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/130_url_rewrite",
    "content": "\"Relative to Website Base URL\",\"Relative to Website Base URL\"\r\n\"URL key already exists.\",\"URL key already exists.\"\r\n\"The URL key contains capital letters or disallowed symbols.\",\"The URL key contains capital letters or disallowed symbols.\"\r\n\"URL key\",\"URL key\"\r\n\"The URL key cannot consist only of numbers.\",\"The URL key cannot consist only of numbers.\"\r\n\"URL prefix\",\"URL prefix\"\r\n\"Leave empty for no prefix\",\"Leave empty for no prefix\"\r\n\"What goes after the dot. Leave empty for no suffix.\",\"What goes after the dot. Leave empty for no suffix.\"\r\n\"URL suffix\",\"URL suffix\"\r\n\"URL key for list page\",\"URL key for list page\"\r\n\"Leave empty to use default URL module/controller/action\",\"Leave empty to use default URL module/controller/action\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/140_api",
    "content": "\"List\",\"List\"\r\n\"Info\",\"Info\"\r\n\"Add\",\"Add\"\r\n\"Update\",\"Update\"\r\n\"Remove\",\"Remove\"\r\n\"Data cannot be null\",\"Data cannot be null\"\r\n\"Product does not exist.\",\"Product does not exist.\"\r\n\"Provided data is invalid.\",\"Provided data is invalid.\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/150_api_entity",
    "content": "\"{{EntityLabel}} API\",\"{{EntityLabel}} API\"\r\n\"Retrieve list of {{entitiesLabel}}\",\"Retrieve list of {{entitiesLabel}}\"\r\n\"Retrieve {{entity}} info\",\"Retrieve {{entity}} info\"\r\n\"Add {{entityLabel}}\",\"Add {{entityLabel}}\"\r\n\"Update {{entityLabel}}\",\"Update {{entityLabel}}\"\r\n\"Remove {{entityLabel}}\",\"Remove {{entityLabel}}\"\r\n\"Requested {{entityLabel}} does not exist.\",\"Requested {{entityLabel}} does not exist.\"\r\n\"Error while saving {{entityLabel}}. Details in error message.\",\"Error while saving {{entityLabel}}. Details in error message.\"\r\n\"Error while removing {{entityLabel}}. Details in error message.\",\"Error while removing {{entityLabel}}. Details in error message.\"\r\n\"{{EntityLabel}}\",\"{{EntityLabel}}\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/160_api_product_related",
    "content": "\"Product does not exist.\",\"Product does not exist.\"\r\n\"Remove product from {{entityLabel}}\",\"Remove product from {{entityLabel}}\"\r\n\"Assign product to {{entityLabel}}\",\"Assign product to {{entityLabel}}\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/170_api_category_related",
    "content": "\"Category does not exist.\",\"Category does not exist.\"\r\n\"Remove category from {{entityLabel}}\",\"Remove category from {{entityLabel}}\"\r\n\"Assign category to {{entityLabel}}\",\"Assign category to {{entityLabel}}\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/180_api_tree",
    "content": "\"Retrieve one level of {{entitiesLabel}}\",\"Retrieve one level of {{entitiesLabel}}\"\r\n\"Move {{entityLabel}} in tree\",\"Move {{entityLabel}} in tree\"\r\n\"Cannot move parent inside {{entityLabel}}\",\"Cannot move parent inside {{entityLabel}}\"\r\n\"{{EntityLabel}} not moved. Details in error message.\",\"{{EntityLabel}} not moved. Details in error message.\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/190_api_sibling",
    "content": "\"Assign {{siblingLabel}} to {{entityLabel}}\",\"Assign {{siblingLabel}} to {{entityLabel}}\"\r\n\"Remove {{siblingLabel}} from {{entityLabel}}\",\"Remove {{siblingLabel}} from {{entityLabel}}\"\r\n\"{{SiblingLabel}} does not exist.\",\"{{SiblingLabel}} does not exist.\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/200_entity_eav",
    "content": "\"Manage {{EntityLabel}} Attributes\",\"Manage {{EntityLabel}} Attributes\"\r\n\"Add New {{EntityLabel}} Attribute\",\"Add New {{EntityLabel}} Attribute\"\r\n\"Save {{EntityLabel}} Attribute\",\"Save {{EntityLabel}} Attribute\"\r\n\"Delete {{EntityLabel}} Attribute\",\"Delete {{EntityLabel}} Attribute\"\r\n\"Edit {{EntityLabel}} Attribute \"\"%s\"\"\",\"Edit {{EntityLabel}} Attribute \"\"%s\"\"\"\r\n\"Edit {{EntityLabel}} Attribute\",\"Edit {{EntityLabel}} Attribute\"\r\n\"New {{EntityLabel}} Attribute\",\"New {{EntityLabel}} Attribute\"\r\n\"{{EntityLabel}} Information\",\"{{EntityLabel}} Information\"\r\n\"This {{entityLabel}} attribute no longer exists\",\"This {{entityLabel}} attribute no longer exists\"\r\n\"This {{entityLabel}} attribute cannot be edited.\",\"This {{entityLabel}} attribute cannot be edited.\"\r\n\"The {{entityLabel}} attribute has been saved.\",\"The {{entityLabel}} attribute has been saved.\"\r\n\"The {{entityLabel}} attribute has been deleted.\",\"The {{entityLabel}} attribute has been deleted.\"\r\n\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/210_eav",
    "content": "\"Image\",\"Image\"\r\n\"File\",\"File\"\r\n\"Store View\",\"Store View\"\r\n\"Website\",\"Website\"\r\n\"Global\",\"Global\"\r\n\"Scope\",\"Scope\"\r\n\"Declare attribute value saving scope\",\"Declare attribute value saving scope\"\r\n\"Position\",\"Position\"\r\n\"Position in the admin form\",\"Position in the admin form\"\r\n\"Frontend Properties\",\"Frontend Properties\"\r\n\"Enable WYSIWYG\",\"Enable WYSIWYG\"\r\n\"Attribute Information\",\"Attribute Information\"\r\n\"Properties\",\"Properties\"\r\n\"Manage Label / Options\",\"Manage Label / Options\"\r\n\"[GLOBAL]\",\"[GLOBAL]\"\r\n\"[WEBSITE]\",\"[WEBSITE]\"\r\n\"[STORE VIEW]\",\"[STORE VIEW]\"\r\n\"Attributes\",\"Attributes\"\r\n\"Manage Attributes\",\"Manage Attributes\"\r\n\"Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.\",\"Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.\"\r\n\"This attribute no longer exists\",\"This attribute no longer exists\"\r\n\"This attribute cannot be updated.\",\"This attribute cannot be updated.\"\r\n\"This attribute cannot be deleted.\",\"This attribute cannot be deleted.\"\r\n\"Unable to find an attribute to delete.\",\"Unable to find an attribute to delete.\"\r\n\"Default Values\",\"Default Values\"\r\n\"Attribute \"\"%s\"\" is required.\",\"Attribute \"\"%s\"\" is required.\"\r\n\"This attribute is not deletable\",\"This attribute is not deletable\"\r\n\"Text to appear below the input.\",\"Text to appear below the input.\"\r\n\"Note\",\"Note\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/220_entity_comment",
    "content": "\"{{EntityLabel}} Comments\",\"{{EntityLabel}} Comments\"\r\n\"Save {{EntityLabel}} comment\",\"Save {{EntityLabel}} comment\"\r\n\"Delete {{EntityLabel}} comment\",\"Delete {{EntityLabel}} comment\"\r\n\"Edit {{EntityLabel}} comment '%s'\",\"Edit {{EntityLabel}} comment '%s'\"\r\n\"{{EntityLabel}} Comment\",\"{{EntityLabel}} Comment\"\r\n\"{{EntityLabel}} comment\",\"{{EntityLabel}} comment\"\r\n\"This {{entityLabel}} does not allow comments\",\"This {{entityLabel}} does not allow comments\"\r\n\"My {{EntityLabel}} Comments\",\"My {{EntityLabel}} Comments\"\r\n\"You have submitted no comments for {{entitiesLabel}}.\",\"You have submitted no comments for {{entitiesLabel}}.\"\r\n\"My {{EntitiesLabel}} comment view\",\"My {{EntitiesLabel}} comment view\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/230_comment",
    "content": "\"Comment\",\"Comment\"\r\n\"Comments\",\"Comments\"\r\n\"Title\",\"Title\"\r\n\"Status\",\"Status\"\r\n\"Pending\",\"Pending\"\r\n\"Approved\",\"Approved\"\r\n\"Rejected\",\"Rejected\"\r\n\"Poster name\",\"Poster name\"\r\n\"Customer profile\",\"Customer profile\"\r\n\"Poster e-mail\",\"Poster e-mail\"\r\n\"Allow Comments\",\"Allow Comments\"\r\n\"Allow guest comments\",\"Allow guest comments\"\r\n\"This comment no longer exists.\",\"This comment no longer exists.\"\r\n\"Comment was successfully saved\",\"Comment was successfully saved\"\r\n\"There was a problem saving the comment.\",\"There was a problem saving the comment.\"\r\n\"Unable to find comment to save.\",\"Unable to find comment to save.\"\r\n\"Comment was successfully deleted.\",\"Comment was successfully deleted.\"\r\n\"There was an error deleting the comment.\",\"There was an error deleting the comment.\"\r\n\"Could not find comment to delete.\",\"Could not find comment to delete.\"\r\n\"Please select comments to delete.\",\"Please select comments to delete.\"\r\n\"Total of %d comments were successfully deleted.\",\"Total of %d comments were successfully deleted.\"\r\n\"There was an error deleting comments.\",\"There was an error deleting comments.\"\r\n\"Please select comments.\",\"Please select comments.\"\r\n\"Total of %d comments were successfully updated.\",\"Total of %d comments were successfully updated.\"\r\n\"There was an error updating comments.\",\"There was an error updating comments.\"\r\n\"Your comment has been accepted for moderation.\",\"Your comment has been accepted for moderation.\"\r\n\"Unable to post the comment.\",\"Unable to post the comment.\"\r\n\"Guest comments are not allowed\",\"Guest comments are not allowed\"\r\n\"Use default config\",\"Use default config\"\r\n\"Comment title can't be empty\",\"Comment title can't be empty\"\r\n\"Your name can't be empty\",\"Your name can't be empty\"\r\n\"Comment can't be empty\",\"Comment can't be empty\"\r\n\"View Details\",\"View Details\"\r\n\"On %s you wrote:\",\"On %s you wrote:\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/240_comment_store",
    "content": "\"Store views\",\"Store views\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/250_api_comment",
    "content": "\"Update {{EntityLabel}} Status\",\"Update {{EntityLabel}} Status\"\r\n\"List\",\"List\"\r\n\"Update status\",\"Update status\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/260_eav_api",
    "content": "\"Set/Get current store view\",\"Set/Get current store view\"\r\n\"Retrieve attribute list\",\"Retrieve attribute list\"\r\n\"Retrieve attribute options\",\"Retrieve attribute options\"\r\n\"Get list of possible attribute types\",\"Get list of possible attribute types\"\r\n\"Create new attribute\",\"Create new attribute\"\r\n\"Update attribute\",\"Update attribute\"\r\n\"Delete attribute\",\"Delete attribute\"\r\n\"Get full information about attribute with list of options\",\"Get full information about attribute with list of options\"\r\n\"Add option\",\"Add option\"\r\n\"Remove option\",\"Remove option\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/270_frontend",
    "content": "\"Use Breadcrumbs\",\"Use Breadcrumbs\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/280_entity_seo",
    "content": "\"Meta title for {{entitiesLabel}} list page\",\"Meta title for {{entitiesLabel}} list page\"\r\n\"Meta description for {{entitiesLabel}} list page\",\"Meta description for {{entitiesLabel}} list page\"\r\n\"Meta keywords for {{entitiesLabel}} list page\",\"Meta keywords for {{entitiesLabel}} list page\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/290_rest",
    "content": "\"{{Module}}\",\"{{Module}}\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/300_rest_entity",
    "content": "\"{{Entity}}\",\"{{Entity}}\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/app/locale/310_parent",
    "content": "\"View {#name}\",\"View {#name}\"\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/skin/css/namespace_module/tree/010_content",
    "content": "{{License}}\r\n.tree,.tree ul,.tree li{list-style:none;margin:0;padding:0;}\r\n.tree{background:url(../../images/{{namespace}}_{{module}}/line1.png) repeat-y;}\r\n.tree li{line-height:20px;margin-top:1px;position:relative;width:100%;}\r\n* html .tree li{float:left;display:inline;}\r\n.tree li a{padding-left:28px;}\r\n.tree li span{cursor:auto;float:left;font-size:0;height:13px;left:5px;position:absolute;top:5px;width:13px;}\r\n.tree li span,.tree li span.collapsed{background:url(../../images/{{namespace}}_{{module}}/collapsed.png) no-repeat 0 0;}\r\n.tree li span.expanded{background:url(../../images/{{namespace}}_{{module}}/expanded.png) no-repeat 0 0;}\r\n.tree li ul{margin-left:28px;background:url(../../images/{{namespace}}_{{module}}/line1.png) repeat-y;}\r\n.tree li li{background:url(../../images/{{namespace}}_{{module}}/line2.png) no-repeat 0 0;}\r\n.tree:after,.tree ul:after{clear:both;content:\".\";display:block;height:0;visibility:hidden;}\r\n.tree,.tree ul{display:block;}\r\n.tree li.map-category{font-weight:bold;}\r\n.tree li.map-product{font-weight:normal;}\r\n.tree li.map-product a{color:#203548;}\r\n/* \\*/ .tree,.tree ul{min-height:1%;}\r\n* html .tree,* html .tree ul{height:1%;}\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/source/skin/js/namespace_module/tree/010_content",
    "content": "{{License}}\r\nfunction {{module}}Tree(treeId) {\r\n    var tree = $(treeId);\r\n    if (tree) {\r\n        tree.addClassName('tree');\r\n        tree.select('ul').each(function(list) {\r\n            $(list).hide();\r\n        })\r\n        tree.select('li').each(function(item) {\r\n            var children = $(item).childElements().grep(new Selector('ul'));\r\n            if (children.length > 0) {\r\n                var span = new Element('span').addClassName('collapsed');\r\n                span.observe('click', function(el) {\r\n                    if ($(this).hasClassName('collapsed')) {\r\n                        this.addClassName('expanded');\r\n                        this.removeClassName('collapsed');\r\n                        $(item).childElements().grep(new Selector('ul')).each(function(list) {\r\n                            $(list).show();\r\n                        });\r\n                    } else {\r\n                        this.removeClassName('expanded');\r\n                        this.addClassName('collapsed');\r\n                        $(item).childElements().grep(new Selector('ul')).each(function(list) {\r\n                            $(list).hide();\r\n                        });\r\n                    }\r\n                });\r\n                $(item).insert({top:span});\r\n            }\r\n        });\r\n    };\r\n};\r\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/system.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n/**\n* Ultimate_ModuleCreator extension\n*\n* NOTICE OF LICENSE\n*\n* This source file is subject to the MIT License\n* that is bundled with this package in the file LICENSE_UMC.txt.\n* It is also available through the world-wide-web at this URL:\n* http://opensource.org/licenses/mit-license.php\n*\n* @category       Ultimate\n* @package        Ultimate_ModuleCreator\n* @copyright      Copyright (c) 2014\n* @license        http://opensource.org/licenses/mit-license.php MIT License\n* @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n*/\n-->\n<config>\n    <tabs>\n        <umc translate=\"label\" module=\"modulecreator\">\n            <label>Ultimate Module Creator</label>\n            <sort_order>500</sort_order>\n        </umc>\n    </tabs>\n    <sections>\n        <modulecreator translate=\"label\" module=\"modulecreator\">\n            <class>separator-top</class>\n            <label>Ultimate Module Creator</label>\n            <tab>umc</tab>\n            <frontend_type>text</frontend_type>\n            <sort_order>100</sort_order>\n            <show_in_default>1</show_in_default>\n            <show_in_website>0</show_in_website>\n            <show_in_store>0</show_in_store>\n            <groups>\n                <general translate=\"label\" module=\"modulecreator\">\n                    <label>General settings</label>\n                    <sort_order>5</sort_order>\n                    <show_in_default>1</show_in_default>\n                    <show_in_website>0</show_in_website>\n                    <show_in_store>0</show_in_store>\n                    <fields>\n                        <help translate=\"title comment\" module=\"modulecreator\">\n                            <label>Enable help tab</label>\n                            <frontend_type>select</frontend_type>\n                            <source_model>adminhtml/system_config_source_yesno</source_model>\n                            <sort_order>10</sort_order>\n                            <show_in_default>1</show_in_default>\n                            <show_in_website>0</show_in_website>\n                            <show_in_store>0</show_in_store>\n                            <comment>After you get the hang of it you can disable the help tab to make it a little faster.</comment>\n                        </help>\n                        <tooltips translate=\"title comment\" module=\"modulecreator\">\n                            <label>Show field tooltips</label>\n                            <frontend_type>select</frontend_type>\n                            <source_model>adminhtml/system_config_source_yesno</source_model>\n                            <sort_order>15</sort_order>\n                            <show_in_default>1</show_in_default>\n                            <show_in_website>0</show_in_website>\n                            <show_in_store>0</show_in_store>\n                            <comment>After you get the hang of it you can disable the field tooltips to make it a little faster.</comment>\n                        </tooltips>\n                        <collapsed translate=\"title\" module=\"modulecreator\">\n                            <label>Show entity fieldsets expanded</label>\n                            <frontend_type>select</frontend_type>\n                            <source_model>adminhtml/system_config_source_yesno</source_model>\n                            <sort_order>20</sort_order>\n                            <show_in_default>1</show_in_default>\n                            <show_in_website>0</show_in_website>\n                            <show_in_store>0</show_in_store>\n                        </collapsed>\n                    </fields>\n                </general>\n                <settings translate=\"label\" module=\"modulecreator\">\n                    <label>Default module settings</label>\n                    <frontend_model>modulecreator/adminhtml_modulecreator_system_config_form_fieldset_settings</frontend_model>\n                    <sort_order>10</sort_order>\n                    <show_in_default>1</show_in_default>\n                    <show_in_website>0</show_in_website>\n                    <show_in_store>0</show_in_store>\n                </settings>\n                <entity translate=\"label\" module=\"modulecreator\">\n                    <label>Default entity settings</label>\n                    <frontend_model>modulecreator/adminhtml_modulecreator_system_config_form_fieldset_entity</frontend_model>\n                    <sort_order>20</sort_order>\n                    <show_in_default>1</show_in_default>\n                    <show_in_website>0</show_in_website>\n                    <show_in_store>0</show_in_store>\n                </entity>\n                <attribute translate=\"label\" module=\"modulecreator\">\n                    <label>Default attribute settings</label>\n                    <frontend_model>modulecreator/adminhtml_modulecreator_system_config_form_fieldset_attribute</frontend_model>\n                    <sort_order>30</sort_order>\n                    <show_in_default>1</show_in_default>\n                    <show_in_website>0</show_in_website>\n                    <show_in_store>0</show_in_store>\n                </attribute>\n            </groups>\n        </modulecreator>\n    </sections>\n</config>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/umc.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n/**\n* Ultimate_ModuleCreator extension\n*\n* NOTICE OF LICENSE\n*\n* This source file is subject to the MIT License\n* that is bundled with this package in the file LICENSE_UMC.txt.\n* It is also available through the world-wide-web at this URL:\n* http://opensource.org/licenses/mit-license.php\n*\n* @category       Ultimate\n* @package        Ultimate_ModuleCreator\n* @copyright      Copyright (c) 2014\n* @license        http://opensource.org/licenses/mit-license.php MIT License\n* @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n*/\n-->\n<config>\n    <forms>\n        <settings>\n            <fieldsets>\n                <settings translate=\"label description\" module=\"modulecreator\">\n                    <label>General Information</label>\n                    <description>This tab allows you to fill in the general data about your module</description>\n                    <fields>\n                        <namespace translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Namespace</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>10</position>\n                            <system>1</system>\n                            <class>umc-validate-class-name</class>\n                            <tooltip>This is the folder name of your new extension. Your company name should go here. Use only letters and numbers. Start with a capital letter.</tooltip>\n                        </namespace>\n                        <module_name translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Module name</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>20</position>\n                            <class>umc-validate-class-name</class>\n                            <tooltip><![CDATA[This is your extension/module name. It should be something meaningful and not very long.<br />Try to use a noun in singular form. Start with a capital letter.]]></tooltip>\n                            <additional>For security reasons, to avoid module name collisions with the Magento core you cannot name a module just like an existing one even in a different namespace: \"Catalog\", \"Sales\", \"Checkout\"...</additional>\n                        </module_name>\n                        <codepool translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Code pool</label>\n                            <type>select</type>\n                            <source>modulecreator/source_codepool</source>\n                            <required>1</required>\n                            <position>25</position>\n                            <system>1</system>\n                            <tooltip><![CDATA[This is the code folder in which your extension will be installed. If you don't know what goes here, choose \"local\"]]></tooltip>\n                        </codepool>\n                        <install translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Action</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <source>modulecreator/source_install</source>\n                            <position>30</position>\n                            <system>1</system>\n                            <tooltip><![CDATA[This allows you to directly install the module you create on the current Magento instance, or create a zip with it and install it later.]]></tooltip>\n                            <additional><![CDATA[<span class=\"label label-warning\">Warning:</span>The zip is not compatible with Magento Connect. It's just a simple archive with the files of the module.<br />If you choose to install the module directly no file will be overwritten. If by a human error or UMC error a file should be overwritten then the 'Action' is changed to 'Create an archive. I will install it later.' and you will be notified of the files that were not overwritten.]]></additional>\n                        </install>\n                        <version translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Version</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>35</position>\n                            <system>1</system>\n                            <tooltip><![CDATA[This is the version of the module.]]></tooltip>\n                        </version>\n                        <menu_text translate=\"label tooltip note\" module=\"modulecreator\">\n                            <label>Admin menu title</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>40</position>\n                            <tooltip>This is the title that will be added to the menu.</tooltip>\n                        </menu_text>\n                        <menu_parent translate=\"label tooltip note\" module=\"modulecreator\">\n                            <label>Admin parent menu ID</label>\n                            <type>text</type>\n                            <code>menu</code>\n                            <required>0</required>\n                            <position>50</position>\n                            <readonly>1</readonly>\n                            <class>menu-parent-id</class>\n                            <tooltip>This is the parent menu id of the module menu. Leave empty to add in top menu.</tooltip>\n                            <note><![CDATA[<a href=\"#\">Select menu parent and position</a>]]></note>\n                        </menu_parent>\n                        <sort_order  translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Admin menu sort order</label>\n                            <type>text</type>\n                            <code>sort_order</code>\n                            <required>1</required>\n                            <position>60</position>\n                            <class>menu-sort-order</class>\n                            <readonly>1</readonly>\n                            <tooltip>This is the sort order in the menu.</tooltip>\n                            <note><![CDATA[<a href=\"#\">Select menu parent and position</a>]]></note>\n                        </sort_order>\n                        <system_tab translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>System -&gt; Configuration tab name</label>\n                            <type>text</type>\n                            <code>system_tab</code>\n                            <required>0</required>\n                            <position>70</position>\n                            <system>0</system>\n                            <tooltip><![CDATA[If at least one entity has frontend files then a section in System->Configuration will be created. Fill in the tab name here. Leave empty to use the namespace.]]></tooltip>\n                        </system_tab>\n                        <system_tab_position translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>System -&gt; Configuration tab position</label>\n                            <type>text</type>\n                            <code>system_tab</code>\n                            <required>0</required>\n                            <position>70</position>\n                            <system>1</system>\n                            <tooltip><![CDATA[If at least one entity has frontend files then a section in System->Configuration will be created. Fill in the tab position. The higher the number the lower it will appear in the list.]]></tooltip>\n                        </system_tab_position>\n                        <license translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>License</label>\n                            <type>textarea</type>\n                            <code>license</code>\n                            <required>0</required>\n                            <position>70</position>\n                            <system>1</system>\n                            <tooltip><![CDATA[The text you put here will be added at the top of (almost) each file in the module you create.<br />Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} as placeholder for current year.<br />If you don't want any License text on your files just leave this field empty.]]></tooltip>\n                        </license>\n                        <front_key translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Frontend key</label>\n                            <type>text</type>\n                            <code>front_key</code>\n                            <required>0</required>\n                            <position>80</position>\n                            <system>0</system>\n                            <tooltip><![CDATA[This is the route name of your module. It's the first part of the URL. ('module/controller/action'). This is what goes instead of 'module'. Useful only if you have frontend listing or viewing for at least one entity. Leave empty to use default value 'namespace_module'.]]></tooltip>\n                        </front_key>\n                    </fields>\n                </settings>\n            </fieldsets>\n        </settings>\n        <entity>\n            <fieldsets>\n                <name translate=\"label description\" module=\"modulecreator\">\n                    <label>Name settings</label>\n                    <description>Settings regarding the entity name and code</description>\n                    <collapsable>1</collapsable>\n                    <fields>\n                        <label_singular translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Label singular</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <class>label-singular</class>\n                            <position>10</position>\n                            <tooltip><![CDATA[Each entity must have a label used for buttons, links, messages.<br />This is the singular form of the label. For example in a blog module, the post entity will have the label in singular form 'Post']]></tooltip>\n                            <additional><![CDATA[<span class=\"label label-info\">Info:</span>Try to use English words for this label. It's not mandatory, but it makes the taxonomy more readable. UMC will create a language file for the modules it generates and you can translate your module.<br /><span class=\"label label-info\">Info:</span>I recommend the first letter to be uppercase.]]></additional>\n                        </label_singular>\n                        <label_plural translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Label plural</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>20</position>\n                            <tooltip>This is the plural form of the label above. It will be used for lists. (For example: 'Posts')</tooltip>\n                            <additional><![CDATA[<span class=\"label label-info\">Info:</span>Try to use English words for this label. It's not mandatory, but it makes the taxonomy more readable. UMC will create a language file for the modules it generates and you can translate your module.<br /><span class=\"label label-info\">Info:</span>I recommend the first letter to be uppercase.]]></additional>\n                        </label_plural>\n                        <name_singular translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Entity code singular</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <class>validate-alphanum validate-code</class>\n                            <position>30</position>\n                            <tooltip><![CDATA[UMC generates the code in a 'human readable' form. It's easier to figure out what the code is about when the variables and methods have a propper name.<br />For example it's easier to read foreach ($_posts as $_post){...} or $_post->getTags() than foreach ($_list as $_item){...} or $_entity->getRelated('tags');<br />The value you fill in here will be used for variable names, file names and table names.]]></tooltip>\n                            <additional><![CDATA[<span class=\"label label-info\">Info:</span>Use only letters. No numbers, no underscores, all in lowercase.<br /><span class=\"label label-info\">Info:</span>:There are some restrictions to these values, because there are reserved strings that might make the code not function properly. For example: 'resource', 'setup'. For a complete list of restrictions see Ultimate_ModuleCreator_Helper_Data::$_restrictedEntityNames]]></additional>\n                        </name_singular>\n                        <name_plural translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Entity code plural</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <class>validate-alphanum validate-code</class>\n                            <position>40</position>\n                            <tooltip><![CDATA[This is the plural value of the entity code. For example 'posts'.]]></tooltip>\n                            <additional><![CDATA[<span class=\"label label-info\">Info:</span>Use only letters. No numbers, no underscores, all in lowercase.]]></additional>\n                        </name_plural>\n                    </fields>\n                </name>\n\n                <backend translate=\"label description\" module=\"modulecreator\">\n                    <label>Backend settings</label>\n                    <description>Backend settings for you entity</description>\n                    <collapsable>1</collapsable>\n                    <fields>\n                        <type translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Entity type</label>\n                            <type>select</type>\n                            <source>modulecreator/source_entity_type</source>\n                            <required>1</required>\n                            <position>10</position>\n                            <class>type</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[There are 2 types of entities in Magento <a href=\"http://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model\" target=\"_blank\">EAV</a> and Flat (all fields in one table). Choose yours]]></tooltip>\n                        </type>\n                        <is_tree translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Behaves as tree</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>20</position>\n                            <class>is_tree</class>\n                            <system>1</system>\n                            <tooltip>If this is set to 'Yes' then your entity will behave as the default Magento categories. It will have the same UI as the categories module have. The fields 'parent_id', 'position' 'children_count' &amp; 'level' will be added automatically to the entity.</tooltip>\n                        </is_tree>\n                        <store translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Enable by stores</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>25</position>\n                            <class>store-specific</class>\n                            <system>1</system>\n                            <tooltip>If this is set to 'Yes' it will allow you to assign your entity to specific store views (just like pages or static block).</tooltip>\n                        </store>\n                        <add_created_to_grid translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Add \"Created at\" to admin grid</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>30</position>\n                            <class>use-not-tree</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[The entities created with UMC will have a field called 'created_at' with the creation date of any entity instance.<br />If this is set to 'Yes' the 'Created at' field will be added to the admin grid.]]></tooltip>\n                        </add_created_to_grid>\n                        <add_updated_to_grid translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Add \"Updated at\" to admin grid</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>40</position>\n                            <class>use-not-tree</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[The entities created with UMC will have a field called 'updated_at' with the last update date of any entity instance.<br />If this is set to 'Yes' the 'Updated at' field will be added to the admin grid.]]></tooltip>\n                        </add_updated_to_grid>\n                        <search translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Include in admin global search</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>50</position>\n                            <class>use-not-tree</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[The Magento admin Global search (at the top of every admin page) searches for the text you enter in products, customers and orders.<br />If you set this to 'Yes' than it will search in your entity also.]]></tooltip>\n                        </search>\n                        <api translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Create SOAP API</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>60</position>\n                            <system>1</system>\n                            <tooltip><![CDATA[Magento offers a SOAP API for managing products, categories, orders and other entities.<br />If this is set to 'Yes', then your entity will also be available for managing through the SOAP API.<br />It generates the classes and xml files needed for API V1, API V2 and API V2 with WSI compliance.]]></tooltip>\n                        </api>\n                        <rest translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Create REST API</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>60</position>\n                            <system>1</system>\n                            <tooltip><![CDATA[Magento offers a REST API for managing products, categories and other entities.<br />If this is set to 'Yes', then your entity will also be available for managing through the REST API.<br />It generates the classes and xml files needed.]]></tooltip>\n                        </rest>\n                    </fields>\n                </backend>\n\n                <frontend translate=\"label description\" module=\"modulecreator\">\n                    <label>Frontend</label>\n                    <description>Frontend settings for your entity</description>\n                    <collapsable>1</collapsable>\n                    <fields>\n                        <create_frontend translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Create frontend files</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>10</position>\n                            <class>create-frontend</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes' then the frontend files of your entity will be created.<br />If this is set to 'No', all the other fields in this section will not be available.]]></tooltip>\n                        </create_frontend>\n                        <create_list translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Create entity list files</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>20</position>\n                            <class>create-list use-frontend</class>\n                            <system>1</system>\n                            <tooltip>If this is set to 'Yes', a link will be added to the footer to a page where your entity instances will be listed. The page has a toolbar for pagination, and it will list the titles of the entity instances.</tooltip>\n                        </create_list>\n                        <list_template translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>List page template</label>\n                            <type>select</type>\n                            <source>modulecreator/source_entity_layout</source>\n                            <required>1</required>\n                            <position>30</position>\n                            <class>use-frontend use-create-list</class>\n                            <system>1</system>\n                            <tooltip>From this dropdown you can select the layout of your entity list page from the available page formats.</tooltip>\n                            <additional><![CDATA[All the Magento page layouts are listed here: 1column, 2columns-left, ....<br />If you have any other page layout it will appear here.]]></additional>\n                        </list_template>\n                        <list_menu translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Add link to list in menu</label>\n                            <type>select</type>\n                            <source>modulecreator/source_entity_menu</source>\n                            <required>0</required>\n                            <position>35</position>\n                            <class>use-frontend use-create-list</class>\n                            <system>1</system>\n                            <tooltip>Select the menu where you want to add the link to your entities. It may not work on very custom themes.</tooltip>\n                        </list_menu>\n                        <create_view translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Create entity view files</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>40</position>\n                            <class>create-view use-frontend</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', the files needed for the page details of your entity are created.]]></tooltip>\n                        </create_view>\n                        <view_template translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>View page template</label>\n                            <type>select</type>\n                            <source>modulecreator/source_entity_layout</source>\n                            <required>1</required>\n                            <position>50</position>\n                            <class>use-frontend use-create-view</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[From this dropdown you can select the layout of your entity view page from the available page formats.]]></tooltip>\n                            <additional><![CDATA[All the Magento page layouts are listed here: 1column, 2columns-left, ....<br />If you have any other page layout it will appear here.]]></additional>\n                        </view_template>\n                        <add_seo translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Add SEO attributes</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>60</position>\n                            <class>use-frontend use-create-view</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', 3 extra fields/attributes will be added to your entity, 'meta_title', 'meta_keywords' and 'meta_description'. The values of these fields/attributes will be added used for the details page of your entity.]]></tooltip>\n                        </add_seo>\n                        <url_rewrite translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Create URL rewrites</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>70</position>\n                            <class>use-frontend use-create-view url-rewrite</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If you set this to 'Yes', a new field will be added to your entity called 'url_key'.<br />This will allow you to use SEF url's for your entity view pages. Example: http://mysite.com/some-key-here.html]]></tooltip>\n                            <additional><![CDATA[If is set to 'No' your entity view page will be accessed in the default way http://mysite.com/module/controller/action/id/7<br /><span class=\"label label-warning\">warning</span>This field is available only if 'Create entity view page' is set to 'Yes'.]]></additional>\n                        </url_rewrite>\n                        <url_rewrite_list translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>List page url rewrite</label>\n                            <type>text</type>\n                            <required>0</required>\n                            <position>71</position>\n                            <class>use-frontend use-create-list use-url-rewrite</class>\n                            <system>0</system>\n                            <tooltip><![CDATA[Fill in here the url for the list page. Leave empty to use 'module/entity/index'. It can later be changed from the config section.]]></tooltip>\n                        </url_rewrite_list>\n                        <url_prefix translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>URL prefix</label>\n                            <type>text</type>\n                            <required>0</required>\n                            <position>73</position>\n                            <class>use-frontend use-create-view use-url-rewrite</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[This is the prefix of your url. Example 'news', 'articles'. Leave empty for no prefix.]]></tooltip>\n                        </url_prefix>\n                        <url_suffix translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>URL suffix</label>\n                            <type>text</type>\n                            <required>0</required>\n                            <position>77</position>\n                            <class>use-frontend use-create-view use-url-rewrite</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[This is the suffix of your url. Example 'html', 'htm'. Don't add the dot. Leave empty for no suffix.]]></tooltip>\n                        </url_suffix>\n                        <rss translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Create RSS feed</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>80</position>\n                            <class>rss use-frontend</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', a RSS feed with your entities will be added to the list or Magento RSS feeds.<br />Also a new fields called 'in_rss' will be added to your entity. This will allow you to filter the entities listed in the RSS feed.<br />You can disable the RSS feature later from the configuration section of your module.]]></tooltip>\n                            <additional><![CDATA[<span class=\"label label-warning\">Known issue:</span>If all the default Magento RSS feeds are disabled, but the general RSS feed is enabled and the RSS feed for your entity is also enabled a message will apprear on the RSS list page: 'There are no Rss Feeds'. This happens because Magento RSS list functionality does not allow adding custom RSS feeds without overriding a block.]]></additional>\n                        </rss>\n                        <widget translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Create widgets</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>90</position>\n                            <class>widget use-frontend</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', 2 new widgets will be added to the list of widgets that can be used in CMS pages and CMS blocks.<br />One widget will allow you to add a link to your entity instance and one will allow you to add a few details about your entity in CMS page or block.]]></tooltip>\n                        </widget>\n                        <allow_comment translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Allow comments</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>100</position>\n                            <class>allow-comment use-frontend use-create-view</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes' the users of your website will be able to comment on your custom entities. Comments will be moderated.<br /><span class=\"label label-warning\">warning:</span>This option is available only if \"Create frontend view\" is set to 'Yes'.]]></tooltip>\n                        </allow_comment>\n                        <manage_comment translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Enable/disable comments for each instance</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <required>1</required>\n                            <position>110</position>\n                            <class>use-frontend use-allow-comment use-create-view</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[This setting will add a new attribute/field that will allow you to enable/disable the comment form for each entity instance.<br /><span class=\"label label-warning\">warning:</span>This option is available only if \"Allow comments\" is set to 'Yes'.]]></tooltip>\n                        </manage_comment>\n                    </fields>\n                </frontend>\n                <product translate=\"label description\" module=\"modulecreator\">\n                    <label>Products</label>\n                    <description>Entity links with products</description>\n                    <collapsable>1</collapsable>\n                    <fields>\n                        <link_product translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Link \"many to many\" with products</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <position>10</position>\n                            <class>link-product</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', a new tab will be added to the product add/edit form, with a list of your entities. Something similar to the 'Related products' tab.<br />Also on your entity add/edit page a similar tab listing all the products will be added.]]></tooltip>\n                        </link_product>\n                        <show_on_product translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Show associated entities on product page</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <position>20</position>\n                            <class>use-link-product</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', a new section with the list of your entities related to a specific product will be added to the product view page.]]></tooltip>\n                            <additional><![CDATA[This happens for the default Magento theme and for themes with similar format for the product view page. For custom themes there the block might not appear.<br /><span class=\"label label-info\">Info:</span> This field is available only if 'Link \"many to many\" with products' is set to 'Yes'.]]></additional>\n                        </show_on_product>\n                        <show_products translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Show associated product on entity page</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <position>30</position>\n                            <class>use-frontend use-create-view use-link-product</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', a new section with the list of your products related to one entity will be added to the entity view page.]]></tooltip>\n                            <additional><![CDATA[<span class=\"label label-info\">Info:</span> This field is available only if 'Link \"many to many\" with products' is set to 'Yes'.]]></additional>\n                        </show_products>\n                        <product_attribute translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Make entity a product attribute</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <position>40</position>\n                            <class>product-attribute</class>\n                            <system>1</system>\n                            <tooltip>This will add a new dropdown attribute to the product where the options will be your entity instances.</tooltip>\n                        </product_attribute>\n                        <product_attribute_code translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Product attribute code</label>\n                            <type>text</type>\n                            <position>50</position>\n                            <required>1</required>\n                            <class>use-product-attribute validate-code</class>\n                            <tooltip>Fill in the dropdown attribute code.</tooltip>\n                        </product_attribute_code>\n                        <product_attribute_scope translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Product attribute scope</label>\n                            <type>select</type>\n                            <source>modulecreator/source_attribute_scope</source>\n                            <position>60</position>\n                            <class>use-product-attribute</class>\n                            <system>1</system>\n                            <tooltip>Select the product attribute scope.</tooltip>\n                        </product_attribute_scope>\n                        <product_attribute_group translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Product attribute group</label>\n                            <type>text</type>\n                            <position>60</position>\n                            <class>use-product-attribute</class>\n                            <system>1</system>\n                            <tooltip>The name of the attribute group where the attribute will be added. If you leave it empty the attribute will not be added to the attribute sets. If the group does not exist it will be created.</tooltip>\n                        </product_attribute_group>\n                    </fields>\n                </product>\n                <category translate=\"label description\" module=\"modulecreator\">\n                    <label>Categories</label>\n                    <description>Entity links with catalog categories</description>\n                    <collapsable>1</collapsable>\n                    <fields>\n                        <link_category translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Link \"many to many\" with category</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <position>10</position>\n                            <class>link-category</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', a new tab will be added to the category add/edit form, with a list of your entities. Something similar to the 'Products' tab.<br />Also on your entity add/edit page a similar tab listing all the categories will be added.]]></tooltip>\n                        </link_category>\n                        <show_on_category translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Show associated entities on category page</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <position>20</position>\n                            <class>use-link-category</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', a new section with the list of your entities related to a specific category will be added to the category view page.]]></tooltip>\n                        </show_on_category>\n                        <show_category translate=\"label tooltip additional\" module=\"modulecreator\">\n                            <label>Show associated categories on entity page</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <position>30</position>\n                            <class>use-frontend use-create-view use-link-category</class>\n                            <system>1</system>\n                            <tooltip><![CDATA[If this is set to 'Yes', a new section with the list of your categories related to one entity will be added to the entity view page.]]></tooltip>\n                            <additional><![CDATA[<span class=\"label label-info\">Info:</span> This field is available only if 'Link \"many to many\" with categories' is set to 'Yes'.]]></additional>\n                        </show_category>\n                        <category_attribute translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Make entity a category attribute</label>\n                            <type>select</type>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <position>40</position>\n                            <class>category-attribute</class>\n                            <system>1</system>\n                            <tooltip>This will add a new dropdown attribute to the category where the options will be your entity instances.</tooltip>\n                        </category_attribute>\n                        <category_attribute_code translate=\"label\" module=\"modulecreator\">\n                            <label>Category attribute code</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>50</position>\n                            <class>use-category-attribute validate-code</class>\n                            <tooltip>Fill in the dropdown attribute code.</tooltip>\n                        </category_attribute_code>\n                        <category_attribute_scope translate=\"label\" module=\"modulecreator\">\n                            <label>Category attribute scope</label>\n                            <type>select</type>\n                            <source>modulecreator/source_attribute_scope</source>\n                            <position>60</position>\n                            <class>use-category-attribute</class>\n                            <system>1</system>\n                            <tooltip>Select the category attribute scope.</tooltip>\n                        </category_attribute_scope>\n                        <category_attribute_group translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Category attribute group</label>\n                            <type>text</type>\n                            <position>60</position>\n                            <class>use-category-attribute</class>\n                            <system>1</system>\n                            <tooltip>The name of the attribute group where the attribute will be added. If you leave it empty the attribute will not be added to the category attribute set. If the group does not exist it will be created.</tooltip>\n                        </category_attribute_group>\n                    </fields>\n                </category>\n            </fieldsets>\n        </entity>\n        <attribute>\n            <fieldsets>\n                <fieldset translate=\"label description\">\n                    <label>Field / Attribute settings</label>\n                    <description>Configure the field / attribute assigned to the entity</description>\n                    <collapsable>1</collapsable>\n                    <use_depends>1</use_depends>\n                    <fields>\n                        <code translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Attribute code</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>10</position>\n                            <class>validate-code</class>\n                            <tooltip><![CDATA[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 />There are some naming restriction. For example the code cannot be: \"data\", \"child]]></tooltip>\n                        </code>\n                        <label translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Attribute label</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>20</position>\n                            <class>attribute-label</class>\n                            <tooltip>This is the attribute label that will be visible in the back-end in the add/edit form and in some cases in frontend.</tooltip>\n                        </label>\n                        <type translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Attribute Type</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <source>modulecreator/source_attribute_type</source>\n                            <position>30</position>\n                            <class>attribute-type</class>\n                            <system>1</system>\n                            <tooltip>This is the attribute type. This wil determine the table column type for this field/attribute and its behavior.</tooltip>\n                        </type>\n                        <scope translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Attribute Scope</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <source>modulecreator/source_attribute_scope</source>\n                            <position>40</position>\n                            <system>1</system>\n                            <class>attribute-scope</class>\n                            <tooltip>This is the attribute scope. It is available only for EAV entities. It works similar to the product attribute scope.</tooltip>\n                        </scope>\n                        <note translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Note</label>\n                            <type>text</type>\n                            <required>0</required>\n                            <position>50</position>\n                            <tooltip>This will be added as a comment under the field in the admin add/edit form.</tooltip>\n                        </note>\n                        <position>\n                            <label>Position</label>\n                            <type>hidden</type>\n                            <required>0</required>\n                            <position>60</position>\n                            <class>position</class>\n                            <tooltip>This is the sort order of the field in the add/edit form.</tooltip>\n                        </position>\n                        <is_name translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Acts as name</label>\n                            <type>radio</type>\n                            <required>0</required>\n                            <position>70</position>\n                            <class>validate-one-required-by-name is_name</class>\n                            <depend_class>type-text type-int type-signedint type-decimal type-timestamp</depend_class>\n                            <tooltip><![CDATA[Each entity must have an attribute to behave as \"Name\". This attribute will be used to identify different entities among themselves. It will also be used in dropdowns with entities. This option is available only for text, number and decimal attributes.]]></tooltip>\n                        </is_name>\n                        <required translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Required</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <position>80</position>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <system>1</system>\n                            <tooltip>This sets the attribute as required in the admin add/edit form. Is available for all the attribute types.</tooltip>\n                        </required>\n                        <editor translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Use WYSIWYG editor</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <position>90</position>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <depend_class>type-textarea</depend_class>\n                            <system>1</system>\n                            <tooltip>This allows you to use a WYSIWYG editor for the attribute. It is available only for Textarea attributes.</tooltip>\n                        </editor>\n                        <admin_grid translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Show in admin grid</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <position>100</position>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <system>1</system>\n                            <depend_class>type-text type-yesno type-timestamp type-int type-signedint type-decimal type-website type-dropdown type-country</depend_class>\n                            <tooltip><![CDATA[This allows you to display the attribute as a column in the admin grid of the entity. The attribute set to behave as \"Name\" will be included by default in the grid.]]></tooltip>\n                        </admin_grid>\n                        <frontend translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Show in frontend</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <position>110</position>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <depend_class>type-all use-create-view use-frontend</depend_class>\n                            <system>1</system>\n                            <tooltip><![CDATA[This allows you to show the attribute in the entity view page. Is available for all attribute types.]]></tooltip>\n                        </frontend>\n                        <widget translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Show in widget</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <position>120</position>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <depend_class>type-all use-widget use-frontend</depend_class>\n                            <system>1</system>\n                            <tooltip><![CDATA[This allows you to show the attribute in view widget. Is available for all attribute types.]]></tooltip>\n                        </widget>\n                        <rss translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Show in rss</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <position>130</position>\n                            <source>adminhtml/system_config_source_yesno</source>\n                            <depend_class>type-all use-rss use-frontend</depend_class>\n                            <system>1</system>\n                            <tooltip><![CDATA[This allows you to show the attribute in rss feed. Is available for all attribute types.]]></tooltip>\n                        </rss>\n                        <options_source translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Options source</label>\n                            <type>select</type>\n                            <required>1</required>\n                            <position>140</position>\n                            <source>modulecreator/source_attribute_value_source</source>\n                            <depend_class>type-dropdown type-multiselect is-source</depend_class>\n                            <system>1</system>\n                            <tooltip>For dropdown and multiselect attributes you can set the values manually or use the values from a product attribute, a category attribute or a customer attribute.</tooltip>\n                        </options_source>\n                        <options_source_attribute translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Attribute code for option source</label>\n                            <type>text</type>\n                            <required>1</required>\n                            <position>160</position>\n                            <depend_class>type-dropdown type-multiselect not-custom-source</depend_class>\n                            <tooltip>If you choose to use the values of an attribute as values for the dropdown field enter here the attribute code to use. If the product (or category or customer) attribute does not have values or does not support values you will not see any options.</tooltip>\n                        </options_source_attribute>\n                        <options translate=\"label note tooltip\" module=\"modulecreator\">\n                            <label>Options in select</label>\n                            <type>textarea</type>\n                            <required>1</required>\n                            <position>170</position>\n                            <depend_class>type-dropdown type-multiselect custom-source</depend_class>\n                            <note>One option on each row</note>\n                            <tooltip>If you choose to enter the values for the dropdown or multiselect manually, input them here. Separate the options with | (pipe). If you want an empty option at the begining start with a | (pipe) symbol.</tooltip>\n                        </options>\n                        <default_value translate=\"label tooltip\" module=\"modulecreator\">\n                            <label>Default value</label>\n                            <type>textarea</type>\n                            <required>0</required>\n                            <position>180</position>\n                            <depend_class>type-text type-textarea type-timestamp type-dropdown type-multiselect type-decimal type-int type-yesno type-country dropdown-custom-source</depend_class>\n                            <tooltip>Fill in a default value for the attribute. Leave empty for no value. For dropdown and multiselect attributes the value, must be a valid value. not valid ones will be removed. For the multiselect attributes add one default value on each line. For Yes/No attribtues enter 1 for Yes, 0 for No. For country attributes fill in the country ISO2 code. You cannot set a default value for dropdown and multiselect attributes that use a source model and on image and file attributes.</tooltip>\n                        </default_value>\n                    </fields>\n                </fieldset>\n            </fieldsets>\n        </attribute>\n    </forms>\n    <xml_attributes>\n        <umc_module>\n            <namespace />\n            <module_name />\n            <install />\n            <codepool />\n            <version />\n            <license />\n            <menu_text />\n            <menu_parent />\n            <sort_order />\n            <front_key />\n            <system_tab />\n            <system_tab_position />\n        </umc_module>\n        <umc_entity>\n            <label_singular />\n            <label_plural />\n            <name_singular />\n            <name_plural />\n            <is_tree />\n            <add_created_to_grid />\n            <add_updated_to_grid />\n            <type />\n            <store />\n            <create_frontend />\n            <create_list />\n            <list_menu />\n            <list_template />\n            <create_view />\n            <view_template />\n            <add_seo />\n            <url_rewrite />\n            <url_rewrite_list />\n            <url_prefix />\n            <url_suffix />\n            <rss />\n            <widget />\n            <link_product />\n            <show_on_product />\n            <show_products />\n            <product_attribute />\n            <product_attribute_code />\n            <product_attribute_scope />\n            <link_category />\n            <show_on_category />\n            <show_category />\n            <category_attribute />\n            <category_attribute_code />\n            <category_attribute_scope />\n            <allow_comment />\n            <manage_comment />\n            <search />\n            <api />\n            <rest />\n            <product_attribute_group />\n            <category_attribute_group />\n        </umc_entity>\n    </xml_attributes>\n    <types>\n        <umc_entity>\n            <flat translate=\"label\" module=\"modulecreator\">\n                <label>Flat</label>\n                <type_model>modulecreator/entity_type_flat</type_model>\n            </flat>\n            <eav translate=\"label\" module=\"modulecreator\">\n                <label>EAV</label>\n                <type_model>modulecreator/entity_type_eav</type_model>\n            </eav>\n        </umc_entity>\n        <umc_attribute>\n            <country translate=\"label\" module=\"modulecreator\">\n                <label>Country</label>\n                <type_model>modulecreator/attribute_type_country</type_model>\n                <group>dropdown</group>\n                <allow_is_name>0</allow_is_name>\n                <mass_update>1</mass_update>\n            </country>\n            <decimal translate=\"label\" module=\"modulecreator\">\n                <label>Decimal</label>\n                <type_model>modulecreator/attribute_type_decimal</type_model>\n                <group>text</group>\n                <allow_is_name>1</allow_is_name>\n                <mass_update>0</mass_update>\n            </decimal>\n            <dropdown translate=\"label\" module=\"modulecreator\">\n                <label>Dropdown</label>\n                <type_model>modulecreator/attribute_type_dropdown</type_model>\n                <group>dropdown</group>\n                <allow_is_name>0</allow_is_name>\n                <mass_update>1</mass_update>\n            </dropdown>\n            <file translate=\"label\" module=\"modulecreator\">\n                <label>File</label>\n                <type_model>modulecreator/attribute_type_file</type_model>\n                <group>file</group>\n                <allow_is_name>0</allow_is_name>\n                <mass_update>0</mass_update>\n            </file>\n            <image translate=\"label\" module=\"modulecreator\">\n                <label>Image</label>\n                <type_model>modulecreator/attribute_type_image</type_model>\n                <group>file</group>\n                <allow_is_name>0</allow_is_name>\n                <mass_update>0</mass_update>\n            </image>\n            <int translate=\"label\" module=\"modulecreator\">\n                <label>Unsinged Int</label>\n                <type_model>modulecreator/attribute_type_int</type_model>\n                <group>text</group>\n                <allow_is_name>1</allow_is_name>\n                <mass_update>0</mass_update>\n            </int>\n            <signedint translate=\"label\" module=\"modulecreator\">\n                <label>Singed Int</label>\n                <type_model>modulecreator/attribute_type_signedint</type_model>\n                <group>text</group>\n                <allow_is_name>1</allow_is_name>\n                <mass_update>0</mass_update>\n            </signedint>\n            <multiselect translate=\"label\" module=\"modulecreator\">\n                <label>Multiselect</label>\n                <type_model>modulecreator/attribute_type_multiselect</type_model>\n                <group>dropdown</group>\n                <allow_is_name>0</allow_is_name>\n                <mass_update>0</mass_update>\n            </multiselect>\n            <text translate=\"label\" module=\"modulecreator\">\n                <label>Text</label>\n                <type_model>modulecreator/attribute_type_text</type_model>\n                <group>text</group>\n                <allow_is_name>1</allow_is_name>\n                <mass_update>0</mass_update>\n            </text>\n            <textarea translate=\"label\" module=\"modulecreator\">\n                <label>Textarea</label>\n                <type_model>modulecreator/attribute_type_textarea</type_model>\n                <group>text</group>\n                <allow_is_name>0</allow_is_name>\n                <mass_update>0</mass_update>\n            </textarea>\n            <yesno translate=\"label\" module=\"modulecreator\">\n                <label>Yes / No</label>\n                <type_model>modulecreator/attribute_type_yesno</type_model>\n                <group>dropdown</group>\n                <allow_is_name>0</allow_is_name>\n                <mass_update>1</mass_update>\n            </yesno>\n            <timestamp translate=\"label\" module=\"modulecreator\">\n                <label>Date</label>\n                <type_model>modulecreator/attribute_type_timestamp</type_model>\n                <group>date</group>\n                <allow_is_name>0</allow_is_name>\n                <mass_update>0</mass_update>\n            </timestamp>\n        </umc_attribute>\n        <umc_attribute_group>\n            <text translate=\"label\">\n                <label>Text</label>\n            </text>\n            <dropdown translate=\"label\">\n                <label>Dropdown</label>\n            </dropdown>\n            <file translate=\"label\">\n                <label>File</label>\n            </file>\n            <date translate=\"label\">\n                <label>Date</label>\n            </date>\n        </umc_attribute_group>\n        <umc_dropdown>\n            <custom translate=\"label\" module=\"modulecreator\">\n                <label>Manually defined</label>\n                <type_model>modulecreator/attribute_type_dropdown_custom</type_model>\n            </custom>\n            <catalog_product translate=\"label\" module=\"modulecreator\">\n                <label>Product attribute</label>\n                <type_model>modulecreator/attribute_type_dropdown_product</type_model>\n            </catalog_product>\n            <catalog_category translate=\"label\" module=\"modulecreator\">\n                <label>Category attribute</label>\n                <type_model>modulecreator/attribute_type_dropdown_category</type_model>\n            </catalog_category>\n            <customer translate=\"label\" module=\"modulecreator\">\n                <label>Customer attribute</label>\n                <type_model>modulecreator/attribute_type_dropdown_customer</type_model>\n            </customer>\n        </umc_dropdown>\n        <umc_relation>\n            <none translate=\"label description\">\n                <label>--Has no relation with--</label>\n                <description>The entities are not related in any way.</description>\n            </none>\n            <parent translate=\"label description\">\n                <label>Is parent for</label>\n                <description><![CDATA[The first entity acts as a parent for the second one <br />. A field will be added to the second entity table as a reference to the first entity.]]></description>\n            </parent>\n            <child translate=\"label description\">\n                <label>Is child of</label>\n                <description><![CDATA[The first entity acts as a child for the second one <br />. A field will be added to the first entity table as a reference to the first entity.]]></description>\n            </child>\n            <sibling translate=\"label description\">\n                <label>Is sibling with</label>\n                <description>The entities are in a many to many relation. A new table will be created to support this relation containing the ids of each entity.</description>\n            </sibling>\n        </umc_relation>\n    </types>\n    <restricted>\n        <entity>\n            <resource />\n            <setup />\n            <attribute />\n            <system />\n            <flat />\n            <data />\n            <collection />\n            <adminhtml />\n            <widget />\n            <observer />\n            <tree />\n            <image />\n            <node />\n            <api />\n            <comment />\n            <template />\n        </entity>\n        <attribute>\n            <template translate=\"message\">\n                <message><![CDATA[This will conflict with the magento methods.]]></message>\n            </template>\n            <created_at translate=\"message\">\n                <message><![CDATA[An attribute/field with code \"created_at\" will be added by default to your entity.]]></message>\n            </created_at>\n            <updated_at translate=\"message\">\n                <message><![CDATA[An attribute/field with code \"updated_at\" will be added by default to your entity.]]></message>\n            </updated_at>\n            <status translate=\"message\">\n                <message><![CDATA[An attribute/field with code \"status\" will be added by default to your entity if you choose to create frontend files for the entity.]]></message>\n                <depend_entity>\n                    <create_frontend>1</create_frontend>\n                </depend_entity>\n            </status>\n            <in_rss translate=\"message\">\n                <message><![CDATA[An attribute/field with code \"in_rss\" will be added by default to your entity if you choose to create a RSS feed for the entity.]]></message>\n                <depend_entity>\n                    <rss>1</rss>\n                </depend_entity>\n            </in_rss>\n            <meta_title translate=\"message\">\n                <message><![CDATA[An attribute/field with code \"meta_title\" will be added by default to your entity if you choose to add seo attributes to the entity.]]></message>\n                <depend_entity>\n                    <add_seo>1</add_seo>\n                </depend_entity>\n            </meta_title>\n            <meta_description translate=\"message\">\n                <message><![CDATA[An attribute/field with code \"meta_description\" will be added by default to your entity if you choose to add seo attributes to the entity.]]></message>\n                <depend_entity>\n                    <add_seo>1</add_seo>\n                </depend_entity>\n            </meta_description>\n            <meta_keywords translate=\"message\">\n                <message><![CDATA[An attribute/field with code \"meta_keywords\" will be added by default to your entity if you choose to add seo attributes to the entity.]]></message>\n                <depend_entity>\n                    <add_seo>1</add_seo>\n                </depend_entity>\n            </meta_keywords>\n            <parent_id translate=\"message\">\n                <message><![CDATA[A field with the code \"parent_id\" will be added by default to your entity if the entity has \"Tree behavior\"]]></message>\n                <depend_entity>\n                    <is_tree>1</is_tree>\n                </depend_entity>\n            </parent_id>\n            <level translate=\"message\">\n                <message><![CDATA[A field with the code \"level\" will be added by default to your entity if the entity has \"Tree behavior\"]]></message>\n                <depend_entity>\n                    <is_tree>1</is_tree>\n                </depend_entity>\n            </level>\n            <children_count translate=\"message\">\n                <message><![CDATA[A field with the code \"children_count\" will be added by default to your entity if the entity has \"Tree behavior\"]]></message>\n                <depend_entity>\n                    <is_tree>1</is_tree>\n                </depend_entity>\n            </children_count>\n            <path translate=\"message\">\n                <message><![CDATA[A field with the code \"path\" will be added by default to your entity if the entity has \"Tree behavior\"]]></message>\n                <depend_entity>\n                    <is_tree>1</is_tree>\n                </depend_entity>\n            </path>\n            <url_key translate=\"message\">\n                <message><![CDATA[A attribute/field with the code \"url_key\" will be added by default to your entity oif you choose to create URL rewrites for your entity]]></message>\n                <depend_entity>\n                    <url_rewrite>1</url_rewrite>\n                </depend_entity>\n            </url_key>\n            <node translate=\"message\">\n                <message><![CDATA[A field/attribute cannot have the code \"node\"]]></message>\n            </node>\n        </attribute>\n    </restricted>\n    <system>\n        <p>QGF1dGhvciBVbHRpbWF0ZSBNb2R1bGUgQ3JlYXRvcg==</p>\n        <pp>QGF1dGhvciAgICAgIFVsdGltYXRlIE1vZHVsZSBDcmVhdG9y</pp>\n        <f>YmFzZTY0X2RlY29kZQ==</f>\n    </system>\n    <release_notes>\n        <v1_9_6_0>\n            <version>1.9.6.0</version>\n            <date>2015-10-27</date>\n            <data>\n                <cleanup translate=\"label type comment\">\n                    <label>No new line on some source files</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[Some of the source files don't end with an empty new line ]]></comment>\n                </cleanup>\n                <template translate=\"label type\">\n                    <label>\"Template\" should not be allowed as attribute name or entity name </label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a target=\"_blank\" href=\"https://github.com/tzyganu/UMC1.9/issues/82\">#82</a>]]></comment>\n                </template>\n                <escape translate=\"label type\">\n                    <label>Labels and notes were not escaped</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a target=\"_blank\" href=\"https://github.com/tzyganu/UMC1.9/issues/105\">#105</a>]]></comment>\n                </escape>\n                <validation translate=\"label type comment\">\n                    <label>Added client side validation to module name and namespace</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[<a target=\"_blank\" href=\"https://github.com/tzyganu/UMC1.9/issues/103\">#103</a>]]></comment>\n                </validation>\n            </data>\n        </v1_9_6_0>\n        <v1_9_5_0>\n            <version>1.9.5.0</version>\n            <date>2014-12-19</date>\n            <data>\n                <cleanup translate=\"label type comment\">\n                    <label>Cleaned up the code</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[Cleaned up the UMC code and the generated code. Now all files (almost) follow the zend coding standards.]]></comment>\n                </cleanup>\n                <gcl translate=\"label type\">\n                    <label>Stick to CGL</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/68\" target=\"_blank\">#68</a>]]></comment>\n                </gcl>\n                <signed translate=\"label type\">\n                    <label>Support for signed int attributes/fields</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/43\" target=\"_blank\">#43</a>]]></comment>\n                </signed>\n                <modman translate=\"label type\">\n                    <label>Suport for modman file</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/64\" target=\"_blank\">#64</a> - The modman file is generated in `var/modulecreator/package/Namespace_Module/`]]></comment>\n                </modman>\n                <htmlescape translate=\"label type\">\n                    <label>Removed calls to deprecated method htmlEscape</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/66\" target=\"_blank\">#66</a>]]></comment>\n                </htmlescape>\n                <canonical translate=\"label type\">\n                    <label>Support for canonical URL in generated module</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/69\" target=\"_blank\">#69</a>]]></comment>\n                </canonical>\n                <helper translate=\"label type\">\n                    <label>Fixed wrong helper alias in Yes/No attribute display</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/72\" target=\"_blank\">#72</a>]]></comment>\n                </helper>\n                <multiselect translate=\"label type comment\">\n                    <label>Fixed wrong display of multiselect attribute on frontend</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[Multiselect attribute values were not displayed correctly on frontend]]></comment>\n                </multiselect>\n                <status translate=\"label type\">\n                    <label>Fixed 2 status fields generated in the setup file</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/73\" target=\"_blank\">#73</a>]]></comment>\n                </status>\n            </data>\n        </v1_9_5_0>\n        <v1_9_4_4>\n            <version>1.9.4.4</version>\n            <date>2014-10-29</date>\n            <data>\n                <category_relation translate=\"label type\">\n                    <label>Layout file not generated correctly for links with category</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/53\" target=\"_blank\">#53</a>]]></comment>\n                </category_relation>\n            </data>\n        </v1_9_4_4>\n        <v1_9_4_3>\n            <version>1.9.4.3</version>\n            <date>2014-10-28</date>\n            <data>\n                <category_relation translate=\"label type\">\n                    <label>Many to many relation with categories - missing controller</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/52\" target=\"_blank\">#52</a>]]></comment>\n                </category_relation>\n            </data>\n        </v1_9_4_3>\n        <v1_9_4_2>\n            <version>1.9.4.2</version>\n            <date>2014-10-28</date>\n            <data>\n                <category_relation translate=\"label type\">\n                    <label>Many to many relation with categories don't always work.</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/51\" target=\"_blank\">#51</a>]]></comment>\n                </category_relation>\n            </data>\n        </v1_9_4_2>\n        <v1_9_4_1>\n            <version>1.9.4.1</version>\n            <date>2014-08-27</date>\n            <data>\n                <tree_eav translate=\"label type comment\">\n                    <label>EAV tree entities admin tree not refreshing on save</label>\n                    <type>Bug Fix</type>\n                    <comment>The left side tree on the admin add/edit form for EAV tree entities does not refresh when a new entity instance is added.</comment>\n                </tree_eav>\n                <list_url translate=\"label type comment\">\n                    <label>Support for url rewrites for entity list pages</label>\n                    <type>Feature</type>\n                    <comment>You can now set a SEF url for the entity list page on frontend instead of 'module/controller/action'. The value can be changed later.</comment>\n                </list_url>\n                <cleanup translate=\"label type comment\">\n                    <label>Cleaned a bit the code</label>\n                    <type>Improvement</type>\n                    <comment>Removed some unused variables, added some type hints. I hope I didn't break anything.</comment>\n                </cleanup>\n            </data>\n        </v1_9_4_1>\n        <v1_9_4_0>\n            <version>1.9.4.0</version>\n            <date>2014-08-19</date>\n            <data>\n                <relations translate=\"label type\">\n                    <label>Link to related entities in grids and add/edit forms</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/35\" target=\"_blank\">#35</a>]]></comment>\n                </relations>\n                <relation_fix translate=\"label type comment\">\n                    <label>Fixed related entities grid columns</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[For the EAV entities that have child entities, the grid column did not display values.]]></comment>\n                </relation_fix>\n                <category_fix translate=\"label type comment\">\n                    <label>The related entities tab did not show only selected entities on category edit mode.</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[On the category edit page, in the tabs with flat related entities, all the entities were shown instead of only the selected ones.]]></comment>\n                </category_fix>\n            </data>\n        </v1_9_4_0>\n        <v1_9_3_0>\n            <version>1.9.3.0</version>\n            <date>2014-07-22</date>\n            <data>\n                <version_fix translate=\"label type comment\">\n                    <label>Writing generated files does not work on CE-1.8.0.0</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[The generated files could not pe written to disk because of the changes in Varien_Io_File in this version.]]></comment>\n                </version_fix>\n                <escape_options translate=\"label type comment\">\n                    <label>Attribute options are not escaped</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[For attributes that have options, the options were not escaped in the install script.]]></comment>\n                </escape_options>\n                <eav_default_values translate=\"label type\">\n                    <label>Set default values for EAV entities</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/14\" target=\"_blank\">14</a>]]></comment>\n                </eav_default_values>\n                <ui_error_report translate=\"label type\">\n                    <label>In the UMC UI, when submitting a form that has errors all the fieldsets that contain fields with errors will be automatically opened to get a better wiew on the error.</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/30\" target=\"_blank\">30</a>]]></comment>\n                </ui_error_report>\n                <default_values translate=\"label type\">\n                    <label>Set default values when creating a module</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[You can now set default values for most of the attribute types (file and image don't support it) when creating your entity attributes.]]></comment>\n                </default_values>\n            </data>\n        </v1_9_3_0>\n        <v1_9_2_0>\n            <version>1.9.2.0</version>\n            <date>2014-07-21</date>\n            <data>\n                <rest translate=\"label type comment\">\n                    <label>Added REST API functionality</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[You can not generate the files needed for the REST API of you entities.]]></comment>\n                </rest>\n            </data>\n        </v1_9_2_0>\n        <v1_9_1_2>\n            <version>1.9.1.2</version>\n            <date>2014-06-12</date>\n            <data>\n                <separator translate=\"label type comment\">\n                    <label>Changed dropdown options separator to new line instead of pipe (|)</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/29\" target=\"_blank\">#29</a>]]></comment>\n                </separator>\n                <escape translate=\"label type comment\">\n                    <label>Escaped attribute labels and notes.</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/28\" target=\"_blank\">#28</a>]]></comment>\n                </escape>\n            </data>\n        </v1_9_1_2>\n        <v1_9_1_1>\n            <version>1.9.1.1</version>\n            <date>2014-06-11</date>\n            <data>\n                <resource_model translate=\"label type comment\">\n                    <label>Wrong resource model parent</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[For modules with entities that are marked as being product or category attributes the resource model parent class is set to `Mage_Core_Model_Resource_Setup` and it should be `Mage_Catalog_Model_Resource_Setup`]]></comment>\n                </resource_model>\n            </data>\n        </v1_9_1_1>\n        <v1_9_1_0>\n            <version>1.9.1.0</version>\n            <date>2014-06-03</date>\n            <data>\n                <missing_images translate=\"label type comment\">\n                    <label>Tree entity list images not generated</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[Images for the tree entities were not generated for Magento 1.8+]]></comment>\n                </missing_images>\n                <category_relation translate=\"label type comment\">\n                    <label>Category relation bug</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[Category relation tab appears for tree entities even if not set to yes.]]></comment>\n                </category_relation>\n                <top_menu translate=\"label type comment\">\n                    <label>Entities link top menu does not get selected.</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[Entities link top menu does not get selected.]]></comment>\n                </top_menu>\n            </data>\n        </v1_9_1_0>\n        <v1_9_0_1>\n            <version>1.9.0.1</version>\n            <date>2014-05-02</date>\n            <data>\n                <parent_child translate=\"label type\">\n                    <label>Parent / child entities have a method of retrieving the associated entities (children / parent)</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/13\" target=\"_blank\">#13</a>]]></comment>\n                </parent_child>\n                <locale translate=\"label type comment\">\n                    <label>Fixed some typos in the locale file</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[Some texts from the locale files still displayed placeholders after generation.]]></comment>\n                </locale>\n                <misspell translate=\"label type\">\n                    <label>Fixed some typos text messages</label>\n                    <type>Inconsistency</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/16\" target=\"_blank\">#16</a>]]></comment>\n                </misspell>\n                <filter_dates translate=\"label type\">\n                    <label>Fixed missing single quotation mark in _filterDates()</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/17\" target=\"_blank\">#17</a>]]></comment>\n                </filter_dates>\n                <translations translate=\"label type\">\n                    <label>Missing translation for some system.xml labels</label>\n                    <type>Inconsistency</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/18\" target=\"_blank\">#18</a>]]></comment>\n                </translations>\n            </data>\n        </v1_9_0_1>\n        <v1_9_0_0>\n            <version>1.9.0.0</version>\n            <date>2014-04-25</date>\n            <data>\n                <attribute_code translate=\"label type comment\">\n                    <label>Product/category attribute code made required</label>\n                    <type>Bug Fix</type>\n                    <comment>When selecting to make an entity a product/category attribute, the attribute code was not required and resulted in errors.</comment>\n                </attribute_code>\n            </data>\n        </v1_9_0_0>\n        <v1_9_0_rc2>\n            <version>1.9.0-rc2</version>\n            <date>2014-04-16</date>\n            <data>\n                <date translate=\"label type comment\">\n                    <label>Fixed date fields save</label>\n                    <type>Bug Fix</type>\n                    <comment>The date fields were saved as 1970-01-01 for some locale settings (French for example)</comment>\n                </date>\n            </data>\n        </v1_9_0_rc2>\n        <v1_9_0_rc>\n            <version>1.9.0-rc</version>\n            <date>2014-04-14</date>\n            <data>\n                <typo translate=\"label type comment\">\n                    <label>Fixed typos in the UI</label>\n                    <type>Fix</type>\n                    <comment><![CDATA[Fixed some typos in the UMC UI.]]></comment>\n                </typo>\n                <url_rewrite translate=\"label type comment\">\n                    <label>Auto-generate url rewrites</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[URL rewrites for flat entities can be left blank and they will be auto-generated]]></comment>\n                </url_rewrite>\n                <doc translate=\"label type comment\">\n                    <label>Fixed php doc on some methods</label>\n                    <type>Fix</type>\n                    <comment><![CDATA[Fixed documentation on some generated methods.]]></comment>\n                </doc>\n                <tree translate=\"label type comment\">\n                    <label>Fixed 'undefined variable' for tree entities</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[Fixed 'undefined variable' error for tree entities.]]></comment>\n                </tree>\n            </data>\n        </v1_9_0_rc>\n        <v1_9_0_beta>\n            <version>1.9.0-beta</version>\n            <date>2014-04-11</date>\n            <data>\n                <grid translate=\"label type comment\">\n                    <label>Improved te created modules grid.</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[Added a verification for file existing for download in the created modules grid. Changed the names of the downloaded files - added module name to them.]]></comment>\n                </grid>\n                <typo translate=\"label type comment\">\n                    <label>Fixed typo</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[Fixed typo in the generated module for category relation.]]></comment>\n                </typo>\n                <eav_export translate=\"label type\">\n                    <label>Wrong export for EAV entities.</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/pull/11\" target=\"_blank\">#11</a>]]></comment>\n                </eav_export>\n            </data>\n        </v1_9_0_beta>\n        <v1_9_0_alpha2>\n            <version>1.9.0-alpha2</version>\n            <date>2014-04-03</date>\n            <data>\n                <attribute_notes_admin translate=\"label type comment\">\n                    <label>Attribute notes for EAV entities are now manageable from the backend.</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[Attribute notes for EAV entities can be changed from the backend, when editing the attribute.]]></comment>\n                </attribute_notes_admin>\n                <attribute_notes translate=\"label type\">\n                    <label>Attribute notes do not appear in the EAV entity form</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/10\" target=\"_blank\">#10</a>]]></comment>\n                </attribute_notes>\n                <eav_flag translate=\"label type\">\n                    <label>Wrong EAV mass action flag change</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/pull/8\" target=\"_blank\">#8</a>]]></comment>\n                </eav_flag>\n                <system_config translate=\"label type comment\">\n                    <label>The configuration panel for tree entities was incomplete</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[The display mode of tree entities was not manageable from the system configuration section.]]></comment>\n                </system_config>\n                <system_config_tab translate=\"label type comment\">\n                    <label>Set the system configuration tab name and position.</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[You can set the configuration tab name and position when creating a module.]]></comment>\n                </system_config_tab>\n            </data>\n        </v1_9_0_alpha2>\n        <v1_9_0_alpha1>\n            <version>1.9.0-alpha1</version>\n            <date>2014-03-27</date>\n            <data>\n                <sibling_relation translate=\"label type comment\">\n                    <label>Fixed the sibling relation tab on admin.</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[For non tree entities related as siblings there was an error in the admin relation tab.]]></comment>\n                </sibling_relation>\n                <uninstall translate=\"label type comment\">\n                    <label>Fixed generation of uninstall script</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[The uninstall script tried to remove the module_eav_attribute table once for each EAV entity.]]></comment>\n                </uninstall>\n                <image translate=\"label type comment\">\n                    <label>Image field/attribute display on frontend</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[The image attributes/fields were displayed wrong on frontend for EAV entities.]]></comment>\n                </image>\n                <filename translate=\"label type\">\n                    <label>A file for generating content had a wrong name</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/pull/6\" target=\"_blank\">#6</a>]]></comment>\n                </filename>\n            </data>\n        </v1_9_0_alpha1>\n        <v1_9_0_dev8>\n            <version>1.9.0-dev8</version>\n            <date>2014-03-26</date>\n            <data>\n                <class_alias translate=\"label type comment\">\n                    <label>Change module class aliases</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[Changed the class aliases from `module` to `namespace_module`. For example a model will be instantiated using `Mage::getModel('namespace_module/some_model')` to avoid extension conflicts.]]></comment>\n                </class_alias>\n                <routes translate=\"label type comment\">\n                    <label>Added configurable frontend routes</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[The route of the module can be configured. (<a href=\"https://github.com/tzyganu/UMC1.9/issues/4\" target=\"_blank\">#4</a>)]]></comment>\n                </routes>\n                <comment_row translate=\"label type comment\">\n                    <label>Fixed comment row URL</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[A click on any row on the comments grid ended up in a \"Comment not found\" error.]]></comment>\n                </comment_row>\n                <category_url translate=\"label type comment\">\n                    <label>Fixed entities in category page</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[Links to entities related to categories had a wrong format in the category view page.]]></comment>\n                </category_url>\n            </data>\n        </v1_9_0_dev8>\n        <v1_9_0_dev7>\n            <version>1.9.0-dev7</version>\n            <date>2014-03-21</date>\n            <data>\n                <wsi_api translate=\"label type comment\">\n                    <label>Added WS-I support for API for EAV entities</label>\n                    <type>Feature</type>\n                    <comment><![CDATA[Added WS-I support for API for EAV entities and their attributes.]]></comment>\n                </wsi_api>\n                <attributes_save translate=\"label type comment\">\n                    <label>Values for manually added attributes for EAV attributes are not saved</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[The values for manually added attributes for EAV entities were not saved due to the attributes not belonging to a group.]]></comment>\n                </attributes_save>\n                <layout_messages translate=\"label type comment\">\n                    <label>Added initLayoutMessages for frontend controllers</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[Different types of session messages were not displayed in the entity actions (view/list) <a href=\"https://github.com/tzyganu/UMC1.9/issues/2\" target=\"_blank\">(#2)</a>]]></comment>\n                </layout_messages>\n                <relations translate=\"label type comment\">\n                    <label>Relations not saved when 3 or more entities exist</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[The entities relations were not displayed correctly when the module contained 3 or more entities. <a href=\"https://github.com/tzyganu/UMC1.9/issues/5\" target=\"_blank\">(#5)</a>]]></comment>\n                </relations>\n                <acl translate=\"label type comment\">\n                    <label>Fixed admin ACL for comments and EAV attributes</label>\n                    <type>Bug Fix</type>\n                    <comment><![CDATA[When setting specific permissions for an admin the comments & EAV attributes grid got \"Access denied\".]]></comment>\n                </acl>\n            </data>\n        </v1_9_0_dev7>\n        <v1_9_0_dev6>\n            <version>1.9.0-dev6</version>\n            <date>2014-02-14</date>\n            <data>\n                <api translate=\"label type comment\">\n                    <label>Added support for SOAP API</label>\n                    <type>Feature</type>\n                    <comment>The generated extensions can contain files used for the SOAP API.</comment>\n                </api>\n                <relation_table translate=\"label type comment\">\n                    <label>Added unique indexes to relation tables</label>\n                    <type>Improvement</type>\n                    <comment>The relation tables between entities and products or categories or other entities now have a unique index on the entity id and the related entity id.</comment>\n                </relation_table>\n                <relation_save translate=\"label type comment\">\n                    <label>Changed the way sibling entities relations are saved</label>\n                    <type>Improvement</type>\n                    <comment>The sibling relations are not recreated completely anymore. They are merged.</comment>\n                </relation_save>\n                <admin_search translate=\"label type comment\">\n                    <label>Fixed admin search</label>\n                    <type>Bug Fix</type>\n                    <comment>Selecting to include entities in admin search had no effect.</comment>\n                </admin_search>\n                <effects translate=\"label type comment\">\n                    <label>Added UI Effects</label>\n                    <type>Useless</type>\n                    <comment>The UMC UI has pulsating and sliding effects on different operations.</comment>\n                </effects>\n            </data>\n        </v1_9_0_dev6>\n        <v1_9_0_dev5>\n            <version>1.9.0-dev5</version>\n            <date>2014-02-06</date>\n            <data>\n                <language_file translate=\"label type comment\">\n                    <label>Added language file</label>\n                    <type>Improvement</type>\n                    <comment><![CDATA[Added the en_US locale file for the module. The file was generated using <a href=\"https://github.com/tzyganu/MagentoTranslationTool\" target=\"_blank\">MagentoTranslationTool</a>]]></comment>\n                </language_file>\n                <comments_grid translate=\"label type comment\">\n                    <label>Comments grid include entity name</label>\n                    <type>Improvement</type>\n                    <comment>The admin grids for each entity comments include the entity name.</comment>\n                </comments_grid>\n                <comments translate=\"label type comment\">\n                    <label>Added my comments for customers</label>\n                    <type>Feature</type>\n                    <comment>There is a new section in the customer account menu that links to \"my comments\" for each entity.</comment>\n                </comments>\n                <url_rewrite translate=\"label type comment\">\n                    <label>Fix url rewrite save</label>\n                    <type>Bug Fix</type>\n                    <comment>Flat entities with url rewrites and no stores could not be saved.</comment>\n                </url_rewrite>\n            </data>\n        </v1_9_0_dev5>\n        <v1_9_0_dev4>\n            <version>1.9.0-dev4</version>\n            <date>2014-02-04</date>\n            <data>\n                <mass_action translate=\"label type comment\">\n                    <label>Allowed more attributes in mass action</label>\n                    <type>Feature</type>\n                    <comment>Country and Dropdown attributes can be set by mass action from grid.</comment>\n                </mass_action>\n                <tree_widget translate=\"label type comment\">\n                    <label>Fixed tree widget chooser</label>\n                    <type>Bug fix</type>\n                    <comment>Tree widget chooser was giving fatal error.</comment>\n                </tree_widget>\n                <tree_relations translate=\"label type comment\">\n                    <label>Fixed relations between tree behaving entities</label>\n                    <type>Bug fix</type>\n                    <comment>A \"sibling\" relation between and EAV Tree entity and a Flat Tree entity did not behave as expected. but this is no problem. No one will use this kind of relation.</comment>\n                </tree_relations>\n                <rss translate=\"label type comment\">\n                    <label>Fixed RSS display</label>\n                    <type>Bug fix</type>\n                    <comment>Now all attribute types displayed properly in the rss feed.</comment>\n                </rss>\n                <tree translate=\"label type comment\">\n                    <label>Fixed tree entities display</label>\n                    <type>Bug fix</type>\n                    <comment>Tree entities rendered wrong when the view page was disabled.</comment>\n                </tree>\n                <widget translate=\"label type comment\">\n                    <label>Widgets</label>\n                    <type>Refactored</type>\n                    <comment>Refactored widget view contents</comment>\n                </widget>\n            </data>\n        </v1_9_0_dev4>\n        <v1_9_0_dev3>\n            <version>1.9.0-dev3</version>\n            <date>2014-01-24</date>\n            <data>\n                <attribtues translate=\"label type comment\">\n                    <label>Drag &amp; drop attributes</label>\n                    <type>Feature</type>\n                    <comment>When creating an entity you can drag and drop attributes to sort them in the list</comment>\n                </attribtues>\n                <menu translate=\"label type comment\">\n                    <label>Select menu for entity link</label>\n                    <type>Feature</type>\n                    <comment>Added ability to select the frontend menu where the link to your entity page should be placed</comment>\n                </menu>\n                <api translate=\"label type comment\">\n                    <label>Temporarily disable API</label>\n                    <type>???</type>\n                    <comment>The API does not yet work for EAV entities and comments. It is temporarily disabled until I get it working.</comment>\n                </api>\n                <view_page translate=\"label type comment\">\n                    <label>Empty page for non existing entities</label>\n                    <type>Bug fix</type>\n                    <comment>The entity view page displayed as blank if looking at an entity that does not exist. Now redirects to 404 page.</comment>\n                </view_page>\n                <category_relation translate=\"label type comment\">\n                    <label>Fixed display on category page</label>\n                    <type>Bug fix</type>\n                    <comment>Entities related to categories were displayed on the category page at the top. Now they are after the product list.</comment>\n                </category_relation>\n                <relations translate=\"label type comment\">\n                    <label>Fixed entity relations</label>\n                    <type>Bug fix</type>\n                    <comment>Entities can be related independent of their type</comment>\n                </relations>\n                <url translate=\"label type comment\">\n                    <label>Fixed or generation for entities without url rewrites</label>\n                    <type>Bug fix</type>\n                    <comment>Entities without url rewrites generated an empty url.</comment>\n                </url>\n                <multi_attr translate=\"label type comment\">\n                    <label>Fixed multiselect attributes in combination with url rewrite</label>\n                    <type>Bug fix</type>\n                    <comment>For flat entities that have multiselect attributes and url rewrite the _beforeSave method was generated twice.</comment>\n                </multi_attr>\n            </data>\n        </v1_9_0_dev3>\n        <v1_9_0_dev2>\n            <version>1.9.0-dev2</version>\n            <date>2014-01-17</date>\n            <data>\n                <attribute_codes translate=\"label type comment\">\n                    <label>Refactored some attribute codes</label>\n                    <type>Refactor</type>\n                    <comment>Variables that depend on attribute names now look like this: $someName instead of $some_name</comment>\n                </attribute_codes>\n                <front_layout translate=\"label type comment\">\n                    <label>Frontend layout file generation</label>\n                    <type>Bug fix</type>\n                    <comment>Frontend layout file was always generated. Now is generated only if there is at least one entity that has frontend.</comment>\n                </front_layout>\n                <dropdown translate=\"label type comment\">\n                    <label>Fixed dropdown attributes for flat entities</label>\n                    <type>Bug fix</type>\n                    <comment>Dropdown attribute for flat entities were not configured correctly in the admin grid and admin add/edid form.</comment>\n                </dropdown>\n                <product_relation translate=\"label type comment\">\n                    <label>Entities not displaying in product page.</label>\n                    <type>Bug fix</type>\n                    <comment>Entities were not displaying in product page unless they had a separate view page.</comment>\n                </product_relation>\n                <validation translate=\"label type comment\">\n                    <label>Fixed field/attribute codes validation.</label>\n                    <type>Bug fix</type>\n                    <comment>Field/Attribute codes use the same validation as product attributes</comment>\n                </validation>\n                <add_filter translate=\"label type\">\n                    <label>Replaced 'addFilter' with 'addFieldToFilter'</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/1\" target=\"_blank\">https://github.com/tzyganu/UMC1.9/issues/1</a>]]></comment>\n                </add_filter>\n                <inconsistency_3 translate=\"label type\">\n                    <label>Inconsistent registry naming</label>\n                    <type>Bug fix</type>\n                    <comment><![CDATA[<a href=\"https://github.com/tzyganu/UMC1.9/issues/3\" target=\"_blank\">https://github.com/tzyganu/UMC1.9/issues/3</a>]]></comment>\n                </inconsistency_3>\n            </data>\n        </v1_9_0_dev2>\n        <v1_9_0_dev1>\n            <version>1.9.0-dev1</version>\n            <date>2014-01-13</date>\n            <data>\n                <eav_entities translate=\"label type comment\">\n                    <label>Added EAV entities</label>\n                    <type>Feature</type>\n                    <comment>Now you can create EAV entities that you can manage just like products and categories.</comment>\n                </eav_entities>\n                <category_link translate=\"label type comment\">\n                    <label>Added many to many link to categories</label>\n                    <type>Feature</type>\n                    <comment>Now you can link you entities \"many to many\" with the catalog categories</comment>\n                </category_link>\n                <comments translate=\"label type comment\">\n                    <label>Added comment feature</label>\n                    <type>Feature</type>\n                    <comment>You can choose to allow customers to write comments on your entities.</comment>\n                </comments>\n                <extensible translate=\"label type comment\">\n                    <label>Made extension \"extensible\"</label>\n                    <type>Feature</type>\n                    <comment>Yeah...like someone is going to extend it</comment>\n                </extensible>\n                <tree_many translate=\"label type comment\">\n                    <label>Many to many relations between tree entities</label>\n                    <type>Feature</type>\n                    <comment>Now the tree entities can be related in \"Many to many\"</comment>\n                </tree_many>\n                <menu_placing translate=\"label type comment\">\n                    <label>Module menu can be placed anywhere</label>\n                    <type>Feature</type>\n                    <comment>Until now the menu could be placed in admin only on top level. Now it can be placed anywhere in the menu tree.</comment>\n                </menu_placing>\n                <attribute_types translate=\"label type comment\">\n                    <label>Added new attribute types</label>\n                    <type>Feature</type>\n                    <comment>dorpdown, multiselect. Can have different sources - still experimental.</comment>\n                </attribute_types>\n                <attribute_entity translate=\"label type comment\">\n                    <label>Custom entities can be added as product, category and customer attributes.</label>\n                    <type>Feature</type>\n                    <comment />\n                </attribute_entity>\n                <version translate=\"label type comment\">\n                    <label>You can set the version of your generated module.</label>\n                    <type>Feature</type>\n                    <comment>No more hard coded 0.0.1 version.</comment>\n                </version>\n                <source_refactor translate=\"label type comment\">\n                    <label>Source file refactoring</label>\n                    <type>Refactor</type>\n                    <comment>Because some IDEs show errors when parsing incomplete PHP files I've removed the extension of the source files (etc/source)</comment>\n                </source_refactor>\n                <js_refactor translate=\"label type comment\">\n                    <label>Refactored JS</label>\n                    <type>Refactor</type>\n                    <comment>The UI of the module creator now uses prototype classes instead of simple JS functions.</comment>\n                </js_refactor>\n                <ui_refactor translate=\"label type comment\">\n                    <label>UI refactor</label>\n                    <type>Refactor</type>\n                    <comment>'Pimped up' the UI of the module creator</comment>\n                </ui_refactor>\n                <theme translate=\"label type comment\">\n                    <label>Removed frontend package and theme fields</label>\n                    <type>Refactor</type>\n                    <comment>base/default is used for all modules.</comment>\n                </theme>\n                <identation translate=\"label type comment\">\n                    <label>Changed identation from TAB to 4x space</label>\n                    <type>Refactor</type>\n                    <comment />\n                </identation>\n                <speed translate=\"label type comment\">\n                    <label>Improved speed of the module creator</label>\n                    <type>Improvement</type>\n                    <comment>No more AJAX calls to add an entity/attribute. The module save is done in the same step as validation.</comment>\n                </speed>\n                <uninstall translate=\"label type comment\">\n                    <label>Module creator generate sql uninstall script</label>\n                    <type>Improvement</type>\n                    <comment>Along with the list of generated files now an sql uninstall script is generated for the created module.</comment>\n                </uninstall>\n                <ucwords translate=\"label type comment\">\n                    <label>Fixed bug that appears when there is an uppercase letter in the module name.</label>\n                    <type>Bug fix</type>\n                    <comment>In previous version 'ModuleName' was not working on UNIX servers. Only 'Modulename'. This is fixed in this version.</comment>\n                </ucwords>\n            </data>\n        </v1_9_0_dev1>\n    </release_notes>\n    <thanks><!-- no need to translate -->\n        <carco>\n            <to>@carco</to>\n            <for>Thanks for the abstract image helper implementation. and \"cârcoteli\"</for>\n        </carco>\n        <magepsycho>\n            <to>@MagePsycho</to>\n            <for>Thanks for the free testing and the good ideas.</for>\n        </magepsycho>\n        <nadirs>\n            <to>@nadirs</to>\n            <for><![CDATA[Thanks for these fixes. <a href=\"https://github.com/tzyganu/UMC1.9/pull/6\" target=\"_blank\">#6</a>, <a href=\"https://github.com/tzyganu/UMC1.9/pull/8\" target=\"_blank\">#8</a> and <a href=\"https://github.com/tzyganu/UMC1.9/pull/11\" target=\"_blank\">#11</a>]]></for>\n        </nadirs>\n        <access3000>\n            <to>@access3000</to>\n            <for>Thanks for the free testing and the submitted issues. I would have never found them.</for>\n        </access3000>\n        <greenwellness>\n            <to>@greenwellness</to>\n            <for>Thanks for the free testing and good ideas.</for>\n        </greenwellness>\n        <dmanners>\n            <to>@mannersd</to>\n            <for><![CDATA[<a target=\"_blank\" href=\"http://magento.stackexchange.com/a/32718/146\">Showing me how to create correct links to category edit pages</a>]]></for>\n        </dmanners>\n        <ahmed90>\n            <to>@ahmed90</to>\n            <for><![CDATA[Thanks the help with the category relation for entities.]]></for>\n        </ahmed90>\n        <dfelton>\n            <to>@dfelton</to>\n            <for><![CDATA[Thanks for the awesome pull requests and the free testing.]]></for>\n        </dfelton>\n    </thanks>\n</config>\n"
  },
  {
    "path": "app/code/community/Ultimate/ModuleCreator/etc/umc_source.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n/**\n* Ultimate_ModuleCreator extension\n*\n* NOTICE OF LICENSE\n*\n* This source file is subject to the MIT License\n* that is bundled with this package in the file LICENSE_UMC.txt.\n* It is also available through the world-wide-web at this URL:\n* http://opensource.org/licenses/mit-license.php\n*\n* @category       Ultimate\n* @package        Ultimate_ModuleCreator\n* @copyright      Copyright (c) 2014\n* @license        http://opensource.org/licenses/mit-license.php MIT License\n* @author         Marius Strajeru <ultimate.module.creator@gmail.com>\n*/\n-->\n<config>\n    <files>\n        <declaration_file translate=\"title description condition\" module=\"modulecreator\">\n            <title>Module declaration xml</title>\n            <description>The module declaration file.</description>\n            <condition>This is always generated.</condition>\n            <scope>global</scope>\n            <filetype>xml</filetype>\n            <source>app/etc/modules/Namespace_Module/</source>\n            <destination>app/etc/modules/{{Namespace}}_{{Module}}.xml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </declaration_file>\n\n        <block_rss translate=\"title description condition\" module=\"modulecreator\">\n            <title>Module RSS block.</title>\n            <description>A block added to the RSS feed list</description>\n            <condition>Generated if at least an entity has RSS enabled.</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <rss/>\n            </depend>\n            <source>app/code/Block/Rss/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Rss.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </block_rss>\n\n        <entity_admin_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin block.</title>\n            <description>This is the main admin block for the entities. The grid container</description>\n            <condition>Is generated if the entity does not behave as tree</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <not_is_tree/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <eav>\n                    <name>020_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </eav>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </entity_admin_block>\n\n        <entity_admin_edit_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin edit block.</title>\n            <description>This is the entity admin edit block: form container</description>\n            <condition>This is always generated.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <source>app/code/Block/Adminhtml/Entity/Edit/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <tree>\n                    <name>020_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </tree>\n                <not_tree>\n                    <name>030_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </not_tree>\n            </code>\n        </entity_admin_edit_block>\n\n        <entity_admin_edit_form_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin edit form block.</title>\n            <description>This is the entity admin edit form block</description>\n            <condition>This is always generated.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Form/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Form.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <prepare_form>\n                    <name>020_prepare_form</name>\n                    <depend>\n                        <not_is_tree/>\n                        <is_flat />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </prepare_form>\n                <prepare_form_eav>\n                    <name>025_prepare_form_eav</name>\n                    <depend>\n                        <not_is_tree/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>25</sort_order>\n                </prepare_form_eav>\n                <tree_top>\n                    <name>030_tree_top</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </tree_top>\n                <product_relation>\n                    <name>040_product_relation</name>\n                    <depend>\n                        <is_tree/>\n                        <link_product/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </product_relation>\n                <entity_relation>\n                    <name>050_entity_relation</name>\n                    <scope>siblings</scope>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </entity_relation>\n                <footer>\n                    <name>060_footer</name>\n                    <sort_order>60</sort_order>\n                </footer>\n            </code>\n        </entity_admin_edit_form_block>\n\n        <entity_admin_abstract_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin abstract block.</title>\n            <description>This is a block used as parent for different tree behaving entities blocks</description>\n            <condition>This is genereted for entities that behave as tree.</condition>\n            <depend>\n                <is_tree/>\n            </depend>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <source>app/code/Block/Adminhtml/Entity/Abstract/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Abstract.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_abstract_block>\n\n        <entity_file_helper_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity form file renderer.</title>\n            <description>This is the rendered for file fields.</description>\n            <condition>It is generated for entities that have at least a file field</condition>\n            <source>app/code/Block/Adminhtml/Entity/Helper/File/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Helper/File.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_file/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_file_helper_block>\n\n        <entity_tree_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree block.</title>\n            <description>This is the rendered for file fields.</description>\n            <condition>It is generated for entities that have at least a file field</condition>\n            <source>app/code/Block/Adminhtml/Entity/Tree/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Tree.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_tree/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <store_switcher>\n                    <name>020_store_switcher</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </store_switcher>\n                <content>\n                    <name>030_content</name>\n                    <sort_order>30</sort_order>\n                </content>\n                <eav>\n                    <name>040_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </eav>\n                <methods>\n                    <name>050_methods</name>\n                    <sort_order>50</sort_order>\n                </methods>\n                <store_switcher_block>\n                    <name>060_store_switcher_block</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>60</sort_order>\n                </store_switcher_block>\n                <footer>\n                    <name>070_footer</name>\n                    <sort_order>70</sort_order>\n                </footer>\n            </code>\n        </entity_tree_block>\n\n        <entity_widget_chooser_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity widget chooser .</title>\n            <description>This helps you choose your widget entity.</description>\n            <condition>It is generated for entities that have widgets enabled</condition>\n            <source>app/code/Block/Adminhtml/Entity/Widget/Chooser/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Widget/Chooser.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <widget/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </not_tree>\n                <not_tree_eav>\n                    <name>030_not_tree_eav</name>\n                    <depend>\n                        <not_is_tree/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </not_tree_eav>\n                <not_tree_content>\n                    <name>040_not_tree_content</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </not_tree_content>\n                <not_tree_store>\n                    <name>050_not_tree_store</name>\n                    <depend>\n                        <not_is_tree/>\n                        <store />\n                    </depend>\n                    <sort_order>50</sort_order>\n                </not_tree_store>\n                <not_tree_footer>\n                    <name>060_not_tree_footer</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </not_tree_footer>\n                <not_tree_flat>\n                    <name>070_not_tree_flat</name>\n                    <depend>\n                        <not_is_tree />\n                        <is_flat />\n                    </depend>\n                    <sort_order>70</sort_order>\n                </not_tree_flat>\n                <tree>\n                    <name>080_tree</name>\n                    <sort_order>80</sort_order>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                </tree>\n                <footer>\n                    <name>090_footer</name>\n                    <sort_order>90</sort_order>\n                </footer>\n            </code>\n        </entity_widget_chooser_block>\n\n        <entity_product_list_block>\n            <title>Entity product list block</title>\n            <description>Block that lists associated products on entity page.</description>\n            <condition>It is generated for entities that are related to products.</condition>\n            <source>app/code/Block/Entity/Catalog/Product/List/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Catalog/Product/List.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_products/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_product_list_block>\n\n        <entity_category_list_block>\n            <title>Entity category list block</title>\n            <description>Block that lists associated categories on entity page.</description>\n            <condition>It is generated for entities that are related to categories.</condition>\n            <source>app/code/Block/Entity/Catalog/Category/List/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Catalog/Category/List.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_category />\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_category_list_block>\n\n        <product_entity_list_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity list on product page</title>\n            <description>This block is used to show the entities related to the product on the product list.</description>\n            <condition>It is generated for entities are linked with products and are set to appear in the product list.</condition>\n            <source>app/code/Block/Catalog/Product/List/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Catalog/Product/List/{{Entity}}.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_on_product/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <store>\n                    <name>020_store</name>\n                    <depend>\n                        <store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </store>\n                <eav>\n                    <name>030_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </eav>\n                <not_eav>\n                    <name>040_not_eav</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </not_eav>\n                <footer>\n                    <name>050_footer</name>\n                    <sort_order>50</sort_order>\n                </footer>\n            </code>\n        </product_entity_list_block>\n\n        <category_entity_list_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity list on category page</title>\n            <description>This block is used to show the entities related to the category on the category list.</description>\n            <condition>It is generated for entities are linked with products and are set to appear in the product list.</condition>\n            <source>app/code/Block/Catalog/Category/List/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Catalog/Category/List/{{Entity}}.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_on_category/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <store>\n                    <name>020_store</name>\n                    <depend>\n                        <store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </store>\n                <eav>\n                    <name>030_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </eav>\n                <not_eav>\n                    <name>040_not_eav</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </not_eav>\n                <footer>\n                    <name>050_footer</name>\n                    <sort_order>50</sort_order>\n                </footer>\n            </code>\n        </category_entity_list_block>\n\n        <entity_list_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity list page</title>\n            <description>This block lists your entities.</description>\n            <condition>It is generated for entities that have frontend list enabled</condition>\n            <source>app/code/Block/Entity/List/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/List.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <can_create_list_block/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <stores>\n                    <name>020_stores</name>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </stores>\n                <attributes>\n                    <name>030_attributes</name>\n                    <depend>\n                        <is_eav/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </attributes>\n                <status>\n                    <name>040_status</name>\n                    <sort_order>40</sort_order>\n                    <depend>\n                        <is_flat/>\n                    </depend>\n                </status>\n                <not_tree>\n                    <name>050_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </not_tree>\n                <tree_flat>\n                    <name>060_tree_flat</name>\n                    <depend>\n                        <is_tree/>\n                        <is_flat />\n                    </depend>\n                    <sort_order>60</sort_order>\n                </tree_flat>\n                <tree_eav>\n                    <name>070_tree_eav</name>\n                    <depend>\n                        <is_tree/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>70</sort_order>\n                </tree_eav>\n                <footer>\n                    <name>080_footer</name>\n                    <sort_order>80</sort_order>\n                </footer>\n            </code>\n        </entity_list_block>\n\n        <entity_image_helper_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity form image renderer.</title>\n            <description>This is the rendered for image fields.</description>\n            <condition>It is generated for entities that have at least an image field</condition>\n            <source>app/code/Block/Adminhtml/Entity/Helper/Image/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Helper/Image.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_image/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_image_helper_block>\n\n        <entity_rss_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity RSS block.</title>\n            <description>This block handles the rss generation for an entity.</description>\n            <condition>It is generated for entities that have RSS enabled</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <rss/>\n            </depend>\n            <source>app/code/Block/Entity/Rss/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Rss.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <stores>\n                    <name>020_stores</name>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </stores>\n                <eav>\n                    <name>025_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>25</sort_order>\n                </eav>\n                <content>\n                    <name>030_content</name>\n                    <sort_order>30</sort_order>\n                </content>\n                <tree>\n                    <name>035_tree</name>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                    <sort_order>35</sort_order>\n                </tree>\n                <attributes>\n                    <name>040_attributes</name>\n                    <scope>attribute</scope>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </attributes>\n                <footer>\n                    <name>050_footer</name>\n                    <sort_order>50</sort_order>\n                </footer>\n            </code>\n        </entity_rss_block>\n\n        <entity_sibling_list_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity sibling list block</title>\n            <description>This block lists the siblings of an entity</description>\n            <condition>This is generated for entities that have siblings</condition>\n            <scope>siblings</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_frontend_relation_siblings/>\n            </depend>\n            <source>app/code/Block/Entity/Sibling/List/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/{{Sibling}}/List.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_sibling_list_block>\n\n        <entity_widget_link_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity link widget block</title>\n            <description>This block handles the entity link widget.</description>\n            <condition>Is generated for entities that have widgets enabled</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <widget/>\n            </depend>\n            <source>app/code/Block/Entity/Widget/Link/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Widget/Link.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_widget_link_block>\n\n        <entity_widget_view_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity view widget block</title>\n            <description>This block handles the entity view widget.</description>\n            <condition>Is generated for entities that have widgets enabled</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <widget/>\n            </depend>\n            <source>app/code/Block/Entity/Widget/View/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Widget/View.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <depend>\n                        <not_is_tree />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </not_tree>\n                <tree>\n                    <name>030_tree</name>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </entity_widget_view_block>\n\n        <entity_widget_subtree_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity subtree widget block</title>\n            <description>This block handles the subtree view widget.</description>\n            <condition>Is generated for entities that have widgets enabled and behave as tree</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <widget/>\n                <is_tree/>\n            </depend>\n            <source>app/code/Block/Entity/Widget/Subtree/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Widget/Subtree.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_widget_subtree_block>\n\n        <product_entity_tab translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity tab on product form</title>\n            <description>This is the block for the entity tab on the product add/edit form</description>\n            <condition>s generated for any entity that is related many to many with products</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <link_product/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Catalog/Product/Edit/Tab/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/Catalog/Product/Edit/Tab/{{Entity}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <sort_order>20</sort_order>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                </not_tree>\n                <tree>\n                    <name>030_tree</name>\n                    <sort_order>30</sort_order>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                </tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </product_entity_tab>\n\n        <category_entity_tab translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity tab on product form</title>\n            <description>This is the block for the entity tab on the category add/edit form</description>\n            <condition>s generated for any entity that is related many to many with categories</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <link_category/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Catalog/Category/Tab/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/Catalog/Category/Tab/{{Entity}}.php</destination>\n            <code>\n                <tree>\n                    <name>010_tree</name>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                    <sort_order>10</sort_order>\n                </tree>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <depend>\n                        <not_is_tree />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </not_tree>\n            </code>\n        </category_entity_tab>\n\n        <entity_view_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity view block</title>\n            <description>This is the entity view page main block.</description>\n            <condition>It is generated for entities that have a frontend view enabled</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <create_view/>\n            </depend>\n            <source>app/code/Block/Entity/View/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/View.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_view_block>\n\n        <entity_child_list_block>\n            <title>Entity children list block</title>\n            <description>Block that lists the entity child entities.</description>\n            <condition>It is generated for entities in parent/child relation</condition>\n            <source>app/code/Block/Entity/Child/List/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/{{Sibling}}/List.php</destination>\n            <scope>children</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_frontend_relation_children/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_child_list_block>\n\n        <entity_children_list_block>\n            <title>Entity child nodes list block</title>\n            <description>Block that lists the entity child nodes.</description>\n            <condition>It is generated for tree entities that have frontend enabled.</condition>\n            <source>app/code/Block/Entity/Children/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Children.php</destination>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <create_view/>\n                <is_tree/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_children_list_block>\n\n        <wysiwyg_helper_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>WISIWYG helper block.</title>\n            <description>Helper block for tree attributes with editors</description>\n            <condition>Generated if there is at least one tree entity that has an attribute that uses WYSIWYG editor</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <editor/>\n                <has_tree/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Helper/Wysiwyg/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/Helper/Wysiwyg.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </wysiwyg_helper_block>\n\n        <fieldset_renderer_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Element renderer for EAV attributes.</title>\n            <description>Renderer used for EAV attribute form</description>\n            <condition>Generated if there is at least one EAV entity </condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Module/Renderer/Fieldset/Element/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{ModuleFolder}}/Renderer/Fieldset/Element.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </fieldset_renderer_block>\n\n        <wysiwyg_content_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Helper for WYSIWYG attributes.</title>\n            <description>Helper for WYSIWYG attributes.</description>\n            <condition>Generated if there is at least one EAV entity </condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Module/Helper/Form/Wysiwyg/Content/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{ModuleFolder}}/Helper/Form/Wysiwyg/Content.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </wysiwyg_content_block>\n\n        <entity_form_tabs translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin tabs block.</title>\n            <description>Block used to generate the tabs in the admin add/edit form.</description>\n            <condition>Is always generated</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Tabs/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tabs.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <flat_not_tree_prepare>\n                    <name>020_flat_not_tree_prepare</name>\n                    <depend>\n                        <not_is_tree/>\n                        <is_flat/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </flat_not_tree_prepare>\n                <flat_tree_prepare>\n                    <name>030_flat_tree_prepare</name>\n                    <depend>\n                        <is_tree/>\n                        <is_flat/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </flat_tree_prepare>\n                <eav_prepare_top>\n                    <name>040_eav_prepare_top</name>\n                    <depend>\n                        <is_eav/>\n                        <not_is_tree />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </eav_prepare_top>\n                <eav_tree_prepare_top>\n                    <name>042_eav_tree_prepare_top</name>\n                    <depend>\n                        <is_eav/>\n                        <is_tree />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </eav_tree_prepare_top>\n                <eav_seo_prepare>\n                    <name>043_eav_seo_prepare</name>\n                    <depend>\n                        <is_eav />\n                        <add_seo />\n                    </depend>\n                    <sort_order>43</sort_order>\n                </eav_seo_prepare>\n                <eav_prepare_bottom>\n                    <name>047_eav_prepare_bottom</name>\n                    <depend>\n                        <is_eav/>\n                    </depend>\n                    <sort_order>47</sort_order>\n                </eav_prepare_bottom>\n                <eav_prepare_bottom_tree>\n                    <name>048_eav_prepare_bottom_tree</name>\n                    <depend>\n                        <is_eav/>\n                        <is_tree />\n                    </depend>\n                    <sort_order>48</sort_order>\n                </eav_prepare_bottom_tree>\n                <eav_prepare_real_bottom>\n                    <name>049_eav_prepare_real_bottom</name>\n                    <depend>\n                        <is_eav/>\n                    </depend>\n                    <sort_order>49</sort_order>\n                </eav_prepare_real_bottom>\n                <seo>\n                    <name>050_seo</name>\n                    <depend>\n                        <add_seo />\n                        <is_flat />\n                    </depend>\n                    <sort_order>50</sort_order>\n                </seo>\n                <seo_eav>\n                    <name>055_seo_eav</name>\n                    <depend>\n                        <add_seo />\n                        <is_eav />\n                    </depend>\n                    <sort_order>55</sort_order>\n                </seo_eav>\n                <stores>\n                    <name>060_stores</name>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </stores>\n                <relation_not_tree>\n                    <name>070_relation_not_tree</name>\n                    <scope>siblings</scope>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </relation_not_tree>\n                <relation_tree>\n                    <name>080_relation_tree</name>\n                    <scope>siblings</scope>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </relation_tree>\n                <product_relation_not_tree>\n                    <name>090_product_relation_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                        <link_product/>\n                    </depend>\n                    <sort_order>90</sort_order>\n                </product_relation_not_tree>\n                <product_relation_tree>\n                    <name>100_product_relation_tree</name>\n                    <depend>\n                        <is_tree/>\n                        <link_product/>\n                    </depend>\n                    <sort_order>100</sort_order>\n                </product_relation_tree>\n\n                <category_relation_not_tree>\n                    <name>110_category_relation_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                        <link_category/>\n                    </depend>\n                    <sort_order>110</sort_order>\n                </category_relation_not_tree>\n                <category_relation_tree>\n                    <name>120_category_relation_tree</name>\n                    <depend>\n                        <is_tree/>\n                        <link_category/>\n                    </depend>\n                    <sort_order>120</sort_order>\n                </category_relation_tree>\n\n                <end_prepare_not_tree>\n                    <name>130_end_prepare_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>130</sort_order>\n                </end_prepare_not_tree>\n                <end_prepare_tree>\n                    <name>140_end_prepare_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>140</sort_order>\n                </end_prepare_tree>\n                <footer>\n                    <name>150_footer</name>\n                    <sort_order>150</sort_order>\n                </footer>\n            </code>\n        </entity_form_tabs>\n\n        <store_selection_tab_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin stores tab.</title>\n            <description>From this tab you can select the store to publish your entity.</description>\n            <condition>It is generated for entities that can be set to stores.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <store/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Tab/Stores/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/Stores.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </store_selection_tab_block>\n        <entity_admin_meta_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin tab for meta data.</title>\n            <description>From this tab you can set the meta attribute values for the entity.</description>\n            <condition>It is generated for entities that have frontend view enabled and meta attributes enabled</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <add_seo/>\n                <is_flat />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Tab/Meta/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/Meta.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_meta_block>\n\n        <entity_admin_product_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin tab product relation.</title>\n            <description>From this tab you can set the related products to your entity.</description>\n            <condition>It is generated for entities that have link to products enabled</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <link_product/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Tab/Product/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/Product.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_product_block>\n\n        <entity_admin_category_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin tab category relation.</title>\n            <description>From this tab you can set the related categories to your entity.</description>\n            <condition>It is generated for entities that have link to categories enabled</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <link_category/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Tab/Categories/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/Categories.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_category_block>\n\n        <entity_admin_sibling_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin siblings tab.</title>\n            <description>From this tab you can set the related entities.</description>\n            <condition>It is generated for entities that are siblings with your current entity</condition>\n            <scope>siblings</scope>\n            <filetype>php</filetype>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Tab/Sibling/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/{{Sibling}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <depend>\n                        <sibling_is_not_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </not_tree>\n                <tree>\n                    <name>030_tree</name>\n                    <depend>\n                        <sibling_is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </entity_admin_sibling_block>\n\n        <entity_admin_form_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin Entity edit form.</title>\n            <description>This is the block with all the entity fields.</description>\n            <condition>It is generated for flat entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_flat/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Tab/Form/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/Form.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <image>\n                    <name>020_image</name>\n                    <depend>\n                        <has_image/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </image>\n                <file>\n                    <name>030_file</name>\n                    <depend>\n                        <has_file/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </file>\n\n                <wysiwyg>\n                    <name>040_wysiwyg</name>\n                    <depend>\n                        <editor/>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </wysiwyg>\n                <wysiwyg_is_tree>\n                    <name>050_wysiwyg_is_tree</name>\n                    <depend>\n                        <editor/>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </wysiwyg_is_tree>\n                <path_tree>\n                    <name>060_path_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </path_tree>\n                <parents>\n                    <name>070_parents</name>\n                    <scope>parents</scope>\n                    <sort_order>70</sort_order>\n                </parents>\n                <attributes>\n                    <name>080_attributes</name>\n                    <scope>attribute</scope>\n                    <sort_order>80</sort_order>\n                </attributes>\n                <url_rewrite>\n                    <name>090_url_rewrite</name>\n                    <depend>\n                        <url_rewrite/>\n                    </depend>\n                    <sort_order>90</sort_order>\n                </url_rewrite>\n                <status>\n                    <name>100_status</name>\n                    <sort_order>100</sort_order>\n                </status>\n                <rss>\n                    <name>110_rss</name>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>120</sort_order>\n                </rss>\n                <stores>\n                    <name>120_stores</name>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>120</sort_order>\n                </stores>\n                <allow_comment>\n                    <name>130_allow_comment</name>\n                    <depend>\n                        <allow_comment/>\n                    </depend>\n                    <sort_order>130</sort_order>\n                </allow_comment>\n                <add_values_not_tree>\n                    <name>140_add_values_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>140</sort_order>\n                </add_values_not_tree>\n                <add_values_tree>\n                    <name>150_add_values_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>150</sort_order>\n                </add_values_tree>\n                <get_entity_tree>\n                    <name>160_get_entity_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>160</sort_order>\n                </get_entity_tree>\n                <footer>\n                    <name>170_footer</name>\n                    <sort_order>170</sort_order>\n                </footer>\n            </code>\n        </entity_admin_form_block>\n\n        <entity_admin_attributes_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin Entity attributes form.</title>\n            <description>This is the block with the entity attributes.</description>\n            <condition>It is generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Edit/Tab/Attributes/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Edit/Tab/Attributes.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <tree>\n                    <name>020_tree</name>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </tree>\n                <default_values>\n                    <name>021_default_values</name>\n                    <sort_order>21</sort_order>\n                </default_values>\n                <default_values_tree>\n                    <name>022_default_values_tree</name>\n                    <sort_order>22</sort_order>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                </default_values_tree>\n                <layout>\n                    <name>023_layout</name>\n                    <sort_order>23</sort_order>\n                </layout>\n                <after_html_top>\n                    <name>025_after_html_top</name>\n                    <sort_order>25</sort_order>\n                    <depend>\n                        <has_parent_relation />\n                    </depend>\n                </after_html_top>\n                <after_html>\n                    <name>026_after_html</name>\n                    <sort_order>26</sort_order>\n                    <scope>parents</scope>\n                </after_html>\n                <after_html_footer>\n                    <name>027_after_html_footer</name>\n                    <sort_order>27</sort_order>\n                    <depend>\n                        <has_parent_relation />\n                    </depend>\n                </after_html_footer>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </entity_admin_attributes_block>\n\n        <entity_admin_comments_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin comments block</title>\n            <description>Main block for viewing comments.</description>\n            <condition>For entities that support comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Comment/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Comment.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_comments_block>\n\n        <entity_admin_comments_grid_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin comments grid block</title>\n            <description>Grid block for viewing comments.</description>\n            <condition>For entities that support comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Comment/Grid/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Comment/Grid.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <store_data>\n                    <name>013_store_data</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>13</sort_order>\n                </store_data>\n                <prepare>\n                    <name>016_prepare</name>\n                    <sort_order>16</sort_order>\n                </prepare>\n                <stores>\n                    <name>020_stores</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </stores>\n                <content>\n                    <name>030_content</name>\n                    <sort_order>30</sort_order>\n                </content>\n                <store_filter>\n                    <name>040_store_filter</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </store_filter>\n                <footer>\n                    <name>050_footer</name>\n                    <sort_order>50</sort_order>\n                </footer>\n            </code>\n        </entity_admin_comments_grid_block>\n\n        <entity_admin_comments_edit_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin edit comments block</title>\n            <description>Main block for editing comments.</description>\n            <condition>For entities that support comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Comment/Edit/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Comment/Edit.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_comments_edit_block>\n\n        <entity_admin_comments_edit_tabs_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin edit comments tabs block</title>\n            <description>Tabs for editing comments.</description>\n            <condition>For entities that support comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Comment/Edit/Tabs/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Comment/Edit/Tabs.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <stores>\n                    <name>020_stores</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </stores>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </entity_admin_comments_edit_tabs_block>\n\n        <entity_admin_comments_edit_tab_form_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin edit comments main tab block</title>\n            <description>Main tab for editing comments.</description>\n            <condition>For entities that support comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Comment/Edit/Tab/Form/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Comment/Edit/Tab/Form.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <stores>\n                    <name>020_stores</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </stores>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </entity_admin_comments_edit_tab_form_block>\n\n        <entity_admin_comments_edit_tab_stores_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin edit comments stores tab block</title>\n            <description>Stores tab for editing comments.</description>\n            <condition>For entities that support comments by store</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment_by_store />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Comment/Edit/Tab/Stores/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Comment/Edit/Tab/Stores.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_comments_edit_tab_stores_block>\n\n        <entity_admin_comments_edit_form_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin edit comments form container block</title>\n            <description>Form container block for editing comments.</description>\n            <condition>For entities that support comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Comment/Edit/Form/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Comment/Edit/Form.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_comments_edit_form_block>\n\n        <entity_grid translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin grid.</title>\n            <description>This is the entity admin grid. file</description>\n            <condition>Is generated if the entity does not behave as tree</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <not_is_tree/>\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Grid/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Grid.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <parents>\n                    <name>020_parents</name>\n                    <scope>parents</scope>\n                    <sort_order>20</sort_order>\n                </parents>\n                <name_attribute>\n                    <name>030_name_attribute</name>\n                    <sort_order>30</sort_order>\n                </name_attribute>\n                <grid_attributes>\n                    <name>040_grid_attributes</name>\n                    <scope>attribute</scope>\n                    <depend>\n                        <admin_grid/>\n                        <not_is_name/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </grid_attributes>\n                <url_rewrite>\n                    <name>050_url_rewrite</name>\n                    <depend>\n                        <url_rewrite/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </url_rewrite>\n                <stores>\n                    <name>060_stores</name>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </stores>\n                <created_at>\n                    <name>070_created_at</name>\n                    <depend>\n                        <add_created_to_grid/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </created_at>\n                <updated_at>\n                    <name>080_updated_at</name>\n                    <depend>\n                        <add_updated_to_grid/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </updated_at>\n                <columns_footer>\n                    <name>090_columns_footer</name>\n                    <sort_order>90</sort_order>\n                </columns_footer>\n                <eav_functions>\n                    <name>100_eav_functions</name>\n                    <depend>\n                        <is_eav/>\n                    </depend>\n                    <sort_order>100</sort_order>\n                </eav_functions>\n                <mass_action_top>\n                    <name>110_mass_action_top</name>\n                    <sort_order>110</sort_order>\n                </mass_action_top>\n                <mass_action_flags>\n                    <name>120_mass_action_flags</name>\n                    <scope>attribute</scope>\n                    <depend>\n                        <mass_update />\n                    </depend>\n                    <sort_order>120</sort_order>\n                </mass_action_flags>\n                <mass_action_parents>\n                    <name>130_mass_action_parents</name>\n                    <scope>parents</scope>\n                    <sort_order>130</sort_order>\n                </mass_action_parents>\n                <collection_end>\n                    <name>140_collection_end</name>\n                    <sort_order>140</sort_order>\n                </collection_end>\n                <collection_walk>\n                    <name>145_collection_walk</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>145</sort_order>\n                </collection_walk>\n                <store_filter>\n                    <name>150_store_filter</name>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>150</sort_order>\n                </store_filter>\n                <footer>\n                    <name>160_footer</name>\n                    <sort_order>160</sort_order>\n                </footer>\n            </code>\n        </entity_grid>\n\n        <entity_attribute_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Manage attributes block.</title>\n            <description>Block used for managing EAV attribute</description>\n            <condition>Generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Attribute/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Attribute.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_attribute_block>\n\n        <entity_attribute_edit_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Manage attributes edit block.</title>\n            <description>Edit block used for managing EAV attribute</description>\n            <condition>Generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Attribute/Edit/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Attribute/Edit.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_attribute_edit_block>\n        <entity_attribute_edit_form_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Manage attributes form block.</title>\n            <description>Form block used for managing EAV attribute</description>\n            <condition>Generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Attribute/Edit/Form/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Attribute/Edit/Form.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_attribute_edit_form_block>\n\n        <entity_attribute_edit_tabs_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Manage attributes form tabs block.</title>\n            <description>Tabs block used for managing EAV attribute</description>\n            <condition>Generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Attribute/Edit/Tabs/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Attribute/Edit/Tabs.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_attribute_edit_tabs_block>\n\n        <entity_attribute_edit_main_tab_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Manage attributes form main tab block.</title>\n            <description>Main tab block used for managing EAV attribute</description>\n            <condition>Generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Attribute/Edit/Tab/Main/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Attribute/Edit/Tab/Main.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_attribute_edit_main_tab_block>\n\n        <entity_attribute_edit_options_tab_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Manage attributes form options tab block.</title>\n            <description>Options tab block used for managing EAV attribute</description>\n            <condition>Generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Attribute/Edit/Tab/Options/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Attribute/Edit/Tab/Options.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_attribute_edit_options_tab_block>\n\n        <entity_attribute_grid_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Attributes grid.</title>\n            <description>Grid block used for managing EAV attribute</description>\n            <condition>Generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Block/Adminhtml/Entity/Attribute/Grid/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/{{Entity}}/Attribute/Grid.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_attribute_grid_block>\n\n        <entity_comment_list_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Frontend comments for entity</title>\n            <description>Block used to display the entity comments on frontend</description>\n            <condition>Generated for entities that support comments.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Entity/Comment/List/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Comment/List.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <stores>\n                    <name>020_stores</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </stores>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </entity_comment_list_block>\n\n        <entity_comment_form_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Frontend comments form for entity</title>\n            <description>Block used to add comments on frontend</description>\n            <condition>Generated for entities that support comments.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Entity/Comment/Form/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Comment/Form.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_comment_form_block>\n\n        <entity_admin_attribute_controller translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin attribute controller.</title>\n            <description>Controller used for managing entity attributes</description>\n            <condition>Generated for each eav entity.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/Entity/AttributeController/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}/AttributeController.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_attribute_controller>\n        <base_controller translate=\"title description condition\" module=\"modulecreator\">\n            <title>Module base admin controller.</title>\n            <description>Controller used to create other module controllers</description>\n            <condition>Generated if there is at least a flat entity.</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_flat />\n            </depend>\n            <source>app/code/Controller/Adminhtml/Module/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Controller/Adminhtml/{{Module}}.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </base_controller>\n\n        <router translate=\"title description condition\" module=\"modulecreator\">\n            <title>Router</title>\n            <description>Router for matching url rewrites</description>\n            <condition>Generated if at least one entity has url rewrites enabled.</condition>\n            <filetype>php</filetype>\n            <scope>global</scope>\n            <depend>\n                <url_rewrite/>\n            </depend>\n            <source>app/code/Controller/Router/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Controller/Router.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity>\n                    <name>020_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <url_rewrite/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </router>\n\n        <entity_front_controller translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity frontend controller</title>\n            <description>This controller handles the frontend request for an entity</description>\n            <condition>Is generated if and entity has frontend pages.</condition>\n            <scope>entity</scope>\n            <depend>\n                <create_frontend/>\n            </depend>\n            <source>app/code/controllers/EntityController/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/{{Entity}}Controller.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <list>\n                    <name>020_list</name>\n                    <depend>\n                        <create_list/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </list>\n                <list_seo>\n                    <name>030_list_seo</name>\n                    <depend>\n                        <create_list/>\n                        <add_seo/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </list_seo>\n                <list_footer>\n                    <name>040_list_footer</name>\n                    <depend>\n                        <create_list/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </list_footer>\n                <view>\n                    <name>050_view</name>\n                    <depend>\n                        <create_view/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </view>\n                <view_tree>\n                    <name>060_view_tree</name>\n                    <depend>\n                        <create_view/>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </view_tree>\n                <view2>\n                    <name>070_view2</name>\n                    <depend>\n                        <create_view/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </view2>\n                <breadcrumbs>\n                    <name>080_breadcrumbs</name>\n                    <depend>\n                        <create_view/>\n                        <create_list/>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </breadcrumbs>\n                <breadcrumbs_tree>\n                    <name>090_breadcrumbs_tree</name>\n                    <depend>\n                        <create_view/>\n                        <create_list/>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>90</sort_order>\n                </breadcrumbs_tree>\n                <breadcrumbs_footer>\n                    <name>100_breadcrumbs_footer</name>\n                    <depend>\n                        <create_view/>\n                    </depend>\n                    <sort_order>100</sort_order>\n                </breadcrumbs_footer>\n                <view_canonical>\n                    <name>105_view_canonical</name>\n                    <depend>\n                        <create_view />\n                    </depend>\n                    <sort_order>105</sort_order>\n                </view_canonical>\n                <view_seo>\n                    <name>110_view_seo</name>\n                    <depend>\n                        <create_view/>\n                        <add_seo/>\n                    </depend>\n                    <sort_order>110</sort_order>\n                </view_seo>\n                <view_footer>\n                    <name>120_view_footer</name>\n                    <depend>\n                        <create_view/>\n                    </depend>\n                    <sort_order>120</sort_order>\n                </view_footer>\n                <rss>\n                    <name>130_rss</name>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>130</sort_order>\n                </rss>\n                <comment>\n                    <name>140_comment</name>\n                    <depend>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>140</sort_order>\n                </comment>\n                <footer>\n                    <name>150_footer</name>\n                    <sort_order>150</sort_order>\n                </footer>\n            </code>\n        </entity_front_controller>\n\n        <entity_admin_product_controller translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity Admin product controller</title>\n            <description>Controller for handling entity-product relation requests</description>\n            <condition>Generated for entities linked many to many with products.</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <link_product/>\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/Entity/Catalog/ProductController/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}/Catalog/ProductController.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </not_tree>\n                <tree>\n                    <name>030_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </entity_admin_product_controller>\n\n        <entity_admin_category_controller translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity Admin category controller</title>\n            <description>Controller for handling entity-category relation requests</description>\n            <condition>Generated for entities linked many to many with categories.</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <link_category />\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/Entity/Catalog/CategoryController/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}/Catalog/CategoryController.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <depend>\n                        <not_is_tree />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </not_tree>\n                <tree>\n                    <name>030_tree</name>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </entity_admin_category_controller>\n\n\n        <entity_admin_comment_controller translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity comments admin controller</title>\n            <description>This controller handles the admin requestion for entity comments.</description>\n            <condition>Is generated if and entity allows comments.</condition>\n            <scope>entity</scope>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/Entity/CommentController/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}/CommentController.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_admin_comment_controller>\n\n        <entity_admin_widget_controller translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin widget controller.</title>\n            <description>This controller handles the admin widget requests.</description>\n            <condition>Is created for entities that have widgets enabled</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <widget/>\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/Entity/WidgetController/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}/WidgetController.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <tree>\n                    <name>020_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </tree>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </entity_admin_widget_controller>\n\n        <entity_admin_controller_flat_not_tree translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity admin controller for flat not tree entities.</title>\n            <description>This controller handles the admin entity requests.</description>\n            <condition>Generated for flat entities that don't behave as tree.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_flat/>\n                <not_is_tree/>\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/EntityControllerFlatNotTree/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}Controller.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <upload_image>\n                    <name>020_upload_image</name>\n                    <scope>attribute</scope>\n                    <depend_type>\n                        <image/>\n                    </depend_type>\n                    <sort_order>20</sort_order>\n                </upload_image>\n                <upload_file>\n                    <name>030_upload_files</name>\n                    <scope>attribute</scope>\n                    <depend_type>\n                        <file/>\n                    </depend_type>\n                    <sort_order>30</sort_order>\n                </upload_file>\n                <save_product_relation>\n                    <name>040_save_product_relation</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </save_product_relation>\n                <save_category_relation>\n                    <name>050_save_category_relation</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </save_category_relation>\n                <save_sibling_relation>\n                    <name>060_save_sibling_relation</name>\n                    <scope>siblings_not_tree</scope>\n                    <sort_order>60</sort_order>\n                </save_sibling_relation>\n                <save_sibling_relation_tree>\n                    <name>070_save_sibling_relation_tree</name>\n                    <scope>siblings_tree</scope>\n                    <sort_order>70</sort_order>\n                </save_sibling_relation_tree>\n                <save>\n                    <name>080_save</name>\n                    <sort_order>80</sort_order>\n                </save>\n                <exception_upload_image>\n                    <name>090_exception_upload</name>\n                    <scope>attribute</scope>\n                    <depend_type>\n                        <image/>\n                    </depend_type>\n                    <sort_order>90</sort_order>\n                </exception_upload_image>\n                <exception_upload_file>\n                    <name>090_exception_upload</name>\n                    <scope>attribute</scope>\n                    <depend_type>\n                        <file/>\n                    </depend_type>\n                    <sort_order>100</sort_order>\n                </exception_upload_file>\n                <exception>\n                    <name>100_exception</name>\n                    <sort_order>110</sort_order>\n                </exception>\n                <exception_upload_image2>\n                    <name>090_exception_upload</name>\n                    <scope>attribute</scope>\n                    <depend_type>\n                        <image/>\n                    </depend_type>\n                    <sort_order>120</sort_order>\n                </exception_upload_image2>\n                <exception_upload_file2>\n                    <name>090_exception_upload</name>\n                    <scope>attribute</scope>\n                    <depend_type>\n                        <file/>\n                    </depend_type>\n                    <sort_order>130</sort_order>\n                </exception_upload_file2>\n                <center>\n                    <name>110_center</name>\n                    <sort_order>140</sort_order>\n                </center>\n                <mass_update>\n                    <name>120_mass_update</name>\n                    <scope>attribute</scope>\n                    <depend>\n                        <mass_update />\n                    </depend>\n                    <sort_order>150</sort_order>\n                </mass_update>\n                <mass_parents>\n                    <name>130_mass_parents</name>\n                    <scope>parents</scope>\n                    <sort_order>160</sort_order>\n                </mass_parents>\n                <product_relation_actions>\n                    <name>140_product_relation_actions</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>170</sort_order>\n                </product_relation_actions>\n                <category_relation_actions>\n                    <name>150_category_relation_actions</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>180</sort_order>\n                </category_relation_actions>\n                <sibling_actions>\n                    <name>160_sibling_actions</name>\n                    <scope>siblings_not_tree</scope>\n                    <sort_order>180</sort_order>\n                </sibling_actions>\n                <sibling_actions_tree>\n                    <name>170_sibling_actions_tree</name>\n                    <scope>siblings_tree</scope>\n                    <sort_order>190</sort_order>\n                </sibling_actions_tree>\n                <footer>\n                    <name>180_footer</name>\n                    <sort_order>200</sort_order>\n                </footer>\n            </code>\n        </entity_admin_controller_flat_not_tree>\n\n        <entity_admin_controller_flat_tree translate=\"title description condition\" module=\"modulecreator\">\n            <title>Flat entity admin controller (tree).</title>\n            <description>This controller handles the admin entity requests.</description>\n            <condition>Generated for flat entities that behave as tree.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_flat/>\n                <is_tree/>\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/EntityControllerFlatTree/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}Controller.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <wysiwyg>\n                    <name>020_wysiwyg</name>\n                    <depend>\n                        <editor/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </wysiwyg>\n                <save>\n                    <name>030_save</name>\n                    <sort_order>30</sort_order>\n                </save>\n                <upload_image>\n                    <name>040_upload_image</name>\n                    <scope>attribute</scope>\n                    <depend_type>\n                        <image/>\n                    </depend_type>\n                    <sort_order>40</sort_order>\n                </upload_image>\n                <upload_file>\n                    <name>050_upload_file</name>\n                    <scope>attribute</scope>\n                    <depend_type>\n                        <file/>\n                    </depend_type>\n                    <sort_order>50</sort_order>\n                </upload_file>\n                <save_continue>\n                    <name>060_save_continue</name>\n                    <sort_order>60</sort_order>\n                </save_continue>\n                <product_data>\n                    <name>070_product_data</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </product_data>\n                <category_data>\n                    <name>080_category_data</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </category_data>\n\n                <sibling_data>\n                    <name>090_sibling_data</name>\n                    <scope>siblings</scope>\n                    <sort_order>90</sort_order>\n                </sibling_data>\n                <sibling_data_tree>\n                    <name>095_sibling_data_tree</name>\n                    <scope>siblings_tree</scope>\n                    <sort_order>95</sort_order>\n                </sibling_data_tree>\n                <real_save>\n                    <name>100_real_save</name>\n                    <sort_order>100</sort_order>\n                </real_save>\n                <product_relation_action>\n                    <name>110_product_relation_action</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>110</sort_order>\n                </product_relation_action>\n                <category_relation_action>\n                    <name>120_category_relation_action</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>120</sort_order>\n                </category_relation_action>\n                <sibling_actions>\n                    <name>130_sibling_actions</name>\n                    <scope>siblings_not_tree</scope>\n                    <sort_order>130</sort_order>\n                </sibling_actions>\n                <sibling_actions_tree>\n                    <name>135_sibling_actions_tree</name>\n                    <scope>siblings_tree</scope>\n                    <sort_order>135</sort_order>\n                </sibling_actions_tree>\n                <footer>\n                    <name>140_footer</name>\n                    <sort_order>140</sort_order>\n                </footer>\n            </code>\n        </entity_admin_controller_flat_tree>\n\n        <entity_admin_controller_eav_not_tree translate=\"title description condition\" module=\"modulecreator\">\n            <title>EAV entity admin controller (not tree).</title>\n            <description>This controller handles the admin entity requests.</description>\n            <condition>Generated for EAV entities that don't behave as tree.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav/>\n                <not_is_tree/>\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/EntityControllerEavNotTree/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}Controller.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <product_save>\n                    <name>020_save_product_relation</name>\n                    <depend>\n                        <link_product />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </product_save>\n                <category_save>\n                    <name>030_save_category_relation</name>\n                    <depend>\n                        <link_category />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </category_save>\n                <sibling_save>\n                    <name>040_sibling_save</name>\n                    <scope>siblings_not_tree</scope>\n                    <sort_order>40</sort_order>\n                </sibling_save>\n                <sibling_save_tree>\n                    <name>045_sibling_save_tree</name>\n                    <scope>siblings_tree</scope>\n                    <sort_order>45</sort_order>\n                </sibling_save_tree>\n                <middle>\n                    <name>050_middle</name>\n                    <sort_order>50</sort_order>\n                </middle>\n                <mass_action>\n                    <name>060_mass_action</name>\n                    <scope>attribute</scope>\n                    <depend>\n                        <mass_update />\n                    </depend>\n                    <sort_order>60</sort_order>\n                </mass_action>\n                <mass_parents>\n                    <name>065_mass_parents</name>\n                    <scope>parents</scope>\n                    <sort_order>65</sort_order>\n                </mass_parents>\n                <product_relation_action>\n                    <name>070_product_relation_actions</name>\n                    <depend>\n                        <link_product />\n                    </depend>\n                    <sort_order>70</sort_order>\n                </product_relation_action>\n                <category_relation_action>\n                    <name>080_category_relation_actions</name>\n                    <depend>\n                        <link_category />\n                    </depend>\n                    <sort_order>80</sort_order>\n                </category_relation_action>\n                <sibling_grid>\n                    <name>090_sibling_grid</name>\n                    <scope>siblings_not_tree</scope>\n                    <sort_order>90</sort_order>\n                </sibling_grid>\n                <sibling_tree>\n                    <name>100_sibling_actions_tree</name>\n                    <scope>siblings_tree</scope>\n                    <sort_order>100</sort_order>\n                </sibling_tree>\n                <footer>\n                    <name>110_footer</name>\n                    <sort_order>110</sort_order>\n                </footer>\n            </code>\n        </entity_admin_controller_eav_not_tree>\n        <entity_admin_controller_eav_tree translate=\"title description condition\" module=\"modulecreator\">\n            <title>EAV entity admin controller EAV Tree.</title>\n            <description>This controller handles the admin entity requests for EAV tree entities.</description>\n            <condition>Generated for EAV entities that behave as tree.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav/>\n                <is_tree/>\n            </depend>\n            <source>app/code/controllers/Adminhtml/Module/EntityControllerEavTree/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/Adminhtml/{{ModuleFolder}}/{{Entity}}Controller.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <product_data>\n                    <name>020_product_data</name>\n                    <depend>\n                        <link_product />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </product_data>\n                <category_data>\n                    <name>030_category_data</name>\n                    <depend>\n                        <link_category />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </category_data>\n                <sibling_data>\n                    <name>040_sibling_data</name>\n                    <scope>siblings_not_tree</scope>\n                    <sort_order>40</sort_order>\n                </sibling_data>\n                <sibling_data_tree>\n                    <name>045_sibling_data_tree</name>\n                    <scope>siblings_tree</scope>\n                    <sort_order>45</sort_order>\n                </sibling_data_tree>\n                <real_save>\n                    <name>050_real_save</name>\n                    <sort_order>50</sort_order>\n                </real_save>\n                <product_relation_action>\n                    <name>060_product_relation_action</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </product_relation_action>\n                <category_relation_action>\n                    <name>070_category_relation_action</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </category_relation_action>\n                <sibling_actions>\n                    <name>080_sibling_actions</name>\n                    <scope>siblings</scope>\n                    <sort_order>80</sort_order>\n                </sibling_actions>\n                <footer>\n                    <name>090_footer</name>\n                    <sort_order>90</sort_order>\n                </footer>\n            </code>\n        </entity_admin_controller_eav_tree>\n\n        <install_data translate=\"title description condition\" module=\"modulecreator\">\n            <title>Module data install script.</title>\n            <description>This holds the data added to the database tables on install.</description>\n            <condition>This is generated if there are any tree behaving entities.</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_tree/>\n            </depend>\n            <source>app/code/data/namespace_module_setup/data-install/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/data/{{namespace}}_{{module}}_setup/data-install-{{version}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity>\n                    <name>020_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity>\n            </code>\n        </install_data>\n\n        <adminhtml_xml translate=\"title description condition\" module=\"modulecreator\">\n            <title>Module adminhtml.xml file</title>\n            <description>Module menu and ACL settings.</description>\n            <condition>This is always generated</condition>\n            <scope>global</scope>\n            <filetype>xml</filetype>\n            <source>app/code/etc/adminhtml/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/adminhtml.xml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </adminhtml_xml>\n\n        <config_xml translate=\"title description condition\" module=\"modulecreator\">\n            <title>Module configuration file</title>\n            <description>The module configuration file</description>\n            <condition>This is always generated</condition>\n            <scope>global</scope>\n            <filetype>xml</filetype>\n            <source>app/code/etc/config/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/config.xml</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <tables>\n                    <name>020_tables</name>\n                    <scope>entity</scope>\n                    <sort_order>20</sort_order>\n                </tables>\n                <store_tables>\n                    <name>030_store_tables</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </store_tables>\n                <siblings_table>\n                    <name>040_siblings_table</name>\n                    <scope>siblings</scope>\n                    <sort_order>40</sort_order>\n                </siblings_table>\n                <product_relation_table>\n                    <name>050_product_relation_table</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </product_relation_table>\n                <category_relation_table>\n                    <name>060_category_relation_table</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </category_relation_table>\n                <comment_table>\n                    <name>070_comment_table</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <allow_comment/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </comment_table>\n                <comment_store_table>\n                    <name>080_comment_store_table</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <allow_comment_by_store/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </comment_store_table>\n                <eav_attribute>\n                    <name>090_eav_attribute</name>\n                    <depend>\n                        <has_eav/>\n                    </depend>\n                    <sort_order>90</sort_order>\n                </eav_attribute>\n                <global>\n                    <name>100_global</name>\n                    <sort_order>100</sort_order>\n                </global>\n                <url_rewrite>\n                    <name>110_url_rewrite</name>\n                    <depend>\n                        <url_rewrite/>\n                    </depend>\n                    <sort_order>110</sort_order>\n                </url_rewrite>\n                <adminhtml>\n                    <name>120_adminhtml</name>\n                    <sort_order>120</sort_order>\n                </adminhtml>\n                <relation_events_top>\n                    <name>130_relation_events_top</name>\n                    <depend>\n                        <link_core/>\n                    </depend>\n                    <sort_order>130</sort_order>\n                </relation_events_top>\n                <relation_product_top>\n                    <name>140_relation_product_top</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>140</sort_order>\n                </relation_product_top>\n                <relation_events_middle>\n                    <name>150_relation_events_middle</name>\n                    <depend>\n                        <link_core/>\n                    </depend>\n                    <sort_order>150</sort_order>\n                </relation_events_middle>\n                <relation_category_top>\n                    <name>160_relation_category_top</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>160</sort_order>\n                </relation_category_top>\n\n\n                <relation_product_bottom_start>\n                    <name>170_relation_product_bottom_start</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>170</sort_order>\n                </relation_product_bottom_start>\n\n                <relation_product_bottom>\n                    <name>180_relation_product_bottom</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>180</sort_order>\n                </relation_product_bottom>\n\n                <relation_product_bottom_end>\n                    <name>190_relation_product_bottom_end</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>190</sort_order>\n                </relation_product_bottom_end>\n\n                <relation_category_bottom_start>\n                    <name>200_relation_category_bottom_start</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>200</sort_order>\n                </relation_category_bottom_start>\n                <relation_category_bottom>\n                    <name>210_relation_category_bottom</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>210</sort_order>\n                </relation_category_bottom>\n                <relation_category_bottom_end>\n                    <name>220_relation_category_bottom_end</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>220</sort_order>\n                </relation_category_bottom_end>\n                <relation_events_bottom>\n                    <name>230_relation_events_bottom</name>\n                    <depend>\n                        <link_core/>\n                    </depend>\n                    <sort_order>230</sort_order>\n                </relation_events_bottom>\n                <global_search_top>\n                    <name>240_global_search_top</name>\n                    <depend>\n                        <search/>\n                    </depend>\n                    <sort_order>240</sort_order>\n                </global_search_top>\n                <global_search_entity>\n                    <name>250_global_search_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <search/>\n                    </depend>\n                    <sort_order>250</sort_order>\n                </global_search_entity>\n                <global_search_footer>\n                    <name>260_global_search_footer</name>\n                    <depend>\n                        <search/>\n                    </depend>\n                    <sort_order>260</sort_order>\n                </global_search_footer>\n                <admin>\n                    <name>270_admin</name>\n                    <sort_order>260</sort_order>\n                </admin>\n                <frontend>\n                    <name>280_frontend</name>\n                    <depend>\n                        <create_frontend/>\n                    </depend>\n                    <sort_order>280</sort_order>\n                </frontend>\n                <router>\n                    <name>284_router</name>\n                    <depend>\n                        <can_create_router />\n                    </depend>\n                    <sort_order>284</sort_order>\n                </router>\n                <frontend_footer>\n                    <name>287_frontend_footer</name>\n                    <depend>\n                        <create_frontend/>\n                    </depend>\n                    <sort_order>287</sort_order>\n                </frontend_footer>\n                <default_top>\n                    <name>290_default_top</name>\n                    <depend>\n                        <create_frontend/>\n                    </depend>\n                    <sort_order>290</sort_order>\n                </default_top>\n                <default>\n                    <name>300_default</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <create_frontend/>\n                    </depend>\n                    <sort_order>300</sort_order>\n                </default>\n                <default_footer>\n                    <name>310_default_footer</name>\n                    <sort_order>310</sort_order>\n                    <depend>\n                        <create_frontend/>\n                    </depend>\n                </default_footer>\n                <footer>\n                    <name>320_footer</name>\n                    <sort_order>320</sort_order>\n                </footer>\n            </code>\n        </config_xml>\n\n        <widget_xml translate=\"title description condition\" module=\"modulecreator\">\n            <title>Widget xml</title>\n            <description>widget.xml file of the module</description>\n            <condition>Generated if at least one entity has widgets enabled</condition>\n            <scope>global</scope>\n            <filetype>xml</filetype>\n            <source>app/code/etc/widget/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/widget.xml</destination>\n            <depend>\n                <widget/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity>\n                    <name>020_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <widget/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity>\n                <tree>\n                    <name>030_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <widget/>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </widget_xml>\n\n        <system_xml translate=\"title description condition\" module=\"modulecreator\">\n            <title>System xml</title>\n            <description>system.xml file of the module</description>\n            <condition>Generated if at least one entity has frontend enabled</condition>\n            <scope>global</scope>\n            <filetype>xml</filetype>\n            <source>app/code/etc/system/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/system.xml</destination>\n            <depend>\n                <create_frontend />\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity>\n                    <name>020_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <create_frontend/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </system_xml>\n\n        <api_xml translate=\"title description condition\" module=\"modulecreator\">\n            <title>Api config file</title>\n            <description>File needed for API integration</description>\n            <condition>Generated if at least one entity support API</condition>\n            <filetype>xml</filetype>\n            <depend>\n                <api/>\n            </depend>\n            <source>app/code/etc/api/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/api.xml</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity_api>\n                    <name>020_entity_api</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity_api>\n                <resource_alias>\n                    <name>030_resource_alias</name>\n                    <sort_order>30</sort_order>\n                </resource_alias>\n                <entity_resource_alias>\n                    <name>040_entity_resource_alias</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </entity_resource_alias>\n                <v2>\n                    <name>050_v2</name>\n                    <sort_order>50</sort_order>\n                </v2>\n                <v2_entity>\n                    <name>060_v2_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </v2_entity>\n                <acl>\n                    <name>070_acl</name>\n                    <sort_order>70</sort_order>\n                </acl>\n                <acl_entity>\n                    <name>080_acl_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </acl_entity>\n                <footer>\n                    <name>090_footer</name>\n                    <sort_order>90</sort_order>\n                </footer>\n            </code>\n        </api_xml>\n\n        <wsdl_xml translate=\"title description condition\" module=\"modulecreator\">\n            <title>WSDL file</title>\n            <description>File needed for API V2 integration</description>\n            <condition>Generated if at least one entity support API</condition>\n            <filetype>xml</filetype>\n            <depend>\n                <api/>\n            </depend>\n            <source>app/code/etc/wsdl/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/wsdl.xml</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity_types>\n                    <name>020_entity_types</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity_types>\n                <entity_comment_types>\n                    <name>023_entity_comment_types</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>23</sort_order>\n                </entity_comment_types>\n                <entity_attribute_types>\n                    <name>026_entity_attribute_types</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>26</sort_order>\n                </entity_attribute_types>\n                <schema_footer>\n                    <name>030_schema_footer</name>\n                    <sort_order>30</sort_order>\n                </schema_footer>\n                <entity_messages>\n                    <name>040_entity_messages</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </entity_messages>\n                <entity_comment_messages>\n                    <name>043_entity_comment_messages</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>43</sort_order>\n                </entity_comment_messages>\n                <entity_attribute_messages>\n                    <name>046_entity_attribute_messages</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>46</sort_order>\n                </entity_attribute_messages>\n                <porttype_top>\n                    <name>050_porttype_top</name>\n                    <sort_order>50</sort_order>\n                </porttype_top>\n                <porttype_entity>\n                    <name>060_porttype_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </porttype_entity>\n                <porttype_entity_comment>\n                    <name>063_porttype_entity_comment</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>63</sort_order>\n                </porttype_entity_comment>\n                <porttype_entity_attribute>\n                    <name>066_porttype_entity_attribute</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>66</sort_order>\n                </porttype_entity_attribute>\n                <porttype_footer>\n                    <name>070_porttype_footer</name>\n                    <sort_order>70</sort_order>\n                </porttype_footer>\n                <binding_top>\n                    <name>080_binding_top</name>\n                    <sort_order>80</sort_order>\n                </binding_top>\n                <entity_binding>\n                    <name>090_entity_binding</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>90</sort_order>\n                </entity_binding>\n                <entity_binding_comment>\n                    <name>093_entity_binding_comment</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>93</sort_order>\n                </entity_binding_comment>\n                <entity_binding_attribute>\n                    <name>096_entity_binding_attribute</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>96</sort_order>\n                </entity_binding_attribute>\n                <footer>\n                    <name>100_footer</name>\n                    <sort_order>100</sort_order>\n                </footer>\n            </code>\n        </wsdl_xml>\n\n        <wsi_xml translate=\"title description condition\" module=\"modulecreator\">\n            <title>WSI file</title>\n            <description>API xml for WS-I complience</description>\n            <condition>Generated if at least one entity has API enabled</condition>\n            <filetype>xml</filetype>\n            <depend>\n                <api/>\n            </depend>\n            <source>app/code/etc/wsi/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/wsi.xml</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity_types>\n                    <name>020_entity_types</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity_types>\n                <entity_comment_types>\n                    <name>023_entity_comment_types</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>23</sort_order>\n                </entity_comment_types>\n                <entity_attribute_types>\n                    <name>026_entity_attribute_types</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>26</sort_order>\n                </entity_attribute_types>\n                <schema_footer>\n                    <name>030_schema_footer</name>\n                    <sort_order>30</sort_order>\n                </schema_footer>\n                <entity_messages>\n                    <name>040_entity_messages</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </entity_messages>\n                <entity_comment_messages>\n                    <name>043_entity_comment_messages</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>43</sort_order>\n                </entity_comment_messages>\n                <entity_attribute_messages>\n                    <name>046_entity_attribute_messages</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>46</sort_order>\n                </entity_attribute_messages>\n                <porttype_top>\n                    <name>050_porttype_top</name>\n                    <sort_order>50</sort_order>\n                </porttype_top>\n                <porttype_entity>\n                    <name>060_porttype_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </porttype_entity>\n                <porttype_entity_comment>\n                    <name>063_porttype_entity_comment</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>63</sort_order>\n                </porttype_entity_comment>\n                <porttype_entity_attribute>\n                    <name>066_porttype_entity_attribute</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>66</sort_order>\n                </porttype_entity_attribute>\n                <porttype_footer>\n                    <name>070_porttype_footer</name>\n                    <sort_order>70</sort_order>\n                </porttype_footer>\n                <binding_top>\n                    <name>080_binding_top</name>\n                    <sort_order>80</sort_order>\n                </binding_top>\n                <entity_binding>\n                    <name>090_entity_binding</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                    </depend>\n                    <sort_order>90</sort_order>\n                </entity_binding>\n                <entity_binding_comment>\n                    <name>093_entity_binding_comment</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>93</sort_order>\n                </entity_binding_comment>\n                <entity_binding_attribute>\n                    <name>096_entity_binding_attribute</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>96</sort_order>\n                </entity_binding_attribute>\n                <footer>\n                    <name>100_footer</name>\n                    <sort_order>100</sort_order>\n                </footer>\n            </code>\n        </wsi_xml>\n\n        <helper_data translate=\"title description condition\" module=\"modulecreator\">\n            <title>Module default helper.</title>\n            <description>This is the default helper of the module.</description>\n            <condition>This is always generated.</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <source>app/code/Helper/Data/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/Data.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </helper_data>\n\n        <helper_image_abstract translate=\"title description condition\" module=\"modulecreator\">\n            <title>Abstract helper for image resizing</title>\n            <description>This is the base helper used for resizing images.</description>\n            <condition>Is generated if there is at least an image attribute.</condition>\n            <filetype>php</filetype>\n            <scope>global</scope>\n            <depend>\n                <has_image/>\n            </depend>\n            <source>app/code/Helper/Image/Abstract/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/Image/Abstract.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </helper_image_abstract>\n\n        <helper_image_entity translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity image helper</title>\n            <description>Helper used for image processing.</description>\n            <condition>Is generated if there is at least an image attribute for an entity.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_image/>\n            </depend>\n            <source>app/code/Helper/Entity/Image/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/{{Entity}}/Image.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </helper_image_entity>\n\n        <helper_product translate=\"title description condition\" module=\"modulecreator\">\n            <title>Product helper</title>\n            <description>Helper used for product relation actions</description>\n            <condition>Is generated if there is at least one entity related to products</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <link_product/>\n            </depend>\n            <source>app/code/Helper/Product/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/Product.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <content>\n                    <name>020_content</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </content>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </helper_product>\n\n        <helper_category translate=\"title description condition\" module=\"modulecreator\">\n            <title>Category helper</title>\n            <description>Helper used for category relation actions</description>\n            <condition>Is generated if there is at least one entity related to categories</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <link_category/>\n            </depend>\n            <source>app/code/Helper/Category/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/Category.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <content>\n                    <name>020_content</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </content>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </helper_category>\n\n        <helper_entity translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity helper</title>\n            <description>Helper for each entity</description>\n            <condition>Generated for each entity that matches one of these conditions. Is EAV or has frontend files or has a file type field or behaves as tree</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <can_create_entity_helper />\n            </depend>\n            <source>app/code/Helper/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Helper/{{Entity}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <create_list>\n                    <name>020_create_list</name>\n                    <sort_order>20</sort_order>\n                    <depend>\n                        <create_list/>\n                    </depend>\n                </create_list>\n                <breadcrumbs>\n                    <name>030_breadcrumbs</name>\n                    <sort_order>30</sort_order>\n                    <depend>\n                        <create_frontend/>\n                    </depend>\n                </breadcrumbs>\n                <tree>\n                    <name>040_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </tree>\n                <rss>\n                    <name>050_rss</name>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </rss>\n                <file>\n                    <name>060_file</name>\n                    <depend>\n                        <has_file/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </file>\n                <eav>\n                    <name>070_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>70</sort_order>\n                </eav>\n                <footer>\n                    <name>080_footer</name>\n                    <sort_order>80</sort_order>\n                </footer>\n            </code>\n        </helper_entity>\n\n        <model_adminhtml_observer translate=\"title description condition\" module=\"modulecreator\">\n            <title>Adminhtml Observer</title>\n            <description>Used for product and category relations</description>\n            <condition>Generated if at least one entity is related to product or categories.</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <source>app/code/Model/Adminhtml/Observer/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Adminhtml/Observer.php</destination>\n            <depend>\n                <has_observer/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity_product>\n                    <name>020_entity_product</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity_product>\n                <entity_product_save_not_tree>\n                    <name>030_entity_product_save</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </entity_product_save_not_tree>\n                <entity_product_save_tree>\n                    <name>040_entity_product_save_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </entity_product_save_tree>\n\n                <entity_category>\n                    <name>050_entity_category</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                        <not_is_tree />\n                    </depend>\n                    <sort_order>50</sort_order>\n                </entity_category>\n                <entity_category_tree>\n                    <name>055_entity_category_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                        <is_tree />\n                    </depend>\n                    <sort_order>55</sort_order>\n                </entity_category_tree>\n                <entity_category_save_not_tree>\n                    <name>060_entity_category_save</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                        <not_is_tree />\n                    </depend>\n                    <sort_order>60</sort_order>\n                </entity_category_save_not_tree>\n                <entity_category_save_tree>\n                    <name>070_entity_category_save_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product />\n                        <is_tree />\n                    </depend>\n                    <sort_order>70</sort_order>\n                </entity_category_save_tree>\n\n                <footer>\n                    <name>080_footer</name>\n                    <sort_order>80</sort_order>\n                </footer>\n            </code>\n        </model_adminhtml_observer>\n\n        <model_adminhtml_search translate=\"title description condition\" module=\"modulecreator\">\n            <title>Adminhtml Search Model</title>\n            <description>Model used by admin global search</description>\n            <condition>Generated for each entity that is included in the admin search.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <source>app/code/Model/Adminhtml/Search/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Adminhtml/Search/{{Entity}}.php</destination>\n            <depend>\n                <search/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_adminhtml_search>\n\n        <model_observer translate=\"title description condition\" module=\"modulecreator\">\n            <title>Frontend observer</title>\n            <description>Observer for frontend</description>\n            <condition>Generated if at least one entity is set to have the link in the category menu</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_in_category_menu />\n            </depend>\n            <source>app/code/Model/Observer/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Observer.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity>\n                    <name>020_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <show_in_category_menu />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </model_observer>\n        <model_entity translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity model</title>\n            <description>The entity model. Simple as that.</description>\n            <condition>This is generated for each entity.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <source>app/code/Model/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <var_sibling>\n                    <name>020_var_sibling</name>\n                    <scope>siblings</scope>\n                    <sort_order>20</sort_order>\n                </var_sibling>\n                <var_product_relation>\n                    <name>030_var_product_relation</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </var_product_relation>\n                <var_category_relation>\n                    <name>040_var_category_relation</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </var_category_relation>\n                <construct>\n                    <name>050_construct</name>\n                    <sort_order>50</sort_order>\n                </construct>\n                <url>\n                    <name>060_url</name>\n                    <depend>\n                        <create_view />\n                        <not_url_rewrite />\n                    </depend>\n                    <sort_order>60</sort_order>\n                </url>\n                <url_rewrite>\n                    <name>070_url_rewrite</name>\n                    <depend>\n                        <url_rewrite/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </url_rewrite>\n                <editors>\n                    <name>080_editors</name>\n                    <scope>attribute</scope>\n                    <depend>\n                        <editor/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </editors>\n                <after_save_top>\n                    <name>090_after_save_top</name>\n                    <sort_order>90</sort_order>\n                </after_save_top>\n                <after_save_product>\n                    <name>100_after_save_product</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>100</sort_order>\n                </after_save_product>\n                <after_save_category>\n                    <name>110_after_save_category</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>110</sort_order>\n                </after_save_category>\n\n                <after_save_sibling>\n                    <name>120_after_save_sibling</name>\n                    <scope>siblings</scope>\n                    <sort_order>120</sort_order>\n                </after_save_sibling>\n                <after_save_footer>\n                    <name>130_after_save_footer</name>\n                    <sort_order>130</sort_order>\n                </after_save_footer>\n                <product_relation>\n                    <name>140_product_relation</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>140</sort_order>\n                </product_relation>\n                <category_relation>\n                    <name>150_category_relation</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>150</sort_order>\n                </category_relation>\n\n                <sibling_relation>\n                    <name>160_sibling_relation</name>\n                    <scope>siblings</scope>\n                    <sort_order>160</sort_order>\n                </sibling_relation>\n\n                <children_relation>\n                    <name>163_children_relation</name>\n                    <scope>children</scope>\n                    <sort_order>163</sort_order>\n                </children_relation>\n                <parent_relation>\n                    <name>165_parent_relation</name>\n                    <scope>parents</scope>\n                    <sort_order>165</sort_order>\n                </parent_relation>\n\n                <tree>\n                    <name>170_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>170</sort_order>\n                </tree>\n                <eav_default_attribute_set>\n                    <name>175_eav_default_attribute_set</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>175</sort_order>\n                </eav_default_attribute_set>\n                <allow_comment>\n                    <name>180_allow_comment</name>\n                    <depend>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>180</sort_order>\n                </allow_comment>\n                <default_values>\n                    <name>190_default_values</name>\n                    <sort_order>190</sort_order>\n                </default_values>\n                <default_values_rss>\n                    <name>200_default_values_rss</name>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>200</sort_order>\n                </default_values_rss>\n                <default_values_comment>\n                    <name>210_default_values_comment</name>\n                    <depend>\n                        <allow_comment/>\n                    </depend>\n                    <sort_order>210</sort_order>\n                </default_values_comment>\n                <default_attribute_values>\n                    <name>215_default_attribute_values</name>\n                    <depend>\n                        <is_flat/>\n                    </depend>\n                    <sort_order>215</sort_order>\n                </default_attribute_values>\n                <footer>\n                    <name>220_footer</name>\n                    <sort_order>220</sort_order>\n                </footer>\n            </code>\n        </model_entity>\n        <model_entity_source translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity source model</title>\n            <description>Model used as a a source containing all entities</description>\n            <condition>Generated if the entity is set to be a product or category attribute</condition>\n            <source>app/code/Model/Entity/Source/</source>\n            <scope>entity</scope>\n            <depend>\n                <can_create_source_model />\n            </depend>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Source.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <eav>\n                    <name>020_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </eav>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </model_entity_source>\n        <model_backend_file translate=\"title description condition\" module=\"modulecreator\">\n            <title>File save backend model</title>\n            <description>Model used for saving entity files</description>\n            <condition>Is generated for EAV entities</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Model/Entity/Attribute/Backend/File/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Attribute/Backend/File.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_backend_file>\n        <model_backend_image translate=\"title description condition\" module=\"modulecreator\">\n            <title>Image save backend model</title>\n            <description>Model used for saving entity images</description>\n            <condition>Is generated for EAV entities</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Model/Entity/Attribute/Backend/Image/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Attribute/Backend/Image.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_backend_image>\n        <model_backend_url_key translate=\"title description condition\" module=\"modulecreator\">\n            <title>Url key save backend model</title>\n            <description>Model used for saving entity url key</description>\n            <condition>Is generated for EAV entities that have url rewrites enabled</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_eav />\n                <url_rewrite />\n            </depend>\n            <source>app/code/Model/Entity/Attribute/Backend/Urlkey/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Attribute/Backend/Urlkey.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_backend_url_key>\n        <model_entity_api translate=\"title description condition\" module=\"modulecreator\">\n            <title>API model</title>\n            <description>API v1 model</description>\n            <condition>Is generated if you choose to create the API</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <api/>\n            </depend>\n            <source>app/code/Model/Entity/Api/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Api.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <tree_filter>\n                    <name>014_tree_filter</name>\n                    <sort_order>14</sort_order>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                </tree_filter>\n                <eav>\n                    <name>013_eav</name>\n                    <sort_order>13</sort_order>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                </eav>\n                <content>\n                    <name>016_content</name>\n                    <sort_order>16</sort_order>\n                </content>\n                <add_eav>\n                    <name>017_add_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>17</sort_order>\n                </add_eav>\n                <add_end>\n                    <name>018_add_end</name>\n                    <sort_order>18</sort_order>\n                </add_end>\n                <update_eav>\n                    <name>019_update_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>19</sort_order>\n                </update_eav>\n                <update_footer>\n                    <name>020_update_footer</name>\n                    <sort_order>20</sort_order>\n                </update_footer>\n                <product_relation_info>\n                    <name>024_product_relation_info</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>24</sort_order>\n                </product_relation_info>\n                <category_relation_info>\n                    <name>030_category_relation_info</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </category_relation_info>\n                <siblings_info>\n                    <name>040_sibling_info</name>\n                    <scope>siblings</scope>\n                    <sort_order>40</sort_order>\n                </siblings_info>\n                <info_footer>\n                    <name>050_info_footer</name>\n                    <sort_order>50</sort_order>\n                </info_footer>\n                <tree>\n                    <name>060_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </tree>\n                <product_relation>\n                    <name>070_product_relation</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </product_relation>\n                <category_relation>\n                    <name>080_category_relation</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </category_relation>\n                <sibling_relation>\n                    <name>090_sibling_relation</name>\n                    <scope>siblings_not_tree</scope>\n                    <sort_order>90</sort_order>\n                </sibling_relation>\n                <sibling_relation_tree>\n                    <name>095_sibling_relation_tree</name>\n                    <scope>siblings_tree</scope>\n                    <sort_order>95</sort_order>\n                </sibling_relation_tree>\n                <get_attributes>\n                    <name>097_get_attributes</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>97</sort_order>\n                </get_attributes>\n                <get_api_data_flat>\n                    <name>098_get_api_data_flat</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>98</sort_order>\n                </get_api_data_flat>\n                <get_api_data_eav>\n                    <name>099_get_api_data_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>99</sort_order>\n                </get_api_data_eav>\n                <footer>\n                    <name>100_footer</name>\n                    <sort_order>100</sort_order>\n                </footer>\n            </code>\n        </model_entity_api>\n\n        <model_entity_api_v2 translate=\"title description condition\" module=\"modulecreator\">\n            <title>API V2 model</title>\n            <description>API v2 model</description>\n            <condition>Is generated if you choose to create the API</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <api/>\n            </depend>\n            <source>app/code/Model/Entity/Api/V2/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Api/V2.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <product_relation>\n                    <name>020_product_relation</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </product_relation>\n                <category_relation>\n                    <name>030_category_relation</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </category_relation>\n                <sibling_relation>\n                    <name>040_sibling_relation</name>\n                    <scope>siblings</scope>\n                    <sort_order>40</sort_order>\n                </sibling_relation>\n                <footer>\n                    <name>050_footer</name>\n                    <sort_order>50</sort_order>\n                </footer>\n            </code>\n        </model_entity_api_v2>\n\n        <model_entity_product translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity product model</title>\n            <description>Model for relations between entities and products</description>\n            <condition>Is generated if you choose to link an entity with products</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <link_product/>\n            </depend>\n            <source>app/code/Model/Entity/Product/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Product.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_entity_product>\n\n\n        <model_entity_category translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity category model</title>\n            <description>Model for relations between entities and categories</description>\n            <condition>Is generated if you choose to link an entity with categories</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <link_category/>\n            </depend>\n            <source>app/code/Model/Entity/Category/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Category.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_entity_category>\n\n        <model_entity_sibling translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity sibling model</title>\n            <description>Model for many to many relations between entities</description>\n            <condition>Is generated for each many to many relation</condition>\n            <scope>siblings</scope>\n            <filetype>php</filetype>\n            <source>app/code/Model/Entity/Sibling/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/{{Sibling}}.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_entity_sibling>\n\n        <model_resource_entity translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity resource model.</title>\n            <description>The resource model for an entity</description>\n            <condition>This is generated for all entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <source>app/code/Model/Resource/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <tree_var>\n                    <name>020_tree_var</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </tree_var>\n                <constructor>\n                    <name>030_constructor</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </constructor>\n                <eav_construct>\n                    <name>032_eav_construct</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>32</sort_order>\n                </eav_construct>\n                <store>\n                    <name>037_store</name>\n                    <depend>\n                        <store />\n                    </depend>\n                    <sort_order>37</sort_order>\n                </store>\n                <not_tree>\n                    <name>040_not_tree</name>\n                    <depend>\n                        <not_is_tree />\n                        <is_flat />\n                        <store />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </not_tree>\n                <before_save_multiple>\n                    <name>045_before_save_multiple</name>\n                    <depend>\n                        <not_is_tree />\n                        <is_flat />\n                        <has_multiple_select />\n                        <not_url_rewrite />\n                    </depend>\n                    <sort_order>45</sort_order>\n                </before_save_multiple>\n                <tree>\n                    <name>050_tree</name>\n                    <depend>\n                        <is_tree/>\n                        <is_flat />\n                    </depend>\n                    <sort_order>50</sort_order>\n                </tree>\n                <tree_store>\n                    <name>052_tree_store</name>\n                    <depend>\n                        <is_tree/>\n                        <is_flat />\n                        <store />\n                    </depend>\n                    <sort_order>52</sort_order>\n                </tree_store>\n                <tree_after>\n                    <name>053_tree_after</name>\n                    <depend>\n                        <is_tree/>\n                        <is_flat />\n                    </depend>\n                    <sort_order>53</sort_order>\n                </tree_after>\n                <tree_eav>\n                    <name>055_tree_eav</name>\n                    <depend>\n                        <is_tree/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>55</sort_order>\n                </tree_eav>\n                <tree_before_save_no_url_rewrite>\n                    <name>060_tree_before_save_no_url_rewrite</name>\n                    <depend>\n                        <is_tree/>\n                        <not_url_rewrite/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </tree_before_save_no_url_rewrite>\n                <eav_tree_before_save_no_url_rewrite>\n                    <name>070_eav_tree_before_save_url_rewrite</name>\n                    <depend>\n                        <is_tree/>\n                        <url_rewrite/>\n                        <is_eav />\n                    </depend>\n                    <sort_order>70</sort_order>\n                </eav_tree_before_save_no_url_rewrite>\n                <tree_before_save_url_rewrite>\n                    <name>080_tree_before_save_url_rewrite</name>\n                    <depend>\n                        <is_tree/>\n                        <url_rewrite/>\n                        <is_flat />\n                    </depend>\n                    <sort_order>80</sort_order>\n                </tree_before_save_url_rewrite>\n                <content>\n                    <name>090_content</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>90</sort_order>\n                </content>\n                <url_rewrite>\n                    <name>100_url_rewrite</name>\n                    <depend>\n                        <url_rewrite/>\n                        <is_flat />\n                    </depend>\n                    <sort_order>100</sort_order>\n                </url_rewrite>\n                <url_rewrite_store>\n                    <name>103_url_rewrite_store</name>\n                    <depend>\n                        <url_rewrite/>\n                        <is_flat />\n                        <store />\n                    </depend>\n                    <sort_order>103</sort_order>\n                </url_rewrite_store>\n                <url_rewrite_no_store>\n                    <name>107_url_rewrite_no_store</name>\n                    <depend>\n                        <url_rewrite/>\n                        <is_flat />\n                        <no_store />\n                    </depend>\n                    <sort_order>107</sort_order>\n                </url_rewrite_no_store>\n                <url_rewrite_before_save_not_tree>\n                    <name>110_url_rewrite_before_save_not_tree</name>\n                    <depend>\n                        <url_rewrite/>\n                        <not_is_tree/>\n                        <is_flat />\n                    </depend>\n                    <sort_order>110</sort_order>\n                </url_rewrite_before_save_not_tree>\n                <url_rewrite_eav>\n                    <name>120_url_rewrite_eav</name>\n                    <depend>\n                        <url_rewrite />\n                        <is_eav />\n                    </depend>\n                    <sort_order>120</sort_order>\n                </url_rewrite_eav>\n                <footer>\n                    <name>130_footer</name>\n                    <sort_order>130</sort_order>\n                </footer>\n            </code>\n        </model_resource_entity>\n\n        <model_resource_entity_collection translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity collection resource model.</title>\n            <description>The collection resource model for an entity</description>\n            <condition>Generated for every entity</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <source>app/code/Model/Resource/Entity/Collection/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Collection.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <top_store>\n                    <name>020_top_store</name>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </top_store>\n                <content>\n                    <name>030_content</name>\n                    <sort_order>30</sort_order>\n                </content>\n                <store>\n                    <name>040_store</name>\n                    <depend>\n                        <store/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </store>\n                <tree>\n                    <name>050_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </tree>\n                <not_tree>\n                    <name>060_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </not_tree>\n                <product_relation>\n                    <name>070_product_relation</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </product_relation>\n                <category_relation>\n                    <name>080_category_relation</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </category_relation>\n                <sibling_relation>\n                    <name>090_sibling_relation</name>\n                    <scope>siblings</scope>\n                    <sort_order>90</sort_order>\n                </sibling_relation>\n                <footer>\n                    <name>100_footer</name>\n                    <sort_order>100</sort_order>\n                </footer>\n            </code>\n        </model_resource_entity_collection>\n\n        <model_resource_eav_attribute translate=\"title description condition\" module=\"modulecreator\">\n            <title>EAV attribute resource model.</title>\n            <description>Resource model used for eav attributes.</description>\n            <condition>Generated if there is at least one entity with type EAV</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_eav />\n            </depend>\n            <source>app/code/Model/Resource/Eav/Attribute/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/Eav/Attribute.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_resource_eav_attribute>\n\n        <model_resource_attribute_collection translate=\"title description condition\" module=\"modulecreator\">\n            <title>EAV Entity attribute resource collection model</title>\n            <description>Resource model used for eav attributes.</description>\n            <condition>Generated for EAV entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_eav />\n            </depend>\n            <source>app/code/Model/Resource/Entity/Attribute/Collection/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Attribute/Collection.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_resource_attribute_collection>\n\n        <model_resource_attribute translate=\"title description condition\" module=\"modulecreator\">\n            <title>EAV attribute model.</title>\n            <description>Model used for eav attributes.</description>\n            <condition>Generated if there is at least one entity with type EAV</condition>\n            <scope>global</scope>\n            <filetype>php</filetype>\n            <depend>\n                <has_eav />\n            </depend>\n            <source>app/code/Model/Resource/Attribute/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/Attribute.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_resource_attribute>\n\n\n        <model_resource_entity_tree translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree resource model.</title>\n            <description>Tree resource model for tree behaving entities.</description>\n            <condition>Generated for every tree behaving entities</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <is_tree/>\n            </depend>\n            <source>app/code/Model/Resource/Entity/Tree/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Tree.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <eav>\n                    <name>020_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </eav>\n                <content>\n                    <name>030_content</name>\n                    <sort_order>30</sort_order>\n                </content>\n                <flat_collection>\n                    <name>040_flat_collection</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </flat_collection>\n                <eav_collection>\n                    <name>050_eav_collection</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>50</sort_order>\n                </eav_collection>\n                <footer>\n                    <name>060_footer</name>\n                    <sort_order>60</sort_order>\n                </footer>\n            </code>\n        </model_resource_entity_tree>\n\n        <model_resource_entity_product translate=\"title description condition\" module=\"modulecreator\">\n            <title>Product relation resource model</title>\n            <description>Resource model for entity product relation</description>\n            <condition>Generated for all entities that are related many to many with products</condition>\n            <scope>entity</scope>\n            <source>app/code/Model/Resource/Entity/Product/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Product.php</destination>\n            <depend>\n                <link_product/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </not_tree>\n                <tree>\n                    <name>030_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </model_resource_entity_product>\n\n\n        <model_resource_entity_category translate=\"title description condition\" module=\"modulecreator\">\n            <title>Category relation resource model</title>\n            <description>Resource model for entity category relation</description>\n            <condition>Generated for all entities that are related many to many with categories</condition>\n            <scope>entity</scope>\n            <source>app/code/Model/Resource/Entity/Category/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Category.php</destination>\n            <depend>\n                <link_category/>\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <not_tree>\n                    <name>020_not_tree</name>\n                    <depend>\n                        <not_is_tree />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </not_tree>\n                <tree>\n                    <name>030_tree</name>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </model_resource_entity_category>\n\n        <model_resource_entity_product_collection translate=\"title description condition\" module=\"modulecreator\">\n            <title>Product relation collection resource model</title>\n            <description>Collection resource model for entity product relation</description>\n            <condition>Generated for all entities that are related many to many with products</condition>\n            <scope>entity</scope>\n            <source>app/code/Model/Resource/Entity/Product/Collection/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Product/Collection.php</destination>\n            <depend>\n                <link_product/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_resource_entity_product_collection>\n\n        <model_resource_entity_category_collection translate=\"title description condition\" module=\"modulecreator\">\n            <title>Category relation collection resource model</title>\n            <description>Collection resource model for entity category relation</description>\n            <condition>Generated for all entities that are related many to many with categories</condition>\n            <scope>entity</scope>\n            <source>app/code/Model/Resource/Entity/Category/Collection/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Category/Collection.php</destination>\n            <depend>\n                <link_category/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_resource_entity_category_collection>\n\n        <model_resource_sibling translate=\"title description condition\" module=\"modulecreator\">\n            <title>Sibling relation resource model</title>\n            <description>Resource model for entities that are related many to many</description>\n            <condition>Generated for all entities that are related many to many</condition>\n            <scope>siblings</scope>\n            <source>app/code/Model/Resource/Entity/Sibling/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/{{Sibling}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <save_relation>\n                    <name>020_save_relation</name>\n                    <depend>\n                        <sibling_is_not_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </save_relation>\n                <save_relation_tree>\n                    <name>030_save_relation_tree</name>\n                    <depend>\n                        <sibling_is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </save_relation_tree>\n                <footer>\n                    <name>040_footer</name>\n                    <sort_order>40</sort_order>\n                </footer>\n            </code>\n        </model_resource_sibling>\n\n        <model_resource_sibling_collection translate=\"title description condition\" module=\"modulecreator\">\n            <title>Sibling relation collection resource model</title>\n            <description>Collection resource model for entities that are related many to many</description>\n            <condition>Generated for all entities that are related many to many</condition>\n            <scope>siblings</scope>\n            <source>app/code/Model/Resource/Entity/Sibling/Collection/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/{{Sibling}}/Collection.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </model_resource_sibling_collection>\n\n        <model_resource_setup translate=\"title description condition\" module=\"modulecreator\">\n            <title>Module setup resource model</title>\n            <description>Resrouce model used for the module setup</description>\n            <condition>Always generated</condition>\n            <scope>global</scope>\n            <source>app/code/Model/Resource/Setup/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/Setup.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <eav_top>\n                    <name>020_eav_top</name>\n                    <depend>\n                        <has_eav/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </eav_top>\n                <eav>\n                    <name>030_eav</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_eav/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </eav>\n                <eav_footer>\n                    <name>040_eav_footer</name>\n                    <depend>\n                        <has_eav/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </eav_footer>\n                <footer>\n                    <name>050_footer</name>\n                    <sort_order>50</sort_order>\n                </footer>\n            </code>\n        </model_resource_setup>\n\n        <yesnodefault_model translate=\"title description condition\" module=\"modulecreator\">\n            <title>Yes-no-default source model</title>\n            <description>A source model that returns 3 possible values</description>\n            <condition>Generated if at least an entity allows comments</condition>\n            <scope>global</scope>\n            <source>app/code/Model/Adminhtml/Source/Yesnodefault/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Adminhtml/Source/Yesnodefault.php</destination>\n            <depend>\n                <allow_comment/>\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </yesnodefault_model>\n\n        <attribute_model translate=\"title description condition\" module=\"modulecreator\">\n            <title>Attribute model</title>\n            <description>MOdel used for EAV attributes</description>\n            <condition>Generated if at least an EAV entity</condition>\n            <scope>global</scope>\n            <source>app/code/Model/Attribute/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Attribute.php</destination>\n            <depend>\n                <has_eav />\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </attribute_model>\n\n        <country_source_model translate=\"title description condition\" module=\"modulecreator\">\n            <title>Country source model</title>\n            <description>A source model that returns available countries</description>\n            <condition>Generated if at least an entity has a country field/attribute</condition>\n            <scope>global</scope>\n            <source>app/code/Model/Attribute/Source/Country/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Attribute/Source/Country.php</destination>\n            <depend>\n                <has_country />\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </country_source_model>\n\n        <dropdown_source_model translate=\"title description condition\" module=\"modulecreator\">\n            <title>Dropdown attribute source model</title>\n            <description>A source model that returns available dropdown values</description>\n            <condition>Generated for all attributes with type dropdown or multiselect in a flat entity</condition>\n            <scope>attribute</scope>\n            <source>app/code/Model/Entity/Attribute/Source/Attributecode/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Attribute/Source/{{AttributeCodeForFile}}.php</destination>\n            <depend>\n                <generate_source />\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n                <eav>\n                    <name>020_eav</name>\n                    <depend>\n                        <not_entity_eav />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </eav>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </dropdown_source_model>\n\n        <entity_comment_model translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity comment model</title>\n            <description>Model to handle entity comments</description>\n            <condition>Generated for all entities with comments enabled</condition>\n            <scope>entity</scope>\n            <source>app/code/Model/Entity/Comment/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Comment.php</destination>\n            <depend>\n                <allow_comment />\n            </depend>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_comment_model>\n\n        <entity_comment_resource_model translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity comment resource model</title>\n            <description>Resource model to handle entity comments</description>\n            <condition>Generated for all entities with comments enabled</condition>\n            <scope>entity</scope>\n            <source>app/code/Model/Resource/Entity/Comment/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Comment.php</destination>\n            <depend>\n                <allow_comment />\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <store>\n                    <name>020_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </store>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </entity_comment_resource_model>\n        <entity_comment_resource_collection_model translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity comment collection resource model</title>\n            <description>Collection resource model to handle entity comments</description>\n            <condition>Generated for all entities with comments enabled</condition>\n            <scope>entity</scope>\n            <source>app/code/Model/Resource/Entity/Comment/Collection/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Comment/Collection.php</destination>\n            <depend>\n                <allow_comment />\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <top_store>\n                    <name>020_top_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </top_store>\n                <content>\n                    <name>030_content</name>\n                    <sort_order>30</sort_order>\n                </content>\n                <store>\n                    <name>040_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </store>\n                <footer>\n                    <name>050_footer</name>\n                    <sort_order>50</sort_order>\n                </footer>\n            </code>\n        </entity_comment_resource_collection_model>\n\n        <install_sql translate=\"title description condition\" module=\"modulecreator\">\n            <title>Install script</title>\n            <description>Setup script with table structure</description>\n            <condition>Always generated</condition>\n            <source>app/code/sql/namespace_module_setup/install/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/sql/{{namespace}}_{{module}}_setup/install-{{version}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity_flat>\n                    <name>020_entity_flat</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_flat/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity_flat>\n                <entity_store>\n                    <name>030_entity_store</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_flat/>\n                        <store/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </entity_store>\n                <entity_eav>\n                    <name>040_entity_eav</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_eav/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </entity_eav>\n                <product_relation>\n                    <name>050_product_relation</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>50</sort_order>\n                </product_relation>\n                <category_relation>\n                    <name>060_category_relation</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </category_relation>\n                <comments>\n                    <name>070_comments</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <allow_comment/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </comments>\n                <comments_store>\n                    <name>080_comments_store</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>80</sort_order>\n                </comments_store>\n                <sibling_relation>\n                    <name>090_sibling_relation</name>\n                    <scope>siblings</scope>\n                    <sort_order>90</sort_order>\n                </sibling_relation>\n                <has_eav>\n                    <name>100_has_eav</name>\n                    <depend>\n                        <has_eav />\n                    </depend>\n                    <sort_order>100</sort_order>\n                </has_eav>\n                <product_attribute>\n                    <name>110_product_attribute</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <product_attribute />\n                    </depend>\n                    <sort_order>110</sort_order>\n                </product_attribute>\n                <category_attribute>\n                    <name>120_category_attribute</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <category_attribute />\n                    </depend>\n                    <sort_order>120</sort_order>\n                </category_attribute>\n                <eav_options_default>\n                    <name>125_eav_options_default</name>\n                    <sort_order>125</sort_order>\n                    <depend>\n                        <has_eav />\n                    </depend>\n                </eav_options_default>\n                <footer>\n                    <name>130_footer</name>\n                    <sort_order>130</sort_order>\n                </footer>\n            </code>\n        </install_sql>\n\n        <design_admin_layout translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin layout file</title>\n            <description>Layout file for the admin section of the module</description>\n            <condition>Always generated</condition>\n            <scope>global</scope>\n            <filetype>xml</filetype>\n            <source>app/design/adminhtml/layout/namespace_module/</source>\n            <destination>app/design/adminhtml/default/default/layout/{{namespace}}_{{module}}.xml</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity_not_tree>\n                    <name>020_entity_not_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity_not_tree>\n                <relation_product>\n                    <name>030_relation_product</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </relation_product>\n                <relation_category>\n                    <name>040_relation_category</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </relation_category>\n                <relation_sibling>\n                    <name>050_relation_sibling</name>\n                    <scope>siblings_both_not_tree</scope>\n                    <sort_order>50</sort_order>\n                </relation_sibling>\n                <entity_tree>\n                    <name>060_entity_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </entity_tree>\n                <relation_product_tree>\n                    <name>070_relation_product_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_product/>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </relation_product_tree>\n                <relation_category_tree>\n                    <name>080_relation_category_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <link_category/>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </relation_category_tree>\n                <relation_sibling_tree>\n                    <name>090_relation_sibling_tree</name>\n                    <scope>siblings_both_tree</scope>\n                    <sort_order>90</sort_order>\n                </relation_sibling_tree>\n                <eav_attribute_edit>\n                    <name>100_eav_attribute_edit</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_eav/>\n                    </depend>\n                    <sort_order>100</sort_order>\n                </eav_attribute_edit>\n                <comment>\n                    <name>110_comment</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>110</sort_order>\n                </comment>\n                <footer>\n                    <name>120_footer</name>\n                    <sort_order>120</sort_order>\n                </footer>\n            </code>\n        </design_admin_layout>\n\n        <product_tree_tab_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin template for product list</title>\n            <description>Admin template used for product listing in tree behaving entities.</description>\n            <condition>Generated for tree entities related many to many with products.</condition>\n            <filetype>phtml</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_tree/>\n                <link_product/>\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/catalog/product/edit/tab/entity/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/catalog/product/edit/tab/{{entity}}.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </product_tree_tab_template>\n\n        <category_tree_tab_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin template for category edit</title>\n            <description>Admin template used for tree entity listing in categories.</description>\n            <condition>Generated for tree entities related many to many with categories.</condition>\n            <filetype>phtml</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_tree/>\n                <link_category/>\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/catalog/category/tab/entities/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/catalog/category/tab/{{entities}}.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </category_tree_tab_template>\n\n        <entity_tree_admin_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree admin template</title>\n            <description>Template used in the backend for the tree for tree behaving entities</description>\n            <condition>Generated for all tree behaving entities</condition>\n            <filetype>phtml</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_tree/>\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/entity/tree/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/{{entity}}/tree.phtml</destination>\n            <code>\n                <not_eav>\n                    <name>010_not_eav</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>10</sort_order>\n                </not_eav>\n                <eav>\n                    <name>020_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </eav>\n            </code>\n        </entity_tree_admin_template>\n\n        <entity_tree_edit_admin_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree edit admin template</title>\n            <description>Template used in the backend for editing the tree for tree behaving entities</description>\n            <condition>Generated for all tree behaving entities</condition>\n            <filetype>phtml</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_tree/>\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/entity/edit/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/{{entity}}/edit.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_tree_edit_admin_template>\n\n        <entity_tree_edit_form_admin_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree edit form admin template</title>\n            <description>Template used in the backend for editing the tree form for tree behaving entities</description>\n            <condition>Generated for all tree behaving entities</condition>\n            <filetype>phtml</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_tree/>\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/entity/edit/form/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/{{entity}}/edit/form.phtml</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <product_hidden>\n                    <name>020_product_hidden</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </product_hidden>\n                <category_hidden>\n                    <name>030_category_hidden</name>\n                    <depend>\n                        <link_category/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </category_hidden>\n                <sibling_hidden>\n                    <name>040_sibling_hidden</name>\n                    <scope>siblings</scope>\n                    <sort_order>40</sort_order>\n                </sibling_hidden>\n                <content>\n                    <name>050_content</name>\n                    <sort_order>50</sort_order>\n                </content>\n                <product_relation>\n                    <name>060_product_relation</name>\n                    <depend>\n                        <link_product/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </product_relation>\n                <sibling_relations>\n                    <name>070_sibling_relations</name>\n                    <scope>siblings</scope>\n                    <sort_order>70</sort_order>\n                </sibling_relations>\n                <footer>\n                    <name>080_footer</name>\n                    <sort_order>80</sort_order>\n                </footer>\n            </code>\n        </entity_tree_edit_form_admin_template>\n\n        <admin_siblings_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree sibling admin template</title>\n            <description>Admin template for managing siblings for tree entities</description>\n            <condition>Generated for all siblings that behave as tree</condition>\n            <filetype>phtml</filetype>\n            <scope>siblings</scope>\n            <depend>\n                <sibling_is_tree/>\n            </depend>\n            <source>app/design/adminhtml//template/namespace_module/entity/edit/tab/sibling/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/{{entity}}/edit/tab/{{sibling}}.phtml</destination>\n            <code>\n                <file>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </file>\n            </code>\n        </admin_siblings_template>\n\n        <admin_categories_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Categories admin template</title>\n            <description>Admin template for managing categories </description>\n            <condition>Generated for entities that are linked to categories</condition>\n            <filetype>phtml</filetype>\n            <scope>entity</scope>\n            <depend>\n                <link_category/>\n            </depend>\n            <source>app/design/adminhtml//template/namespace_module/entity/edit/tab/categories/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/{{entity}}/edit/tab/categories.phtml</destination>\n            <code>\n                <file>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </file>\n            </code>\n        </admin_categories_template>\n\n        <admin_tree_widget_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin tree widget template</title>\n            <description>Admin template used for tree behaving entities widgets</description>\n            <condition>Generated for all tree behaving entities that support widgets.</condition>\n            <filetype>phtml</filetype>\n            <scope>entity</scope>\n            <depend>\n                <is_tree/>\n                <widget/>\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/entity/widget/tree/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/{{entity}}/widget/tree.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </admin_tree_widget_template>\n\n        <admin_eav_grid_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin EAV grid template</title>\n            <description>Admin template used for grids of EAV entities</description>\n            <condition>Generated if there is at least one EAV entity.</condition>\n            <filetype>phtml</filetype>\n            <scope>global</scope>\n            <depend>\n                <has_eav />\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/grid/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/grid.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </admin_eav_grid_template>\n\n        <attribute_js_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin EAV attribute edit js</title>\n            <description>Admin template used for editing attributes</description>\n            <condition>Generated if there is at least one EAV entity.</condition>\n            <filetype>phtml</filetype>\n            <scope>global</scope>\n            <depend>\n                <has_eav />\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/attribute/js/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/attribute/js.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </attribute_js_template>\n\n        <admin_eav_field_renderer translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin EAV field renderer</title>\n            <description>Admin template used for rendering fields in EAV entities</description>\n            <condition>Generated if there is at least one EAV entity.</condition>\n            <filetype>phtml</filetype>\n            <scope>global</scope>\n            <depend>\n                <has_eav />\n            </depend>\n            <source>app/design/adminhtml/template/namespace_module/form/renderer/fieldset/element/</source>\n            <destination>app/design/adminhtml/default/default/template/{{namespace}}_{{module}}/form/renderer/fieldset/element.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </admin_eav_field_renderer>\n\n        <frontend_layout translate=\"title description conditin\" module=\"modulecreator\">\n            <title>Frontend layout file</title>\n            <description>Layout XML file used for frontend</description>\n            <condition>Generated if at least an entity is displayed on frontend</condition>\n            <scope>global</scope>\n            <filetype>xml</filetype>\n            <source>app/design/frontend/layout/namespace_module/</source>\n            <destination>app/design/frontend/base/default/layout/{{namespace}}_{{module}}.xml</destination>\n            <depend>\n                <create_frontend />\n            </depend>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <comment>\n                    <name>020_comment</name>\n                    <depend>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </comment>\n                <list>\n                    <name>060_list</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <create_list/>\n                    </depend>\n                    <sort_order>60</sort_order>\n                </list>\n                <view>\n                    <name>070_view</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <create_view/>\n                    </depend>\n                    <sort_order>70</sort_order>\n                </view>\n                <entity_rss>\n                    <name>080_entity_rss</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>80</sort_order>\n                </entity_rss>\n                <rss_top>\n                    <name>090_rss_top</name>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>90</sort_order>\n                </rss_top>\n                <rss>\n                    <name>100_rss</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>100</sort_order>\n                </rss>\n                <rss_footer>\n                    <name>110_rss_footer</name>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>110</sort_order>\n                </rss_footer>\n                <relation_product>\n                    <name>120_relation_product</name>\n                    <depend>\n                        <show_on_product/>\n                    </depend>\n                    <sort_order>120</sort_order>\n                </relation_product>\n                <relation_category>\n                    <name>130_relation_category</name>\n                    <depend>\n                        <show_on_category/>\n                    </depend>\n                    <sort_order>130</sort_order>\n                </relation_category>\n                <entity_comment>\n                    <name>135_entity_comment</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>135</sort_order>\n                </entity_comment>\n                <footer>\n                    <name>140_footer</name>\n                    <sort_order>140</sort_order>\n                </footer>\n            </code>\n        </frontend_layout>\n\n        <list_on_product translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity list on product page template</title>\n            <description>Template for listing entities on product view page</description>\n            <condition>Generated for entities that should be listed on the product page.</condition>\n            <scope>entity</scope>\n            <filetype>phtml</filetype>\n            <depend>\n                <show_on_product/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/catalog/product/list/entity/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/catalog/product/list/{{entity}}.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </list_on_product>\n\n        <list_on_category translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity list on category page template</title>\n            <description>Template for listing entities on category view page</description>\n            <condition>Generated for entities that should be listed on the category page.</condition>\n            <scope>entity</scope>\n            <filetype>phtml</filetype>\n            <depend>\n                <show_on_category/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/catalog/category/list/entity/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/catalog/category/list/{{entity}}.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </list_on_category>\n\n        <product_list translate=\"title description condition\" module=\"modulecreator\">\n            <title>Product list on entity page template</title>\n            <description>Template used for listing products on entity page</description>\n            <condition>Generated for entities linked to products and that show products on the details page</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_products/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/catalog/product/list/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/catalog/product/list.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </product_list>\n\n        <category_list translate=\"title description condition\" module=\"modulecreator\">\n            <title>Category list on entity page template</title>\n            <description>Template used for listing categories on entity page</description>\n            <condition>Generated for entities linked to categories and that show categories on the details page</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_category/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/catalog/category/list/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/catalog/category/list.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </category_list>\n\n        <entity_children_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Frontend list children template</title>\n            <description>Template used to display the entity children on frontend for tree behaving entities</description>\n            <condition>Generated for tree behaving entities that have a fronted list page.</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <create_list/>\n                <is_tree/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/children/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/children.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_children_template>\n\n        <entity_child_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Frontend list child template</title>\n            <description>Template used to display child related entities</description>\n            <condition>Generated entities that have child entities.</condition>\n            <scope>children</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_frontend_relation_children/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/child/list/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/{{sibling}}/list.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_child_template>\n\n        <entity_list_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Frontend entity list template</title>\n            <description>Template used to list the entities on frontend</description>\n            <condition>Generated for entities that have a frontend list page</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <create_list/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/list/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/list.phtml</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <rss_link>\n                    <name>020_rss_link</name>\n                    <depend>\n                        <rss/>\n                    </depend>\n                    <sort_order>20</sort_order>\n                </rss_link>\n                <footer>\n                    <name>030_footer</name>\n                    <depend>\n                        <not_is_tree/>\n                    </depend>\n                    <sort_order>30</sort_order>\n                </footer>\n                <footer_is_tree>\n                    <name>040_footer_is_tree</name>\n                    <depend>\n                        <is_tree/>\n                    </depend>\n                    <sort_order>40</sort_order>\n                </footer_is_tree>\n            </code>\n        </entity_list_template>\n\n        <entity_view_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Frontend entity view template</title>\n            <description>Template used to view an entity on frontend</description>\n            <condition>Generated for entities that have a frontend view page</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <create_view/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/view/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/view.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_view_template>\n\n        <entity_sibling_list_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity siblings list template</title>\n            <description>Template used for listing entity siblings</description>\n            <condition>Generated for all siblings of an entity with frontend view page.</condition>\n            <scope>siblings</scope>\n            <filetype>php</filetype>\n            <depend>\n                <show_frontend_relation_siblings/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/sibling/list/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/{{sibling}}/list.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_sibling_list_template>\n\n        <entity_widget_link_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity widget link template</title>\n            <description>Template used for entity widget link</description>\n            <condition>Generated for entities with frontend view page and widgets</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <widget/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/widget/link/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/widget/link.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_widget_link_template>\n\n        <entity_widget_view_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity widget view template</title>\n            <description>Template used for entity widget view</description>\n            <condition>Generated for entities with frontend view page and widgets</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <widget/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/widget/view/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/widget/view.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_widget_view_template>\n\n        <entity_widget_subtree_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity widget view template</title>\n            <description>Template used for entity widget subtree</description>\n            <condition>Generated for tree entities with frontend view page and widgets</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <widget/>\n                <is_tree/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/widget/subtree/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/widget/subtree.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_widget_subtree_template>\n\n        <entity_comment_list_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity comment list template</title>\n            <description>Template used for displaying comments</description>\n            <condition>Generated for entities that allow comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/comment/list/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/comment/list.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_comment_list_template>\n\n        <entity_comment_form_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity comment form template</title>\n            <description>Template used for adding comments</description>\n            <condition>Generated for entities that allow comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/comment/form/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/comment/form.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_comment_form_template>\n\n        <entity_customer_comment_controller translate=\"title description condition\" module=\"modulecreator\">\n            <title>Customer comments controller</title>\n            <description>Controller used to list and view customer reviews for an entity</description>\n            <condition>Generated for entities that allow comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/controllers/Entity/Customer/CommentController/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/controllers/{{Entity}}/Customer/CommentController.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <entity_eav>\n                    <name>020_entity_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </entity_eav>\n                <entity_flat>\n                    <name>030_entity_flat</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </entity_flat>\n                <store>\n                    <name>040_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </store>\n                <entity_flat_store>\n                    <name>050_entity_flat_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                        <is_flat />\n                    </depend>\n                    <sort_order>50</sort_order>\n                </entity_flat_store>\n                <footer>\n                    <name>060_footer</name>\n                    <sort_order>60</sort_order>\n                </footer>\n            </code>\n        </entity_customer_comment_controller>\n\n        <entity_customer_comment_view translate=\"title description condition\" module=\"modulecreator\">\n            <title>Comment view block</title>\n            <description>Block used for viewing own comment</description>\n            <condition>Generated for entities that allow comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Entity/Customer/Comment/View/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Customer/Comment/View.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_customer_comment_view>\n\n        <entity_customer_comment_view_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Comment view template</title>\n            <description>Template used for viewing own comment</description>\n            <condition>Generated for entities that allow comments</condition>\n            <scope>entity</scope>\n            <filetype>phtml</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/customer/comment/view/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/customer/comment/view.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_customer_comment_view_template>\n\n        <entity_model_resource_entity_comment_entity_collection translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity - Comment resource collection</title>\n            <description>Resource used to link comments to entities</description>\n            <condition>Generated for entities that allow comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Model/Resource/Entity/Comment/Entity/Collection/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Resource/{{Entity}}/Comment/{{Entity}}/Collection.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <store_var>\n                    <name>020_store_var</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </store_var>\n                <construct>\n                    <name>030_construct</name>\n                    <sort_order>30</sort_order>\n                </construct>\n                <construct_store>\n                    <name>040_construct_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </construct_store>\n                <content>\n                    <name>050_content</name>\n                    <sort_order>50</sort_order>\n                </content>\n                <eav_title>\n                    <name>060_eav_title</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>60</sort_order>\n                </eav_title>\n                <more_content>\n                    <name>070_more_content</name>\n                    <sort_order>70</sort_order>\n                </more_content>\n                <select_count_store>\n                    <name>073_select_count_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>73</sort_order>\n                </select_count_store>\n                <select_sql>\n                    <name>075_select_sql</name>\n                    <sort_order>75</sort_order>\n                </select_sql>\n                <store_top>\n                    <name>080_store_top</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>80</sort_order>\n                </store_top>\n                <flat_store>\n                    <name>090_flat_store</name>\n                    <depend>\n                        <is_flat />\n                        <store />\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>90</sort_order>\n                </flat_store>\n                <store>\n                    <name>100_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>100</sort_order>\n                </store>\n                <filter>\n                    <name>110_filter</name>\n                    <sort_order>110</sort_order>\n                </filter>\n                <store_filter>\n                    <name>120_store_filter</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>120</sort_order>\n                </store_filter>\n                <footer>\n                    <name>130_footer</name>\n                    <sort_order>130</sort_order>\n                </footer>\n            </code>\n        </entity_model_resource_entity_comment_entity_collection>\n        <entity_customer_comment_list_block translate=\"title description condition\" module=\"modulecreator\">\n            <title>Block for rendering customer comments</title>\n            <description>This is the main block for listing comments posted by a customer</description>\n            <condition>Generated for entities that support comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/code/Block/Entity/Customer/Comment/List/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/{{Entity}}/Customer/Comment/List.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <store>\n                    <name>020_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </store>\n                <filter_eav>\n                    <name>030_filter_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>30</sort_order>\n                </filter_eav>\n                <filter_flat>\n                    <name>040_filter_flat</name>\n                    <depend>\n                        <is_flat />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </filter_flat>\n                <footer>\n                    <name>050_footer</name>\n                    <sort_order>50</sort_order>\n                </footer>\n            </code>\n        </entity_customer_comment_list_block>\n\n        <entity_customer_comment_list_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Template for rendering customer comments</title>\n            <description>This template renders the customer submitted comments</description>\n            <condition>Generated for entities that support comments</condition>\n            <scope>entity</scope>\n            <filetype>php</filetype>\n            <depend>\n                <allow_comment />\n            </depend>\n            <source>app/design/frontend/template/namespace_module/entity/customer/comment/list/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/{{entity}}/customer/comment/list.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_customer_comment_list_template>\n\n        <rss_template translate=\"title description condition\" module=\"modulecreator\">\n            <title>Frontend rss list template</title>\n            <description>The template for listing RSS links.</description>\n            <condition>Generated if at least an entity has RSS enabled.</condition>\n            <scope>global</scope>\n            <filetype>phtml</filetype>\n            <depend>\n                <rss/>\n            </depend>\n            <source>app/design/frontend/template/namespace_module/rss/</source>\n            <destination>app/design/frontend/base/default/template/{{namespace}}_{{module}}/rss.phtml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </rss_template>\n\n        <locale translate=\"title description condition\" module=\"modulecreator\">\n            <title>Translation file</title>\n            <description>File used for translation with all the texts in the module</description>\n            <condition>Always generated</condition>\n            <scope>global</scope>\n            <filetype>csv</filetype>\n            <source>app/locale/</source>\n            <destination>app/locale/en_US/{{Namespace}}_{{Module}}.csv</destination>\n            <after_build>_sortTranslationFile</after_build>\n            <code>\n                <global>\n                    <name>010_global</name>\n                    <sort_order>10</sort_order>\n                </global>\n                <entity>\n                    <name>020_entity</name>\n                    <scope>entity</scope>\n                    <sort_order>20</sort_order>\n                </entity>\n                <attribute>\n                    <name>030_attribute</name>\n                    <scope>attribute</scope>\n                    <sort_order>30</sort_order>\n                </attribute>\n                <rss>\n                    <name>040_rss</name>\n                    <depend>\n                        <rss />\n                    </depend>\n                    <sort_order>40</sort_order>\n                </rss>\n                <seo>\n                    <name>050_seo</name>\n                    <depend>\n                        <has_seo />\n                    </depend>\n                    <sort_order>50</sort_order>\n                </seo>\n                <attribute_yesno>\n                    <name>060_attribute_yesno</name>\n                    <scope>attribute</scope>\n                    <depend>\n                        <is_yes_no />\n                    </depend>\n                    <sort_order>60</sort_order>\n                </attribute_yesno>\n                <file>\n                    <name>070_file</name>\n                    <depend>\n                        <has_file />\n                    </depend>\n                    <sort_order>70</sort_order>\n                </file>\n                <product_relation>\n                    <name>080_product_relation</name>\n                    <depend>\n                        <link_product />\n                    </depend>\n                    <sort_order>80</sort_order>\n                </product_relation>\n                <category_relation>\n                    <name>090_category_relation</name>\n                    <depend>\n                        <link_category />\n                    </depend>\n                    <sort_order>90</sort_order>\n                </category_relation>\n                <relations>\n                    <name>100_relations</name>\n                    <scope>children</scope>\n                    <sort_order>100</sort_order>\n                </relations>\n                <tree>\n                    <name>110_tree</name>\n                    <depend>\n                        <has_tree />\n                    </depend>\n                    <sort_order>110</sort_order>\n                </tree>\n                <tree_entity>\n                    <name>120_tree_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                    <sort_order>120</sort_order>\n                </tree_entity>\n                <url_rewrite>\n                    <name>130_url_rewrite</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <url_rewrite />\n                    </depend>\n                    <sort_order>130</sort_order>\n                </url_rewrite>\n                <api>\n                    <name>140_api</name>\n                    <depend>\n                        <api />\n                    </depend>\n                    <sort_order>140</sort_order>\n                </api>\n                <api_entity>\n                    <name>150_api_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api />\n                    </depend>\n                    <sort_order>150</sort_order>\n                </api_entity>\n                <api_product_related>\n                    <name>160_api_product_related</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api />\n                        <link_product />\n                    </depend>\n                    <sort_order>160</sort_order>\n                </api_product_related>\n                <api_category_related>\n                    <name>170_api_category_related</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api />\n                        <link_category />\n                    </depend>\n                    <sort_order>170</sort_order>\n                </api_category_related>\n                <api_tree>\n                    <name>180_api_tree</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <api />\n                        <is_tree />\n                    </depend>\n                    <sort_order>180</sort_order>\n                </api_tree>\n                <api_sibling>\n                    <name>190_api_sibling</name>\n                    <scope>siblings</scope>\n                    <depend>\n                        <entity_has_api />\n                    </depend>\n                    <sort_order>190</sort_order>\n                </api_sibling>\n                <entity_eav>\n                    <name>200_entity_eav</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>200</sort_order>\n                </entity_eav>\n                <eav>\n                    <name>210_eav</name>\n                    <depend>\n                        <has_eav />\n                    </depend>\n                    <sort_order>210</sort_order>\n                </eav>\n                <entity_comment>\n                    <name>220_entity_comment</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>220</sort_order>\n                </entity_comment>\n                <comment>\n                    <name>230_comment</name>\n                    <depend>\n                        <allow_comment />\n                    </depend>\n                    <sort_order>230</sort_order>\n                </comment>\n                <comment_store>\n                    <name>240_comment_store</name>\n                    <depend>\n                        <allow_comment_by_store />\n                    </depend>\n                    <sort_order>240</sort_order>\n                </comment_store>\n                <api_comment>\n                    <name>250_api_comment</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <allow_comment />\n                        <api />\n                    </depend>\n                    <sort_order>250</sort_order>\n                </api_comment>\n                <eav_api>\n                    <name>260_eav_api</name>\n                    <depend>\n                        <has_eav />\n                        <api />\n                    </depend>\n                    <sort_order>260</sort_order>\n                </eav_api>\n                <frontend>\n                    <name>270_frontend</name>\n                    <depend>\n                        <create_frontend />\n                    </depend>\n                    <sort_order>270</sort_order>\n                </frontend>\n                <entity_seo>\n                    <name>280_entity_seo</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <add_seo />\n                    </depend>\n                    <sort_order>280</sort_order>\n                </entity_seo>\n                <rest>\n                    <name>290_rest</name>\n                    <depend>\n                        <rest />\n                    </depend>\n                    <sort_order>290</sort_order>\n                </rest>\n                <rest_entity>\n                    <name>300_rest_entity</name>\n                    <scope>entity</scope>\n                    <depend>\n                        <rest />\n                    </depend>\n                    <sort_order>300</sort_order>\n                </rest_entity>\n                <parent_relation>\n                    <name>310_parent</name>\n                    <depend>\n                        <has_parent_relation />\n                    </depend>\n                    <sort_order>310</sort_order>\n                </parent_relation>\n            </code>\n        </locale>\n\n        <image_placeholder translate=\"title description condition\" module=\"modulecreator\">\n            <title>Image placeholder</title>\n            <description>The placeholder image for entities with image attributes.</description>\n            <condition>Generated if an entity has at least one image field/attribute.</condition>\n            <scope>entity</scope>\n            <filetype>jpg</filetype>\n            <depend>\n                <has_image/>\n            </depend>\n            <source>skin/images/placeholder/entity/</source>\n            <destination>skin/frontend/base/default/images/placeholder/{{entity}}.jpg</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </image_placeholder>\n\n        <tree_css translate=\"title description condition\" module=\"modulecreator\">\n            <title>Css for tree display</title>\n            <description>Css file used to render a tree entity on frontend</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <scope>global</scope>\n            <filetype>css</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/css/namespace_module/tree/</source>\n            <destination>skin/frontend/base/default/css/{{namespace}}_{{module}}/tree.css</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </tree_css>\n\n        <tree_js translate=\"title description condition\" module=\"modulecreator\">\n            <title>Javascript for tree display</title>\n            <description>Javascript file used to render a tree entity on frontend</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <scope>global</scope>\n            <filetype>css</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/js/namespace_module/tree/</source>\n            <destination>skin/frontend/base/default/js/{{namespace}}_{{module}}/tree.css</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </tree_js>\n\n        <image_collapsed_gif translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree collapsed image (gif)</title>\n            <description>Image for collapsed tree</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <filetype>gif</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/images/namespace_module/collapsedgif/</source>\n            <destination>skin/frontend/base/default/images/{{namespace}}_{{module}}/collapsed.gif</destination>\n            <code>\n                <content>\n                    <name>010_content.gif</name>\n                </content>\n            </code>\n        </image_collapsed_gif>\n        <image_collapsed_png translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree collapsed image (png)</title>\n            <description>Image for collapsed tree</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <filetype>png</filetype>\n            <depend>\n                <has_tree />\n                <create_frontend/>\n            </depend>\n            <source>skin/images/namespace_module/collapsedpng/</source>\n            <destination>skin/frontend/base/default/images/{{namespace}}_{{module}}/collapsed.png</destination>\n            <code>\n                <content>\n                    <name>010_content.png</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </image_collapsed_png>\n        <image_expanded_gif translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree expanded image (gif)</title>\n            <description>Image for expanded tree</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <filetype>gif</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/images/namespace_module/expandedgif/</source>\n            <destination>skin/frontend/base/default/images/{{namespace}}_{{module}}/expanded.gif</destination>\n            <code>\n                <content>\n                    <name>010_content.gif</name>\n                </content>\n            </code>\n        </image_expanded_gif>\n        <image_expanded_png translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree expanded image (png)</title>\n            <description>Image for expanded tree</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <filetype>png</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/images/namespace_module/expandedpng/</source>\n            <destination>skin/frontend/base/default/images/{{namespace}}_{{module}}/expanded.png</destination>\n            <code>\n                <content>\n                    <name>010_content.png</name>\n                </content>\n            </code>\n        </image_expanded_png>\n        <image_line_1_gif translate=\"title description condition\" module=\"modulecreator\">\n            <title>Image 1 for tree (gif)</title>\n            <description>Image for tree</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <filetype>gif</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/images/namespace_module/line1gif/</source>\n            <destination>skin/frontend/base/default/images/{{namespace}}_{{module}}/line1.gif</destination>\n            <code>\n                <content>\n                    <name>010_content.gif</name>\n                </content>\n            </code>\n        </image_line_1_gif>\n        <image_line_1_png translate=\"title description condition\" module=\"modulecreator\">\n            <title>Image 1 for tree (png)</title>\n            <description>Image for tree</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <filetype>png</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/images/namespace_module/line1png/</source>\n            <destination>skin/frontend/base/default/images/{{namespace}}_{{module}}/line1.png</destination>\n            <code>\n                <content>\n                    <name>010_content.png</name>\n                </content>\n            </code>\n        </image_line_1_png>\n        <image_line_2_gif translate=\"title description condition\" module=\"modulecreator\">\n            <title>Image 2 for tree (gif)</title>\n            <description>Image for tree</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <filetype>gif</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/images/namespace_module/line2gif/</source>\n            <destination>skin/frontend/base/default/images/{{namespace}}_{{module}}/line2.gif</destination>\n            <code>\n                <content>\n                    <name>010_content.gif</name>\n                </content>\n            </code>\n        </image_line_2_gif>\n        <image_line_2_png translate=\"title description condition\" module=\"modulecreator\">\n            <title>Image 2 for tree (png)</title>\n            <description>Image for tree</description>\n            <condition>Generated if there is at least an entity that behaves as tree and has frontend list enabled</condition>\n            <filetype>png</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/images/namespace_module/line2png/</source>\n            <destination>skin/frontend/base/default/images/{{namespace}}_{{module}}/line2.png</destination>\n            <code>\n                <content>\n                    <name>010_content.png</name>\n                </content>\n            </code>\n        </image_line_2_png>\n\n        <tree_js translate=\"title description condition\" module=\"modulecreator\">\n            <title>Tree js file</title>\n            <description>Js file used for tree display.</description>\n            <condition>Generated if there is at least one entity that behaves as tree and has frontend files.</condition>\n            <filetype>js</filetype>\n            <depend>\n                <has_tree/>\n                <create_frontend/>\n            </depend>\n            <source>skin/js/namespace_module/tree/</source>\n            <destination>skin/frontend/base/default/js/{{namespace}}_{{module}}/tree.js</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </tree_js>\n\n        <entity_model_comment_api translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity comment SOAP API model</title>\n            <description>Model used to handle the SOAP API calls for entity comments</description>\n            <condition>Generated for each entities that has comments and SOAP API enabled</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <api/>\n                <allow_comment/>\n            </depend>\n            <source>app/code/Model/Entity/Comment/Api/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Comment/Api.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_model_comment_api>\n        <entity_model_comment_api_v2 translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity comment SOAP API model</title>\n            <description>Model used to handle the SOAP API calls for entity comments</description>\n            <condition>Generated for each entities that has comments and SOAP API enabled</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <api/>\n                <allow_comment/>\n            </depend>\n            <source>app/code/Model/Entity/Comment/Api/V2/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Comment/Api/V2.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_model_comment_api_v2>\n        <entity_model_attribute_api translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity attribute SOAP API model</title>\n            <description>Model used to handle the SOAP API calls for entity attributes</description>\n            <condition>Generated for each eav entities that has SOAP API enabled</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <api/>\n                <is_eav />\n            </depend>\n            <source>app/code/Model/Entity/Attribute/Api/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Attribute/Api.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_model_attribute_api>\n        <entity_model_attribute_api_v2 translate=\"title description condition\" module=\"modulecreator\">\n            <title>Entity attribute SOAP API V2 model</title>\n            <description>Model used to handle the SOAP API V2 calls for entity attributes</description>\n            <condition>Generated for each eav entities that has SOAP API enabled</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <api/>\n                <is_eav />\n            </depend>\n            <source>app/code/Model/Entity/Attribute/Api/V2/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/{{Entity}}/Attribute/Api/V2.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </entity_model_attribute_api_v2>\n        <api2 translate=\"title description condition\" module=\"modulecreator\">\n            <title>api2.xml - REST config file</title>\n            <description>The configuration for the REST API</description>\n            <condition>Generated if there is at least one entity that should have the REST API</condition>\n            <filetype>xml</filetype>\n            <depend>\n                <rest />\n            </depend>\n            <source>app/code/etc/api2/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/etc/api2.xml</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </api2>\n        <api2_model translate=\"title description condition\" module=\"modulecreator\">\n            <title>REST API entity model</title>\n            <description>The main model for the entity REST API</description>\n            <condition>Generated if there the entity should have the REST API</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <rest />\n            </depend>\n            <source>app/code/Model/Api2/Entity/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Api2/{{Entity}}.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <eav>\n                    <name>020_eav</name>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                    <sort_order>20</sort_order>\n                </eav>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </api2_model>\n        <api2_model_rest translate=\"title description condition\" module=\"modulecreator\">\n            <title>REST API entity model - rest handler</title>\n            <description>The main handler model for the entity REST API</description>\n            <condition>Generated if there the entity should have the REST API</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <rest />\n            </depend>\n            <source>app/code/Model/Api2/Entity/Rest/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Api2/{{Entity}}/Rest.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <tree_filter>\n                    <name>015_tree_filter</name>\n                    <sort_order>15</sort_order>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                </tree_filter>\n                <sore_collection>\n                    <name>020_store_collection</name>\n                    <sort_order>20</sort_order>\n                    <depend>\n                        <store />\n                    </depend>\n                </sore_collection>\n                <collection_center>\n                    <name>030_collection_center</name>\n                    <sort_order>30</sort_order>\n                </collection_center>\n                <url>\n                    <name>040_url</name>\n                    <sort_order>40</sort_order>\n                    <depend>\n                        <create_view />\n                    </depend>\n                </url>\n                <center>\n                    <name>050_center</name>\n                    <sort_order>50</sort_order>\n                </center>\n                <eav>\n                    <name>060_eav</name>\n                    <sort_order>60</sort_order>\n                    <depend>\n                        <is_eav />\n                    </depend>\n                </eav>\n                <load>\n                    <name>070_load</name>\n                    <sort_order>70</sort_order>\n                </load>\n                <store>\n                    <name>080_store</name>\n                    <sort_order>80</sort_order>\n                    <depend>\n                        <store />\n                    </depend>\n                </store>\n                <footer>\n                    <name>090_footer</name>\n                    <sort_order>90</sort_order>\n                </footer>\n            </code>\n        </api2_model_rest>\n        <api2_model_rest_guest translate=\"title description condition\" module=\"modulecreator\">\n            <title>REST API entity model - guest handler</title>\n            <description>The guest handler model for the entity REST API</description>\n            <condition>Generated if there the entity should have the REST API</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <rest />\n            </depend>\n            <source>app/code/Model/Api2/Entity/Rest/Guest/V1/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Api2/{{Entity}}/Rest/Guest/V1.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </api2_model_rest_guest>\n        <api2_model_rest_customer translate=\"title description condition\" module=\"modulecreator\">\n            <title>REST API entity model - customer handler</title>\n            <description>The customer handler model for the entity REST API</description>\n            <condition>Generated if there the entity should have the REST API</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <rest />\n            </depend>\n            <source>app/code/Model/Api2/Entity/Rest/Customer/V1/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Api2/{{Entity}}/Rest/Customer/V1.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </api2_model_rest_customer>\n        <api2_model_rest_admin translate=\"title description condition\" module=\"modulecreator\">\n            <title>REST API entity model - admin handler</title>\n            <description>The admin handler model for the entity REST API</description>\n            <condition>Generated if there the entity should have the REST API</condition>\n            <filetype>php</filetype>\n            <scope>entity</scope>\n            <depend>\n                <rest />\n            </depend>\n            <source>app/code/Model/Api2/Entity/Rest/Admin/V1/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Model/Api2/{{Entity}}/Rest/Admin/V1.php</destination>\n            <code>\n                <top>\n                    <name>010_top</name>\n                    <sort_order>10</sort_order>\n                </top>\n                <tree_filter>\n                    <name>020_tree_filter</name>\n                    <sort_order>20</sort_order>\n                    <depend>\n                        <is_tree />\n                    </depend>\n                </tree_filter>\n                <footer>\n                    <name>030_footer</name>\n                    <sort_order>30</sort_order>\n                </footer>\n            </code>\n        </api2_model_rest_admin>\n        <relation_column_renderer translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin column renderer for linked entities</title>\n            <description>Block for rendering columns of related entities</description>\n            <condition>Generated if are entities related or at least one entity is in a \"many to many\" relation with the products or categories.</condition>\n            <filetype>php</filetype>\n            <depend>\n                <has_relation_column_renderer />\n            </depend>\n            <source>app/code/Block/Adminhtml/Helper/Column/Renderer/Relation/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/Helper/Column/Renderer/Relation.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </relation_column_renderer>\n        <parent_column_renderer translate=\"title description condition\" module=\"modulecreator\">\n            <title>Admin column renderer for parent entities entities</title>\n            <description>Block for rendering columns of parent entities entities</description>\n            <condition>Generated if there is at least one parent-child relation between entities.</condition>\n            <filetype>php</filetype>\n            <depend>\n                <has_parent_relation />\n            </depend>\n            <source>app/code/Block/Adminhtml/Helper/Column/Renderer/Parent/</source>\n            <destination>app/code/{{codepool}}/{{Namespace}}/{{Module}}/Block/Adminhtml/Helper/Column/Renderer/Parent.php</destination>\n            <code>\n                <content>\n                    <name>010_content</name>\n                    <sort_order>10</sort_order>\n                </content>\n            </code>\n        </parent_column_renderer>\n    </files>\n</config>\n"
  },
  {
    "path": "app/design/adminhtml/default/default/layout/ultimate_modulecreator.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!-- \r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n */ \r\n/**\r\n * @category    Ultimate\r\n * @package     Ultimate_ModuleCreator\r\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */  \r\n -->\r\n<layout>\r\n    <!--[+] index action layout -->\r\n    <adminhtml_modulecreator_index>\r\n        <reference name=\"menu\">\r\n            <action method=\"setActive\">\r\n                <menupath>system/modulecreator</menupath>\r\n            </action>\r\n        </reference>\r\n        <reference name=\"content\">\r\n            <block type=\"modulecreator/adminhtml_modulecreator\" name=\"modules_list\"/>\r\n        </reference>\r\n    </adminhtml_modulecreator_index>\r\n    <!--[-] index action layout -->\r\n    <!--[+] grid action layout -->\r\n    <adminhtml_modulecreator_grid>\r\n        <block type=\"core/text_list\" name=\"root\">\r\n            <block type=\"modulecreator/adminhtml_modulecreator_grid\" name=\"modules_list\"/>\r\n        </block>\r\n    </adminhtml_modulecreator_grid>\r\n    <!--[-] grid action layout -->\r\n    <!--[+] add/edit action layout -->\r\n    <adminhtml_modulecreator_edit>\r\n        <reference name=\"menu\">\r\n            <action method=\"setActive\">\r\n                <menupath>system/modulecreator</menupath>\r\n            </action>\r\n        </reference>\r\n        <reference name=\"head\">\r\n            <action method=\"addCss\"><css>ultimate_modulecreator.css</css></action>\r\n            <action method=\"addjs\"><name>ultimate_modulecreator.js</name></action>\r\n            <action method=\"addItem\"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>\r\n            <action method=\"addCss\"><css>lib/prototype/windows/themes/magento.css</css></action>\r\n        </reference>\r\n        <reference name=\"left\">\r\n            <block type=\"modulecreator/adminhtml_modulecreator_edit_tabs\" name=\"modulecreator_edit_tabs\">\r\n                <action method=\"addTab\"><name>settings</name><block>modulecreator/adminhtml_modulecreator_edit_tab_settings</block></action>\r\n                <action method=\"addTab\"><name>entities</name><block>modulecreator/adminhtml_modulecreator_edit_tab_entities</block></action>\r\n                <action method=\"addTab\"><name>relations</name><block>modulecreator/adminhtml_modulecreator_edit_tab_relation</block></action>\r\n                <action method=\"addTab\" ifconfig=\"modulecreator/general/help\"><name>help</name><block>modulecreator/adminhtml_modulecreator_edit_tab_help</block></action>\r\n            </block>\r\n        </reference>\r\n        <reference name=\"content\">\r\n            <block type=\"modulecreator/adminhtml_modulecreator_edit\" />\r\n        </reference>\r\n    </adminhtml_modulecreator_edit>\r\n    <!--[-] add/edit action layout -->\r\n    <!--[+] system configuration screen -->\r\n    <adminhtml_system_config_edit>\r\n        <reference name=\"head\">\r\n            <action method=\"addCss\"><name>ultimate_modulecreator.css</name></action>\r\n        </reference>\r\n    </adminhtml_system_config_edit>\r\n    <!--[-] system configuration screen -->\r\n</layout>"
  },
  {
    "path": "app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities/entity/attribute.phtml",
    "content": "<?php\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n */\r\n/**\r\n * attribute template\r\n *\r\n * @category    Ultimate\r\n * @package     Ultimate_ModuleCreator\r\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n?>\r\n<?php $_id = $this->getEntityId().'_'.$this->getIncrement();?>\r\n<?php $_attribute = $this->getAttributeInstance();?>\r\n<div class=\"entry-edit modulecreator-attribute\" id=\"attribute_<?php echo $_id?>\">\r\n    <?php echo $this->getFormHtml()?>\r\n    <?php /** @var Ultimate_ModuleCreator_Model_Attribute $_attribute */?>\r\n    <?php if ($_attribute->getIsName()) : ?>\r\n        <script type=\"text/javascript\">\r\n            document.observe(\"dom:loaded\", function() {\r\n                nameAttributes[<?php echo $this->getEntityId();?>] = <?php echo $this->getIncrement();?>\r\n            });\r\n        </script>\r\n    <?php endif;?>\r\n</div>\r\n"
  },
  {
    "path": "app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities/entity.phtml",
    "content": "<?php\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n */\r\n/**\r\n * entity template\r\n * @category    Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n?>\r\n<?php /** @var Ultimate_ModuleCreator_Model_Entity $_entity */?>\r\n<?php $_entity = $this->getEntity();?>\r\n<div class=\"entry-edit modulecreator-entity\" id=\"entity_<?php echo $this->getIncrement();?>\">\r\n    <div class=\"entry-edit-head\">\r\n        <h4 id=\"entity_<?php echo $this->getIncrement()?>_title\" class=\"left\">\r\n            <?php if ($_entity->getLabelSingular()) : ?>\r\n                <?php echo $_entity->getLabelSingular();?>\r\n            <?php else : ?>\r\n                <?php echo Mage::helper('modulecreator')->__('Entity %s', $this->getIncrement());?>\r\n            <?php endif;?>\r\n        </h4>\r\n        <div class=\"right\">\r\n            <button type=\"button\" class=\"delete delete-entity\">\r\n                <span>\r\n                    <span>\r\n                        <span>\r\n                            <?php echo Mage::helper('modulecreator')->__('Remove entity');?>\r\n                        </span>\r\n                    </span>\r\n                </span>\r\n            </button>\r\n        </div>\r\n    </div>\r\n    <div class=\"option-box box fieldset\">\r\n        <div id=\"entity_<?php echo $this->getIncrement();?>_settings\">\r\n            <?php echo $this->getFormHtml();?>\r\n        </div>\r\n        <div id=\"entity_<?php echo $this->getIncrement();?>_attributes_container\" class=\"entry-edit\">\r\n            <div class=\"entry-edit-head\">\r\n                <h4><?php echo Mage::helper('modulecreator')->__('Fields / Attributes');?></h4>\r\n                <div class=\"right\">\r\n                    <button type=\"button\" class=\"add-attribute add\">\r\n                        <span>\r\n                            <span>\r\n                                <span><?php echo Mage::helper('modulecreator')->__('Add field / attribute');?></span>\r\n                            </span>\r\n                        </span>\r\n                    </button>\r\n                </div>\r\n            </div>\r\n            <div class=\"box fieldset\" id=\"entity_<?php echo $this->getIncrement();?>_attributes\" class=\"attributes-container\">\r\n                <?php $_index = 0; foreach ($_entity->getAttributes() as $_key=>$_attribute) : ?>\r\n                    <?php\r\n                    echo $this->getLayout()\r\n                            ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_entities_entity_attribute')\r\n                            ->setTemplate('ultimate_modulecreator/edit/tab/entities/entity/attribute.phtml')\r\n                            ->setAttributeInstance($_attribute)\r\n                            ->setEntityId($this->getIncrement())\r\n                            ->setIncrement($_index++)\r\n                            ->toHtml();\r\n                    ?>\r\n                <?php endforeach;?>\r\n            </div>\r\n            <div id=\"entity_<?php echo $this->getIncrement();?>_attributes_bottom\"></div>\r\n            <button type=\"button\" class=\"add-attribute add\">\r\n                <span>\r\n                    <span>\r\n                        <span><?php echo Mage::helper('modulecreator')->__('Add field / attribute');?></span>\r\n                    </span>\r\n                </span>\r\n            </button>\r\n        </div>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/entities.phtml",
    "content": "<?php\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n/**\r\n * entities tab template\r\n * @category    Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n?>\r\n<?php $_entities = $this->getEntities();?>\r\n<div id=\"entities-wrapper\" class=\"fieldset-wrapper\">\r\n    <div class=\"fieldset-wrapper-title\">\r\n        <strong class=\"title active\">\r\n            <span class=\"entity-title\">\r\n                <?php echo Mage::helper('modulecreator')->__('Entities');?>\r\n            </span>\r\n        </strong>\r\n    </div>\r\n    <div id=\"entities_container\">\r\n        <?php $_increment = 0;foreach ($_entities as $_code=>$_entity) : ?>\r\n            <?php\r\n            echo $this->getLayout()\r\n                ->createBlock('modulecreator/adminhtml_modulecreator_edit_tab_entities_entity')\r\n                ->setTemplate('ultimate_modulecreator/edit/tab/entities/entity.phtml')\r\n                ->setEntity($_entity)\r\n                ->setIncrement($_increment++)\r\n                ->toHtml();\r\n            ?>\r\n        <?php endforeach;?>\r\n    </div>\r\n</div>\r\n"
  },
  {
    "path": "app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/help/fieldset.phtml",
    "content": "<?php\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n */\r\n/**\r\n * help fieldset\r\n * @category    Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n?>\r\n<?php $fieldsets = $this->getFieldsets();?>\r\n<?php $columns = $this->getColumns();?>\r\n<?php if (count($fieldsets) > 0 && count($columns) > 0) : ?>\r\n    <h2><?php echo $this->getDescription();?></h2>\r\n    <?php foreach ($fieldsets as $key=>$settings) : ?>\r\n        <div class=\"entry-edit modulecretor-help\">\r\n            <div class=\"entry-edit\">\r\n                <div class=\"entry-edit-head\"><h4><?php echo $settings['label']?></h4></div>\r\n                <div class=\"box custom-options grid\" id=\"modulecreator_help_container_<?php echo $key?>\">\r\n                    <table id=\"help_<?php echo $key?>_table\" class=\"umc-help-table data\">\r\n                        <thead>\r\n                            <?php foreach ($columns as $column) : ?>\r\n                                <td><?php echo $column['header']?></td>\r\n                            <?php endforeach ;?>\r\n                        </thead>\r\n                        <tbody>\r\n                            <?php foreach ($settings['fields'] as $field) : ?>\r\n                                <tr>\r\n                                    <?php foreach ($columns as $column) : ?>\r\n                                        <td><?php echo $this->getFormatedValue($field, $column)?></td>\r\n                                    <?php endforeach ;?>\r\n                                </tr>\r\n                            <?php endforeach ;?>\r\n                        </tbody>\r\n                    </table>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        <script type=\"text/javascript\">\r\n            decorateTable('help_<?php echo $key?>_table', {'tbody tr':['odd', 'even'], 'tr td' : ['last']});\r\n        </script>\r\n    <?php endforeach;?>\r\n<?php endif;?>\r\n"
  },
  {
    "path": "app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/help.phtml",
    "content": "<?php\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n/**\r\n * help template\r\n * @category    Ultimate\r\n * @package     Ultimate_ModuleCreator\r\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n?>\r\n<div id=\"modulecreator_help_container\">\r\n    <h2><?php echo $this->__('This section should make it easier for you to use the module creator extension.');?></h2>\r\n    <div><?php echo $this->__('Each field has a tooltip about what it means, but there are all listed here.')?></div>\r\n    <div><?php echo $this->__('Current version is <strong>%s</strong>', $this->getVersion())?></div>\r\n    <?php echo $this->getChildHtml();?>\r\n    <script type=\"text/javascript\">\r\n        var umcHelp = new UMC.Help($('modulecreator_help_container'));\r\n    </script>\r\n</div>\r\n"
  },
  {
    "path": "app/design/adminhtml/default/default/template/ultimate_modulecreator/edit/tab/relation.phtml",
    "content": "<?php\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n/**\r\n * relation tab template\r\n * @category    Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n?>\r\n<div id=\"modulecreator_relations_container\" class=\"box custom-options\"></div>\r\n"
  },
  {
    "path": "app/design/adminhtml/default/default/template/ultimate_modulecreator/edit.phtml",
    "content": "<?php\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n/**\r\n * module edit template\r\n * @category    Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @author         Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n?>\r\n<script type=\"text/javascript\">\r\n    var nameAttributes = {};\r\n</script>\r\n<div class=\"content-header\">\r\n    <h3 class=\"icon-head\"><?php echo $this->getHeaderText() ?></h3>\r\n    <p class=\"content-buttons form-buttons\">\r\n        <?php echo $this->getBackButtonHtml() ?>\r\n        <?php echo $this->getCancelButtonHtml() ?>\r\n        <?php echo $this->getAddEntityButtonHtml();?>\r\n        <?php echo $this->getSaveButtonHtml() ?>\r\n        <?php echo $this->getSaveAndEditButtonHtml() ?>\r\n    </p>\r\n</div>\r\n<form action=\"<?php echo $this->getSaveUrl() ?>\" method=\"post\" id=\"edit_form\" enctype=\"multipart/form-data\">\r\n    <?php echo $this->getBlockHtml('formkey')?>\r\n    <div style=\"display:none\"></div>\r\n</form>\r\n<div id=\"entity_template\" style=\"display:none\">\r\n    <?php echo $this->getChildHtml('entity-template');?>\r\n</div>\r\n<div id=\"attribute_template\" style=\"display:none\">\r\n    <?php echo $this->getChildHtml('attribute-template');?>\r\n</div>\r\n<div id=\"menu_selector\" style=\"display:none\">\r\n    <?php echo $this->getChildHtml('menu-selector');?>\r\n</div>\r\n<script type=\"text/javascript\">\r\n//<![CDATA[\r\n    var moduleForm = new UMC.Form('edit_form', '<?php echo $this->getValidationUrl() ?>');\r\n    moduleForm._processValidationResult = function(transport) {\r\n        try{\r\n            var response = transport.responseText.evalJSON();\r\n            if (typeof varienGlobalEvents != undefined) {\r\n                varienGlobalEvents.fireEvent('formValidateAjaxComplete', transport);\r\n            }\r\n            if (response.error){\r\n                var errors = response.errors;\r\n                var attributes = response.attributes;\r\n                var globalErrors = '';\r\n                if (response.message){\r\n                    globalErrors = response.message;\r\n                }\r\n                //console.log(attributes);\r\n                if (attributes){\r\n                    for (var i in attributes){\r\n                        if (attributes.hasOwnProperty(i)){\r\n                            if ($(i)){\r\n                                $(i).setHasError(true, moduleForm);\r\n                                Validation.ajaxError($(i), attributes[i]);\r\n                                //open all fieldsets\r\n                                var field = $(i);\r\n                                while ($(field) && $(field).up('.fieldset') != 'undefined') {\r\n                                    field = $(field).up('.fieldset');\r\n                                    if ($(field)) {\r\n                                        $(field).show();\r\n                                    }\r\n                                }\r\n                                if (!Prototype.Browser.IE){\r\n                                    $(i).focus();\r\n                                }\r\n                            }\r\n                            else{\r\n                                globalErrors += '<li>' + attributes[i] + '</li>';\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n                if (globalErrors != '' && $('messages')){\r\n                    $('messages').innerHTML = '<ul class=\"messages\"><li class=\"error-msg\"><ul>' + globalErrors + '</ul></li></ul>';\r\n                    $('messages').show();\r\n                    Effect.ScrollTo($('messages'));\r\n                }\r\n            }\r\n            else{\r\n                moduleForm._submit();\r\n            }\r\n        }\r\n        catch (e){\r\n            $('messages').innerHTML = '<ul class=\"messages\"><li class=\"error-msg\"><ul>' + transport.responseText + '</ul></li></ul>';\r\n            $('messages').show();\r\n            Effect.ScrollTo($('messages'));\r\n        }\r\n    };\r\n\r\n    var templateSyntax = /(^|.|\\r|\\n)({{(\\w+)}})/;\r\n    function saveAndContinueEdit(urlTemplate) {\r\n        var template = new Template(urlTemplate, templateSyntax);\r\n        var url = template.evaluate({tab_id:modulecreator_info_tabsJsTabs.activeTab.id});\r\n        var advices = $$('div.validation-advice');\r\n        for (var i = 0; i<advices.length;i++){\r\n            advices[i].remove();\r\n        }\r\n        if ($('messages')){\r\n            $('messages').hide();\r\n        }\r\n        moduleForm.submit(url);\r\n    }\r\n    $('modulecreator_info_tabs_settings_content').select('table').each(function(el){\r\n        decorateTable($(el));\r\n    });\r\n    var $form = '';\r\n    document.observe(\"dom:loaded\", function() {\r\n        $form = new UMC.Module({\r\n            relationSelect: '<?php echo $this->getRelationSelectTemplate()?>',\r\n            entityTemplate: $('entity_template').innerHTML,\r\n            attributeTemplate: $('attribute_template').innerHTML,\r\n            nameAttributes: nameAttributes,\r\n            collapsed: <?php echo $this->getShowFieldsetsCollapsed();?>\r\n            <?php if ($this->getModule()) : ?>,\r\n            relations: <?php echo $this->getModule()->getRelationsAsJson()?>\r\n            <?php endif;?>\r\n        });\r\n    });\r\n//]]>\r\n</script>\r\n"
  },
  {
    "path": "app/design/adminhtml/default/default/template/ultimate_modulecreator/tooltip.phtml",
    "content": "<?php\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category       Ultimate\r\n * @package        Ultimate_ModuleCreator\r\n * @copyright      Copyright (c) 2014\r\n * @license        http://opensource.org/licenses/mit-license.php MIT License\r\n */ \r\n/**\r\n * tooltip template\r\n * @category    Ultimate\r\n * @package     Ultimate_ModuleCreator\r\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n?>\r\n<div class=\"f-right \">\r\n    <a class=\"field-tooltip\" style=\"cursor:pointer;z-index:0\" onclick=\"Dialog.alert('<?php echo $this->jsQuoteEscape($this->htmlEscape($this->getMessage()))?>', {className:'magento',width:300,okLabel: '<?php echo Mage::helper('modulecreator')->__('OK. I got it!')?>', buttonClass: 'scalable',id: '<?php echo md5($this->getMessage())?>', title: '<?php echo $this->jsQuoteEscape($this->htmlEscape($this->getTitle()))?>'});return false;\"></a>\r\n</div>\r\n"
  },
  {
    "path": "app/etc/modules/Ultimate_ModuleCreator.xml",
    "content": "<?xml version=\"1.0\"?>\r\n<!--\r\n/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category   Ultimate\r\n * @package    Ultimate_ModuleCreator\r\n * @copyright  Copyright (c) 2013\r\n * @license    http://opensource.org/licenses/mit-license.php MIT License\r\n */\r\n/**\r\n * @category    Ultimate\r\n * @package     Ultimate_ModuleCreator\r\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n -->\r\n<config>\r\n    <modules>\r\n        <Ultimate_ModuleCreator>\r\n            <active>true</active>\r\n            <codePool>community</codePool>\r\n            <depends>\r\n                <Mage_Core />\r\n                <Mage_Catalog />\r\n            </depends>\r\n        </Ultimate_ModuleCreator>\r\n    </modules>\r\n</config>\r\n"
  },
  {
    "path": "app/locale/en_US/Ultimate_ModuleCreator.csv",
    "content": "\"'Pimped up' the UI of the module creator\",\"'Pimped up' the UI of the module creator\"\n\"--Has no relation with--\",\"--Has no relation with--\"\n\"<a href=\"\"#\"\">Select menu parent and position</a>\",\"<a href=\"\"#\"\">Select menu parent and position</a>\"\n\"<a href=\"\"https://github.com/tzyganu/UMC1.9/issues/28\"\" target=\"\"_blank\"\">#28</a>\",\"<a href=\"\"https://github.com/tzyganu/UMC1.9/issues/28\"\" target=\"\"_blank\"\">#28</a>\"\n\"<a href=\"\"https://github.com/tzyganu/UMC1.9/issues/29\"\" target=\"\"_blank\"\">#29</a>\",\"<a href=\"\"https://github.com/tzyganu/UMC1.9/issues/29\"\" target=\"\"_blank\"\">#29</a>\"\n\"<span class=\"\"label label-info\"\">Info:</span> This field is available only if 'Link \"\"many to many\"\" with categories' is set to 'Yes'.\",\"<span class=\"\"label label-info\"\">Info:</span> This field is available only if 'Link \"\"many to many\"\" with categories' is set to 'Yes'.\"\n\"<span class=\"\"label label-info\"\">Info:</span> This field is available only if 'Link \"\"many to many\"\" with products' is set to 'Yes'.\",\"<span class=\"\"label label-info\"\">Info:</span> This field is available only if 'Link \"\"many to many\"\" with products' is set to 'Yes'.\"\n\"<span class=\"\"label label-info\"\">Info:</span>Try to use English words for this label. It's not mandatory, but it makes the taxonomy more readable. UMC will create a language file for the modules it generates and you can translate your module.<br /><span class=\"\"label label-info\"\">Info:</span>I recommend the first letter to be uppercase.\",\"<span class=\"\"label label-info\"\">Info:</span>Try to use English words for this label. It's not mandatory, but it makes the taxonomy more readable. UMC will create a language file for the modules it generates and you can translate your module.<br /><span class=\"\"label label-info\"\">Info:</span>I recommend the first letter to be uppercase.\"\n\"<span class=\"\"label label-info\"\">Info:</span>Use only letters. No numbers, no underscores, all in lowercase.\",\"<span class=\"\"label label-info\"\">Info:</span>Use only letters. No numbers, no underscores, all in lowercase.\"\n\"<span class=\"\"label label-info\"\">Info:</span>Use only letters. No numbers, no underscores, all in lowercase.<br /><span class=\"\"label label-info\"\">Info:</span>:There are some restrictions to these values, because there are reserved strings that might make the code not function properly. For example: 'resource', 'setup'. For a complete list of restrictions see Ultimate_ModuleCreator_Helper_Data::$_restrictedEntityNames\",\"<span class=\"\"label label-info\"\">Info:</span>Use only letters. No numbers, no underscores, all in lowercase.<br /><span class=\"\"label label-info\"\">Info:</span>:There are some restrictions to these values, because there are reserved strings that might make the code not function properly. For example: 'resource', 'setup'. For a complete list of restrictions see Ultimate_ModuleCreator_Helper_Data::$_restrictedEntityNames\"\n\"<span class=\"\"label label-warning\"\">Known issue:</span>If all the default Magento RSS feeds are disabled, but the general RSS feed is enabled and the RSS feed for your entity is also enabled a message will apprear on the RSS list page: 'There are no Rss Feeds'. This happens because Magento RSS list functionality does not allow adding custom RSS feeds without overriding a block.\",\"<span class=\"\"label label-warning\"\">Known issue:</span>If all the default Magento RSS feeds are disabled, but the general RSS feed is enabled and the RSS feed for your entity is also enabled a message will apprear on the RSS list page: 'There are no Rss Feeds'. This happens because Magento RSS list functionality does not allow adding custom RSS feeds without overriding a block.\"\n\"<span class=\"\"label label-warning\"\">Warning:</span>The zip is not compatible with Magento Connect. It's just a simple archive with the files of the module.<br />If you choose to install the module directly no file will be overwritten. If by a human error or UMC error a file should be overwritten then the 'Action' is changed to 'Create an archive. I will install it later.' and you will be notified of the files that were not overwritten.\",\"<span class=\"\"label label-warning\"\">Warning:</span>The zip is not compatible with Magento Connect. It's just a simple archive with the files of the module.<br />If you choose to install the module directly no file will be overwritten. If by a human error or UMC error a file should be overwritten then the 'Action' is changed to 'Create an archive. I will install it later.' and you will be notified of the files that were not overwritten.\"\n???,???\n\"A \"\"sibling\"\" relation between and EAV Tree entity and a Flat Tree entity did not behave as expected. but this is no problem. No one will use this kind of relation.\",\"A \"\"sibling\"\" relation between and EAV Tree entity and a Flat Tree entity did not behave as expected. but this is no problem. No one will use this kind of relation.\"\n\"A attribute/field with the code \"\"url_key\"\" will be added by default to your entity oif you choose to create URL rewrites for your entity\",\"A attribute/field with the code \"\"url_key\"\" will be added by default to your entity oif you choose to create URL rewrites for your entity\"\n\"A block added to the RSS feed list\",\"A block added to the RSS feed list\"\n\"A click on any row on the comments grid ended up in a \"\"Comment not found\"\" error.\",\"A click on any row on the comments grid ended up in a \"\"Comment not found\"\" error.\"\n\"A field with the code \"\"children_count\"\" will be added by default to your entity if the entity has \"\"Tree behavior\"\"\",\"A field with the code \"\"children_count\"\" will be added by default to your entity if the entity has \"\"Tree behavior\"\"\"\n\"A field with the code \"\"level\"\" will be added by default to your entity if the entity has \"\"Tree behavior\"\"\",\"A field with the code \"\"level\"\" will be added by default to your entity if the entity has \"\"Tree behavior\"\"\"\n\"A field with the code \"\"parent_id\"\" will be added by default to your entity if the entity has \"\"Tree behavior\"\"\",\"A field with the code \"\"parent_id\"\" will be added by default to your entity if the entity has \"\"Tree behavior\"\"\"\n\"A field with the code \"\"path\"\" will be added by default to your entity if the entity has \"\"Tree behavior\"\"\",\"A field with the code \"\"path\"\" will be added by default to your entity if the entity has \"\"Tree behavior\"\"\"\n\"A field/attribute cannot have the code \"\"node\"\"\",\"A field/attribute cannot have the code \"\"node\"\"\"\n\"A file for generating content had a wrong name\",\"A file for generating content had a wrong name\"\n\"A source model that returns 3 possible values\",\"A source model that returns 3 possible values\"\n\"A source model that returns available countries\",\"A source model that returns available countries\"\n\"A source model that returns available dropdown values\",\"A source model that returns available dropdown values\"\n\"API V2 model\",\"API V2 model\"\n\"API model\",\"API model\"\n\"API v1 model\",\"API v1 model\"\n\"API v2 model\",\"API v2 model\"\n\"API xml for WS-I complience\",\"API xml for WS-I complience\"\n\"Abstract helper for image resizing\",\"Abstract helper for image resizing\"\nAction,Action\n\"Acts as name\",\"Acts as name\"\n\"Add \"\"Created at\"\" to admin grid\",\"Add \"\"Created at\"\" to admin grid\"\n\"Add \"\"Updated at\"\" to admin grid\",\"Add \"\"Updated at\"\" to admin grid\"\n\"Add SEO attributes\",\"Add SEO attributes\"\n\"Add at least an entity\",\"Add at least an entity\"\n\"Add entity\",\"Add entity\"\n\"Add field / attribute\",\"Add field / attribute\"\n\"Add link to list in menu\",\"Add link to list in menu\"\n\"Add module\",\"Add module\"\n\"Added EAV entities\",\"Added EAV entities\"\n\"Added REST API functionality\",\"Added REST API functionality\"\n\"Added UI Effects\",\"Added UI Effects\"\n\"Added WS-I support for API for EAV entities\",\"Added WS-I support for API for EAV entities\"\n\"Added WS-I support for API for EAV entities and their attributes.\",\"Added WS-I support for API for EAV entities and their attributes.\"\n\"Added a verification for file existing for download in the created modules grid. Changed the names of the downloaded files - added module name to them.\",\"Added a verification for file existing for download in the created modules grid. Changed the names of the downloaded files - added module name to them.\"\n\"Added ability to select the frontend menu where the link to your entity page should be placed\",\"Added ability to select the frontend menu where the link to your entity page should be placed\"\n\"Added comment feature\",\"Added comment feature\"\n\"Added configurable frontend routes\",\"Added configurable frontend routes\"\n\"Added initLayoutMessages for frontend controllers\",\"Added initLayoutMessages for frontend controllers\"\n\"Added language file\",\"Added language file\"\n\"Added many to many link to categories\",\"Added many to many link to categories\"\n\"Added my comments for customers\",\"Added my comments for customers\"\n\"Added new attribute types\",\"Added new attribute types\"\n\"Added support for SOAP API\",\"Added support for SOAP API\"\n\"Added the en_US locale file for the module. The file was generated using <a href=\"\"https://github.com/tzyganu/MagentoTranslationTool\"\" target=\"\"_blank\"\">MagentoTranslationTool</a>\",\"Added the en_US locale file for the module. The file was generated using <a href=\"\"https://github.com/tzyganu/MagentoTranslationTool\"\" target=\"\"_blank\"\">MagentoTranslationTool</a>\"\n\"Added unique indexes to relation tables\",\"Added unique indexes to relation tables\"\n\"Admin EAV attribute edit js\",\"Admin EAV attribute edit js\"\n\"Admin EAV field renderer\",\"Admin EAV field renderer\"\n\"Admin EAV grid template\",\"Admin EAV grid template\"\n\"Admin Entity attributes form.\",\"Admin Entity attributes form.\"\n\"Admin Entity edit form.\",\"Admin Entity edit form.\"\n\"Admin column renderer for linked entities\",\"Admin column renderer for linked entities\"\n\"Admin column renderer for parent entities entities\",\"Admin column renderer for parent entities entities\"\n\"Admin layout file\",\"Admin layout file\"\n\"Admin menu sort order\",\"Admin menu sort order\"\n\"Admin menu title\",\"Admin menu title\"\n\"Admin parent menu ID\",\"Admin parent menu ID\"\n\"Admin siblings tab.\",\"Admin siblings tab.\"\n\"Admin tab category relation.\",\"Admin tab category relation.\"\n\"Admin tab for meta data.\",\"Admin tab for meta data.\"\n\"Admin tab product relation.\",\"Admin tab product relation.\"\n\"Admin template for category edit\",\"Admin template for category edit\"\n\"Admin template for managing categories \",\"Admin template for managing categories \"\n\"Admin template for managing siblings for tree entities\",\"Admin template for managing siblings for tree entities\"\n\"Admin template for product list\",\"Admin template for product list\"\n\"Admin template used for editing attributes\",\"Admin template used for editing attributes\"\n\"Admin template used for grids of EAV entities\",\"Admin template used for grids of EAV entities\"\n\"Admin template used for product listing in tree behaving entities.\",\"Admin template used for product listing in tree behaving entities.\"\n\"Admin template used for rendering fields in EAV entities\",\"Admin template used for rendering fields in EAV entities\"\n\"Admin template used for tree behaving entities widgets\",\"Admin template used for tree behaving entities widgets\"\n\"Admin template used for tree entity listing in categories.\",\"Admin template used for tree entity listing in categories.\"\n\"Admin tree widget template\",\"Admin tree widget template\"\n\"Adminhtml Observer\",\"Adminhtml Observer\"\n\"Adminhtml Search Model\",\"Adminhtml Search Model\"\n\"After you get the hang of it you can disable the field tooltips to make it a little faster.\",\"After you get the hang of it you can disable the field tooltips to make it a little faster.\"\n\"After you get the hang of it you can disable the help tab to make it a little faster.\",\"After you get the hang of it you can disable the help tab to make it a little faster.\"\n\"All the Magento page layouts are listed here: 1column, 2columns-left, ....<br />If you have any other page layout it will appear here.\",\"All the Magento page layouts are listed here: 1column, 2columns-left, ....<br />If you have any other page layout it will appear here.\"\n\"Allow comments\",\"Allow comments\"\n\"Allowed more attributes in mass action\",\"Allowed more attributes in mass action\"\n\"Along with the list of generated files now an sql uninstall script is generated for the created module.\",\"Along with the list of generated files now an sql uninstall script is generated for the created module.\"\n\"Always generated\",\"Always generated\"\n\"An attribute/field with code \"\"created_at\"\" will be added by default to your entity.\",\"An attribute/field with code \"\"created_at\"\" will be added by default to your entity.\"\n\"An attribute/field with code \"\"in_rss\"\" will be added by default to your entity if you choose to create a RSS feed for the entity.\",\"An attribute/field with code \"\"in_rss\"\" will be added by default to your entity if you choose to create a RSS feed for the entity.\"\n\"An attribute/field with code \"\"meta_description\"\" will be added by default to your entity if you choose to add seo attributes to the entity.\",\"An attribute/field with code \"\"meta_description\"\" will be added by default to your entity if you choose to add seo attributes to the entity.\"\n\"An attribute/field with code \"\"meta_keywords\"\" will be added by default to your entity if you choose to add seo attributes to the entity.\",\"An attribute/field with code \"\"meta_keywords\"\" will be added by default to your entity if you choose to add seo attributes to the entity.\"\n\"An attribute/field with code \"\"meta_title\"\" will be added by default to your entity if you choose to add seo attributes to the entity.\",\"An attribute/field with code \"\"meta_title\"\" will be added by default to your entity if you choose to add seo attributes to the entity.\"\n\"An attribute/field with code \"\"status\"\" will be added by default to your entity if you choose to create frontend files for the entity.\",\"An attribute/field with code \"\"status\"\" will be added by default to your entity if you choose to create frontend files for the entity.\"\n\"An attribute/field with code \"\"updated_at\"\" will be added by default to your entity.\",\"An attribute/field with code \"\"updated_at\"\" will be added by default to your entity.\"\n\"Api config file\",\"Api config file\"\n\"Are you sure?\",\"Are you sure?\"\n\"Attribute Scope\",\"Attribute Scope\"\n\"Attribute Type\",\"Attribute Type\"\n\"Attribute code\",\"Attribute code\"\n\"Attribute code %s is restricted because a method similar to \"\"set%s()\"\" or \"\"get%s()\"\" exists in parent model class\",\"Attribute code %s is restricted because a method similar to \"\"set%s()\"\" or \"\"get%s()\"\" exists in parent model class\"\n\"Attribute code for option source\",\"Attribute code for option source\"\n\"Attribute label\",\"Attribute label\"\n\"Attribute model\",\"Attribute model\"\n\"Attribute notes do not appear in the EAV entity form\",\"Attribute notes do not appear in the EAV entity form\"\n\"Attribute notes for EAV entities are now manageable from the backend.\",\"Attribute notes for EAV entities are now manageable from the backend.\"\n\"Attribute notes for EAV entities can be changed from the backend, when editing the attribute.\",\"Attribute notes for EAV entities can be changed from the backend, when editing the attribute.\"\n\"Attribute options are not escaped\",\"Attribute options are not escaped\"\n\"Attributes grid.\",\"Attributes grid.\"\n\"Auto-generate url rewrites\",\"Auto-generate url rewrites\"\nBack,Back\n\"Backend settings\",\"Backend settings\"\n\"Backend settings for you entity\",\"Backend settings for you entity\"\nBecause,Because\n\"Because some IDEs show errors when parsing incomplete PHP files I've removed the extension of the source files (etc/source)\",\"Because some IDEs show errors when parsing incomplete PHP files I've removed the extension of the source files (etc/source)\"\n\"Behaves as tree\",\"Behaves as tree\"\n\"Block for rendering columns of parent entities entities\",\"Block for rendering columns of parent entities entities\"\n\"Block for rendering columns of related entities\",\"Block for rendering columns of related entities\"\n\"Block for rendering customer comments\",\"Block for rendering customer comments\"\n\"Block used for managing EAV attribute\",\"Block used for managing EAV attribute\"\n\"Block used for viewing own comment\",\"Block used for viewing own comment\"\n\"Block used to add comments on frontend\",\"Block used to add comments on frontend\"\n\"Block used to display the entity comments on frontend\",\"Block used to display the entity comments on frontend\"\n\"Block used to generate the tabs in the admin add/edit form.\",\"Block used to generate the tabs in the admin add/edit form.\"\n\"Bug Fix\",\"Bug Fix\"\n\"Bug fix\",\"Bug fix\"\n\"Can behave as name\",\"Can behave as name\"\nCategories,Categories\n\"Categories admin template\",\"Categories admin template\"\n\"Category attribute\",\"Category attribute\"\n\"Category attribute code\",\"Category attribute code\"\n\"Category attribute group\",\"Category attribute group\"\n\"Category attribute scope\",\"Category attribute scope\"\n\"Category helper\",\"Category helper\"\n\"Category list on entity page template\",\"Category list on entity page template\"\n\"Category relation bug\",\"Category relation bug\"\n\"Category relation collection resource model\",\"Category relation collection resource model\"\n\"Category relation resource model\",\"Category relation resource model\"\n\"Category relation tab appears for tree entities even if not set to yes.\",\"Category relation tab appears for tree entities even if not set to yes.\"\n\"Change module class aliases\",\"Change module class aliases\"\n\"Changed dropdown options separator to new line instead of pipe (|)\",\"Changed dropdown options separator to new line instead of pipe (|)\"\n\"Changed identation from TAB to 4x space\",\"Changed identation from TAB to 4x space\"\n\"Changed the class aliases from `module` to `namespace_module`. For example a model will be instantiated using `Mage::getModel('namespace_module/some_model')` to avoid extension conflicts.\",\"Changed the class aliases from `module` to `namespace_module`. For example a model will be instantiated using `Mage::getModel('namespace_module/some_model')` to avoid extension conflicts.\"\n\"Changed the way sibling entities relations are saved\",\"Changed the way sibling entities relations are saved\"\n\"Cleaned a bit the code\",\"Cleaned a bit the code\"\n\"Cleaned up the UMC code and the generated code. Now all files (almost) follow the zend coding standards.\",\"Cleaned up the UMC code and the generated code. Now all files (almost) follow the zend coding standards.\"\n\"Cleaned up the code\",\"Cleaned up the code\"\n\"Code pool\",\"Code pool\"\n\"Collection resource model for entities that are related many to many\",\"Collection resource model for entities that are related many to many\"\n\"Collection resource model for entity category relation\",\"Collection resource model for entity category relation\"\n\"Collection resource model for entity product relation\",\"Collection resource model for entity product relation\"\n\"Collection resource model to handle entity comments\",\"Collection resource model to handle entity comments\"\nComment,Comment\n\"Comment view block\",\"Comment view block\"\n\"Comment view template\",\"Comment view template\"\n\"Comments grid include entity name\",\"Comments grid include entity name\"\nCondition,Condition\n\"Configure the field / attribute assigned to the entity\",\"Configure the field / attribute assigned to the entity\"\n\"Controller for handling entity-category relation requests\",\"Controller for handling entity-category relation requests\"\n\"Controller for handling entity-product relation requests\",\"Controller for handling entity-product relation requests\"\n\"Controller used for managing entity attributes\",\"Controller used for managing entity attributes\"\n\"Controller used to create other module controllers\",\"Controller used to create other module controllers\"\n\"Controller used to list and view customer reviews for an entity\",\"Controller used to list and view customer reviews for an entity\"\nCountry,Country\n\"Country and Dropdown attributes can be set by mass action from grid.\",\"Country and Dropdown attributes can be set by mass action from grid.\"\n\"Country source model\",\"Country source model\"\n\"Create Module\",\"Create Module\"\n\"Create REST API\",\"Create REST API\"\n\"Create RSS feed\",\"Create RSS feed\"\n\"Create SOAP API\",\"Create SOAP API\"\n\"Create URL rewrites\",\"Create URL rewrites\"\n\"Create archive. I will install it later\",\"Create archive. I will install it later\"\n\"Create entity list files\",\"Create entity list files\"\n\"Create entity view files\",\"Create entity view files\"\n\"Create frontend files\",\"Create frontend files\"\n\"Create new module\",\"Create new module\"\n\"Create widgets\",\"Create widgets\"\n\"Created files\",\"Created files\"\n\"Css file used to render a tree entity on frontend\",\"Css file used to render a tree entity on frontend\"\n\"Css for tree display\",\"Css for tree display\"\n\"Current version is <strong>%s</strong>\",\"Current version is <strong>%s</strong>\"\n\"Custom entities can be added as product, category and customer attributes.\",\"Custom entities can be added as product, category and customer attributes.\"\n\"Customer attribute\",\"Customer attribute\"\n\"Customer comments controller\",\"Customer comments controller\"\nDate,Date\nDecimal,Decimal\n\"Default attribute settings\",\"Default attribute settings\"\n\"Default entity settings\",\"Default entity settings\"\n\"Default module settings\",\"Default module settings\"\n\"Default value\",\"Default value\"\nDescription,Description\n\"Different types of session messages were not displayed in the entity actions (view/list) <a href=\"\"https://github.com/tzyganu/UMC1.9/issues/2\"\" target=\"\"_blank\"\">(#2)</a>\",\"Different types of session messages were not displayed in the entity actions (view/list) <a href=\"\"https://github.com/tzyganu/UMC1.9/issues/2\"\" target=\"\"_blank\"\">(#2)</a>\"\n\"Disallowed entity names\",\"Disallowed entity names\"\n\"Disallowed field/attribute names\",\"Disallowed field/attribute names\"\n\"Disallowed module names\",\"Disallowed module names\"\n\"Disallowed namespace names\",\"Disallowed namespace names\"\n\"Do not include in any menu\",\"Do not include in any menu\"\nDownload,Download\n\"Download Config File\",\"Download Config File\"\n\"Download List of Files\",\"Download List of Files\"\n\"Download Module\",\"Download Module\"\n\"Download Uninstall DB Script\",\"Download Uninstall DB Script\"\n\"Drag & drop attributes\",\"Drag & drop attributes\"\nDropdown,Dropdown\n\"Dropdown attribute for flat entities were not configured correctly in the admin grid and admin add/edid form.\",\"Dropdown attribute for flat entities were not configured correctly in the admin grid and admin add/edid form.\"\n\"Dropdown attribute source model\",\"Dropdown attribute source model\"\nEAV,EAV\n\"EAV Entity attribute resource collection model\",\"EAV Entity attribute resource collection model\"\n\"EAV attribute model.\",\"EAV attribute model.\"\n\"EAV attribute resource model.\",\"EAV attribute resource model.\"\n\"EAV entity admin controller (not tree).\",\"EAV entity admin controller (not tree).\"\n\"EAV entity admin controller EAV Tree.\",\"EAV entity admin controller EAV Tree.\"\n\"EAV tree entities admin tree not refreshing on save\",\"EAV tree entities admin tree not refreshing on save\"\n\"Each entity must have a label used for buttons, links, messages.<br />This is the singular form of the label. For example in a blog module, the post entity will have the label in singular form 'Post'\",\"Each entity must have a label used for buttons, links, messages.<br />This is the singular form of the label. For example in a blog module, the post entity will have the label in singular form 'Post'\"\n\"Each entity must have an attribute to behave as \"\"Name\"\". This attribute will be used to identify different entities among themselves. It will also be used in dropdowns with entities. This option is available only for text, number and decimal attributes.\",\"Each entity must have an attribute to behave as \"\"Name\"\". This attribute will be used to identify different entities among themselves. It will also be used in dropdowns with entities. This option is available only for text, number and decimal attributes.\"\n\"Each field has a tooltip about what it means, but there are all listed here.\",\"Each field has a tooltip about what it means, but there are all listed here.\"\nEdit,Edit\n\"Edit block used for managing EAV attribute\",\"Edit block used for managing EAV attribute\"\n\"Edit module \"\"%s\"\"\",\"Edit module \"\"%s\"\"\"\n\"Element renderer for EAV attributes.\",\"Element renderer for EAV attributes.\"\n\"Empty page for non existing entities\",\"Empty page for non existing entities\"\n\"Enable by stores\",\"Enable by stores\"\n\"Enable/disable comments for each instance\",\"Enable/disable comments for each instance\"\nEntities,Entities\n\"Entities can be related independent of their type\",\"Entities can be related independent of their type\"\n\"Entities link top menu does not get selected.\",\"Entities link top menu does not get selected.\"\n\"Entities not displaying in product page.\",\"Entities not displaying in product page.\"\n\"Entities related to categories were displayed on the category page at the top. Now they are after the product list.\",\"Entities related to categories were displayed on the category page at the top. Now they are after the product list.\"\n\"Entities were not displaying in product page unless they had a separate view page.\",\"Entities were not displaying in product page unless they had a separate view page.\"\n\"Entities without url rewrites generated an empty url.\",\"Entities without url rewrites generated an empty url.\"\nEntity,Entity\n\"Entity \"\"%s\"\" type is not valid\",\"Entity \"\"%s\"\" type is not valid\"\n\"Entity %s\",\"Entity %s\"\n\"Entity - Comment resource collection\",\"Entity - Comment resource collection\"\n\"Entity Admin category controller\",\"Entity Admin category controller\"\n\"Entity Admin product controller\",\"Entity Admin product controller\"\n\"Entity RSS block.\",\"Entity RSS block.\"\n\"Entity Relations\",\"Entity Relations\"\n\"Entity admin abstract block.\",\"Entity admin abstract block.\"\n\"Entity admin attribute controller.\",\"Entity admin attribute controller.\"\n\"Entity admin block.\",\"Entity admin block.\"\n\"Entity admin comments block\",\"Entity admin comments block\"\n\"Entity admin comments grid block\",\"Entity admin comments grid block\"\n\"Entity admin controller for flat not tree entities.\",\"Entity admin controller for flat not tree entities.\"\n\"Entity admin edit block.\",\"Entity admin edit block.\"\n\"Entity admin edit comments block\",\"Entity admin edit comments block\"\n\"Entity admin edit comments form container block\",\"Entity admin edit comments form container block\"\n\"Entity admin edit comments main tab block\",\"Entity admin edit comments main tab block\"\n\"Entity admin edit comments stores tab block\",\"Entity admin edit comments stores tab block\"\n\"Entity admin edit comments tabs block\",\"Entity admin edit comments tabs block\"\n\"Entity admin edit form block.\",\"Entity admin edit form block.\"\n\"Entity admin grid.\",\"Entity admin grid.\"\n\"Entity admin stores tab.\",\"Entity admin stores tab.\"\n\"Entity admin tabs block.\",\"Entity admin tabs block.\"\n\"Entity admin widget controller.\",\"Entity admin widget controller.\"\n\"Entity attribute SOAP API V2 model\",\"Entity attribute SOAP API V2 model\"\n\"Entity attribute SOAP API model\",\"Entity attribute SOAP API model\"\n\"Entity category model\",\"Entity category model\"\n\"Entity code plural\",\"Entity code plural\"\n\"Entity code singular\",\"Entity code singular\"\n\"Entity collection resource model.\",\"Entity collection resource model.\"\n\"Entity comment SOAP API model\",\"Entity comment SOAP API model\"\n\"Entity comment collection resource model\",\"Entity comment collection resource model\"\n\"Entity comment form template\",\"Entity comment form template\"\n\"Entity comment list template\",\"Entity comment list template\"\n\"Entity comment model\",\"Entity comment model\"\n\"Entity comment resource model\",\"Entity comment resource model\"\n\"Entity comments admin controller\",\"Entity comments admin controller\"\n\"Entity form file renderer.\",\"Entity form file renderer.\"\n\"Entity form image renderer.\",\"Entity form image renderer.\"\n\"Entity frontend controller\",\"Entity frontend controller\"\n\"Entity helper\",\"Entity helper\"\n\"Entity image helper\",\"Entity image helper\"\n\"Entity link widget block\",\"Entity link widget block\"\n\"Entity links with catalog categories\",\"Entity links with catalog categories\"\n\"Entity links with products\",\"Entity links with products\"\n\"Entity list on category page\",\"Entity list on category page\"\n\"Entity list on category page template\",\"Entity list on category page template\"\n\"Entity list on product page\",\"Entity list on product page\"\n\"Entity list on product page template\",\"Entity list on product page template\"\n\"Entity list page\",\"Entity list page\"\n\"Entity management.\",\"Entity management.\"\n\"Entity model\",\"Entity model\"\n\"Entity product model\",\"Entity product model\"\n\"Entity resource model.\",\"Entity resource model.\"\n\"Entity sibling list block\",\"Entity sibling list block\"\n\"Entity sibling model\",\"Entity sibling model\"\n\"Entity siblings list template\",\"Entity siblings list template\"\n\"Entity source model\",\"Entity source model\"\n\"Entity subtree widget block\",\"Entity subtree widget block\"\n\"Entity tab on product form\",\"Entity tab on product form\"\n\"Entity type\",\"Entity type\"\n\"Entity view block\",\"Entity view block\"\n\"Entity view widget block\",\"Entity view widget block\"\n\"Entity widget chooser .\",\"Entity widget chooser .\"\n\"Entity widget link template\",\"Entity widget link template\"\n\"Entity widget view template\",\"Entity widget view template\"\n\"Escaped attribute labels and notes.\",\"Escaped attribute labels and notes.\"\nFeature,Feature\nField,Field\n\"Field / Attribute settings\",\"Field / Attribute settings\"\n\"Field/Attribute codes use the same validation as product attributes\",\"Field/Attribute codes use the same validation as product attributes\"\n\"Field/Attribute management.\",\"Field/Attribute management.\"\n\"Fields / Attributes\",\"Fields / Attributes\"\nFile,File\n\"File does not exist or is not readable\",\"File does not exist or is not readable\"\n\"File needed for API V2 integration\",\"File needed for API V2 integration\"\n\"File needed for API integration\",\"File needed for API integration\"\n\"File save backend model\",\"File save backend model\"\n\"File used for translation with all the texts in the module\",\"File used for translation with all the texts in the module\"\n\"Fill in a default value for the attribute. Leave empty for no value. For dropdown and multiselect attributes the value, must be a valid value. not valid ones will be removed. For the multiselect attributes add one default value on each line. For Yes/No attribtues enter 1 for Yes, 0 for No. For country attributes fill in the country ISO2 code. You cannot set a default value for dropdown and multiselect attributes that use a source model and on image and file attributes.\",\"Fill in a default value for the attribute. Leave empty for no value. For dropdown and multiselect attributes the value, must be a valid value. not valid ones will be removed. For the multiselect attributes add one default value on each line. For Yes/No attribtues enter 1 for Yes, 0 for No. For country attributes fill in the country ISO2 code. You cannot set a default value for dropdown and multiselect attributes that use a source model and on image and file attributes.\"\n\"Fill in here the url for the list page. Leave empty to use 'module/entity/index'. It can later be changed from the config section.\",\"Fill in here the url for the list page. Leave empty to use 'module/entity/index'. It can later be changed from the config section.\"\n\"Fill in the dropdown attribute code.\",\"Fill in the dropdown attribute code.\"\nFix,Fix\n\"Fix url rewrite save\",\"Fix url rewrite save\"\n\"Fixed 'undefined variable' error for tree entities.\",\"Fixed 'undefined variable' error for tree entities.\"\n\"Fixed 'undefined variable' for tree entities\",\"Fixed 'undefined variable' for tree entities\"\n\"Fixed 2 status fields generated in the setup file\",\"Fixed 2 status fields generated in the setup file\"\n\"Fixed RSS display\",\"Fixed RSS display\"\n\"Fixed admin ACL for comments and EAV attributes\",\"Fixed admin ACL for comments and EAV attributes\"\n\"Fixed admin search\",\"Fixed admin search\"\n\"Fixed bug that appears when there is an uppercase letter in the module name.\",\"Fixed bug that appears when there is an uppercase letter in the module name.\"\n\"Fixed comment row URL\",\"Fixed comment row URL\"\n\"Fixed date fields save\",\"Fixed date fields save\"\n\"Fixed display on category page\",\"Fixed display on category page\"\n\"Fixed documentation on some generated methods.\",\"Fixed documentation on some generated methods.\"\n\"Fixed dropdown attributes for flat entities\",\"Fixed dropdown attributes for flat entities\"\n\"Fixed entities in category page\",\"Fixed entities in category page\"\n\"Fixed entity relations\",\"Fixed entity relations\"\n\"Fixed field/attribute codes validation.\",\"Fixed field/attribute codes validation.\"\n\"Fixed generation of uninstall script\",\"Fixed generation of uninstall script\"\n\"Fixed missing single quotation mark in _filterDates()\",\"Fixed missing single quotation mark in _filterDates()\"\n\"Fixed multiselect attributes in combination with url rewrite\",\"Fixed multiselect attributes in combination with url rewrite\"\n\"Fixed or generation for entities without url rewrites\",\"Fixed or generation for entities without url rewrites\"\n\"Fixed php doc on some methods\",\"Fixed php doc on some methods\"\n\"Fixed related entities grid columns\",\"Fixed related entities grid columns\"\n\"Fixed relations between tree behaving entities\",\"Fixed relations between tree behaving entities\"\n\"Fixed some typos in the UMC UI.\",\"Fixed some typos in the UMC UI.\"\n\"Fixed some typos in the locale file\",\"Fixed some typos in the locale file\"\n\"Fixed some typos text messages\",\"Fixed some typos text messages\"\n\"Fixed the sibling relation tab on admin.\",\"Fixed the sibling relation tab on admin.\"\n\"Fixed tree entities display\",\"Fixed tree entities display\"\n\"Fixed tree widget chooser\",\"Fixed tree widget chooser\"\n\"Fixed typo\",\"Fixed typo\"\n\"Fixed typo in the generated module for category relation.\",\"Fixed typo in the generated module for category relation.\"\n\"Fixed typos in the UI\",\"Fixed typos in the UI\"\n\"Fixed wrong display of multiselect attribute on frontend\",\"Fixed wrong display of multiselect attribute on frontend\"\n\"Fixed wrong helper alias in Yes/No attribute display\",\"Fixed wrong helper alias in Yes/No attribute display\"\nFlat,Flat\n\"Flat entities with url rewrites and no stores could not be saved.\",\"Flat entities with url rewrites and no stores could not be saved.\"\n\"Flat entity admin controller (tree).\",\"Flat entity admin controller (tree).\"\n\"For attributes that have options, the options were not escaped in the install script.\",\"For attributes that have options, the options were not escaped in the install script.\"\n\"For dropdown and multiselect attributes you can set the values manually or use the values from a product attribute, a category attribute or a customer attribute.\",\"For dropdown and multiselect attributes you can set the values manually or use the values from a product attribute, a category attribute or a customer attribute.\"\n\"For entities that support comments\",\"For entities that support comments\"\n\"For entities that support comments by store\",\"For entities that support comments by store\"\n\"For flat entities that have multiselect attributes and url rewrite the _beforeSave method was generated twice.\",\"For flat entities that have multiselect attributes and url rewrite the _beforeSave method was generated twice.\"\n\"For modules with entities that are marked as being product or category attributes the resource model parent class is set to `Mage_Core_Model_Resource_Setup` and it should be `Mage_Catalog_Model_Resource_Setup`\",\"For modules with entities that are marked as being product or category attributes the resource model parent class is set to `Mage_Core_Model_Resource_Setup` and it should be `Mage_Catalog_Model_Resource_Setup`\"\n\"For non tree entities related as siblings there was an error in the admin relation tab.\",\"For non tree entities related as siblings there was an error in the admin relation tab.\"\n\"For security reasons, to avoid module name collisions with the Magento core you cannot name a module just like an existing one even in a different namespace: \"\"Catalog\"\", \"\"Sales\"\", \"\"Checkout\"\"...\",\"For security reasons, to avoid module name collisions with the Magento core you cannot name a module just like an existing one even in a different namespace: \"\"Catalog\"\", \"\"Sales\"\", \"\"Checkout\"\"...\"\n\"For the EAV entities that have child entities, the grid column did not display values.\",\"For the EAV entities that have child entities, the grid column did not display values.\"\n\"Form block used for managing EAV attribute\",\"Form block used for managing EAV attribute\"\n\"Form container block for editing comments.\",\"Form container block for editing comments.\"\n\"From this dropdown you can select the layout of your entity list page from the available page formats.\",\"From this dropdown you can select the layout of your entity list page from the available page formats.\"\n\"From this dropdown you can select the layout of your entity view page from the available page formats.\",\"From this dropdown you can select the layout of your entity view page from the available page formats.\"\n\"From this tab you can select the store to publish your entity.\",\"From this tab you can select the store to publish your entity.\"\n\"From this tab you can set the meta attribute values for the entity.\",\"From this tab you can set the meta attribute values for the entity.\"\n\"From this tab you can set the related categories to your entity.\",\"From this tab you can set the related categories to your entity.\"\n\"From this tab you can set the related entities.\",\"From this tab you can set the related entities.\"\n\"From this tab you can set the related products to your entity.\",\"From this tab you can set the related products to your entity.\"\nFrontend,Frontend\n\"Frontend comments for entity\",\"Frontend comments for entity\"\n\"Frontend comments form for entity\",\"Frontend comments form for entity\"\n\"Frontend entity list template\",\"Frontend entity list template\"\n\"Frontend entity view template\",\"Frontend entity view template\"\n\"Frontend key\",\"Frontend key\"\n\"Frontend layout file\",\"Frontend layout file\"\n\"Frontend layout file generation\",\"Frontend layout file generation\"\n\"Frontend layout file was always generated. Now is generated only if there is at least one entity that has frontend.\",\"Frontend layout file was always generated. Now is generated only if there is at least one entity that has frontend.\"\n\"Frontend list child template\",\"Frontend list child template\"\n\"Frontend list children template\",\"Frontend list children template\"\n\"Frontend observer\",\"Frontend observer\"\n\"Frontend rss list template\",\"Frontend rss list template\"\n\"Frontend settings for your entity\",\"Frontend settings for your entity\"\n\"General Information\",\"General Information\"\n\"General Settings\",\"General Settings\"\n\"General settings\",\"General settings\"\n\"General settings tab.\",\"General settings tab.\"\n\"Generated entities that have child entities.\",\"Generated entities that have child entities.\"\n\"Generated files\",\"Generated files\"\n\"Generated for EAV entities\",\"Generated for EAV entities\"\n\"Generated for EAV entities that behave as tree.\",\"Generated for EAV entities that behave as tree.\"\n\"Generated for EAV entities that don't behave as tree.\",\"Generated for EAV entities that don't behave as tree.\"\n\"Generated for all attributes with type dropdown or multiselect in a flat entity\",\"Generated for all attributes with type dropdown or multiselect in a flat entity\"\n\"Generated for all entities that are related many to many\",\"Generated for all entities that are related many to many\"\n\"Generated for all entities that are related many to many with categories\",\"Generated for all entities that are related many to many with categories\"\n\"Generated for all entities that are related many to many with products\",\"Generated for all entities that are related many to many with products\"\n\"Generated for all entities with comments enabled\",\"Generated for all entities with comments enabled\"\n\"Generated for all siblings of an entity with frontend view page.\",\"Generated for all siblings of an entity with frontend view page.\"\n\"Generated for all siblings that behave as tree\",\"Generated for all siblings that behave as tree\"\n\"Generated for all tree behaving entities\",\"Generated for all tree behaving entities\"\n\"Generated for all tree behaving entities that support widgets.\",\"Generated for all tree behaving entities that support widgets.\"\n\"Generated for each eav entities that has SOAP API enabled\",\"Generated for each eav entities that has SOAP API enabled\"\n\"Generated for each eav entity.\",\"Generated for each eav entity.\"\n\"Generated for each entities that has comments and SOAP API enabled\",\"Generated for each entities that has comments and SOAP API enabled\"\n\"Generated for each entity that is included in the admin search.\",\"Generated for each entity that is included in the admin search.\"\n\"Generated for each entity that matches one of these conditions. Is EAV or has frontend files or has a file type field or behaves as tree\",\"Generated for each entity that matches one of these conditions. Is EAV or has frontend files or has a file type field or behaves as tree\"\n\"Generated for entities linked many to many with categories.\",\"Generated for entities linked many to many with categories.\"\n\"Generated for entities linked many to many with products.\",\"Generated for entities linked many to many with products.\"\n\"Generated for entities linked to categories and that show categories on the details page\",\"Generated for entities linked to categories and that show categories on the details page\"\n\"Generated for entities linked to products and that show products on the details page\",\"Generated for entities linked to products and that show products on the details page\"\n\"Generated for entities that allow comments\",\"Generated for entities that allow comments\"\n\"Generated for entities that are linked to categories\",\"Generated for entities that are linked to categories\"\n\"Generated for entities that have a frontend list page\",\"Generated for entities that have a frontend list page\"\n\"Generated for entities that have a frontend view page\",\"Generated for entities that have a frontend view page\"\n\"Generated for entities that should be listed on the category page.\",\"Generated for entities that should be listed on the category page.\"\n\"Generated for entities that should be listed on the product page.\",\"Generated for entities that should be listed on the product page.\"\n\"Generated for entities that support comments\",\"Generated for entities that support comments\"\n\"Generated for entities that support comments.\",\"Generated for entities that support comments.\"\n\"Generated for entities with frontend view page and widgets\",\"Generated for entities with frontend view page and widgets\"\n\"Generated for every entity\",\"Generated for every entity\"\n\"Generated for every tree behaving entities\",\"Generated for every tree behaving entities\"\n\"Generated for flat entities that behave as tree.\",\"Generated for flat entities that behave as tree.\"\n\"Generated for flat entities that don't behave as tree.\",\"Generated for flat entities that don't behave as tree.\"\n\"Generated for tree behaving entities that have a fronted list page.\",\"Generated for tree behaving entities that have a fronted list page.\"\n\"Generated for tree entities related many to many with categories.\",\"Generated for tree entities related many to many with categories.\"\n\"Generated for tree entities related many to many with products.\",\"Generated for tree entities related many to many with products.\"\n\"Generated for tree entities with frontend view page and widgets\",\"Generated for tree entities with frontend view page and widgets\"\n\"Generated if an entity has at least one image field/attribute.\",\"Generated if an entity has at least one image field/attribute.\"\n\"Generated if are entities related or at least one entity is in a \"\"many to many\"\" relation with the products or categories.\",\"Generated if are entities related or at least one entity is in a \"\"many to many\"\" relation with the products or categories.\"\n\"Generated if at least an EAV entity\",\"Generated if at least an EAV entity\"\n\"Generated if at least an entity allows comments\",\"Generated if at least an entity allows comments\"\n\"Generated if at least an entity has RSS enabled.\",\"Generated if at least an entity has RSS enabled.\"\n\"Generated if at least an entity has a country field/attribute\",\"Generated if at least an entity has a country field/attribute\"\n\"Generated if at least one entity has API enabled\",\"Generated if at least one entity has API enabled\"\n\"Generated if at least one entity has frontend enabled\",\"Generated if at least one entity has frontend enabled\"\n\"Generated if at least one entity has url rewrites enabled.\",\"Generated if at least one entity has url rewrites enabled.\"\n\"Generated if at least one entity has widgets enabled\",\"Generated if at least one entity has widgets enabled\"\n\"Generated if at least one entity is related to product or categories.\",\"Generated if at least one entity is related to product or categories.\"\n\"Generated if at least one entity is set to have the link in the category menu\",\"Generated if at least one entity is set to have the link in the category menu\"\n\"Generated if at least one entity support API\",\"Generated if at least one entity support API\"\n\"Generated if the entity is set to be a product or category attribute\",\"Generated if the entity is set to be a product or category attribute\"\n\"Generated if there is at least a flat entity.\",\"Generated if there is at least a flat entity.\"\n\"Generated if there is at least an entity that behaves as tree and has frontend list enabled\",\"Generated if there is at least an entity that behaves as tree and has frontend list enabled\"\n\"Generated if there is at least one EAV entity \",\"Generated if there is at least one EAV entity \"\n\"Generated if there is at least one EAV entity.\",\"Generated if there is at least one EAV entity.\"\n\"Generated if there is at least one entity that behaves as tree and has frontend files.\",\"Generated if there is at least one entity that behaves as tree and has frontend files.\"\n\"Generated if there is at least one entity that should have the REST API\",\"Generated if there is at least one entity that should have the REST API\"\n\"Generated if there is at least one entity with type EAV\",\"Generated if there is at least one entity with type EAV\"\n\"Generated if there is at least one parent-child relation between entities.\",\"Generated if there is at least one parent-child relation between entities.\"\n\"Generated if there is at least one tree entity that has an attribute that uses WYSIWYG editor\",\"Generated if there is at least one tree entity that has an attribute that uses WYSIWYG editor\"\n\"Generated if there the entity should have the REST API\",\"Generated if there the entity should have the REST API\"\nGlobal,Global\n\"Grid block for viewing comments.\",\"Grid block for viewing comments.\"\n\"Grid block used for managing EAV attribute\",\"Grid block used for managing EAV attribute\"\n\"Has default\",\"Has default\"\nHelp,Help\n\"Helper block for tree attributes with editors\",\"Helper block for tree attributes with editors\"\n\"Helper for WYSIWYG attributes.\",\"Helper for WYSIWYG attributes.\"\n\"Helper for each entity\",\"Helper for each entity\"\n\"Helper used for category relation actions\",\"Helper used for category relation actions\"\n\"Helper used for image processing.\",\"Helper used for image processing.\"\n\"Helper used for product relation actions\",\"Helper used for product relation actions\"\n\"If at least one entity has frontend files then a section in System->Configuration will be created. Fill in the tab name here. Leave empty to use the namespace.\",\"If at least one entity has frontend files then a section in System->Configuration will be created. Fill in the tab name here. Leave empty to use the namespace.\"\n\"If at least one entity has frontend files then a section in System->Configuration will be created. Fill in the tab position. The higher the number the lower it will appear in the list.\",\"If at least one entity has frontend files then a section in System->Configuration will be created. Fill in the tab position. The higher the number the lower it will appear in the list.\"\n\"If is set to 'No' your entity view page will be accessed in the default way http://mysite.com/module/controller/action/id/7<br /><span class=\"\"label label-warning\"\">warning</span>This field is available only if 'Create entity view page' is set to 'Yes'.\",\"If is set to 'No' your entity view page will be accessed in the default way http://mysite.com/module/controller/action/id/7<br /><span class=\"\"label label-warning\"\">warning</span>This field is available only if 'Create entity view page' is set to 'Yes'.\"\n\"If this is set to 'Yes' it will allow you to assign your entity to specific store views (just like pages or static block).\",\"If this is set to 'Yes' it will allow you to assign your entity to specific store views (just like pages or static block).\"\n\"If this is set to 'Yes' the users of your website will be able to comment on your custom entities. Comments will be moderated.<br /><span class=\"\"label label-warning\"\">warning:</span>This option is available only if \"\"Create frontend view\"\" is set to 'Yes'.\",\"If this is set to 'Yes' the users of your website will be able to comment on your custom entities. Comments will be moderated.<br /><span class=\"\"label label-warning\"\">warning:</span>This option is available only if \"\"Create frontend view\"\" is set to 'Yes'.\"\n\"If this is set to 'Yes' then the frontend files of your entity will be created.<br />If this is set to 'No', all the other fields in this section will not be available.\",\"If this is set to 'Yes' then the frontend files of your entity will be created.<br />If this is set to 'No', all the other fields in this section will not be available.\"\n\"If this is set to 'Yes' then your entity will behave as the default Magento categories. It will have the same UI as the categories module have. The fields 'parent_id', 'position' 'children_count' & 'level' will be added automatically to the entity.\",\"If this is set to 'Yes' then your entity will behave as the default Magento categories. It will have the same UI as the categories module have. The fields 'parent_id', 'position' 'children_count' & 'level' will be added automatically to the entity.\"\n\"If this is set to 'Yes', 2 new widgets will be added to the list of widgets that can be used in CMS pages and CMS blocks.<br />One widget will allow you to add a link to your entity instance and one will allow you to add a few details about your entity in CMS page or block.\",\"If this is set to 'Yes', 2 new widgets will be added to the list of widgets that can be used in CMS pages and CMS blocks.<br />One widget will allow you to add a link to your entity instance and one will allow you to add a few details about your entity in CMS page or block.\"\n\"If this is set to 'Yes', 3 extra fields/attributes will be added to your entity, 'meta_title', 'meta_keywords' and 'meta_description'. The values of these fields/attributes will be added used for the details page of your entity.\",\"If this is set to 'Yes', 3 extra fields/attributes will be added to your entity, 'meta_title', 'meta_keywords' and 'meta_description'. The values of these fields/attributes will be added used for the details page of your entity.\"\n\"If this is set to 'Yes', a RSS feed with your entities will be added to the list or Magento RSS feeds.<br />Also a new fields called 'in_rss' will be added to your entity. This will allow you to filter the entities listed in the RSS feed.<br />You can disable the RSS feature later from the configuration section of your module.\",\"If this is set to 'Yes', a RSS feed with your entities will be added to the list or Magento RSS feeds.<br />Also a new fields called 'in_rss' will be added to your entity. This will allow you to filter the entities listed in the RSS feed.<br />You can disable the RSS feature later from the configuration section of your module.\"\n\"If this is set to 'Yes', a link will be added to the footer to a page where your entity instances will be listed. The page has a toolbar for pagination, and it will list the titles of the entity instances.\",\"If this is set to 'Yes', a link will be added to the footer to a page where your entity instances will be listed. The page has a toolbar for pagination, and it will list the titles of the entity instances.\"\n\"If this is set to 'Yes', a new section with the list of your categories related to one entity will be added to the entity view page.\",\"If this is set to 'Yes', a new section with the list of your categories related to one entity will be added to the entity view page.\"\n\"If this is set to 'Yes', a new section with the list of your entities related to a specific category will be added to the category view page.\",\"If this is set to 'Yes', a new section with the list of your entities related to a specific category will be added to the category view page.\"\n\"If this is set to 'Yes', a new section with the list of your entities related to a specific product will be added to the product view page.\",\"If this is set to 'Yes', a new section with the list of your entities related to a specific product will be added to the product view page.\"\n\"If this is set to 'Yes', a new section with the list of your products related to one entity will be added to the entity view page.\",\"If this is set to 'Yes', a new section with the list of your products related to one entity will be added to the entity view page.\"\n\"If this is set to 'Yes', a new tab will be added to the category add/edit form, with a list of your entities. Something similar to the 'Products' tab.<br />Also on your entity add/edit page a similar tab listing all the categories will be added.\",\"If this is set to 'Yes', a new tab will be added to the category add/edit form, with a list of your entities. Something similar to the 'Products' tab.<br />Also on your entity add/edit page a similar tab listing all the categories will be added.\"\n\"If this is set to 'Yes', a new tab will be added to the product add/edit form, with a list of your entities. Something similar to the 'Related products' tab.<br />Also on your entity add/edit page a similar tab listing all the products will be added.\",\"If this is set to 'Yes', a new tab will be added to the product add/edit form, with a list of your entities. Something similar to the 'Related products' tab.<br />Also on your entity add/edit page a similar tab listing all the products will be added.\"\n\"If this is set to 'Yes', the files needed for the page details of your entity are created.\",\"If this is set to 'Yes', the files needed for the page details of your entity are created.\"\n\"If you choose to enter the values for the dropdown or multiselect manually, input them here. Separate the options with | (pipe). If you want an empty option at the begining start with a | (pipe) symbol.\",\"If you choose to enter the values for the dropdown or multiselect manually, input them here. Separate the options with | (pipe). If you want an empty option at the begining start with a | (pipe) symbol.\"\n\"If you choose to use teh values of an attribute as values for the dropdown field enter here the attribute code to use. If the product (or category or customer) attribute does not have values or does not support values you will not see any options.\",\"If you choose to use teh values of an attribute as values for the dropdown field enter here the attribute code to use. If the product (or category or customer) attribute does not have values or does not support values you will not see any options.\"\n\"If you set this to 'Yes', a new field will be added to your entity called 'url_key'.<br />This will allow you to use SEF url's for your entity view pages. Example: http://mysite.com/some-key-here.html\",\"If you set this to 'Yes', a new field will be added to your entity called 'url_key'.<br />This will allow you to use SEF url's for your entity view pages. Example: http://mysite.com/some-key-here.html\"\nImage,Image\n\"Image 1 for tree (gif)\",\"Image 1 for tree (gif)\"\n\"Image 1 for tree (png)\",\"Image 1 for tree (png)\"\n\"Image 2 for tree (gif)\",\"Image 2 for tree (gif)\"\n\"Image 2 for tree (png)\",\"Image 2 for tree (png)\"\n\"Image field/attribute display on frontend\",\"Image field/attribute display on frontend\"\n\"Image for collapsed tree\",\"Image for collapsed tree\"\n\"Image for expanded tree\",\"Image for expanded tree\"\n\"Image for tree\",\"Image for tree\"\n\"Image placeholder\",\"Image placeholder\"\n\"Image save backend model\",\"Image save backend model\"\n\"Images for the tree entities were not generated for Magento 1.8+\",\"Images for the tree entities were not generated for Magento 1.8+\"\n\"Improved speed of the module creator\",\"Improved speed of the module creator\"\n\"Improved te created modules grid.\",\"Improved te created modules grid.\"\nImprovement,Improvement\n\"In previous version 'ModuleName' was not working on UNIX servers. Only 'Modulename'. This is fixed in this version.\",\"In previous version 'ModuleName' was not working on UNIX servers. Only 'Modulename'. This is fixed in this version.\"\n\"In the UMC UI, when submitting a form that has errors all the fieldsets that contain fields with errors will be automatically opened to get a better wiew on the error.\",\"In the UMC UI, when submitting a form that has errors all the fieldsets that contain fields with errors will be automatically opened to get a better wiew on the error.\"\n\"Include in admin global search\",\"Include in admin global search\"\n\"Include in category menu\",\"Include in category menu\"\n\"Include in footer links\",\"Include in footer links\"\nInconsistency,Inconsistency\n\"Inconsistent registry naming\",\"Inconsistent registry naming\"\n\"Insert here\",\"Insert here\"\n\"Install new extension on the current instance.\",\"Install new extension on the current instance.\"\n\"Install script\",\"Install script\"\n\"Is always generated\",\"Is always generated\"\n\"Is child of\",\"Is child of\"\n\"Is created for entities that have widgets enabled\",\"Is created for entities that have widgets enabled\"\n\"Is generated for EAV entities\",\"Is generated for EAV entities\"\n\"Is generated for EAV entities that have url rewrites enabled\",\"Is generated for EAV entities that have url rewrites enabled\"\n\"Is generated for each many to many relation\",\"Is generated for each many to many relation\"\n\"Is generated for entities that have widgets enabled\",\"Is generated for entities that have widgets enabled\"\n\"Is generated for entities that have widgets enabled and behave as tree\",\"Is generated for entities that have widgets enabled and behave as tree\"\n\"Is generated if and entity allows comments.\",\"Is generated if and entity allows comments.\"\n\"Is generated if and entity has frontend pages.\",\"Is generated if and entity has frontend pages.\"\n\"Is generated if the entity does not behave as tree\",\"Is generated if the entity does not behave as tree\"\n\"Is generated if there is at least an image attribute for an entity.\",\"Is generated if there is at least an image attribute for an entity.\"\n\"Is generated if there is at least an image attribute.\",\"Is generated if there is at least an image attribute.\"\n\"Is generated if there is at least one entity related to categories\",\"Is generated if there is at least one entity related to categories\"\n\"Is generated if there is at least one entity related to products\",\"Is generated if there is at least one entity related to products\"\n\"Is generated if you choose to create the API\",\"Is generated if you choose to create the API\"\n\"Is generated if you choose to link an entity with categories\",\"Is generated if you choose to link an entity with categories\"\n\"Is generated if you choose to link an entity with products\",\"Is generated if you choose to link an entity with products\"\n\"Is parent for\",\"Is parent for\"\n\"Is sibling with\",\"Is sibling with\"\n\"It is generated for EAV entities\",\"It is generated for EAV entities\"\n\"It is generated for entities are linked with products and are set to appear in the product list.\",\"It is generated for entities are linked with products and are set to appear in the product list.\"\n\"It is generated for entities that are siblings with your current entity\",\"It is generated for entities that are siblings with your current entity\"\n\"It is generated for entities that can be set to stores.\",\"It is generated for entities that can be set to stores.\"\n\"It is generated for entities that have RSS enabled\",\"It is generated for entities that have RSS enabled\"\n\"It is generated for entities that have a frontend view enabled\",\"It is generated for entities that have a frontend view enabled\"\n\"It is generated for entities that have at least a file field\",\"It is generated for entities that have at least a file field\"\n\"It is generated for entities that have at least an image field\",\"It is generated for entities that have at least an image field\"\n\"It is generated for entities that have frontend list enabled\",\"It is generated for entities that have frontend list enabled\"\n\"It is generated for entities that have frontend view enabled and meta attributes enabled\",\"It is generated for entities that have frontend view enabled and meta attributes enabled\"\n\"It is generated for entities that have link to categories enabled\",\"It is generated for entities that have link to categories enabled\"\n\"It is generated for entities that have link to products enabled\",\"It is generated for entities that have link to products enabled\"\n\"It is generated for entities that have widgets enabled\",\"It is generated for entities that have widgets enabled\"\n\"It is generated for flat entities\",\"It is generated for flat entities\"\n\"Javascript file used to render a tree entity on frontend\",\"Javascript file used to render a tree entity on frontend\"\n\"Javascript for tree display\",\"Javascript for tree display\"\n\"Js file used for tree display.\",\"Js file used for tree display.\"\nLabel,Label\n\"Label plural\",\"Label plural\"\n\"Label singular\",\"Label singular\"\n\"Layout XML file used for frontend\",\"Layout XML file used for frontend\"\n\"Layout file for the admin section of the module\",\"Layout file for the admin section of the module\"\n\"Layout file not generated correctly for links with category\",\"Layout file not generated correctly for links with category\"\nLicense,License\n\"Link \"\"many to many\"\" with category\",\"Link \"\"many to many\"\" with category\"\n\"Link \"\"many to many\"\" with products\",\"Link \"\"many to many\"\" with products\"\n\"Link to related entities in grids and add/edit forms\",\"Link to related entities in grids and add/edit forms\"\n\"Links to entities related to categories had a wrong format in the category view page.\",\"Links to entities related to categories had a wrong format in the category view page.\"\n\"List page template\",\"List page template\"\n\"List page url rewrite\",\"List page url rewrite\"\n\"MOdel used for EAV attributes\",\"MOdel used for EAV attributes\"\n\"Made extension \"\"extensible\"\"\",\"Made extension \"\"extensible\"\"\"\n\"Magento offers a REST API for managing products, categories and other entities.<br />If this is set to 'Yes', then your entity will also be available for managing through the REST API.<br />It generates the classes and xml files needed.\",\"Magento offers a REST API for managing products, categories and other entities.<br />If this is set to 'Yes', then your entity will also be available for managing through the REST API.<br />It generates the classes and xml files needed.\"\n\"Magento offers a SOAP API for managing products, categories, orders and other entities.<br />If this is set to 'Yes', then your entity will also be available for managing through the SOAP API.<br />It generates the classes and xml files needed for API V1, API V2 and API V2 with WSI compliance.\",\"Magento offers a SOAP API for managing products, categories, orders and other entities.<br />If this is set to 'Yes', then your entity will also be available for managing through the SOAP API.<br />It generates the classes and xml files needed for API V1, API V2 and API V2 with WSI compliance.\"\n\"Main block for editing comments.\",\"Main block for editing comments.\"\n\"Main block for viewing comments.\",\"Main block for viewing comments.\"\n\"Main tab block used for managing EAV attribute\",\"Main tab block used for managing EAV attribute\"\n\"Main tab for editing comments.\",\"Main tab for editing comments.\"\n\"Make entity a category attribute\",\"Make entity a category attribute\"\n\"Make entity a product attribute\",\"Make entity a product attribute\"\n\"Manage attributes block.\",\"Manage attributes block.\"\n\"Manage attributes edit block.\",\"Manage attributes edit block.\"\n\"Manage attributes form block.\",\"Manage attributes form block.\"\n\"Manage attributes form main tab block.\",\"Manage attributes form main tab block.\"\n\"Manage attributes form options tab block.\",\"Manage attributes form options tab block.\"\n\"Manage attributes form tabs block.\",\"Manage attributes form tabs block.\"\n\"Manage modules\",\"Manage modules\"\n\"Manually defined\",\"Manually defined\"\n\"Many to many relation with categories - missing controller\",\"Many to many relation with categories - missing controller\"\n\"Many to many relation with categories don't always work.\",\"Many to many relation with categories don't always work.\"\n\"Many to many relations between tree entities\",\"Many to many relations between tree entities\"\n\"Missing translation for some system.xml labels\",\"Missing translation for some system.xml labels\"\n\"Model for many to many relations between entities\",\"Model for many to many relations between entities\"\n\"Model for relations between entities and categories\",\"Model for relations between entities and categories\"\n\"Model for relations between entities and products\",\"Model for relations between entities and products\"\n\"Model to handle entity comments\",\"Model to handle entity comments\"\n\"Model used as a a source containing all entities\",\"Model used as a a source containing all entities\"\n\"Model used by admin global search\",\"Model used by admin global search\"\n\"Model used for eav attributes.\",\"Model used for eav attributes.\"\n\"Model used for saving entity files\",\"Model used for saving entity files\"\n\"Model used for saving entity images\",\"Model used for saving entity images\"\n\"Model used for saving entity url key\",\"Model used for saving entity url key\"\n\"Model used to handle the SOAP API V2 calls for entity attributes\",\"Model used to handle the SOAP API V2 calls for entity attributes\"\n\"Model used to handle the SOAP API calls for entity attributes\",\"Model used to handle the SOAP API calls for entity attributes\"\n\"Model used to handle the SOAP API calls for entity comments\",\"Model used to handle the SOAP API calls for entity comments\"\nModule,Module\n\"Module RSS block.\",\"Module RSS block.\"\n\"Module adminhtml.xml file\",\"Module adminhtml.xml file\"\n\"Module base admin controller.\",\"Module base admin controller.\"\n\"Module configuration file\",\"Module configuration file\"\n\"Module creator\",\"Module creator\"\n\"Module creator generate sql uninstall script\",\"Module creator generate sql uninstall script\"\n\"Module data install script.\",\"Module data install script.\"\n\"Module declaration xml\",\"Module declaration xml\"\n\"Module default helper.\",\"Module default helper.\"\n\"Module information\",\"Module information\"\n\"Module menu and ACL settings.\",\"Module menu and ACL settings.\"\n\"Module menu can be placed anywhere\",\"Module menu can be placed anywhere\"\n\"Module name\",\"Module name\"\n\"Module setup resource model\",\"Module setup resource model\"\nMultiselect,Multiselect\n\"Multiselect attribute values were not displayed correctly on frontend\",\"Multiselect attribute values were not displayed correctly on frontend\"\n\"Name settings\",\"Name settings\"\nNamespace,Namespace\n\"Naming restrictions\",\"Naming restrictions\"\nNo,No\n\"No attribute types configured\",\"No attribute types configured\"\n\"No dropdown subtypes configured\",\"No dropdown subtypes configured\"\n\"No entity types configured\",\"No entity types configured\"\n\"No more AJAX calls to add an entity/attribute. The module save is done in the same step as validation.\",\"No more AJAX calls to add an entity/attribute. The module save is done in the same step as validation.\"\n\"No more hard coded 0.0.1 version.\",\"No more hard coded 0.0.1 version.\"\n\"No relation types configured\",\"No relation types configured\"\nNote,Note\n\"Now all attribute types displayed properly in the rss feed.\",\"Now all attribute types displayed properly in the rss feed.\"\n\"Now the tree entities can be related in \"\"Many to many\"\"\",\"Now the tree entities can be related in \"\"Many to many\"\"\"\n\"Now you can create EAV entities that you can manage just like products and categories.\",\"Now you can create EAV entities that you can manage just like products and categories.\"\n\"Now you can link you entities \"\"many to many\"\" with the catalog categories\",\"Now you can link you entities \"\"many to many\"\" with the catalog categories\"\n\"OK. I got it!\",\"OK. I got it!\"\n\"Observer for frontend\",\"Observer for frontend\"\n\"On the category edit page, in the tabs with flat related entities, all the entities were shown instead of only the selected ones.\",\"On the category edit page, in the tabs with flat related entities, all the entities were shown instead of only the selected ones.\"\n\"One option on each row\",\"One option on each row\"\n\"Options in select\",\"Options in select\"\n\"Options source\",\"Options source\"\n\"Options tab block used for managing EAV attribute\",\"Options tab block used for managing EAV attribute\"\n\"Parent / child entities have a method of retrieving the associated entities (children / parent)\",\"Parent / child entities have a method of retrieving the associated entities (children / parent)\"\nPath,Path\n\"Product attribute\",\"Product attribute\"\n\"Product attribute code\",\"Product attribute code\"\n\"Product attribute group\",\"Product attribute group\"\n\"Product attribute scope\",\"Product attribute scope\"\n\"Product helper\",\"Product helper\"\n\"Product list on entity page template\",\"Product list on entity page template\"\n\"Product relation collection resource model\",\"Product relation collection resource model\"\n\"Product relation resource model\",\"Product relation resource model\"\n\"Product/category attribute code made required\",\"Product/category attribute code made required\"\nProducts,Products\n\"REST API entity model\",\"REST API entity model\"\n\"REST API entity model - admin handler\",\"REST API entity model - admin handler\"\n\"REST API entity model - customer handler\",\"REST API entity model - customer handler\"\n\"REST API entity model - guest handler\",\"REST API entity model - guest handler\"\n\"REST API entity model - rest handler\",\"REST API entity model - rest handler\"\nRefactor,Refactor\nRefactored,Refactored\n\"Refactored JS\",\"Refactored JS\"\n\"Refactored some attribute codes\",\"Refactored some attribute codes\"\n\"Refactored widget view contents\",\"Refactored widget view contents\"\nRelation,Relation\n\"Relation types\",\"Relation types\"\n\"Relations not saved when 3 or more entities exist\",\"Relations not saved when 3 or more entities exist\"\n\"Release notes\",\"Release notes\"\n\"Remove entity\",\"Remove entity\"\n\"Remove field / attribute\",\"Remove field / attribute\"\n\"Removed calls to deprecated method htmlEscape\",\"Removed calls to deprecated method htmlEscape\"\n\"Removed frontend package and theme fields\",\"Removed frontend package and theme fields\"\n\"Removed some unused variables, added some type hints. I hope I didn't break anything.\",\"Removed some unused variables, added some type hints. I hope I didn't break anything.\"\n\"Renderer used for EAV attribute form\",\"Renderer used for EAV attribute form\"\n\"Replaced 'addFilter' with 'addFieldToFilter'\",\"Replaced 'addFilter' with 'addFieldToFilter'\"\nRequired,Required\nReset,Reset\n\"Resource model for entities that are related many to many\",\"Resource model for entities that are related many to many\"\n\"Resource model for entity category relation\",\"Resource model for entity category relation\"\n\"Resource model for entity product relation\",\"Resource model for entity product relation\"\n\"Resource model to handle entity comments\",\"Resource model to handle entity comments\"\n\"Resource model used for eav attributes.\",\"Resource model used for eav attributes.\"\n\"Resource used to link comments to entities\",\"Resource used to link comments to entities\"\n\"Resrouce model used for the module setup\",\"Resrouce model used for the module setup\"\nResticted,Resticted\nRouter,Router\n\"Router for matching url rewrites\",\"Router for matching url rewrites\"\nSave,Save\n\"Save and Continue Edit\",\"Save and Continue Edit\"\n\"Select a codepool\",\"Select a codepool\"\n\"Select action\",\"Select action\"\n\"Select menu for entity link\",\"Select menu for entity link\"\n\"Select the menu where you want to add the link to your entities. It may not work on very custom themes.\",\"Select the menu where you want to add the link to your entities. It may not work on very custom themes.\"\n\"Select the product attribute scope.\",\"Select the product attribute scope.\"\n\"Selecting to include entities in admin search had no effect.\",\"Selecting to include entities in admin search had no effect.\"\n\"Set default values for EAV entities\",\"Set default values for EAV entities\"\n\"Set default values when creating a module\",\"Set default values when creating a module\"\n\"Set the system configuration tab name and position.\",\"Set the system configuration tab name and position.\"\n\"Settings regarding the entity name and code\",\"Settings regarding the entity name and code\"\n\"Setup script with table structure\",\"Setup script with table structure\"\n\"Show associated categories on entity page\",\"Show associated categories on entity page\"\n\"Show associated entities on category page\",\"Show associated entities on category page\"\n\"Show associated entities on product page\",\"Show associated entities on product page\"\n\"Show associated product on entity page\",\"Show associated product on entity page\"\n\"Show in admin grid\",\"Show in admin grid\"\n\"Show in frontend\",\"Show in frontend\"\n\"Show in rss\",\"Show in rss\"\n\"Show in widget\",\"Show in widget\"\n\"Sibling relation collection resource model\",\"Sibling relation collection resource model\"\n\"Sibling relation resource model\",\"Sibling relation resource model\"\n\"Singed Int\",\"Singed Int\"\n\"Some texts from the locale files still displayed placeholders after generation.\",\"Some texts from the locale files still displayed placeholders after generation.\"\n\"Source file refactoring\",\"Source file refactoring\"\n\"Stick to CGL\",\"Stick to CGL\"\n\"Store View\",\"Store View\"\n\"Stores tab for editing comments.\",\"Stores tab for editing comments.\"\n\"Suport for modman file\",\"Suport for modman file\"\n\"Support for canonical URL in generated module\",\"Support for canonical URL in generated module\"\n\"Support for signed int attributes/fields\",\"Support for signed int attributes/fields\"\n\"Support for url rewrites for entity list pages\",\"Support for url rewrites for entity list pages\"\n\"Supported field / attribute types\",\"Supported field / attribute types\"\n\"System -> Configuration tab name\",\"System -> Configuration tab name\"\n\"System -> Configuration tab position\",\"System -> Configuration tab position\"\n\"System xml\",\"System xml\"\n\"Tabs block used for managing EAV attribute\",\"Tabs block used for managing EAV attribute\"\n\"Tabs for editing comments.\",\"Tabs for editing comments.\"\n\"Template for listing entities on category view page\",\"Template for listing entities on category view page\"\n\"Template for listing entities on product view page\",\"Template for listing entities on product view page\"\n\"Template for rendering customer comments\",\"Template for rendering customer comments\"\n\"Template used for adding comments\",\"Template used for adding comments\"\n\"Template used for displaying comments\",\"Template used for displaying comments\"\n\"Template used for entity widget link\",\"Template used for entity widget link\"\n\"Template used for entity widget subtree\",\"Template used for entity widget subtree\"\n\"Template used for entity widget view\",\"Template used for entity widget view\"\n\"Template used for listing categories on entity page\",\"Template used for listing categories on entity page\"\n\"Template used for listing entity siblings\",\"Template used for listing entity siblings\"\n\"Template used for listing products on entity page\",\"Template used for listing products on entity page\"\n\"Template used for viewing own comment\",\"Template used for viewing own comment\"\n\"Template used in the backend for editing the tree for tree behaving entities\",\"Template used in the backend for editing the tree for tree behaving entities\"\n\"Template used in the backend for editing the tree form for tree behaving entities\",\"Template used in the backend for editing the tree form for tree behaving entities\"\n\"Template used in the backend for the tree for tree behaving entities\",\"Template used in the backend for the tree for tree behaving entities\"\n\"Template used to display child related entities\",\"Template used to display child related entities\"\n\"Template used to display the entity children on frontend for tree behaving entities\",\"Template used to display the entity children on frontend for tree behaving entities\"\n\"Template used to list the entities on frontend\",\"Template used to list the entities on frontend\"\n\"Template used to view an entity on frontend\",\"Template used to view an entity on frontend\"\n\"Temporarily disable API\",\"Temporarily disable API\"\nText,Text\nTextarea,Textarea\n\"Thank you for your help\",\"Thank you for your help\"\nThanks,Thanks\n\"The API does not yet work for EAV entities and comments. It is temporarily disabled until I get it working.\",\"The API does not yet work for EAV entities and comments. It is temporarily disabled until I get it working.\"\n\"The Magento admin Global search (at the top of every admin page) searches for the text you enter in products, customers and orders.<br />If you set this to 'Yes' than it will search in your entity also.\",\"The Magento admin Global search (at the top of every admin page) searches for the text you enter in products, customers and orders.<br />If you set this to 'Yes' than it will search in your entity also.\"\n\"The UI of the module creator now uses prototype classes instead of simple JS functions.\",\"The UI of the module creator now uses prototype classes instead of simple JS functions.\"\n\"The UMC UI has pulsating and sliding effects on different operations.\",\"The UMC UI has pulsating and sliding effects on different operations.\"\n\"The admin grids for each entity comments include the entity name.\",\"The admin grids for each entity comments include the entity name.\"\n\"The admin handler model for the entity REST API\",\"The admin handler model for the entity REST API\"\n\"The collection resource model for an entity\",\"The collection resource model for an entity\"\n\"The configuration for the REST API\",\"The configuration for the REST API\"\n\"The configuration panel for tree entities was incomplete\",\"The configuration panel for tree entities was incomplete\"\n\"The customer handler model for the entity REST API\",\"The customer handler model for the entity REST API\"\n\"The date fields were saved as 1970-01-01 for some locale settings (French for example)\",\"The date fields were saved as 1970-01-01 for some locale settings (French for example)\"\n\"The display mode of tree entities was not manageable from the system configuration section.\",\"The display mode of tree entities was not manageable from the system configuration section.\"\n\"The entities are in a many to many relation. A new table will be created to support this relation containing the ids of each entity.\",\"The entities are in a many to many relation. A new table will be created to support this relation containing the ids of each entity.\"\n\"The entities are not related in any way.\",\"The entities are not related in any way.\"\n\"The entities created with UMC will have a field called 'created_at' with the creation date of any entity instance.<br />If this is set to 'Yes' the 'Created at' field will be added to the admin grid.\",\"The entities created with UMC will have a field called 'created_at' with the creation date of any entity instance.<br />If this is set to 'Yes' the 'Created at' field will be added to the admin grid.\"\n\"The entities created with UMC will have a field called 'updated_at' with the last update date of any entity instance.<br />If this is set to 'Yes' the 'Updated at' field will be added to the admin grid.\",\"The entities created with UMC will have a field called 'updated_at' with the last update date of any entity instance.<br />If this is set to 'Yes' the 'Updated at' field will be added to the admin grid.\"\n\"The entities relations were not displayed correctly when the module contained 3 or more entities. <a href=\"\"https://github.com/tzyganu/UMC1.9/issues/5\"\" target=\"\"_blank\"\">(#5)</a>\",\"The entities relations were not displayed correctly when the module contained 3 or more entities. <a href=\"\"https://github.com/tzyganu/UMC1.9/issues/5\"\" target=\"\"_blank\"\">(#5)</a>\"\n\"The entity model. Simple as that.\",\"The entity model. Simple as that.\"\n\"The entity view page displayed as blank if looking at an entity that does not exist. Now redirects to 404 page.\",\"The entity view page displayed as blank if looking at an entity that does not exist. Now redirects to 404 page.\"\n\"The first entity acts as a child for the second one <br />. A field will be added to the first entity table as a reference to the first entity.\",\"The first entity acts as a child for the second one <br />. A field will be added to the first entity table as a reference to the first entity.\"\n\"The first entity acts as a parent for the second one <br />. A field will be added to the second entity table as a reference to the first entity.\",\"The first entity acts as a parent for the second one <br />. A field will be added to the second entity table as a reference to the first entity.\"\n\"The generated extensions can contain files used for the SOAP API.\",\"The generated extensions can contain files used for the SOAP API.\"\n\"The generated files could not pe written to disk because of the changes in Varien_Io_File in this version.\",\"The generated files could not pe written to disk because of the changes in Varien_Io_File in this version.\"\n\"The guest handler model for the entity REST API\",\"The guest handler model for the entity REST API\"\n\"The image attributes/fields were displayed wrong on frontend for EAV entities.\",\"The image attributes/fields were displayed wrong on frontend for EAV entities.\"\n\"The left side tree on the admin add/edit form for EAV tree entities does not refresh when a new entity instance is added.\",\"The left side tree on the admin add/edit form for EAV tree entities does not refresh when a new entity instance is added.\"\n\"The main handler model for the entity REST API\",\"The main handler model for the entity REST API\"\n\"The main model for the entity REST API\",\"The main model for the entity REST API\"\n\"The module configuration file\",\"The module configuration file\"\n\"The module declaration file.\",\"The module declaration file.\"\n\"The name of the attribute group where the attribute will be added. If you leave it empty the attribute will not be added to the attribute sets. If the group does not exist it will be created.\",\"The name of the attribute group where the attribute will be added. If you leave it empty the attribute will not be added to the attribute sets. If the group does not exist it will be created.\"\n\"The name of the attribute group where the attribute will be added. If you leave it empty the attribute will not be added to the category attribute set. If the group does not exist it will be created.\",\"The name of the attribute group where the attribute will be added. If you leave it empty the attribute will not be added to the category attribute set. If the group does not exist it will be created.\"\n\"The placeholder image for entities with image attributes.\",\"The placeholder image for entities with image attributes.\"\n\"The related entities tab did not show only selected entities on category edit mode.\",\"The related entities tab did not show only selected entities on category edit mode.\"\n\"The relation tables between entities and products or categories or other entities now have a unique index on the entity id and the related entity id.\",\"The relation tables between entities and products or categories or other entities now have a unique index on the entity id and the related entity id.\"\n\"The resource model for an entity\",\"The resource model for an entity\"\n\"The route of the module can be configured. (<a href=\"\"https://github.com/tzyganu/UMC1.9/issues/4\"\" target=\"\"_blank\"\">#4</a>)\",\"The route of the module can be configured. (<a href=\"\"https://github.com/tzyganu/UMC1.9/issues/4\"\" target=\"\"_blank\"\">#4</a>)\"\n\"The sibling relations are not recreated completely anymore. They are merged.\",\"The sibling relations are not recreated completely anymore. They are merged.\"\n\"The template for listing RSS links.\",\"The template for listing RSS links.\"\n\"The text you put here will be added at the top of (almost) each file in the module you create.<br />Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} as placeholder for current year.<br />If you don't want any License text on your files just leave this field empty.\",\"The text you put here will be added at the top of (almost) each file in the module you create.<br />Use {{Namespace}} as a placeholder for namespace, {{Module}} as a placeholder for the module name and {{Y}} as placeholder for current year.<br />If you don't want any License text on your files just leave this field empty.\"\n\"The uninstall script tried to remove the module_eav_attribute table once for each EAV entity.\",\"The uninstall script tried to remove the module_eav_attribute table once for each EAV entity.\"\n\"The values for manually added attributes for EAV entities were not saved due to the attributes not belonging to a group.\",\"The values for manually added attributes for EAV entities were not saved due to the attributes not belonging to a group.\"\n\"There are 2 types of entities in Magento <a href=\"\"http://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model\"\" target=\"\"_blank\"\">EAV</a> and Flat (all fields in one table). Choose yours\",\"There are 2 types of entities in Magento <a href=\"\"http://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model\"\" target=\"\"_blank\"\">EAV</a> and Flat (all fields in one table). Choose yours\"\n\"There is a new section in the customer account menu that links to \"\"my comments\"\" for each entity.\",\"There is a new section in the customer account menu that links to \"\"my comments\"\" for each entity.\"\n\"This allows you to directly install the module you create on the current Magento instance, or create a zip with it and install it later.\",\"This allows you to directly install the module you create on the current Magento instance, or create a zip with it and install it later.\"\n\"This allows you to display the attribute as a column in the admin grid of the entity. The attribute set to behave as \"\"Name\"\" will be included by default in the grid.\",\"This allows you to display the attribute as a column in the admin grid of the entity. The attribute set to behave as \"\"Name\"\" will be included by default in the grid.\"\n\"This allows you to show the attribute in rss feed. Is available for all attribute types.\",\"This allows you to show the attribute in rss feed. Is available for all attribute types.\"\n\"This allows you to show the attribute in the entity view page. Is available for all attribute types.\",\"This allows you to show the attribute in the entity view page. Is available for all attribute types.\"\n\"This allows you to show the attribute in view widget. Is available for all attribute types.\",\"This allows you to show the attribute in view widget. Is available for all attribute types.\"\n\"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.\"\n\"This block handles the entity link widget.\",\"This block handles the entity link widget.\"\n\"This block handles the entity view widget.\",\"This block handles the entity view widget.\"\n\"This block handles the rss generation for an entity.\",\"This block handles the rss generation for an entity.\"\n\"This block handles the subtree view widget.\",\"This block handles the subtree view widget.\"\n\"This block is used to show the entities related to the category on the category list.\",\"This block is used to show the entities related to the category on the category list.\"\n\"This block is used to show the entities related to the product on the product list.\",\"This block is used to show the entities related to the product on the product list.\"\n\"This block lists the siblings of an entity\",\"This block lists the siblings of an entity\"\n\"This block lists your entities.\",\"This block lists your entities.\"\n\"This controller handles the admin entity requests for EAV tree entities.\",\"This controller handles the admin entity requests for EAV tree entities.\"\n\"This controller handles the admin entity requests.\",\"This controller handles the admin entity requests.\"\n\"This controller handles the admin requestion for entity comments.\",\"This controller handles the admin requestion for entity comments.\"\n\"This controller handles the admin widget requests.\",\"This controller handles the admin widget requests.\"\n\"This controller handles the frontend request for an entity\",\"This controller handles the frontend request for an entity\"\n\"This happens for the default Magento theme and for themes with similar format for the product view page. For custom themes there the block might not appear.<br /><span class=\"\"label label-info\"\">Info:</span> This field is available only if 'Link \"\"many to many\"\" with products' is set to 'Yes'.\",\"This happens for the default Magento theme and for themes with similar format for the product view page. For custom themes there the block might not appear.<br /><span class=\"\"label label-info\"\">Info:</span> This field is available only if 'Link \"\"many to many\"\" with products' is set to 'Yes'.\"\n\"This helps you choose your widget entity.\",\"This helps you choose your widget entity.\"\n\"This holds the data added to the database tables on install.\",\"This holds the data added to the database tables on install.\"\n\"This is a block used as parent for different tree behaving entities blocks\",\"This is a block used as parent for different tree behaving entities blocks\"\n\"This is always generated\",\"This is always generated\"\n\"This is always generated.\",\"This is always generated.\"\n\"This is generated for all entities\",\"This is generated for all entities\"\n\"This is generated for each entity.\",\"This is generated for each entity.\"\n\"This is generated for entities that have siblings\",\"This is generated for entities that have siblings\"\n\"This is generated if there are any tree behaving entities.\",\"This is generated if there are any tree behaving entities.\"\n\"This is genereted for entities that behave as tree.\",\"This is genereted for entities that behave as tree.\"\n\"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 />There are some naming restriction. For example the code cannot be: \"\"data\"\", \"\"child\",\"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 />There are some naming restriction. For example the code cannot be: \"\"data\"\", \"\"child\"\n\"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.\"\n\"This is the attribute scope. It is available only for EAV entities. It works similar to the product attribute scope.\",\"This is the attribute scope. It is available only for EAV entities. It works similar to the product attribute scope.\"\n\"This is the attribute type. This wil determine the table column type for this field/attribute and its behavior.\",\"This is the attribute type. This wil determine the table column type for this field/attribute and its behavior.\"\n\"This is the base helper used for resizing images.\",\"This is the base helper used for resizing images.\"\n\"This is the block for the entity tab on the category add/edit form\",\"This is the block for the entity tab on the category add/edit form\"\n\"This is the block for the entity tab on the product add/edit form\",\"This is the block for the entity tab on the product add/edit form\"\n\"This is the block with all the entity fields.\",\"This is the block with all the entity fields.\"\n\"This is the block with the entity attributes.\",\"This is the block with the entity attributes.\"\n\"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\"\"\"\n\"This is the default helper of the module.\",\"This is the default helper of the module.\"\n\"This is the entity admin edit block: form container\",\"This is the entity admin edit block: form container\"\n\"This is the entity admin edit form block\",\"This is the entity admin edit form block\"\n\"This is the entity admin grid. file\",\"This is the entity admin grid. file\"\n\"This is the entity view page main block.\",\"This is the entity view page main block.\"\n\"This is the folder name of your new extension. Your company name should go here. Use only letters and numbers. Start with a capital letter.\",\"This is the folder name of your new extension. Your company name should go here. Use only letters and numbers. Start with a capital letter.\"\n\"This is the main admin block for the entities. The grid container\",\"This is the main admin block for the entities. The grid container\"\n\"This is the main block for listing comments posted by a customer\",\"This is the main block for listing comments posted by a customer\"\n\"This is the parent menu id of the module menu. Leave empty to add in top menu.\",\"This is the parent menu id of the module menu. Leave empty to add in top menu.\"\n\"This is the plural form of the label above. It will be used for lists. (For example: 'Posts')\",\"This is the plural form of the label above. It will be used for lists. (For example: 'Posts')\"\n\"This is the plural value of the entity code. For example 'posts'.\",\"This is the plural value of the entity code. For example 'posts'.\"\n\"This is the prefix of your url. Example 'news', 'articles'. Leave empty for no prefix.\",\"This is the prefix of your url. Example 'news', 'articles'. Leave empty for no prefix.\"\n\"This is the rendered for file fields.\",\"This is the rendered for file fields.\"\n\"This is the rendered for image fields.\",\"This is the rendered for image fields.\"\n\"This is the route name of your module. It's the first part of the URL. ('module/controller/action'). This is what goes instead of 'module'. Useful only if you have frontend listing or viewing for at least one entity. Leave empty to use default value 'namespace_module'.\",\"This is the route name of your module. It's the first part of the URL. ('module/controller/action'). This is what goes instead of 'module'. Useful only if you have frontend listing or viewing for at least one entity. Leave empty to use default value 'namespace_module'.\"\n\"This is the sort order in the menu.\",\"This is the sort order in the menu.\"\n\"This is the suffix of your url. Example 'html', 'htm'. Don't add the dot. Leave empty for no suffix.\",\"This is the suffix of your url. Example 'html', 'htm'. Don't add the dot. Leave empty for no suffix.\"\n\"This is the title that will be added to the menu.\",\"This is the title that will be added to the menu.\"\n\"This is the version of the module.\",\"This is the version of the module.\"\n\"This is your extension/module name. It should be something meaningful and not very long.<br />Try to use a noun in singular form. Start with a capital letter.\",\"This is your extension/module name. It should be something meaningful and not very long.<br />Try to use a noun in singular form. Start with a capital letter.\"\n\"This section should make it easier for you to use the module creator extension.\",\"This section should make it easier for you to use the module creator extension.\"\n\"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.\"\n\"This setting will add a new attribute/field that will allow you to enable/disable the comment form for each entity instance.<br /><span class=\"\"label label-warning\"\">warning:</span>This option is available only if \"\"Allow comments\"\" is set to 'Yes'.\",\"This setting will add a new attribute/field that will allow you to enable/disable the comment form for each entity instance.<br /><span class=\"\"label label-warning\"\">warning:</span>This option is available only if \"\"Allow comments\"\" is set to 'Yes'.\"\n\"This tab allows you to fill in the general data about your module\",\"This tab allows you to fill in the general data about your module\"\n\"This template renders the customer submitted comments\",\"This template renders the customer submitted comments\"\n\"This will add a new dropdown attribute to the category where the options will be your entity instances.\",\"This will add a new dropdown attribute to the category where the options will be your entity instances.\"\n\"This will add a new dropdown attribute to the product where the options will be your entity instances.\",\"This will add a new dropdown attribute to the product where the options will be your entity instances.\"\n\"This will be added as a comment under the field in the admin add/edit form.\",\"This will be added as a comment under the field in the admin add/edit form.\"\nTo,To\n\"Translation file\",\"Translation file\"\n\"Tree admin template\",\"Tree admin template\"\n\"Tree block.\",\"Tree block.\"\n\"Tree collapsed image (gif)\",\"Tree collapsed image (gif)\"\n\"Tree collapsed image (png)\",\"Tree collapsed image (png)\"\n\"Tree edit admin template\",\"Tree edit admin template\"\n\"Tree edit form admin template\",\"Tree edit form admin template\"\n\"Tree entities rendered wrong when the view page was disabled.\",\"Tree entities rendered wrong when the view page was disabled.\"\n\"Tree entity list images not generated\",\"Tree entity list images not generated\"\n\"Tree expanded image (gif)\",\"Tree expanded image (gif)\"\n\"Tree expanded image (png)\",\"Tree expanded image (png)\"\n\"Tree js file\",\"Tree js file\"\n\"Tree resource model for tree behaving entities.\",\"Tree resource model for tree behaving entities.\"\n\"Tree resource model.\",\"Tree resource model.\"\n\"Tree sibling admin template\",\"Tree sibling admin template\"\n\"Tree widget chooser was giving fatal error.\",\"Tree widget chooser was giving fatal error.\"\nType,Type\n\"UI refactor\",\"UI refactor\"\n\"UMC generates the code in a 'human readable' form. It's easier to figure out what the code is about when the variables and methods have a propper name.<br />For example it's easier to read foreach ($_posts as $_post){...} or $_post->getTags() than foreach ($_list as $_item){...} or $_entity->getRelated('tags');<br />The value you fill in here will be used for variable names, file names and table names.\",\"UMC generates the code in a 'human readable' form. It's easier to figure out what the code is about when the variables and methods have a propper name.<br />For example it's easier to read foreach ($_posts as $_post){...} or $_post->getTags() than foreach ($_list as $_item){...} or $_entity->getRelated('tags');<br />The value you fill in here will be used for variable names, file names and table names.\"\n\"URL prefix\",\"URL prefix\"\n\"URL rewrites for flat entities can be left blank and they will be auto-generated\",\"URL rewrites for flat entities can be left blank and they will be auto-generated\"\n\"URL suffix\",\"URL suffix\"\n\"Ultimate Module Creator\",\"Ultimate Module Creator\"\n\"Ultimate module creator\",\"Ultimate module creator\"\n\"Unsinged Int\",\"Unsinged Int\"\n\"Until now the menu could be placed in admin only on top level. Now it can be placed anywhere in the menu tree.\",\"Until now the menu could be placed in admin only on top level. Now it can be placed anywhere in the menu tree.\"\n\"Url key save backend model\",\"Url key save backend model\"\n\"Use WYSIWYG editor\",\"Use WYSIWYG editor\"\n\"Used for product and category relations\",\"Used for product and category relations\"\nUseless,Useless\n\"Values for manually added attributes for EAV attributes are not saved\",\"Values for manually added attributes for EAV attributes are not saved\"\n\"Variables that depend on attribute names now look like this: $someName instead of $some_name\",\"Variables that depend on attribute names now look like this: $someName instead of $some_name\"\nVersion,Version\n\"View page template\",\"View page template\"\n\"WISIWYG helper block.\",\"WISIWYG helper block.\"\n\"WSDL file\",\"WSDL file\"\n\"WSI file\",\"WSI file\"\nWebsite,Website\n\"When creating an entity you can drag and drop attributes to sort them in the list\",\"When creating an entity you can drag and drop attributes to sort them in the list\"\n\"When selecting to make an entity a product/category attribute, the attribute code was not required and resulted in errors.\",\"When selecting to make an entity a product/category attribute, the attribute code was not required and resulted in errors.\"\n\"When setting specific permissions for an admin the comments & EAV attributes grid got \"\"Access denied\"\".\",\"When setting specific permissions for an admin the comments & EAV attributes grid got \"\"Access denied\"\".\"\n\"Widget xml\",\"Widget xml\"\nWidgets,Widgets\n\"Writing generated files does not work on CE-1.8.0.0\",\"Writing generated files does not work on CE-1.8.0.0\"\n\"Wrong EAV mass action flag change\",\"Wrong EAV mass action flag change\"\n\"Wrong export for EAV entities.\",\"Wrong export for EAV entities.\"\n\"Wrong resource model parent\",\"Wrong resource model parent\"\n\"Yeah...like someone is going to extend it\",\"Yeah...like someone is going to extend it\"\nYes,Yes\n\"Yes / No\",\"Yes / No\"\n\"Yes-no-default source model\",\"Yes-no-default source model\"\n\"You can choose to allow customers to write comments on your entities.\",\"You can choose to allow customers to write comments on your entities.\"\n\"You can not generate the files needed for the REST API of you entities.\",\"You can not generate the files needed for the REST API of you entities.\"\n\"You can now set a SEF url for the entity list page on frontend instead of 'module/controller/action'. The value can be changed later.\",\"You can now set a SEF url for the entity list page on frontend instead of 'module/controller/action'. The value can be changed later.\"\n\"You can set the configuration tab name and position when creating a module.\",\"You can set the configuration tab name and position when creating a module.\"\n\"You can set the version of your generated module.\",\"You can set the version of your generated module.\"\n\"You shouldn't use the namespace Mage. Be Creative\",\"You shouldn't use the namespace Mage. Be Creative\"\n\"Your extension has been created!\",\"Your extension has been created!\"\n\"api2.xml - REST config file\",\"api2.xml - REST config file\"\n\"base/default is used for all modules.\",\"base/default is used for all modules.\"\n\"dorpdown, multiselect. Can have different sources - still experimental.\",\"dorpdown, multiselect. Can have different sources - still experimental.\"\n\"s generated for any entity that is related many to many with categories\",\"s generated for any entity that is related many to many with categories\"\n\"s generated for any entity that is related many to many with products\",\"s generated for any entity that is related many to many with products\"\n\"system.xml file of the module\",\"system.xml file of the module\"\n\"widget.xml file of the module\",\"widget.xml file of the module\"\n"
  },
  {
    "path": "composer.json",
    "content": "{\r\n  \"name\": \"ultimate/modulecreator\",\r\n  \"description\": \"New Ultimate Module Creator for Magento 1.7 +\",\r\n  \"type\": \"magento-module\",\r\n  \"license\": \"MIT\",\r\n  \"minimum-stability\": \"dev\",\r\n  \"authors\": [\r\n    {\r\n      \"name\": \"Marius Strajeru\",\r\n      \"email\": \"ultimate.module.creator@gmail.com\"\r\n    }\r\n  ],\r\n  \"repositories\": [\r\n    {\r\n      \"type\": \"composer\",\r\n      \"url\": \"http://packages.firegento.com\"\r\n    }\r\n  ],\r\n  \"require\": {\r\n    \"magento-hackathon/magento-composer-installer\": \"*\"\r\n  },\r\n  \"extra\": {\r\n    \"map\": [\r\n      [\r\n        \"app/etc/modules/Ultimate_ModuleCreator.xml\",\r\n        \"app/etc/modules/Ultimate_ModuleCreator.xml\"\r\n      ],\r\n      [\r\n        \"app/code/community/Ultimate/ModuleCreator\",\r\n        \"app/code/community/Ultimate/ModuleCreator\"\r\n      ],\r\n      [\r\n        \"app/locale/en_US/Ultimate_ModuleCreator.csv\",\r\n        \"app/locale/en_US/Ultimate_ModuleCreator.csv\"\r\n      ],\r\n      [\r\n        \"app/design/adminhtml/default/default/layout/ultimate_modulecreator.xml\",\r\n        \"app/design/adminhtml/default/default/layout/ultimate_modulecreator.xml\"\r\n      ],\r\n      [\r\n        \"app/design/adminhtml/default/default/template/ultimate_modulecreator\",\r\n        \"app/design/adminhtml/default/default/template/ultimate_modulecreator\"\r\n      ],\r\n      [\r\n        \"skin/adminhtml/default/default/ultimate_modulecreator.css\",\r\n        \"skin/adminhtml/default/default/ultimate_modulecreator.css\"\r\n      ],\r\n      [\r\n        \"skin/adminhtml/default/default/images/ultimate_modulecreator\",\r\n        \"skin/adminhtml/default/default/images/ultimate_modulecreator\"\r\n      ],\r\n      [\r\n        \"js/ultimate_modulecreator.js\",\r\n        \"js/ultimate_modulecreator.js\"\r\n      ]\r\n    ]\r\n  }\r\n}\r\n"
  },
  {
    "path": "js/ultimate_modulecreator.js",
    "content": "/**\r\n * Ultimate_ModuleCreator extension\r\n *\r\n * NOTICE OF LICENSE\r\n *\r\n * This source file is subject to the MIT License\r\n * that is bundled with this package in the file LICENSE_UMC.txt.\r\n * It is also available through the world-wide-web at this URL:\r\n * http://opensource.org/licenses/mit-license.php\r\n *\r\n * @category   Ultimate\r\n * @package    Ultimate_ModuleCreator\r\n * @copyright  Copyright (c) 2014\r\n * @license    http://opensource.org/licenses/mit-license.php MIT License\r\n */\r\n/**\r\n * js for module creation UI\r\n * @category    Ultimate\r\n * @package     Ultimate_ModuleCreator\r\n * @author      Marius Strajeru <ultimate.module.creator@gmail.com>\r\n */\r\n\r\nValidation.add('umc-validate-class-name', 'Please use only letters (a-z or A-Z) or numbers (0-9) in this field, first character should be an uppercase letter.', function(v) {\r\n    return Validation.get('IsEmpty').test(v) ||  /^[A-Z]+[a-zA-Z0-9]+$/.test(v)\r\n});\r\n\r\n\r\nif(typeof UMC=='undefined') {\r\n    var UMC = {};\r\n}\r\n/**\r\n * override the varienForm to show fieldsets with errors\r\n * @type UMC.Form\r\n */\r\nUMC.Form = Class.create(varienForm);\r\nUMC.Form.prototype.submit = function(url){\r\n    if (typeof varienGlobalEvents != undefined) {\r\n        varienGlobalEvents.fireEvent('formSubmit', this.formId);\r\n    }\r\n    this.errorSections = $H({});\r\n    this.canShowError = true;\r\n    this.submitUrl = url;\r\n    if(this.validator && this.validator.validate()){\r\n        if(this.validationUrl){\r\n            this._validate();\r\n        }\r\n        else{\r\n            this._submit();\r\n        }\r\n        return true;\r\n    }\r\n    else {\r\n        var errors = $$('.validation-advice');\r\n        for (var i =0; i < errors.length; i++){\r\n            var field = $(errors[i]);\r\n            while ($(field) && $(field).up('.fieldset') != 'undefined') {\r\n                field = $(field).up('.fieldset');\r\n                if ($(field)) {\r\n                    $(field).show();\r\n                }\r\n            }\r\n        }\r\n    }\r\n    return false;\r\n}\r\n/**\r\n * module class\r\n * @type UMC.Module\r\n */\r\nUMC.Module = Class.create();\r\nUMC.Module.prototype =  {\r\n    /**\r\n     * initialize module\r\n     * @param config\r\n     */\r\n    initialize: function (config){\r\n        this.config = Object.extend({\r\n            addEntityTrigger    : \".add-entity\",\r\n            entityTab           : 'modulecreator_info_tabs_entities',\r\n            entitiesContainer   : 'entities_container',\r\n            relationTabId       : 'modulecreator_info_tabs_relations',\r\n            relationHolder      : 'modulecreator_relations_container',\r\n            relations           : {},\r\n            menuSelectors       : '#note_sort_order a, #note_menu_parent a',\r\n            nameAttributes      : {},\r\n            collapsed           : 0\r\n        }, config);\r\n        this.entities = [];\r\n        this.entityCount = 0;\r\n        this.entityTemplate = this.config.entityTemplate;\r\n        this.attributeTemplate = this.config.attributeTemplate;\r\n        this.templateSyntax = /(^|.|\\r|\\n)({{(\\w+)}})/;\r\n        var that = this;\r\n        $$(this.config.addEntityTrigger).each(function(element){\r\n            Element.observe(element, 'click', that.addEntity.bind(that));\r\n        });\r\n        $$(this.config.menuSelectors).each(function(el){\r\n            Element.observe($(el), 'click', that.selectMenu.bind(that))\r\n        });\r\n        $(this.config.entitiesContainer).select('.modulecreator-entity').each(function(element){\r\n            var entity = new UMC.Entity(element, {\r\n                nameAttribute: that.config.nameAttributes[that.entityCount],\r\n                collapsed: that.config.collapsed\r\n            });\r\n            that.registerEntity(entity);\r\n        });\r\n    },\r\n    /**\r\n     * add entity to module\r\n     */\r\n    addEntity: function(){\r\n        var that = this;\r\n        fireEvent($(that.config.entityTab), 'click');\r\n        var template = new Template(that.entityTemplate, this.templateSyntax);\r\n        var entityTemplate = template.evaluate({entity_id:that.entityCount});\r\n        $(that.config.entitiesContainer).insert({bottom:entityTemplate});\r\n\r\n        var entity = new UMC.Entity($('entity_' + that.entityCount), {collapsed: that.config.collapsed});\r\n        Effect.Pulsate('entity_' + that.entityCount, { pulses: 1, duration: 1 });\r\n        Effect.ScrollTo($('entity_' + that.entityCount), { duration:'1'});\r\n        that.registerEntity(entity);\r\n    },\r\n    /**\r\n     * remove entity from module\r\n     * @param index\r\n     * @returns UMC.Module\r\n     */\r\n    removeEntity: function(index){\r\n        for (var i = 0; i<this.entities.length; i++) {\r\n            if (this.entities[i].index == index) {\r\n                this.entities.splice(i, 1);\r\n                $$('#' + this.config.relationHolder + ' .relation_entity_' + index).each(function(el){\r\n                    $(el).up().remove();\r\n                });\r\n                break;\r\n            }\r\n        }\r\n        if (this.entities.length < 2){\r\n            $(this.config.relationTabId).up().hide();\r\n        }\r\n        return this;\r\n    },\r\n    /**\r\n     * register entity\r\n     * @param entity\r\n     */\r\n    registerEntity: function(entity){\r\n        entity.setModule(this);\r\n        entity.setIndex(this.entityCount);\r\n        this.entities.push(entity);\r\n        this.entityCount++;\r\n        this.rebuildRelations();\r\n    },\r\n    /**\r\n     * rebuild relations tab\r\n     */\r\n    rebuildRelations: function(){\r\n        var entities = this.entities;\r\n        if (entities.length < 2){\r\n            $(this.config.relationTabId).up().hide();\r\n        }\r\n        else{\r\n            $(this.config.relationTabId).up().show();\r\n        }\r\n        var container = $(this.config.relationHolder);\r\n        for (var i=0;i<entities.length - 1;i++){\r\n            for (var j = i+1; j<entities.length;j++){\r\n                var index1 = entities[i].index;\r\n                var index2 = entities[j].index;\r\n                var relName = index1 + '_' + index2;\r\n                var _tmp = 'relation_' + relName;\r\n                if (container.select('#' + _tmp).length == 0){\r\n                    var template = '<div id=\"' + _tmp + '\" data-id-1=\"' + index1 + '\" data-id-2=\"' + index2 + '\">';\r\n                    template += '<div class=\"relation-label relation_entity_' + index1 + '\">' + $(entities[i].element).select('.entry-edit-head h4')[0].innerHTML + '</div>';\r\n                    template += this.config.relationSelect.replace(/#{e1}/g, index1).replace(/#{e2}/g, index2);\r\n                    template += '<div class=\"relation-label relation_entity_' + index2 + '\">' + $(entities[j].element).select('.entry-edit-head h4')[0].innerHTML + '</div>';\r\n                    template += '<div class=\"clearfix\">';\r\n                    template += '</div>';\r\n                    container.insert({bottom:template});\r\n                    var relations = this.config.relations;\r\n                    if (typeof relations[relName] != \"undefined\"){\r\n                        $(_tmp).select('option[value=\"' + relations[relName] +'\"]')[0].selected = \"selected\";\r\n                    }\r\n\r\n                }\r\n            }\r\n        }\r\n    },\r\n    /**\r\n     * select menu item\r\n     * @param e\r\n     */\r\n    selectMenu: function(e){\r\n        var that = this;\r\n        var menuSelector = $('umc-nav');\r\n        Dialog.alert(menuSelector.up().innerHTML, {\r\n            className:'magento',\r\n            width:300,\r\n            height: 500,\r\n            okLabel: 'Close',\r\n            buttonClass: 'scalable',\r\n            title: ''\r\n        });\r\n        this.makeTree('umc-nav');\r\n        Event.stop(e);\r\n    },\r\n    /**\r\n     * transform menu into tree\r\n     * @param treeId\r\n     */\r\n    makeTree: function(treeId){\r\n        var that = this;\r\n        var tree = $(treeId);\r\n        if (tree.hasClassName('tree')){\r\n            return ;\r\n        }\r\n        if(tree){\r\n            tree.addClassName('tree');\r\n            tree.select('ul').each(function(el){\r\n                $(el).hide();\r\n            })\r\n            tree.select('li').each(function(item){\r\n                if ($(item).hasClassName('umc-menu-selector')){\r\n                    return;\r\n                }\r\n                var children = $(item).childElements().grep(new Selector('ul'));\r\n                if (children.length > 0) {\r\n                    var togglers = $(item).childElements().grep(new Selector('.toggler'));\r\n                    try{\r\n                        if (togglers.length > 0){\r\n                            Element.observe($(togglers[0]), 'click', function(e){\r\n                                if ($(this).hasClassName('collapsed')){\r\n                                    $(this).addClassName('expanded');\r\n                                    $(this).removeClassName('collapsed');\r\n                                    $(item).childElements().grep(new Selector('ul')).each(function(ul){\r\n                                        $(ul).show();\r\n                                    });\r\n                                }\r\n                                else{\r\n                                    $(this).removeClassName('expanded');\r\n                                    $(this).addClassName('collapsed');\r\n                                    $(item).childElements().grep(new Selector('ul')).each(function(ul){\r\n                                        $(ul).hide();\r\n                                    });\r\n                                }\r\n                            });\r\n                        }\r\n                    }\r\n                    catch(e){\r\n                        console.log(e);\r\n                    }\r\n                }\r\n            });\r\n            var selector = 'li.umc-menu-selector a.insert-menu';\r\n            tree.select(selector).each(function(el){\r\n                Element.observe(el, 'click', function(e){\r\n                    Event.stop(e);\r\n\r\n                    var values = $(this).readAttribute('menu-data').evalJSON(true);\r\n                    $('settings_menu_parent').setAttribute('value', values.parent);\r\n                    if (values.parent == ''){\r\n                        $('settings_menu_parent').setAttribute('placeholder', '[top-level]');\r\n                    }\r\n                    $('settings_sort_order').setAttribute('value', values.sort_order);\r\n                    Dialog.okCallback();\r\n                });\r\n            })\r\n        };\r\n    }\r\n}\r\n/**\r\n * Entity class\r\n * @type UMC.Entity\r\n */\r\nUMC.Entity = Class.create();\r\nUMC.Entity.prototype = {\r\n    /**\r\n     * initialize entity\r\n     * @param element\r\n     * @param config\r\n     */\r\n    initialize: function(element, config){\r\n        var that = this;\r\n        this.element = element;\r\n        this.attributeCount = 0;\r\n        this.attributes = [];\r\n        this.cacheElements = [];\r\n        this.config = Object.extend(config, {\r\n            addAttributeTrigger             : '.add-attribute',\r\n            index                           : -1\r\n        });\r\n        this.index = this.config.index;\r\n        $(this.element).select('.delete-entity').each(function(el){\r\n            Event.observe(el, 'click', function(){\r\n                if (confirm(Translator.translate('Are you sure?'))){\r\n                    that.remove();\r\n                }\r\n            });\r\n        });\r\n        $(this.element).select(this.config.addAttributeTrigger).each(function(element) {\r\n            Element.observe(element, 'click', that.addAttribute.bind(that));\r\n        });\r\n        var index = 0;\r\n        $(this.element).select('.entry-edit-head').each(function(el){\r\n            if ($(el).select('.modulecreator-toggle').length == 0){\r\n                $(el).insert({top:'<div class=\"collapseable\"><a href=\"#\" class=\"left modulecreator-toggle open\">&nbsp;</a></div>'});\r\n                Event.observe($(el).select('a.modulecreator-toggle')[0], 'click', function(e){\r\n                    $(this).up(1).next().toggle();\r\n                    $(this).toggleClassName('open');\r\n                    $(this).toggleClassName('closed');\r\n                    Event.stop(e);\r\n                    return false;\r\n                });\r\n                if (index > 0 && that.config.collapsed){\r\n                    $(el).select('a.modulecreator-toggle')[0].click();\r\n                }\r\n                index++;\r\n            }\r\n        });\r\n        Event.observe($(this.element).select('.label-singular')[0], 'change', function(){\r\n            var label = $(this).value;\r\n            $(that.element).select('h4')[0].update(label);\r\n            $$('.relation_entity_' + that.index).each(function(el){\r\n                $(el).update(label);\r\n            })\r\n        });\r\n        var reloaders = this.getReloaders();\r\n        for (var i = 0; i< reloaders.length; i++){\r\n            Event.observe($(reloaders[i]), 'change', function(){\r\n                that.reloadFrontend();\r\n            })\r\n        }\r\n        $(this.element).select('table').each(function(elem){\r\n            decorateTable(elem);\r\n        });\r\n        $(this.element).select('.modulecreator-attribute').each(function(elem){\r\n            var attribute = new UMC.Attribute(elem, {})\r\n            that.registerAttribute(attribute);\r\n        });\r\n\r\n        this.reloadFrontend();\r\n    },\r\n    /**\r\n     * set module\r\n     * @param module\r\n     */\r\n    setModule: function(module){\r\n        this.module = module;\r\n    },\r\n    /**\r\n     * set index\r\n     * @param index\r\n     */\r\n    setIndex: function(index){\r\n        this.index = index;\r\n        this.initAttributeSort()\r\n    },\r\n    /**\r\n     * remove entity\r\n     */\r\n    remove: function(){\r\n        var that = this;\r\n        var index = this.index;\r\n        var module = this.module;\r\n        if (module){\r\n            module.removeEntity(index);\r\n        }\r\n        $(that.element).slideUp({\r\n            afterFinish: function(){\r\n                $(that.element).remove();\r\n            }\r\n        });\r\n    },\r\n    /**\r\n     * add attribute to entity\r\n     */\r\n    addAttribute: function(){\r\n        var that = this;\r\n        var template = new Template(that.module.attributeTemplate, that.module.templateSyntax);\r\n        var attributeTemplate = template.evaluate({\r\n            entity_id:this.index,\r\n            attribute_id : that.attributeCount\r\n        });\r\n        $('entity_' + that.index + '_attributes').show();\r\n        $('entity_' + that.index + '_attributes_container').select('.modulecreator-toggle')[0].removeClassName('closed');\r\n        $('entity_' + that.index + '_attributes_container').select('.modulecreator-toggle')[0].addClassName('open');\r\n        $('entity_' + that.index + '_attributes').insert({bottom:attributeTemplate});\r\n        $$('#attribute_' + that.index + '_' + that.attributeCount + ' table').each(function(elem){\r\n            decorateTable(elem);\r\n        });\r\n        var attribute = new UMC.Attribute($('attribute_' + that.index + '_' + that.attributeCount), {});\r\n        Effect.ScrollTo($('attribute_' + that.index + '_' + that.attributeCount), { duration:1});\r\n        Effect.Pulsate('attribute_' + that.index + '_' + that.attributeCount, { pulses: 1, duration: 1 });\r\n        that.registerAttribute(attribute);\r\n        this.initAttributeSort();\r\n    },\r\n    /**\r\n     * register attribute\r\n     * @param attribute\r\n     */\r\n    registerAttribute: function(attribute){\r\n        attribute.setEntity(this);\r\n        attribute.setIndex(this.attributeCount);\r\n        this.attributes.push(attribute);\r\n        this.reloadFrontend();\r\n        attribute.reloadSettings(false);\r\n        this.attributeCount++;\r\n    },\r\n    /**\r\n     * remove attribute\r\n     * @param index\r\n     */\r\n    removeAttribute: function(index){\r\n        for (var i = 0; i<this.attributes.length; i++) {\r\n            if (this.attributes[i].index == index) {\r\n                this.attributes.splice(i, 1);\r\n                break;\r\n            }\r\n        }\r\n    },\r\n    /**\r\n     * get elements that reload the settings\r\n     * @returns {Array}\r\n     */\r\n    getReloaders: function(){\r\n        var classes = ['type', 'is_tree', 'create-frontend', 'create-list', 'create-view', 'link-product', 'link-category', 'product-attribute', 'category-attribute', 'allow-comment', 'rss', 'widget', 'url-rewrite'];\r\n        var reloaders = [];\r\n        for (var i=0; i<classes.length; i++){\r\n            reloaders.push(this.getElementByClass(classes[i]));\r\n        }\r\n        return reloaders;\r\n    },\r\n    /**\r\n     * reload settings for fronend\r\n     */\r\n    reloadFrontend: function(){\r\n        var that = this;\r\n        $(this.element).select('input, textarea, select').each(function(el){\r\n            that.evaluateElement(el);\r\n        });\r\n        for (var i = 0; i < this.attributes.length; i++){\r\n            this.attributes[i].reloadSettings(false);\r\n        }\r\n    },\r\n    /**\r\n     * check if element should be disabled or not\r\n     * @param item\r\n     * @returns UMC.Entity\r\n     */\r\n    evaluateElement: function(item){\r\n        if (this.canEnableElement(item)){\r\n            this.enableItem(item);\r\n        }\r\n        else{\r\n            this.disableItem(item);\r\n        }\r\n        return this;\r\n    },\r\n    /**\r\n     * check if element can be disabled\r\n     * @param item\r\n     * @returns {boolean}\r\n     */\r\n    canEnableElement: function(item){\r\n        item = $(item);\r\n        var canEnable = true;\r\n        if (item.hasClassName('use-frontend')){\r\n            if (this.getValueByClass('create-frontend') == 0){\r\n                canEnable = false;\r\n            }\r\n            else{\r\n                if (item.hasClassName('use-create-list')){\r\n                    canEnable = canEnable && (this.getValueByClass('create-list') == 1);\r\n                }\r\n                if (item.hasClassName('use-create-view')){\r\n                    canEnable = canEnable && (this.getValueByClass('create-view') == 1);\r\n                }\r\n                if (item.hasClassName('use-rss')){\r\n                    canEnable = canEnable && (this.getValueByClass('rss') == 1);\r\n                }\r\n                if (item.hasClassName('use-widget')){\r\n                    canEnable = canEnable && (this.getValueByClass('widget') == 1);\r\n                }\r\n                if (item.hasClassName('use-allow-comment')){\r\n                    canEnable = canEnable && (this.getValueByClass('allow-comment') == 1);\r\n                }\r\n                if (item.hasClassName('use-url-rewrite')){\r\n                    canEnable = canEnable && (this.getValueByClass('url-rewrite') == 1);\r\n                }\r\n            }\r\n        }\r\n        if (item.hasClassName('use-link-product')){\r\n            canEnable = canEnable && (this.getValueByClass('link-product') == 1);\r\n        }\r\n        if (item.hasClassName('use-link-category')){\r\n            canEnable = canEnable && (this.getValueByClass('link-category') == 1);\r\n        }\r\n        if (item.hasClassName('use-product-attribute')){\r\n            canEnable = canEnable && (this.getValueByClass('product-attribute') == 1);\r\n        }\r\n        if (item.hasClassName('use-category-attribute')){\r\n            canEnable = canEnable && (this.getValueByClass('category-attribute') == 1);\r\n        }\r\n        if (item.hasClassName('attribute-scope')){\r\n            canEnable = canEnable && (this.getValueByClass('type') == 'eav');\r\n        }\r\n        if (item.hasClassName('store-specific')){\r\n            canEnable = canEnable && (this.getValueByClass('type') == 'flat');\r\n        }\r\n        if (item.hasClassName('use-not-tree')){\r\n            canEnable = canEnable && (this.getValueByClass('is_tree') == 0);\r\n        }\r\n        return canEnable;\r\n    },\r\n    /**\r\n     * get element by class name\r\n     * @param className\r\n     * @returns {*}\r\n     */\r\n    getElementByClass: function(className){\r\n        if (!this.cacheElements[className]){\r\n            this.cacheElements[className] = $(this.element).select('.' + className)[0];\r\n        }\r\n        return this.cacheElements[className];\r\n    },\r\n    /**\r\n     * get value by class name\r\n     * @param className\r\n     * @returns {*}\r\n     */\r\n    getValueByClass: function(className){\r\n        return this.getElementByClass(className).value;\r\n    },\r\n    /**\r\n     * disable element\r\n     * @param item\r\n     * @returns {*}\r\n     */\r\n    disableItem: function(item){\r\n        $(item).setAttribute('disabled', 'disabled');\r\n        return this;\r\n    },\r\n    /**\r\n     * enable element\r\n     * @param item\r\n     * @returns {*}\r\n     */\r\n    enableItem: function(item){\r\n        $(item).removeAttribute('disabled');\r\n        return this;\r\n    },\r\n    /**\r\n     * initialize attribute sorting\r\n     */\r\n    initAttributeSort: function() {\r\n        var that = this;\r\n        Sortable.create('entity_' + this.index +'_attributes', {\r\n            tag:'div',\r\n            onUpdate: function(){\r\n                that.reloadAttributePositions()\r\n            }\r\n        });\r\n        this.reloadAttributePositions();\r\n    },\r\n    /**\r\n     * set attribute positions\r\n     */\r\n    reloadAttributePositions: function() {\r\n        var position = 10;\r\n        $(this.element).select('input.position').each(function(element){\r\n            $(element).value = position;\r\n            position += 10;\r\n        });\r\n    }\r\n}\r\n/**\r\n * Attribute class\r\n * @type UMC.Attribute\r\n */\r\nUMC.Attribute = Class.create();\r\nUMC.Attribute.prototype = {\r\n    /**\r\n     * initialize attribute class\r\n     * @param element\r\n     * @param config\r\n     */\r\n    initialize: function(element, config){\r\n        var that = this;\r\n        this.element = element;\r\n        this.config = config;\r\n        $(this.element).select('.entry-edit-head').each(function(el){\r\n            if ($(el).select('.modulecreator-toggle').length == 0){\r\n                $(el).insert({top:'<div class=\"collapseable\"><a href=\"#\" class=\"left modulecreator-toggle open\">&nbsp;</a></div>'});\r\n                Event.observe($(el).select('a.modulecreator-toggle')[0], 'click', function(e){\r\n                    $(this).up(1).next().toggle();\r\n                    $(this).toggleClassName('open');\r\n                    $(this).toggleClassName('closed');\r\n                    Event.stop(e);\r\n                    return false;\r\n                });\r\n            }\r\n        });\r\n        var removeAttributeTemplate = '<div class=\"right\">';\r\n        removeAttributeTemplate += '   <button type=\"button\" class=\"delete delete-attribute\">';\r\n        removeAttributeTemplate += '    <span>';\r\n        removeAttributeTemplate += '        <span>';\r\n        removeAttributeTemplate += '            <span>';\r\n        removeAttributeTemplate += '                ' + Translator.translate('Remove field / attribute');\r\n        removeAttributeTemplate += '            </span>';\r\n        removeAttributeTemplate += '        </span>';\r\n        removeAttributeTemplate += '    </span>';\r\n        removeAttributeTemplate += '    </button>';\r\n        removeAttributeTemplate += '</div>';\r\n        $(this.element).select('.entry-edit-head')[0].insert({bottom: removeAttributeTemplate});\r\n        $(this.element).select('.delete-attribute').each(function(el){\r\n            Event.observe(el, 'click', function(){\r\n                if (confirm(Translator.translate('Are you sure?'))){\r\n                    that.remove();\r\n                }\r\n            });\r\n        });\r\n        Event.observe(this.getTypeElement(), 'change', function(){\r\n            that.reloadSettings(true);\r\n        });\r\n        Event.observe(this.getSourceTypeElement(), 'change', function(){\r\n            that.reloadSettings(false);\r\n        });\r\n        Event.observe(this.element.select('.attribute-label')[0], 'change', function(){\r\n            if ($(this).value.length > 0){\r\n                $(that.element).select('h4')[0].update($(this).value);\r\n            }\r\n        });\r\n        var labelElement = this.element.select('.attribute-label')[0]\r\n        if (labelElement.value != '') {\r\n            $(that.element).select('h4')[0].update(labelElement.value);\r\n        }\r\n        else {\r\n            $(that.element).select('h4')[0].update('New Attribute');\r\n        }\r\n    },\r\n    /**\r\n     * attach to entity\r\n     * @param entity\r\n     */\r\n    setEntity: function(entity){\r\n        this.entity = entity;\r\n        var nameElem = (this.element).select('input.is_name')[0];\r\n        var name = nameElem.name;\r\n        var parts = name.split('][');\r\n        var newName = parts[0] + '][' + parts[1] + '][' + parts[3];\r\n        nameElem.name = newName;\r\n\r\n    },\r\n    /**\r\n     * set attribute index\r\n     * @param index\r\n     */\r\n    setIndex: function(index){\r\n        this.index = index;\r\n        $(this.element).select('input.is_name')[0].value = index;\r\n        if (index == this.entity.config.nameAttribute){\r\n            $(this.element).select('input.is_name')[0].setAttribute('checked', 'checked');\r\n        }\r\n    },\r\n    /**\r\n     * remove attribute\r\n     */\r\n    remove: function(){\r\n        var that = this;\r\n        var index = this.index;\r\n        var entity = this.entity;\r\n        if (entity){\r\n            entity.removeAttribute(index);\r\n        }\r\n        //$(that.element).remove();\r\n        $(that.element).slideUp({\r\n            afterFinish: function(){\r\n                $(that.element).remove();\r\n            }\r\n        });\r\n    },\r\n    /**\r\n     * reload attribute settings\r\n     * @param withEntity\r\n     */\r\n    reloadSettings: function(withEntity){\r\n        var that = this;\r\n        if(withEntity){\r\n            this.entity.reloadFrontend();\r\n        }\r\n        this.element.select('input, textarea, select').each(function(el){\r\n            var shouldDisable = false;\r\n            if ($(el).hasClassName('type-' + that.getType()) || $(el).hasClassName('type-all')){\r\n                shouldDisable = !that.entity.canEnableElement(el);\r\n                if ($(el).hasClassName('custom-source')){\r\n                    shouldDisable = shouldDisable || (that.getSourceType() != 'custom');\r\n                }\r\n                if ($(el).hasClassName('not-custom-source')){\r\n                    shouldDisable = shouldDisable || (that.getSourceType() == 'custom' || !that.getSourceType());\r\n                }\r\n                if ($(el).hasClassName('dropdown-custom-source')) {\r\n                    shouldDisable = shouldDisable || ((that.getType() == 'dropdown' || that.getType() == 'multiselect') && that.getSourceType() != 'custom');\r\n                }\r\n            }\r\n            else{\r\n                shouldDisable = true;\r\n            }\r\n            if (!shouldDisable){\r\n                that.entity.enableItem(el);\r\n            }\r\n            else{\r\n                that.entity.disableItem(el);\r\n            }\r\n        });\r\n    },\r\n    /**\r\n     * get attrbute type dom element\r\n     * @returns {*}\r\n     */\r\n    getTypeElement: function(){\r\n        return $(this.element).select('.attribute-type')[0];\r\n    },\r\n    /**\r\n     * get attribute type\r\n     * @returns {*}\r\n     */\r\n    getType: function(){\r\n        return this.getTypeElement().value;\r\n    },\r\n    /**\r\n     * get source type DOM element\r\n     * @returns {*}\r\n     */\r\n    getSourceTypeElement: function(){\r\n        return $(this.element).select('.is-source')[0];\r\n    },\r\n    /**\r\n     * get source type\r\n     * @returns {*}\r\n     */\r\n    getSourceType: function(){\r\n        return this.getSourceTypeElement().value;\r\n    }\r\n}\r\n/**\r\n * Help class\r\n * @type UMC.Help\r\n */\r\nUMC.Help = Class.create();\r\nUMC.Help.prototype = {\r\n    /**\r\n     * initialize help class\r\n     * @param element\r\n     */\r\n    initialize: function(element){\r\n        var that = this;\r\n        this.element = element;\r\n        $(this.element).select('.entry-edit-head').each(function(el){\r\n            if ($(el).select('.modulecreator-toggle').length == 0){\r\n                $(el).insert({top:'<div class=\"collapseable\"><a href=\"#\" class=\"left modulecreator-toggle open\">&nbsp;</a></div>'});\r\n                Event.observe($(el).select('a.modulecreator-toggle')[0], 'click', function(e){\r\n                    $(this).up(1).next().toggle();\r\n                    $(this).toggleClassName('open');\r\n                    $(this).toggleClassName('closed');\r\n                    Event.stop(e);\r\n                    return false;\r\n                });\r\n                $(el).select('a.modulecreator-toggle')[0].click();\r\n            }\r\n        });\r\n    }\r\n}"
  },
  {
    "path": "modman",
    "content": "#Ultimate Module Creator\r\napp/etc/modules/Ultimate_ModuleCreator.xml\tapp/etc/modules/Ultimate_ModuleCreator.xml\r\napp/code/community/Ultimate/ModuleCreator\tapp/code/community/Ultimate/ModuleCreator\r\napp/locale/en_US/Ultimate_ModuleCreator.csv\tapp/locale/en_US/Ultimate_ModuleCreator.csv\r\napp/design/adminhtml/default/default/layout/ultimate_modulecreator.xml\tapp/design/adminhtml/default/default/layout/ultimate_modulecreator.xml\r\napp/design/adminhtml/default/default/template/ultimate_modulecreator\tapp/design/adminhtml/default/default/template/ultimate_modulecreator\r\nskin/adminhtml/default/default/ultimate_modulecreator.css  skin/adminhtml/default/default/ultimate_modulecreator.css\r\nskin/adminhtml/default/default/images/ultimate_modulecreator skin/adminhtml/default/default/images/ultimate_modulecreator\r\njs/ultimate_modulecreator.js\tjs/ultimate_modulecreator.js\r\n"
  },
  {
    "path": "skin/adminhtml/default/default/ultimate_modulecreator.css",
    "content": ".adminhtml-modulecreator-edit a.modulecreator-toggle {\r\n    width:18px;\r\n}\r\n.adminhtml-modulecreator-edit .entry-edit-head {\r\n    margin-bottom: 3px;\r\n}\r\n.adminhtml-modulecreator-edit .form-list td.label label {\r\n    width:auto!important;\r\n    padding-right: 0px;\r\n}\r\n.adminhtml-modulecreator-edit .form-list td.label {\r\n    width:30%;\r\n}\r\n.adminhtml-modulecreator-edit tr.odd {\r\n    float:left;\r\n    width:49%;\r\n}\r\n.adminhtml-modulecreator-edit tr.even {\r\n    float:left;\r\n    width:49%;\r\n}\r\n\r\n.adminhtml-modulecreator-edit .form-list td.value textarea,\r\n.adminhtml-modulecreator-edit .form-list td.value input,\r\n.adminhtml-modulecreator-edit .form-list td.value select {\r\n    width:90%;\r\n}\r\n.adminhtml-modulecreator-edit td.value .link-store-scope {\r\n    cursor: pointer;\r\n    margin-top:0px;\r\n}\r\n.adminhtml-modulecreator-edit .relation-label,\r\n.adminhtml-modulecreator-edit .relation-select {\r\n    float:left;\r\n    font-size: 15px;\r\n    margin: 0 10px;\r\n    padding: 8px;\r\n}\r\n.adminhtml-modulecreator-edit .relation-label {\r\n    font-weight: bold;\r\n    text-align: center;\r\n    width:150px;\r\n}\r\n.adminhtml-modulecreator-edit .clearfix {\r\n    clear:both;\r\n    height:3px;\r\n}\r\n#umc-nav {\r\n    margin-top: 30px;\r\n}\r\n#umc-nav ul {\r\n    list-style-type: none;\r\n}\r\n#umc-nav li button.collapsed,\r\n#umc-nav li button.expanded {\r\n    width:16px;\r\n    height:16px;\r\n    padding: 0!important\r\n}\r\n#umc-nav li span {\r\n    color:#666666;\r\n    font-size:16px;\r\n    font-weight: bold;\r\n}\r\n#umc-nav li button {\r\n    font-size: 12px;\r\n}\r\n#umc-nav a.insert-menu {\r\n    color: #CCCCCC;\r\n    cursor: pointer;\r\n}\r\n\r\n.umc-help-table tr.odd {\r\n    float:none;\r\n    width:auto;\r\n}\r\n.umc-help-table tr.even {\r\n    float:none;\r\n    width:auto;\r\n}\r\n.umc-help-table thead tr td {\r\n    font-weight: bold;\r\n    text-align: center;\r\n}\r\n\r\n.modulecreator-attribute h4 {\r\n    cursor: move;\r\n}\r\n\r\n.tree,\r\n.tree ul,\r\n.tree li {\r\n    list-style:none;\r\n    margin:0;\r\n    padding:0;\r\n}\r\n.tree {\r\n    background:url(images/ultimate_modulecreator/line1.png) repeat-y;\r\n}\r\n.tree li {\r\n    line-height:20px;\r\n    margin-top:1px;\r\n    position:relative;\r\n    width:100%;\r\n}\r\n* html .tree li {\r\n    float:left;\r\n    display:inline;\r\n}\r\n.tree li a {\r\n    padding-left:28px;\r\n}\r\n.tree li span {\r\n    cursor:auto;\r\n    float:left;\r\n    font-size:0;\r\n    height:13px;\r\n    left:5px;\r\n    position:absolute;\r\n    top:5px;\r\n    width:13px;\r\n}\r\n.tree li span,\r\n.tree li span.collapsed {\r\n    background:url(images/ultimate_modulecreator/collapsed.png) no-repeat 0 0;\r\n}\r\n.tree li span.expanded {\r\n    background:url(images/ultimate_modulecreator/expanded.png) no-repeat 0 0;\r\n}\r\n.tree li ul {\r\n    margin-left:28px;\r\n    background:url(images/ultimate_modulecreator/line1.png) repeat-y;\r\n}\r\n.tree li li {\r\n    background:url(images/ultimate_modulecreator/line2.png) no-repeat 0 0;\r\n}\r\n.tree:after,\r\n.tree ul:after {\r\n    clear:both;\r\n    content:\".\";\r\n    display:block;\r\n    height:0;\r\n    visibility:hidden;\r\n}\r\n.tree,\r\n.tree ul {\r\n    display:block;\r\n}\r\n.tree li.map-category {\r\n    font-weight:bold;\r\n}\r\n.tree li.map-product {\r\n    font-weight:normal;\r\n}\r\n.tree li.map-product a {\r\n    color:#203548;\r\n}\r\n.tree,\r\n.tree ul {\r\n   min-height:1%;\r\n}\r\n* html .tree,\r\n* html .tree ul {\r\n    height:1%;\r\n}"
  },
  {
    "path": "wagner.cson",
    "content": "{\n    name: 'ultimate/modulecreator'\n\n    description: 'New Ultimate Module Creator for Magento 1.7 +'\n\n    type: 'magento-module'\n\n    license: 'MIT'\n\n    'minimum-stability': 'dev'\n    authors: [\n        name: 'Marius Strajeru'\n        email: 'ultimate.module.creator@gmai.com'\n    ]\n    repositories: [\n        type: 'composer'\n        url: 'http://packages.firegento.com'\n    ]\n    require:\n        'magento-hackathon/magento-composer-installer': '*'\n\n    extra:\n        map: [\n            [\"app/etc/modules/Ultimate_ModuleCreator.xml\", \"app/etc/modules/Ultimate_ModuleCreator.xml\"]\n            [\"app/code/community/Ultimate/ModuleCreator\", \"app/code/community/Ultimate/ModuleCreator\"]\n            [\"app/locale/en_US/Ultimate_ModuleCreator.csv\", \"app/locale/en_US/Ultimate_ModuleCreator.csv\"]\n            [\"app/design/adminhtml/default/default/layout/ultimate_modulecreator.xml\", \"app/design/adminhtml/default/default/layout/ultimate_modulecreator.xml\"]\n            [\"app/design/adminhtml/default/default/template/ultimate_modulecreator\", \"app/design/adminhtml/default/default/template/ultimate_modulecreator\"]\n            [\"skin/adminhtml/default/default/ultimate_modulecreator.css\", \"skin/adminhtml/default/default/ultimate_modulecreator.css\"]\n            [\"js/ultimate_modulecreator.js\", \"js/ultimate_modulecreator.js\"]\n        ]\n}\n"
  }
]