public function getAPICaptions() { $apiList = array(); foreach (opToolkit::retrieveAPIList() as $key => $value) { if (in_array($key, $this->getUsingApis())) { $apiList[] = $value; } } return $apiList; }
public function configure() { unset($this['created_at'], $this['updated_at'], $this['file_id'], $this['key_string'], $this['secret'], $this['member_id']); $this->setWidget('image', new sfWidgetFormInputFile()); $this->setValidator('image', new opValidatorImageFile(array('required' => false))); $apis = opToolkit::retrieveAPIList(); $this->setWidget('using_apis', new sfWidgetFormSelectMany(array('choices' => $apis), array('size' => 10))); $this->setValidator('using_apis', new sfValidatorChoice(array('multiple' => true, 'choices' => array_keys($apis)))); $this->getWidgetSchema()->setHelp('using_apis', 'Select apis that your application needs.'); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('api'); }