Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Adminhtml_Rss_CatalogController
  • Mage_Adminhtml_Rss_OrderController
  • Mage_Rss_Block_Abstract
  • Mage_Rss_Block_Catalog_Abstract
  • Mage_Rss_Block_Catalog_Category
  • Mage_Rss_Block_Catalog_New
  • Mage_Rss_Block_Catalog_NotifyStock
  • Mage_Rss_Block_Catalog_Review
  • Mage_Rss_Block_Catalog_Salesrule
  • Mage_Rss_Block_Catalog_Special
  • Mage_Rss_Block_Catalog_Tag
  • Mage_Rss_Block_List
  • Mage_Rss_Block_Order_Details
  • Mage_Rss_Block_Order_New
  • Mage_Rss_Block_Order_Status
  • Mage_Rss_Block_Wishlist
  • Mage_Rss_CatalogController
  • Mage_Rss_Helper_Catalog
  • Mage_Rss_Helper_Data
  • Mage_Rss_Helper_Order
  • Mage_Rss_IndexController
  • Mage_Rss_Model_Mysql4_Order
  • Mage_Rss_Model_Observer
  • Mage_Rss_Model_Resource_Order
  • Mage_Rss_Model_Rss
  • Mage_Rss_Model_Session
  • Mage_Rss_Model_System_Config_Backend_Links
  • Mage_Rss_OrderController
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Rss
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Poll index controller
 29:  *
 30:  * @file        IndexController.php
 31:  * @author      Magento Core Team <core@magentocommerce.com>
 32:  */
 33: 
 34: class Mage_Rss_IndexController extends Mage_Core_Controller_Front_Action
 35: {
 36:     /**
 37:      * Current wishlist
 38:      *
 39:      * @var Mage_Wishlist_Model_Wishlist
 40:      */
 41:     protected $_wishlist;
 42: 
 43:     /**
 44:      * Current customer
 45:      *
 46:      * @var Mage_Customer_Model_Customer
 47:      */
 48:     protected $_customer;
 49: 
 50:     /**
 51:      * Index action
 52:      */
 53:     public function indexAction()
 54:     {
 55:         if (Mage::getStoreConfig('rss/config/active')) {
 56:             $this->loadLayout();
 57:             $this->renderLayout();
 58:         } else {
 59:             $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
 60:             $this->getResponse()->setHeader('Status','404 File not found');
 61:             $this->_forward('defaultNoRoute');
 62:         }
 63:     }
 64: 
 65:     /**
 66:      * Display feed not found message
 67:      */
 68:     public function nofeedAction()
 69:     {
 70:         $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
 71:         $this->getResponse()->setHeader('Status','404 File not found');
 72:         $this->loadLayout(false);
 73:         $this->renderLayout();
 74:     }
 75: 
 76:     /**
 77:      * Wishlist rss feed action
 78:      * Show all public wishlists and private wishlists that belong to current user
 79:      *
 80:      * @return mixed
 81:      */
 82:     public function wishlistAction()
 83:     {
 84:         if (!Mage::getStoreConfig('rss/wishlist/active')) {
 85:             $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
 86:             $this->getResponse()->setHeader('Status','404 File not found');
 87:             $this->_forward('nofeed','index','rss');
 88:             return;
 89:         }
 90: 
 91:         $wishlist = $this->_getWishlist();
 92:         if (!$wishlist) {
 93:             $this->_forward('nofeed','index','rss');
 94:             return;
 95:         }
 96: 
 97:         if ($wishlist->getVisibility()) {
 98:             $this->_showWishlistRss();
 99:             return ;
100:         } else if (Mage::getSingleton('customer/session')->authenticate($this)
101:             && $wishlist->getCustomerId() == $this->_getCustomer()->getId()
102:         ) {
103:             $this->_showWishlistRss();
104:         } else {
105:             $this->_forward('nofeed','index','rss');
106:         }
107:     }
108: 
109:     /**
110:      * Show wishlist rss
111:      */
112:     protected function _showWishlistRss()
113:     {
114:         $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8');
115:         $this->loadLayout(false);
116:         $this->renderLayout();
117:     }
118: 
119:     /**
120:      * Retrieve Wishlist model
121:      *
122:      * @return Mage_Wishlist_Model_Wishlist
123:      */
124:     protected function _getWishlist()
125:     {
126:         if (is_null($this->_wishlist)) {
127:             $this->_wishlist = Mage::getModel('wishlist/wishlist');
128:             $wishlistId = $this->getRequest()->getParam('wishlist_id');
129:             if ($wishlistId) {
130:                 $this->_wishlist->load($wishlistId);
131:             } else {
132:                 if($this->_getCustomer()->getId()) {
133:                     $this->_wishlist->loadByCustomer($this->_getCustomer());
134:                 }
135:             }
136:         }
137:         return $this->_wishlist;
138:     }
139: 
140:     /**
141:      * Retrieve Customer instance
142:      *
143:      * @return Mage_Customer_Model_Customer
144:      */
145:     protected function _getCustomer()
146:     {
147:         if (is_null($this->_customer)) {
148:             $this->_customer = Mage::getModel('customer/customer');
149: 
150:             $params = Mage::helper('core')->urlDecode($this->getRequest()->getParam('data'));
151:             $data   = explode(',', $params);
152:             $customerId    = abs(intval($data[0]));
153:             if ($customerId && ($customerId == Mage::getSingleton('customer/session')->getCustomerId()) ) {
154:                 $this->_customer->load($customerId);
155:             }
156:         }
157: 
158:         return $this->_customer;
159:     }
160: }
161: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0