Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Wizard Class Reference

Inheritance diagram for Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Wizard:

Mage_Adminhtml_Block_Widget_Container Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getAttributes ($entityType)
 getValue ($key, $default='', $defaultNew=null)
 getSelected ($key, $value)
 getChecked ($key)
 getMappings ($entityType)
 getAddMapButtonHtml ()
 getRemoveMapButtonHtml ()
 getProductTypeFilterOptions ()
 getProductAttributeSetFilterOptions ()
 getProductVisibilityFilterOptions ()
 getProductStatusFilterOptions ()
 getStoreFilterOptions ()
 getCustomerGroupFilterOptions ()
 getCountryFilterOptions ()
 getWebsiteCollection ()
 getGroupCollection ()
 getStoreCollection ()
 getShortDateFormat ()

Protected Member Functions

 _prepareLayout ()
 _getStoreModel ()

Protected Attributes

 $_storeModel
 $_attributes
 $_addMapButtonHtml
 $_removeMapButtonHtml
 $_shortDateFormat


Detailed Description

Definition at line 34 of file Wizard.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 43 of file Wizard.php.

00044     {
00045         parent::__construct();
00046         $this->setTemplate('system/convert/profile/wizard.phtml');
00047     }


Member Function Documentation

_getStoreModel (  )  [protected]

Retrieve system store model

Returns:
Mage_Adminhtml_Model_System_Store

Definition at line 204 of file Wizard.php.

00204                                         {
00205         if (is_null($this->_storeModel)) {
00206             $this->_storeModel = Mage::getSingleton('adminhtml/system_store');
00207         }
00208         return $this->_storeModel;
00209     }

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Adminhtml_Block_Widget_Container.

Definition at line 49 of file Wizard.php.

00050     {
00051         if ($head = $this->getLayout()->getBlock('head')) {
00052             $head->setCanLoadCalendarJs(true);
00053         }
00054         return $this;
00055     }

getAddMapButtonHtml (  ) 

Definition at line 106 of file Wizard.php.

00107     {
00108         if (!$this->_addMapButtonHtml) {
00109             $this->_addMapButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')
00110                 ->setClass('add')->setLabel($this->__('Add Field Mapping'))
00111                 ->setOnClick("addFieldMapping()")->toHtml();
00112         }
00113         return $this->_addMapButtonHtml;
00114     }

getAttributes ( entityType  ) 

Definition at line 57 of file Wizard.php.

00058     {
00059         if (!isset($this->_attributes[$entityType])) {
00060             switch ($entityType) {
00061                 case 'product':
00062                     $attributes = Mage::getSingleton('catalog/convert_parser_product')
00063                         ->getExternalAttributes();
00064                     break;
00065 
00066                 case 'customer':
00067                     $attributes = Mage::getSingleton('customer/convert_parser_customer')
00068                         ->getExternalAttributes();
00069                     break;
00070             }
00071 
00072             array_splice($attributes, 0, 0, array(''=>$this->__('Choose an attribute')));
00073             $this->_attributes[$entityType] = $attributes;
00074         }
00075         return $this->_attributes[$entityType];
00076     }

getChecked ( key  ) 

Definition at line 95 of file Wizard.php.

00096     {
00097         return $this->getData($key) ? 'checked="checked"' : '';
00098     }

getCountryFilterOptions (  ) 

Definition at line 191 of file Wizard.php.

00192     {
00193         $options = Mage::getResourceModel('directory/country_collection')
00194             ->load()->toOptionArray(false);
00195         array_unshift($options, array('value'=>'', 'label'=>Mage::helper('adminhtml')->__('All countries')));
00196         return $options;
00197     }

getCustomerGroupFilterOptions (  ) 

Definition at line 180 of file Wizard.php.

00181     {
00182         $options = Mage::getResourceModel('customer/group_collection')
00183             ->addFieldToFilter('customer_group_id', array('gt'=>0))
00184             ->load()
00185             ->toOptionHash();
00186 
00187         array_splice($options, 0, 0, array(''=>$this->__('Any Group')));
00188         return $options;
00189     }

getGroupCollection (  ) 

Definition at line 216 of file Wizard.php.

00217     {
00218         return $this->_getStoreModel()->getGroupCollection();
00219     }

getMappings ( entityType  ) 

Definition at line 100 of file Wizard.php.

