Skip to content

Commit

Permalink
Import Magento Release 1.4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed Dec 8, 2010
1 parent 9bb265e commit b7dc90c
Show file tree
Hide file tree
Showing 4,009 changed files with 371,705 additions and 279,885 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1,016 changes: 1,016 additions & 0 deletions RELEASE_NOTES.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public static function getVersionInfo()
return array(
'major' => '1',
'minor' => '4',
'revision' => '1',
'patch' => '1',
'revision' => '2',
'patch' => '0',
'stability' => '',
'number' => '',
);
Expand Down
64 changes: 64 additions & 0 deletions app/code/community/Find/Feed/Block/Adminhtml/Edit/Codes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Find
* @package Find_Feed
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


/**
* Attribute map edit codes form container block
*
* @category Find
* @package Find_Feed
* @author Magento Core Team <core@magentocommerce.com>
*/
class Find_Feed_Block_Adminhtml_Edit_Codes extends Mage_Adminhtml_Block_Widget_Form_Container
{
/**
* Initialize form container
*
*/
public function __construct()
{
$this->_blockGroup = 'find_feed';
$this->_controller = 'adminhtml_edit_codes';

parent::__construct();

$this->_removeButton('back');
$url = $this->getUrl('*/codes_grid/saveForm');
$this->_updateButton('save', 'onclick', 'saveNewImportItem(\''.$url.'\')');
$this->_updateButton('reset', 'label', 'Close');
$this->_updateButton('reset', 'onclick', 'closeNewImportItem()');
}

/**
* Return Form Header text
*
* @return string
*/
public function getHeaderText()
{
return Mage::helper('find_feed')->__('Import attribute map');
}
}
124 changes: 124 additions & 0 deletions app/code/community/Find/Feed/Block/Adminhtml/Edit/Codes/Edit/Form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Find
* @package Find_Feed
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


/**
* Attribute map edit form container block
*
* @category Find
* @package Find_Feed
* @author Magento Core Team <core@magentocommerce.com>
*/
class Find_Feed_Block_Adminhtml_Edit_Codes_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
/**
* Import codes list
*
* @return array
*/
protected function _getImportCodeList()
{
$attributes = Mage::getConfig()->getNode(Find_Feed_Model_Import::XML_NODE_FIND_FEED_ATTRIBUTES)->children();
$result = array();
foreach ($attributes as $node) {
$label = trim((string)$node->label);
if ($label) {
$result[$label] = $label;
}
}

return $result;
}

/**
* Magento entity type list for eav attributes
*
* @return array
*/
protected function _getCatalogEntityType()
{
return Mage::getSingleton('eav/config')->getEntityType('catalog_product')->getId();
}


/**
* Magento eav attributes list
*
* @return array
*/
protected function _getEavAttributeList()
{
$result = array();
$collection = Mage::getResourceModel('catalog/product_attribute_collection');
foreach ($collection as $model) {
$result[$model->getAttributeCode()] = $model->getAttributeCode();
}
return $result;
}

