示例#1
0
 /**
  * Init Website Store Elements
  *
  * @param Varien_Data_Form $form
  * @param Mage_Core_Model_Website $masterWebsite
  * @param Mage_Core_Model_Website $stagingWebsite
  * @return Enterprise_Staging_Block_Manage_Staging_Edit_Tabs_Website
  */
 protected function _initWebsiteStore($form, $masterWebsite, $stagingWebsite = null)
 {
     if (empty($masterWebsite)) {
         return $this;
     }
     if ($stagingWebsite) {
         $fieldset = $form->addFieldset('staging_website_stores', array('legend' => Mage::helper('enterprise_staging')->__('Store Views to Copy')));
     } else {
         $fieldset = $form->addFieldset('staging_website_stores', array('legend' => Mage::helper('enterprise_staging')->__('Select Original Website Store Views to be Copied to Staging Website')));
     }
     if ($stagingWebsite) {
         $_storeGroups = $stagingWebsite->getGroups();
         $_storeGroupsCount = $stagingWebsite->getGroupsCount();
     } else {
         $_storeGroups = $masterWebsite->getGroups();
         $_storeGroupsCount = $masterWebsite->getGroupsCount();
     }
     $noStores = true;
     foreach ($_storeGroups as $group) {
         if ($group->getStoresCount()) {
             $noStores = false;
             $_stores = $group->getStores();
             $this->_initStoreGroup($fieldset, $group, $stagingWebsite);
             foreach ($_stores as $storeView) {
                 $this->_initStoreView($fieldset, $storeView, $stagingWebsite);
             }
         }
     }
     if ($noStores) {
         if ($stagingWebsite) {
             $fieldset->addField('staging_no_stores', 'label', array('label' => Mage::helper('enterprise_staging')->__('There are no store views to be copied.')));
         } else {
             $fieldset->addField('staging_no_stores', 'label', array('label' => Mage::helper('enterprise_staging')->__('There are no store views for copying.')));
         }
     }
     return $this;
 }
示例#2
0
 public function testGetGroupsCount()
 {
     $this->assertEquals(1, $this->_model->getGroupsCount());
 }