diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
commit | 4766f36a4d74924f21ff329c4318ce4e069ffa04 (patch) | |
tree | 969b84632f2a8b0db79788a8a6db8e41d63e5cb4 /mod/file/views/default/widgets | |
parent | 57a217fd6b708844407486046a1faa23b46cac08 (diff) | |
download | elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.gz elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.bz2 |
Pulled in the interface changes.
git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file/views/default/widgets')
-rw-r--r-- | mod/file/views/default/widgets/filerepo/edit.php | 25 | ||||
-rw-r--r-- | mod/file/views/default/widgets/filerepo/view.php | 86 |
2 files changed, 111 insertions, 0 deletions
diff --git a/mod/file/views/default/widgets/filerepo/edit.php b/mod/file/views/default/widgets/filerepo/edit.php new file mode 100644 index 000000000..35d633058 --- /dev/null +++ b/mod/file/views/default/widgets/filerepo/edit.php @@ -0,0 +1,25 @@ +<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> +</p> + +<p> + <?php echo elgg_echo("file:gallery_list"); ?>? + <select name="params[gallery_list]"> + <option value="1" <?php if($vars['entity']->gallery_list == 1) echo "SELECTED"; ?>><?php echo elgg_echo("file:list"); ?></option> + <option value="2" <?php if($vars['entity']->gallery_list == 2) echo "SELECTED"; ?>><?php echo elgg_echo("file:gallery"); ?></option> + </select> +</p>
\ No newline at end of file diff --git a/mod/file/views/default/widgets/filerepo/view.php b/mod/file/views/default/widgets/filerepo/view.php new file mode 100644 index 000000000..8113ea45a --- /dev/null +++ b/mod/file/views/default/widgets/filerepo/view.php @@ -0,0 +1,86 @@ +<script type="text/javascript"> +$(document).ready(function () { + +$('a.show_file_desc').click(function () { + $(this.parentNode).children("[class=filerepo_listview_desc]").slideToggle("fast"); + return false; +}); + +}); /* end document ready function */ +</script> + + +<?php + + //the page owner + $owner = $vars['entity']->owner_guid; + + //the number of files to display + $number = (int) $vars['entity']->num_display; + if (!$number) + $number = 1; + + //get the layout view which is set by the user in the edit panel + $get_view = (int) $vars['entity']->gallery_list; + if (!$get_view || $get_view == 1) { + $view = "list"; + }else{ + $view = "gallery"; + } + + //get the user's files + $files = get_user_objects($vars['entity']->owner_guid, "file", $number, 0); + + //if there are some files, go get them + if ($files) { + + echo "<div id=\"filerepo_widget_layout\">"; + + if($view == "gallery"){ + + echo "<div class=\"filerepo_widget_galleryview\">"; + + //display in gallery mode + foreach($files as $f){ + + $mime = $f->mimetype; + echo "<a href=\"{$f->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . "</a>"; + + } + + echo "</div>"; + + }else{ + + //display in list mode + foreach($files as $f){ + + $mime = $f->mimetype; + echo "<div class=\"filerepo_widget_singleitem\">"; + echo "<div class=\"filerepo_listview_icon\"><a href=\"{$f->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . "</a></div>"; + echo "<div class=\"filerepo_widget_content\">"; + echo "<div class=\"filerepo_listview_title\"><p class=\"filerepo_title\">" . $f->title . "</p></div>"; + echo "<div class=\"filerepo_listview_date\"><p class=\"filerepo_timestamp\"><small>" . friendly_time($f->time_created) . "</small></p></div>"; + $description = $f->description; + if (!empty($description)) echo "<a href=\"javascript:void(0);\" class=\"show_file_desc\">". elgg_echo('more') ."</a><br /><div class=\"filerepo_listview_desc\">" . $description . "</div>"; + echo "</div><div class=\"clearfloat\"></div></div>"; + + } + + } + + + //get a link to the users files + $users_file_url = $vars['url'] . "pg/file/" . get_user($f->owner_guid)->username; + + echo "<div class=\"filerepo_widget_singleitem_more\"><a href=\"{$users_file_url}\">" . elgg_echo('file:more') . "</a></div>"; + echo "</div>"; + + + } else { + + echo "<div class=\"contentWrapper\">" . elgg_echo("file:none") . "</div>"; + + } + +?>
\ No newline at end of file |