Skip to content

Commit

Permalink
Merge pull request #1294 from jemproject/jem2.3.4-php8
Browse files Browse the repository at this point in the history
Do PHP8 compatible release
  • Loading branch information
Egnarts94 authored Nov 5, 2022
2 parents f399727 + 71c8c2c commit ae0603f
Show file tree
Hide file tree
Showing 26 changed files with 147 additions and 159 deletions.
26 changes: 13 additions & 13 deletions admin/helpers/html/jemhtml.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @version 2.3.1
* @version 2.3.4
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2013-2022 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand All @@ -17,10 +17,10 @@ abstract class JHtmlJemHtml
{
/**
*
* @param int $value state value
* @param int $i
* @param int $value state value
*/
static public function featured($value = 0, $i, $canChange = true)
static public function featured($i, $value = 0, $canChange = true)
{
// Array of image, iconfont, task, title, action
$states = array(
Expand Down Expand Up @@ -51,12 +51,12 @@ static public function featured($value = 0, $i, $canChange = true)

/**
*
* @param int $value state value
* @param int $i
* @param int $value state value
* @deprecated since version 2.1.7
*/
static public function toggleStatus($value = 0, $i, $canChange = true)
static public function toggleStatus($i, $value = 0, $canChange = true)

{
if (class_exists('JemHelper')) {
JemHelper::addLogEntry('Use of this function is deprecated. Use JemHekper::toggleAttendanceStatus() instead.', __METHOD__, JLog::WARNING);
Expand Down Expand Up @@ -92,14 +92,14 @@ static public function toggleStatus($value = 0, $i, $canChange = true)
/**
* Returns text of attendance status, maybe incl. hint to toggle this status.
*
* @param int $value status value
* @param int $i registration record id
* @param int $value status value
* @param bool $canChange current user is allowed to modify the status
* @param bool $print if true show icon AND text for printing
* @return string The html snippet.
*/
static public function getAttendanceStatusText($value = 0, $i, $canChange = true, $print = false)
static public function getAttendanceStatusText($i, $value = 0, $canChange = true, $print = false)

{
// Array of image, iconfont, task, alt-text, alt-text edit, tooltip
$states = array(
Expand Down Expand Up @@ -159,14 +159,14 @@ static public function getAttendanceStatusText($value = 0, $i, $canChange = true
/**
* Creates html code to show attendance status, maybe incl. link to toggle this status.
*
* @param int $value status value
* @param int $i registration record id
* @param int $value status value
* @param bool $canChange current user is allowed to modify the status
* @param bool $print if true show icon AND text for printing
* @return string The html snippet.
*/
static public function toggleAttendanceStatus($value = 0, $i, $canChange = true, $print = false)
static public function toggleAttendanceStatus($i, $value = 0, $canChange = true, $print = false)

{
// Array of image, iconfont, task, alt-text, alt-text edit, tooltip
$states = array(
Expand Down
10 changes: 0 additions & 10 deletions admin/models/forms/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,6 @@
>
<option value="0">COM_JEM_DISABLED</option>
<option value="1">COM_JEM_ENABLED</option>
</field>
<field name="frontendpublish" type="list"
label="COM_JEM_FRONTEND_PUBLISH_OPTIONS"
description="COM_JEM_FRONTEND_PUBLISH_OPTIONS_DESC"
class="inputbox"
default="0"
required="false"
>
<option value="0">COM_JEM_DISABLED</option>
<option value="1">COM_JEM_ENABLED</option>
</field>
</fieldset>

Expand Down
2 changes: 1 addition & 1 deletion admin/models/sampledata.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function loadData()
// Process queries
foreach ($queries as $query) {
$query = trim($query);
if ($query != '' && $query{0} != '#') {
if ($query != '' && $query[0] != '#') {

$this->_db->setQuery($query);
$this->_db->execute();
Expand Down
6 changes: 3 additions & 3 deletions admin/views/attendees/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @version 2.3.1
* @version 2.3.4
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2013-2022 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand Down Expand Up @@ -110,7 +110,7 @@ function submitName(node) {
<?php
$status = (int)$row->status;
if ($status === 1 && $row->waiting == 1) { $status = 2; }
echo JHtml::_('jemhtml.toggleAttendanceStatus', $status, $i, $canChange);
echo JHtml::_('jemhtml.toggleAttendanceStatus', $i, $status, $canChange);
?>
</td>
<?php if (!empty($this->jemsettings->regallowcomments)) : ?>
Expand Down
8 changes: 4 additions & 4 deletions admin/views/categories/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @version 2.3.1
* @version 2.3.4
* @package JEM
* @copyright Copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright Copyright (C) 2013-2022 joomlaeventmanager.net
* @copyright Copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand Down Expand Up @@ -187,8 +187,8 @@
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="original_order_values" value="<?php echo implode($originalOrders, ','); ?>" />
<input type="hidden" name="original_order_values" value="<?php echo implode(',', $originalOrders); ?>" />

<?php echo JHtml::_('form.token'); ?>
</div>
</form>
6 changes: 3 additions & 3 deletions admin/views/events/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @version 2.3.1
* @version 2.3.4
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2013-2022 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand Down Expand Up @@ -175,7 +175,7 @@
</td>
<td class="center"><?php echo $published; ?></td>
<td class="center">
<?php echo JHtml::_('jemhtml.featured', $row->featured, $i, $canChange); ?>
<?php echo JHtml::_('jemhtml.featured', $i, $row->featured, $canChange); ?>
</td>
<td>
<?php echo JText::_('COM_JEM_AUTHOR').': '; ?><a href="<?php echo 'index.php?option=com_users&amp;task=edit&amp;hidemainmenu=1&amp;cid[]='.$row->created_by; ?>"><?php echo $row->author; ?></a><br />
Expand Down
6 changes: 3 additions & 3 deletions jem.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="2.5" method="upgrade">
<name>com_jem</name>
<creationDate>April 2021</creationDate>
<creationDate>November 2022</creationDate>
<author>JEM Community</author>
<copyright>Copyright (C) 2013-2021 joomlaeventmanager.net</copyright>
<copyright>Copyright (C) 2013-2022 joomlaeventmanager.net</copyright>
<license>https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.joomlaeventmanager.net</authorUrl>
<version>2.3.3</version>
<version>2.3.5</version>
<description>COM_JEM_INSTALLATION_DESCRIPTION</description>

<!-- Runs on install/uninstall/update; New in 1.6 -->
Expand Down
6 changes: 3 additions & 3 deletions package/pkg_jem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<extension type="package" version="2.5" method="upgrade">
<name>pkg_jem</name>
<packagename>jem</packagename>
<creationDate>April 2021</creationDate>
<copyright>Copyright (C) 2013-2021 joomlaeventmanager.net</copyright>
<creationDate>November 2022</creationDate>
<copyright>Copyright (C) 2013-2022 joomlaeventmanager.net</copyright>
<license>https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<author>JEM Community</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.joomlaeventmanager.net</authorUrl>

<version>2.3.1</version>
<version>2.3.5</version>
<description>PKG_JEM_INSTALLATION_DESCRIPTION</description>
<url>http://www.joomlaeventmanager.net/</url>
<packager>JEM Community</packager>
Expand Down
Binary file removed pkg_jem_v2.3.3_gut.zip
Binary file not shown.
16 changes: 8 additions & 8 deletions site/classes/iCalcreator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ function parse( $unparsedtext=FALSE ) {
$proprows = array();
for( $i = 0; $i < count( $this->unparsed ); $i++ ) { // concatenate lines
$line = rtrim( $this->unparsed[$i], $nl );
while( isset( $this->unparsed[$i+1] ) && !empty( $this->unparsed[$i+1] ) && ( ' ' == $this->unparsed[$i+1]{0} ))
while( isset( $this->unparsed[$i+1] ) && !empty( $this->unparsed[$i+1] ) && ( ' ' == $this->unparsed[$i+1][0] ))

$line .= rtrim( substr( $this->unparsed[++$i], 1 ), $nl );
$proprows[] = $line;
Expand Down Expand Up @@ -3064,8 +3064,8 @@ function setFreebusy( $fbType, $fbValues, $params=FALSE, $index=FALSE ) {
}
}
elseif(( 3 <= strlen( trim( $fbMember ))) && // string format duration
( in_array( $fbMember{0}, array( 'P', '+', '-' )))) {
if( 'P' != $fbMember{0} )
( in_array( $fbMember[0], array( 'P', '+', '-' )))) {
if( 'P' != $fbMember[0] )

$fbmember = substr( $fbMember, 1 );
$freebusyPairMember = iCalUtilityFunctions::_durationStr2arr( $fbMember );
Expand Down Expand Up @@ -3992,7 +3992,7 @@ function setTrigger( $year, $month=null, $day=null, $week=FALSE, $hour=FALSE, $m
}
elseif(is_string( $year ) && ( is_array( $month ) || empty( $month ))) { // duration or date in a string
$params = iCalUtilityFunctions::_setParams( $month );
if( in_array( $year{0}, array( 'P', '+', '-' ))) { // duration
if( in_array( $year[0], array( 'P', '+', '-' ))) { // duration

$relatedStart = ( isset( $params['RELATED'] ) && ( 'END' == strtoupper( $params['RELATED'] ))) ? FALSE : TRUE;
$before = ( '-' == $year[0] ) ? TRUE : FALSE;
Expand Down Expand Up @@ -4255,7 +4255,7 @@ function _makeUid() {
$length = 6;
$str = null;
for( $p = 0; $p < $length; $p++ )
$unique .= $base{mt_rand( $start, $end )};
$unique .= $base[mt_rand( $start, $end )];

$this->uid = array( 'params' => null );
$this->uid['value'] = $date.'-'.$unique.'@'.$this->getConfig( 'unique_id' );
Expand Down Expand Up @@ -5731,7 +5731,7 @@ function parse( $unparsedtext=null ) {
$proprows = array();
for( $i = 0; $i < count( $this->unparsed ); $i++ ) { // concatenate lines
$line = rtrim( $this->unparsed[$i], $nl );
while( isset( $this->unparsed[$i+1] ) && !empty( $this->unparsed[$i+1] ) && ( ' ' == $this->unparsed[$i+1]{0} ))
while( isset( $this->unparsed[$i+1] ) && !empty( $this->unparsed[$i+1] ) && ( ' ' == $this->unparsed[$i+1][0] ))

$line .= rtrim( substr( $this->unparsed[++$i], 1 ), $nl );
$proprows[] = $line;
Expand Down Expand Up @@ -6963,7 +6963,7 @@ public static function _chkdatecfg( $theDate, & $parno, & $params ) {
if( isset( $theDate['timestamp'] ))
$tzid = ( isset( $theDate['tz'] )) ? $theDate['tz'] : null;
else
$tzid = ( isset( $theDate['tz'] )) ? $theDate['tz'] : ( 7 == count( $theDate )) ? end( $theDate ) : null;
$tzid = ( isset( $theDate['tz'] )) ? $theDate['tz'] : (( 7 == count( $theDate )) ? end( $theDate ) : null);
if( !empty( $tzid )) {

$parno = 7;
Expand Down Expand Up @@ -7063,7 +7063,7 @@ public static function convEolChar( & $text, $nl ) {
$base = 'aAbB!cCdD"eEfF#gGhHiIjJ%kKlL&mMnN/oOpP(rRsS)tTuU=vVxX?uUvV*wWzZ-1234_5678|90';
$len = strlen( $base ) - 1;
for( $p = 0; $p < 6; $p++ )
iCalUtilityFunctions::$baseDelim .= $base{mt_rand( 0, $len )};
iCalUtilityFunctions::$baseDelim .= $base[mt_rand( 0, $len )];

}
/* fix eol chars */
Expand Down
6 changes: 3 additions & 3 deletions site/classes/output.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @version 2.3.1
* @version 2.3.4
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2013-2022 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand All @@ -11,7 +11,7 @@
// ensure JemFactory is loaded (because this class is used by modules or plugins too)
require_once(JPATH_SITE.'/components/com_jem/factory.php');

JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/helpers/html');
JHtml::addIncludePath(JPATH_SITE . '/administrator/components/com_jem/helpers/html');

/**
* Holds the logic for all output related things
Expand Down
6 changes: 3 additions & 3 deletions site/views/attendees/tmpl/addusers.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @version 2.3.1
* @version 2.3.4
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2013-2022 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand Down Expand Up @@ -101,7 +101,7 @@ function checkList(form)
<td class="center"><?php echo $this->pagination->getRowOffset( $i ); ?></td>
<td class="center"><?php echo JHtml::_('grid.id', $i, $row->id); ?></td>
<td align="left"><?php echo $this->escape($row->name); ?></td>
<td class="center"><?php echo JHtml::_('jemhtml.toggleAttendanceStatus', $row->status, 0, false); ?></td>
<td class="center"><?php echo JHtml::_('jemhtml.toggleAttendanceStatus', 0, $row->status, false); ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
Expand Down
8 changes: 4 additions & 4 deletions site/views/attendees/tmpl/alternative/default.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @version 2.3.1
* @version 2.3.4
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2013-2022 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand Down Expand Up @@ -207,9 +207,9 @@ function jSelectUsers_newusers(ids, count, status, eventid, token) {
<?php
$status = (int)$row->status;
if ($status === 1 && $row->waiting == 1) { $status = 2; }
echo JHtml::_('jemhtml.toggleAttendanceStatus', $status, $row->id, true);
echo JHtml::_('jemhtml.toggleAttendanceStatus', $row->id, $status, true);
?><span class="info-text"><?php
echo JHtml::_('jemhtml.getAttendanceStatusText', $status, $row->id, false, true);
echo JHtml::_('jemhtml.getAttendanceStatusText', $row->id, $status, false, true);
?></span>
</div>
<?php if (array_key_exists('comment', $a_span)) : ?>
Expand Down
6 changes: 3 additions & 3 deletions site/views/attendees/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @version 2.3.1
* @version 2.3.4
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2013-2022 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand Down Expand Up @@ -138,7 +138,7 @@ function jSelectUsers_newusers(ids, count, status, eventid, token) {
<?php
$status = (int)$row->status;
if ($status === 1 && $row->waiting == 1) { $status = 2; }
echo JHtml::_('jemhtml.toggleAttendanceStatus', $status, $row->id, true);
echo JHtml::_('jemhtml.toggleAttendanceStatus', $row->id, $status, true);
?>
</td>
<?php if (!empty($this->jemsettings->regallowcomments)) : ?>
Expand Down
Loading

0 comments on commit ae0603f

Please sign in to comment.