本文整理汇总了PHP中Widget::Fieldset方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::Fieldset方法的具体用法?PHP Widget::Fieldset怎么用?PHP Widget::Fieldset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widget
的用法示例。
在下文中一共展示了Widget::Fieldset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view(SymphonyDOMElement $wrapper, MessageStack $errors)
{
$page = Administration::instance()->Page;
$page->insertNodeIntoHead($page->createScriptElement(URL . '/extensions/bbcww_api_client/assets/view.js'));
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$right = $layout->createColumn(Layout::LARGE);
$fieldset = Widget::Fieldset(__('Essentials'));
$label = Widget::Label(__('Name'));
$label->appendChild(Widget::Input('fields[name]', General::sanitize($this->about()->name)));
if (isset($errors->{'about::name'})) {
$fieldset->appendChild(Widget::wrapFormElementWithError($label, $errors->{'about::name'}));
} else {
$fieldset->appendChild($label);
}
$field_groups = $options = array();
foreach ($this->driver->getMemberSections() as $section) {
$source = $section->{'api-source'};
$field_groups[$section->handle] = array('fields' => $section->fields, 'section' => $section);
if (!isset($options[$source])) {
$options[$source] = array('label' => ucwords(strtr($source, '-', ' ')), 'options' => array());
}
$options[$source]['options'][] = array($section->handle, $this->parameters()->section == $section->handle, $section->name);
}
$label = Widget::Label(__('Section'));
$label->appendChild(Widget::Select('fields[section]', $options, array('id' => 'context')));
$fieldset->appendChild($label);
$left->appendChild($fieldset);
$fieldset = Widget::Fieldset(__('Overrides & Defaults'), '{$param}');
foreach ($this->driver->getMemberSections() as $section) {
$this->appendDuplicator($fieldset, $section, $this->parameters()->section == $section->handle ? array('overrides' => $this->parameters()->overrides, 'defaults' => $this->parameters()->defaults) : NULL);
}
$right->appendChild($fieldset);
$layout->appendTo($wrapper);
}
示例2: view
public function view(SymphonyDOMElement $wrapper, MessageStack $errors)
{
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$right = $layout->createColumn(Layout::LARGE);
// Essentials --------------------------------------------------------
$fieldset = Widget::Fieldset(__('Essentials'));
// Name:
$label = Widget::Label(__('Name'));
$input = Widget::Input('fields[about][name]', General::sanitize($this->about()->name));
$label->appendChild($input);
if (isset($errors->{'about::name'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'about::name'});
}
$fieldset->appendChild($label);
$left->appendChild($fieldset);
$fieldset = Widget::Fieldset(__('Content'));
$label = Widget::Label(__('Source XML'));
$input = Widget::Textarea('fields[xml]', $this->parameters()->{'xml'}, array('rows' => '24', 'cols' => '50', 'class' => 'code'));
$label->appendChild($input);
if (isset($errors->{'xml'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'xml'});
}
$fieldset->appendChild($label);
$right->appendChild($fieldset);
$layout->appendTo($wrapper);
}
示例3: view
public function view(SymphonyDOMElement $wrapper, MessageStack $errors)
{
$page = $wrapper->ownerDocument;
$page->insertNodeIntoHead($page->createScriptElement(URL . '/extensions/ds_sections/assets/view.js'), 55533140);
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$middle = $layout->createColumn(Layout::LARGE);
$right = $layout->createColumn(Layout::SMALL);
// Essentials --------------------------------------------------------
$fieldset = Widget::Fieldset(__('Essentials'), null, array('class' => 'settings'));
// Name:
$label = Widget::Label(__('Name'));
$input = Widget::Input('fields[about][name]', General::sanitize($this->about()->name));
$label->appendChild($input);
if (isset($errors->{'about::name'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'about::name'});
}
$fieldset->appendChild($label);
$left->appendChild($fieldset);
// Filtering ---------------------------------------------------------
$fieldset = Widget::Fieldset(__('Filtering'), '<code>{$param}</code> or <code>Value</code>', array('class' => 'settings'));
// Filters
$duplicator = new Duplicator(__('Add Filter'));
$filters = array('id' => __('ID'), 'username' => __('Username'), 'first-name' => __('First Name'), 'last-name' => __('Last Name'), 'email' => __('Email Address'));
foreach ($filters as $handle => $name) {
$this->appendFilter($duplicator, $handle, $name);
if (is_array($this->parameters()->filters) && array_key_exists($handle, $this->parameters()->filters)) {
$this->appendFilter($duplicator, $handle, $name, $this->parameters()->filters[$handle]);
}
}
$duplicator->appendTo($fieldset);
$middle->appendChild($fieldset);
// Output options ----------------------------------------------------
$fieldset = Widget::Fieldset(__('Output Options'));
$select = Widget::Select('fields[included-elements][]', array(array('username', in_array('username', $this->parameters()->{"included-elements"}), 'username'), array('name', in_array('name', $this->parameters()->{"included-elements"}), 'name'), array('email-address', in_array('email-address', $this->parameters()->{"included-elements"}), 'email-address'), array('language', in_array('language', $this->parameters()->{"included-elements"}), 'language'), array('authentication-token', in_array('authentication-token', $this->parameters()->{"included-elements"}), 'authentication-token'), array('default-section', in_array('default-section', $this->parameters()->{"included-elements"}), 'default-section')));
$select->setAttribute('class', 'filtered');
$select->setAttribute('multiple', 'multiple');
$label = Widget::Label(__('Included Elements'));
$label->appendChild($select);
$fieldset->appendChild($label);
$right->appendChild($fieldset);
$layout->appendTo($wrapper);
}
示例4: __viewIndex
public function __viewIndex()
{
$this->appendSubheading(__('Settings'));
$this->appendTabs();
if (!is_writable(CONF . '/core.xml')) {
$this->alerts()->append(__('The core Symphony configuration file, /manifest/conf/core.xml, is not writable. You will not be able to save any changes.'), AlertStack::ERROR);
}
// Status message:
$callback = Administration::instance()->getPageCallback();
if (isset($callback['flag']) && !is_null($callback['flag'])) {
switch ($callback['flag']) {
case 'saved':
$this->alerts()->append(__('System settings saved at %1$s.', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__))), AlertStack::SUCCESS);
break;
}
}
// SETUP PAGE
$layout = new Layout();
$left = $layout->createColumn(Layout::LARGE);
$center = $layout->createColumn(Layout::LARGE);
$right = $layout->createColumn(Layout::LARGE);
// SITE SETUP
$helptext = 'Symphony version: ' . Symphony::Configuration()->core()->symphony->version;
$fieldset = Widget::Fieldset(__('Site Setup'), $helptext);
$label = Widget::Label(__('Site Name'));
$input = Widget::Input('settings[symphony][sitename]', Symphony::Configuration()->core()->symphony->sitename);
$label->appendChild($input);
if (isset($this->errors->{'symphony::sitename'})) {
$label = Widget::wrapFormElementWithError($label, $this->errors->{'symphony::sitename'});
}
$fieldset->appendChild($label);
// Get available languages
$languages = Lang::getAvailableLanguages(true);
if (count($languages) > 1) {
// Create language selection
$label = Widget::Label(__('Default Language'));
// Get language names
asort($languages);
foreach ($languages as $code => $name) {
$options[] = array($code, $code == Symphony::Configuration()->core()->symphony->lang, $name);
}
$select = Widget::Select('settings[symphony][lang]', $options);
unset($options);
$label->appendChild($select);
//$group->appendChild(new XMLElement('p', __('Users can set individual language preferences in their profiles.'), array('class' => 'help')));
// Append language selection
$fieldset->appendChild($label);
}
$left->appendChild($fieldset);
// REGIONAL SETTINGS
$fieldset = Widget::Fieldset(__('Date & Time Settings'));
// Date and Time Settings
$label = Widget::Label(__('Date Format'));
$input = Widget::Input('settings[region][date-format]', Symphony::Configuration()->core()->region->{'date-format'});
$label->appendChild($input);
if (isset($this->errors->{'region::date-format'})) {
$label = Widget::wrapFormElementWithError($label, $this->errors->{'region::date-format'});
}
$fieldset->appendChild($label);
$label = Widget::Label(__('Time Format'));
$input = Widget::Input('settings[region][time-format]', Symphony::Configuration()->core()->region->{'time-format'});
$label->appendChild($input);
if (isset($this->errors->{'region::time-format'})) {
$label = Widget::wrapFormElementWithError($label, $this->errors->{'region::time-format'});
}
$fieldset->appendChild($label);
$label = Widget::Label(__('Timezone'));
$timezones = timezone_identifiers_list();
foreach ($timezones as $timezone) {
$options[] = array($timezone, $timezone == Symphony::Configuration()->core()->region->timezone, $timezone);
}
$select = Widget::Select('settings[region][timezone]', $options);
unset($options);
$label->appendChild($select);
$fieldset->appendChild($label);
$center->appendChild($fieldset);
// PERMISSIONS
$fieldset = Widget::Fieldset(__('Permissions'));
$permissions = array('0777', '0775', '0755', '0666', '0644');
$fileperms = Symphony::Configuration()->core()->symphony->{'file-write-mode'};
$dirperms = Symphony::Configuration()->core()->symphony->{'directory-write-mode'};
$label = Widget::Label(__('File Permissions'));
foreach ($permissions as $p) {
$options[] = array($p, $p == $fileperms, $p);
}
if (!in_array($fileperms, $permissions)) {
$options[] = array($fileperms, true, $fileperms);
}
$select = Widget::Select('settings[symphony][file-write-mode]', $options);
unset($options);
$label->appendChild($select);
$fieldset->appendChild($label);
$label = Widget::Label(__('Directory Permissions'));
foreach ($permissions as $p) {
$options[] = array($p, $p == $dirperms, $p);
}
if (!in_array($dirperms, $permissions)) {
$options[] = array($dirperms, true, $dirperms);
}
$select = Widget::Select('settings[symphony][directory-write-mode]', $options);
//.........这里部分代码省略.........
示例5: __layout
private function __layout(Section $existing = null)
{
// Status message:
$callback = Administration::instance()->getPageCallback();
if (isset($callback['flag']) && !is_null($callback['flag'])) {
switch ($callback['flag']) {
case 'saved':
$this->alerts()->append(__('Section updated at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), ADMIN_URL . '/blueprints/sections/new/', ADMIN_URL . '/blueprints/sections/')), AlertStack::SUCCESS);
break;
}
}
if (!$this->alerts()->valid() and $existing instanceof Section) {
$this->appendSyncAlert();
}
$layout = new Layout();
$content = $layout->createColumn(Layout::LARGE);
$fieldset = Widget::Fieldset(__('Layout'));
if (!$this->section instanceof Section) {
$this->section = new Section();
}
$this->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Sections'))));
$this->appendSubheading($existing instanceof Section ? $existing->name : __('Untitled'));
$this->appendViewOptions();
$widget = $this->createElement('div');
$widget->setAttribute('id', 'section-layout');
$layouts = $this->createElement('ol');
$layouts->setAttribute('class', 'layouts');
$templates = $this->createElement('ol');
$templates->setAttribute('class', 'templates');
$columns = new Layout('ol', 'li');
// Load fields:
$fields = $this->section->fields;
foreach ($fields as $index => $field) {
$name = $field->{'element-name'};
$fields[$name] = $field;
unset($fields[$index]);
}
// Layouts:
$layout_options = array(array(Layout::LARGE), array(Layout::LARGE, Layout::LARGE), array(Layout::LARGE, Layout::SMALL), array(Layout::SMALL, Layout::LARGE), array(Layout::LARGE, Layout::LARGE, Layout::LARGE), array(Layout::LARGE, Layout::LARGE, Layout::LARGE, Layout::LARGE));
foreach ($layout_options as $layout_columns) {
$item = $this->createElement('li');
$mini_layout = new Layout();
foreach ($layout_columns as $index => $size) {
$column = $mini_layout->createColumn($size);
$text = $this->createTextNode(chr(97 + $index));
$column->appendChild($text);
}
$mini_layout->appendTo($item);
$layouts->appendChild($item);
}
// Current columns:
foreach ($this->section->layout as $data) {
$column = $columns->createColumn($data->size);
if (!empty($data->fieldsets)) {
foreach ($data->fieldsets as $data) {
$this->appendFieldset($column, $data, $fields);
}
}
}
// Templates:
if (is_array($fields)) {
foreach ($fields as $position => $field) {
$this->appendField($templates, $field);
}
}
$widget->appendChild($layouts);
$widget->appendChild($templates);
$columns->appendTo($widget);
$fieldset->appendChild($widget);
$content->appendChild($fieldset);
$layout->appendTo($this->Form);
$div = $this->createElement('div');
$div->setAttribute('class', 'actions');
$div->appendChild(Widget::Submit('action[save]', __('Save Changes'), array('accesskey' => 's')));
if ($this->_context[0] == 'edit') {
$div->appendChild(Widget::Submit('action[delete]', __('Delete'), array('class' => 'confirm delete', 'title' => __('Delete this section'))));
}
$this->Form->appendChild($div);
}
示例6: view
public function view(SymphonyDOMElement $wrapper, MessageStack $errors)
{
$page = Administration::instance()->Page;
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$right = $layout->createColumn(Layout::LARGE);
// Essentials --------------------------------------------------------
$fieldset = Widget::Fieldset(__('Essentials'));
// Name:
$label = Widget::Label(__('Name'));
$input = Widget::Input('fields[about][name]', General::sanitize($this->about()->name));
$label->appendChild($input);
if (isset($errors->{'about::name'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'about::name'});
}
$fieldset->appendChild($label);
$left->appendChild($fieldset);
// Filtering ---------------------------------------------------------
$p = $page->createElement('p');
$p->setAttribute('class', 'help');
$p->appendChild($page->createElement('code', '{$param}'));
$p->setValue(' or ');
$p->appendChild($page->createElement('code', 'Value'));
$fieldset = Widget::Fieldset(__('Filtering'), $p);
// Parent View:
$label = Widget::Label(__('Parent View'));
$input = Widget::Input('fields[parent]', General::sanitize($this->parameters()->parent));
$label->appendChild($input);
if (isset($errors->{'parent'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'parent'});
}
$fieldset->appendChild($label);
$ul = $page->createElement('ul');
$ul->setAttribute('class', 'tags');
foreach (new ViewIterator() as $view) {
$ul->appendChild($page->createElement('li', $view->path));
}
$fieldset->appendChild($ul);
// View Type:
$label = Widget::Label(__('View Type'));
$input = Widget::Input('fields[type]', General::sanitize($this->parameters()->type));
$label->appendChild($input);
if (isset($errors->{'type'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'type'});
}
$fieldset->appendChild($label);
$ul = $page->createElement('ul');
$ul->setAttribute('class', 'tags');
foreach (View::fetchUsedTypes() as $type) {
$ul->appendChild($page->createElement('li', $type));
}
$fieldset->appendChild($ul);
/*
if (isset($this->parameters()->parent) && !is_null($this->parameters()->parent)){
$li = new XMLElement('li');
$li->setAttribute('class', 'unique');
$li->appendChild(new XMLElement('h4', __('Parent View')));
$label = Widget::Label(__('Value'));
$label->appendChild(Widget::Input(
'fields[parent]', General::sanitize($this->parameters()->parent)
));
$li->appendChild($label);
$li->appendChild($ul);
$ol->appendChild($li);
}
$li = new XMLElement('li');
$li->setAttribute('class', 'unique template');
$li->appendChild(new XMLElement('h4', __('Parent View')));
$label = Widget::Label(__('Value'));
$label->appendChild(Widget::Input('fields[parent]'));
$li->appendChild($label);
$li->appendChild($ul);
$ol->appendChild($li);
$ul = new XMLElement('ul');
$ul->setAttribute('class', 'tags');
foreach(View::fetchUsedTypes() as $type) $ul->appendChild(new XMLElement('li', $type));
if (isset($this->parameters()->type) && !is_null($this->parameters()->type)){
$li = new XMLElement('li');
$li->setAttribute('class', 'unique');
$li->appendChild(new XMLElement('h4', __('View Type')));
$label = Widget::Label(__('Value'));
$label->appendChild(Widget::Input(
'fields[type]',
General::sanitize($this->parameters()->type)
));
$li->appendChild($label);
$li->appendChild($ul);
$ol->appendChild($li);
}
$li = new XMLElement('li');
$li->setAttribute('class', 'unique template');
$li->appendChild(new XMLElement('h4', __('View Type')));
$label = Widget::Label(__('Value'));
$label->appendChild(Widget::Input('fields[type]'));
$li->appendChild($label);
$li->appendChild($ul);
//.........这里部分代码省略.........
示例7: __form
private function __form()
{
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$center = $layout->createColumn(Layout::LARGE);
$right = $layout->createColumn(Layout::SMALL);
require_once LIB . '/class.field.php';
## Handle unknow context
if (!in_array($this->_context[0], array('new', 'edit'))) {
throw new AdministrationPageNotFoundException();
}
$callback = Administration::instance()->getPageCallback();
if (isset($callback['flag'])) {
switch ($callback['flag']) {
case 'saved':
$this->alerts()->append(__('User updated at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), ADMIN_URL . '/system/users/new/', ADMIN_URL . '/system/users/')), AlertStack::SUCCESS);
break;
case 'created':
$this->alerts()->append(__('User created at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), ADMIN_URL . '/system/users/new/', ADMIN_URL . '/system/users/')), AlertStack::SUCCESS);
break;
}
}
$isOwner = false;
/*if(isset($_POST['fields']))
$user = $this->user;
elseif($this->_context[0] == 'edit'){
if(!$user_id = $this->_context[1]) redirect(ADMIN_URL . '/system/users/');
if(!$user = UserManager::fetchByID($user_id)){
throw new SymphonyErrorPage('The user profile you requested does not exist.', 'User not found');
}
}
else */
if ($this->_context[0] == 'edit' && $this->user->id == Administration::instance()->User->id) {
$isOwner = true;
}
$this->setTitle(__($this->_context[0] == 'new' ? '%1$s – %2$s – Untitled' : '%1$s – %2$s – %3$s', array(__('Symphony'), __('Users'), $this->user->getFullName())));
$this->appendSubheading($this->_context[0] == 'new' ? __('New User') : $this->user->getFullName());
### Essentials ###
$fieldset = Widget::Fieldset(__('Essentials'));
$label = Widget::Label(__('First Name'));
$label->appendChild(Widget::Input('fields[first_name]', $this->user->{'first_name'}));
$fieldset->appendChild(isset($this->errors->{'first-name'}) ? Widget::wrapFormElementWithError($label, $this->errors->{'first-name'}) : $label);
$label = Widget::Label(__('Last Name'));
$label->appendChild(Widget::Input('fields[last_name]', $this->user->{'last_name'}));
$fieldset->appendChild(isset($this->errors->{'last-name'}) ? Widget::wrapFormElementWithError($label, $this->errors->{'last-name'}) : $label);
$label = Widget::Label(__('Email Address'));
$label->appendChild(Widget::Input('fields[email]', $this->user->email));
$fieldset->appendChild(isset($this->errors->email) ? Widget::wrapFormElementWithError($label, $this->errors->email) : $label);
$left->appendChild($fieldset);
###
### Login Details ###
$fieldset = Widget::Fieldset(__('Login Details'));
$label = Widget::Label(__('Username'));
$label->appendChild(Widget::Input('fields[username]', $this->user->username, NULL));
$fieldset->appendChild(isset($this->errors->username) ? Widget::wrapFormElementWithError($label, $this->errors->username) : $label);
if ($this->_context[0] == 'edit') {
$fieldset->setAttribute('id', 'change-password');
}
$label = Widget::Label($this->_context[0] == 'edit' ? __('New Password') : __('Password'));
$label->appendChild(Widget::Input('fields[password]', NULL, 'password'));
$fieldset->appendChild(isset($this->errors->password) ? Widget::wrapFormElementWithError($label, $this->errors->password) : $label);
$label = Widget::Label($this->_context[0] == 'edit' ? __('Confirm New Password') : __('Confirm Password'));
if (isset($this->errors->{'password-confirmation'})) {
$label->setAttributeArray(array('class' => 'contains-error', 'title' => $this->errors->{'password-confirmation'}));
}
$label->appendChild(Widget::Input('fields[password-confirmation]', NULL, 'password'));
$fieldset->appendChild($label);
if ($this->_context[0] == 'edit') {
$fieldset->appendChild($this->createElement('p', __('Leave password fields blank to keep the current password'), array('class' => 'help')));
}
$label = Widget::Label();
$input = Widget::Input('fields[auth_token_active]', 'yes', 'checkbox');
if ($this->user->auth_token_active == 'yes') {
$input->setAttribute('checked', 'checked');
}
$temp = ADMIN_URL . '/login/' . $this->user->createAuthToken() . '/';
$label->appendChild($input);
$label->appendChild(new DOMText(__('Allow remote login via ')));
$label->appendChild(Widget::Anchor($temp, $temp));
$fieldset->appendChild($label);
$center->appendChild($fieldset);
### Default Section ###
$fieldset = Widget::Fieldset(__('Custom Preferences'));
$label = Widget::Label(__('Default Section'));
//$sections = SectionManager::instance()->fetch(NULL, 'ASC', 'sortorder');
$options = array();
//if(is_array($sections) && !empty($sections))
foreach (new SectionIterator() as $s) {
$options[] = array($s->handle, $this->user->default_section == $s->handle, $s->name);
}
$label->appendChild(Widget::Select('fields[default_section]', $options));
$fieldset->appendChild($label);
### Custom Language Selection ###
$languages = Lang::getAvailableLanguages(true);
if (count($languages > 1)) {
// Get language names
//.........这里部分代码省略.........
示例8: appendSidebar
protected function appendSidebar(DOMElement $wrapper)
{
$sidebar = parent::appendSidebar($wrapper);
$fieldset = $sidebar->lastChild;
$list = $this->document->createElement('ul');
$url = clone $this->url;
$url->parameters()->{'debug'} = 'source';
if (isset($_GET['debug-state'])) {
$url->parameters()->{'debug-state'} = $this->state;
}
$this->appendLink($list, __('View Source'), (string) $url, $this->show == 'source');
$url->parameters()->debug = 'output';
$this->appendLink($list, __('View Output'), (string) $url, $this->show == 'output');
$url->parameters()->debug = 'params';
$this->appendLink($list, __('View Parameters'), (string) $url, $this->show == 'params');
$url->parameters()->debug = 'frontend';
$this->appendLink($list, __('View Frontend'), (string) $url, $this->show == 'frontend');
$fieldset->appendChild($list);
$fieldset = Widget::Fieldset(__('Templates'));
$fieldset->addClass('templates');
$list = $this->document->createElement('ul');
$url->parameters()->debug = 'template';
$item = $this->appendLink($list, basename($this->view->templatePathname()), (string) $url, $this->show == 'template');
$this->appendUtilityLinks($item, $this->utilities);
$fieldset->appendChild($list);
$sidebar->appendChild($fieldset);
$fieldset = Widget::Fieldset(__('Saved States'));
$fieldset->addClass('states');
$this->appendStateLinks($fieldset, $this->states);
$sidebar->appendChild($fieldset);
return $sidebar;
}
示例9: __form
public function __form()
{
$layout = new Layout();
$left = $layout->createColumn(Layout::LARGE);
$center = $layout->createColumn(Layout::LARGE);
$right = $layout->createColumn(Layout::LARGE);
$existing = null;
$fields = array();
// Verify view exists:
if ($this->_context[0] == 'edit') {
if (!isset($this->_context[1]) || strlen(trim($this->_context[1])) == 0) {
redirect(ADMIN_URL . '/blueprints/views/');
}
$context = $this->_context;
array_shift($context);
$view_pathname = implode('/', $context);
$existing = self::__loadExistingView($view_pathname);
}
// Status message:
$callback = Administration::instance()->getPageCallback();
if (isset($callback['flag']) && !is_null($callback['flag'])) {
switch ($callback['flag']) {
case 'saved':
$this->alerts()->append(__('View updated at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), ADMIN_URL . '/blueprints/views/new/', ADMIN_URL . '/blueprints/views/')), AlertStack::SUCCESS);
break;
case 'created':
$this->alerts()->append(__('View created at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), ADMIN_URL . '/blueprints/views/new/', ADMIN_URL . '/blueprints/views/')), AlertStack::SUCCESS);
break;
}
}
// Find values:
if (isset($_POST['fields'])) {
$fields = $_POST['fields'];
} elseif ($this->_context[0] == 'edit') {
$fields = (array) $existing->about();
// Flatten the types array:
$fields['types'] = (isset($fields['types']) and is_array($fields['types'])) ? implode(', ', $fields['types']) : null;
// Flatten the url-parameters array:
$fields['url-parameters'] = (isset($fields['url-parameters']) and is_array($fields['url-parameters'])) ? implode('/', $fields['url-parameters']) : null;
$fields['parent'] = $existing->parent() instanceof View ? $existing->parent()->path : NULL;
$fields['handle'] = $existing->handle;
}
$title = null;
if (isset($fields['title'])) {
$title = $fields['title'];
}
if (strlen(trim($title)) == 0) {
$title = $existing instanceof View ? $existing->title : 'New View';
}
$this->setTitle(__($title ? '%1$s – %2$s – %3$s' : '%1$s – %2$s', array(__('Symphony'), __('Views'), $title)));
if ($existing instanceof View) {
$template_name = $fields['handle'];
$this->appendSubheading(__($title ? $title : __('New View')));
$viewoptions = array(__('Configuration') => Administration::instance()->getCurrentPageURL(), __('Template') => sprintf('%s/blueprints/views/template/%s/', ADMIN_URL, $view_pathname));
$this->appendViewOptions($viewoptions);
} else {
$this->appendSubheading($title ? $title : __('Untitled'));
}
// Fieldset -----------------------------------------------------------
$fieldset = Widget::Fieldset(__('Essentials'));
// Title --------------------------------------------------------------
$label = Widget::Label(__('Title'));
$label->appendChild(Widget::Input('fields[title]', isset($fields['title']) ? $fields['title'] : null));
if (isset($this->errors->title)) {
$label = Widget::wrapFormElementWithError($label, $this->errors->title);
}
$fieldset->appendChild($label);
// Type ---------------------------------------------------------------
$container = $this->createElement('div');
$label = Widget::Label(__('View Type'));
$label->appendChild(Widget::Input('fields[types]', isset($fields['types']) ? $fields['types'] : null));
if (isset($this->errors->types)) {
$label = Widget::wrapFormElementWithError($label, $this->errors->types);
}
$tags = $this->createElement('ul');
$tags->setAttribute('class', 'tags');
foreach (self::__fetchAvailableViewTypes() as $t) {
$tags->appendChild($this->createElement('li', $t));
}
$container->appendChild($label);
$container->appendChild($tags);
$fieldset->appendChild($container);
$left->appendChild($fieldset);
// Fieldset -----------------------------------------------------------
$fieldset = Widget::Fieldset(__('URL Settings'));
// Parent -------------------------------------------------------------
$label = Widget::Label(__('Parent'));
$options = array(array(NULL, false, '/'));
foreach (new ViewIterator() as $v) {
// Make sure the current view cannot be set as either a child of itself, or a child of
// another view that is already at child of the current view.
if (isset($existing) && $existing instanceof View && ($v->isChildOf($existing) || $v->guid == $existing->guid)) {
continue;
}
$options[] = array($v->path, isset($fields['parent']) and $fields['parent'] == $v->path, "/{$v->path}");
}
$label->appendChild(Widget::Select('fields[parent]', $options));
$fieldset->appendChild($label);
// Handle -------------------------------------------------------------
$label = Widget::Label(__('Handle'));
//.........这里部分代码省略.........
示例10: view
public function view(SymphonyDOMElement $wrapper, MessageStack $errors)
{
$page = Administration::instance()->Page;
$page->insertNodeIntoHead($page->createScriptElement(URL . '/extensions/ds_sections/assets/view.js'));
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$right = $layout->createColumn(Layout::SMALL);
// Essentials --------------------------------------------------------
$fieldset = Widget::Fieldset(__('Essentials'));
// Name:
$label = Widget::Label(__('Name'));
$input = Widget::Input('fields[about][name]', General::sanitize($this->about()->name));
$label->appendChild($input);
if (isset($errors->{'about::name'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'about::name'});
}
$fieldset->appendChild($label);
// Section:
$field_groups = $options = array();
foreach (new SectionIterator() as $section) {
$field_groups[$section->handle] = array('fields' => $section->fields, 'section' => $section);
$options[] = array($section->handle, $this->parameters()->section == $section->handle, $section->name);
}
$label = Widget::Label(__('Section'));
$label->appendChild(Widget::Select('fields[section]', $options, array('id' => 'context')));
$fieldset->appendChild($label);
$left->appendChild($fieldset);
// Conditions ---------------------------------------------------------
$fieldset = Widget::Fieldset(__('Conditions'), '<code>$param</code>');
$duplicator = new Duplicator(__('Add Condition'));
//$duplicator->setAttribute('class', 'conditions-duplicator');
// Templates:
$this->appendCondition($duplicator);
// Instances:
if (is_array($this->parameters()->conditions) && !empty($this->parameters()->conditions)) {
foreach ($this->parameters()->conditions as $condition) {
$this->appendCondition($duplicator, $condition);
}
}
$duplicator->appendTo($fieldset);
$left->appendChild($fieldset);
// Filtering ---------------------------------------------------------
$fieldset = Widget::Fieldset(__('Filtering'), '<code>{$param}</code> or <code>Value</code>');
$container_filter_results = $page->createElement('div');
$fieldset->appendChild($container_filter_results);
// Redirect/404 ------------------------------------------------------
/*
$label = Widget::Label(__('Required URL Parameter <i>Optional</i>'));
$label->appendChild(Widget::Input('fields[required_url_param]', $this->parameters()->required_url_param));
$fieldset->appendChild($label);
$p = new XMLElement('p', __('An empty result will be returned when this parameter does not have a value. Do not wrap the parameter with curly-braces.'));
$p->setAttribute('class', 'help');
$fieldset->appendChild($p);
*/
$left->appendChild($fieldset);
// Sorting -----------------------------------------------------------
$fieldset = Widget::Fieldset(__('Sorting'));
$container_sort_by = $page->createElement('div');
$fieldset->appendChild($container_sort_by);
$label = Widget::Label(__('Sort Order'));
$options = array(array('asc', 'asc' == $this->parameters()->{'sort-order'}, __('Acending')), array('desc', 'desc' == $this->parameters()->{'sort-order'}, __('Descending')), array('random', 'random' == $this->parameters()->{'sort-order'}, __('Random')));
$label->appendChild(Widget::Select('fields[sort-order]', $options));
$fieldset->appendChild($label);
$right->appendChild($fieldset);
// Limiting ----------------------------------------------------------
$fieldset = Widget::Fieldset(__('Limiting'), '<code>{$param}</code> or <code>Value</code>');
// Show a maximum of # results
$label = Widget::Label(__('Limit results per page'));
$input = Widget::Input('fields[limit]', $this->parameters()->limit);
$label->appendChild($input);
if (isset($errors->limit)) {
$label = Widget::wrapFormElementWithError($label, $errors->limit);
}
$fieldset->appendChild($label);
// Show page # of results:
$label = Widget::Label(__('Show page of results'));
$input = Widget::Input('fields[page]', $this->parameters()->page);
$label->appendChild($input);
if (isset($errors->page)) {
$label = Widget::wrapFormElementWithError($label, $errors->page);
}
$fieldset->appendChild($label);
// Can redirect on empty:
$fieldset->appendChild(Widget::Input('fields[redirect-404-on-empty]', 'no', 'hidden'));
$label = Widget::Label(__('Redirect to 404 page when no results are found'));
$input = Widget::Input('fields[redirect-404-on-empty]', 'yes', 'checkbox');
if ($this->parameters()->{'redirect-404-on-empty'} == true) {
$input->setAttribute('checked', 'checked');
}
$label->prependChild($input);
$fieldset->appendChild($label);
$right->appendChild($fieldset);
// Output options ----------------------------------------------------
$fieldset = Widget::Fieldset(__('Output Options'));
//$container_parameter_output = $page->createElement('div');
$context_content = $page->createElement('div');
$fieldset->appendChild($context_content);
$fieldset->appendChild(Widget::Input('fields[append-pagination]', 'no', 'hidden'));
$label = Widget::Label(__('Append pagination data'));
//.........这里部分代码省略.........
示例11: view
public function view(SymphonyDOMElement $wrapper, MessageStack $errors)
{
$page = Administration::instance()->Page;
$page->insertNodeIntoHead($page->createScriptElement(URL . '/extensions/ds_sections/assets/view.js'));
$layout = new Layout();
$column_1 = $layout->createColumn(Layout::SMALL);
$column_2 = $layout->createColumn(Layout::SMALL);
$column_3 = $layout->createColumn(Layout::LARGE);
$fieldset = Widget::Fieldset(__('Essentials'));
$label = Widget::Label(__('Name'));
$label->appendChild(Widget::Input('fields[name]', General::sanitize($this->about()->name)));
if (isset($errors->{'about::name'})) {
$fieldset->appendChild(Widget::wrapFormElementWithError($label, $errors->{'about::name'}));
} else {
$fieldset->appendChild($label);
}
$label = Widget::Label(__('Section'));
$options = array();
foreach (new SectionIterator() as $section) {
$options[] = array($section->handle, $this->parameters()->section == $section->handle, $section->name);
}
$label->appendChild(Widget::Select('fields[section]', $options, array('id' => 'context')));
$fieldset->appendChild($label);
$column_1->appendChild($fieldset);
$fieldset = Widget::Fieldset(__('Processing Options'));
$label = Widget::Label(__('Filter Rules'));
$filters = $this->parameters()->filters;
if (!is_array($filters)) {
$filters = array();
}
$options = array(array('admin-only', in_array('admin-only', $filters), __('Admin Only')), array('send-email', in_array('send-email', $filters), __('Send Email')), array('expect-multiple', in_array('expect-multiple', $filters), __('Allow Multiple')));
###
# Delegate: AppendEventFilter
# Description: Allows adding of new filter rules to the Event filter
# rule select box. A reference to the $options array is provided, and selected filters
Extension::notify('AppendEventFilter', '/blueprints/events/', array('selected' => $filters, 'options' => &$options));
$label->appendChild(Widget::Select('fields[filters][]', $options, array('multiple' => 'multiple')));
$fieldset->appendChild($label);
$label = Widget::Label();
$input = Widget::Input('fields[output-id-on-save]', 'yes', 'checkbox');
if ($this->parameters()->{'output-id-on-save'} == true) {
$input->setAttribute('checked', 'checked');
}
$label->appendChild($input);
$label->appendChild(new DOMText(__('Add entry ID to the parameter pool in the format of $this-name-id when saving is successful.')));
$fieldset->appendChild($label);
$column_2->appendChild($fieldset);
$fieldset = Widget::Fieldset(__('Overrides & Defaults'), '{$param}');
foreach (new SectionIterator() as $section) {
$this->appendDuplicator($fieldset, $section, $this->parameters()->section == $section->handle ? array('overrides' => $this->parameters()->overrides, 'defaults' => $this->parameters()->defaults) : NULL);
}
$column_3->appendChild($fieldset);
$layout->appendTo($wrapper);
}
示例12: view
public function view(SymphonyDOMElement $wrapper, MessageStack $errors)
{
$page = $wrapper->ownerDocument;
$page->insertNodeIntoHead($page->createScriptElement(URL . '/extensions/ds_sections/assets/view.js'), 55533140);
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$right = $layout->createColumn(Layout::LARGE);
// Essentials --------------------------------------------------------
$fieldset = Widget::Fieldset(__('Essentials'));
// Name:
$label = Widget::Label(__('Name'));
$input = Widget::Input('fields[about][name]', General::sanitize($this->about()->name));
$label->appendChild($input);
if (isset($errors->{'about::name'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'about::name'});
}
$fieldset->appendChild($label);
// Source ------------------------------------------------------------
$label = Widget::Label(__('Source URL'));
$label->appendChild(Widget::Input('fields[url]', General::sanitize($this->parameters()->url)));
if (isset($errors->url)) {
$label = Widget::wrapFormElementWithError($label, $errors->url);
}
$fieldset->appendChild($label);
$fragment = $page->createDocumentFragment();
$fragment->appendXML(__('Use <code>{$param}</code> syntax to specify dynamic portions of the URL.'));
$fieldset->appendChild($page->createElement('p', $fragment, array('class' => 'help')));
$left->appendChild($fieldset);
// Timeouts ------------------------------------------------------------
$fieldset = Widget::Fieldset(__('Time Limits'));
$label = Widget::Label(__('Cache Limit'));
$label->appendChild(Widget::Input('fields[cache-lifetime]', max(0, intval($this->parameters()->{'cache-lifetime'}))));
if (isset($errors->{'cache-lifetime'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'cache-lifetime'});
}
$fieldset->appendChild($label);
$fragment = $page->createDocumentFragment();
$fragment->appendXML(__('How often to refresh the cache.'));
$fieldset->appendChild($page->createElement('p', $fragment, array('class' => 'help')));
$label = Widget::Label(__('Gateway Timeout'));
$label->appendChild(Widget::Input('fields[timeout]', max(1, intval($this->parameters()->{'timeout'}))));
if (isset($errors->{'timeout'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'timeout'});
}
$fieldset->appendChild($label);
$fragment = $page->createDocumentFragment();
$fragment->appendXML(__('How long to wait for a response.'));
$fieldset->appendChild($page->createElement('p', $fragment, array('class' => 'help')));
$left->appendChild($fieldset);
// Included Elements
$fieldset = Widget::Fieldset(__('XML Processing'));
$label = Widget::Label(__('Included Elements'));
$label->appendChild(Widget::Input('fields[xpath]', General::sanitize($this->parameters()->xpath)));
if (isset($errors->xpath)) {
$label = Widget::wrapFormElementWithError($label, $errors->xpath);
}
$fieldset->appendChild($label);
$help = Symphony::Parent()->Page->createElement('p');
$help->setAttribute('class', 'help');
$help->setValue(__('Use an XPath expression to select which elements from the source XML to include.'));
$fieldset->appendChild($help);
$right->appendChild($fieldset);
// Namespace Declarations
$fieldset = Widget::Fieldset(__('Namespace Declarations'), $page->createElement('em', 'Optional'));
$duplicator = new Duplicator(__('Add Namespace'));
$this->appendNamespace($duplicator);
if (is_array($this->parameters()->namespaces)) {
foreach ($this->parameters()->namespaces as $index => $namespace) {
$this->appendNamespace($duplicator, $namespace);
}
}
$duplicator->appendTo($fieldset);
$right->appendChild($fieldset);
$layout->appendTo($wrapper);
}
示例13: __form
private function __form()
{
$this->insertNodeIntoHead($this->createStylesheetElement(URL . '/extensions/aac/assets/roles.css'));
$this->insertNodeIntoHead($this->createScriptElement(URL . '/extensions/aac/assets/roles.js'));
// The "symphony.selectable.js" messes up the checkboxes, so remove it
foreach ($this->xpath("//head/script[contains(@src, 'symphony/assets/js/symphony.selectable.js')]") as $element) {
$element->parentNode->removeChild($element);
}
if (!in_array($this->_context[0], array('new', 'edit'))) {
throw new AdministrationPageNotFoundException();
}
$callback = Administration::instance()->getPageCallback();
if (isset($callback['flag'])) {
switch ($callback['flag']) {
case 'saved':
$this->alerts()->append(__('Role updated at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all Roles</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), ADMIN_URL . '/extension/aac/roles/new/', ADMIN_URL . '/extension/aac/roles/')), AlertStack::SUCCESS);
break;
case 'created':
$this->alerts()->append(__('Role created at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all Roles</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), ADMIN_URL . '/extension/aac/roles/new/', ADMIN_URL . '/extension/aac/roles/')), AlertStack::SUCCESS);
break;
}
}
/**********
INSERT logic for determining the current role and
whether the user has permission to edit it
**********/
$this->setTitle(__($this->_context[0] == 'new' ? '%1$s – %2$s – Untitled' : '%1$s – %2$s – %3$s', array(__('Symphony'), __('Roles'), $this->role->name)));
$this->appendSubheading($this->_context[0] == 'new' ? __('Untitled') : $this->role->name);
// SETUP PAGE
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$middle = $layout->createColumn(Layout::LARGE);
$right = $layout->createColumn(Layout::LARGE);
/** ESSENTIALS **/
$fieldset = Widget::Fieldset(__('Essentials'));
$label = Widget::Label(__('Name'));
$label->appendChild(Widget::Input('fields[name]', $this->role->name));
$fieldset->appendChild(isset($this->errors->name) ? Widget::wrapFormElementWithError($label, $this->errors->name) : $label);
$label = Widget::Label(__('Description'));
$label->appendChild(Widget::Textarea('fields[description]', $this->role->description, array('rows' => 7, 'cols' => 50)));
$fieldset->appendChild(isset($this->errors->description) ? Widget::wrapFormElementWithError($label, $this->errors->description) : $label);
$left->appendChild($fieldset);
/// PUBLISHING PERMISSIONS
$fieldset = Widget::Fieldset(__('Publishing Permissions'));
$sections = new SectionIterator();
if ($sections->length() <= 0) {
$p = $this->createElement('p', 'No sections exist. ');
$p->appendChild(Widget::Anchor(__('Create one'), ADMIN_URL . '/sections/new/'));
$fieldset->appendChild($p);
} else {
$thead = array(array(__('Section'), 'col'), array(__('Create'), 'col', array('class' => 'checkbox')), array(__('Edit'), 'col', array('class' => 'checkbox')));
$tbody = array();
/*
// TODO: Global permissions set all permissions
$td1 = Widget::TableData(__('Global Permissions'));
$td2 = Widget::TableData(
Widget::Input('global-add', '1', 'checkbox'),
array('class' => 'checkbox')
);
$td3 = Widget::TableData(NULL, array('class' => 'edit'));
$td3->appendChild($this->createElement('p', NULL, array('class' => 'global-slider')));
$td3->appendChild($this->createElement('span', 'n/a'));
$tbody[] = Widget::TableRow(array($td1, $td2, $td3), array('class' => 'global'));
*/
foreach ($sections as $section) {
$td1 = Widget::TableData($section->name);
// TODO: Remove this and implement sliders
$td2 = Widget::TableData();
$td2->appendChild(Widget::Input("fields[permissions][publish::{$section->handle}][create]", '0', 'checkbox', array('checked' => 'checked', 'style' => 'display: none;')));
$td2->appendChild(Widget::Input("fields[permissions][publish::{$section->handle}][create]", '1', 'checkbox', (int) $this->role->permissions()->{"publish::{$section->handle}.create"} > 0 ? array('checked' => 'checked') : NULL));
$edit_level = (int) $this->role->permissions()->{"publish::{$section->handle}.edit"};
$td3 = Widget::TableData(Widget::Select("fields[permissions][publish::{$section->handle}][edit]", array(array('0', false, 'None'), array(1, $edit_level == 1, 'Own'), array(2, $edit_level == 2, 'All'))));
/*
$td2 = Widget::TableData(
Widget::Input(
"fields[permissions][{$section->handle}][create]",
'1',
'checkbox',
($permissions['create'] == 1 ? array('checked' => 'checked') : array())
),
array('class' => 'checkbox')
);
$td3 = Widget::TableData(NULL, array('class' => 'edit'));
$td3->appendChild($this->createElement('p', NULL, array('class' => 'slider')));
$td3->appendChild(
$this->createElement('span', '')
);
$td3->appendChild(
Widget::Input('fields[permissions][' . $section->handle .'][edit]',
(isset($permissions['edit']) ? $permissions['edit'] : '0'),
'hidden'
)
//.........这里部分代码省略.........
示例14: view
public function view(SymphonyDOMElement $wrapper, MessageStack $errors)
{
$page = $wrapper->ownerDocument;
$layout = new Layout();
$left = $layout->createColumn(Layout::SMALL);
$right = $layout->createColumn(Layout::LARGE);
$fieldset = Widget::Fieldset(__('Essentials'));
// Name:
$label = Widget::Label(__('Name'));
$input = Widget::Input('fields[about][name]', General::sanitize($this->about()->name));
$label->appendChild($input);
if (isset($errors->{'about::name'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'about::name'});
}
$fieldset->appendChild($label);
$left->appendChild($fieldset);
$fieldset = Widget::Fieldset(__('Gravatar'), '<code>{$param}</code> or <code>Value</code>');
$label = Widget::Label(__('Email Addresses'));
$input = Widget::Input('fields[addresses]', $this->parameters()->{'addresses'});
$label->appendChild($input);
if (isset($errors->{'addresses'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'addresses'});
}
$help = $page->createElement('p');
$help->setAttribute('class', 'help');
$help->setValue(__('Enter email addresses separated by commas.'));
$fieldset->appendChild($label);
$fieldset->appendChild($help);
$label = Widget::Label(__('Default Image'));
$input = Widget::Input('fields[default]', $this->parameters()->{'default'});
$label->appendChild($input);
if (isset($errors->{'default'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'default'});
}
$help = $page->createElement('p');
$help->setAttribute('class', 'help');
$help->setValue(__('An image to use as a fallback, either identicon, monsterid, wavatar, 404 or a URL to your own image.'));
$fieldset->appendChild($label);
$fieldset->appendChild($help);
$size = $page->createElement('div');
$label = Widget::Label(__('Size'));
$input = Widget::Input('fields[size]', $this->parameters()->{'size'});
$label->appendChild($input);
if (isset($errors->{'size'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'size'});
}
$help = $page->createElement('p');
$help->setAttribute('class', 'help');
$help->setValue(__('Images sized from 1 to 512 pixels. Defaults to 80 pixels.'));
$size->appendChild($label);
$size->appendChild($help);
$rating = $page->createElement('div');
$label = Widget::Label(__('Rating'));
$input = Widget::Input('fields[rating]', $this->parameters()->{'rating'});
$label->appendChild($input);
if (isset($errors->{'rating'})) {
$label = Widget::wrapFormElementWithError($label, $errors->{'rating'});
}
$help = $page->createElement('p');
$help->setAttribute('class', 'help');
$help->setValue(__('Specify a content rating of g, pg, r, or x. Defaults to g.'));
$rating->appendChild($label);
$rating->appendChild($help);
$fieldset->appendChild(Widget::Group($size, $rating));
$right->appendChild($fieldset);
$layout->appendTo($wrapper);
}
示例15: appendSidebar
protected function appendSidebar(DOMElement $wrapper)
{
$container = $this->document->createElement('div');
$container->setAttribute('id', 'sidebar');
// Header:
$header = $this->document->createElement('h1');
$header->appendChild(Widget::Anchor($this->view->title, (string) $this->url));
$container->appendChild($header);
$list = $this->document->createElement('ul');
$list->setAttribute('class', 'menu');
$root = $this->document->createElement('navigation');
####
# Delegate: DevKiAppendtMenuItem
# Description: Allow navigation XML to be manipulated before it is rendered.
# Global: Yes
#$this->_page->ExtensionManager->notifyMembers(
Extension::notify('DevKiAppendtMenuItem', '/frontend/', array('wrapper' => $root));
if ($root->hasChildNodes()) {
foreach ($root->childNodes as $node) {
if ($node->getAttribute('active') == 'yes') {
$item = $this->document->createElement('li', $node->getAttribute('name'));
} else {
$handle = $node->getAttribute('handle');
$url = clone $this->url;
$url->parameters()->{$handle} = null;
$item = $this->document->createElement('li');
$item->appendChild(Widget::Anchor($node->getAttribute('name'), '?' . (string) $url));
}
$list->appendChild($item);
}
}
$item = $this->document->createElement('li');
$item->appendChild(Widget::Anchor(__('Edit'), ADMIN_URL . '/blueprints/views/edit/' . $this->view->handle . '/'));
$list->prependChild($item);
$container->appendChild($list);
// Main:
$fieldset = Widget::Fieldset(__('Pages'));
$container->appendChild($fieldset);
$wrapper->appendChild($container);
return $container;
}