Example #1
0
 protected function _prepareCollection()
 {
     //$block_collection = Mage::getModel('cms/block')->getCollection();
     $collection = Mage::getModel('ves_tempcp/theme')->getCollection();
     // add the stores this block belongs to
     foreach ($collection as $key => $theme) {
         $stores = $theme->getResource()->lookupStoreIds($theme->getThemeId());
         $stores = implode(';', $stores);
         $theme->setStores($stores);
     }
     // end
     /* @var $collection Mage_Cms_Model_Mysql4_Block_Collection */
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Example #2
0
 protected function _prepareCollection()
 {
     //$store_collection = Mage::getModel('core/store')->getCollection();
     $store_collection = Mage::getModel('core/store')->getCollection();
     // add the stores this block belongs to
     foreach ($store_collection as $key => $store) {
         $store_group = $store->getGroup();
         $store_name = $store_group->getName() . " > " . $store->getName();
         $store->setName($store_name);
     }
     // end
     /* @var $collection Mage_Core_Model_Mysql4_Store_Collection */
     $this->setCollection($store_collection);
     return parent::_prepareCollection();
 }
Example #3
0
 protected function _prepareCollection()
 {
     $collection = Mage::getResourceModel('cms/page_collection');
     if ($current_stores = Mage::registry('current_stores')) {
         $current_stores[] = 0;
         $collection->addFilter('store', array('in' => $current_stores), 'public');
     }
     // add the stores this block belongs to
     foreach ($collection as $key => $page) {
         $stores = $page->getResource()->lookupStoreIds($page->getPageId());
         $stores = implode(';', $stores);
         $page->setStores($stores);
     }
     // end
     /* @var $collection Mage_Cms_Model_Mysql4_Block_Collection */
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
Example #4
0
 protected function _prepareCollection()
 {
     //$block_collection = Mage::getModel('cms/block')->getCollection();
     $collection = Mage::getModel('ves_tempcp/theme')->getCollection();
     if ($theme_name = Mage::registry('theme_name')) {
         $tmp_theme = explode("/", $theme_name);
         if (count($tmp_theme) == 1) {
             $theme_name = "default/" . $theme_name;
         }
         $collection->addGroupFilter($theme_name);
     }
     // add the stores this block belongs to
     foreach ($collection as $key => $theme) {
         $stores = $theme->getResource()->lookupStoreIds($theme->getThemeId());
         $stores = implode(';', $stores);
         $theme->setStores($stores);
     }
     // end
     /* @var $collection Mage_Cms_Model_Mysql4_Block_Collection */
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }