public function init() { parent::init(); $this->setTitle('Edit Page'); $this->submit->setLabel('Edit Page'); }
public function addPageAction() { $this->view->form = $form = new SocialConnect_Form_Admin_CreatePage(); // Output $this->renderScript('admin-settings/form.tpl'); if (!$this->getRequest()->isPost()) { return; } if (!$form->isValid($this->getRequest()->getPost())) { return; } $success = FALSE; $values = array_merge($form->getValues(), array('created_date' => date('Y-m-d H:i:s'))); $db = Engine_Api::_()->getDbTable('pages', 'socialConnect')->getAdapter(); $db->beginTransaction(); try { $table = Engine_Api::_()->getDbtable('pages', 'socialConnect'); $page = $table->createRow(); $page->setFromArray($values); $page->save(); $success = TRUE; } catch (Exception $e) { $db->rollBack(); throw $e; } $db->commit(); $this->_forward('success', 'utility', 'core', array('smoothboxClose' => 10, 'parentRefresh' => 10, 'messages' => array(''))); }