aboutsummaryrefslogtreecommitdiff
path: root/mod/file/views/default/file
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-01 17:55:18 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-01 17:55:18 +0000
commit7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52 (patch)
tree1070be6b85c5a2327163cb0326dfbcbc62f10d62 /mod/file/views/default/file
parent07ffe6464b453fd90cd2833fc55f804c57c52b4a (diff)
downloadelgg-7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52.tar.gz
elgg-7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52.tar.bz2
almost finished updating the file plugin to work with new html/css
git-svn-id: http://code.elgg.org/elgg/trunk@7804 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file/views/default/file')
-rw-r--r--mod/file/views/default/file/css.php108
-rw-r--r--mod/file/views/default/file/group_module.php48
-rw-r--r--mod/file/views/default/file/groupprofile_files.php59
-rw-r--r--mod/file/views/default/file/icon.php2
-rw-r--r--mod/file/views/default/file/typecloud.php83
-rw-r--r--mod/file/views/default/file/upload.php128
6 files changed, 86 insertions, 342 deletions
diff --git a/mod/file/views/default/file/css.php b/mod/file/views/default/file/css.php
index d4d1a2c13..53fa94e46 100644
--- a/mod/file/views/default/file/css.php
+++ b/mod/file/views/default/file/css.php
@@ -27,111 +27,3 @@
.file-gallery-item img {
margin: 5px 0;
}
-
-
-.files .entity-listing .entity-listing-info {
- width:453px;
-}
-.files .entity-listing:hover {
- background-color: white;
-}
-
-/* files - single entity view */
-.filerepo_title_owner_wrapper .filerepo_title,
-.filerepo_title_owner_wrapper .filerepo_owner,
-.filerepo_file .filerepo_maincontent {
- margin-left: 70px !important;
-}
-.filerepo_owner_details {
- margin:0;
- padding:0;
- line-height: 1.2em;
-}
-.filerepo_owner_details small {
- color:#666666;
-}
-.filerepo_owner .elgg-user-icon {
- margin: 3px 5px 5px 0;
- float: left;
-}
-.filerepo_file .filerepo_icon {
- width: 70px;
- position: absolute;
- margin:5px 0 10px 0;
-}
-.filerepo_file .filerepo_title {
- margin:0;
- padding:7px 4px 10px 0;
- line-height: 1.2em;
-}
-.filerepo_file .filerepo_description {
- margin:10px 0 0 0;
-}
-.filerepo_file .filerepo_description p {
- padding:0 0 5px 0;
- margin:0;
-}
-.filerepo_file .filerepo_specialcontent img {
- padding:10px;
- margin-bottom:10px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- background: #333333;
-}
-
-
-/* files - gallery view */
-.entity_gallery_item .filerepo_gallery_item {
- margin:10px 10px 0 0;
- padding:5px;
- text-align:center;
- background-color: #eeeeee;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- width:165px;
-}
-.entity_gallery_item .filerepo_gallery_item:hover {
- background-color: #999999;
-}
-.filerepo_download,
-.filerepo_controls {
- padding:0 0 1px 0;
- margin:0 0 10px 0;
-}
-.entity_gallery .filerepo_title {
- font-weight: bold;
- line-height: 1.1em;
- margin:0 0 10px 0;
-}
-.filerepo_gallery_item p {
- margin:0;
- padding:0;
-}
-.filerepo_gallery_item .filerepo_controls {
- margin-top:10px;
-}
-.filerepo_gallery_item .filerepo_controls a {
- padding-right:10px;
- padding-left:10px;
-}
-.entity_gallery .filerepo_comments {
- font-size:90%;
-}
-.filerepo_user_gallery_link {
- float:right;
- margin:5px 5px 5px 50px;
-}
-.filerepo_user_gallery_link a {
- padding:2px 25px 5px 0;
- background: transparent url(<?php echo elgg_get_site_url(); ?>mod/file/graphics/icon_gallery.gif) no-repeat right top;
- display:block;
-}
-.filerepo_user_gallery_link a:hover {
- background-position: right -40px;
-}
-
-
-
-
-
-
diff --git a/mod/file/views/default/file/group_module.php b/mod/file/views/default/file/group_module.php
new file mode 100644
index 000000000..babdcf677
--- /dev/null
+++ b/mod/file/views/default/file/group_module.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Group file module
+ */
+
+$group = elgg_get_page_owner();
+
+if ($group->file_enable == "no") {
+ return true;
+}
+
+$all_link = elgg_view('output/url', array(
+ 'href' => "pg/file/group/$group->guid/owner",
+ 'text' => elgg_echo('link:view:all'),
+));
+
+$header = "<span class=\"group-widget-viewall\">$all_link</span>";
+$header .= '<h3>' . elgg_echo('file:group') . '</h3>';
+
+
+elgg_push_context('widgets');
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'file',
+ 'container_guid' => elgg_get_page_owner_guid(),
+ 'limit' => 6,
+ 'full_view' => false,
+ 'pagination' => false,
+);
+$content = elgg_list_entities($options);
+elgg_pop_context();
+
+if (!$content) {
+ $content = '<p>' . elgg_echo('file:none') . '</p>';
+}
+
+$new_link = elgg_view('output/url', array(
+ 'href' => "pg/file/new/$group->guid",
+ 'text' => elgg_echo('file:new'),
+));
+$content .= "<span class='elgg-widget-more'>$new_link</span>";
+
+
+$params = array(
+ 'header' => $header,
+ 'body' => $content,
+);
+echo elgg_view('layout/objects/module', $params);
diff --git a/mod/file/views/default/file/groupprofile_files.php b/mod/file/views/default/file/groupprofile_files.php
deleted file mode 100644
index 5cbf75bce..000000000
--- a/mod/file/views/default/file/groupprofile_files.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
- // Files on group profile page
-
- //check to make sure group files is activated
- if($vars['entity']->file_enable != 'no'){
-
-?>
-<div class="group_tool_widget files">
-<h3><?php echo elgg_echo("file:group"); ?></h3>
-
-<?php
-
- //the number of files to display
- $number = (int) $vars['entity']->num_display;
- if (!$number)
- $number = 6;
-
- //get the group's files
- $files = elgg_get_entities(array('type' => 'object',
- 'subtype' => 'file',
- 'container_guid' => $vars['entity']->guid,
- 'limit' => $number
- ));
-
- //if there are some files, go get them
- if ($files) {
-
- //display in list mode
- foreach($files as $f){
-
- $mime = $f->mimetype;
- echo "<div class='entity-listing clearfix'>";
- echo "<div class='entity-listing-icon'><a href=\"{$f->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . "</a></div>";
- echo "<div class='entity-listing-info'>";
- echo "<p class='entity-title'>" . $f->title . "</p>";
- echo "<p class='entity-subtext'>" . elgg_view_friendly_time($f->time_created) . "</p>";
- echo "</div></div>";
-
- }
-
-
- //get a link to the users files
- $users_file_url = elgg_get_site_url() . "pg/file/group/" . elgg_get_page_owner()->guid;
-
- echo "<p><a href=\"{$users_file_url}\">" . elgg_echo('file:more') . "</a></p>";
-
- } else {
-
- echo "<p class='margin-top'>" . elgg_echo("file:none") . "</p>";
-
- }
-
-?>
-</div>
-
-<?php
- }//end of activate check statement
-?> \ No newline at end of file
diff --git a/mod/file/views/default/file/icon.php b/mod/file/views/default/file/icon.php
index 63756a952..391afd0c8 100644
--- a/mod/file/views/default/file/icon.php
+++ b/mod/file/views/default/file/icon.php
@@ -13,7 +13,7 @@
*/
$mime = $vars['mimetype'];
-$simple_type = get_general_file_type($mime);
+$simple_type = file_get_simple_type($mime);
// is this request for an image thumbnail
$thumbnail = elgg_get_array_value('thumbnail', $vars, false);
diff --git a/mod/file/views/default/file/typecloud.php b/mod/file/views/default/file/typecloud.php
index bb322d4d7..4a59d8a7c 100644
--- a/mod/file/views/default/file/typecloud.php
+++ b/mod/file/views/default/file/typecloud.php
@@ -1,59 +1,50 @@
<?php
+/**
+ * Type cloud
+ */
- $types = $vars['types'];
+function file_type_cloud_get_url($type, $friends) {
+ $url = elgg_get_site_url() . "mod/file/search.php?subtype=file";
- if (is_array($vars['types']) && sizeof($vars['types'])) {
+ if ($type->tag != "all") {
+ $url .= "&md_type=simpletype&tag=" . urlencode($type->tag);
+ }
-?>
-<ul>
-<?php
+ if ($friends) {
+ $url .= "&friends=$friends";
+ }
- $all = new stdClass;
- $all->tag = "all";
- $vars['types'][] = $all;
- $vars['types'] = array_reverse($vars['types']);
- foreach($vars['types'] as $type) {
-
- $tag = $type->tag;
- if ($tag != "all") {
- $label = elgg_echo("file:type:" . $tag);
- } else {
- $label = elgg_echo('all');
- }
-
- $url = elgg_get_site_url() . "mod/file/search.php?subtype=file";
- if ($tag != "all")
- $url .= "&md_type=simpletype&tag=" . urlencode($tag);
- if (isset($vars['friend_guid']) && $vars['friend_guid'] != false) {
- $url .= "&friends_guid={$vars['friend_guid']}";
- } else if ($vars['owner_guid'] != "") {
- if (is_array($vars['owner_guid'])) {
- $owner_guid = implode(",",$vars['owner_guid']);
- } else {
- $owner_guid = $vars['owner_guid'];
- }
- $url .= "&owner_guid={$owner_guid}";
- }
- if ($tag == "image")
- $url .= "&listtype=gallery";
+ if ($type->tag == "image") {
+ $url .= "&listtype=gallery";
+ }
+ if (elgg_get_page_owner_guid()) {
$url .= "&page_owner=" . elgg_get_page_owner_guid();
+ }
- $inputtag = get_input('tag');
- if ($inputtag == $tag || (empty($inputtag) && $tag == "all")) {
- $class = " class=\"selected\" ";
- } else {
- $class = "";
- }
+ return $url;
+}
- add_submenu_item($label, $url, 'filetypes');
- }
-?>
-</ul>
+$types = elgg_get_array_value('types', $vars, array());
+if (!$types) {
+ return true;
+}
-<?php
+$friends = elgg_get_array_value('friends', $vars, false);
- }
+$all = new stdClass;
+$all->tag = "all";
+elgg_register_menu_item('page', array(
+ 'name' => 'file:all',
+ 'title' => elgg_echo('all'),
+ 'url' => file_type_cloud_get_url($all, $friends),
+));
-?> \ No newline at end of file
+foreach ($types as $type) {
+ elgg_register_menu_item('page', array(
+ 'name' => "file:$type->tag",
+ 'title' => elgg_echo("file:type:$type->tag"),
+ 'url' => file_type_cloud_get_url($type, $friends),
+ ));
+}
diff --git a/mod/file/views/default/file/upload.php b/mod/file/views/default/file/upload.php
deleted file mode 100644
index 041bd9227..000000000
--- a/mod/file/views/default/file/upload.php
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
-/**
- * Elgg file browser uploader
- *
- * @package ElggFile
- */
-
-global $CONFIG;
-
-if (isset($vars['entity'])) {
- $action_type = "update";
- $action = "file/upload";
- $title = $vars['entity']->title;
- $description = $vars['entity']->description;
- $tags = $vars['entity']->tags;
- $access_id = $vars['entity']->access_id;
- $container_guid = $vars['entity']->container_guid;
-} else {
- $action_type = "new";
- $action = "file/upload";
- $title = isset($_SESSION['uploadtitle']) ? $_SESSION['uploadtitle'] : '';
- $description = isset($_SESSION['uploaddesc']) ? $_SESSION['uploaddesc'] : '';
- $tags = isset($_SESSION['uploadtags']) ? $_SESSION['uploadtags'] : '';
- if (defined('ACCESS_DEFAULT')) {
- $access_id = ACCESS_DEFAULT;
- } else {
- $access_id = 0;
- }
- $access_id = isset($_SESSION['uploadaccessid']) ? $_SESSION['uploadaccessid'] : $access_id;
- $container_guid = elgg_get_page_owner_guid();
-}
-
-// make sure session cache is cleared
-unset($_SESSION['uploadtitle']);
-unset($_SESSION['uploaddesc']);
-unset($_SESSION['uploadtags']);
-unset($_SESSION['uploadaccessid']);
-
-
-?>
-<form action="<?php echo elgg_get_site_url(); ?>action/<?php echo $action; ?>" enctype="multipart/form-data" method="post" class="margin-top">
-<p>
- <label>
-<?php
- echo elgg_view('input/securitytoken');
- if ($action_type == "new") {
- echo elgg_echo("file:file");
- } else {
- echo elgg_echo("file:replace");
- }
-?>
-<br />
-<?php
-
- echo elgg_view("input/file",array('internalname' => 'upload'));
-
-?>
- </label>
-</p>
-<p>
- <label><?php echo elgg_echo("title"); ?><br />
-<?php
-
- echo elgg_view("input/text", array(
- "internalname" => "title",
- "value" => $title,
- ));
-
-?>
- </label>
-</p>
-<p class="longtext_inputarea">
- <label><?php echo elgg_echo("description"); ?></label>
-<?php
-
- echo elgg_view("input/longtext",array(
- "internalname" => "description",
- "value" => $description,
- ));
-?>
-</p>
-<p>
- <label><?php echo elgg_echo("tags"); ?><br />
-<?php
-
- echo elgg_view("input/tags", array(
- "internalname" => "tags",
- "value" => $tags,
- ));
-
-?>
- </label>
-</p>
-<?php
-
- $categories = elgg_view('categories',$vars);
- if (!empty($categories)) {
-?>
-
- <p>
- <?php echo $categories; ?>
- </p>
-
-<?php
- }
-
-?>
-<p>
- <label>
- <?php echo elgg_echo('access'); ?><br />
- <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?>
- </label>
-</p>
-
-<p>
-<?php
-
- echo "<input type=\"hidden\" name=\"container_guid\" value=\"{$container_guid}\" />";
-
- if (isset($vars['entity'])) {
- echo "<input type=\"hidden\" name=\"file_guid\" value=\"{$vars['entity']->getGUID()}\" />";
- }
-
-?>
- <input type="submit" value="<?php echo elgg_echo("save"); ?>" />
-</p>
-
-</form> \ No newline at end of file