Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a35f734
testingCreateDir
jonCroatanUto Jun 22, 2021
65878b4
testing
jonCroatanUto Jun 22, 2021
618eaf8
Merge pull request #2 from jonCroatanUto/testing
Ernest-DT Jun 22, 2021
c911300
testing2
jonCroatanUto Jun 22, 2021
978f943
Merge pull request #4 from jonCroatanUto/testing
Ernest-DT Jun 22, 2021
0138a43
diagrama
jonCroatanUto Jun 22, 2021
e77f440
Merge pull request #6 from jonCroatanUto/diagrama
jonCroatanUto Jun 22, 2021
939b23f
png diagram
jonCroatanUto Jun 23, 2021
9a4890a
Merge pull request #18 from jonCroatanUto/diagrama
jonCroatanUto Jun 23, 2021
3d67fde
delete
jonCroatanUto Jun 23, 2021
d618452
fixissues
jonCroatanUto Jun 23, 2021
c74fbce
edit almost finish
jonCroatanUto Jun 23, 2021
5ae9034
styling
jonCroatanUto Jun 24, 2021
8a70fb9
preparing sass
jonCroatanUto Jun 24, 2021
349d305
navbar & sohwformButon
jonCroatanUto Jun 24, 2021
8a47bc5
UIX estructure, folder icons
jonCroatanUto Jun 24, 2021
1826bf3
basic styles
jonCroatanUto Jun 24, 2021
11a718f
close menus
jonCroatanUto Jun 24, 2021
ab23274
Merge pull request #22 from jonCroatanUto/S1_basicStyles
jonCroatanUto Jun 24, 2021
b09f6b4
mergin
jonCroatanUto Jun 24, 2021
b97b063
merge comits
jonCroatanUto Jun 24, 2021
b143a90
styles.css
jonCroatanUto Jun 24, 2021
0877acd
MERGIN basicStyles
jonCroatanUto Jun 24, 2021
ad77515
fix merge
jonCroatanUto Jun 24, 2021
77b84ea
basicStyles merged
jonCroatanUto Jun 24, 2021
30cce1d
finish edit & delete
jonCroatanUto Jun 25, 2021
14e82dc
Merge pull request #23 from jonCroatanUto/F2_deleteEdit
jonCroatanUto Jun 25, 2021
d95b00d
open directories and show content
jonCroatanUto Jun 25, 2021
410681d
Merge pull request #24 from jonCroatanUto/F3_openDir
jonCroatanUto Jun 28, 2021
c953e34
1 subnivel
jonCroatanUto Jun 28, 2021
1d9af6b
render files and folders
jonCroatanUto Jun 28, 2021
7a49795
change icon
jonCroatanUto Jun 28, 2021
4b05ebc
diagramas
jonCroatanUto Jun 29, 2021
96be41b
scan
jonCroatanUto Jun 29, 2021
0c1404a
file WIP
Ernest-DT Jun 29, 2021
d0a9b91
reset
Ernest-DT Jun 29, 2021
56f524f
Merge branch 'master' of https://github.com/jonCroatanUto/filesystem-…
Ernest-DT Jun 29, 2021
979d198
reset2
Ernest-DT Jun 29, 2021
06aa040
subfoledr
jonCroatanUto Jun 29, 2021
d2dc39f
no funciona
jonCroatanUto Jun 29, 2021
5284869
path
jonCroatanUto Jun 29, 2021
6cf97bf
hola
jonCroatanUto Jun 29, 2021
e551fad
mk dir in the folder
jonCroatanUto Jun 29, 2021
cc10ba0
mkdir dinamic
jonCroatanUto Jun 29, 2021
09e44c0
render sublevels
jonCroatanUto Jun 30, 2021
88a3356
apply scripts to subfolders
jonCroatanUto Jun 30, 2021
57999d3
infinite
jonCroatanUto Jun 30, 2021
72df4f0
delete & edit infinit dir
jonCroatanUto Jun 30, 2021
97df1b7
path in session
jonCroatanUto Jun 30, 2021
e9348e8
navegation almost finish
jonCroatanUto Jul 1, 2021
8159dfe
subfolders funcions
jonCroatanUto Jul 2, 2021
495b408
pull request
jonCroatanUto Jul 2, 2021
072557f
Merge pull request #27 from jonCroatanUto/subfolders2
jonCroatanUto Jul 2, 2021
921c0f8
show files
jonCroatanUto Jul 2, 2021
3fc2d9c
Merge pull request #28 from jonCroatanUto/subfolders2
jonCroatanUto Jul 2, 2021
4a178e3
clean
jonCroatanUto Jul 2, 2021
3e67132
clean
jonCroatanUto Jul 2, 2021
39855b4
button rigth
jonCroatanUto Jul 2, 2021
29add78
dirs
jonCroatanUto Jul 2, 2021
eb30c0b
diagramas
jonCroatanUto Jul 2, 2021
6cc2a51
diagramas
jonCroatanUto Jul 2, 2021
7f9f1af
Merge branch 'Subfolders'
jonCroatanUto Jul 2, 2021
b18d737
diagrams
jonCroatanUto Jul 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
3 changes: 3 additions & 0 deletions basePath.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
session_start();
echo $_SESSION["currentPath"];
Binary file added diagramas/create, delete && edit.paint
Binary file not shown.
Binary file added diagramas/first diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added diagramas/second diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added diagramas/sublevels.paint
Binary file not shown.
Binary file added diagramas/sublevels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions dirContent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@


