Tuesday, 29 August 2017

94.social engine smooth box deletion

user/views/scripts/admin-manage/tipdelete.tpl  
<?php echo $this->form->setAttrib('class', 'global_form_popup')->render($this) ?>
 
listpage
 <td> <a class='smoothbox'  href='<?php echo $this->url(array('action' => 'tipdelete', 'id' => $item['id']));?>'>
                  <?php echo $this->translate("delete") ?>
                </a></td>
   controller
 
         public function tipdeleteAction()
    {
    $id = $this->_getParam('id', null);
    $this->view->form = $form = new User_Form_Admin_Manage_Deleteitem();
    if( $this->getRequest()->isPost() ) {
   
      try {
       
         Engine_Db_Table::getDefaultAdapter()->delete('engine4_tips', array('id = ?'=>$id) );
       
     
      } catch( Exception $e ) {
        throw $e;
      }
     
      return $this->_forward('success', 'utility', 'core', array(
        'smoothboxClose' => true,
        'parentRefresh' => true,
        'format'=> 'smoothbox',
        'messages' => array('Tip has been successfully deleted.')
      ));
     
     }

    }    

No comments:

Post a Comment