/** * DOCUMENT ME */ public function setup() { parent::setup(); $services = aMediaTools::getEmbedServiceNames(); $this->setWidget('service', new aWidgetFormChoice(array('choices' => array_combine($services, $services), 'expanded' => true, 'default' => 'YouTube'))); $this->setValidator('service', new sfValidatorChoice(array('choices' => $services))); $this->widgetSchema->setFormFormatterName('aAdmin'); }
/** * DOCUMENT ME */ public function configure() { $services = aMediaTools::getEmbedServiceNames(); $this->setWidget('service', new aWidgetFormChoice(array('choices' => array_combine($services, $services), 'expanded' => true, 'default' => 'YouTube'))); $this->setValidator('service', new sfValidatorChoice(array('choices' => $services))); $this->setWidget('q', new sfWidgetFormInput(array(), array('class' => 'a-search-video a-search-form'))); $this->setValidator('q', new sfValidatorString(array('required' => true))); $this->widgetSchema->setNameFormat('aMediaSearchServices[%s]'); $this->widgetSchema->setFormFormatterName('aAdmin'); $this->widgetSchema->setLabel('q', ' '); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('apostrophe'); }
use_helper('a'); ?> <div class="a-media-add-subheading a-media-add-embed"> <h3><?php echo a_('Add by Embed Code'); ?> </h3> <p><?php echo a_("You can paste almost any embed code below. You can also paste a URL for the following services: "); ?> <?php $list = array(); ?> <?php echo implode(a_(', '), aMediaTools::getEmbedServiceNames()); ?> </p> <?php $form = new aMediaVideoForm(); ?> <form id="a-media-video-add-by-embed-form" class="a-media-search-form" method="post" action="<?php echo url_for("aMedia/editVideo"); ?> "> <div class="a-form-row a-hidden"> <?php // If you tamper with this, the next form will be missing a default radio button choice ?> <?php