Beispiel #1
0
 /**
  * Present an interface to edit / create content
  */
 function run_editable()
 {
     $inline_edit =& get_reason_inline_editing($this->page_id);
     $active = $inline_edit->active_for_module($this);
     $class = $active ? 'editable editing' : 'editable';
     echo '<div id="pageContent" class="' . $class . '">' . "\n";
     if ($active) {
         $form = new Disco();
         $form->strip_tags_from_user_input = true;
         $form->allowable_HTML_tags = REASON_DEFAULT_ALLOWED_TAGS;
         $form->actions = array('save' => 'Save', 'save_and_finish' => 'Save and Finish Editing');
         $form->add_element('editable_content', html_editor_name($this->site_id), html_editor_params($this->site_id, $this->get_html_editor_user_id()));
         $form->set_display_name('editable_content', ' ');
         $form->set_value('editable_content', $this->content);
         $form->add_callback(array(&$this, 'process_editable'), 'process');
         $form->add_callback(array(&$this, 'where_to_editable'), 'where_to');
         $form->run();
     } else {
         $url = carl_make_link($inline_edit->get_activation_params($this));
         if (!carl_empty_html($this->content)) {
             $link = '<p><a href="' . $url . '" class="editThis">Edit Content</a></p>';
             $pre = '<div class="editRegion">';
             $post = '</div>';
             $output = $pre . $this->content . $link . $post;
         } else {
             $link = '<p><a href="' . $url . '" class="editThis">Create Content</a></p>';
             $pre = '<div class="editRegion">';
             $post = '</div>';
             $output = $pre . $link . $post;
         }
         echo $output;
     }
     echo '</div>' . "\n";
 }
 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;
 }
 function run_form()
 {
     $form = new Disco();
     $form->actions = array('save' => 'Use This Image');
     $range_opts = $this->generate_range_options();
     $form->add_element('thumbnails', 'range_slider', $range_opts);
     $form->set_display_name('thumbnails', 'Thumbnails');
     // This element is merely a placeholder for the javascript to see
     $form->add_element('entry_id', 'hidden');
     $form->set_value('entry_id', $this->media_work->get_value('entry_id'));
     $form->add_callback(array(&$this, 'process_form'), 'process');
     $form->add_callback(array(&$this, 'where_to'), 'where_to');
     $form->run();
 }
 function show_form()
 {
     $form = new Disco();
     $form->strip_tags_from_user_input = true;
     if ($this->has_master_admin_edit_access) {
         $form->add_element('add_user', 'checkbox');
         $form->set_display_name('add_user', 'Add self to site');
     }
     if ($this->can_pose_as_other_user && $this->get_users_with_access()) {
         if ($this->has_master_admin_edit_access) {
             $form->add_element('or_comment', 'comment', array('text' => '<strong>OR</strong>'));
         }
         $form->add_element('user_list', 'select', array('options' => $this->build_usernames()));
         $form->set_display_name('user_list', 'Pose as a user with access');
     }
     $form->add_callback(array(&$this, 'pre_show_form'), 'pre_show_form');
     $form->add_callback(array(&$this, 'process'), 'process');
     $form->add_callback(array(&$this, 'where_to'), 'where_to');
     $form->run();
 }
 function run_form()
 {
     $form = new Disco();
     $form->actions = array('save' => 'Use This Image');
     $range_opts = $this->generate_range_options();
     $form->add_element('seconds', 'range_slider', $range_opts);
     $form->set_display_name('seconds', 'Seconds into Video');
     // This element is merely a placeholder for the javascript to see
     $form->add_element('entry_id', 'hidden');
     $form->set_value('entry_id', $this->media_work->get_value('entry_id'));
     $form->add_element('service_url', 'hidden');
     $form->set_value('service_url', KALTURA_SERVICE_URL);
     $form->add_element('partner_id', 'hidden');
     $form->set_value('partner_id', KALTURA_PARTNER_ID);
     $form->add_callback(array(&$this, 'process_form'), 'process');
     $form->add_callback(array(&$this, 'where_to'), 'where_to');
     $form->run();
 }