Fix: Solve phpcodesniffer errors and warning
This commit is contained in:
parent
852a997559
commit
0b624b859a
@ -12,6 +12,9 @@
|
||||
|
||||
define('NEWLINE', "\n");
|
||||
|
||||
/**
|
||||
* Class DHTML_Calendar
|
||||
*/
|
||||
class DHTML_Calendar {
|
||||
var $calendar_lib_path;
|
||||
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
$lang = $_GET['lang'];
|
||||
if (!$lang) {
|
||||
$lang = $_REQUEST['lang'];
|
||||
$lang = $_REQUEST['lang'];
|
||||
}
|
||||
if (!$lang) {
|
||||
$lang = 'en';
|
||||
$lang = 'en';
|
||||
}
|
||||
setcookie('lang', $lang);
|
||||
|
||||
@ -13,9 +13,7 @@ setcookie('lang', $lang);
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
Test for calendar.php
|
||||
</title>
|
||||
<title>Test for calendar.php</title>
|
||||
|
||||
<?php
|
||||
|
||||
@ -48,69 +46,68 @@ $calendar->load_files();
|
||||
<h1>Form submitted</h1>
|
||||
|
||||
<?php foreach ($_REQUEST as $key => $val) {
|
||||
echo htmlspecialchars($key) . ' = ' . htmlspecialchars($val) . '<br />';
|
||||
echo htmlspecialchars($key) . ' = ' . htmlspecialchars($val) . '<br />';
|
||||
} ?>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<h1>Calendar.php test</h1>
|
||||
|
||||
<form action="test.php" method="get">
|
||||
Select language: <select name="lang" onchange="this.form.submit()">
|
||||
<?php
|
||||
$cwd = getcwd();
|
||||
chdir('lang');
|
||||
foreach (glob('*.js') as $filename) {
|
||||
$l = preg_replace('/(^calendar-|.js$)/', '', $filename);
|
||||
$selected = '';
|
||||
if ($l == $lang)
|
||||
$selected = 'selected="selected" ';
|
||||
$display = $l;
|
||||
if ($l == 'en')
|
||||
$display = 'EN';
|
||||
echo '<option ' . $selected . 'value="' . $l . '">' . $display . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<blockquote style="font-size: 90%">
|
||||
<b>NOTE</b>: as of this release, 0.9.6, only "EN" and "RO", which I
|
||||
maintain, function correctly. Other language files do not work
|
||||
because they need to be updated. If you update some language file,
|
||||
please consider sending it back to me so that I can include it in the
|
||||
calendar distribution.
|
||||
</blockquote>
|
||||
</form>
|
||||
<form action="test.php" method="get">Select language: <select
|
||||
name="lang" onchange="this.form.submit()">
|
||||
<?php
|
||||
$cwd = getcwd();
|
||||
chdir('lang');
|
||||
foreach (glob('*.js') as $filename) {
|
||||
$l = preg_replace('/(^calendar-|.js$)/', '', $filename);
|
||||
$selected = '';
|
||||
if ($l == $lang)
|
||||
$selected = 'selected="selected" ';
|
||||
$display = $l;
|
||||
if ($l == 'en')
|
||||
$display = 'EN';
|
||||
echo '<option ' . $selected . 'value="' . $l . '">' . $display . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<blockquote style="font-size: 90%"><b>NOTE</b>: as of this release,
|
||||
0.9.6, only "EN" and "RO", which I maintain, function correctly. Other
|
||||
language files do not work because they need to be updated. If you
|
||||
update some language file, please consider sending it back to me so that
|
||||
I can include it in the calendar distribution.</blockquote>
|
||||
</form>
|
||||
|
||||
<form action="test.php" method="get">
|
||||
<input type="hidden" name="submitted" value="1" />
|
||||
<form action="test.php" method="get"><input type="hidden"
|
||||
name="submitted" value="1" />
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Date 1:
|
||||
</td>
|
||||
<td>
|
||||
<?php $calendar->make_input_field(
|
||||
// calendar options go here; see the documentation and/or calendar-setup.js
|
||||
array('firstDay' => 1, // show Monday first
|
||||
'showsTime' => true,
|
||||
'showOthers' => true,
|
||||
'ifFormat' => '%Y-%m-%d %I:%M %P',
|
||||
'timeFormat' => '12'),
|
||||
// field attributes go here
|
||||
array('style' => 'width: 15em; color: #840; background-color: #ff8; border: 1px solid #000; text-align: center',
|
||||
'name' => 'date1',
|
||||
'value' => strftime('%Y-%m-%d %I:%M %P', strtotime('now')))); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Date 1:</td>
|
||||
<td><?php $calendar->make_input_field(
|
||||
// calendar options go here; see the documentation and/or calendar-setup.js
|
||||
array(
|
||||
'firstDay' => 1, // show Monday first
|
||||
'showsTime' => true,
|
||||
'showOthers' => true,
|
||||
'ifFormat' => '%Y-%m-%d %I:%M %P',
|
||||
'timeFormat' => '12'
|
||||
),
|
||||
// field attributes go here
|
||||
array(
|
||||
'style' => 'width: 15em; color: #840; background-color: #ff8; border: 1px solid #000; text-align: center',
|
||||
'name' => 'date1',
|
||||
'value' => strftime('%Y-%m-%d %I:%M %P', strtotime('now'))
|
||||
)
|
||||
); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr />
|
||||
<button>Submit</button>
|
||||
<hr />
|
||||
<button>Submit</button>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user