summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorastaf <astaf@proxy.ccwn.org.ccwn.org>2013-05-15 10:25:55 +0200
committerastaf <astaf@proxy.ccwn.org.ccwn.org>2013-05-15 10:25:55 +0200
commit9de2cb93d7b70a9f015187060ee856d561023469 (patch)
tree71d546b083ab260af19b6a40adbbdab5282e71d6
parent6d5e8fa629c7453f4384bf95741fc3a93b1f472e (diff)
parent40cf298654b879f6996e41bee096798313769f68 (diff)
Merge branch 'master' of ssh://proxy:9044/home/ccwn/git-repos/admin.astaf.de
-rw-r--r--protected/controllers/MyAngebotController.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/protected/controllers/MyAngebotController.php b/protected/controllers/MyAngebotController.php
index b85846e..d0adfd2 100644
--- a/protected/controllers/MyAngebotController.php
+++ b/protected/controllers/MyAngebotController.php
@@ -77,6 +77,26 @@ class MyAngebotController extends Controller
));
}
+ /**
+ * Deletes a particular model.
+ * If deletion is successful, the browser will be redirected to the 'admin' page.
+ * @param integer $id the ID of the model to be deleted
+ */
+ public function actionDelete($id)
+ {
+ if(Yii::app()->request->isPostRequest)
+ {
+ // we only allow deletion via POST request
+ $this->loadModel($id)->delete();
+
+ // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
+ if(!isset($_GET['ajax']))
+ $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
+ }
+ else
+ throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
+ }
+
public function actionUpdate($id) {
$model = $this->loadModel($id);