]> source.dussan.org Git - nextcloud-server.git/commitdiff
files: hide non functioning code when called from a/f_s/get.php
authorFlorian Pritz <bluewind@xinu.at>
Fri, 23 Sep 2011 07:46:13 +0000 (09:46 +0200)
committerFlorian Pritz <bluewind@xinu.at>
Sat, 24 Sep 2011 16:41:54 +0000 (18:41 +0200)
The checkboxes don't work because files.js is missing. Adding it leads
to the problem that it relies on files/ajax and most of the code only
works for logged in users.

The actions div contains undefined variables and doesn't work either.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
apps/files_sharing/get.php
files/templates/index.php
files/templates/part.list.php

index a1b6c316cd526d49c1d5f00a1e4a67aba42d759b..33918bf9e7dcefda74428565be422404688a9d58 100644 (file)
@@ -56,9 +56,11 @@ if ($source !== false) {
                $list->assign("files", $files);
                $list->assign("baseURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
                $list->assign("downloadURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
+               $list->assign("readonly", true);
                $tmpl = new OC_Template("files", "index", "user");
                $tmpl->assign("fileList", $list->fetchPage());
                $tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage());
+               $tmpl->assign("readonly", true);
                $tmpl->printPage();
        } else {
                //get time mimetype and set the headers
index 76531b22ed5fce154d93b4702e19db0cfebdaf17..e2e9dc030017b1c1a45c9adac63faabbecef04df 100644 (file)
@@ -1,5 +1,6 @@
 <div id="controls">
        <?php echo($_['breadcrumb']); ?>
+       <?php if (!isset($_['readonly']) || !$_['readonly']) {?>
        <div class="actions">
                <form data-upload-id='1' class="file_upload_form" action="ajax/upload.php" method="post" enctype="multipart/form-data" target="file_upload_target_1">
                        <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
@@ -19,6 +20,9 @@
        <div id="file_action_panel">
        </div>
 </div>
+<?php
+}
+?>
 <div id='notification'></div>
 
 <?php
@@ -31,7 +35,7 @@ if (isset($_['files'])) {
        <thead>
                <tr>
                        <th id='headerName'>
-                               <input type="checkbox" id="select_all" />
+                               <?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" id="select_all" /><?php } ?>
                                <span class='name'><?php echo $l->t( 'Name' ); ?></span>
                                <span class='selectedActions'>
                                <a href="" title="<?php echo $l->t('Download')?>" class="download"><img class='svg' alt="Download" src="<?php echo image_path("core", "actions/download.svg"); ?>" /></a>
index 5995976f73a8f541a6a63d9f75c33a1fe7b1b473..398094f56d025cb721b8607d143dfa12bbb5fcc6 100644 (file)
@@ -7,7 +7,7 @@
                        if($relative_date_color>200) $relative_date_color = 200; ?>
                        <tr data-file="<?php echo $file['name'];?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
                                <td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
-                                       <input type="checkbox" />
+                                       <?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
                                        <a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$file['directory'].'/'.$file['name']; else echo $_['downloadURL'].$file['directory'].'/'.$file['name']; ?>" title="">
                                        <span class="nametext">
                                                <?php if($file['type'] == 'dir'):?>