本文整理汇总了PHP中Summit::ActiveSummitID方法的典型用法代码示例。如果您正苦于以下问题:PHP Summit::ActiveSummitID方法的具体用法?PHP Summit::ActiveSummitID怎么用?PHP Summit::ActiveSummitID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Summit
的用法示例。
在下文中一共展示了Summit::ActiveSummitID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
public function getCMSFields()
{
$summit_id = isset($_REQUEST['SummitID']) ? $_REQUEST['SummitID'] : Summit::ActiveSummitID();
Requirements::javascript('summit/javascript/SummitPushNotification.js');
$f = new FieldList($rootTab = new TabSet("Root", $tabMain = new Tab('Main')));
$f->addFieldToTab('Root.Main', $txt = new TextareaField('Message', 'Message'));
$txt->setAttribute('required', 'true');
$f->addFieldToTab('Root.Main', $ddl_channel = new DropdownField('Channel', 'Channel', singleton('SummitPushNotification')->dbObject('Channel')->enumValues()));
$f->addFieldToTab('Root.Main', $ddl_events = new DropdownField('EventID', 'Event', SummitEvent::get()->filter(['Published' => 1, 'SummitID' => $summit_id])->sort('Title', 'ASC')->Map('ID', 'FormattedTitle')));
$f->addFieldToTab('Root.Main', $ddl_groups = new DropdownField('GroupID', 'Group', Group::get()->sort('Title', 'ASC')->Map('ID', 'Title')));
$f->addFieldToTab('Root.Main', new HiddenField('SummitID', 'SummitID'));
$ddl_channel->setEmptyString('--SELECT A CHANNEL--');
$ddl_channel->setAttribute('required', 'true');
$ddl_events->setEmptyString('--SELECT AN EVENT--');
$ddl_events->addExtraClass('hidden');
$ddl_groups->setEmptyString('--SELECT A GROUP--');
$ddl_groups->addExtraClass('hidden');
$config = GridFieldConfig_RelationEditor::create(50);
$config->removeComponentsByType('GridFieldAddExistingAutocompleter');
$config->removeComponentsByType('GridFieldAddNewButton');
$config->addComponent($auto_completer = new CustomGridFieldAddExistingAutocompleter('buttons-before-right'));
$auto_completer->setResultsFormat('$Title ($Email)');
$recipients = new GridField('Recipients', 'Member Recipients', $this->Recipients(), $config);
$f->addFieldToTab('Root.Main', $recipients);
return $f;
}
示例2: run
/**
* @return void
*/
public function run()
{
try {
$init_time = time();
$summit_id = Summit::ActiveSummitID();
if (isset($_GET['summit_id'])) {
$summit_id = intval(trim(Convert::raw2sql($_GET['summit_id'])));
echo sprintf('summit_id set to %s', $summit_id) . PHP_EOL;
}
$manager = Injector::inst()->get('SummitVenueRoomMetricsManager');
$manager->ingest($summit_id);
$finish_time = time() - $init_time;
echo 'time elapsed : ' . $finish_time . ' seconds.' . PHP_EOL;
} catch (Exception $ex) {
SS_Log::log($ex->getMessage(), SS_Log::ERR);
}
}
示例3: SummitEntityEvent
$event = new SummitEntityEvent();
$event->EntityClassName = 'MySchedule';
$event->EntityID = $item->ID;
$event->Type = 'INSERT';
$event->OwnerID = $attendee->MemberID;
$event->SummitID = $summit_id;
$event->Metadata = $metadata;
$event->write();
});
PublisherSubscriberManager::getInstance()->subscribe('manymanylist_removed_item', function ($list, $item) {
if (!$item instanceof ISummitEvent) {
return;
}
$summit_id = $item->getField("SummitID");
if (is_null($summit_id) || $summit_id == 0) {
$summit_id = Summit::ActiveSummitID();
}
$metadata = '';
$join_table = $list->getJoinTable();
if ($join_table !== 'SummitAttendee_Schedule') {
return;
}
$attendee_id = $list->getForeignID();
$attendee = SummitAttendee::get()->byID($attendee_id);
$event = new SummitEntityEvent();
$event->EntityClassName = 'MySchedule';
$event->EntityID = $item->ID;
$event->Type = 'DELETE';
$event->OwnerID = $attendee->MemberID;
$event->SummitID = $summit_id;
$event->Metadata = $metadata;