Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Most input -> button convertion #433

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions access.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
$defConfigStr = translate( 'DEFAULT CONFIGURATION' );
$goStr = '
</select>
<input class="btn btn-primary" type="submit" value="' . translate( 'Go' ) . '">
<button class="btn btn-primary" type="submit">'
. translate ( 'Go' ) . '</button>
</form>';
$saveStr = translate( 'Save' );
$undoStr = translate( 'Undo' );
Expand Down Expand Up @@ -262,8 +263,9 @@
</tr>
</tbody>
</table>
<input class="btn btn-secondary" type="submit" value="' . $undoStr . '">
<input class="btn btn-primary" type="submit" name="submit" value="' . $saveStr . '">
<button class="btn btn-secondary" type="submit">' . $undoStr . '</button>
<button class="btn btn-primary" name="submit" type="submit">'
. $saveStr . '</button>
</form>';

$pagetitle = translate( 'Allow Access to Other Users Calendar' );
Expand Down Expand Up @@ -415,13 +417,15 @@
echo '
<tr>
<td colspan="2" class="boxleft alignright">'
. ( $otheruser != '__default__' && $otheruser != '__public__' ? '
<input class="btn btn-secondary" type="button" value="' . translate( 'Assistant' )
. '" onclick="selectAll(63);">&nbsp;&nbsp;' : '' ) . '
<input class="btn btn-secondary" type="button" value="' . translate( 'Select All' )
. '" onclick="selectAll(256);">&nbsp;&nbsp;
<input class="btn btn-secondary" type="button" value="' . translate( 'Clear All' )
. '" onclick="selectAll(0);">
. ( $otheruser !== '__default__' && $otheruser !== '__public__' ? '
<button class="btn btn-secondary" type="button" '
. 'onclick="selectAll(63);">'
. translate ( 'Assistant' ) . '</button>'
: '' ) . '
<button class="btn btn-secondary" type="button" '
. 'onclick="selectAll(256);">' . translate ( 'Select All' ) . '</button>
<button class="btn btn-secondary" type="button" '
. 'onclick="selectAll(0);">' . translate ( 'Clear All' ) . '</button>
</td>
<td colspan="9" class="boxright">
<table class="aligncenter" cellpadding="5" cellspacing="2">
Expand All @@ -438,8 +442,10 @@
echo '
<tr>
<td colspan="11" class="boxleft boxbottom boxright">
<input class="btn btn-secondary" type="submit" value="' . $undoStr . '">
<input class="btn btn-primary" type="submit" name="submit" value="' . $saveStr . '">
<button class="btn btn-secondary" type="submit">'
. $undoStr . '</button>
<button class="btn btn-primary" name="submit" type="submit">'
. $saveStr . '</button>
</td>
</tr>
</tbody>
Expand Down
15 changes: 8 additions & 7 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ function save_pref ( $prefs, $src ) {
@session_start();
$_SESSION['webcal_tmp_login'] = 'blahblahblah';

$editStr = '<input type="button" value="' . translate ( 'Edit' )
. "...\" onclick=\"window.open( 'edit_template.php?type=%s','cal_template','"
. 'dependent,menubar,scrollbars,height=500,width=500,outerHeight=520,'
. 'outerWidth=520\' );" name="">';
$editStr = '<button name="" type="button" '
. "onclick=\"window.open('edit_template.php?type=%s','cal_template','"
. 'dependent,menubar,scrollbars,height=500,width=500,outerHeight=520,'
. 'outerWidth=520\');">' . translate ( 'Edit' ) . '...</button>';
$choices = ['day.php', 'week.php', 'month.php', 'year.php'];
$choices_text = [translate ( 'Day' ), translate ( 'Week' ),
translate ( 'Month' ), translate ( 'Year' )];
Expand Down Expand Up @@ -243,8 +243,8 @@ function save_pref ( $prefs, $src ) {
<form action="admin.php" method="post" onsubmit="return valid_form( this );"'
. ' name="prefform">' . csrf_form_key()
. display_admin_link() . '
<input class="btn btn-primary" type="submit" value="' . $saveStr
. '" name=""><br><br>
<button class="btn btn-primary" name="" type="submit">'
. $saveStr . '</button><br><br>

<!-- TABS -->' . $tabs . '
<!-- TABS BODY -->
Expand Down Expand Up @@ -852,7 +852,8 @@ function save_pref ( $prefs, $src ) {
</div>
</div>
<div style="clear:both;">
<input class="btn btn-primary" type="submit" value="' . $saveStr . '" name="">
<button class="btn btn-primary" name="" type="submit">'
. $saveStr . '</button>
</div>
</form>
</div>
Expand Down
8 changes: 4 additions & 4 deletions approve_entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
</tr>
<tr>
<td class="aligncenter">
<input type="submit" value="' . translate ( 'Approve and Send' )
. '">&nbsp;&nbsp;&nbsp;
<input type="submit" id="cancel" name="cancel" value="'
. translate( 'Approve and Exit' ) . '">
<button type="submit">' . translate ( 'Approve and Send' )
. '</button>&nbsp;&nbsp;&nbsp;
<button id="cancel" name="cancel" type="submit">'
. translate ( 'Approve and Exit' ) . '</button>
</td>
</tr>
<tr>
Expand Down
7 changes: 4 additions & 3 deletions assistant_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@
echo "</select>\n";

if ( $GROUPS_ENABLED == 'Y' ) {
echo '<input class="btn btn-primary" type="button" onclick="selectUsers()" value="'
. translate ( 'Select' ) . '...">';
echo '<button class="btn btn-primary" type="button" onclick="selectUsers()">'
. translate ( 'Select' ) . '...</button>';
}
echo "</div>\n";

?>
<div class="form-inline col-4 pt-2">
<input class="btn btn-primary" type="submit" name="action" value="<?php etranslate ( 'Save' );?>">
<button class="btn btn-primary" name="action" type="submit">'<?php
etranslate ( 'Save' );?></button>
</div>

</form>
Expand Down
27 changes: 14 additions & 13 deletions category.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<input type="checkbox" name="delIcon" value="Y"></div>
<div class="form-inline">
<label class="col-sm-3 col-form-label" for="FileName">'
. (($ENABLE_ICON_UPLOADS == 'Y' || $is_admin)
. (($ENABLE_ICON_UPLOADS === 'Y' || $is_admin)
? translate('Add Icon to Category') . ':</label>
<input class="form-control" type="file" name="FileName" id="fileupload" size="45" '
. 'maxlength="50" value="">
Expand All @@ -76,19 +76,19 @@

<div class="form-inline p-1">
<input type="hidden" id="urlname" name="urlname" size="50">&nbsp;&nbsp;&nbsp;
<input class="btn btn-secondary openBtn" type="button" value="'
. translate('Search for existing icons...')
. '">
</div>' : '') // end test of ENABLE_ICON_UPLOADS
. '<div class="form-inline">
<input class="form-control btn btn-primary" type="submit" name="action" value="'
. ($add == '1' ? translate('Add') : translate('Save')) . '">'
<button class="btn btn-secondary openBtn" type="button">'
. translate ( 'Search for existing icons...' ) . '</button>
</div>' : '' ) . '
<div class="form-inline">
<button class="form-control btn btn-primary" name="action" type="submit">'
. ( $add === '1' ? translate ( 'Add' ) : translate ( 'Save' ) )
. '</button>'
. '<a href="category.php" class="form-control btn btn-secondary ml-1">Cancel</a> '
. (!empty($id) ? '
<input class="form-control btn btn-danger ml-1" type="submit" name="delete" value="'
. translate('Delete') . '" onclick="return confirm( '
. translate('Are you sure you want to delete this entry?', true)
. '\' )">' : '') . '
<button class="form-control btn btn-danger ml-1" name="delete" '
. 'type="submit" onclick="return confirm('
. translate ( 'Are you sure you want to delete this entry?', true )
. '\')">' . translate ( 'Delete' ) . '</button>' : '' ) . '
</div>
</form>';
} else
Expand Down Expand Up @@ -141,7 +141,8 @@

</div>
<div class="modal-footer">
<button id="modalclosebtn" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button class="btn btn-default" id="modalclosebtn" data-dismiss="modal"'
. ' type="button">' . translate ( 'Close' ) . '</button>
</div>
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions catsel.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
}
echo '
</td>
<td class="alignmiddle"><input type="button" value=">>" onclick="selAdd()"'
. '></td>
<td class="AlignMiddle"><button type="button" onclick="selAdd()">>>'
. '</button></td>
<td class="aligncenter aligntop">
<select name="eventcats[]" size="9" multiple>
<option disabled>' . $entryCatStr . '</option>';
Expand All @@ -81,16 +81,16 @@
}
echo '
</select>
<input type="button" value="' . translate ( 'Remove' )
. '" onclick="selRemove()">
<button type="button" onclick="selRemove()">'
. translate ( 'Remove' ) . '</button>
</td>
</tr>
<tr>
<td class="aligntop alignright">*' . translate ( 'Global Category' )
. '&nbsp;&nbsp;&nbsp;<input type="button" value="' . translate ( 'OK' )
. '" onclick="sendCats()"></td>
<td colspan="2" class="alignleft">&nbsp;&nbsp;<input type="button" value="'
. translate ( 'Cancel' ) . '" onclick="window.close()"></td>
. '&nbsp;&nbsp;&nbsp;<button type="button" onclick="sendCats()">'
. translate ( 'OK' ) . '</button></td>
<td class="AlignLeft" colspan="2"><button type="button" '
. 'onclick="window.close()">' . translate ( 'Cancel' ) . '</button></td>
</tr>
</form>
</table>
Expand Down
4 changes: 2 additions & 2 deletions docadd.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
<?php etranslate ( 'Comment' )?>:</label></td>
<td><textarea name="comment" rows="15" cols="60" wrap="auto"></textarea></td></tr>
<tr><td colspan="2">
<input type="submit" value="<?php etranslate ( 'Add Comment' )?>"></td></tr>
<button type="submit"><?php etranslate ( 'Add Comment' )?></button></td></tr>
</table>
</form>

Expand All @@ -236,7 +236,7 @@
<td><input type="text" name="description" size="50" maxlength="127"></td></tr>

<tr><td colspan="2">
<input type="submit" value="<?php etranslate ( 'Add Attachment' )?>"></td></tr>
<button type="submit"><?php etranslate ( 'Add Attachment' )?></button></td></tr>

</table>
</form>
Expand Down
56 changes: 32 additions & 24 deletions edit_entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,8 @@ function time_selection($prefix, $time = '', $trigger = false)
<legend class="w-auto px-2"><?php etranslate('Users'); ?></legend>
<select class="form-control m-1" name="participants[]" id="entry_part" size="<?php echo $size; ?>" multiple><?php echo $users; ?>
</select>
<input class="btn btn-secondary m-1" name="movert" type="button" value="<?php echo $addStr; ?>" onclick=" selAdd(this);">
<button class="btn btn-secondary m-1" name="movert"
type="button" onclick="selAdd(this);"><?php echo $addStr ?></button>
</fieldset>
</td>
<?php if (!empty($nonusers)) { ?>
Expand All @@ -1026,7 +1027,8 @@ function time_selection($prefix, $time = '', $trigger = false)
<select class="form-control m-1" name="nonuserPart[]" id="res_part" size="<?php echo $size; ?>" multiple>
<?php echo $nonusers; ?>
</select>
<input class="btn btn-secondary m-1" name="movert" type="button" value="<?php echo $addStr; ?>" onclick="selResource(this);">
<button class="btn btn-secondary m-1" name="movert"
type="button" onclick="selResource(this);"><?php echo $addStr ?></button>
</fieldset>
</td>
<?php } ?>
Expand All @@ -1037,7 +1039,8 @@ function time_selection($prefix, $time = '', $trigger = false)
<select class="form-control m-1" name="groups" id="groups" size="<?php echo $size; ?>" onclick="addGroup()">
<?php echo $grouplist; ?>
</select>
<input class="btn btn-secondary m-1" name="movert" type="button" value="<?php echo $addStr; ?>" onclick="selAdd(this);">
<button class="btn btn-secondary m-1" name="movert"
type="button" onclick="selAdd(this);"><?php echo $addStr ?></button>
</fieldset>
</td>
<?php } ?>
Expand All @@ -1052,8 +1055,10 @@ function time_selection($prefix, $time = '', $trigger = false)
<select class="form-control" name="selectedPart[]" id="sel_part" size="7" multiple>'
<?php echo $myusers; ?>
</select>
<input class="btn btn-secondary m-1" name="movelt" type="button" value="<?php etranslate('Remove'); ?>" onclick="selRemove( this );">
<input class="btn btn-secondary m-1" type="button" onclick="showSchedule()" value="<?php etranslate('Availability'); ?>...">
<button class="btn btn-secondary m-1" name="movelt" type="button"
onclick="selRemove(this);"><?php etranslate ( 'Remove' ); ?></button>
<button class="btn btn-secondary m-1" type="button"
onclick="showSchedule()"><?php etranslate ( 'Availability' )?>...</button>
</fieldset>
</td>
</tr>
Expand All @@ -1067,9 +1072,7 @@ function time_selection($prefix, $time = '', $trigger = false)
<?php } ?>
</table>
</div>
<?php /* // End Participants */ ?>

