本文整理汇总了PHP中Events::loadAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::loadAll方法的具体用法?PHP Events::loadAll怎么用?PHP Events::loadAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::loadAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPrefsEvents
public function getPrefsEvents()
{
/* Events settings */
$this->addPrettyName('events', _("Events settings"));
$c = new ConfigElement_list('mail_to', _('Email addresses to send alerts to'), _('On system alerts, emails will be sent to these addresses'), NULL, array());
$this->add($c, 'events');
$events = Events::loadAll();
foreach ($events as $event) {
$list = array();
$pretty_list = array();
foreach ($event->getCallbacks() as $cb) {
if (!$cb['is_internal']) {
$list[] = $cb['name'];
$pretty_list[$cb['name']] = $cb['description'];
}
}
if (count($list) == 0) {
continue;
}
$event_name = $event->getPrettyName();
/* FIXME: descriptions */
$c = new ConfigElement_multiselect(get_class($event), $event_name, "When {$event_name} is emitted", "When {$event_name} is emitted", array());
$c->setContentAvailable($pretty_list);
$this->add($c, 'events', 'active_callbacks');
}
$this->addPrettyName('active_callbacks', _('Activated callbacks'));
unset($events);
}
示例2: getPrefsEvents
public function getPrefsEvents()
{
/* Events settings */
$c = new ConfigElement_list('mail_to', array());
$this->add($c, 'events');
$events = Events::loadAll();
foreach ($events as $event) {
$list = array();
$pretty_list = array();
foreach ($event->getCallbacks() as $cb) {
if (!$cb['is_internal']) {
$list[] = $cb['name'];
$pretty_list[] = $cb['name'];
}
}
if (count($list) == 0) {
continue;
}
$event_name = $event->getPrettyName();
/* FIXME: descriptions */
$c = new ConfigElement_multiselect(get_class($event), array());
$c->setContentAvailable($pretty_list);
$this->add($c, 'events', 'active_callbacks');
}
unset($events);
}