Skip to content

Commit

Permalink
Add more choices to jemlistevents #1918
Browse files Browse the repository at this point in the history
"Open date events" and "All events", and first unfinished steps with "ongoing"
  • Loading branch information
Heklaterriol committed Mar 1, 2025
1 parent 5be2e96 commit 19b7d6b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions plugins/plg_content_jemlistevents/jemlistevents.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PlgContentJemlistevents extends CMSPlugin
/** all text tokens with their corresponding option
*/
protected static $optionTokens = array( // {jemlistevents
'type' => 'type', // [type=today|unfinished|upcoming|archived|newest];
'type' => 'type', // [type=today|unfinished|upcoming|archived|newest|open|all|ongoing];
'featured' => 'show_featured', // [featured=on|off];
'title' => 'title', // [title=on|link|off];
'cuttitle' => 'cut_title', // [cuttitle=n];
Expand All @@ -77,7 +77,7 @@ class PlgContentJemlistevents extends CMSPlugin
/** all text tokens with their corresponding option
*/
protected static $tokenValues = array( // {jemlistevents
'type' => array('today', 'unfinished', 'upcoming', 'archived', 'newest'),
'type' => array('today', 'unfinished', 'upcoming', 'ongoing', 'archived', 'newest', 'open', 'all'),
'featured' => array('on', 'off'),
'title' => array('on', 'link', 'off'),
'date' => array('on', 'link', 'off'),
Expand Down Expand Up @@ -288,6 +288,16 @@ protected function _load($parameters)
$model->setState('filter.published', 1);
$model->setState('filter.orderby', array('a.id DESC'));
break;
case 'open': //open events = events with no start and enddate
$model->setState('filter.published', 1);
$model->setState('filter.orderby', array('a.id DESC'));
$model->setState('filter.opendates', 2);
break;
case 'all': //all events
$model->setState('filter.published', array(1, 2));
$model->setState('filter.orderby', array('a.dates ASC', 'a.times ASC'));
$model->setState('filter.opendates', 1);
break;
} // switch type

//$model->setState('filter.calendar_from', $cal_from);
Expand Down
3 changes: 3 additions & 0 deletions plugins/plg_content_jemlistevents/jemlistevents.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
<option value="today" >PLG_CONTENT_JEMLISTEVENTS_TODAYS_EVENTS</option>
<option value="unfinished">PLG_CONTENT_JEMLISTEVENTS_UNFINISHED_EVENTS</option>
<option value="upcoming" >PLG_CONTENT_JEMLISTEVENTS_UPCOMING_EVENTS</option>
<option value="ongoing" >PLG_CONTENT_JEMLISTEVENTS_ONGOING_EVENTS</option>
<option value="archived" >PLG_CONTENT_JEMLISTEVENTS_ARCHIVED_EVENTS</option>
<option value="newest" >PLG_CONTENT_JEMLISTEVENTS_NEWEST_EVENTS</option>
<option value="open" >PLG_CONTENT_JEMLISTEVENTS_OPEN_EVENTS</option>
<option value="all" >PLG_CONTENT_JEMLISTEVENTS_ALL_EVENTS</option>
</field>
<field name="show_featured" type="radio"
class="btn-group btn-group-yesno"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ PLG_CONTENT_JEMLISTEVENTS_LINK="Yes with link"
PLG_CONTENT_JEMLISTEVENTS_TODAYS_EVENTS="Today's events"
PLG_CONTENT_JEMLISTEVENTS_UNFINISHED_EVENTS="Unfinished events"
PLG_CONTENT_JEMLISTEVENTS_UPCOMING_EVENTS="Upcoming events"
PLG_CONTENT_JEMLISTEVENTS_ONGOINGG_EVENTS="Ongoing events"
PLG_CONTENT_JEMLISTEVENTS_ARCHIVED_EVENTS="Archived events"
PLG_CONTENT_JEMLISTEVENTS_NEWEST_EVENTS="Newest events"
PLG_CONTENT_JEMLISTEVENTS_OPEN_EVENTS="Open date events"
PLG_CONTENT_JEMLISTEVENTS_ALL_EVENTS="All events (except trashed)"
PLG_CONTENT_JEMLISTEVENTS_FEATURED_LABEL="Featured only"
PLG_CONTENT_JEMLISTEVENTS_FEATURED_DESCRIPTION="Only show featured events accordiung to the settings above"
PLG_CONTENT_JEMLISTEVENTS_TYPE_LABEL="Type of events"
Expand Down

0 comments on commit 19b7d6b

Please sign in to comment.