aboutsummaryrefslogtreecommitdiff
path: root/mod/file
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:08:42 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:08:42 +0000
commit36ef345eb6425106f061fb866d9fa66d051e16df (patch)
tree53fb2bd05f8b5e2010f9e3d1e93075ad7071ec1e /mod/file
parent5571ca5b350fd1735f13af7ddfbb88afa6befb0c (diff)
downloadelgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.gz
elgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.bz2
Merged 5530:5604 from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5622 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file')
-rw-r--r--mod/file/index.php5
-rw-r--r--mod/file/start.php5
-rw-r--r--mod/file/views/default/widgets/filerepo/edit.php35
-rw-r--r--mod/file/views/default/widgets/filerepo/view.php5
4 files changed, 29 insertions, 21 deletions
diff --git a/mod/file/index.php b/mod/file/index.php
index 6a418ac6a..848de9e53 100644
--- a/mod/file/index.php
+++ b/mod/file/index.php
@@ -13,9 +13,8 @@
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
- if (is_callable('group_gatekeeper')) {
- group_gatekeeper();
- }
+ // access check for closed groups
+ group_gatekeeper();
//set the title
if (page_owner() == get_loggedin_userid()) {
diff --git a/mod/file/start.php b/mod/file/start.php
index 1345dec44..b8a26fab5 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -43,7 +43,7 @@
register_page_handler('file','file_page_handler');
// Add a new file widget
- add_widget_type('filerepo',elgg_echo("file:widget"),elgg_echo("file:widget:description"));
+ add_widget_type('filerepo',elgg_echo("file"),elgg_echo("file:widget:description"));
// Register a URL handler for files
register_entity_url_handler('file_url','object','file');
@@ -235,5 +235,8 @@
register_action("file/upload", false, $CONFIG->pluginspath . "file/actions/upload.php");
register_action("file/save", false, $CONFIG->pluginspath . "file/actions/save.php");
register_action("file/delete", false, $CONFIG->pluginspath. "file/actions/delete.php");
+
+ // temporary - see #2010
+ register_action("file/download", false, $CONFIG->pluginspath. "file/actions/download.php");
?>
diff --git a/mod/file/views/default/widgets/filerepo/edit.php b/mod/file/views/default/widgets/filerepo/edit.php
index 35d633058..0d1901662 100644
--- a/mod/file/views/default/widgets/filerepo/edit.php
+++ b/mod/file/views/default/widgets/filerepo/edit.php
@@ -1,19 +1,24 @@
+<?php
+// set default value
+if (!isset($vars['entity']->num_display)) {
+ $vars['entity']->num_display = 4;
+}
+?>
<p>
- <?php echo elgg_echo("file:num_files"); ?>:
- <select name="params[num_display]">
- <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>
- <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option>
- <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option>
- <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option>
- <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option>
- <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
- <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option>
- <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option>
- <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
- <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option>
- <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option>
- <option value="20" <?php if($vars['entity']->num_display == 20) echo "SELECTED"; ?>>20</option>
- </select>
+ <?php echo elgg_echo("file:num_files"); ?>:
+ <select name="params[num_display]">
+<?php
+$options = array(1,2,3,4,5,6,7,8,9,10,15,20);
+foreach ($options as $option) {
+ $selected = '';
+ if ($vars['entity']->num_display == $option) {
+ $selected = "selected='selected'";
+ }
+
+ echo " <option value='{$option}' $selected >{$option}</option>\n";
+}
+?>
+ </select>
</p>
<p>
diff --git a/mod/file/views/default/widgets/filerepo/view.php b/mod/file/views/default/widgets/filerepo/view.php
index 01fdefa48..276ece053 100644
--- a/mod/file/views/default/widgets/filerepo/view.php
+++ b/mod/file/views/default/widgets/filerepo/view.php
@@ -17,8 +17,9 @@ $('a.show_file_desc').click(function () {
//the number of files to display
$number = (int) $vars['entity']->num_display;
- if (!$number)
- $number = 1;
+ if (!$number) {
+ $number = 4;
+ }
//get the layout view which is set by the user in the edit panel
$get_view = (int) $vars['entity']->gallery_list;