Remove unused code in mod/
- Remove commented code - Remove unused/immediately overwritten variables - Remove extraneous parameters - Remove unreachable code
This commit is contained in:
parent
4a95ca280d
commit
dbc6eb5422
34 changed files with 32 additions and 173 deletions
|
|
@ -213,14 +213,14 @@ function events_content(App $a)
|
|||
}
|
||||
|
||||
if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
|
||||
$r = q("UPDATE `event` SET `ignore` = 1 WHERE `id` = %d AND `uid` = %d",
|
||||
q("UPDATE `event` SET `ignore` = 1 WHERE `id` = %d AND `uid` = %d",
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
}
|
||||
|
||||
if (($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) {
|
||||
$r = q("UPDATE `event` SET `ignore` = 0 WHERE `id` = %d AND `uid` = %d",
|
||||
q("UPDATE `event` SET `ignore` = 0 WHERE `id` = %d AND `uid` = %d",
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
|
|
@ -300,21 +300,6 @@ function events_content(App $a)
|
|||
$y = 2100;
|
||||
}
|
||||
|
||||
$nextyear = $y;
|
||||
$nextmonth = $m + 1;
|
||||
if ($nextmonth > 12) {
|
||||
$nextmonth = 1;
|
||||
$nextyear ++;
|
||||
}
|
||||
|
||||
$prevyear = $y;
|
||||
if ($m > 1) {
|
||||
$prevmonth = $m - 1;
|
||||
} else {
|
||||
$prevmonth = 12;
|
||||
$prevyear --;
|
||||
}
|
||||
|
||||
$dim = Temporal::getDaysInMonth($y, $m);
|
||||
$start = sprintf('%d-%d-%d %d:%d:%d', $y, $m, 1, 0, 0, 0);
|
||||
$finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
|
||||
|
|
@ -526,7 +511,7 @@ function events_content(App $a)
|
|||
'$s_text' => L10n::t('Event Starts:') . ' <span class="required" title="' . L10n::t('Required') . '">*</span>',
|
||||
'$s_dsel' => Temporal::getDateTimeField(
|
||||
new DateTime(),
|
||||
DateTime::createFromFormat('Y', $syear+5),
|
||||
DateTime::createFromFormat('Y', intval($syear) + 5),
|
||||
DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"),
|
||||
L10n::t('Event Starts:'),
|
||||
'start_text',
|
||||
|
|
@ -541,7 +526,7 @@ function events_content(App $a)
|
|||
'$f_text' => L10n::t('Event Finishes:'),
|
||||
'$f_dsel' => Temporal::getDateTimeField(
|
||||
new DateTime(),
|
||||
DateTime::createFromFormat('Y', $fyear+5),
|
||||
DateTime::createFromFormat('Y', intval($fyear) + 5),
|
||||
DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"),
|
||||
L10n::t('Event Finishes:'),
|
||||
'finish_text',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue