Skip to content

Commit

Permalink
Add wifi
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Apr 15, 2024
1 parent 37420ad commit 25c470c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 29 deletions.
50 changes: 25 additions & 25 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions plugins/Sandbox/src/Controller/QrCodeExamplesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ public function svg() {
case 'sms':
$result = $formatter->formatSms($this->request->getData('Sms.number'), $this->request->getData('Sms.content'));

break;
case 'wifi':
$result = $formatter->formatWifi($this->request->getData('Wifi.type'), $this->request->getData('Wifi.network'), $this->request->getData('Wifi.password'));

break;
case 'geo':
//TODO
$result = $this->request->getData('content');
$result = 'geo:' . str_replace(' ', '', $this->request->getData('content'));

break;
}
Expand Down
23 changes: 21 additions & 2 deletions plugins/Sandbox/templates/QrCodeExamples/complex.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@

?>
</div>
<div id="wifiBox">
<?php
$types = [
'WPA' => 'WPA',
'WPE' => 'WPE',
];
echo $this->Form->control('Wifi.type', ['options' => $types]);
echo $this->Form->control('Wifi.network');
echo $this->Form->control('Wifi.password');
?>
</div>

<div class="col-md-offset-2 col-md-6">
<?php echo $this->Form->button(__('Go'), ['class' => 'btn btn-success']);?>
Expand All @@ -82,17 +93,25 @@

$("#type").change(function () {
var selvalue = $(this).val();
if (selvalue == 'card') {
if (selvalue === 'card') {
$("#textBox").hide(50);
$("#smsBox").hide(50);
$("#wifiBox").hide(50);
$("#cardBox").show(50);
} else if (selvalue == 'sms') {
} else if (selvalue === 'sms') {
$("#textBox").hide(50);
$("#cardBox").hide(50);
$("#wifiBox").hide(50);
$("#smsBox").show(50);
} else if (selvalue === 'wifi') {
$("#textBox").hide(50);
$("#cardBox").hide(50);
$("#smsBox").hide(50);
$("#wifiBox").show(50);
} else {
$("#cardBox").hide(50);
$("#smsBox").hide(50);
$("#wifiBox").hide(50);
$("#textBox").show(50);
}
}).change();
Expand Down

0 comments on commit 25c470c

Please sign in to comment.