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

strike not supported in html5 #459

Merged
merged 7 commits into from
Aug 31, 2024
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
4 changes: 2 additions & 2 deletions docs/WebCalendar-UserManual.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body id="manual">
<h1>WebCalendar User Manual</h1>
<p class="b">WebCalendar Version: 1.9.9</p>
<p class="b">WebCalendar Version: 1.9.12</p>
<h2>Table of Contents</h2>
<ul>
<li><a href="#intro">Introduction</a></li>
Expand Down Expand Up @@ -340,7 +340,7 @@ <h2><a id="categories">Categories</a></h2>
<p>Events may be associated with one or more categories, but it is not required. Categories can be user-level or global. Each user maintains his/her own list of user-level categories, while the system administrator maintains the list of global categories.</p>
<p>When creating or editing event, you may specify the categories for the event. If the category you select isn't a global category, and you select participants other than yourself for that event, other users will see "None" as the category. If you selected a global category, all users will be able to see the same category.</p>
<p>When viewing the calendar (month, week or day), a selection box is displayed near the top of the page that allows you to filter events based on a category. When you select a category from this menu, only events associated with that category will appear on your calendar.</p>
<p>If enabled, icons can also be uploaded and assigned to categories to be displayed before the event name. You will also be able to choose an icon from existing icons that have already been uploaded. This requires that a folder named <tt>icons</tt> exist in the WebCalendar directory.</p>
<p>If enabled, icons can also be uploaded and assigned to categories to be displayed before the event name. You will also be able to choose an icon from existing icons that have already been uploaded. This requires that a folder named <span class="tt">icons</span> exist in the WebCalendar directory.</p>
<a href="#" target="_top">↑&nbsp;top</a>
<hr>
<h2><a id="views">Views</a></h2>
Expand Down
20 changes: 11 additions & 9 deletions includes/assert.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?php
/**
* This file implements the assertion handler.
* Implements the assertion handler.
*
* This is called anytime a WebCalendar call to assert() fails.
*
* @todo Create a link that will pass all the bug details to a form hosted on
* k5n.us so that it can be easily submitted.
* @todo Create a link that will pass all the bug details to a form
* hosted on k5n.us so that it can be easily submitted.
*
* @author Craig Knudsen <cknudsen@cknudsen.com>
* @copyright Craig Knudsen, <cknudsen@cknudsen.com>, http://k5n.us/webcalendar
* @license https://gnu.org/licenses/old-licenses/gpl-2.0.html GNU GPL
*
* @package WebCalendar
*/

