Exemple #1
0
     if (isset($_GET['files'])) {
         $file_list_to_print = '';
         $files = implode(',', $_GET['files']);
         $hidden_vars['files'] = $files;
         $sql = "SELECT file_name FROM " . TABLE_PREFIX . "files WHERE file_id IN ({$files}) AND owner_type={$owner_type} AND owner_id={$owner_id} ORDER BY file_name";
         $result = mysql_query($sql, $db);
         while ($row = mysql_fetch_assoc($result)) {
             $file_list_to_print .= '<li style="list-style: none; margin: 0px; padding: 0px 10px;"><img src="images/file_types/' . fs_get_file_type_icon($row['file_name']) . '.gif" height="16" width="16" alt="" title="" /> ' . htmlspecialchars($row['file_name']) . '</li>';
         }
         $msg->addConfirm(array('FILE_DELETE', $file_list_to_print), $hidden_vars);
     }
     if (isset($_GET['folders'])) {
         $dir_list_to_print = '';
         $folders = implode(',', $_GET['folders']);
         $hidden_vars['folders'] = $folders;
         $rows = fs_get_folder_by_id($_GET['folders'], $owner_type, $owner_id);
         foreach ($rows as $row) {
             $dir_list_to_print .= '<li style="list-style: none; margin: 0px; padding: 0px 10px;"><img src="images/folder.gif" height="18" width="20" alt="" title="" /> ' . AT_print($row['title'], 'input.text') . '</li>';
         }
         $msg->addConfirm(array('DIR_DELETE', $dir_list_to_print), $hidden_vars);
     }
     require AT_INCLUDE_PATH . 'header.inc.php';
     $msg->printConfirm();
     require AT_INCLUDE_PATH . 'footer.inc.php';
     exit;
 } else {
     if (query_bit($owner_status, WORKSPACE_AUTH_WRITE) && isset($_POST['submit_yes'])) {
         // handle the delete
         if (isset($_POST['files'])) {
             $files = explode(',', $_POST['files']);
         }
/**
 * recursively return the path to the current folder
 * PRIVATE! do not call directly, use get_folder_path() above.
 */
function fs_get_folder_path_recursive($folder_id, $owner_type, $owner_id) {
	global $db;

	if ($folder_id == 0) {
		return array();
	}

	$row = fs_get_folder_by_id($folder_id, $owner_type, $owner_id);

	return array_merge(array($row), fs_get_folder_path_recursive($row['parent_folder_id'], $owner_type, $owner_id));
}