コード例 #1
0
 public function populateFromObject($object, $add_underscore = true)
 {
     /* @var Kaltura_Client_FtpDistribution_Type_FtpDistributionProfile $object */
     parent::populateFromObject($object, $add_underscore);
     $this->addItemXpathsToExtend($object->itemXpathsToExtend);
     $entryFields = array_keys($this->getEntryFields());
     $metadataXpaths = array_keys($this->getMetadataFields());
     $fieldConfigArray = $object->fieldConfigArray;
     $this->setDefault('sftp_public_key_readonly', $object->sftpPublicKey);
     $this->setDefault('sftp_private_key_readonly', $object->sftpPrivateKey);
     $this->setDefault('aspera_public_key_readonly', $object->asperaPublicKey);
     $this->setDefault('aspera_private_key_readonly', $object->asperaPrivateKey);
     //in edit mode of the form
     $this->getElement('protocol')->setAttrib('disabled', true);
     foreach ($fieldConfigArray as $fieldConfig) {
         if (!isset($fieldConfig->updateParams[0]) || !isset($fieldConfig->updateParams[0]->value)) {
             continue;
         }
         $field = $fieldConfig->updateParams[0]->value;
         $index = array_search($field, $entryFields);
         if ($index !== false) {
             $this->setDefault("update_required_entry_fields_{$index}", true);
         }
         $index = array_search($field, $metadataXpaths);
         if ($index !== false) {
             $this->setDefault("update_required_metadata_xpaths_{$index}", true);
         }
     }
 }
コード例 #2
0
 public function init()
 {
     parent::init();
     $this->setDescription('DoubleClick Distribution Profile');
     $this->getView()->addBasePath(realpath(dirname(__FILE__)));
     $this->addDecorator('ViewScript', array('viewScript' => 'doubleclick-form.phtml', 'placement' => 'APPEND'));
 }
コード例 #3
0
 public function populateFromObject($object, $add_underscore = true)
 {
     $this->tvinciElements();
     parent::populateFromObject($object, $add_underscore);
     if ($object->xsltFile) {
         $this->getElement('xsltFileText')->setValue(json_encode($object->xsltFile));
     }
 }
コード例 #4
0
 public function populateFromObject($object, $add_underscore = true)
 {
     $this->_sort();
     $order = $this->_order[self::FORM_PLACEHOLDER_ELEMENT_ID];
     $this->resetOrderOfLastElements();
     /** @var $object Kaltura_Client_TvinciDistribution_Type_TvinciDistributionProfile */
     $this->layoutForm($order++);
     parent::populateFromObject($object, $add_underscore);
 }
コード例 #5
0
 public function addFlavorParamsFields(Kaltura_Client_Type_FlavorParamsListResponse $flavorParams, array $optionalFlavorParamsIds = array(), array $requiredFlavorParamsIds = array())
 {
     $options = array();
     foreach ($flavorParams->objects as $flavorParamsItem) {
         /* @var $flavorParamsItem Kaltura_Client_Type_FlavorParams */
         $options[$flavorParamsItem->id] = $flavorParamsItem->name;
     }
     $this->getElement("remote_asset_params_id")->setMultiOptions($options);
     parent::addFlavorParamsFields($flavorParams, $optionalFlavorParamsIds, $requiredFlavorParamsIds);
 }
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     /* @var $object Kaltura_Client_FtpDistribution_Type_FtpDistributionProfile */
     $object = parent::getObject($objectType, $properties, $add_underscore, true);
     $upload = new Zend_File_Transfer_Adapter_Http();
     $files = $upload->getFileInfo();
     if (isset($files['sftp_public_key'])) {
         $object->sftpPublicKey = $this->getFileContent($files['sftp_public_key']);
     }
     if (isset($files['sftp_private_key'])) {
         $object->sftpPrivateKey = $this->getFileContent($files['sftp_private_key']);
     }
     if (isset($files['aspera_public_key'])) {
         $object->asperaPublicKey = $this->getFileContent($files['aspera_public_key']);
     }
     if (isset($files['aspera_private_key'])) {
         $object->asperaPrivateKey = $this->getFileContent($files['aspera_private_key']);
     }
     $updateRequiredEntryFields = array();
     $updateRequiredMetadataXpaths = array();
     $entryFields = array_keys($this->getEntryFields());
     $metadataXpaths = array_keys($this->getMetadataFields());
     $fieldConfigArray = array();
     foreach ($properties as $property => $value) {
         if (!$value) {
             continue;
         }
         $updateField = null;
         $matches = null;
         if (preg_match('/update_required_entry_fields_(\\d+)$/', $property, $matches)) {
             $index = $matches[1];
             if (isset($entryFields[$index])) {
                 $updateField = $entryFields[$index];
             }
         }
         if (preg_match('/update_required_metadata_xpaths_(\\d+)$/', $property, $matches)) {
             $index = $matches[1];
             if (isset($metadataXpaths[$index])) {
                 $updateField = $metadataXpaths[$index];
             }
         }
         if ($updateField) {
             $fieldConfig = new Kaltura_Client_ContentDistribution_Type_DistributionFieldConfig();
             $fieldConfig->fieldName = md5($updateField);
             // needs to have a value for the field to get saved
             $fieldConfig->updateOnChange = true;
             $string = new Kaltura_Client_Type_String();
             $string->value = $updateField;
             $fieldConfig->updateParams = array($string);
             $fieldConfigArray[] = $fieldConfig;
         }
     }
     $object->fieldConfigArray = $fieldConfigArray;
     return $object;
 }