00101     {
00102         $maps = $this->getData('gui_data/map/'.$entityType.'/db');
00103         return $maps ? $maps : array();
00104     }

getProductAttributeSetFilterOptions (  ) 

Definition at line 133 of file Wizard.php.

00134     {
00135         $options = Mage::getResourceModel('eav/entity_attribute_set_collection')
00136             ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
00137             ->load()
00138             ->toOptionHash();
00139 
00140         $opt = array();
00141         $opt = array(''=>$this->__('Any Attribute Set'));
00142         if ($options) foreach($options as $index => $value) {
00143             $opt[$index]  = $value;
00144         }
00145         //array_slice($options, 0, 0, array(''=>$this->__('Any Attribute Set')));
00146         return $opt;
00147     }

getProductStatusFilterOptions (  ) 

Definition at line 157 of file Wizard.php.

00158     {
00159         $options = Mage::getSingleton('catalog/product_status')->getOptionArray();
00160 
00161         array_splice($options, 0, 0, array(''=>$this->__('Any Status')));
00162         return $options;
00163     }

getProductTypeFilterOptions (  ) 

Definition at line 126 of file Wizard.php.

00127     {
00128         $options = Mage::getSingleton('catalog/product_type')->getOptionArray();
00129         array_splice($options, 0, 0, array(''=>$this->__('Any Type')));
00130         return $options;
00131     }

getProductVisibilityFilterOptions (  ) 

Definition at line 149 of file Wizard.php.

00150     {
00151         $options = Mage::getSingleton('catalog/product_visibility')->getOptionArray();
00152 
00153         array_splice($options, 0, 0, array(''=>$this->__('Any Visibility')));
00154         return $options;
00155     }

getRemoveMapButtonHtml (  ) 

Definition at line 116 of file Wizard.php.

00117     {
00118         if (!$this->_removeMapButtonHtml) {
00119             $this->_removeMapButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')
00120                 ->setClass('delete')->setLabel($this->__('Remove'))
00121                 ->setOnClick("removeFieldMapping(this)")->toHtml();
00122         }
00123         return $this->_removeMapButtonHtml;
00124     }

getSelected ( key,
value 
)

Definition at line 90 of file Wizard.php.

00091     {
00092         return $this->getData($key)==$value ? 'selected="selected"' : '';
00093     }

getShortDateFormat (  ) 

Definition at line 226 of file Wizard.php.

00227     {
00228         if (!$this->_shortDateFormat) {
00229             $this->_shortDateFormat = Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
00230         }
00231         return $this->_shortDateFormat;
00232     }

getStoreCollection (  ) 

Definition at line 221 of file Wizard.php.

00222     {
00223         return $this->_getStoreModel()->getStoreCollection();
00224     }

getStoreFilterOptions (  ) 

Definition at line 165 of file Wizard.php.

00166     {
00167         if (!$this->_filterStores) {
00168             #$this->_filterStores = array(''=>$this->__('Any Store'));
00169             $this->_filterStores = array();
00170             foreach (Mage::getConfig()->getNode('stores')->children() as $storeNode) {
00171                 if ($storeNode->getName()==='default') {
00172                     //continue;
00173                 }
00174                 $this->_filterStores[$storeNode->getName()] = (string)$storeNode->system->store->name;
00175             }
00176         }
00177         return $this->_filterStores;
00178     }

getValue ( key,
default = '',
defaultNew = null 
)

Definition at line 78 of file Wizard.php.

00079     {
00080         if (null !== $defaultNew) {
00081             if (0 == $this->getProfileId()) {
00082                 $default = $defaultNew;
00083             }
00084         }
00085 
00086         $value = $this->getData($key);
00087         return $this->htmlEscape(strlen($value) > 0 ? $value : $default);
00088     }

getWebsiteCollection (  ) 

Definition at line 211 of file Wizard.php.

00212     {
00213         return $this->_getStoreModel()->getWebsiteCollection();
00214     }


Member Data Documentation

$_addMapButtonHtml [protected]

Definition at line 39 of file Wizard.php.

$_attributes [protected]

Definition at line 38 of file Wizard.php.

$_removeMapButtonHtml [protected]

Definition at line 40 of file Wizard.php.

$_shortDateFormat [protected]

Definition at line 41 of file Wizard.php.

$_storeModel [protected]

Definition at line 37 of file Wizard.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:03 2009 for Magento by  doxygen 1.5.8