mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 01:37:02 +02:00
improved folder feature
This commit is contained in:
31
webui/controller/message/folder.php
Normal file
31
webui/controller/message/folder.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerMessageFolder extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "message/note.tpl";
|
||||
$this->layout = "common/layout-empty";
|
||||
|
||||
$session = Registry::get('session');
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
$sphx = Registry::get('sphx');
|
||||
|
||||
$this->load->model('search/search');
|
||||
$this->load->model('folder/folder');
|
||||
|
||||
if(isset($this->request->post['folder_id']) && isset($this->request->post['id'])) {
|
||||
|
||||
if($this->model_search_search->check_your_permission_by_id($this->request->post['id']) == 1) {
|
||||
$this->model_folder_folder->update_message_folder($this->request->post['id'], $this->request->post['folder_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -19,6 +19,10 @@ class ControllerMessageView extends Controller {
|
||||
|
||||
$this->load->model('user/user');
|
||||
|
||||
if(ENABLE_FOLDER_RESTRICTIONS == 1) {
|
||||
$this->load->model('folder/folder');
|
||||
}
|
||||
|
||||
$this->document->title = $this->data['text_message'];
|
||||
|
||||
$this->data['id'] = '';
|
||||
@ -83,6 +87,11 @@ class ControllerMessageView extends Controller {
|
||||
$this->data['can_download'] = $this->model_audit_audit->can_download();
|
||||
$this->data['can_restore'] = $this->model_audit_audit->can_restore();
|
||||
|
||||
if(ENABLE_FOLDER_RESTRICTIONS == 1) {
|
||||
$this->data['folders'] = $this->model_folder_folder->get_folders_for_user();
|
||||
$this->data['folder_id'] = $this->model_folder_folder->get_folder_id_by_id($this->data['id']);
|
||||
}
|
||||
|
||||
foreach($this->data['attachments'] as $a) {
|
||||
if(preg_match("/image/", $a['type'])) {
|
||||
$attachment = $this->model_search_message->get_attachment_by_id($a['id']);
|
||||
|
Reference in New Issue
Block a user