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 | |
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')
38 files changed, 1151 insertions, 0 deletions
diff --git a/mod/file/views/default/file/css.php b/mod/file/views/default/file/css.php new file mode 100644 index 000000000..64642d9de --- /dev/null +++ b/mod/file/views/default/file/css.php @@ -0,0 +1,224 @@ +<?php + /** + * File CSS extender + * + * @package Elgg File Repository + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ +?> + + +p.filerepo_owner { + margin:0; + padding:0; +} +.filerepo_owner_details { + margin:0; + padding:0; + line-height: 1.2em; +} +.filerepo_owner_details small { + color:#666666; +} +.filerepo_owner .usericon { + margin: 3px 5px 5px 0; + float: left; +} + +.filerepo_download a { + font: 12px/100% Arial, Helvetica, sans-serif; + font-weight: bold; + color: white; + background:#4690d6; + border:none; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + width: auto; + height: 25px; + padding: 3px 6px 3px 6px; + margin:10px 0 10px 0; + cursor: pointer; +} +.filerepo_download a:hover { + background: black; + color:white; + text-decoration: none; +} + +/* FILE REPRO WIDGET VIEW */ +.filerepo_widget_singleitem { + margin:0 0 5px 0; + padding:5px; + min-height:60px; + display:block; + background:white; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; +} +.filerepo_widget_singleitem_more { + margin:0; + padding:5px; + display:block; + background:white; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; +} +.filerepo_listview_icon { + float: left; + margin-right: 10px; +} +.filerepo_timestamp { + color:#666666; + margin:0; +} +.filerepo_listview_desc { + display:none; + padding:0 10px 10px 0; + line-height: 1.2em; +} +.filerepo_listview_desc p { + color:#333333; +} +.filerepo_widget_content { + margin-left: 70px; +} +.filerepo_title { + margin:0; + padding:6px 5px 0 0; + line-height: 1.2em; + color:#666666; + font-weight: bold; +} + +.collapsable_box #filerepo_widget_layout { + margin:0 10px 0 10px; + background: none; +} + +/* widget gallery view */ +#filerepo_widget_layout .filerepo_widget_galleryview { + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + background: white; + margin:0 0 5px 0; +} +.filerepo_widget_galleryview img { + padding:0; + border:1px solid white; + margin:4px; +} +.filerepo_widget_galleryview img:hover { + border:1px solid #333333; +} + +/* SINGLE ITEM VIEW */ +.filerepo_file { + background:white; + margin:10px 10px 0 10px; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; +} +.filerepo_file .filerepo_title_owner_wrapper { + min-height:60px; + +} +.filerepo_title_owner_wrapper .filerepo_title, +.filerepo_title_owner_wrapper .filerepo_owner { + margin-left: 70px !important; +} +.filerepo_file .filerepo_maincontent { + padding:0 20px 0 0; +} +.filerepo_file .filerepo_icon { + width: 70px; + position: absolute; + margin:10px 0 10px 10px; +} +.filerepo_file .filerepo_title { + margin:0; + padding:7px 4px 10px 10px; + line-height: 1.2em; +} +.filerepo_file .filerepo_owner { + padding:0 0 0 10px; +} +.filerepo_file .filerepo_description { + margin:10px 0 0 0; + padding:0 0 0 10px; +} +.filerepo_download, +.filerepo_controls { + padding:0 0 1px 10px; + margin:0 0 10px 0; +} +.filerepo_file .filerepo_description p { + padding:0 0 5px 0; + margin:0; +} +.filerepo_file .filerepo_specialcontent img { + padding:10px; + margin:0 0 0 10px; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + background: black; +} +/* zaudio player */ +.filerepo_maincontent .filerepo_specialcontent { + margin:0 0 20px 0; +} +.filerepo_tags { + padding:0 0 10px 10px; + margin:0; +} + +/* file repro gallery items */ +.search_gallery .filerepo_controls { + padding:0; +} +.search_gallery .filerepo_title { + font-weight: bold; + line-height: 1.1em; + margin:0 0 10px 0; +} +.filerepo_gallery_item { + margin:0; + padding:0; + text-align:center; + +} +.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; +} +.search_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 $vars['url']; ?>_graphics/icon_gallery.gif) no-repeat right top; + display:block; +} +.filerepo_user_gallery_link a:hover { + background-position: right -40px; +} + +/* IE6 */ +* html #description_tbl { width:676px !important;} + + + diff --git a/mod/file/views/default/file/groupprofile_files.php b/mod/file/views/default/file/groupprofile_files.php new file mode 100644 index 000000000..778de3301 --- /dev/null +++ b/mod/file/views/default/file/groupprofile_files.php @@ -0,0 +1,74 @@ +<?php + + // Latest forum discussion for the group home page + + //check to make sure this group forum has been activated + if($vars['entity']->files_enable != 'no'){ + +?> + +<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> + +<div id="filerepo_widget_layout"> +<h2><?php echo elgg_echo("file:group"); ?></h2> + +<?php + + //the number of files to display + $number = (int) $vars['entity']->num_display; + if (!$number) + $number = 10; + + //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=\"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/" . page_owner_entity()->username; + + echo "<div class=\"forum_latest\"><a href=\"{$users_file_url}\">" . elgg_echo('file:more') . "</a></div>"; + + } else { + + echo "<div class=\"forum_latest\">" . elgg_echo("file:none") . "</div>"; + + } + +?> +<div class="clearfloat" /></div> +</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 new file mode 100644 index 000000000..f1bb3f8e1 --- /dev/null +++ b/mod/file/views/default/file/icon.php @@ -0,0 +1,65 @@ +<?php + /** + * Elgg file icons. + * Displays an icon, depending on its mime type, for a file. + * Optionally you can specify a size. + * + * @package ElggFile + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + + global $CONFIG; + + $mime = $vars['mimetype']; + + // is this request for an image thumbnail + if (isset($vars['thumbnail'])) { + $thumbnail = $vars['thumbnail']; + } else { + $thumbnail = false; + } + + // default size is small for thumbnails + if (isset($vars['size'])) { + $size = $vars['size']; + } else { + $size = 'small'; + } + + // Handle + switch ($mime) + { + case 'image/jpg' : + case 'image/jpeg' : + case 'image/pjpeg' : + case 'image/png' : + case 'image/x-png' : + case 'image/gif' : + case 'image/bmp' : + if ($thumbnail) { + echo "<img src=\"{$vars['url']}mod/file/thumbnail.php?file_guid={$vars['file_guid']}&size={$size}\" border=\"0\" />"; + } else { + if (!empty($mime) && elgg_view_exists("file/icon/{$mime}")) { + echo elgg_view("file/icon/{$mime}", $vars); + } else if (!empty($mime) && elgg_view_exists("file/icon/" . substr($mime,0,strpos($mime,'/')) . "/default")) { + echo elgg_view("file/icon/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars); + } else { + echo "<img src=\"". elgg_view('file/icon/default',$vars) ."\" border=\"0\" />"; + } + } + + break; + default : + if (!empty($mime) && elgg_view_exists("file/icon/{$mime}")) { + echo elgg_view("file/icon/{$mime}", $vars); + } else if (!empty($mime) && elgg_view_exists("file/icon/" . substr($mime,0,strpos($mime,'/')) . "/default")) { + echo elgg_view("file/icon/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars); + } else { + echo "<img src=\"". elgg_view('file/icon/default',$vars) ."\" border=\"0\" />"; + } + break; + } + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/default.php b/mod/file/views/default/file/icon/application/default.php new file mode 100644 index 000000000..eea8cbafe --- /dev/null +++ b/mod/file/views/default/file/icon/application/default.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/application{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/excel.php b/mod/file/views/default/file/icon/application/excel.php new file mode 100644 index 000000000..ba2460fec --- /dev/null +++ b/mod/file/views/default/file/icon/application/excel.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/excel{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/msword.php b/mod/file/views/default/file/icon/application/msword.php new file mode 100644 index 000000000..20efb1069 --- /dev/null +++ b/mod/file/views/default/file/icon/application/msword.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/word{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/pdf.php b/mod/file/views/default/file/icon/application/pdf.php new file mode 100644 index 000000000..6a5a7369c --- /dev/null +++ b/mod/file/views/default/file/icon/application/pdf.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/pdf{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/powerpoint.php b/mod/file/views/default/file/icon/application/powerpoint.php new file mode 100644 index 000000000..1857d513f --- /dev/null +++ b/mod/file/views/default/file/icon/application/powerpoint.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/ppt{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/vnd.ms-excel.php b/mod/file/views/default/file/icon/application/vnd.ms-excel.php new file mode 100644 index 000000000..ba2460fec --- /dev/null +++ b/mod/file/views/default/file/icon/application/vnd.ms-excel.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/excel{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/vnd.ms-powerpoint.php b/mod/file/views/default/file/icon/application/vnd.ms-powerpoint.php new file mode 100644 index 000000000..1857d513f --- /dev/null +++ b/mod/file/views/default/file/icon/application/vnd.ms-powerpoint.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/ppt{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/vnd.oasis.opendocument.text.php b/mod/file/views/default/file/icon/application/vnd.oasis.opendocument.text.php new file mode 100644 index 000000000..d0bde81df --- /dev/null +++ b/mod/file/views/default/file/icon/application/vnd.oasis.opendocument.text.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/openoffice{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/x-gzip.php b/mod/file/views/default/file/icon/application/x-gzip.php new file mode 100644 index 000000000..72f839732 --- /dev/null +++ b/mod/file/views/default/file/icon/application/x-gzip.php @@ -0,0 +1,5 @@ +<?php + + echo elgg_view('file/icon/archive',$vars); + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/x-rar-compressed.php b/mod/file/views/default/file/icon/application/x-rar-compressed.php new file mode 100644 index 000000000..72f839732 --- /dev/null +++ b/mod/file/views/default/file/icon/application/x-rar-compressed.php @@ -0,0 +1,5 @@ +<?php + + echo elgg_view('file/icon/archive',$vars); + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/x-stuffit.php b/mod/file/views/default/file/icon/application/x-stuffit.php new file mode 100644 index 000000000..72f839732 --- /dev/null +++ b/mod/file/views/default/file/icon/application/x-stuffit.php @@ -0,0 +1,5 @@ +<?php + + echo elgg_view('file/icon/archive',$vars); + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/zip.php b/mod/file/views/default/file/icon/application/zip.php new file mode 100644 index 000000000..72f839732 --- /dev/null +++ b/mod/file/views/default/file/icon/application/zip.php @@ -0,0 +1,5 @@ +<?php + + echo elgg_view('file/icon/archive',$vars); + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/archive.php b/mod/file/views/default/file/icon/archive.php new file mode 100644 index 000000000..4fffd9346 --- /dev/null +++ b/mod/file/views/default/file/icon/archive.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/archive{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/audio.php b/mod/file/views/default/file/icon/audio.php new file mode 100644 index 000000000..73c55be7b --- /dev/null +++ b/mod/file/views/default/file/icon/audio.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/music{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/audio/default.php b/mod/file/views/default/file/icon/audio/default.php new file mode 100644 index 000000000..2bd1498b2 --- /dev/null +++ b/mod/file/views/default/file/icon/audio/default.php @@ -0,0 +1,5 @@ +<?php + + echo elgg_view('file/icon/audio',$vars); + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/default.php b/mod/file/views/default/file/icon/default.php new file mode 100644 index 000000000..844ee312c --- /dev/null +++ b/mod/file/views/default/file/icon/default.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "{$CONFIG->wwwroot}mod/file/graphics/icons/general{$ext}.gif"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/document.php b/mod/file/views/default/file/icon/document.php new file mode 100644 index 000000000..8823514b8 --- /dev/null +++ b/mod/file/views/default/file/icon/document.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/text{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/text/default.php b/mod/file/views/default/file/icon/text/default.php new file mode 100644 index 000000000..bf5da852d --- /dev/null +++ b/mod/file/views/default/file/icon/text/default.php @@ -0,0 +1,5 @@ +<?php + + echo elgg_view('file/icon/document',$vars); + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/text/directory.php b/mod/file/views/default/file/icon/text/directory.php new file mode 100644 index 000000000..a08e098c6 --- /dev/null +++ b/mod/file/views/default/file/icon/text/directory.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/vcard{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/text/v-card.php b/mod/file/views/default/file/icon/text/v-card.php new file mode 100644 index 000000000..5c8ecd855 --- /dev/null +++ b/mod/file/views/default/file/icon/text/v-card.php @@ -0,0 +1,5 @@ +<?php + + echo elgg_view('file/icon/text/directory',$vars); + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/video.php b/mod/file/views/default/file/icon/video.php new file mode 100644 index 000000000..94617abff --- /dev/null +++ b/mod/file/views/default/file/icon/video.php @@ -0,0 +1,10 @@ +<?php + + if ($vars['size'] == 'large') { + $ext = '_lrg'; + } else { + $ext = ''; + } + echo "<img src=\"{$CONFIG->wwwroot}mod/file/graphics/icons/video{$ext}.gif\" border=\"0\" />"; + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/video/default.php b/mod/file/views/default/file/icon/video/default.php new file mode 100644 index 000000000..0ff2db791 --- /dev/null +++ b/mod/file/views/default/file/icon/video/default.php @@ -0,0 +1,5 @@ +<?php + + echo elgg_view('file/icon/video',$vars); + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/menu.php b/mod/file/views/default/file/menu.php new file mode 100644 index 000000000..a9c79a85c --- /dev/null +++ b/mod/file/views/default/file/menu.php @@ -0,0 +1,16 @@ +<?php + + /** + * Elgg hoverover extender for file + * + * @package ElggFile + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + +?> + + <p class="user_menu_file"> + <a href="<?php echo $vars['url']; ?>pg/file/<?php echo $vars['entity']->username; ?>"><?php echo elgg_echo("file"); ?></a> + </p>
\ No newline at end of file diff --git a/mod/file/views/default/file/specialcontent/audio/mid.php b/mod/file/views/default/file/specialcontent/audio/mid.php new file mode 100644 index 000000000..cf216a3b3 --- /dev/null +++ b/mod/file/views/default/file/specialcontent/audio/mid.php @@ -0,0 +1,4 @@ +<object type="audio/midi" data="<?php echo $vars['url']; ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" width="200" height="20"> + <param name="autoplay" value="false"> + <param name="autoStart" value="0"> +</object>
\ No newline at end of file diff --git a/mod/file/views/default/file/specialcontent/audio/mp3.php b/mod/file/views/default/file/specialcontent/audio/mp3.php new file mode 100644 index 000000000..83b77c391 --- /dev/null +++ b/mod/file/views/default/file/specialcontent/audio/mp3.php @@ -0,0 +1,4 @@ +<object type="audio/mpeg" data="<?php echo $vars['url']; ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" width="200" height="20"> + <param name="autoplay" value="false"> + <param name="autoStart" value="0"> +</object>
\ No newline at end of file diff --git a/mod/file/views/default/file/specialcontent/audio/mpeg.php b/mod/file/views/default/file/specialcontent/audio/mpeg.php new file mode 100644 index 000000000..83b77c391 --- /dev/null +++ b/mod/file/views/default/file/specialcontent/audio/mpeg.php @@ -0,0 +1,4 @@ +<object type="audio/mpeg" data="<?php echo $vars['url']; ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" width="200" height="20"> + <param name="autoplay" value="false"> + <param name="autoStart" value="0"> +</object>
\ No newline at end of file diff --git a/mod/file/views/default/file/specialcontent/audio/x-wav.php b/mod/file/views/default/file/specialcontent/audio/x-wav.php new file mode 100644 index 000000000..21af956c2 --- /dev/null +++ b/mod/file/views/default/file/specialcontent/audio/x-wav.php @@ -0,0 +1,4 @@ +<object type="audio/x-wav" data="<?php echo $vars['url']; ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" width="200" height="20"> + <param name="autoplay" value="false"> + <param name="autoStart" value="0"> +</object>
\ No newline at end of file diff --git a/mod/file/views/default/file/specialcontent/image/default.php b/mod/file/views/default/file/specialcontent/image/default.php new file mode 100644 index 000000000..b034857c2 --- /dev/null +++ b/mod/file/views/default/file/specialcontent/image/default.php @@ -0,0 +1,9 @@ +<?php + + if ($vars['full'] && $smallthumb = $vars['entity']->smallthumb) { + + echo "<p><a href=\"{$vars['url']}mod/file/download.php?file_guid={$vars['entity']->getGUID()}\"><img src=\"{$vars['url']}mod/file/thumbnail.php?file_guid={$vars['entity']->getGUID()}&size=large\" border=\"0\" /></a></p>"; + + } + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/typecloud.php b/mod/file/views/default/file/typecloud.php new file mode 100644 index 000000000..b85960849 --- /dev/null +++ b/mod/file/views/default/file/typecloud.php @@ -0,0 +1,70 @@ +<?php + + $types = $vars['types']; + + if (is_array($vars['types']) && sizeof($vars['types'])) { + +?> + + <!-- <div class="filerepo_types"> --> + <!-- <p><b><?php echo elgg_echo('file:types'); ?>:</b> --> + + <div id="canvas_header_submenu"> + <ul> +<?php + + $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 = $vars['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 .= "&search_viewtype=gallery"; + + $url .= "&page_owner=" . page_owner(); + + $inputtag = get_input('tag'); + if ($inputtag == $tag || (empty($inputtag) && $tag == "all")) { + // $class = "class=\"filerepo_types_current\""; + $class = " class=\"selected\" "; + } else { + $class = ""; + } + + add_submenu_item($label, $url, 'filetypes'); + + //echo "<li {$class} ><a href=\"{$url}\">{$label}</a></li>"; + + } + +?> + <!-- </p> --> + </ul> + </div> + +<?php + + } + +?>
\ No newline at end of file diff --git a/mod/file/views/default/file/upload.php b/mod/file/views/default/file/upload.php new file mode 100644 index 000000000..5a1f5c927 --- /dev/null +++ b/mod/file/views/default/file/upload.php @@ -0,0 +1,134 @@ +<?php + /** + * Elgg file browser uploader + * + * @package ElggFile + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + + 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 = page_owner_entity()->guid; + } + + // make sure session cache is cleared + unset($_SESSION['uploadtitle']); + unset($_SESSION['uploaddesc']); + unset($_SESSION['uploadtags']); + unset($_SESSION['uploadaccessid']); + + +?> +<div class="contentWrapper"> +<form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" enctype="multipart/form-data" method="post"> +<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_editarea"> + <label><?php echo elgg_echo("description"); ?><br /> +<?php + + echo elgg_view("input/longtext",array( + "internalname" => "description", + "value" => $description, + )); +?> + </label> +</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> +</div> diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php new file mode 100644 index 000000000..9568074b2 --- /dev/null +++ b/mod/file/views/default/object/file.php @@ -0,0 +1,205 @@ +<?php + /** + * Elgg file browser. + * File renderer. + * + * @package ElggFile + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + + global $CONFIG; + + $file = $vars['entity']; + + $file_guid = $file->getGUID(); + $tags = $file->tags; + $title = $file->title; + $desc = $file->description; + $owner = $vars['entity']->getOwnerEntity(); + $friendlytime = friendly_time($vars['entity']->time_created); + $mime = $file->mimetype; + + if (!$title) { + $title = elgg_echo('untitled'); + } + + if (get_context() == "search") { // Start search listing version + + if (get_input('search_viewtype') == "gallery") { + echo "<div class=\"filerepo_gallery_item\">"; + if ($vars['entity']->smallthumb) { + echo "<p class=\"filerepo_title\">" . $file->title . "</p>"; + echo "<p><a href=\"{$file->getURL()}\"><img src=\"{$vars['url']}mod/file/thumbnail.php?size=medium&file_guid={$vars['entity']->getGUID()}\" border=\"0\" /></a></p>"; + echo "<p class=\"filerepo_timestamp\"><small><a href=\"{$vars['url']}pg/file/{$owner->username}\">{$owner->username}</a> {$friendlytime}</small></p>"; + + //get the number of comments + $numcomments = elgg_count_comments($vars['entity']); + if ($numcomments) + echo "<p class=\"filerepo_comments\"><a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a></p>"; + + + //if the user can edit, display edit and delete links + if ($file->canEdit()) { + echo "<div class=\"filerepo_controls\"><p>"; + echo "<a href=\"{$vars['url']}mod/file/edit.php?file_guid={$file->getGUID()}\">" . elgg_echo('edit') . "</a> "; + echo elgg_view('output/confirmlink',array( + + 'href' => $vars['url'] . "action/file/delete?file=" . $file->getGUID(), + 'text' => elgg_echo("delete"), + 'confirm' => elgg_echo("file:delete:confirm"), + 'is_action' => true, + + )); + echo "</p></div>"; + } + + + } else { + echo "<p class=\"filerepo_title\">{$title}</p>"; + echo "<a href=\"{$file->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'large')) . "</a>"; + echo "<p class=\"filerepo_timestamp\"><small><a href=\"{$vars['url']}pg/file/{$owner->username}\">{$owner->name}</a> {$friendlytime}</small></p>"; + //get the number of comments + $numcomments = elgg_count_comments($file); + if ($numcomments) + echo "<p class=\"filerepo_comments\"><a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a></p>"; + + + } + echo "</div>"; + // echo elgg_view("search/gallery",array('info' => $info, 'icon' => $icon)); + + } else { + + $info = "<p> <a href=\"{$file->getURL()}\">{$title}</a></p>"; + $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/file/{$owner->username}\">{$owner->name}</a> {$friendlytime}"; + $numcomments = elgg_count_comments($file); + if ($numcomments) + $info .= ", <a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>"; + $info .= "</p>"; + + // $icon = elgg_view("profile/icon",array('entity' => $owner, 'size' => 'small')); + $icon = "<a href=\"{$file->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'small')) . "</a>"; + + echo elgg_view_listing($icon, $info); + + } + + } else { // Start main version + +?> + <div class="filerepo_file"> + <div class="filerepo_icon"> + <a href="<?php echo $vars['url']; ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php + + echo elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid)); + + ?></a> + </div> + + <div class="filerepo_title_owner_wrapper"> + <?php + //get the user and a link to their gallery + $user_gallery = $vars['url'] . "mod/file/search.php?md_type=simpletype&subtype=file&tag=image&owner_guid=" . $owner->guid . "&search_viewtype=gallery"; + ?> + <div class="filerepo_user_gallery_link"><a href="<?php echo $user_gallery; ?>"><?php echo sprintf(elgg_echo("file:user:gallery"),''); ?></a></div> + <div class="filerepo_title"><h2><a href="<?php echo $vars['url']; ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php echo $title; ?></a></h2></div> + <div class="filerepo_owner"> + <?php + + echo elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny')); + + ?> + <p class="filerepo_owner_details"><b><a href="<?php echo $vars['url']; ?>pg/file/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b><br /> + <small><?php echo $friendlytime; ?></small></p> + </div> + </div> + + + <div class="filerepo_maincontent"> + + <div class="filerepo_description"><?php echo elgg_view('output/longtext', array('value' => $desc)); ?></div> + <div class="filerepo_tags"> +<?php + + if (!empty($tags)) { + +?> + <div class="object_tag_string"><?php + + echo elgg_view('output/tags',array('value' => $tags)); + + ?></div> +<?php + } + + $categories = elgg_view('categories/view',$vars); + if (!empty($categories)) { +?> + <div class="filerepo_categories"> + <?php + + echo $categories; + + ?> + </div> +<?php + } + +?> + </div> + <?php + if (elgg_view_exists('file/specialcontent/' . $mime)) { + echo "<div class=\"filerepo_specialcontent\">".elgg_view('file/specialcontent/' . $mime, $vars)."</div>"; + } else if (elgg_view_exists("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default")) { + echo "<div class=\"filerepo_specialcontent\">".elgg_view("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars)."</div>"; + } + + ?> + + <div class="filerepo_download"><p><a href="<?php echo $vars['url']; ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php echo elgg_echo("file:download"); ?></a></p></div> + +<?php + + if ($file->canEdit()) { +?> + + <div class="filerepo_controls"> + <p> + <a href="<?php echo $vars['url']; ?>mod/file/edit.php?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo('edit'); ?></a> + <?php + echo elgg_view('output/confirmlink',array( + + 'href' => $vars['url'] . "action/file/delete?file=" . $file->getGUID(), + 'text' => elgg_echo("delete"), + 'confirm' => elgg_echo("file:delete:confirm"), + 'is_action' => true, + + )); + ?> + </p> + </div> + +<?php + } + +?> + </div> +</div> + +<?php + + if ($vars['full']) { + + echo elgg_view_comments($file); + + } + +?> + +<?php + + } + +?>
\ No newline at end of file diff --git a/mod/file/views/default/river/object/file/create.php b/mod/file/views/default/river/object/file/create.php new file mode 100644 index 000000000..b0e2ca07b --- /dev/null +++ b/mod/file/views/default/river/object/file/create.php @@ -0,0 +1,17 @@ +<?php + + $performed_by = get_entity($vars['item']->subject_guid); + $object = get_entity($vars['item']->object_guid); + $url = $object->getURL(); + $container = get_entity($object->container_guid); + + $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; + $string = sprintf(elgg_echo("file:river:created"),$url) . " " . elgg_echo("file:river:item"); + $string .= " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; + if ($container && $container instanceof ElggGroup) { + $string .= ' ' . elgg_echo('groups:river:togroup') . " <a href=\"" . $container->getURL() ."\">". $container->name . "</a>"; + } + + echo $string; + +?>
\ No newline at end of file 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 diff --git a/mod/file/views/rss/object/file.php b/mod/file/views/rss/object/file.php new file mode 100644 index 000000000..fdefb4069 --- /dev/null +++ b/mod/file/views/rss/object/file.php @@ -0,0 +1,30 @@ +<?php + + /** + * Elgg RSS file object view + * + * @package ElggFile + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + $title = $vars['entity']->title; + if (empty($title)) { + $title = substr($vars['entity']->description,0,32); + if (strlen($vars['entity']->description) > 32) + $title .= " ..."; + } + +?> + + <item> + <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid> + <pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate> + <link><?php echo $vars['entity']->getURL(); ?></link> + <title><![CDATA[<?php echo $title; ?>]]></title> + <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description> + <enclosure url="<?php echo $vars['url']; ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" length="<?php echo $vars['entity']->size(); ?>" type="<?php echo $vars['entity']->getMimeType(); ?>" /> + </item> |