예제 #1
0
 public function saveAction()
 {
     $this->model->bind($this->Request);
     $form = new FeedForm('Feed');
     $form->initFromModel($this->model);
     if ($form->validate()) {
         if ($this->model->save()) {
             $this->Router->redirect('index', 'Feed', $this->language['redirect']['element_saved'], CoreView::MESSAGE_TYPE_SUCCESS);
         } else {
             $this->Router->redirect('index', 'Feed', $this->language['redirect']['element_not_saved'], CoreView::MESSAGE_TYPE_ERROR);
         }
     } else {
         $params = array_merge(array('id' => $this->model->id, 'errors' => $form->getErrors()));
         $this->Router->redirect('add', 'Feed', $this->language['redirect']['element_not_saved'], CoreView::MESSAGE_TYPE_ERROR, $params);
     }
     exit;
 }
예제 #2
0
}
?>

<a href="#" id="add-format-open">Add new format</a>

<div id="add-format" style="display: none;">
<h3>Add new format</h3>
  <div class="form-wrapper open">
  <form action="<?php 
echo url_for('podcast_feed/add');
?>
" method="POST" enctype="multipart/form-data" class=".form_feed">
  <table>
    <?php 
// todo move to action
$fform = new FeedForm();
$fform->setDefault('podcast_id', $episode->getPodcastId());
?>
    <?php 
include_partial('podcast_feed/feedform', array('form' => $fform));
?>
    <tr>
    <td>&nbsp;</td>
    <td>
        <input type="submit" value="Save"/>
    </td>
    <td>

    </td>
    </tr>