]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/deletenotice.php
Only start daemons that are required, according to the site config. There is the...
[quix0rs-gnu-social.git] / actions / deletenotice.php
index d8bc5d0e0c9206816b3698f87d217bdb3e09f5dc..6c350b33ab36e3c45d278f5009f20d1259ef435c 100644 (file)
@@ -103,24 +103,18 @@ class DeletenoticeAction extends DeleteAction
 
     function showContent()
     {
-        $this->elementStart('form', array('id' => 'notice_delete_form',
+        $this->elementStart('form', array('id' => 'form_notice_delete',
+                                          'class' => 'form_settings',
                                           'method' => 'post',
                                           'action' => common_local_url('deletenotice')));
+        $this->elementStart('fieldset');
+        $this->element('legend', null, _('Delete notice'));
         $this->hidden('token', common_session_token());
         $this->hidden('notice', $this->trimmed('notice'));
-        $this->elementStart('p');
-        $this->element('span', array('id' => 'confirmation_text'),
-                       _('Are you sure you want to delete this notice?'));
-
-        $this->element('input', array('id' => 'submit_no',
-                                      'name' => 'submit',
-                                      'type' => 'submit',
-                                      'value' => _('No')));
-        $this->element('input', array('id' => 'submit_yes',
-                                      'name' => 'submit',
-                                      'type' => 'submit',
-                                      'value' => _('Yes')));
-        $this->elementEnd('p');
+        $this->element('p', null, _('Are you sure you want to delete this notice?'));
+        $this->submit('form_action-yes', _('Yes'), 'submit form_action-primary', 'yes');
+        $this->submit('form_action-no', _('No'), 'submit form_action-secondary', 'no');
+        $this->elementEnd('fieldset');
         $this->elementEnd('form');
     }
 
@@ -135,31 +129,18 @@ class DeletenoticeAction extends DeleteAction
             return;
         }
 
-        $url       = common_get_returnto();
-        $confirmed = $this->trimmed('submit');
-
-        if ($confirmed == _('Yes')) {
-
-            $replies = new Reply;
-            $replies->get('notice_id', $this->notice->id);
-
-            common_dequeue_notice($this->notice);
-
-            if (common_config('memcached', 'enabled')) {
-                $notice->blowSubsCache();
-            }
-
-            $replies->delete();
+        if ($this->arg('yes')) {
             $this->notice->delete();
+        }
 
-        } else {
+        $url = common_get_returnto();
 
-            if ($url) {
-                common_set_returnto(null);
-            } else {
-                $url = common_local_url('public');
-            }
+        if ($url) {
+            common_set_returnto(null);
+        } else {
+            $url = common_local_url('public');
         }
-        common_redirect($url);
+
+        common_redirect($url, 303);
     }
 }