예제 #1
0
 public function appendSettingsInterface(XMLElement $wrapper, $field_name, StdClass $settings = null, MessageStack $errors)
 {
     // Select available drivers:
     $driv_wrap = new XMLElement('div');
     $driv_wrap->addClass('oembed-drivers');
     $driv_title = new XMLElement('label');
     $driv_title->setValue(__('Supported services <i>Select to enable the service in the publish page</i>'));
     $driv_title->appendChild(FieldOembed::generateDriversSelectOptions($settings, "{$field_name}[drivers][]"));
     if (isset($errors->{'drivers'})) {
         $driv_title = Widget::wrapFormElementWithError($driv_title, $errors->{'drivers'});
     }
     $driv_wrap->appendChild($driv_title);
     // Fixes issue #11 (Got a better description?)
     $par_wrap = new XMLElement('div');
     $par_wrap->addClass('oembed-params-settings');
     $par_title = new XMLElement('label');
     $par_title->setValue(__('Request URL Parameters (Appended to the query string) <i>Optional</i>'));
     $par_title->appendChild(Widget::Input("{$field_name}[parameters]", $settings->{'parameters'}));
     $par_wrap->appendChild($par_title);
     $wrapper->appendChild($driv_wrap);
     $wrapper->appendChild($par_wrap);
 }
 /**
  *
  * Drops the table needed for the settings of the field
  */
 public function uninstall()
 {
     // pre v1.3.2
     $field = FieldOembed::deleteFieldTable();
     return $field;
 }