示例#1
0
文件: Html.php 项目: patrova/omeka-s
 /**
  * {@inheritDoc}
  */
 public function form(PhpRenderer $view, array $options = [])
 {
     $titleInput = new TextInput('o:media[__index__][dcterms:title][0][@value]');
     $titlePropertyInput = new Hidden('o:media[__index__][dcterms:title][0][property_id]');
     //make sure we have correct dcterms:title id
     $api = $view->api();
     $dctermsTitle = $api->search('properties', ['term' => 'dcterms:title'])->getContent()[0];
     $titlePropertyInput->setValue($dctermsTitle->id());
     $titleInput->setOptions(['label' => $view->translate('Title'), 'info' => $view->translate('A title for the HTML content')]);
     $html = $view->formRow($titleInput);
     $html .= $view->formRow($titlePropertyInput);
     $html .= $this->getForm($view, 'media-html-__index__');
     return $html;
 }