Proto__

//controllers/Adminhtml/AdminformController.php

May 18th, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. <?php
  2. //controllers/Adminhtml/AdminformController.php
  3.  
  4. class Turnkeye_Adminform_Adminhtml_AdminformController extends Mage_Adminhtml_Controller_Action
  5. {
  6.  
  7.      /**
  8.      * View form action
  9.      */
  10.     public function indexAction()
  11.     {
  12.  
  13.         $this->_registryObject();
  14.         $this->loadLayout();
  15.         $this->_setActiveMenu('turnkeye/form');
  16.         $this->_addBreadcrumb(Mage::helper('turnkeye_adminform')->__('Form'), Mage::helper('turnkeye_adminform')->__('Form'));
  17.         $this->renderLayout();
  18.     }
  19.  
  20.     /**
  21.      * Grid Action
  22.      * Display list of products related to current category
  23.      *
  24.      * @return void
  25.      */
  26.     public function gridAction()
  27.     {
  28.         $this->_registryObject();
  29.         $this->getResponse()->setBody(
  30.             $this->getLayout()->createBlock('turnkeye_adminform/adminhtml_form_edit_tab_product')
  31.                 ->toHtml()
  32.         );
  33.     }
  34.  
  35.     /**
  36.      * Grid Action
  37.      * Display list of products related to current category
  38.      *
  39.      * @return void
  40.      */
  41.     public function saveAction()
  42.     {
  43.        
  44.    
  45.         $example = Mage::getModel('turnkeye_adminform/iaso');
  46.                 $example->setTitle('Code Post!');
  47.                 //$example->setPost('This post was created from code!');
  48.                 $example->save();
  49.                 echo 'post created';
  50.    
  51.  
  52.  
  53.        
  54.         /*
  55.         $output  = "<pre>Full Data:\n";
  56.         $output .= print_r($this->getRequest()->getParams(), 1);
  57.         $products = Mage::helper('adminhtml/js')->decodeGridSerializedInput($this->getRequest()->getParam('products'));
  58.         $output .= "\nProducts:\n";
  59.         $output .= print_r($products, 1);
  60.         $output .= "</pre>";
  61.         $this->getResponse()->setBody($output);
  62.        
  63.     */
  64.  
  65.     }
  66.  
  67.     /**
  68.      * registry form object
  69.      */
  70.     protected function _registryObject()
  71.     {
  72. //        Mage::register('turnkeye_adminform', Mage::getModel('turnkeye_adminform/form'));
  73.     }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment