Exemplo n.º 1
0
         $extension_verif = 'sql';
         $edit = true;
         break;
     default:
         $extension_verif = 'file';
         $edit = true;
         break;
 }
 //Edit ?
 $file_arr['edit'] = $edit;
 //File
 $file_arr['path_file'] = $root . $file;
 $file_arr['path'] = $root;
 //Chmod
 $file_arr['chmod'] = substr($folder->perms(), 1);
 $file_arr['chmod'] = modify_chmod($file_arr['chmod'], $file_arr['path_file'], $count_file);
 if ($extension_verif === 'picture') {
     list($width, $height) = getimagesize($root . $file);
     if ($height > 60) {
         $file_arr['img'] = '<img src="' . $url_file . $file . '" height="47" title="" alt="" />';
     } else {
         $file_arr['img'] = '<img src="' . $url_file . $file . '" title="" alt="" />';
     }
 } else {
     $file_arr['img'] = '<img src="./images/mimetypes/' . $extension_verif . '_48.png" title="" alt="" />';
 }
 $file_arr['extension'] = $extension_verif;
 $file_arr['file'] = htmlentities($file);
 $count_file++;
 $file_arr['newline'] = $count_file % $nbcolonnes_file == 1 ? true : false;
 $xoopsTpl->assign('newline', $file_arr['newline']);
Exemplo n.º 2
0
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new Xoops\Form\Text(_AM_SYSTEM_FILEMANAGER_ADDFILE, 'file_name', 50, 255), true);
     $form->addElement(new Xoops\Form\Hidden('op', 'filemanager_add_file_save'));
     $form->addElement(new Xoops\Form\Hidden('path', $path));
     $form->addElement(new Xoops\Form\Button('', 'dir_button', XoopsLocale::A_SUBMIT, 'submit'));
     echo $form->render();
     break;
     break;
 case 'filemanager_modify_chmod':
     if ($_REQUEST['path_file'] != '') {
         $path = trim($_REQUEST['path_file']);
     } else {
         $path = XOOPS_ROOT_PATH . '/';
     }
     if (chmod($path, '0' . $_REQUEST['chmod'])) {
         $new_chmod = modify_chmod($_REQUEST['chmod'], $path, $_REQUEST['id']);
         echo $new_chmod;
     }
     //echo $_REQUEST['chmod'];
     break;
     //Restore
 //Restore
 case 'filemanager_restore':
     $old_file = $_REQUEST['path_file'] . '.back';
     $new_file = $_REQUEST['path_file'];
     if (file_exists($old_file)) {
         if (unlink($new_file)) {
             if (rename($old_file, $new_file)) {
                 //$xoops->redirect("admin.php?fct=tplsets", 2, XoopsLocale::S_DATABASE_UPDATED);
             } else {
                 //$xoops->redirect("admin.php?fct=tplsets", 2, _AM_SYSTEM_TEMPLATES_RESTORE_ERROR_FILE_RENAME);