diff options
Diffstat (limited to 'app/view')
-rw-r--r-- | app/view/templates/info.php | 4 | ||||
-rw-r--r-- | app/view/templates/media.php | 47 |
2 files changed, 39 insertions, 12 deletions
diff --git a/app/view/templates/info.php b/app/view/templates/info.php index f9144ca..4634995 100644 --- a/app/view/templates/info.php +++ b/app/view/templates/info.php @@ -69,9 +69,11 @@ <p>There is'nt a real start of anything when you're using W.</p> +<p>Just type an adress in your web browser, after your W folder. You should see an empty page, not existing yet. You can login to create one at this adress. If you are already logged in, you can juste type <code><i>page_id</i>/add</code>, this will directly create a page at this adress.</p> +<p>This <code><i>page_id</i></code> is the identifier of each page, you cant change it later, this is like a real solid adress, it cant move. It can only contain lowercase letters, numbers, hyphens or underscore charachters.</p> - +<p>No visitor can see the full list of pages you've created. The only way to see the whole map of your project, is to be conected at least as an editor, and go to the "homepage", the root adress where W is instaled.</p> <h3 id="structure">Structure</h3> diff --git a/app/view/templates/media.php b/app/view/templates/media.php index 6bcba5d..2078d79 100644 --- a/app/view/templates/media.php +++ b/app/view/templates/media.php @@ -10,6 +10,8 @@ <section class="media"> + +<div id="tree"> <h1>Explorer</h1> @@ -18,18 +20,19 @@ <?php -function treecount(array $dir, string $dirname, int $deepness, string $path, string $currentdir) { - if($path === $currentdir) { - $folder = '├─📂<strong>'. $dirname.'<strong>'; +function treecount(array $dir, string $dirname, int $deepness, string $path, string $currentdir) +{ + if ($path === $currentdir) { + $folder = '├─📂<strong>' . $dirname . '<strong>'; } else { - $folder = '├─📁'. $dirname; + $folder = '├─📁' . $dirname; } echo '<tr>'; - echo '<td><a href="?path='.$path.'">'. str_repeat(' ', $deepness) .$folder.'</a></td>'; - echo '<td>'.$dir['dirfilecount'].'</td>'; + echo '<td><a href="?path=' . $path . '">' . str_repeat(' ', $deepness) . $folder . '</a></td>'; + echo '<td>' . $dir['dirfilecount'] . '</td>'; echo '</tr>'; foreach ($dir as $key => $value) { - if(is_array($value)) { + if (is_array($value)) { treecount($value, $key, $deepness + 1, $path . DIRECTORY_SEPARATOR . $key, $currentdir); } } @@ -42,6 +45,11 @@ treecount($dirlist, 'media', 0, 'media', $dir); </table> +</div> + + +<div id="explorer"> + <h2><?= $dir ?></h2> @@ -53,7 +61,7 @@ treecount($dirlist, 'media', 0, 'media', $dir); </form> <form id=addmedia action="<?= $this->url('mediaupload') ?>" method="post" enctype="multipart/form-data"> - <label for="file">🚀 Upload files</label> + <label for="file">🚀 Upload file(s)</label> <input type='file' id="file" name='file[]' multiple> <input type="hidden" name="dir" value="<?= $dir ?>"> <input type="submit" value="upload"> @@ -62,7 +70,7 @@ treecount($dirlist, 'media', 0, 'media', $dir); <table id="medialist"> -<tr><th>id</th><th>ext</th><th>type</th><th>size</th><th>width</th><th>height</th><th>lengh</th></tr> +<tr><th>id</th><th>ext</th><th>type</th><th>size</th><th>width</th><th>height</th><th>lengh</th><th>code</th></tr> <?php foreach ($medialist as $media) { @@ -70,14 +78,29 @@ foreach ($medialist as $media) { <tr> <td><a href="<?= $media->getfullpath() ?>" target="_blank"><?= $media->id() ?></a></td> <td><?= $media->extension() ?></td> - - <td><?= $media->type() == 'image' ? 'image <span class="thumbnail">👁<img src="'.$media->getfullpath().'"></span>' : $media->type() ?></td> + <td><?= $media->type() == 'image' ? 'image <span class="thumbnail">👁<img src="' . $media->getfullpath() . '"></span>' : $media->type() ?></td> <td><?= readablesize($media->size()) ?></td> <td><?= $media->width() ?></td> <td><?= $media->height() ?></td> <td><?= $media->length() ?></td> + <td><code> + <?php + if($media->type() == 'image') { + ?> +  ?>) + <?php + } elseif ($media->type() == 'other') { + ?> + [<?= $media->id() ?>.<?= $media->extension() ?>](<?= $media->getincludepath() ?>) + <?php + } else { + echo $media->getincludepath(); + } + ?> + </code></td> </tr> <?php + } @@ -85,6 +108,8 @@ foreach ($medialist as $media) { </table> +</div> + </section> </body> |