Example #1
0
 public function getLastNotice()
 {
     if ($this->showExtendwarePopup === false) {
         return parent::getLastNotice();
     }
     static $lastNotice = false;
     if ($lastNotice === false) {
         $lastNotice = null;
         $message = Mage::helper('ewcore/notification')->getMessage();
         if ($message) {
             $lastNotice = new Varien_Object();
             $lastNotice->setTitle($message->getSubject());
             $lastNotice->setDescription($message->getSummary());
             $lastNotice->setUrl($this->getUrl('extendware_ewcore/adminhtml_message/edit', array('id' => $message->getId())));
             $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR);
             switch ($message->getSeverity()) {
                 case 'notice':
                     $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE);
                     break;
                 case 'minor':
                     $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR);
                     break;
                 case 'major':
                     $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR);
                     break;
                 case 'critical':
                     $lastNotice->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_CRITICAL);
                     break;
             }
         }
     }
     return $lastNotice;
 }
Example #2
0
 public function __construct()
 {
     $this->types = array('category' => array('model' => 'catalog/category', 'name' => "Category", 'field' => 'name'), 'product' => array('model' => 'product', 'name' => "Product", 'field' => 'name'), 'cms_page' => array('model' => 'cms/page', 'name' => "CMS Page", 'field' => 'title'), 'static_block' => array('model' => 'cms/block', 'name' => "Static Block", 'field' => 'title'));
     foreach ($this->types as $type => $m) {
         $data = new Varien_Object();
         $data->setTitle($m['field'])->setName($type)->setModel($m['model'])->setTitleField($m['name']);
         $this->itemTypes[$type] = $data;
     }
     //	 echo '<pre>'.print_r($this->articleTypes,1); die;
     parent::__construct();
     $this->setTemplate('ves_megamenu/edit/form.phtml');
 }
Example #3
0
 public function getCollection($storeId)
 {
     $pages = parent::getCollection($storeId);
     $select = Mage::getModel('amlanding/page')->getCollection()->addFieldToFilter('is_active', 1)->getSelect()->join(array('amlanding_page_store' => $this->getTable('amlanding/page_store')), 'main_table.page_id = amlanding_page_store.page_id', array())->where('amlanding_page_store.store_id IN (?)', array($storeId));
     $query = $this->_getWriteAdapter()->query($select);
     $urlSuffix = Mage::helper('catalog/category')->getCategoryUrlSuffix($storeId);
     $urlSuffix = $urlSuffix ? $urlSuffix : '';
     while ($row = $query->fetch()) {
         $object = new Varien_Object();
         $object->setId($row['page_id']);
         $object->setUrl($row['identifier'] . $urlSuffix);
         $object->setTitle($row['title']);
         $pages[] = $object;
     }
     return $pages;
 }
Example #4
0
 /**
  * After save process
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Bundle_Model_Resource_Option
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     parent::_afterSave($object);
     $condition = array('option_id = ?' => $object->getId(), 'store_id = ? OR store_id = 0' => $object->getStoreId());
     $write = $this->_getWriteAdapter();
     $write->delete($this->getTable('bundle/option_value'), $condition);
     $data = new Varien_Object();
     $data->setOptionId($object->getId())->setStoreId($object->getStoreId())->setTitle($object->getTitle());
     $write->insert($this->getTable('bundle/option_value'), $data->getData());
     /**
      * also saving default value if this store view scope
      */
     if ($object->getStoreId()) {
         $data->setStoreId(0);
         $data->setTitle($object->getDefaultTitle());
         $write->insert($this->getTable('bundle/option_value'), $data->getData());
     }
     return $this;
 }
Example #5
0
 /**
  * After save process
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Bundle_Model_Mysql4_Option
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     parent::_afterSave($object);
     $condition = $this->_getWriteAdapter()->quoteInto('option_id = ?', $object->getId());
     $condition .= ' and (' . $this->_getWriteAdapter()->quoteInto('store_id = ?', $object->getStoreId());
     $condition .= ' or store_id = 0)';
     $this->_getWriteAdapter()->delete($this->getTable('option_value'), $condition);
     $data = new Varien_Object();
     $data->setOptionId($object->getId())->setStoreId($object->getStoreId())->setTitle($object->getTitle());
     $this->_getWriteAdapter()->insert($this->getTable('option_value'), $data->getData());
     /**
      * also saving default value if this store view scope
      */
     if ($object->getStoreId()) {
         $data->setStoreId('0');
         $data->setTitle($object->getDefaultTitle());
         $this->_getWriteAdapter()->insert($this->getTable('option_value'), $data->getData());
     }
     return $this;
 }
 protected function _createCollection($storeId)
 {
     $configOptions = $config = Mage::getConfig()->loadModulesConfiguration('system.xml')->getNode()->asArray();
     $collection = new Varien_Data_Collection();
     $requiredSections = array('weltpixel_selector', 'weltpixel_colorsettings', 'weltpixel_fontsettings', 'weltpixel_layerednavigation');
     foreach ($configOptions['sections'] as $section => $sectionOptions) {
         if (in_array($section, $requiredSections)) {
             $sectionName = $sectionOptions['label'];
             foreach ($sectionOptions['groups'] as $group => $groupOptions) {
                 $groupName = $groupOptions['label'];
                 foreach ($groupOptions['fields'] as $field => $fieldOptions) {
                     $fieldName = $fieldOptions['label'];
                     $item = new Varien_Object();
                     $item->setTitle($sectionName . '/' . $groupName . '/' . $fieldName);
                     $item->setPath(implode('/', array($section, $group, $field)));
                     $item->setValue(Mage::getStoreConfig(implode('/', array($section, $group, $field)), $storeId));
                     $collection->addItem($item);
                     unset($item);
                 }
             }
         }
     }
     $this->setItems($collection);
 }