View source
<?php
class oembed_provider_ui extends ctools_export_ui {
function edit_form(&$form, &$form_state) {
parent::edit_form($form, $form_state);
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#description' => t('A human-readable title for the provider.'),
'#size' => 32,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => $form_state['item']->title,
);
$form['endpoint'] = array(
'#type' => 'textfield',
'#title' => t('Endpoint'),
'#description' => t('The endpoint where oEmbed requests are going to be sent.'),
'#size' => 32,
'#maxlength' => 255,
'#required' => TRUE,
'#default_value' => $form_state['item']->endpoint,
);
$form['scheme'] = array(
'#type' => 'textarea',
'#title' => t('Schemes'),
'#description' => t('Newline separated list of schemes like !example', array(
'!example' => 'http://*.revision3.com/*',
)),
'#required' => TRUE,
'#default_value' => $form_state['item']->scheme,
);
}
function edit_form_submit(&$form, &$form_state) {
oembed_providers_reset();
return parent::edit_form_submit($form, $form_state);
}
function edit_form_import_submit($form, &$form_state) {
oembed_providers_reset();
return parent::edit_form_import_submit($form, $form_state);
}
function delete_form_submit(&$form_state) {
oembed_providers_reset();
return parent::delete_form_submit($form_state);
}
function set_item_state($state, $js, $input, $item) {
oembed_providers_reset();
return parent::set_item_state($state, $js, $input, $item);
}
}