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_Tag_Block_All
  • Mage_Tag_Block_Customer_Recent
  • Mage_Tag_Block_Customer_Tags
  • Mage_Tag_Block_Customer_View
  • Mage_Tag_Block_Popular
  • Mage_Tag_Block_Product_List
  • Mage_Tag_Block_Product_Result
  • Mage_Tag_CustomerController
  • Mage_Tag_Helper_Data
  • Mage_Tag_IndexController
  • Mage_Tag_ListController
  • Mage_Tag_Model_Api
  • Mage_Tag_Model_Api_V2
  • Mage_Tag_Model_Entity_Customer_Collection
  • Mage_Tag_Model_Indexer_Summary
  • Mage_Tag_Model_Mysql4_Customer_Collection
  • Mage_Tag_Model_Mysql4_Indexer_Summary
  • Mage_Tag_Model_Mysql4_Popular_Collection
  • Mage_Tag_Model_Mysql4_Product_Collection
  • Mage_Tag_Model_Mysql4_Tag
  • Mage_Tag_Model_Mysql4_Tag_Collection
  • Mage_Tag_Model_Mysql4_Tag_Relation
  • Mage_Tag_Model_Resource_Customer_Collection
  • Mage_Tag_Model_Resource_Indexer_Summary
  • Mage_Tag_Model_Resource_Popular_Collection
  • Mage_Tag_Model_Resource_Product_Collection
  • Mage_Tag_Model_Resource_Tag
  • Mage_Tag_Model_Resource_Tag_Collection
  • Mage_Tag_Model_Resource_Tag_Relation
  • Mage_Tag_Model_Session
  • Mage_Tag_Model_Tag
  • Mage_Tag_Model_Tag_Relation
  • Mage_Tag_ProductController
  • 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_Tag
 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:  * Customer tags controller
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Tag
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: 
 35: class Mage_Tag_CustomerController extends Mage_Core_Controller_Front_Action
 36: {
 37:     protected function _getTagId()
 38:     {
 39:         $tagId = (int) $this->getRequest()->getParam('tagId');
 40:         if ($tagId) {
 41:             $customerId = Mage::getSingleton('customer/session')->getCustomerId();
 42:             $model = Mage::getModel('tag/tag_relation');
 43:             $model->loadByTagCustomer(null, $tagId, $customerId);
 44:             Mage::register('tagModel', $model);
 45:             return $model->getTagId();
 46:         }
 47:         return false;
 48:     }
 49: 
 50:     public function indexAction()
 51:     {
 52:         if( !Mage::getSingleton('customer/session')->isLoggedIn() ) {
 53:             Mage::getSingleton('customer/session')->authenticate($this);
 54:             return;
 55:         }
 56: 
 57:         $this->loadLayout();
 58:         $this->_initLayoutMessages('tag/session');
 59:         $this->_initLayoutMessages('catalog/session');
 60: 
 61:         $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
 62:         if ($navigationBlock) {
 63:             $navigationBlock->setActive('tag/customer');
 64:         }
 65: 
 66:         $block = $this->getLayout()->getBlock('customer_tags');
 67:         if ($block) {
 68:             $block->setRefererUrl($this->_getRefererUrl());
 69:         }
 70: 
 71:         $this->getLayout()->getBlock('head')->setTitle(Mage::helper('tag')->__('My Tags'));
 72:         $this->renderLayout();
 73:     }
 74: 
 75:     public function viewAction()
 76:     {
 77:         if( !Mage::getSingleton('customer/session')->isLoggedIn() ) {
 78:             Mage::getSingleton('customer/session')->authenticate($this);
 79:             return;
 80:         }
 81: 
 82:         $tagId = $this->_getTagId();
 83:         if ($tagId) {
 84:             Mage::register('tagId', $tagId);
 85:             $this->loadLayout();
 86:             $this->_initLayoutMessages('tag/session');
 87: 
 88:             $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
 89:             if ($navigationBlock) {
 90:                 $navigationBlock->setActive('tag/customer');
 91:             }
 92: 
 93:             $this->_initLayoutMessages('checkout/session');
 94:             $this->getLayout()->getBlock('head')->setTitle(Mage::helper('tag')->__('My Tags'));
 95:             $this->renderLayout();
 96:         }
 97:         else {
 98:             $this->_forward('noRoute');
 99:         }
100:     }
101: 
102:     /**
103:      * @deprecated after 1.3.2.3
104:      * This functionality was removed
105:      *
106:      */
107:     public function editAction()
108:     {
109:         $this->_forward('noRoute');
110:     }
111: 
112:     public function removeAction()
113:     {
114:         if( !Mage::getSingleton('customer/session')->isLoggedIn() ) {
115:             Mage::getSingleton('customer/session')->authenticate($this);
116:             return;
117:         }
118: 
119:         $tagId = $this->_getTagId();
120:         if ($tagId) {
121:             try {
122:                 $model = Mage::registry('tagModel');
123:                 $model->deactivate();
124:                 $tag = Mage::getModel('tag/tag')->load($tagId)->aggregate();
125:                 Mage::getSingleton('tag/session')->addSuccess(Mage::helper('tag')->__('The tag has been deleted.'));
126:                 $this->getResponse()->setRedirect(Mage::getUrl('*/*/', array(
127:                     self::PARAM_NAME_URL_ENCODED => Mage::helper('core')->urlEncode(Mage::getUrl('customer/account/'))
128:                 )));
129:                 return;
130:             } catch (Exception $e) {
131:                 Mage::getSingleton('tag/session')->addError(Mage::helper('tag')->__('Unable to remove tag. Please, try again later.'));
132:             }
133:         }
134:         else {
135:             $this->_forward('noRoute');
136:         }
137:     }
138: 
139:     /**
140:      * @deprecated after 1.3.2.3
141:      * This functionality was removed
142:      *
143:      */
144:     public function saveAction()
145:     {
146:         $this->_forward('noRoute');
147:     }
148: }
149: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0