function set_content_manager($manager)
 {
     $this->manager = $manager;
     $this->recognized_extensions = KalturaShim::get_recognized_extensions();
     $manager->recognized_extensions = $this->recognized_extensions;
     $this->kaltura_shim = new KalturaShim();
     // set initial metadata to check if it has changed later
     $this->initial_metadata['id'] = $this->manager->get_value('id');
     $this->initial_metadata['name'] = $this->manager->get_value('name');
     $this->initial_metadata['description'] = $this->manager->get_value('description');
     $this->initial_metadata['keywords'] = $this->manager->get_value('keywords');
     if ($manager->get_value('entry_id')) {
         $this->displayer_chrome = new KalturaSizeSwitchDisplayerChrome();
         $this->displayer_chrome->set_media_work(new entity($manager->get_value('id')));
     }
 }
Пример #2
0
 protected function _get_form()
 {
     $d = new Disco();
     $d->set_form_class("StackedBox");
     $d->add_element('name', 'text');
     $d->set_display_name('name', 'Creator\'s Name');
     $d->add_required('name');
     $d->add_element('email', 'text');
     $d->set_display_name('email', 'Creator\'s Email Address');
     $d->add_required('email');
     $d->add_element('class_year', 'text');
     $d->set_display_name('class_year', 'Creators\'s Class Year (if Applicable)');
     $d->add_element('media_title', 'text');
     $d->set_display_name('media_title', 'Title');
     $d->add_required('media_title');
     $d->add_element('description', 'textarea');
     $d->set_display_name('description', 'Media Description');
     $d->add_required('description');
     $d->add_element('av_type', 'radio_no_sort', array('options' => array('Audio' => 'Audio <span class="smallText formComment">(e.g. sound-only music, speech, etc.)</span>', 'Video' => 'Video <span class="smallText formComment">(e.g. movies, videos, etc.)</span>')));
     $d->set_display_name('av_type', 'Media Type');
     $d->add_required('av_type');
     //$authenticator = array("reason_username_has_access_to_site", $this->get_value("site_id"));
     $params = array('acceptable_extensions' => KalturaShim::get_recognized_extensions(), 'max_file_size' => $this->_get_actual_max_upload_size(), 'head_items' => &$this->head_items);
     $d->add_element('upload_file', 'ReasonUpload', $params);
     $d->set_display_name('upload_file', 'Media to Upload');
     //$d->add_required('upload_file');
     $d->add_comments('upload_file', form_comment('If the file is on your computer, browse to it here.'));
     $d->add_comments('upload_file', form_comment('File must have one of the following extensions: .' . implode(', .', KalturaShim::get_recognized_extensions())));
     $d->add_comments('upload_file', form_comment('<div class="maxUploadSizeNotice">Maximum file size for uploading is 100MB. </div>'));
     $d->add_element('url', 'text');
     $d->set_display_name('url', 'Media url');
     $d->add_comments('url', form_comment('If you are uploading a file larger than 100MB, enter the url of the file you are uploading here.'));
     $d->add_comments('url', form_comment('Example: http://people.carleton.edu/~huderlem/reason_import_only/video.mp4'));
     $d->add_element('permission', 'checkboxfirst');
     $d->set_display_name('permission', 'I give Carleton College the right to reproduce, display, and use this media in any manner.');
     $d->add_required('permission');
     $d->add_element('rights', 'checkboxfirst');
     $d->set_display_name('rights', 'I am the creator of this media and have full rights to its use.');
     $d->add_required('rights');
     $d->set_actions(array('save' => 'Submit your Media'));
     $d->form_enctype = 'multipart/form-data';
     $this->_populate_author($d);
     $d->add_callback(array($this, 'get_intro'), 'pre_show_form');
     $d->add_callback(array($this, 'error_check_form'), 'run_error_checks');
     $d->add_callback(array($this, 'process_form'), 'process');
     $d->add_callback(array($this, 'get_thank_you_url'), 'where_to');
     return $d;
 }
Пример #3
0
 function get_recognized_extensions()
 {
     return KalturaShim::get_recognized_extensions();
 }