From d6c76b1fe30fc8065c985c31df633c3c6cbbed9f Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 1 May 2012 23:39:57 +0200 Subject: add ID/info to display more information about a file The table is shared with the old delete_form, but it doesn't display the delete button in info mode. Signed-off-by: Florian Pritz --- application/controllers/file.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index 751b72ce2..079802dbc 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -180,13 +180,12 @@ class File extends CI_Controller { echo $cached; } - // Allow users to delete IDs if their password matches the one used when uploading + // Allow users to delete their own IDs function delete() { $this->muser->require_access(); $id = $this->uri->segment(3); - $this->data["title"] .= " - Delete $id"; $this->data["id"] = $id; $process = $this->input->post("process"); @@ -194,11 +193,6 @@ class File extends CI_Controller { $process = true; } - $this->data["filedata"] = $this->file_mod->get_filedata($id); - if ($this->data["filedata"]) { - $this->data["filedata"]["size"] = filesize($this->file_mod->file($this->data["filedata"]["hash"])); - } - if ($id && !$this->file_mod->id_exists($id)) { $this->output->set_status_header(404); $this->data["msg"] = "Unknown ID."; @@ -213,11 +207,10 @@ class File extends CI_Controller { } } + $this->data["filedata"] = $this->file_mod->get_filedata($id); $this->data["can_delete"] = $this->data["filedata"]["user"] == $this->muser->get_userid(); - $this->load->view($this->var->view_dir.'/header', $this->data); - $this->load->view($this->var->view_dir.'/delete_form', $this->data); - $this->load->view($this->var->view_dir.'/footer', $this->data); + $this->file_mod->display_info($id); } // Handle pastes -- cgit v1.2.3-24-g4f1b