コード例 #7
0
 public function populateFromObject($object, $add_underscore = true)
 {
     parent::populateFromObject($object, $add_underscore);
     $this->setDefault('aspera_public_key_readonly', $object->asperaPublicKey);
     $this->setDefault('aspera_private_key_readonly', $object->asperaPrivateKey);
     $additionalCategories = array();
     foreach ($object->seriesAdditionalCategories as $category) {
         $additionalCategories[] = $category->value;
     }
     $this->setDefault('series_additional_categories', $additionalCategories);
 }
コード例 #8
0
 public function populateFromObject($object, $add_underscore = true)
 {
     $this->_sort();
     $order = $this->_order[self::FORM_PLACEHOLDER_ELEMENT_ID];
     $this->resetOrderOfLastElements();
     /** @var $object Kaltura_Client_YouTubeDistribution_Type_YouTubeDistributionProfile */
     if ($object->feedSpecVersion == Kaltura_Client_YouTubeDistribution_Enum_YouTubeDistributionFeedSpecVersion::VERSION_2) {
         $this->setV2Mode($order++);
     } else {
         $this->setV1Mode($order++);
     }
     parent::populateFromObject($object, $add_underscore);
 }
コード例 #9
0
 public function populateFromObject($object, $add_underscore = true)
 {
     parent::populateFromObject($object, $add_underscore);
     if ($object->replaceGroup) {
         $this->setDefault('replace_group', 'true');
     } else {
         $this->setDefault('replace_group', 'false');
     }
     if ($object->replaceAirDates) {
         $this->setDefault('replace_air_dates', 'true');
     } else {
         $this->setDefault('replace_air_dates', 'false');
     }
 }
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
     if ($object instanceof Kaltura_Client_YouTubeDistribution_Type_YouTubeDistributionProfile) {
         $upload = new Zend_File_Transfer_Adapter_Http();
         $files = $upload->getFileInfo();
         if (isset($files['sftp_public_key'])) {
             $file = $files['sftp_public_key'];
             if ($file['size']) {
                 $content = file_get_contents($file['tmp_name']);
                 $object->sftpPublicKey = $content;
             }
         }
         if (isset($files['sftp_private_key'])) {
             $file = $files['sftp_private_key'];
             if ($file['size']) {
                 $content = file_get_contents($file['tmp_name']);
                 $object->sftpPrivateKey = $content;
             }
         }
     }
     return $object;
 }
コード例 #11
0
 public function init()
 {
     parent::init();
     $this->getView()->addBasePath(realpath(dirname(__FILE__)));
 }
コード例 #12
0
 public function render(Zend_View_Interface $view = null)
 {
     $this->disableTriggerUpdateFieldConfig();
     return parent::render($view);
 }
コード例 #13
0
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = true)
 {
     $object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
     return $object;
 }
コード例 #14
0
 public function init()
 {
     parent::init();
     $this->getView()->addBasePath(realpath(dirname(__FILE__)));
     $this->addDecorator('ViewScript', array('viewScript' => 'youtube-distribution.phtml', 'placement' => 'APPEND'));
 }
コード例 #15
0
 public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = true)
 {
     // $include_empty_fields is defaulted to true instead of false, so we can empty fields
     return parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
 }
コード例 #16
0
 public function populateFromObject($object, $add_underscore = true)
 {
     /* @var Kaltura_Client_CrossKalturaDistribution_Type_CrossKalturaDistributionProfile $object */
     parent::populateFromObject($object, $add_underscore);
     // transform the KalturaStringValue array to a normal array
     $xpathsArray = array();
     foreach ($object->metadataXpathsTriggerUpdate as $xpathStringValue) {
         $xpathsArray[] = $xpathStringValue->value;
     }
     $this->setDefault(self::ELEMENT_METADATA_XPATHS_THAT_TRIGGER_UPDATE, array_unique($xpathsArray));
     // transform source/target map fields
     $this->setDefault(self::ELEMENT_MAP_ACCESS_CONTROL_IDS, json_encode($object->mapAccessControlProfileIds));
     $this->setDefault(self::ELEMENT_MAP_CONVERSION_PROFILE_IDS, json_encode($object->mapConversionProfileIds));
     $this->setDefault(self::ELEMENT_MAP_METADATA_PROFILE_IDS, json_encode($object->mapMetadataProfileIds));
     $this->setDefault(self::ELEMENT_MAP_STORAGE_PROFILE_IDS, json_encode($object->mapStorageProfileIds));
     $this->setDefault(self::ELEMENT_MAP_FLAVOR_PARAMS_IDS, json_encode($object->mapFlavorParamsIds));
     $this->setDefault(self::ELEMENT_MAP_THUMB_PARAMS_IDS, json_encode($object->mapThumbParamsIds));
     $this->setDefault(self::ELEMENT_MAP_CAPTION_PARAMS_IDS, json_encode($object->mapCaptionParamsIds));
 }
コード例 #17
0
 public function populateFromObject($object, $add_underscore = true)
 {
     // save the profile on the form instance because addFlavorParamsFields is called after populateFromObject
     $this->msnDistributionProfile = $object;
     parent::populateFromObject($object, $add_underscore);
 }