/**
* Prepare form
*
* @return Varien_Object
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form(array(
'id' => 'import_item_form',
'method' => 'post'
));

$fieldset = $form->addFieldset('generate_fieldset', array(
'legend' => Mage::helper('find_feed')->__('Item params')
));
$fieldset->addField('import_code', 'select', array(
'label' => Mage::helper('find_feed')->__('Import code'),
'name' => 'import_code',
'required' => true,
'options' => $this->_getImportCodeList()
));
$fieldset->addField('eav_code', 'select', array(
'label' => Mage::helper('find_feed')->__('Eav code'),
'name' => 'eav_code',
'required' => true,
'options' => $this->_getEavAttributeList()
));

$source = Mage::getModel('eav/entity_attribute_source_boolean');
$isImportedOptions = $source->getOptionArray();

$fieldset->addField('is_imported', 'select', array(
'label' => Mage::helper('find_feed')->__('Is imported'),
'name' => 'is_imported',
'value' => 1,
'options' => $isImportedOptions
));
$form->setUseContainer(true);

$this->setForm($form);
return parent::_prepareForm();
}
}
53 changes: 53 additions & 0 deletions app/code/community/Find/Feed/Block/Adminhtml/List/Codes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Find
* @package Find_Feed
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


/**
* TheFind feed attribute map grid container
*
* @category Find
* @package Find_Feed
* @author Magento Core Team <core@magentocommerce.com>
*/
class Find_Feed_Block_Adminhtml_List_Codes extends Mage_Adminhtml_Block_Widget_Grid_Container
{
/**
* Initialize grid container settings
*
*/
public function __construct()
{
$this->_blockGroup = 'find_feed';
$this->_controller = 'adminhtml_list_codes';
$this->_headerText = Mage::helper('find_feed')->__('Attributes map');
$this->_addButtonLabel = Mage::helper('find_feed')->__('Add new');

parent::__construct();

$url = $this->getUrl('*/codes_grid/editForm');
$this->_updateButton('add', 'onclick', 'openNewImportWindow(\''.$url.'\');');
}
}
131 changes: 131 additions & 0 deletions app/code/community/Find/Feed/Block/Adminhtml/List/Codes/Grid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Find
* @package Find_Feed
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


/**
* TheFind feed attribute map Grid
*
* @category Find
* @package Find_Feed
* @author Magento Core Team <core@magentocommerce.com>
*/
class Find_Feed_Block_Adminhtml_List_Codes_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
/**
* Initialize grid settings
*
*/
protected function _construct()
{
parent::_construct();

$this->setId('find_feed_list_codes');
$this->setUseAjax(true);
}

/**
* Prepare codes collection
*
* @return Find_Feed_Block_Adminhtml_List_Codes_Grid
*/
protected function _prepareCollection()
{
$collection = Mage::getResourceModel('find_feed/codes_collection');
$this->setCollection($collection);
return parent::_prepareCollection();
}

/**
* Configuration of grid
*
* @return $this
*/
protected function _prepareColumns()
{
$this->addColumn('import_code', array(
'header'=> Mage::helper('find_feed')->__('Feed code'),
'width' => '80px',
'type' => 'text',
'index' => 'import_code'
));

$this->addColumn('eav_code', array(
'header'=> Mage::helper('find_feed')->__('Eav code'),
'width' => '80px',
'type' => 'text',
'index' => 'eav_code'
));

$source = Mage::getModel('eav/entity_attribute_source_boolean');
$isImportedOptions = $source->getOptionArray();

$this->addColumn('is_imported', array(
'header' => Mage::helper('find_feed')->__('In feed'),
'width' => '100px',
'index' => 'is_imported',
'type' => 'options',
'options' => $isImportedOptions
));
return parent::_prepareColumns();
}

/**
* Prepare massaction
*
* @return $this
*/
protected function _prepareMassaction()
{
$this->setMassactionIdField('code_id');
$this->getMassactionBlock()->setFormFieldName('code_id');

$this->getMassactionBlock()->addItem('enable', array(
'label' => Mage::helper('find_feed')->__('Import'),
'url' => $this->getUrl('*/codes_grid/massEnable'),
'selected' => true,
));
$this->getMassactionBlock()->addItem('disable', array(
'label' => Mage::helper('find_feed')->__('Not import'),
'url' => $this->getUrl('*/codes_grid/massDisable'),
));
$this->getMassactionBlock()->addItem('delete', array(
'label' => Mage::helper('find_feed')->__('Delete'),
'url' => $this->getUrl('*/codes_grid/delete'),
));

return $this;
}

/**
* Return Grid URL for AJAX query
*
* @return string
*/
public function getGridUrl()
{
return $this->getUrl('*/codes_grid/grid', array('_current'=>true));
}
}
Loading

0 comments on commit b7dc90c

Please sign in to comment.