]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Moving form to its own file as we do nowadays
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 25 Apr 2017 19:11:49 +0000 (21:11 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 25 Apr 2017 19:13:29 +0000 (21:13 +0200)
plugins/Blacklist/actions/blacklistadminpanel.php
plugins/Blacklist/forms/blacklistadminpanel.php [new file with mode: 0644]

index ee1c2138b8b46ccaa228e8ca29c25cca862d2202..43cba3e2cef46b4bd6916fec28bf89e79a2132fe 100644 (file)
@@ -27,9 +27,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Administer blacklist
@@ -118,94 +116,3 @@ class BlacklistadminpanelAction extends AdminPanelAction
         return true;
     }
 }
-
-/**
- * Admin panel form for blacklist panel
- *
- * @category Admin
- * @package  StatusNet
- * @author   Evan Prodromou <evan@status.net>
- * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
- * @link     http://status.net/
- */
-class BlacklistAdminPanelForm extends Form
-{
-    /**
-     * ID of the form
-     *
-     * @return string ID
-     */
-    function id()
-    {
-        return 'blacklistadminpanel';
-    }
-
-    /**
-     * Class of the form
-     *
-     * @return string class
-     */
-    function formClass()
-    {
-        return 'form_settings';
-    }
-
-    /**
-     * Action we post to
-     *
-     * @return string action URL
-     */
-    function action()
-    {
-        return common_local_url('blacklistadminpanel');
-    }
-
-    /**
-     * Show the form controls
-     *
-     * @return void
-     */
-    function formData()
-    {
-        $this->out->elementStart('ul', 'form_data');
-
-        $this->out->elementStart('li');
-
-        $nickPatterns = Nickname_blacklist::getPatterns();
-
-        // TRANS: Field label in blacklist plugin administration panel.
-        $this->out->textarea('blacklist-nicknames', _m('Nicknames'),
-                             implode("\r\n", $nickPatterns),
-                             // TRANS: Field title in blacklist plugin administration panel.
-                             _m('Patterns of nicknames to block, one per line.'));
-        $this->out->elementEnd('li');
-
-        $urlPatterns = Homepage_blacklist::getPatterns();
-
-        $this->out->elementStart('li');
-        // TRANS: Field label in blacklist plugin administration panel.
-        $this->out->textarea('blacklist-urls', _m('URLs'),
-                             implode("\r\n", $urlPatterns),
-                             // TRANS: Field title in blacklist plugin administration panel.
-                             _m('Patterns of URLs to block, one per line.'));
-        $this->out->elementEnd('li');
-
-        $this->out->elementEnd('ul');
-    }
-
-    /**
-     * Buttons for submitting
-     *
-     * @return void
-     */
-    function formActions()
-    {
-        $this->out->submit('submit',
-                           // TRANS: Button text in blacklist plugin administration panel to save settings.
-                           _m('BUTTON','Save'),
-                           'submit',
-                           null,
-                           // TRANS: Button title in blacklist plugin administration panel to save settings.
-                           _m('Save site settings.'));
-    }
-}
diff --git a/plugins/Blacklist/forms/blacklistadminpanel.php b/plugins/Blacklist/forms/blacklistadminpanel.php
new file mode 100644 (file)
index 0000000..3153ddb
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+
+if (!defined('GNUSOCIAL')) { exit(1); }
+
+/**
+ * Admin panel form for blacklist panel
+ *
+ * @category Admin
+ * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
+ * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
+ * @link     http://status.net/
+ */
+class BlacklistAdminPanelForm extends Form
+{
+    /**
+     * ID of the form
+     *
+     * @return string ID
+     */
+    function id()
+    {
+        return 'blacklistadminpanel';
+    }
+
+    /**
+     * Class of the form
+     *
+     * @return string class
+     */
+    function formClass()
+    {
+        return 'form_settings';
+    }
+
+    /**
+     * Action we post to
+     *
+     * @return string action URL
+     */
+    function action()
+    {
+        return common_local_url('blacklistadminpanel');
+    }
+
+    /**
+     * Show the form controls
+     *
+     * @return void
+     */
+    function formData()
+    {
+        $this->out->elementStart('ul', 'form_data');
+
+        $this->out->elementStart('li');
+
+        $nickPatterns = Nickname_blacklist::getPatterns();
+
+        // TRANS: Field label in blacklist plugin administration panel.
+        $this->out->textarea('blacklist-nicknames', _m('Nicknames'),
+                             implode("\r\n", $nickPatterns),
+                             // TRANS: Field title in blacklist plugin administration panel.
+                             _m('Patterns of nicknames to block, one per line.'));
+        $this->out->elementEnd('li');
+
+        $urlPatterns = Homepage_blacklist::getPatterns();
+
+        $this->out->elementStart('li');
+        // TRANS: Field label in blacklist plugin administration panel.
+        $this->out->textarea('blacklist-urls', _m('URLs'),
+                             implode("\r\n", $urlPatterns),
+                             // TRANS: Field title in blacklist plugin administration panel.
+                             _m('Patterns of URLs to block, one per line.'));
+        $this->out->elementEnd('li');
+
+        $this->out->elementEnd('ul');
+    }
+
+    /**
+     * Buttons for submitting
+     *
+     * @return void
+     */
+    function formActions()
+    {
+        $this->out->submit('submit',
+                           // TRANS: Button text in blacklist plugin administration panel to save settings.
+                           _m('BUTTON','Save'),
+                           'submit',
+                           null,
+                           // TRANS: Button title in blacklist plugin administration panel to save settings.
+                           _m('Save site settings.'));
+    }
+}