Beispiel #1
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_file.php';
     $File = new common_file();
     if ($this->GET['file_path_encoded']) {
         $file_path = $File->decode_file_path($this->GET['file_path_encoded']);
         $info = $File->getFileInfo($file_path, true);
         $this->tpl->assign("ITEM", $info);
     }
     return true;
 }
Beispiel #2
0
 /**
  * main action
  */
 public function mainAction()
 {
     //msg($file_path);
     require_once 'models/common/common_file.php';
     $File = new common_file();
     $file_path = $File->decode_file_path($this->GET['file_path_encoded']);
     if ($file_path) {
         //msg($file_path);
         //TODO: safer to do another check for file_path string in node.content
         if ($File->deleteFile($file_path)) {
             msg("Deleted " . str_replace('var/files/', '', $file_path));
             $this->tpl->parse('content.deleted');
         }
     }
     return true;
 }
Beispiel #3
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_file.php';
     $File = new common_file();
     /**
      * Setting base paths
      * 
      */
     $file_path_encoded_relative = $File->decode_file_path($this->GET['file_path_encoded_relative']);
     /**
      * Assign template variables
      * 
      */
     $this->tpl->assign('BASE', $base_folder);
     $this->tpl->assign('FOLDER_HEAD', str_replace('/', '/ ', $relative_folder_path));
     $this->tpl->assign('FOLDER', $relative_folder_path);
     $this->tpl->assign('MAX_FILE_SIZE', ini_get('upload_max_filesize'));
     /**
      * Get File List
      * 
      */
     $relations_list = $File->getRelations($file_path_encoded_relative);
     if ($relations_list['count'] == 0) {
         $this->tpl->parse('content.delete');
     } else {
         if (count($relations_list['file']) > 0) {
             $this->displayNodeInfo($relations_list['file']);
         }
         if (count($relations_list['node']) > 0) {
             $this->displayNodeInfo($relations_list['node']);
         }
         if (count($relations_list['product']) > 0) {
             foreach ($relations_list['product'] as $image_detail) {
                 $this->tpl->assign('IMAGE_DETAIL', $image_detail);
                 $this->tpl->parse('content.usage.product');
             }
         }
         if (count($relations_list['product_variety']) > 0) {
             foreach ($relations_list['product_variety'] as $image_detail) {
                 $this->tpl->assign('IMAGE_DETAIL', $image_detail);
                 $this->tpl->parse('content.usage.product_variety');
             }
         }
         if (count($relations_list['taxonomy']) > 0) {
             foreach ($relations_list['taxonomy'] as $image_detail) {
                 $this->tpl->assign('IMAGE_DETAIL', $image_detail);
                 $this->tpl->parse('content.usage.taxonomy');
             }
         }
         if (count($relations_list['recipe']) > 0) {
             foreach ($relations_list['recipe'] as $image_detail) {
                 $this->tpl->assign('IMAGE_DETAIL', $image_detail);
                 $this->tpl->parse('content.usage.recipe');
             }
         }
         if (count($relations_list['store']) > 0) {
             foreach ($relations_list['store'] as $image_detail) {
                 $this->tpl->assign('IMAGE_DETAIL', $image_detail);
                 $this->tpl->parse('content.usage.store');
             }
         }
         if (count($relations_list['survey']) > 0) {
             foreach ($relations_list['survey'] as $image_detail) {
                 $this->tpl->assign('IMAGE_DETAIL', $image_detail);
                 $this->tpl->parse('content.usage.survey');
             }
         }
         $this->tpl->parse('content.usage');
     }
     return true;
 }