00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_GoogleBase_Block_Adminhtml_Items extends Mage_Adminhtml_Block_Widget_Grid_Container
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setTemplate('googlebase/items.phtml');
00041 }
00042
00043 protected function _prepareLayout()
00044 {
00045 $this->setChild('item', $this->getLayout()->createBlock('googlebase/adminhtml_items_item'));
00046 $this->setChild('product', $this->getLayout()->createBlock('googlebase/adminhtml_items_product'));
00047 $this->setChild('store_switcher', $this->getLayout()->createBlock('googlebase/adminhtml_store_switcher'));
00048 }
00049
00050 public function getAddButtonHtml()
00051 {
00052 $addButtonData = array(
00053 'id' => 'products_grid_button',
00054 'label' => $this->__('View Available Products'),
00055 );
00056 return $this->getLayout()
00057 ->createBlock('adminhtml/widget_button')
00058 ->setData($addButtonData)
00059 ->toHtml();
00060 }
00061
00062 public function getStoreSwitcherHtml()
00063 {
00064 return $this->getChildHtml('store_switcher');
00065 }
00066
00067 public function getCaptchaHtml()
00068 {
00069 return $this->getLayout()->createBlock('googlebase/adminhtml_captcha')
00070 ->setGbaseCaptchaToken($this->getGbaseCaptchaToken())
00071 ->setGbaseCaptchaUrl($this->getGbaseCaptchaUrl())
00072 ->toHtml();
00073 }
00074
00075 public function getStore()
00076 {
00077 return $this->_getData('store');
00078 }
00079 }