/*
/**
* Setup callback function only if $settings.php mode == dev
*/
if ( ! empty ( $run_mode ) && $run_mode == 'dev' )
Expand Down Expand Up @@ -79,17 +81,17 @@ function assert_backtrace() {
*
* Abort execution, print the specified error message along with a stack trace.
*
* @param string $script Pathname where assertion failed
* @param int $line Line number where assertion failed
* @param string $msg Failed assertion expression
* @param string $script Pathname where assertion failed
* @param int $line number where assertion failed
* @param string $msg Failed assertion expression
*/
function assert_handler ( $script, $line, $msg='' ) {
if ( empty ( $msg ) )
$msg = 'Assertion failed<br>' . "\n";
$msg = "Assertion failed<br>\n";
$trace = ( function_exists ( 'debug_backtrace' )
? assert_backtrace() : basename( $script ) . ': ' . $line . ' ' . $msg );
$msg .= ( function_exists ( 'debug_backtrace' ) ? '<b>Stack Trace:</b><br><br>' : '' )
. '<blockquote><tt>' . nl2br ( $trace ) . '</tt></blockquote>';
. '<blockquote class="tt">' . nl2br ( $trace ) . '</blockquote>';
if ( function_exists ( 'die_miserable_death' ) )
die_miserable_death ( $msg );
else {
Expand Down
55 changes: 27 additions & 28 deletions includes/classes/WebCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ class WebCalendar {
/**
* WebCalendar constructor.
*
* @param string $path Full path of file being viewed.
* @param string $path full path of file being viewed
*
* @return WebCalendar New WebCalendar object.
* @return WebCalendar new WebCalendar object
*
* @access public
*/
Expand Down Expand Up @@ -126,8 +126,7 @@ function _initInitFirstPhase() {
if ( empty ( $HTTP_POST_VARS ) )
$HTTP_POST_VARS = $_POST;

if ( ! empty ( $HTTP_GET_VARS ) && empty ( $HTTP_GET_VARS['user'] ) && !
empty ( $HTTP_POST_VARS ) && empty ( $HTTP_POST_VARS['user'] ) &&
if ( ! empty ( $HTTP_GET_VARS ) && empty ( $HTTP_GET_VARS['user'] ) && ! empty ( $HTTP_POST_VARS ) && empty ( $HTTP_POST_VARS['user'] ) &&
isset ( $GLOBALS['user'] ) )
unset ( $GLOBALS['user'] );

Expand Down Expand Up @@ -234,10 +233,10 @@ function _initInitSecondPhase() {
if ( $PUBLIC_ACCESS_OTHERS != 'Y' )
$user = ''; // Security precaution.
}
if (!$is_admin && !$is_assistant && !$is_nonuser_admin) {
if ( ! $is_admin && ! $is_assistant && ! $is_nonuser_admin ) {
if ($is_nonuser)
$can_add = false;
else if (!empty($user) && $user != $login && $user != '__public__')
elseif ( ! empty ( $user ) && $user !== $login && $user !== '__public__' )
$can_add = false;
}

Expand All @@ -258,7 +257,7 @@ function _initInitSecondPhase() {

if ( ! empty ( $user ) ) {
$u_url = 'user=' . $user . '&amp;';
if (!user_load_variables ( $user, 'user_' ))
if ( ! user_load_variables ( $user, 'user_' ) )
nonuser_load_variables($user, 'user_');
if ( $user == '__public__' )
$user_fullname = translate ( $PUBLIC_ACCESS_FULLNAME );
Expand Down Expand Up @@ -582,7 +581,7 @@ function _initValidate() {
if ( empty($cooie_check[0]) || empty($cooie_check[1]))
$session_not_found = true;
}
if (! $session_not_found) {
if ( ! $session_not_found ) {
$login_pw = explode('|', decode_string($encoded_login));
$login = $login_pw[0];
$cryptpw = $login_pw[1];
Expand All @@ -598,9 +597,9 @@ function _initValidate() {
// The following deletes the bad cookie.
// So, the user just needs to reload.
sendCookie ( 'webcalendar_session', '', 0 );
die_miserable_death ( 'Illegal characters in login <tt>'
die_miserable_death ( 'Illegal characters in login <span class="tt">'
. htmlentities ( $login )
. '</tt>. Press browser reload to clear bad cookie.' );
. '</span>. Press browser reload to clear bad cookie.' );
}

// Make sure we are connected to the database for password check.
Expand Down Expand Up @@ -684,8 +683,8 @@ function _initConnect() {
// make sure that the login selected is a valid login.
if ( $single_user == 'Y' ) {
if ( empty ( $single_user_login ) )
die_miserable_death ( 'You have not defined <tt>single_user_login</tt> '
. 'in <tt>includes/settings.php</tt>.' );
die_miserable_death ( 'You have not defined <span class="tt">single_user_login</span> '
. 'in <span class="tt">includes/settings.php</span>.' );

$res = dbi_execute ( 'SELECT COUNT( * ) FROM webcal_user
WHERE cal_login = ?', [$single_user_login] );
Expand All @@ -699,8 +698,8 @@ function _initConnect() {
if ( ! dbi_execute ( 'INSERT INTO webcal_user ( cal_login, cal_passwd,
cal_is_admin ) VALUES ( ?, ?, ? )',
[$single_user_login, md5 ( $single_user_login ), 'Y'] ) )
die_miserable_death ( 'User <tt>' . $single_user_login
. '</tt> does not exist in <tt>webcal_user</tt> table and we were '
die_miserable_death ( 'User <span class="tt">' . $single_user_login
. '</span> does not exist in <span class="tt">webcal_user</span> table and we were '
. 'not able to add it for you:<br><blockquote>' . dbi_error()
. '</blockquote>' );

Expand Down Expand Up @@ -942,7 +941,7 @@ function _initTranslate() {
if (extension_loaded('mbstring')) {
$mb_lang = strtok($lang, '-');
// Check the language against the map, default to 'neutral' if not found
$mapped_lang = isset($this->mb_language_map[$mb_lang]) ? $this->mb_language_map[$mb_lang] : 'neutral';
$mapped_lang = $this->mb_language_map[$mb_lang] ?? 'neutral';
if (@mb_language($mapped_lang) && mb_internal_encoding(translate('charset'))) {
$enable_mbstring = true;
} else {
Expand All @@ -958,7 +957,7 @@ function _initTranslate() {
/**
* Gets the initialization phases for the page being viewed.
*
* @return array Array of initialization phases.
* @return array of initialization phases
*
* @access private
*/
Expand All @@ -976,9 +975,9 @@ function _getPhases() {
/**
* Gets the initialization steps for the current page and phase.
*
* @param int $phase Initialization phase number
* @param int $phase Initialization phase number
*
* @return array Array of initialization steps.
* @return array of initialization steps
*
* @access private
*/
Expand All @@ -991,7 +990,7 @@ function _getSteps ( $phase ) {
/**
* Performs initialization steps.
*
* @param int $phase Which step of initialization should we perform?
* @param int $phase Which step of initialization should we perform?
*
* @access private
*/
Expand All @@ -1006,7 +1005,7 @@ function _doInit ( $phase ) {
/**
* Begins initialization of WebCalendar.
*
* @param string $path Full path of page being viewed
* @param string $path Full path of page being viewed
*
* @access public
*/
Expand All @@ -1017,7 +1016,7 @@ function initializeFirstPhase() {
/**
* Continues initialization of WebCalendar.
*
* @param string $path Full path of page being viewed
* @param string $path Full path of page being viewed
*
* @access public
*/
Expand All @@ -1034,13 +1033,13 @@ function setLanguage() {
$this->_initTranslate();
}

/**
* Construct an absolute path.
*
* @param string $path The path relative to the WebCalendar install directory
*
* @return string The absolute path
*/
/**
* Construct an absolute path.
*
* @param string $path relative to the WebCalendar install directory
*
* @return string The absolute path
*/
function absolutePath ( $path ) {
return $this->_directory . $path;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ul {
}

.tt {
font: 0.85rem monospace;
font: 0.85rem 'Lucida Console', monospace;
}

.vtop {
Expand Down
5 changes: 5 additions & 0 deletions includes/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ a#programname {
margin-top:.4375rem;
margin-right:.1875rem;
}

.tt {
font-family: 'Lucida Console', monospace";
}

#activitylog .next,
#activitylog .prev {
border:0;
Expand Down
13 changes: 9 additions & 4 deletions purge.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
<form><button class="btn btn-primary" type="button" onclick="history.back()">
<?php etranslate ( 'Back' )?></button></form><?php
if ( $purgeDebug ) {
echo '<div style="border: 1px solid #000;background-color: #FFF;"><tt>'
. "$sqlLog</tt></div>\n";
echo '<div style="border: 1px solid #000;background-color: #FFF;"><span class="tt">'
. "$sqlLog</span></div>\n";
}
} else {
?>
Expand Down Expand Up @@ -171,7 +171,9 @@

<?php echo print_trailer();
/**
* purge_events (needs description)
* purge_events
*
* @param mixed $ids
*/
function purge_events ( $ids ) {
global $allStr, $c, // db connection
Expand Down Expand Up @@ -231,7 +233,10 @@ function purge_events ( $ids ) {
}
}
/**
* get_ids (needs description)
* get_ids
*
* @param mixed $sql
* @param mixed $ALL
*/
function get_ids ( $sql, $ALL = '' ) {
global $sqlLog;
Expand Down
18 changes: 9 additions & 9 deletions translations/English-US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ hour ahead of you: hour ahead of you
hour behind you: hour behind you
hours ahead of you: hours ahead of you
hours behind you: hours behind you
XXX is in a different timezone (ahead): (XXX is in a different timezone; YYY ahead of you.<br />&nbsp;ZZZ)
XXX is in a different timezone (behind): (XXX is in a different timezone; YYY behind you.<br />&nbsp;ZZZ)
XXX is in a different timezone (ahead): (XXX is in a different timezone; YYY ahead of you.<br>&nbsp;ZZZ)
XXX is in a different timezone (behind): (XXX is in a different timezone; YYY behind you.<br>&nbsp;ZZZ)
Time entered here is based on your Timezone.: Time entered here is based on <b>your</b> Timezone.
Edit Entry: Edit Entry
Add Entry: Add Entry
Expand Down Expand Up @@ -205,7 +205,7 @@ Start: Start
End/Due: End/Due
Times: Times
Every: Every
CAPTCHA Warning: <b>Warning:</b> Cannot use CAPTCHA without PHP's GD extension!<br />
CAPTCHA Warning: <b>Warning:</b> Cannot use CAPTCHA without PHP's GD extension!<br>
Are you sure you want to delete this entry?: Are you sure you want to delete this entry?
Delete entry: Delete entry
Edit Categories: Edit Categories
Expand Down Expand Up @@ -422,7 +422,7 @@ Records deleted from XXX: Records deleted from "XXX".
# Page: edit_report_handler.php
#
No such report id XXX.: No such report id: "XXX".
Variable XXX not found.: Variable <tt>XXX</tt> not found.
Variable XXX not found.: Variable <span class="tt">XXX</span> not found.
Page template: Page template
Day template: Day template
Event template: Event template
Expand Down Expand Up @@ -522,7 +522,7 @@ Upload file: Upload file
Fatal Error: Fatal Error
Invalid form request: Invalid form request
You have been logged out.: You have been logged out.
Illegal characters in login XXX.: Illegal characters in login <tt>XXX</tt>.
Illegal characters in login XXX.: Illegal characters in login <span class="tt">XXX</span>.
You must provide a password.: You must provide a password.
Invalid login: Invalid login
Activity login failure: Username: "XXX", IP: "YYY".
Expand Down Expand Up @@ -573,7 +573,7 @@ Date format: Date format
Small Task Date: Small Task Date
preferred-event-visibility: Default visibility for new events
Default Visibility: Default Visibility
time-format-help: Specifies which time format to use:<br /><em>12 hour:</em> Display times as 3am, 8:30pm, etc.<br /><em>24 hour:</em> Display times as 300, 2030, etc.
time-format-help: Specifies which time format to use:<br><em>12 hour:</em> Display times as 3am, 8:30pm, etc.<br><em>24 hour:</em> Display times as 300, 2030, etc.
Time format: Time format
12 hour: 12 hour
24 hour: 24 hour
Expand Down Expand Up @@ -614,7 +614,7 @@ display-tasks-in-grid-help: Display tasks in calendars along with events
Display tasks in Calendars: Display tasks in Calendars
lunar-help: If enabled, will display small icons representing the lunar phases each month
Display Lunar Phases in month view: Display Lunar Phases in month view
display-unapproved-help: Specifies whether unapproved events are displayed in your calendar.<br /> If set to "Yes", then unapproved events will be displayed in your calendar (in a different text color).<br /> If set to "No", then unapproved events must be approved before they are displayed in your calendar.
display-unapproved-help: Specifies whether unapproved events are displayed in your calendar.<br> If set to "Yes", then unapproved events will be displayed in your calendar (in a different text color).<br> If set to "No", then unapproved events must be approved before they are displayed in your calendar.
Display unapproved: Display unapproved
timed-evt-len-help: Specifies input method for determining the length of a timed event.
Specify timed event length by: Specify timed event length by
Expand Down Expand Up @@ -958,7 +958,7 @@ Security Issue: Security Issue
Default admin user password: Default admin user password
You should change the password of the default admin user.: You should change the password of the default admin user.
File permissions XXX: File permissions: XXX
item XXX should not be writable: The following item should not be writable:<br /><tt>XXX</tt>
item XXX should not be writable: The following item should not be writable:<br><span class="tt">XXX</span>
File exists XXX: File exists: "XXX"
Because you have email disabled, you should remove this file.: Because you have email disabled, you should remove this file.
File location XXX: File location: "XXX"
Expand Down Expand Up @@ -1683,7 +1683,7 @@ Help Contents: Help Contents
########################################
# Page: includes/config.php
#
Could not find settings.php file...: Could not find "settings.php" file.<br />Please copy "settings.php.orig" to "settings.php" and edit for your site.
Could not find settings.php file...: Could not find "settings.php" file.<br>Please copy "settings.php.orig" to "settings.php" and edit for your site.
Incomplete settings.php file...: Incomplete settings.php file...
Could not find XXX defined in...: Could not find "XXX" defined in your "settings.php" file.
You must define XXX in: You must define "XXX" in the "settings.php" file.
Expand Down
12 changes: 7 additions & 5 deletions view_entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,13 @@
$can_email = access_user_calendar ( 'email', $templogin );

echo '
<strike>' . ( strlen ( $tempemail ) > 0 && $can_email != 'N'
? '<a href="mailto:' . $tempemail . '?subject=' . $subject . '">'
. $tempfullname . '</a>'
: $tempfullname ) . '</strike> (' . translate ( 'Rejected' ) . ')<br>';
}
<del>'
. ( strlen ( $tempemail ) > 0 && $can_email !== 'N'
? '<a href="mailto:' . $tempemail . '?subject=' . $subject . '">'
. $tempfullname . '</a>'
: $tempfullname )
. '</del> (' . translate ( 'Rejected' ) . ')<br>';
}
}
echo '</div><div class="w-100"></div></div>' . "\n";
} // end participants
Expand Down