<?php
require('./functions/dirManege.php');
$prevPath=$_POST["prevPath"];
$inicialPath="./directories";
$path=$_POST["path"];
$_SESSION["currentPath"]=$path;
scanDirsContent($_SESSION["currentPath"]);
?>
<script>
rightButton();
dubleClick();
showSureToRemove();
editModal();
</script>


10 changes: 10 additions & 0 deletions dirManege/create.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
require('../functions/dirManege.php');
// if(!$_GET["path"]){
// makedir("./directories");

// }else{
// $path = $_GET["path"];

makedir();
//}
5 changes: 5 additions & 0 deletions dirManege/delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
require("../functions/dirManege.php");
$deletedDir=$_GET['path'];
//echo $deletedDir;
removeDir($deletedDir);
5 changes: 5 additions & 0 deletions dirManege/edit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

<?php
require('../functions/dirManege.php');
editFolderName();

Empty file added directories/file.txt
Empty file.
76 changes: 76 additions & 0 deletions functions/dirManege.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php
session_start();
function makedir(){
$actualPath = $_SESSION["currentPath"];
$dirname=$_POST["dirname"];
if(file_exists(".$actualPath/$dirname")){
$_SESSION["existingFolder"]="This folder exists, chosse other name";
}

mkdir(".$actualPath/$dirname");

header("Location:../root.php?currentPath=$actualPath");
}

function editFolderName(){
$newName=$_POST["editDirName"];
$path=$_GET["pathNew"];
$oldName=$_GET["oldName"];
rename(".$oldName",".$path/$newName");
header("Location:../root.php");

}

function removeDir($pathDir){
if (is_dir($pathDir)){
$dir=array_diff(scandir($pathDir),array('.','..'));
foreach($dir as $file){
removeDir("$pathDir/$file");
}
rmdir($pathDir);
}else{
unlink($pathDir);
}
header("Location:../root.php");
}

function scanDirsContent($actualPath){
$allDirs=scandir("$actualPath");
$dirs=array_diff($allDirs,array('.','..'));

// $_SESSION["dirs"]=$dirs;
foreach($dirs as $item){
if(is_dir("$actualPath/$item")){
$id=rand(1,10000);
echo "<div data='$item' id='$id' class='folder'>";
echo "<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(238, 211, 163)' class='bi bi-folder' viewBox='0 0 16 16'>
<path d='M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4H2.19zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z'/>
</svg>";
echo nl2br("\n $item\n");
echo "<ul class='deleteEditOp' style='display: none;'>";
echo "<li id='delete' class=OpEditDel><button id='$id' class='btn btn-outline-secondary'>Delete</button>";
echo "</li>";
echo "<li id='edit' class=OpEditDel><button data='$item' class='btn btn-outline-secondary'>Edit</button>";
echo "</li>";
echo "</ul>";
echo "</div>";
}else{
$id=rand(1,10000);
echo "<div data='$item' id='$id' class='folder'>";
echo "<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='blue' class='bi bi-file-earmark-fill' viewBox='0 0 16 16'>
<path d='M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3z'/>
</svg>";
echo nl2br("\n $item\n");
echo "<ul class='deleteEditOp' style='display: none;'>";
echo "<li id='delete' class=OpEditDel><button id='$id' class='btn btn-outline-secondary'>Delete</button>";
echo "</li>";
echo "<li id='edit' class=OpEditDel><button data='$item' class='btn btn-outline-secondary'>Edit</button>";
echo "</li>";
echo "</ul>";
echo "</div>";

};
}
}


3 changes: 3 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

header("Location:./root.php");
89 changes: 89 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dependencies": {
"ajax": "^0.0.4",
"bootstrap": "^5.0.1",
"jquery": "^3.6.0"
}
}
80 changes: 80 additions & 0 deletions root.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
require("./functions/dirManege.php");
//require("./dirManege/dirContent.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- <script lenguage="javascipt" type="text/javascript">
// window.history.forward();
// window.onunload=function(){null};
</script> -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css">
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="./style.css">
<title>Document</title>
</head>

<body class="bod">
<div class='sureToRemove' style="display:none;">
<h2>Are you sure to delete?</h2>
<a href="./dirManege/delete.php" class='btn btn-outline-danger'>Delete</a>
<button class='btn btn-outline-secondary'>NO</button>
</div>
<div class="closeDiv"></div>
<header class="navBarContain">
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand">Navbar</a>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</nav>
</header>

<main>
<section class="aside">
<button class="newFolderButon">+</button>
<div class="optionsMenu">
<ul class="options">
<li class="Option"><button id="showNewFolderForm">New folder</button></li>
<li class="Option"><button>Upload Item</button></li>
</ul>
<div class="newFolderForm">
<form action="./dirManege/create.php" method="post">
<div class="form-floating">
<input id="floatingInput" class="form-control" type="text" name="dirname" id="submitButon">
<label for="floatingInput">New folder name</label>
</div>
<button type="submit" class="btn btn-outline-success">submit</button>
</form>
</div>

</div>
</section>
<section class="folders">

<?php


//unset($_SESSION["currentPath"]);

if(!isset($_SESSION["currentPath"])){
$_SESSION["currentPath"]="./directories";
}
scanDirsContent($_SESSION["currentPath"]);


?>
</section>

</main>
<script src="./script.js"></script>

</body>
</html>
Loading