<?php
<?php /* // End Participants */

if ($DISABLE_REPEATING_FIELD != 'Y') {
echo "\n" . '<!-- REPEAT -->
Expand Down Expand Up @@ -1237,9 +1240,9 @@ function time_selection($prefix, $time = '', $trigger = false)
. translate($byday_names[$rpt_byday_mod]) : ' '));

echo '
<td><input type="button" name="byday" id="_' . $loop_ctr
. $rpt_byday_mod . '" value="' . $buttonvalue
. '" onclick="toggle_byday( this )"></td>';
<td><button id="_' . $loop_ctr . $rpt_byday_mod
. '" name="byday" type="button" onclick="toggle_byday(this)">'
. "$buttonvalue</button></td>";
}
echo '
</tr>';
Expand Down Expand Up @@ -1311,9 +1314,9 @@ function time_selection($prefix, $time = '', $trigger = false)
<th><label>' . $loop_ctr . '-' . ($loop_ctr + 9)
. '</label></th>' : '') . ($loop_ctr == 31 ? '
<th><label>31</label></th>' : '') . '
<td><input type="button" name="bysetpos" id="bysetpos'
. $loop_ctr . '" value="' . $buttonvalue
. '" onclick="toggle_bysetpos( this )"></td>'
<td><button id="bysetpos' . $loop_ctr
. '" name="bysetpos" type="button" onclick="toggle_bysetpos(this)">'
. "$buttonvalue</button></td>"
. ($loop_ctr % 10 == 0 ? '
</tr>
<tr>' : '');
Expand Down Expand Up @@ -1357,9 +1360,10 @@ function time_selection($prefix, $time = '', $trigger = false)
. '</label></th>' : '')
. ($loop_ctr == 31 ? '
<th><label>31</label></th>' : '') . '
<td><input type="button" name="bymonthday" id="bymonthday'
. $loop_ctr . '" value="' . $buttonvalue
. '" onclick="toggle_bymonthday( this )"></td>'
<td><button id="bymonthday' . $loop_ctr
. '" name="bymonthday" type="button" '
. 'onclick="toggle_bymonthday(this)">'
. "$buttonvalue</button></td>"
. ($loop_ctr % 10 == 0 ? '
</tr>
<tr>' : '');
Expand Down Expand Up @@ -1420,12 +1424,15 @@ function time_selection($prefix, $time = '', $trigger = false)
</select>
</td>
<td class="aligntop">
<input class="alignleft btn" type="button" name="addException" value="'
. translate('Add Exception') . '..." onclick="add_exception(0)"><br>
<input class="alignleft btn" type="button" name="addInclusion" value="'
. translate('Add Inclusion') . '..." onclick="add_exception(1)"><br>
<input class="alignleft btn" type="button" name="delSelected" value="'
. translate('Delete Selected') . '" onclick="del_selected()">
<button class="AlignLeft btn" name="addException" type="button"'
. ' onclick="add_exception(0)">'
. translate ( 'Add Exception' ) . '...</button><br>
<button class="AlignLeft btn" name="addInclusion" type="button"'
. ' onclick="add_exception(1)">'
. translate ( 'Add Inclusion' ) . '...</button><br>
<button class="AlignLeft btn" name="delSelected" type="button"'
. ' onclick="del_selected()">'
. translate ( 'Delete Selected' ) . '</button>
</td>
</tr>
</table>
Expand Down Expand Up @@ -1592,7 +1599,8 @@ function time_selection($prefix, $time = '', $trigger = false)
?>
<div class="container">
<div class="col-auto">
<input type="button" class="form-check btn btn-primary" value="<?php echo $saveStr; ?>" onclick="validate_and_submit()">
<button class="form-check btn btn-primary" type="button"
onclick="validate_and_submit()"><?php echo $saveStr ?></button>
<?php if ($id > 0 && ($login == $create_by || $single_user == 'Y' || $is_admin)) { ?>
<a class="btn btn-danger" href="del_entry.php?id=<?php echo $id; ?>&csrf_form_key=<?php echo getFormKey();?>" onclick="return confirm('<?php etranslate('Are you sure you want to delete this entry?'); ?>');">
<?php etranslate('Delete entry'); ?></a><br>
Expand Down
8 changes: 4 additions & 4 deletions edit_entry_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -1290,10 +1290,10 @@ function sort_byday( $a, $b ) {
echo
// Allow them to override a conflict if server settings allow it.
( ! empty( $ALLOW_CONFLICT_OVERRIDE ) && $ALLOW_CONFLICT_OVERRIDE == 'Y' ? '
<input type="submit" name="confirm_conflicts" value="'
. translate( 'Save' ) . '">' : '' ) . '
<input type="button" value="' . translate( 'Cancel' )
. '" onclick="history.back()">
<button name="confirm_conflicts" type="submit">'
. translate ( 'Save' ) . '</button>' : '' ) . '
<button type="button" onclick="history.back()">'
. translate ( 'Cancel' ) . '</button>
</form>';

} else
Expand Down
16 changes: 9 additions & 7 deletions edit_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,15 @@ function print_options ( $textarea, $option ) {
//}

echo '<div class="form-inline mt-1">
<input class="btn btn-primary m-1" type="submit" value="' . translate ( 'Save' ) . '">'
. ( $adding_report ? '' : '
<a href="report.php" class="btn btn-secondary m-1">' . translate('Cancel') . '</a>
<input class="btn btn-danger m-1" type="submit" name="delete" value="'
. translate ( 'Delete' ) . '" onclick="return confirm( \''
. translate( 'Are you sure you want to delete this report?' )
. '\');">' );
<button class="btn btn-primary m-1" type="submit">'
. translate ( 'Save' ) . '</button>'
. ( $adding_report ? '' : '
<a href="report.php" class="btn btn-secondary m-1">'
. translate ( 'Cancel' ) . '</a>
<button class="btn btn-danger m-1" name="delete" type="submit"'
. '" onclick="return confirm(\''
. translate ( 'Are you sure you want to delete this report?' ) . '\');">'
. translate ( 'Delete' ) . '</button>' );

?>
</div>
Expand Down
Loading