@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | $this->add(new Text('number')); |
| 37 | 37 | |
| 38 | 38 | // Note |
| 39 | - $this->add(new TextArea('note',array("rows"=>2))); |
|
| 39 | + $this->add(new TextArea('note', array("rows"=>2))); |
|
| 40 | 40 | |
| 41 | 41 | // Timeout |
| 42 | - $this->add(new Numeric('timeout',array("maxlength"=>2,"style"=>"width: 80px;","defaultValue"=>120))); |
|
| 42 | + $this->add(new Numeric('timeout', array("maxlength"=>2, "style"=>"width: 80px;", "defaultValue"=>120))); |
|
| 43 | 43 | |
| 44 | 44 | // Providers |
| 45 | - $providers= new Select('provider', $options['providers'], array( |
|
| 45 | + $providers = new Select('provider', $options['providers'], array( |
|
| 46 | 46 | 'using' => array( |
| 47 | 47 | 'id', |
| 48 | 48 | 'name' |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $this->add($providers); |
| 54 | 54 | |
| 55 | 55 | // Extension |
| 56 | - $extension= new Select('extension', $options['extensions'], array( |
|
| 56 | + $extension = new Select('extension', $options['extensions'], array( |
|
| 57 | 57 | 'using' => array( |
| 58 | 58 | 'id', |
| 59 | 59 | 'name' |
@@ -32,21 +32,21 @@ discard block |
||
| 32 | 32 | // Extension |
| 33 | 33 | $this->add(new Text('extension')); |
| 34 | 34 | |
| 35 | - // Number of repeat |
|
| 36 | - $this->add( new Numeric( 'number_of_repeat', [ |
|
| 37 | - "maxlength" => 2, |
|
| 38 | - "style" => "width: 80px;", |
|
| 39 | - "defaultValue" => 3, |
|
| 40 | - ] ) ); |
|
| 35 | + // Number of repeat |
|
| 36 | + $this->add( new Numeric( 'number_of_repeat', [ |
|
| 37 | + "maxlength" => 2, |
|
| 38 | + "style" => "width: 80px;", |
|
| 39 | + "defaultValue" => 3, |
|
| 40 | + ] ) ); |
|
| 41 | 41 | |
| 42 | - // Timeout |
|
| 43 | - $this->add( new Numeric( 'timeout', [ |
|
| 44 | - "maxlength" => 2, |
|
| 45 | - "style" => "width: 80px;", |
|
| 46 | - "defaultValue" => 7, |
|
| 47 | - ] ) ); |
|
| 42 | + // Timeout |
|
| 43 | + $this->add( new Numeric( 'timeout', [ |
|
| 44 | + "maxlength" => 2, |
|
| 45 | + "style" => "width: 80px;", |
|
| 46 | + "defaultValue" => 7, |
|
| 47 | + ] ) ); |
|
| 48 | 48 | |
| 49 | - // Timeoutextension |
|
| 49 | + // Timeoutextension |
|
| 50 | 50 | $extension= new Select('timeout_extension', $options['extensions'], array( |
| 51 | 51 | 'using' => array( |
| 52 | 52 | 'id', |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $this->add(new Check('allow_enter_any_internal_extension',$cheskarr)); |
| 78 | 78 | |
| 79 | 79 | // Description |
| 80 | - $rows = max( round( strlen( $entity->description ) / 95 ), 2 ); |
|
| 81 | - $this->add( new TextArea( 'description', [ "rows" => $rows ] ) ); |
|
| 80 | + $rows = max( round( strlen( $entity->description ) / 95 ), 2 ); |
|
| 81 | + $this->add( new TextArea( 'description', [ "rows" => $rows ] ) ); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | \ No newline at end of file |
@@ -33,21 +33,21 @@ discard block |
||
| 33 | 33 | $this->add(new Text('extension')); |
| 34 | 34 | |
| 35 | 35 | // Number of repeat |
| 36 | - $this->add( new Numeric( 'number_of_repeat', [ |
|
| 36 | + $this->add(new Numeric('number_of_repeat', [ |
|
| 37 | 37 | "maxlength" => 2, |
| 38 | 38 | "style" => "width: 80px;", |
| 39 | 39 | "defaultValue" => 3, |
| 40 | - ] ) ); |
|
| 40 | + ])); |
|
| 41 | 41 | |
| 42 | 42 | // Timeout |
| 43 | - $this->add( new Numeric( 'timeout', [ |
|
| 43 | + $this->add(new Numeric('timeout', [ |
|
| 44 | 44 | "maxlength" => 2, |
| 45 | 45 | "style" => "width: 80px;", |
| 46 | 46 | "defaultValue" => 7, |
| 47 | - ] ) ); |
|
| 47 | + ])); |
|
| 48 | 48 | |
| 49 | 49 | // Timeoutextension |
| 50 | - $extension= new Select('timeout_extension', $options['extensions'], array( |
|
| 50 | + $extension = new Select('timeout_extension', $options['extensions'], array( |
|
| 51 | 51 | 'using' => array( |
| 52 | 52 | 'id', |
| 53 | 53 | 'name' |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->add($extension); |
| 59 | 59 | |
| 60 | 60 | // Audio_message_id |
| 61 | - $audioMessage= new Select('audio_message_id', $options['soundfiles'], array( |
|
| 61 | + $audioMessage = new Select('audio_message_id', $options['soundfiles'], array( |
|
| 62 | 62 | 'using' => array( |
| 63 | 63 | 'id', |
| 64 | 64 | 'name' |
@@ -69,15 +69,15 @@ discard block |
||
| 69 | 69 | $this->add($audioMessage); |
| 70 | 70 | |
| 71 | 71 | //Allow_enter_any_internal_extension |
| 72 | - $cheskarr=array('value'=>null); |
|
| 72 | + $cheskarr = array('value'=>null); |
|
| 73 | 73 | if ($entity->allow_enter_any_internal_extension) { |
| 74 | - $cheskarr = array('checked' => 'checked','value'=>null); |
|
| 74 | + $cheskarr = array('checked' => 'checked', 'value'=>null); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $this->add(new Check('allow_enter_any_internal_extension',$cheskarr)); |
|
| 77 | + $this->add(new Check('allow_enter_any_internal_extension', $cheskarr)); |
|
| 78 | 78 | |
| 79 | 79 | // Description |
| 80 | - $rows = max( round( strlen( $entity->description ) / 95 ), 2 ); |
|
| 81 | - $this->add( new TextArea( 'description', [ "rows" => $rows ] ) ); |
|
| 80 | + $rows = max(round(strlen($entity->description) / 95), 2); |
|
| 81 | + $this->add(new TextArea('description', ["rows" => $rows])); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | class LicensingActivateCouponForm extends Form { |
| 14 | 14 | |
| 15 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 16 | - $this->add( new Text( 'coupon' ) ); |
|
| 17 | - } |
|
| 15 | + public function initialize( $entity = NULL, $options = NULL ) { |
|
| 16 | + $this->add( new Text( 'coupon' ) ); |
|
| 17 | + } |
|
| 18 | 18 | } |
| 19 | 19 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | class LicensingActivateCouponForm extends Form { |
| 14 | 14 | |
| 15 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 16 | - $this->add( new Text( 'coupon' ) ); |
|
| 15 | + public function initialize($entity = NULL, $options = NULL) { |
|
| 16 | + $this->add(new Text('coupon')); |
|
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | \ No newline at end of file |
@@ -10,9 +10,11 @@ |
||
| 10 | 10 | use Phalcon\Forms\Form; |
| 11 | 11 | use Phalcon\Forms\Element\Text; |
| 12 | 12 | |
| 13 | -class LicensingActivateCouponForm extends Form { |
|
| 13 | +class LicensingActivateCouponForm extends Form |
|
| 14 | +{ |
|
| 14 | 15 | |
| 15 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 16 | + public function initialize( $entity = NULL, $options = NULL ) |
|
| 17 | + { |
|
| 16 | 18 | $this->add( new Text( 'coupon' ) ); |
| 17 | 19 | } |
| 18 | 20 | } |
| 19 | 21 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | class LicensingActivateCouponForm extends Form { |
| 14 | 14 | |
| 15 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 15 | + public function initialize( $entity = null, $options = null ) { |
|
| 16 | 16 | $this->add( new Text( 'coupon' ) ); |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | \ No newline at end of file |
@@ -16,47 +16,47 @@ |
||
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | class AsteriskManagerEditForm extends Form { |
| 19 | - public function initialize($entity = NULL, $options = NULL) { |
|
| 20 | - // Id |
|
| 21 | - $this->add(new Hidden('id')); |
|
| 22 | - |
|
| 23 | - // Username |
|
| 24 | - $this->add(new Text('username')); |
|
| 25 | - |
|
| 26 | - // Secret |
|
| 27 | - $this->add(new Text('secret')); |
|
| 28 | - |
|
| 29 | - |
|
| 30 | - foreach ($options['array_of_checkboxes'] as $checkBox) { |
|
| 31 | - $cheskarr = []; |
|
| 32 | - $this->add(new Check($checkBox . '_main', $cheskarr)); |
|
| 33 | - |
|
| 34 | - if (strpos($entity->$checkBox, 'read') !== FALSE) { |
|
| 35 | - $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
|
| 36 | - } |
|
| 37 | - $this->add(new Check($checkBox . '_read', $cheskarr)); |
|
| 38 | - |
|
| 39 | - if (strpos($entity->$checkBox, 'write') !== FALSE) { |
|
| 40 | - $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
|
| 41 | - } else { |
|
| 42 | - $cheskarr = ['value' => NULL]; |
|
| 43 | - } |
|
| 44 | - $this->add(new Check($checkBox . '_write', $cheskarr)); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - // Networkfilterid |
|
| 48 | - $networkfilterid = new Select('networkfilterid', $options['network_filters'], [ |
|
| 49 | - 'using' => [ |
|
| 50 | - 'id', |
|
| 51 | - 'name', |
|
| 52 | - ], |
|
| 53 | - 'useEmpty' => FALSE, |
|
| 54 | - 'value' => $entity->networkfilterid, |
|
| 55 | - 'class' => 'ui selection dropdown network-filter-select', |
|
| 56 | - ]); |
|
| 57 | - $this->add($networkfilterid); |
|
| 58 | - |
|
| 59 | - // Description |
|
| 60 | - $this->add(new TextArea('description', ["rows" => 2])); |
|
| 61 | - } |
|
| 19 | + public function initialize($entity = NULL, $options = NULL) { |
|
| 20 | + // Id |
|
| 21 | + $this->add(new Hidden('id')); |
|
| 22 | + |
|
| 23 | + // Username |
|
| 24 | + $this->add(new Text('username')); |
|
| 25 | + |
|
| 26 | + // Secret |
|
| 27 | + $this->add(new Text('secret')); |
|
| 28 | + |
|
| 29 | + |
|
| 30 | + foreach ($options['array_of_checkboxes'] as $checkBox) { |
|
| 31 | + $cheskarr = []; |
|
| 32 | + $this->add(new Check($checkBox . '_main', $cheskarr)); |
|
| 33 | + |
|
| 34 | + if (strpos($entity->$checkBox, 'read') !== FALSE) { |
|
| 35 | + $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
|
| 36 | + } |
|
| 37 | + $this->add(new Check($checkBox . '_read', $cheskarr)); |
|
| 38 | + |
|
| 39 | + if (strpos($entity->$checkBox, 'write') !== FALSE) { |
|
| 40 | + $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
|
| 41 | + } else { |
|
| 42 | + $cheskarr = ['value' => NULL]; |
|
| 43 | + } |
|
| 44 | + $this->add(new Check($checkBox . '_write', $cheskarr)); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + // Networkfilterid |
|
| 48 | + $networkfilterid = new Select('networkfilterid', $options['network_filters'], [ |
|
| 49 | + 'using' => [ |
|
| 50 | + 'id', |
|
| 51 | + 'name', |
|
| 52 | + ], |
|
| 53 | + 'useEmpty' => FALSE, |
|
| 54 | + 'value' => $entity->networkfilterid, |
|
| 55 | + 'class' => 'ui selection dropdown network-filter-select', |
|
| 56 | + ]); |
|
| 57 | + $this->add($networkfilterid); |
|
| 58 | + |
|
| 59 | + // Description |
|
| 60 | + $this->add(new TextArea('description', ["rows" => 2])); |
|
| 61 | + } |
|
| 62 | 62 | } |
| 63 | 63 | \ No newline at end of file |
@@ -29,19 +29,19 @@ |
||
| 29 | 29 | |
| 30 | 30 | foreach ($options['array_of_checkboxes'] as $checkBox) { |
| 31 | 31 | $cheskarr = []; |
| 32 | - $this->add(new Check($checkBox . '_main', $cheskarr)); |
|
| 32 | + $this->add(new Check($checkBox.'_main', $cheskarr)); |
|
| 33 | 33 | |
| 34 | 34 | if (strpos($entity->$checkBox, 'read') !== FALSE) { |
| 35 | 35 | $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
| 36 | 36 | } |
| 37 | - $this->add(new Check($checkBox . '_read', $cheskarr)); |
|
| 37 | + $this->add(new Check($checkBox.'_read', $cheskarr)); |
|
| 38 | 38 | |
| 39 | 39 | if (strpos($entity->$checkBox, 'write') !== FALSE) { |
| 40 | 40 | $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
| 41 | 41 | } else { |
| 42 | 42 | $cheskarr = ['value' => NULL]; |
| 43 | 43 | } |
| 44 | - $this->add(new Check($checkBox . '_write', $cheskarr)); |
|
| 44 | + $this->add(new Check($checkBox.'_write', $cheskarr)); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // Networkfilterid |
@@ -15,8 +15,10 @@ |
||
| 15 | 15 | use Phalcon\Forms\Element\Select; |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -class AsteriskManagerEditForm extends Form { |
|
| 19 | - public function initialize($entity = NULL, $options = NULL) { |
|
| 18 | +class AsteriskManagerEditForm extends Form |
|
| 19 | +{ |
|
| 20 | + public function initialize($entity = NULL, $options = NULL) |
|
| 21 | + { |
|
| 20 | 22 | // Id |
| 21 | 23 | $this->add(new Hidden('id')); |
| 22 | 24 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | class AsteriskManagerEditForm extends Form { |
| 19 | - public function initialize($entity = NULL, $options = NULL) { |
|
| 19 | + public function initialize($entity = null, $options = null) { |
|
| 20 | 20 | // Id |
| 21 | 21 | $this->add(new Hidden('id')); |
| 22 | 22 | |
@@ -31,15 +31,15 @@ discard block |
||
| 31 | 31 | $cheskarr = []; |
| 32 | 32 | $this->add(new Check($checkBox . '_main', $cheskarr)); |
| 33 | 33 | |
| 34 | - if (strpos($entity->$checkBox, 'read') !== FALSE) { |
|
| 35 | - $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
|
| 34 | + if (strpos($entity->$checkBox, 'read') !== false) { |
|
| 35 | + $cheskarr = ['checked' => 'checked', 'value' => null]; |
|
| 36 | 36 | } |
| 37 | 37 | $this->add(new Check($checkBox . '_read', $cheskarr)); |
| 38 | 38 | |
| 39 | - if (strpos($entity->$checkBox, 'write') !== FALSE) { |
|
| 40 | - $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
|
| 39 | + if (strpos($entity->$checkBox, 'write') !== false) { |
|
| 40 | + $cheskarr = ['checked' => 'checked', 'value' => null]; |
|
| 41 | 41 | } else { |
| 42 | - $cheskarr = ['value' => NULL]; |
|
| 42 | + $cheskarr = ['value' => null]; |
|
| 43 | 43 | } |
| 44 | 44 | $this->add(new Check($checkBox . '_write', $cheskarr)); |
| 45 | 45 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'id', |
| 51 | 51 | 'name', |
| 52 | 52 | ], |
| 53 | - 'useEmpty' => FALSE, |
|
| 53 | + 'useEmpty' => false, |
|
| 54 | 54 | 'value' => $entity->networkfilterid, |
| 55 | 55 | 'class' => 'ui selection dropdown network-filter-select', |
| 56 | 56 | ]); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | // Password |
| 49 | 49 | $password = new Password('newpassword'); |
| 50 | 50 | |
| 51 | - if ($entity==null) { |
|
| 51 | + if ($entity == null) { |
|
| 52 | 52 | $password->addValidators(array( |
| 53 | 53 | new PresenceOf(array( |
| 54 | 54 | 'message' => $this->translation->_("Password is required") |
@@ -66,14 +66,14 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | // Role |
| 68 | 68 | |
| 69 | - $arrTypes=\Models\Users::getRoleValues(); |
|
| 70 | - $arrType=array(); |
|
| 71 | - foreach ($arrTypes as $typename ){ |
|
| 72 | - $arrType[]=array( |
|
| 69 | + $arrTypes = \Models\Users::getRoleValues(); |
|
| 70 | + $arrType = array(); |
|
| 71 | + foreach ($arrTypes as $typename) { |
|
| 72 | + $arrType[] = array( |
|
| 73 | 73 | $typename=>$this->translation->_($typename) |
| 74 | 74 | ); |
| 75 | 75 | } |
| 76 | - $role = new Select('role',$arrType, array( |
|
| 76 | + $role = new Select('role', $arrType, array( |
|
| 77 | 77 | 'using' => array( |
| 78 | 78 | 'id', |
| 79 | 79 | 'name' |
@@ -86,14 +86,14 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | // Language |
| 88 | 88 | |
| 89 | - $arrLanguages=\Models\Users::getLanguages(); |
|
| 90 | - $arrLang=array(); |
|
| 91 | - foreach ($arrLanguages as $langname ){ |
|
| 92 | - $arrLang[]=array( |
|
| 89 | + $arrLanguages = \Models\Users::getLanguages(); |
|
| 90 | + $arrLang = array(); |
|
| 91 | + foreach ($arrLanguages as $langname) { |
|
| 92 | + $arrLang[] = array( |
|
| 93 | 93 | $langname=>$this->translation->_($langname) |
| 94 | 94 | ); |
| 95 | 95 | } |
| 96 | - $language = new Select('language',$arrLang, array( |
|
| 96 | + $language = new Select('language', $arrLang, array( |
|
| 97 | 97 | 'using' => array( |
| 98 | 98 | 'id', |
| 99 | 99 | 'name' |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | // Active |
| 108 | - $cheskarr=array('value'=>null); |
|
| 109 | - if (isset($entity) && $entity->active==1) $cheskarr=array('checked' => 'checked'); |
|
| 108 | + $cheskarr = array('value'=>null); |
|
| 109 | + if (isset($entity) && $entity->active == 1) $cheskarr = array('checked' => 'checked'); |
|
| 110 | 110 | |
| 111 | - $active = new Check('active',$cheskarr); |
|
| 111 | + $active = new Check('active', $cheskarr); |
|
| 112 | 112 | $this->add($active); |
| 113 | 113 | |
| 114 | 114 | |
@@ -106,7 +106,9 @@ |
||
| 106 | 106 | |
| 107 | 107 | // Active |
| 108 | 108 | $cheskarr=array('value'=>null); |
| 109 | - if (isset($entity) && $entity->active==1) $cheskarr=array('checked' => 'checked'); |
|
| 109 | + if (isset($entity) && $entity->active==1) { |
|
| 110 | + $cheskarr=array('checked' => 'checked'); |
|
| 111 | + } |
|
| 110 | 112 | |
| 111 | 113 | $active = new Check('active',$cheskarr); |
| 112 | 114 | $this->add($active); |
@@ -17,30 +17,30 @@ |
||
| 17 | 17 | |
| 18 | 18 | class Fail2BanEditForm extends Form { |
| 19 | 19 | |
| 20 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 21 | - foreach ( $entity as $key => $value ) { |
|
| 22 | - switch ( $key ) { |
|
| 23 | - case "id": |
|
| 24 | - $this->add( new Hidden( $key ) ); |
|
| 25 | - break; |
|
| 26 | - case "maxretry": |
|
| 27 | - case "bantime": |
|
| 28 | - case "findtime": |
|
| 29 | - case "***ALL NUMBERIC ABOVE***": |
|
| 30 | - $this->add( new Numeric( $key ) ); |
|
| 31 | - break; |
|
| 32 | - case "whitelist": |
|
| 33 | - $this->add( new TextArea( $key, [ "rows" => 6 ] ) ); |
|
| 34 | - break; |
|
| 35 | - default: |
|
| 36 | - $this->add( new Text( $key ) ); |
|
| 37 | - } |
|
| 38 | - } |
|
| 20 | + public function initialize( $entity = NULL, $options = NULL ) { |
|
| 21 | + foreach ( $entity as $key => $value ) { |
|
| 22 | + switch ( $key ) { |
|
| 23 | + case "id": |
|
| 24 | + $this->add( new Hidden( $key ) ); |
|
| 25 | + break; |
|
| 26 | + case "maxretry": |
|
| 27 | + case "bantime": |
|
| 28 | + case "findtime": |
|
| 29 | + case "***ALL NUMBERIC ABOVE***": |
|
| 30 | + $this->add( new Numeric( $key ) ); |
|
| 31 | + break; |
|
| 32 | + case "whitelist": |
|
| 33 | + $this->add( new TextArea( $key, [ "rows" => 6 ] ) ); |
|
| 34 | + break; |
|
| 35 | + default: |
|
| 36 | + $this->add( new Text( $key ) ); |
|
| 37 | + } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - $cheskarr = [ 'value' => NULL ]; |
|
| 41 | - if ( $options['PBXFail2BanEnabled'] === "1" ) { |
|
| 42 | - $cheskarr = [ 'checked' => 'checked', 'value' => NULL ]; |
|
| 43 | - } |
|
| 44 | - $this->add( new Check( 'PBXFail2BanEnabled', $cheskarr ) ); |
|
| 45 | - } |
|
| 40 | + $cheskarr = [ 'value' => NULL ]; |
|
| 41 | + if ( $options['PBXFail2BanEnabled'] === "1" ) { |
|
| 42 | + $cheskarr = [ 'checked' => 'checked', 'value' => NULL ]; |
|
| 43 | + } |
|
| 44 | + $this->add( new Check( 'PBXFail2BanEnabled', $cheskarr ) ); |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | \ No newline at end of file |
@@ -17,30 +17,30 @@ |
||
| 17 | 17 | |
| 18 | 18 | class Fail2BanEditForm extends Form { |
| 19 | 19 | |
| 20 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 21 | - foreach ( $entity as $key => $value ) { |
|
| 22 | - switch ( $key ) { |
|
| 20 | + public function initialize($entity = NULL, $options = NULL) { |
|
| 21 | + foreach ($entity as $key => $value) { |
|
| 22 | + switch ($key) { |
|
| 23 | 23 | case "id": |
| 24 | - $this->add( new Hidden( $key ) ); |
|
| 24 | + $this->add(new Hidden($key)); |
|
| 25 | 25 | break; |
| 26 | 26 | case "maxretry": |
| 27 | 27 | case "bantime": |
| 28 | 28 | case "findtime": |
| 29 | 29 | case "***ALL NUMBERIC ABOVE***": |
| 30 | - $this->add( new Numeric( $key ) ); |
|
| 30 | + $this->add(new Numeric($key)); |
|
| 31 | 31 | break; |
| 32 | 32 | case "whitelist": |
| 33 | - $this->add( new TextArea( $key, [ "rows" => 6 ] ) ); |
|
| 33 | + $this->add(new TextArea($key, ["rows" => 6])); |
|
| 34 | 34 | break; |
| 35 | 35 | default: |
| 36 | - $this->add( new Text( $key ) ); |
|
| 36 | + $this->add(new Text($key)); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $cheskarr = [ 'value' => NULL ]; |
|
| 41 | - if ( $options['PBXFail2BanEnabled'] === "1" ) { |
|
| 42 | - $cheskarr = [ 'checked' => 'checked', 'value' => NULL ]; |
|
| 40 | + $cheskarr = ['value' => NULL]; |
|
| 41 | + if ($options['PBXFail2BanEnabled'] === "1") { |
|
| 42 | + $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
|
| 43 | 43 | } |
| 44 | - $this->add( new Check( 'PBXFail2BanEnabled', $cheskarr ) ); |
|
| 44 | + $this->add(new Check('PBXFail2BanEnabled', $cheskarr)); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | \ No newline at end of file |
@@ -15,9 +15,11 @@ |
||
| 15 | 15 | use Phalcon\Forms\Element\Check; |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -class Fail2BanEditForm extends Form { |
|
| 18 | +class Fail2BanEditForm extends Form |
|
| 19 | +{ |
|
| 19 | 20 | |
| 20 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 21 | + public function initialize( $entity = NULL, $options = NULL ) |
|
| 22 | + { |
|
| 21 | 23 | foreach ( $entity as $key => $value ) { |
| 22 | 24 | switch ( $key ) { |
| 23 | 25 | case "id": |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | class Fail2BanEditForm extends Form { |
| 19 | 19 | |
| 20 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 20 | + public function initialize( $entity = null, $options = null ) { |
|
| 21 | 21 | foreach ( $entity as $key => $value ) { |
| 22 | 22 | switch ( $key ) { |
| 23 | 23 | case "id": |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $cheskarr = [ 'value' => NULL ]; |
|
| 40 | + $cheskarr = [ 'value' => null ]; |
|
| 41 | 41 | if ( $options['PBXFail2BanEnabled'] === "1" ) { |
| 42 | - $cheskarr = [ 'checked' => 'checked', 'value' => NULL ]; |
|
| 42 | + $cheskarr = [ 'checked' => 'checked', 'value' => null ]; |
|
| 43 | 43 | } |
| 44 | 44 | $this->add( new Check( 'PBXFail2BanEnabled', $cheskarr ) ); |
| 45 | 45 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | // ); |
| 27 | 27 | |
| 28 | 28 | foreach ($entity as $item) { |
| 29 | - switch ($item->key){ |
|
| 29 | + switch ($item->key) { |
|
| 30 | 30 | case 'PBXTimezone' :{ |
| 31 | 31 | $ntpserver = new Select('PBXTimezone', $options, array( |
| 32 | 32 | 'using' => array( |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | break; |
| 42 | 42 | } |
| 43 | 43 | case 'PBXManualTimeSettings' :{ |
| 44 | - $cheskarr=array('value'=>null); |
|
| 44 | + $cheskarr = array('value'=>null); |
|
| 45 | 45 | if ($item->value) { |
| 46 | - $cheskarr = array('checked' => 'checked','value'=>null); |
|
| 46 | + $cheskarr = array('checked' => 'checked', 'value'=>null); |
|
| 47 | 47 | } |
| 48 | 48 | $this->add(new Check('PBXManualTimeSettings', $cheskarr)); |
| 49 | 49 | break; |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | // Manualattributes |
| 68 | - $rows = max( round( strlen( $entity->manualattributes ) / 95 ), 2 ); |
|
| 69 | - $this->add( new TextArea( 'manualattributes', [ "rows" => $rows ] ) ); |
|
| 68 | + $rows = max( round( strlen( $entity->manualattributes ) / 95 ), 2 ); |
|
| 69 | + $this->add( new TextArea( 'manualattributes', [ "rows" => $rows ] ) ); |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | public function initialize($entity = null, $options = null) |
| 23 | 23 | { |
| 24 | 24 | // ProviderType |
| 25 | - $this->add(new Hidden('providerType',['value'=>'IAX'])); |
|
| 25 | + $this->add(new Hidden('providerType', ['value'=>'IAX'])); |
|
| 26 | 26 | |
| 27 | 27 | // Disabled |
| 28 | 28 | $this->add(new Hidden('disabled')); |
@@ -49,23 +49,23 @@ discard block |
||
| 49 | 49 | $this->add(new Text('host')); |
| 50 | 50 | |
| 51 | 51 | // Qualify |
| 52 | - $cheskarr=array('value'=>null); |
|
| 52 | + $cheskarr = array('value'=>null); |
|
| 53 | 53 | if ($entity->qualify) { |
| 54 | - $cheskarr = array('checked' => 'checked','value'=>null); |
|
| 54 | + $cheskarr = array('checked' => 'checked', 'value'=>null); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $this->add(new Check('qualify',$cheskarr)); |
|
| 57 | + $this->add(new Check('qualify', $cheskarr)); |
|
| 58 | 58 | |
| 59 | 59 | // Noregister |
| 60 | - $cheskarr=array('value'=>null); |
|
| 60 | + $cheskarr = array('value'=>null); |
|
| 61 | 61 | if ($entity->noregister) { |
| 62 | - $cheskarr = array('checked' => 'checked','value'=>null); |
|
| 62 | + $cheskarr = array('checked' => 'checked', 'value'=>null); |
|
| 63 | 63 | } |
| 64 | - $this->add(new Check('noregister',$cheskarr)); |
|
| 64 | + $this->add(new Check('noregister', $cheskarr)); |
|
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | // Manualattributes |
| 68 | - $rows = max( round( strlen( $entity->manualattributes ) / 95 ), 2 ); |
|
| 69 | - $this->add( new TextArea( 'manualattributes', [ "rows" => $rows ] ) ); |
|
| 68 | + $rows = max(round(strlen($entity->manualattributes) / 95), 2); |
|
| 69 | + $this->add(new TextArea('manualattributes', ["rows" => $rows])); |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | \ No newline at end of file |
@@ -18,45 +18,45 @@ |
||
| 18 | 18 | |
| 19 | 19 | class BackupAutomaticForm extends Form { |
| 20 | 20 | |
| 21 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 22 | - foreach ( $entity as $key => $value ) { |
|
| 23 | - switch ( $key ) { |
|
| 21 | + public function initialize( $entity = NULL, $options = NULL ) { |
|
| 22 | + foreach ( $entity as $key => $value ) { |
|
| 23 | + switch ( $key ) { |
|
| 24 | 24 | |
| 25 | - case "id": |
|
| 26 | - case "***ALL HIDDEN ABOVE***": |
|
| 27 | - $this->add( new Hidden( $key ) ); |
|
| 28 | - break; |
|
| 29 | - case "ftp_secret": |
|
| 30 | - $this->add( new Password( $key ) ); |
|
| 31 | - break; |
|
| 32 | - case "keep_older_versions": |
|
| 33 | - case "ftp_port": |
|
| 34 | - case "***ALL INTEGER ABOVE***": |
|
| 35 | - $this->add( new Numeric( $key ) ); |
|
| 36 | - break; |
|
| 37 | - case "every": |
|
| 38 | - $action = new Select( $key, $options['week-days'], [ |
|
| 39 | - 'using' => [ |
|
| 40 | - 'id', |
|
| 41 | - 'name', |
|
| 42 | - ], |
|
| 43 | - 'useEmpty' => FALSE, |
|
| 44 | - 'value' => empty( $entity->$key ) ? 0 : $value, |
|
| 45 | - 'class' => 'ui selection dropdown', |
|
| 46 | - ] ); |
|
| 47 | - $this->add( $action ); |
|
| 48 | - break; |
|
| 49 | - case "ftp_sftp_mode": |
|
| 50 | - case "enabled": |
|
| 51 | - $cheskarr = [ 'value' => NULL ]; |
|
| 52 | - if ( $entity->$key === "1" ) { |
|
| 53 | - $cheskarr = [ 'checked' => 'checked', 'value' => NULL ]; |
|
| 54 | - } |
|
| 55 | - $this->add( new Check( $key, $cheskarr ) ); |
|
| 56 | - break; |
|
| 57 | - default: |
|
| 58 | - $this->add( new Text( $key ) ); |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - } |
|
| 25 | + case "id": |
|
| 26 | + case "***ALL HIDDEN ABOVE***": |
|
| 27 | + $this->add( new Hidden( $key ) ); |
|
| 28 | + break; |
|
| 29 | + case "ftp_secret": |
|
| 30 | + $this->add( new Password( $key ) ); |
|
| 31 | + break; |
|
| 32 | + case "keep_older_versions": |
|
| 33 | + case "ftp_port": |
|
| 34 | + case "***ALL INTEGER ABOVE***": |
|
| 35 | + $this->add( new Numeric( $key ) ); |
|
| 36 | + break; |
|
| 37 | + case "every": |
|
| 38 | + $action = new Select( $key, $options['week-days'], [ |
|
| 39 | + 'using' => [ |
|
| 40 | + 'id', |
|
| 41 | + 'name', |
|
| 42 | + ], |
|
| 43 | + 'useEmpty' => FALSE, |
|
| 44 | + 'value' => empty( $entity->$key ) ? 0 : $value, |
|
| 45 | + 'class' => 'ui selection dropdown', |
|
| 46 | + ] ); |
|
| 47 | + $this->add( $action ); |
|
| 48 | + break; |
|
| 49 | + case "ftp_sftp_mode": |
|
| 50 | + case "enabled": |
|
| 51 | + $cheskarr = [ 'value' => NULL ]; |
|
| 52 | + if ( $entity->$key === "1" ) { |
|
| 53 | + $cheskarr = [ 'checked' => 'checked', 'value' => NULL ]; |
|
| 54 | + } |
|
| 55 | + $this->add( new Check( $key, $cheskarr ) ); |
|
| 56 | + break; |
|
| 57 | + default: |
|
| 58 | + $this->add( new Text( $key ) ); |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | 62 | } |
| 63 | 63 | \ No newline at end of file |
@@ -18,44 +18,44 @@ |
||
| 18 | 18 | |
| 19 | 19 | class BackupAutomaticForm extends Form { |
| 20 | 20 | |
| 21 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 22 | - foreach ( $entity as $key => $value ) { |
|
| 23 | - switch ( $key ) { |
|
| 21 | + public function initialize($entity = NULL, $options = NULL) { |
|
| 22 | + foreach ($entity as $key => $value) { |
|
| 23 | + switch ($key) { |
|
| 24 | 24 | |
| 25 | 25 | case "id": |
| 26 | 26 | case "***ALL HIDDEN ABOVE***": |
| 27 | - $this->add( new Hidden( $key ) ); |
|
| 27 | + $this->add(new Hidden($key)); |
|
| 28 | 28 | break; |
| 29 | 29 | case "ftp_secret": |
| 30 | - $this->add( new Password( $key ) ); |
|
| 30 | + $this->add(new Password($key)); |
|
| 31 | 31 | break; |
| 32 | 32 | case "keep_older_versions": |
| 33 | 33 | case "ftp_port": |
| 34 | 34 | case "***ALL INTEGER ABOVE***": |
| 35 | - $this->add( new Numeric( $key ) ); |
|
| 35 | + $this->add(new Numeric($key)); |
|
| 36 | 36 | break; |
| 37 | 37 | case "every": |
| 38 | - $action = new Select( $key, $options['week-days'], [ |
|
| 38 | + $action = new Select($key, $options['week-days'], [ |
|
| 39 | 39 | 'using' => [ |
| 40 | 40 | 'id', |
| 41 | 41 | 'name', |
| 42 | 42 | ], |
| 43 | 43 | 'useEmpty' => FALSE, |
| 44 | - 'value' => empty( $entity->$key ) ? 0 : $value, |
|
| 44 | + 'value' => empty($entity->$key) ? 0 : $value, |
|
| 45 | 45 | 'class' => 'ui selection dropdown', |
| 46 | - ] ); |
|
| 47 | - $this->add( $action ); |
|
| 46 | + ]); |
|
| 47 | + $this->add($action); |
|
| 48 | 48 | break; |
| 49 | 49 | case "ftp_sftp_mode": |
| 50 | 50 | case "enabled": |
| 51 | - $cheskarr = [ 'value' => NULL ]; |
|
| 52 | - if ( $entity->$key === "1" ) { |
|
| 53 | - $cheskarr = [ 'checked' => 'checked', 'value' => NULL ]; |
|
| 51 | + $cheskarr = ['value' => NULL]; |
|
| 52 | + if ($entity->$key === "1") { |
|
| 53 | + $cheskarr = ['checked' => 'checked', 'value' => NULL]; |
|
| 54 | 54 | } |
| 55 | - $this->add( new Check( $key, $cheskarr ) ); |
|
| 55 | + $this->add(new Check($key, $cheskarr)); |
|
| 56 | 56 | break; |
| 57 | 57 | default: |
| 58 | - $this->add( new Text( $key ) ); |
|
| 58 | + $this->add(new Text($key)); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -16,9 +16,11 @@ |
||
| 16 | 16 | use Phalcon\Forms\Element\Check; |
| 17 | 17 | |
| 18 | 18 | |
| 19 | -class BackupAutomaticForm extends Form { |
|
| 19 | +class BackupAutomaticForm extends Form |
|
| 20 | +{ |
|
| 20 | 21 | |
| 21 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 22 | + public function initialize( $entity = NULL, $options = NULL ) |
|
| 23 | + { |
|
| 22 | 24 | foreach ( $entity as $key => $value ) { |
| 23 | 25 | switch ( $key ) { |
| 24 | 26 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | class BackupAutomaticForm extends Form { |
| 20 | 20 | |
| 21 | - public function initialize( $entity = NULL, $options = NULL ) { |
|
| 21 | + public function initialize( $entity = null, $options = null ) { |
|
| 22 | 22 | foreach ( $entity as $key => $value ) { |
| 23 | 23 | switch ( $key ) { |
| 24 | 24 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | 'id', |
| 41 | 41 | 'name', |
| 42 | 42 | ], |
| 43 | - 'useEmpty' => FALSE, |
|
| 43 | + 'useEmpty' => false, |
|
| 44 | 44 | 'value' => empty( $entity->$key ) ? 0 : $value, |
| 45 | 45 | 'class' => 'ui selection dropdown', |
| 46 | 46 | ] ); |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | break; |
| 49 | 49 | case "ftp_sftp_mode": |
| 50 | 50 | case "enabled": |
| 51 | - $cheskarr = [ 'value' => NULL ]; |
|
| 51 | + $cheskarr = [ 'value' => null ]; |
|
| 52 | 52 | if ( $entity->$key === "1" ) { |
| 53 | - $cheskarr = [ 'checked' => 'checked', 'value' => NULL ]; |
|
| 53 | + $cheskarr = [ 'checked' => 'checked', 'value' => null ]; |
|
| 54 | 54 | } |
| 55 | 55 | $this->add( new Check( $key, $cheskarr ) ); |
| 56 | 56 | break; |