Changeset 9858
- Timestamp:
- Jan 3, 2009, 4:27:55 PM (14 years ago)
- Location:
- OpenPNE3/plugins/opDiaryPlugin/trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/plugins/opDiaryPlugin/trunk/lib/action/opDiaryPluginDiaryActions.class.php
r9856 r9858 72 72 { 73 73 $this->form = new DiaryForm(); 74 $this->form->getObject()->setMemberId($this->getUser()->getMemberId()); 74 75 $this->processForm($request, $this->form); 75 76 $this->setTemplate('new'); … … 90 91 $this->processForm($request, $this->form); 91 92 $this->setTemplate('edit'); 92 }93 94 protected function processForm(sfWebRequest $request, sfForm $form)95 {96 $params = $request->getParameter('diary');97 $params['member_id'] = $this->getUser()->getMemberId();98 $this->form->bind($params, $request->getFiles('diary'));99 100 if ($this->form->isValid())101 {102 $diary = $this->form->save();103 104 $this->redirect($this->generateUrl('diary_show', $diary));105 }106 93 } 107 94 … … 147 134 } 148 135 136 protected function processForm(sfWebRequest $request, sfForm $form) 137 { 138 $form->bind( 139 $request->getParameter($form->getName()), 140 $request->getFiles($form->getName()) 141 ); 142 143 if ($form->isValid()) 144 { 145 $diary = $form->save(); 146 147 $this->redirect($this->generateUrl('diary_show', $diary)); 148 } 149 } 150 149 151 protected function isAuthor() 150 152 { -
OpenPNE3/plugins/opDiaryPlugin/trunk/lib/form/DiaryForm.class.php
r9852 r9858 12 12 public function configure() 13 13 { 14 unset($this->widgetSchema['member_id']); 15 $this->widgetSchema['title'] = new sfWidgetFormInput(); 16 14 unset($this['member_id']); 17 15 unset($this['created_at']); 18 16 unset($this['updated_at']); 17 18 $this->widgetSchema['title'] = new sfWidgetFormInput(); 19 19 20 20 $this->widgetSchema['public_flag'] = new sfWidgetFormChoice(array(
Note: See TracChangeset
for help on using the changeset viewer.