Exemplo n.º 1
0
 private function _edit($id)
 {
     $data = $_POST['tag'];
     $data['id'] = $id;
     $tag = new Tagger($data);
     if (!$tag->save()) {
         Flash::set('error', __('Tag :name has not been saved. Name must be unique!', array(':name' => $tag->name)));
         redirect(get_url('plugin/tagger/edit/' . $id));
     } else {
         Flash::set('success', __('Tag :name has been saved!', array(':name' => $tag->name)));
     }
     // save and quit or save and continue editing?
     if (isset($_POST['commit'])) {
         redirect(get_url('plugin/tagger'));
     } else {
         redirect(get_url('plugin/tagger/edit/' . $id));
     }
 }