public function __viewInfo() { $datasource = DataSource::loadFromHandle($this->_context[1]); $about = $datasource->about(); $this->setTitle(__('%1$s – %2$s – %3$s', array(__('Symphony'), __('Data Source'), $about->name))); $this->appendSubheading($about->name); $this->Form->setAttribute('id', 'controller'); $link = $about->author->name; 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); } foreach ($about as $key => $value) { $fieldset = NULL; switch ($key) { case 'user': $fieldset = $this->createElement('fieldset'); $fieldset->appendChild($this->createElement('legend', 'User')); $fieldset->appendChild($this->createElement('p', $link)); break; case 'version': $fieldset = $this->createElement('fieldset'); $fieldset->appendChild($this->createElement('legend', 'Version')); $fieldset->appendChild($this->createElement('p', $value . ', released on ' . DateTimeObj::get(__SYM_DATE_FORMAT__, strtotime($about->{'release-date'})))); break; case 'description': $fieldset = $this->createElement('fieldset'); $fieldset->appendChild($this->createElement('legend', 'Description')); $fieldset->appendChild(is_object($about->description) ? $about->description : $this->createElement('p', $about->description)); case 'example': if (is_callable(array($datasource, 'example'))) { $fieldset = $this->createElement('fieldset'); $fieldset->appendChild($this->createElement('legend', 'Example XML')); $example = $datasource->example(); if (is_object($example)) { $fieldset->appendChild($example); } else { $p = $this->createElement('p'); $p->appendChild($this->createElement('pre', '<code>' . str_replace('<', '<', $example) . '</code>')); $fieldset->appendChild($p); } } break; } if ($fieldset) { $fieldset->setAttribute('class', 'settings'); $this->Form->appendChild($fieldset); } } /* $dl->appendChild(new XMLElement('dt', __('URL Parameters'))); if(!is_array($about['recognised-url-param']) || empty($about['recognised-url-param'])){ $dl->appendChild(new XMLElement('dd', '<code>'.__('None').'</code>')); } else{ $dd = new XMLElement('dd'); $ul = new XMLElement('ul'); foreach($about['recognised-url-param'] as $f) $ul->appendChild(new XMLElement('li', '<code>' . $f . '</code>')); $dd->appendChild($ul); $dl->appendChild($dd); } $fieldset->appendChild($dl); */ }