*/
static $_actionLinks = NULL;
+ /**
+ * The event links to display for the browse screen.
+ * @var array
+ */
+ static $_eventLinks = NULL;
+
static $_links = NULL;
static $_tabLinks = NULL;
return self::$_actionLinks;
}
+ public function eventLinks() {
+ if (!(self::$_eventLinks)) {
+ self::$_eventLinks = [
+ 'register_participant' => [
+ 'name' => ts('Register Participant'),
+ 'title' => ts('Register Participant'),
+ 'url' => 'civicrm/participant/add',
+ 'qs' => 'reset=1&action=add&context=standalone&eid=%%id%%',
+ ],
+ 'event_info' => [
+ 'name' => ts('Event Info'),
+ 'title' => ts('Event Info'),
+ 'url' => 'civicrm/event/info',
+ 'qs' => 'reset=1&id=%%id%%',
+ 'fe' => TRUE,
+ ],
+ 'online_registration_test' => [
+ 'name' => ts('Registration (Test-drive)'),
+ 'title' => ts('Online Registration (Test-drive)'),
+ 'url' => 'civicrm/event/register',
+ 'qs' => 'reset=1&action=preview&id=%%id%%',
+ 'fe' => TRUE,
+ ],
+ 'online_registration_live' => [
+ 'name' => ts('Registration (Live)'),
+ 'title' => ts('Online Registration (Live)'),
+ 'url' => 'civicrm/event/register',
+ 'qs' => 'reset=1&id=%%id%%',
+ 'fe' => TRUE,
+ ],
+ ];
+ }
+ return self::$_eventLinks;
+ }
+
/**
* Get tab Links for events.
*
$action -= CRM_Core_Action::UPDATE;
}
+ $eventLinks = self::eventLinks();
+ if (!CRM_Core_Permission::check('edit event participants')) {
+ unset($eventLinks['register_participant']);
+ }
+
+ $manageEvent[$dao->id]['eventlinks'] = CRM_Core_Action::formLink($eventLinks,
+ NULL,
+ array('id' => $dao->id),
+ ts('Event Links'),
+ TRUE,
+ 'event.manage.eventlinks',
+ 'Event',
+ $dao->id
+ );
$manageEvent[$dao->id]['action'] = CRM_Core_Action::formLink(self::links(),
$action,
array('id' => $dao->id),
</ul>
</span>
</div>
-
<div class="crm-event-links">
- <span id="event-links-{$row.id}" class="btn-slide crm-hover-button">{ts}Event Links{/ts}
- <ul class="panel" id="panel_links_{$row.id}">
- <li>
- <a title="Register Participant" class="action-item crm-hover-button" href="{crmURL p='civicrm/participant/add'
- q="reset=1&action=add&context=standalone&eid=`$row.id`"}">{ts}Register Participant{/ts}</a>
- </li>
- <li>
- <a title="Event Info" class="action-item crm-hover-button" href="{crmURL p='civicrm/event/info'
- q="reset=1&id=`$row.id`" fe='true'}" target="_blank">{ts}Event Info{/ts}
- </a>
- </li>
- {if $row.is_online_registration}
- <li>
- <a title="Online Registration (Test-drive)" class="action-item crm-hover-button"
- href="{crmURL p='civicrm/event/register'
- q="reset=1&action=preview&id=`$row.id`"}">{ts}Registration (Test-drive){/ts}
- </a>
- </li>
- <li>
- <a title="Online Registration (Live)" class="action-item crm-hover-button" href="{crmURL p='civicrm/event/register'
- q="reset=1&id=`$row.id`" fe='true'}" target="_blank">{ts}Registration (Live){/ts}
- </a>
- </li>
- {/if}
- </ul>
- </span>
+ {$row.eventlinks|replace:'xx':$row.id}
</div>
<div class="crm-event-more">
{$row.action|replace:'xx':$row.id}