/**
  * Draw a confirmation message for this action.
  * @param FORM_RENDERER $renderer
  * @access private
  */
 protected function _draw_message($renderer)
 {
     $renderer->start_row();
     $renderer->draw_text_row('', 'Are you sure you want to purge ' . $this->object_list->description() . '?*');
     if ($this->visible('remove_resources')) {
         $renderer->start_row(' ');
         echo $renderer->check_box_as_html('remove_resources');
         $renderer->finish_row();
     }
     $renderer->draw_text_row('', '*Purging an object permanently removes it and all contained content (entries, comments, etc.) from the database.', 'notes');
     $renderer->finish_row();
     $buttons[] = $renderer->button_as_HTML('No', "view_explorer.php?id={$this->_folder->id}");
     $buttons[] = $renderer->submit_button_as_HTML();
     $renderer->draw_buttons_in_row($buttons);
 }
 /**
  * Draw a confirmation message for this action.
  * @param FORM_RENDERER $renderer
  * @access private
  */
 protected function _draw_message($renderer)
 {
     if ($this->copy) {
         $renderer->draw_text_row('', 'Are you sure you want to copy ' . $this->object_list->description() . '?');
     } else {
         $renderer->draw_text_row('', 'Are you sure you want to move ' . $this->object_list->description() . '?');
     }
     if ($this->object_list->has_folders() && $this->visible('maintain_permissions')) {
         $renderer->start_row();
         echo $renderer->check_box_as_html('maintain_permissions');
         $renderer->finish_row();
     }
     if ($this->object_list->has_entries() && $this->visible('copy_as_draft')) {
         $renderer->start_row();
         echo $renderer->check_box_as_html('copy_as_draft');
         $renderer->finish_row();
     }
     /* Make a copy (not a reference). */
     $tree = $this->app->make_tree_renderer();
     include_once 'webcore/gui/folder_tree_node_info.php';
     $tree_node_info = new EXPLORER_FOLDER_TREE_NODE_INFO($this->context);
     $tree_node_info->set_visible_node($this->_folder);
     $tree_node_info->set_selected_node($this->_folder);
     $tree_node_info->nodes_are_links = false;
     include_once 'webcore/gui/selector_tree_decorator.php';
     $decorator = new SELECTOR_TREE_DECORATOR($tree);
     $decorator->control_name = 'selected_folder_id';
     $tree->node_info = $tree_node_info;
     $tree->decorator = $decorator;
     $folder_query = $this->app->login->folder_query();
     $folders = $folder_query->tree();
     $renderer->start_row('Target');
     $tree->display($folders);
     $renderer->finish_row();
     $renderer->draw_error_row('selected_folder_id');
     $buttons[] = $renderer->button_as_HTML('No', "view_explorer.php?id={$this->_folder->id}");
     $buttons[] = $renderer->submit_button_as_HTML();
     $renderer->draw_buttons_in_row($buttons);
 }
Ejemplo n.º 3
0
 /**
  * @param FORM_RENDERER $renderer
  * @access private
  */
 protected function _draw_controls($renderer)
 {
     /** @var UPLOADED_FILE_SET $file_set */
     $file_set = $this->value_for('upload_file');
     /** @var ALBUM $folder */
     $folder = $this->_folder;
     $upload_allowed = $folder->uploads_allowed();
     $upload_found = isset($file_set) && $file_set->is_valid();
     $is_uploading = $this->value_for('use_upload');
     $this->set_enabled('file_name', !$is_uploading);
     $this->set_enabled('overwrite', $is_uploading);
     $this->set_enabled('upload_file', $is_uploading);
     if (!$upload_allowed || $upload_found) {
         $renderer->draw_hidden('use_upload');
     }
     if ($upload_found) {
         $renderer->draw_hidden('overwrite');
     }
     $renderer->start();
     $renderer->draw_text_line_row('title');
     if (!$this->object_exists()) {
         $renderer->start_block('Day');
         $props = $renderer->make_list_properties();
         $props->on_click_script = 'on_date_changed (this)';
         if (isset($this->_exif_date)) {
             $caption = 'Use <span class="field">' . $this->_exif_date->format() . '</span> (snapshot date)';
         } else {
             $caption = 'Use date stored by a digital camera';
         }
         $props->add_item($caption, 1);
         $props->add_item('Use the date below', 0);
         $renderer->start_row();
         echo $renderer->radio_group_as_html('read_exif', $props);
         $renderer->finish_row();
         $renderer->draw_date_row('day');
         $renderer->draw_error_row('read_exif');
         $renderer->draw_error_row('day');
         $renderer->finish_block();
     } else {
         $renderer->draw_date_row('day');
     }
     $renderer->draw_text_box_row('description', 'short-medium');
     if ($upload_allowed) {
         if (!$upload_found) {
             $options = new FORM_TEXT_CONTROL_OPTIONS();
             $renderer->start_block('Picture');
             if ($this->object_exists()) {
                 /** @var PICTURE $pic */
                 $pic = $this->_object;
                 echo '<img class="pullquote right align-right" src="' . $pic->full_thumbnail_name() . '" alt="Picture">';
             }
             $props = $renderer->make_list_properties();
             $props->on_click_script = 'file_option_changed (this)';
             $props->add_item($this->app->resolve_icon_as_html('{icons}buttons/upload', Sixteen_px, 'Upload') . ' Upload the picture below', 1);
             $renderer->start_row();
             echo $renderer->radio_group_as_html('use_upload', $props);
             $renderer->finish_row();
             $renderer->start_row();
             $options->on_change_script = 'upload_file_changed (this)';
             echo $renderer->file_as_html('upload_file', $options);
             echo $renderer->check_box_as_html('overwrite');
             $renderer->finish_row();
             $renderer->draw_error_row('upload_file');
             $props->clear_items();
             $props->add_item('Show the picture from the URL below', 0);
             $renderer->start_row();
             echo $renderer->radio_group_as_html('use_upload', $props);
             $renderer->finish_row();
             $renderer->start_row();
             $options->on_change_script = 'file_name_changed (this)';
             echo $renderer->text_line_as_html('file_name', $options);
             $renderer->finish_row();
             $renderer->draw_error_row('file_name');
             $this->_draw_thumbnail_options($renderer, '');
             $renderer->finish_block();
         } else {
             $renderer->draw_file_row('upload_file');
             $this->_draw_thumbnail_options($renderer, ' ');
         }
     } else {
         $renderer->start_row();
         if ($this->object_exists()) {
             /** @var PICTURE $pic */
             $pic = $this->_object;
             echo '<img class="pullquote right align-right" src="' . $pic->full_thumbnail_name() . '" alt="Picture">';
         }
         $renderer->finish_row();
         $renderer->draw_text_line_row('file_name');
         $this->_draw_thumbnail_options($renderer, ' ');
     }
     $renderer->draw_check_box_row('is_visible');
     $renderer->draw_submit_button_row();
     $this->_draw_history_item_controls($renderer);
     $renderer->finish();
 }
Ejemplo n.º 4
0
 /**
  * Allows descendents to draw options in the standard form.
  * Called from {@link _draw_controls()}.
  * @param FORM_RENDERER $renderer
  * @access private
  */
 protected function _draw_options($renderer)
 {
     if ($this->visible('remove_resources')) {
         $renderer->start_row(' ');
         echo $renderer->check_box_as_html('remove_resources');
         $renderer->finish_row();
     }
 }