本文整理汇总了PHP中BASE_CLASS_EventCollector::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP BASE_CLASS_EventCollector::getData方法的具体用法?PHP BASE_CLASS_EventCollector::getData怎么用?PHP BASE_CLASS_EventCollector::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BASE_CLASS_EventCollector
的用法示例。
在下文中一共展示了BASE_CLASS_EventCollector::getData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionDelete
/**
* Adds listener to the event collecting user credits actions for removal
*
* @param BASE_CLASS_EventCollector $coll
*/
public function actionDelete(BASE_CLASS_EventCollector $coll)
{
$data = $coll->getData();
if (!count($data)) {
return;
}
USERCREDITS_BOL_CreditsService::getInstance()->deleteActions($data);
}
示例2: view
/**
* View event controller
*
* @param array $params
*/
public function view($params)
{
$event = $this->getEventForParams($params);
$cmpId = UTIL_HtmlTag::generateAutoId('cmp');
$this->assign('contId', $cmpId);
if (!OW::getUser()->isAuthorized('event', 'view_event') && $event->getUserId() != OW::getUser()->getId()) {
$this->assign('authErrorText', OW::getLanguage()->text('event', 'event_view_permission_error_message'));
return;
}
// guest gan't view private events
if ((int) $event->getWhoCanView() === EVENT_BOL_EventService::CAN_VIEW_INVITATION_ONLY && !OW::getUser()->isAuthenticated()) {
$this->redirect(OW::getRouter()->urlForRoute('event.private_event', array('eventId' => $event->getId())));
}
$eventInvite = $this->eventService->findEventInvite($event->getId(), OW::getUser()->getId());
$eventUser = $this->eventService->findEventUser($event->getId(), OW::getUser()->getId());
// check if user can view event
if ((int) $event->getWhoCanView() === EVENT_BOL_EventService::CAN_VIEW_INVITATION_ONLY && $eventUser === null && $eventInvite === null && !OW::getUser()->isAuthorized('event')) {
$this->redirect(OW::getRouter()->urlForRoute('event.private_event', array('eventId' => $event->getId())));
}
if (OW::getUser()->isAuthorized('event') || OW::getUser()->getId() == $event->getUserId()) {
$this->assign('editArray', array('edit' => array('url' => OW::getRouter()->urlForRoute('event.edit', array('eventId' => $event->getId())), 'label' => OW::getLanguage()->text('event', 'edit_button_label')), 'delete' => array('url' => OW::getRouter()->urlForRoute('event.delete', array('eventId' => $event->getId())), 'label' => OW::getLanguage()->text('event', 'delete_button_label'), 'confirmMessage' => OW::getLanguage()->text('event', 'delete_confirm_message'))));
}
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'event', 'main_menu_item');
$this->setPageHeading($event->getTitle());
$this->setPageTitle(OW::getLanguage()->text('event', 'event_view_page_heading', array('event_title' => $event->getTitle())));
$this->setPageHeadingIconClass('ow_ic_calendar');
OW::getDocument()->setDescription(UTIL_String::truncate(strip_tags($event->getDescription()), 200, '...'));
$infoArray = array('id' => $event->getId(), 'image' => $event->getImage() ? $this->eventService->generateImageUrl($event->getImage(), false) : null, 'date' => UTIL_DateTime::formatSimpleDate($event->getStartTimeStamp(), $event->getStartTimeDisable()), 'endDate' => $event->getEndTimeStamp() === null || !$event->getEndDateFlag() ? null : UTIL_DateTime::formatSimpleDate($event->getEndTimeDisable() ? strtotime("-1 day", $event->getEndTimeStamp()) : $event->getEndTimeStamp(), $event->getEndTimeDisable()), 'location' => $event->getLocation(), 'desc' => UTIL_HtmlTag::autoLink($event->getDescription()), 'title' => $event->getTitle(), 'creatorName' => BOL_UserService::getInstance()->getDisplayName($event->getUserId()), 'creatorLink' => BOL_UserService::getInstance()->getUserUrl($event->getUserId()));
$this->assign('info', $infoArray);
// event attend form
if (OW::getUser()->isAuthenticated() && $event->getEndTimeStamp() > time()) {
if ($eventUser !== null) {
$this->assign('currentStatus', OW::getLanguage()->text('event', 'user_status_label_' . $eventUser->getStatus()));
}
$this->addForm(new AttendForm($event->getId(), $cmpId));
$onloadJs = "\n var \$context = \$('#" . $cmpId . "');\n \$('#event_attend_yes_btn').click(\n function(){\n \$('input[name=attend_status]', \$context).val(" . EVENT_BOL_EventService::USER_STATUS_YES . ");\n }\n );\n \$('#event_attend_maybe_btn').click(\n function(){\n \$('input[name=attend_status]', \$context).val(" . EVENT_BOL_EventService::USER_STATUS_MAYBE . ");\n }\n );\n \$('#event_attend_no_btn').click(\n function(){\n \$('input[name=attend_status]', \$context).val(" . EVENT_BOL_EventService::USER_STATUS_NO . ");\n }\n );\n\n \$('.current_status a', \$context).click(\n function(){\n \$('.attend_buttons .buttons', \$context).fadeIn(500);\n }\n );\n ";
OW::getDocument()->addOnloadScript($onloadJs);
} else {
$this->assign('no_attend_form', true);
}
if ($event->getEndTimeStamp() > time() && ((int) $event->getUserId() === OW::getUser()->getId() || (int) $event->getWhoCanInvite() === EVENT_BOL_EventService::CAN_INVITE_PARTICIPANT && $eventUser !== null)) {
$params = array($event->id);
$this->assign('inviteLink', true);
OW::getDocument()->addOnloadScript("\n var eventFloatBox;\n \$('#inviteLink', \$('#" . $cmpId . "')).click(\n function(){\n eventFloatBox = OW.ajaxFloatBox('EVENT_CMP_InviteUserListSelect', " . json_encode($params) . ", {width:600, iconClass: 'ow_ic_user', title: " . json_encode(OW::getLanguage()->text('event', 'friends_invite_button_label')) . "});\n }\n );\n OW.bind('base.avatar_user_list_select',\n function(list){\n eventFloatBox.close();\n \$.ajax({\n type: 'POST',\n url: " . json_encode(OW::getRouter()->urlFor('EVENT_CTRL_Base', 'inviteResponder')) . ",\n data: 'eventId=" . json_encode($event->getId()) . "&userIdList='+JSON.stringify(list),\n dataType: 'json',\n success : function(data){\n if( data.messageType == 'error' ){\n OW.error(data.message);\n }\n else{\n OW.info(data.message);\n }\n },\n error : function( XMLHttpRequest, textStatus, errorThrown ){\n OW.error(textStatus);\n }\n });\n }\n );\n ");
}
$cmntParams = new BASE_CommentsParams('event', 'event');
$cmntParams->setEntityId($event->getId());
$cmntParams->setOwnerId($event->getUserId());
$this->addComponent('comments', new BASE_CMP_Comments($cmntParams));
$this->addComponent('userListCmp', new EVENT_CMP_EventUsers($event->getId()));
$event = new BASE_CLASS_EventCollector(EVENT_BOL_EventService::EVENT_COLLECT_TOOLBAR, array("eventId" => $event->getId()));
$this->assign("toolbar", $event->getData());
}