本文整理汇总了PHP中EventManager::__getDriverPath方法的典型用法代码示例。如果您正苦于以下问题:PHP EventManager::__getDriverPath方法的具体用法?PHP EventManager::__getDriverPath怎么用?PHP EventManager::__getDriverPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventManager
的用法示例。
在下文中一共展示了EventManager::__getDriverPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __form
//.........这里部分代码省略.........
* Allows adding of new filter rules to the Event filter rule select box
*
* @delegate AppendEventFilter
* @param string $context
* '/blueprints/events/(edit|new|info)/'
* @param array $selected
* An array of all the selected filters for this Event
* @param array $options
* An array of all the filters that are available, passed by reference
*/
Symphony::ExtensionManager()->notifyMembers('AppendEventFilter', '/blueprints/events/' . $this->_context[0] . '/', array('selected' => $filters, 'options' => &$options));
$fieldset->appendChild(Widget::Select('fields[filters][]', $options, array('multiple' => 'multiple', 'id' => 'event-filters')));
$this->Form->appendChild($fieldset);
// Connections
$fieldset = new XMLElement('fieldset');
$fieldset->setAttribute('class', 'settings');
$fieldset->appendChild(new XMLElement('legend', __('Attach to Pages')));
$p = new XMLElement('p', __('The event will only be available on the selected pages.'));
$p->setAttribute('class', 'help');
$fieldset->appendChild($p);
$div = new XMLElement('div');
$label = Widget::Label(__('Pages'));
$pages = PageManager::fetch();
$event_handle = str_replace('-', '_', Lang::createHandle($fields['name']));
$connections = ResourceManager::getAttachedPages(RESOURCE_TYPE_EVENT, $event_handle);
$selected = array();
foreach ($connections as $connection) {
$selected[] = $connection['id'];
}
$options = array();
foreach ($pages as $page) {
$options[] = array($page['id'], in_array($page['id'], $selected), PageManager::resolvePageTitle($page['id']));
}
$label->appendChild(Widget::Select('fields[connections][]', $options, array('multiple' => 'multiple')));
$div->appendChild($label);
$fieldset->appendChild($div);
$this->Form->appendChild($fieldset);
// Providers
if (!empty($providers)) {
foreach ($providers as $providerClass => $provider) {
if ($isEditing && $fields['source'] !== call_user_func(array($providerClass, 'getSource'))) {
continue;
}
call_user_func_array(array($providerClass, 'buildEditor'), array($this->Form, &$this->_errors, $fields, $handle));
}
}
} else {
// Author
if (isset($about['author']['website'])) {
$link = Widget::Anchor($about['author']['name'], General::validateURL($about['author']['website']));
} elseif (isset($about['author']['email'])) {
$link = Widget::Anchor($about['author']['name'], 'mailto:' . $about['author']['email']);
} else {
$link = $about['author']['name'];
}
if ($link) {
$fieldset = new XMLElement('fieldset');
$fieldset->setAttribute('class', 'settings');
$fieldset->appendChild(new XMLElement('legend', __('Author')));
$fieldset->appendChild(new XMLElement('p', $link->generate(false)));
$this->Form->appendChild($fieldset);
}
// Version
$fieldset = new XMLElement('fieldset');
$fieldset->setAttribute('class', 'settings');
$fieldset->appendChild(new XMLElement('legend', __('Version')));
$version = array_key_exists('version', $about) ? $about['version'] : null;
$release_date = array_key_exists('release-date', $about) ? $about['release-date'] : filemtime(EventManager::__getDriverPath($handle));
if (preg_match('/^\\d+(\\.\\d+)*$/', $version)) {
$fieldset->appendChild(new XMLElement('p', __('%1$s released on %2$s', array($version, DateTimeObj::format($release_date, __SYM_DATE_FORMAT__)))));
} elseif (!is_null($version)) {
$fieldset->appendChild(new XMLElement('p', __('Created by %1$s at %2$s', array($version, DateTimeObj::format($release_date, __SYM_DATE_FORMAT__)))));
} else {
$fieldset->appendChild(new XMLElement('p', __('Last modified on %s', array(DateTimeObj::format($release_date, __SYM_DATE_FORMAT__)))));
}
$this->Form->appendChild($fieldset);
}
// If we are editing an event, it assumed that the event has documentation
$fieldset = new XMLElement('fieldset');
$fieldset->setAttribute('id', 'event-documentation');
$fieldset->setAttribute('class', 'settings');
if ($isEditing && method_exists($existing, 'documentation')) {
$doc = $existing->documentation();
if ($doc) {
$fieldset->setValue('<legend>' . __('Documentation') . '</legend>' . PHP_EOL . General::tabsToSpaces(is_object($doc) ? $doc->generate(true, 4) : $doc));
}
}
$this->Form->appendChild($fieldset);
$div = new XMLElement('div');
$div->setAttribute('class', 'actions');
$div->appendChild(Widget::Input('action[save]', $isEditing ? __('Save Changes') : __('Create Event'), 'submit', array('accesskey' => 's')));
if ($isEditing) {
$button = new XMLElement('button', __('Delete'));
$button->setAttributeArray(array('name' => 'action[delete]', 'class' => 'button confirm delete', 'title' => __('Delete this event'), 'type' => 'submit', 'accesskey' => 'd', 'data-message' => __('Are you sure you want to delete this event?')));
$div->appendChild($button);
}
if (!$readonly) {
$this->Form->appendChild($div);
}
}