Alex Trofimov 12 anni fa
parent
commit
8414dac113

+ 30 - 3
inc/classes/BxDolForm.php

@@ -722,6 +722,8 @@ class BxDolForm extends BxDol {
     static $TYPES_TEXT = array('text' => 1, 'textarea' => 1);
     static $TYPES_FILE = array('file' => 1);
 
+    protected $_aMarkers = array ();
+
     var $oTemplate;
 
     var $_isValid = true;
@@ -731,7 +733,7 @@ class BxDolForm extends BxDol {
     var $aFormAttrs;
     var $aTableAttrs;
     var $aInputs;
-    var $aParams;    
+    var $aParams;
 
     var $id; ///< Form element id    
 
@@ -891,6 +893,10 @@ class BxDolForm extends BxDol {
         return BxDolForm::getSubmittedValue($this->aParams['db']['submit_name'], $this->aFormAttrs['method'], $this->_aSpecificValues) ? true : false;
     }
 
+    function getId () {
+        return $this->id;
+    }
+
     function setId ($sId) {
     	$this->id = $sId;
     	$this->aFormAttrs['id'] = $sId;
@@ -1033,7 +1039,28 @@ class BxDolForm extends BxDol {
     }
 
     protected function _genMethodName ($s) {
-        return str_replace(' ', '', ucwords(str_replace('_' , ' ', $s)));
+        return bx_gen_method_name($s);
+    }
+
+    /**
+     * Add replace markers. Curently markers are replaced in action, form_attrs fields.
+     * @param $a array of markers as key => value
+     * @return true on success or false on error
+     */
+    public function addMarkers ($a) {
+        if (empty($a) || !is_array($a))
+            return false;
+        $this->_aMarkers = array_merge ($this->_aMarkers, $a);
+        return true;
+    }
+
+    /**
+     * Replace provided markers in form array
+     * @param $a form description array
+     * @return array where markes are replaced with real values
+     */ 
+    protected function _replaceMarkers ($a) {
+        return bx_replace_markers($a, $this->_aMarkers);
     }
 }
 
@@ -1101,7 +1128,7 @@ class BxDolFormChecker {
                 continue;
             }
 
-            $sCheckFunction = array($oChecker, 'check'.ucfirst($a['checker']['func']));
+            $sCheckFunction = array($oChecker, 'check' . bx_gen_method_name($a['checker']['func']));
 
             if (is_callable($sCheckFunction))
                 $bool = call_user_func_array ($sCheckFunction, !empty($a['checker']['params']) ? array_merge(array($val), $a['checker']['params']) : array ($val));

+ 10 - 1
inc/utils.inc.php

@@ -199,7 +199,7 @@ function bx_process_output ($mixedData, $iDataType = BX_DATA_TEXT, $mixedParams
     case BX_DATA_DATE_TS:
         return empty($mixedData) ? '' : date("Y-m-d", $mixedData);
     case BX_DATA_DATETIME_TS:
-        return empty($mixedData) ? '' : date("Y-m-d H:i:s", $mixedData);
+        return empty($mixedData) ? '' : date("Y-m-d H:i", $mixedData);
 
     case BX_DATA_HTML:
         return $mixedData;
@@ -1028,5 +1028,14 @@ function bx_site_hash($sSalt = '', $isSkipVersion = false) {
     return md5($sSalt . ($isSkipVersion ? '' : getParam('sys_version')) . BX_DOL_SECRET . BX_DOL_URL_ROOT);
 }
 
+/**
+ * Transform string to method name string, for example it changes 'some_method' string to 'SomeMethod' string
+ * @param string where words are separated with underscore
+ * @return string where every word begins with capital letter
+ */
+function bx_gen_method_name ($s) {
+    return str_replace(' ', '', ucwords(str_replace('_' , ' ', $s)));
+}
+
 /** @} */ 
 

+ 66 - 91
modules/boonex/antispam/classes/BxAntispamGridIpTable.php

@@ -38,96 +38,72 @@ class BxAntispamGridIpTable extends BxTemplGrid
      */
     public function performActionAdd() 
     {
-        $sAction = 'add';
-
-        $aForm = array(
-            'form_attrs' => array(
-                'id' => 'sample-add-form',    
-                'action' => 'grid.php?o=' . $this->_sObject . '&a=' . $sAction, // grid.php is usiversal actions handler file, we need to pass object and action names to it at least
-                'method' => 'post',
-            ),
-            'params' => array (
-                'db' => array(
-                    'table' => 'sample_grid_data', 
-                    'key' => 'ID', 
-                    'submit_name' => 'do_submit',
-                ),
-            ),
-            'inputs' => array(
-                'NickName' => array(
-                    'type' => 'text',
-                    'name' => 'NickName',
-                    'caption' => _t('Username'),
-                    'required' => true,
-                    'checker' => array(
-                        'func' => 'length',
-                        'params' => array(1, 150),
-                        'error' => _t( 'Username is required' )
-                    ),                    
-                    'db' => array (
-                        'pass' => 'Xss',  
-                    ),
-                ),
-                'Email' => array(
-                    'type' => 'text',
-                    'name' => 'Email',
-                    'caption' => _t('Email'),
-                    'required' => true,
-                    'checker' => array(
-                        'func' => 'email',
-                        'error' => _t( '_Incorrect Email' )
-                    ),
-                    'db' => array (
-                        'pass' => 'Xss',  
-                    ),
-                ),
-                'City' => array(
-                    'type' => 'text',
-                    'name' => 'City',
-                    'caption' => _t('City'),
-                    'required' => true,
-                    'checker' => array(
-                        'func' => 'length',
-                        'params' => array(1, 150),
-                        'error' => _t( 'City is required' )
-                    ),
-                    'db' => array (
-                        'pass' => 'Xss',  
-                    ),
-                ),
-
-                'submit' => array(
-                    'type' => 'input_set',
-                    0 => array (
-                        'type' => 'submit',
-                        'name' => 'do_submit',
-                        'value' => _t('_Submit'),
-                    ),
-                    1 => array (
-                        'type' => 'reset',
-                        'name' => 'close',
-                        'value' => _t('Close'),
-                        'attrs' => array(
-                            'onclick' => "$('.dolPopup:visible').dolPopupHide()",
-                            'class' => 'bx-def-margin-sec-left',
-                        ),
-                    ),
-                ),
-
-            ),
-        );
+        $this->_performAction('add', 'bx_antispam_ip_table_form_add');
+    }
 
-        bx_import('BxTemplFormView');
-        $oForm = new BxTemplFormView($aForm);
-        $oForm->initChecker();
+    /**
+     * 'edit' action handler
+     */
+    public function performActionEdit() 
+    {
+        $iId = 0;
+        $aIds = bx_get('ids');
+        if ($aIds && is_array($aIds))
+            $iId = (int)array_pop($aIds);
+        if (!$iId)
+            $iId = (int)bx_get('ID');
+
+        if (!$iId) {
+            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            exit;
+        }
+
+        $this->_performAction('edit', 'bx_antispam_ip_table_form_edit', $iId);
+    }
+
+    protected function _performAction($sAction, $sDisplay, $iId = 0)
+    {
+        bx_import('BxDolForm');
+        $oForm = BxDolForm::getObjectInstance('bx_antispam_ip_table_form', $sDisplay); // get form instance for specified form object and display
+        if (!$oForm) {
+            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            exit;
+        }
+
+        $oForm->addMarkers(array(
+            'grid_object' => $this->_sObject,
+            'grid_action' => $sAction,
+        ));
+
+        $aIpTableDirective = array();
+        if ($iId) {
+            bx_import('BxDolModule');
+            $oModule = BxDolModule::getInstance('bx_antispam');
+            $oAntispamIp = bx_instance('BxAntispamIP', array(), $oModule->_aModule);
+            $aIpTableDirective = $oAntispamIp->getIpTableDirective($iId);
+            $aIpTableDirective['From'] = long2ip($aIpTableDirective['From']);
+            $aIpTableDirective['To'] = long2ip($aIpTableDirective['To']);
+        }
+        $oForm->initChecker($aIpTableDirective);
+
+        if ($oForm->isSubmittedAndValid()) { // if form is submitted and all fields are valid            
+
+            $aCustomValues = array(
+                'From' => sprintf("%u", ip2long($oForm->getCleanValue('From'))),
+                'To' => sprintf("%u", ip2long($oForm->getCleanValue('To'))),
+            );
 
-        if ($oForm->isSubmittedAndValid()) { // if form is submitted and all fields are valid
+            if ($iId) {
+                if ($oForm->update ($iId, $aCustomValues)) // update record
+                    $iRecentId = $iId;
+            } else {
+                $iRecentId = $oForm->insert ($aCustomValues, true); // insert new record
+            }
 
-            $iNewId = $oForm->insert (array(), true); // insert record to database
-            if ($iNewId)
-                $aRes = array('grid' => $this->getCode(true), 'blink' => $iNewId); // if record is successfully added, reload grid and highlight added row
+            if ($iRecentId)
+                $aRes = array('grid' => $this->getCode(true), 'blink' => $iRecentId); // if record is successfully added, reload grid and highlight added row
             else
-                $aRes = array('msg' => "Error occured"); // if record adding failed, display error message
+                $aRes = array('msg' => _t('_sys_txt_error_occured')); // if record adding failed, display error message
 
             $this->_echoResultJson($aRes, true);
 
@@ -135,17 +111,16 @@ class BxAntispamGridIpTable extends BxTemplGrid
 
             bx_import('BxTemplFunctions');
             // we need to use 'transBox' function to properly display 'popup'
-            $s = BxTemplFunctions::getInstance()->transBox('', '
-                <div class="bx-def-padding-top bx-def-padding-left bx-def-padding-right bx-def-color-bg-block" style="width:300px;">' . $oForm->getCode() . '</div>
+            $s = BxTemplFunctions::getInstance()->popupBox($oForm->getId() . '_form', _t('_bx_antispam_form_ip_table_add'), $oForm->getCode() . '
                 <script>
                     $(document).ready(function () {
-                        $("#sample-add-form").ajaxForm({ 
+                        $("#' . $oForm->getId() . '").ajaxForm({ 
                             dataType: "json",
                             beforeSubmit: function (formData, jqForm, options) {
-                                bx_loading($("#' . $aForm['form_attrs']['id'] . '"), true);
+                                bx_loading($("#' . $oForm->getId() . '"), true);
                             },
                             success: function (data) {
-                                $(".dolPopup:visible").dolPopupHide();
+                                $(".bx-popup-applied:visible").dolPopupHide();
                                 glGrids.' . $this->_sObject . '.processJson(data, "' . $sAction . '");
                             }
                         });

+ 13 - 0
modules/boonex/antispam/classes/BxAntispamIP.php

@@ -96,6 +96,19 @@ class BxAntispamIP extends BxDol
         return false;
     }
 
+    /**
+     * Get IP table direcitve by ID
+     *
+     * @param $sId 
+     * @return array with IP table directive data
+     */
+    public function getIpTableDirective($iId)
+    {
+        $oDb = BxDolDb::getInstance();
+        $sQuery = $oDb->prepare("SELECT * FROM `bx_antispam_ip_table` WHERE `ID` = ? LIMIT 1", $iId);
+        return $oDb->getRow($sQuery);
+    }
+
     /**
      * Clean up expired entries
      * TODO: add to cron

+ 20 - 8
modules/boonex/antispam/install/langs/en.xml

@@ -17,17 +17,29 @@
 
 	<string name="_bx_antispam_page_block_title_ip_table"><![CDATA[IP table]]></string>
 
-	<string name="_bx_antispam_grid_field_select"><![CDATA[Select]]></string>
-	<string name="_bx_antispam_grid_field_ip_from"><![CDATA[IP from]]></string>
-	<string name="_bx_antispam_grid_field_ip_to"><![CDATA[IP to]]></string>
-	<string name="_bx_antispam_grid_title_action"><![CDATA[Action]]></string>
-	<string name="_bx_antispam_grid_title_expiration"><![CDATA[Expiration]]></string>
-	<string name="_bx_antispam_grid_title_note"><![CDATA[Note]]></string>
-	<string name="_bx_antispam_grid_title_actions"><![CDATA[Actions]]></string>
-
 	<string name="_bx_antispam_grid_action_delete"><![CDATA[Delete]]></string>
 	<string name="_bx_antispam_grid_action_add"><![CDATA[Add]]></string>
 
+	<string name="_bx_antispam_grid_title_select"><![CDATA[Select]]></string>
+	<string name="_bx_antispam_grid_title_actions"><![CDATA[Actions]]></string>
+
+	<string name="_bx_antispam_field_id"><![CDATA[ID]]></string>
+	<string name="_bx_antispam_field_ip_from"><![CDATA[IP from]]></string>
+	<string name="_bx_antispam_field_ip_to"><![CDATA[IP to]]></string>
+	<string name="_bx_antispam_field_action"><![CDATA[Action]]></string>
+	<string name="_bx_antispam_field_expiration"><![CDATA[Expiration]]></string>
+	<string name="_bx_antispam_field_note"><![CDATA[Note]]></string>
+
+    <string name="_bx_antispam_form_ip_table"><![CDATA[IP table directive]]></string>
+    <string name="_bx_antispam_form_ip_table_add"><![CDATA[Add IP table directive]]></string>
+    <string name="_bx_antispam_form_ip_table_edit"><![CDATA[Edit IP table directive]]></string>
+    <string name="_bx_antispam_form_buttons"><![CDATA[Form buttons]]></string>
+
+    <string name="_bx_antispam_field_ip_err_msg"><![CDATA[Please enter correct IP address, for example 192.168.4.5]]></string>
+    <string name="_bx_antispam_field_expiration_err_msg"><![CDATA[Please enter correct date time value]]></string>
+
+    <string name="_bx_antispam_data_list_ip_table_actions"><![CDATA[IP table actions]]></string>
+
 	<string name="_bx_antispam_option_block"><![CDATA[Total block all spam content]]></string>
 	<string name="_bx_antispam_option_report"><![CDATA[Send report to admin if spam content discovered]]></string>
 	<string name="_bx_antispam_option_ip_list_type"><![CDATA[IP List Type (1 - all allowed except listed, 2 - all blocked except listed, 0 - disabled)]]></string>

+ 13 - 0
modules/boonex/antispam/install/sql/disable.sql

@@ -14,3 +14,16 @@ DELETE FROM `sys_objects_grid` WHERE `object` = 'bx_antispam_grid_ip_table';
 DELETE FROM `sys_grid_fields` WHERE `object` = 'bx_antispam_grid_ip_table';
 DELETE FROM `sys_grid_actions` WHERE `object` = 'bx_antispam_grid_ip_table';
 
+-- data list: ip table actions
+
+DELETE FROM `sys_form_pre_lists` WHERE `key` = 'bx_antispam_ip_table_actions';
+DELETE FROM `sys_form_pre_values` WHERE `Key` = 'bx_antispam_ip_table_actions';
+
+-- form: IP table add/edit
+
+DELETE FROM `sys_objects_form` WHERE `object`='bx_antispam_ip_table_form';
+DELETE FROM `sys_form_displays` WHERE `object`='bx_antispam_ip_table_form';
+DELETE FROM `sys_form_inputs` WHERE `object`='bx_antispam_ip_table_form';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name`='bx_antispam_ip_table_form_add';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name`='bx_antispam_ip_table_form_edit';
+

+ 56 - 6
modules/boonex/antispam/install/sql/enable.sql

@@ -39,12 +39,12 @@ INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `fie
 ('bx_antispam_grid_ip_table', 'Sql', 'SELECT `ID`, `From`, `To`, `Type`, `LastDT`, `Desc` FROM `bx_antispam_ip_table`', 'bx_antispam_ip_table', 'ID', '', '', 10, NULL, 'start', '', 'From,To,Desc', 'auto', 'From,To,Type,LastDT,Desc', 64, 'BxAntispamGridIpTable', 'modules/boonex/antispam/classes/BxAntispamGridIpTable.php');
 
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
-('bx_antispam_grid_ip_table', 'checkbox', '_bx_antispam_grid_field_select', '2%', '', 1),
-('bx_antispam_grid_ip_table', 'From', '_bx_antispam_grid_field_ip_from', '15%', '', 2),
-('bx_antispam_grid_ip_table', 'To', '_bx_antispam_grid_field_ip_to', '15%', '', 3),
-('bx_antispam_grid_ip_table', 'Type', '_bx_antispam_grid_title_action', '15%', '', 4),
-('bx_antispam_grid_ip_table', 'LastDT', '_bx_antispam_grid_title_expiration', '15%', '', 5),
-('bx_antispam_grid_ip_table', 'Desc', '_bx_antispam_grid_title_note', '26%', '', 6),
+('bx_antispam_grid_ip_table', 'checkbox', '_bx_antispam_grid_title_select', '2%', '', 1),
+('bx_antispam_grid_ip_table', 'From', '_bx_antispam_field_ip_from', '15%', '', 2),
+('bx_antispam_grid_ip_table', 'To', '_bx_antispam_field_ip_to', '15%', '', 3),
+('bx_antispam_grid_ip_table', 'Type', '_bx_antispam_field_action', '15%', '', 4),
+('bx_antispam_grid_ip_table', 'LastDT', '_bx_antispam_field_expiration', '15%', '', 5),
+('bx_antispam_grid_ip_table', 'Desc', '_bx_antispam_field_note', '26%', '', 6),
 ('bx_antispam_grid_ip_table', 'actions', '_bx_antispam_grid_title_actions', '12%', '', 7);
 
 INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
@@ -53,3 +53,53 @@ INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `conf
 ('bx_antispam_grid_ip_table', 'single', 'delete', '', 'remove',  1, 2),
 ('bx_antispam_grid_ip_table', 'independent', 'add', '_bx_antispam_grid_action_add', '', 0, 1);
 
+-- data list: ip table actions
+
+INSERT INTO `sys_form_pre_lists`(`module`, `key`, `title`, `use_for_sets`) VALUES 
+('bx_antispam', 'bx_antispam_ip_table_actions', '_bx_antispam_data_list_ip_table_actions', 0);
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `LKey`, `LKey2`, `Order`) VALUES 
+('bx_antispam_ip_table_actions', 'allow', '_bx_antispam_ip_allow', '', 0),
+('bx_antispam_ip_table_actions', 'deny', '_bx_antispam_ip_deny', '', 0);
+
+-- form: IP table add/edit
+
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam', '_bx_antispam_form_ip_table', 'grid.php?o={grid_object}&a={grid_action}', '', 'bx_antispam_ip_table', 'ID', '', '', 'bx_antispam_ip_table_submit', '', 0, 1, '', '');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam_ip_table_form_add', 'bx_antispam', 0, '_bx_antispam_form_ip_table_add'),
+('bx_antispam_ip_table_form', 'bx_antispam_ip_table_form_edit', 'bx_antispam', 0, '_bx_antispam_form_ip_table_edit');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_antispam_ip_table_form', 'bx_antispam', 'ID', '', '', 0, 'hidden', '_bx_antispam_field_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'From', '', '', 0, 'text', '_bx_antispam_field_ip_from', '_bx_antispam_field_ip_from', '', 1, 0, 0, '', '', '', 'preg', 'a:1:{s:4:\"preg\";s:20:\"#\d+\.\d+\.\d+\.\d+#\";}', '_bx_antispam_field_ip_err_msg', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'To', '', '', 0, 'text', '_bx_antispam_field_ip_to', '_bx_antispam_field_ip_to', '', 1, 0, 0, '', '', '', 'preg', 'a:1:{s:4:\"preg\";s:20:\"#\d+\.\d+\.\d+\.\d+#\";}', '_bx_antispam_field_ip_err_msg', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'Type', 'allow', '#!bx_antispam_ip_table_actions', 0, 'select', '_bx_antispam_field_action', '_bx_antispam_field_action', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'LastDT', '', '', 0, 'datetime', '_bx_antispam_field_expiration', '_bx_antispam_field_expiration', '', 1, 0, 0, '', '', '', 'date_time', '', '_bx_antispam_field_expiration_err_msg', 'DateTime', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'Desc', '', '', 0, 'text', '_bx_antispam_field_note', '_bx_antispam_field_note', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'bx_antispam_ip_table_submit', '_sys_submit', '', 0, 'submit', '_sys_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'close', '_sys_close', '', 0, 'reset', '_sys_close', '', '', 0, 0, 0, 'a:2:{s:7:\"onclick\";s:46:\"$(\'.bx-popup-applied:visible\').dolPopupHide();\";s:5:\"class\";s:22:\"bx-def-margin-sec-left\";}', '', '', '', '', '', '', '', 1, 0),
+('bx_antispam_ip_table_form', 'bx_antispam', 'buttons', '', 'bx_antispam_ip_table_submit,close', 0, 'input_set', '_bx_antispam_form_buttons', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_antispam_ip_table_form_add', 'ID', 2147483647, 0, 0),
+('bx_antispam_ip_table_form_add', 'From', 2147483647, 1, 1),
+('bx_antispam_ip_table_form_add', 'To', 2147483647, 1, 2),
+('bx_antispam_ip_table_form_add', 'Type', 2147483647, 1, 3),
+('bx_antispam_ip_table_form_add', 'LastDT', 2147483647, 1, 4),
+('bx_antispam_ip_table_form_add', 'Desc', 2147483647, 1, 5),
+('bx_antispam_ip_table_form_add', 'bx_antispam_ip_table_submit', 2147483647, 1, 6),
+('bx_antispam_ip_table_form_add', 'close', 2147483647, 1, 7),
+('bx_antispam_ip_table_form_add', 'buttons', 2147483647, 1, 8),
+('bx_antispam_ip_table_form_edit', 'ID', 2147483647, 1, 0),
+('bx_antispam_ip_table_form_edit', 'From', 2147483647, 1, 1),
+('bx_antispam_ip_table_form_edit', 'To', 2147483647, 1, 2),
+('bx_antispam_ip_table_form_edit', 'Type', 2147483647, 1, 3),
+('bx_antispam_ip_table_form_edit', 'LastDT', 2147483647, 1, 4),
+('bx_antispam_ip_table_form_edit', 'Desc', 2147483647, 1, 5),
+('bx_antispam_ip_table_form_edit', 'bx_antispam_ip_table_submit', 2147483647, 1, 6),
+('bx_antispam_ip_table_form_edit', 'close', 2147483647, 1, 7),
+('bx_antispam_ip_table_form_edit', 'buttons', 2147483647, 1, 8);
+
+

+ 2 - 0
modules/boonex/english/data/langs/system.xml

@@ -1416,6 +1416,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_block_types_custom"><![CDATA[Custom]]></string>
 	<string name="_sys_block_types_skeletons"><![CDATA[Skeletons]]></string>
 	<string name="_sys_block_types_system"><![CDATA[System]]></string>
+	<string name="_sys_close"><![CDATA[Close]]></string>
 	<string name="_sys_conn_err_connection_already_exists"><![CDATA[Connection already exists]]></string>
 	<string name="_sys_conn_err_connection_does_not_exists"><![CDATA[Connection doesn't exist]]></string>
 	<string name="_sys_conn_err_connection_is_awaiting_confirmation"><![CDATA[Connection request is awaiting confirmation]]></string>
@@ -1827,6 +1828,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_storage_restriction_ext_allowed"><![CDATA[Please, upload only files of these types: {0}]]></string>
 	<string name="_sys_storage_restriction_ext_denied"><![CDATA[You may upload any types of files except for {0}]]></string>
 	<string name="_sys_storage_restriction_size"><![CDATA[Maximum file size limit is {0}]]></string>
+	<string name="_sys_submit"><![CDATA[Submit]]></string>
 	<string name="_sys_txt_access_denied"><![CDATA[Access denied]]></string>
 	<string name="_sys_txt_account_pending"><![CDATA[Your account is pending approval, please wait until it is activated.]]></string>
 	<string name="_sys_txt_account_profile_context_change_suggestion"><![CDATA[This is your profile, you can <a href="{0}">change your current profile</a> to this profile]]></string>

+ 1 - 0
template/scripts/BxBaseFormView.php

@@ -105,6 +105,7 @@ class BxBaseFormView extends BxDolForm {
     function getCode($bDynamicMode = false) {
         $this->_bDynamicMode = $bDynamicMode;
         $this->addCssJs ();
+        $this->aFormAttrs = $this->_replaceMarkers($this->aFormAttrs);
         return ($this->sCode = $this->genForm());
     }