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_GoogleBase_Adminhtml_Googlebase_ItemsController
  • Mage_GoogleBase_Adminhtml_Googlebase_SelectionController
  • Mage_GoogleBase_Adminhtml_Googlebase_TypesController
  • Mage_GoogleBase_Block_Adminhtml_Captcha
  • Mage_GoogleBase_Block_Adminhtml_Items
  • Mage_GoogleBase_Block_Adminhtml_Items_Item
  • Mage_GoogleBase_Block_Adminhtml_Items_Product
  • Mage_GoogleBase_Block_Adminhtml_Store_Switcher
  • Mage_GoogleBase_Block_Adminhtml_Types
  • Mage_GoogleBase_Block_Adminhtml_Types_Edit
  • Mage_GoogleBase_Block_Adminhtml_Types_Edit_Attributes
  • Mage_GoogleBase_Block_Adminhtml_Types_Edit_Form
  • Mage_GoogleBase_Block_Adminhtml_Types_Grid
  • 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_GoogleBase
 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:  * Google Base Items
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_GoogleBase
 32:  * @author     Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_GoogleBase_Block_Adminhtml_Items_Item extends Mage_Adminhtml_Block_Widget_Grid
 35: {
 36:     public function __construct()
 37:     {
 38:         parent::__construct();
 39:         $this->setId('items');
 40:         $this->setUseAjax(true);
 41:     }
 42: 
 43:     protected function _prepareCollection()
 44:     {
 45:         $collection = Mage::getResourceModel('googlebase/item_collection');
 46:         $store = $this->_getStore();
 47:         $collection->addStoreFilterId($store->getId());
 48:         $this->setCollection($collection);
 49:         parent::_prepareCollection();
 50:         return $this;
 51:     }
 52: 
 53:     protected function _prepareColumns()
 54:     {
 55:         $this->addColumn('name',
 56:             array(
 57:                 'header'    => $this->__('Product Name'),
 58:                 'width'     => '30%',
 59:                 'index'     => 'name',
 60:         ));
 61: 
 62:         $this->addColumn('gbase_item_id',
 63:             array(
 64:                 'header'    => $this->__('Google Base ID'),
 65:                 'width'     => '150px',
 66:                 'index'     => 'gbase_item_id',
 67:                 'renderer'  => 'googlebase/adminhtml_items_renderer_id',
 68: 
 69:         ));
 70: 
 71:         $this->addColumn('gbase_itemtype',
 72:             array(
 73:                 'header'    => $this->__('Google Base Item Type'),
 74:                 'width'     => '150px',
 75:                 'index'     => 'gbase_itemtype',
 76:         ));
 77: 
 78: //        $this->addColumn('published',
 79: //            array(
 80: //                'header'=> $this->__('Published'),
 81: //                'type' => 'datetime',
 82: //                'width' => '100px',
 83: //                'index'     => 'published',
 84: //        ));
 85: 
 86:         $this->addColumn('expires',
 87:             array(
 88:                 'header'    => $this->__('Expires'),
 89:                 'type'      => 'datetime',
 90:                 'width'     => '100px',
 91:                 'index'     => 'expires',
 92:         ));
 93: 
 94:         $this->addColumn('impr',
 95:             array(
 96:                 'header'    => $this->__('Impr.'),
 97:                 'width'     => '150px',
 98:                 'index'     => 'impr',
 99:                 'filter'    => false,
100:         ));
101: 
102:         $this->addColumn('clicks',
103:             array(
104:                 'header'    => $this->__('Clicks'),
105:                 'width'     => '150px',
106:                 'index'     => 'clicks',
107:                 'filter'    => false,
108:         ));
109: 
110:         $this->addColumn('active',
111:             array(
112:                 'header'    => $this->__('Active'),
113:                 'width'     => '150px',
114:                 'type'      => 'options',
115:                 'width'     => '70px',
116:                 'options'   => Mage::getSingleton('googlebase/source_statuses')->getStatuses(),
117:                 'index'     => 'is_hidden',
118:         ));
119: 
120:         return parent::_prepareColumns();
121:     }
122: 
123:     protected function _prepareMassaction()
124:     {
125:         $this->setMassactionIdField('item_id');
126:         $this->getMassactionBlock()->setFormFieldName('item');
127:         $this->setNoFilterMassactionColumn(true);
128: 
129:         $this->getMassactionBlock()->addItem('delete', array(
130:              'label'    => $this->__('Delete'),
131:              'url'      => $this->getUrl('*/*/massDelete', array('_current' => true)),
132:              'confirm'  => $this->__('Are you sure?')
133:         ));
134: 
135:         $this->getMassactionBlock()->addItem('publish', array(
136:              'label'    => $this->__('Publish'),
137:              'url'      => $this->getUrl('*/*/massPublish', array('_current' => true))
138:         ));
139: 
140:         $this->getMassactionBlock()->addItem('unpublish', array(
141:              'label'    => $this->__('Hide'),
142:              'url'      => $this->getUrl('*/*/massHide', array('_current' => true))
143:         ));
144: 
145:         $this->getMassactionBlock()->addItem('refresh', array(
146:              'label'    => $this->__('Synchronize'),
147:              'url'      => $this->getUrl('*/*/refresh', array('_current' => true)),
148:              'confirm'  => $this->__('This action will update items statistics and remove the items which are not available in Google Base. Continue?')
149:         ));
150:         return $this;
151:     }
152: 
153: //    public function getSynchronizeButtonHtml()
154: //    {
155: //        $confirmMsg = $this->__('This action will update items statistics and remove the items which are not available in Google Base. Continue?');
156: //
157: //        $refreshButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')
158: //            ->setData(array(
159: //                'label'     => $this->__('Synchronize'),
160: //                'onclick'   => "if(confirm('".$confirmMsg."'))
161: //                                {
162: //                                    setLocation('".$this->getUrl('*/*/refresh', array('_current'=>true))."');
163: //                                }",
164: //                'class'     => 'task'
165: //            ))->toHtml();
166: //
167: //        return $refreshButtonHtml;
168: //    }
169: //
170: //    public function getMainButtonsHtml()
171: //    {
172: //        return $this->getSynchronizeButtonHtml() . parent::getMainButtonsHtml();
173: //    }
174: 
175:     public function getGridUrl()
176:     {
177:         return $this->getUrl('*/*/grid', array('_current' => true));
178:     }
179: 
180:     protected function _getStore()
181:     {
182:         return Mage::app()->getStore($this->getRequest()->getParam('store'));
183:     }
184: }
185: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0