aboutsummaryrefslogtreecommitdiff
path: root/views/default/tidypics
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-02-25 12:16:53 +0000
committerCash Costello <cash.costello@gmail.com>2009-02-25 12:16:53 +0000
commit4e0c1576475390faa2f1fb4c4dc2902a953f440e (patch)
treecd3a47df019344d7f6c938ebe31c60cfa9b03677 /views/default/tidypics
downloadelgg-4e0c1576475390faa2f1fb4c4dc2902a953f440e.tar.gz
elgg-4e0c1576475390faa2f1fb4c4dc2902a953f440e.tar.bz2
First commit
Diffstat (limited to 'views/default/tidypics')
-rw-r--r--views/default/tidypics/css.php128
-rw-r--r--views/default/tidypics/forms/edit.php115
-rw-r--r--views/default/tidypics/forms/edit_multi.php44
-rw-r--r--views/default/tidypics/forms/upload.php79
-rw-r--r--views/default/tidypics/groupprofile_albums.php60
-rw-r--r--views/default/tidypics/icon.php41
-rw-r--r--views/default/tidypics/menu.php16
7 files changed, 483 insertions, 0 deletions
diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php
new file mode 100644
index 000000000..f9f5b09e6
--- /dev/null
+++ b/views/default/tidypics/css.php
@@ -0,0 +1,128 @@
+<?php
+ /**
+ * tidypics CSS extender
+ */
+?>
+ /* --- independent view for image/album SHARED --- */
+
+#tidypics_title{
+ font-size:1.2em;
+ font-weight:bold;
+}
+#tidypics_desc{
+ padding:0 20px;
+ font-style:italic;
+}
+#tidypics_info{
+ padding:20px;
+ line-height:1.5em;
+}
+
+#tidypics_controls{
+ text-align:center;
+ margin-bottom:10px;
+}
+
+#tidypics_controls a{
+ margin:10px;
+}
+
+ /* independent album view only */
+
+.album_images{
+ float:left;
+ width:160px;
+ height:160px;
+ margin:4px;
+ padding:5px;
+ border:1px solid #ccc;
+ text-align:center;
+}
+
+ /* independent image view only */
+
+#image_full{
+ text-align:center;
+ margin:10px;
+}
+#image_full img{
+ padding:5px;
+ border:1px solid #ccc;
+ margin:7px 0;
+}
+
+/* --- albums gallery view --- */
+
+.album_cover{
+ padding:2px;
+ border:1px solid #ccc;
+ margin:8px 0;
+}
+
+
+/* ------ album WIDGET VIEW ------ */
+
+#album_widget_container{
+ text-align:center;
+}
+
+.album_widget_single_item{
+
+}
+.album_widget_title{
+
+}
+.album_widget_timestamp {
+ color:#666666;
+ margin:0;
+}
+.collapsable_box #album_widget_layout {
+ margin:0;
+}
+
+/* --------- image upload/edit forms ------------ */
+
+#image_upload_list li{
+ margin:3px 0;
+}
+.edit_image_container{
+ padding:5px;
+ margin:5px 0;
+ overflow:auto;
+}
+.edit_images{
+ float:right;
+ width:160px;
+ height:160px;
+ margin:4px;
+ padding:5px;
+ border:1px solid #ccc;
+ text-align:center;
+}
+.image_info{
+ float:left;
+ width:60%;
+}
+.image_info label{
+ font-size:1em;
+}
+.edit_image{
+ float:right;
+ border:1px solid #ccc;
+ width:153px;
+ height:153px;
+}
+
+/* --------- tidypics river items ------------ */
+
+.river_image_create {
+ background: url(<?php echo $vars['url']; ?>mod/tidypics/graphics/icons/river_icon_image.gif) no-repeat left -1px;
+}
+.river_album_create {
+ background: url(<?php echo $vars['url']; ?>mod/tidypics/graphics/icons/river_icon_album.gif) no-repeat left -1px;
+}
+
+.pagination {
+ clear:both !important;
+}
+ \ No newline at end of file
diff --git a/views/default/tidypics/forms/edit.php b/views/default/tidypics/forms/edit.php
new file mode 100644
index 000000000..efe4aa508
--- /dev/null
+++ b/views/default/tidypics/forms/edit.php
@@ -0,0 +1,115 @@
+<?php
+ /**
+ * Elgg images edit/add page
+ * This form is used to:
+ * - create albums
+ * - edit albums
+ * - edit images
+ */
+
+ //set stuff if we are editing existing album or image
+ if (isset($vars['entity'])) {
+ $title = sprintf(elgg_echo("album:edit"),$object->title);
+ $action = "tidypics/editalbum";
+ $title = $vars['entity']->title;
+ $body = $vars['entity']->description;
+ $tags = $vars['entity']->tags;
+ $access_id = $vars['entity']->access_id;
+ $subtype = $vars['subtype'];
+
+ // if nothing is sent, create new, but only new albums are sent here
+ // new images are sent to upload.php
+ } else {
+ $title = elgg_echo("album:add");
+ $action = "tidypics/addalbum";
+ $tags = "";
+ $title = "";
+ $description = "";
+ }
+
+ // in case we have some cached details
+ if (isset($vars['albumtitle'])) {
+ $title = $vars['albumtitle'];
+ $body = $vars['albumbody'];
+ $tags = $vars['albumtags'];
+ }
+
+ $container_guid = get_input('container_guid');
+ if (!$container_guid) $container_guid = page_owner();
+
+?>
+ <form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post">
+ <p>
+ <label><?php echo elgg_echo('album:title'); ?></label>
+ <?php echo elgg_view("input/text", array("internalname" => "albumtitle", "value" => $title,)); ?>
+ </p>
+<?php
+ if($vars['subtype'] == 'album' || $action == "tidypics/addalbum")
+ {
+?>
+ <p>
+ <label><?php echo elgg_echo('album:desc'); ?></label>
+ <?php echo elgg_view("input/text",array("internalname" => "albumbody","value" => $body,)); ?>
+ </p>
+<?php
+ } else {
+?>
+ <p>
+ <label><?php echo elgg_echo('caption'); ?></label>
+ <?php echo elgg_view("input/text",array("internalname" => "albumbody","value" => $body,)); ?>
+ </p>
+<?php
+ } //End album/image selection
+?>
+ <p>
+ <label><?php echo elgg_echo("tags"); ?></label>
+ <?php echo elgg_view("input/tags", array( "internalname" => "albumtags","value" => $tags,)); ?>
+ </p>
+
+ <?php
+
+ if($vars['subtype'] == 'image')
+ {
+ //if this is an image --
+ //ALBUM COVER: ask to set image to album cover ::
+ //ACCESS: only existing images come here :: so acess should already be initially set by album
+
+ $guid = $vars['entity']->guid;
+ $container_guid = $vars['entity']->container_guid;
+ $cover_guid = get_entity($container_guid)->cover;
+
+ if($cover_guid == $vars['entity']->guid)
+ $cover = 'yes';
+
+ ?>
+ <p>
+ <label><?php echo elgg_echo("album:cover"); ?></label>
+ <?php echo elgg_view("input/cover_checkbox", array( "internalname" => "cover", "value" => $cover, 'options' => array(elgg_echo('album:cover:yes')))); ?>
+ </p>
+ <p>
+ <label><?php echo sprintf(elgg_echo('access'), "$subtype"); ?></label>
+ <?php echo elgg_view('input/accessRead', array('internalname' => 'access_id','value' => $access_id)); ?>
+ </p>
+ <?php echo elgg_echo('image:access:note');?>
+ <?php
+ }
+ else{
+ //this is a new or existing album, both of which access is editable
+ ?>
+ <p>
+ <label><?php echo sprintf(elgg_echo('access'), "$subtype"); ?></label>
+ <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?>
+ </p>
+
+ <?php
+ }
+
+ if (isset($vars['entity'])) {
+ ?>
+ <input type="hidden" name="albumpost" value="<?php echo $vars['entity']->getGUID(); ?>" />
+ <?php
+ }
+ ?>
+ <input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" />
+ <p><input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" /></p>
+ </form> \ No newline at end of file
diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php
new file mode 100644
index 000000000..252a660bd
--- /dev/null
+++ b/views/default/tidypics/forms/edit_multi.php
@@ -0,0 +1,44 @@
+<?php
+ /**
+ * form for mass editing all uploaded images
+ */
+?>
+<form action="<?php echo $vars['url']; ?>action/tidypics/edit_multi" method="post">
+<?php
+
+ $file_array = $vars['file_array'];
+ $album_entity = get_entity($vars['album_guid']);
+ if(!$album_entity->cover) $no_cover = true;
+
+ foreach($file_array as $key => $file_guid){
+ $entity = get_entity($file_guid);
+ $guid = $entity->guid;
+ $body = $entity->description;
+ $tags = $entity->tags;
+ $container_guid = $entity->container_guid;
+ if($no_cover && !$cover) $cover = $guid;
+
+ echo '<div class="edit_image_container">';
+ echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $guid . '&size=small" border="0" class="edit_images" alt="' . $title . '"/>';
+ echo '<div class="image_info">';
+ echo '<p><label>' . elgg_echo('album:title') . '</label>';
+ echo elgg_view("input/text", array("internalname" => "title[$key]", "value" => $title,)) . "\n";
+ echo '</p>';
+ echo '<p><label>' . elgg_echo('caption') . "</label>";
+ echo elgg_view("input/text",array("internalname" => "caption[$key]", "value" => $body,)) . "\n";
+ echo "</p>";
+ echo '<p><label>' . elgg_echo("tags") . "</label>\n";
+ echo elgg_view("input/tags", array( "internalname" => "tags[$key]","value" => $tags)) . "\n";
+ echo '</p>';
+ echo '<input type="hidden" name="image_guid[' .$key. ']" value="'. $guid .'">' . "\n";
+ echo '<label>' . elgg_echo("album:cover") . '</label>';
+ echo elgg_view("input/multi_radio", array( "internalname" => "cover", "value" => $guid, 'options' => array('yes'), 'set' => $cover));
+ echo '</div>';
+ echo '</div>';
+
+ }
+ echo elgg_echo('image:access:note');
+?>
+ <input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" />
+ <p><input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" /></p>
+ </form> \ No newline at end of file
diff --git a/views/default/tidypics/forms/upload.php b/views/default/tidypics/forms/upload.php
new file mode 100644
index 000000000..35768f64c
--- /dev/null
+++ b/views/default/tidypics/forms/upload.php
@@ -0,0 +1,79 @@
+<?php
+ /**
+ * Elgg file browser uploader
+ *
+ * @package ElggFile
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+ global $CONFIG;
+
+ //this is for image uploads only. Image edits are handled by edit.php form
+
+ $container_guid = get_input('container_guid');
+ $access_id = get_entity($vars['album'])->access_id;
+ if (get_plugin_setting('maxfilesize','tidypics')) {
+ if (((int) get_plugin_setting('maxfilesize','tidypics')) < 1 || ((int) get_plugin_setting('maxfilesize','tidypics')) > 1048576) {
+ $maxfilesize = 10240; //if file size is less than 1KB or greater than 1GB, default to 10MB
+ } else {
+ $maxfilesize = (int) get_plugin_setting('maxfilesize','tidypics');
+ }
+ } else {
+ $maxfilesize = 10240; //if the file size limit is not set, default to 10MB
+ }
+
+?>
+<script language="javascript">
+<!--
+
+var state = 'none';
+
+function showhide(layer_ref) {
+ if (state == 'block') {
+ state = 'none';
+ }
+ else {
+ state = 'block';
+ }
+ if (document.all) { //IS IE 4 or 5 (or 6 beta)
+ eval( "document.all." + layer_ref + ".style.display = state");
+ }
+ if (document.layers) { //IS NETSCAPE 4 or below
+ document.layers[layer_ref].display = state;
+ }
+ if (document.getElementById &&!document.all) {
+ hza = document.getElementById(layer_ref);
+ hza.style.display = state;
+ }
+ return false;
+}
+//-->
+</script>
+<form action="<?php echo $vars['url']; ?>action/tidypics/upload" enctype="multipart/form-data" method="post">
+ <p style="line-height:1.6em;">
+ <label><?php echo elgg_echo("images:upload"); ?></label><br />
+ <i><?php echo elgg_echo("tidypics:settings:maxfilesize") . ' ' . $maxfilesize; ?></i><br />
+ <div align="center" class="tidypics_loader" id="tidypics_loader" name="tidypics_loader" style="display:none;"><center><img alt="..." border="0" src="<?php echo $vars['url'].'mod/tidypics/graphics/loader.gif' ?>" /></center></div>
+ <ol id="image_upload_list">
+<?php
+ for($x = 0; $x < 10; $x++){
+ echo '<li>' . elgg_view("input/file",array('internalname' => "upload_$x")) . "</li>\n";
+ }
+?>
+ </ol>
+ </p>
+
+ <label><?php echo sprintf(elgg_echo('access'), 'image'); ?></label>
+ <?php echo elgg_view('input/accessRead', array('internalname' => 'access_id','value' => $access_id)); ?>
+
+ <p>
+ <?php
+ if ($container_guid)
+ echo '<input type="hidden" name="container_guid" value="'.$container_guid.'" />';
+
+ ?>
+ <input type="submit" value="<?php echo elgg_echo("save"); ?>" onclick="showhide('tidypics_loader');" />
+ </p>
+
+</form> \ No newline at end of file
diff --git a/views/default/tidypics/groupprofile_albums.php b/views/default/tidypics/groupprofile_albums.php
new file mode 100644
index 000000000..ea11006fa
--- /dev/null
+++ b/views/default/tidypics/groupprofile_albums.php
@@ -0,0 +1,60 @@
+<?php
+ //the number of files to display
+ $number = (int) $vars['entity']->num_display;
+ //if no number has been set, default to 5
+ if (!$number)
+ $number = 5;
+
+ $owner = page_owner_entity();
+ $owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false);
+
+ echo '<div id="group_albums_widget">';
+ echo '<h2>' . elgg_echo('albums') . '</h2>';
+
+ if ($owner_albums) {
+ echo '<div id="album_widget_container">';
+ foreach($owner_albums as $album){
+
+ //get album cover if one was set
+ if($album->cover)
+ $album_cover = '<img src="'.$vars['url'].'/mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" border="0" class="album_cover" alt="album cover"/>';
+ else
+ $album_cover = '<img src="'.$vars['url'].'/mod/tidypics/graphics/img_error.jpg" class="album_cover" alt="new album">';
+
+ ?>
+ <div class="album_widget_single_item">
+ <div class="album_widget_title"><a href="<?php echo $album->getURL();?>"><?php echo $album->title;?></a></div>
+ <div class="album_widget_timestamp"> <?php echo elgg_echo("album:created:on") . ' ' . friendly_time($album->time_created);?></div>
+ <?php
+ //get the number of comments
+ $numcomments = elgg_count_comments($album);
+ if ($numcomments)
+ echo "<a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a><br>";
+ ?>
+ <a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a>
+ </div>
+ <?php
+ } //end of loop
+
+ //get a link to the group's album, or world if unavailable
+ if (is_null($owner->username) || empty($owner->username)) {
+ echo '<a href="' . $vars['url'] . 'pg/photos/world">' . elgg_echo('album:all') . '</a>';
+ } else {
+ echo '<a href="' . $vars['url'] . 'pg/photos/owned/' . $owner->username . '">' . elgg_echo('album:more') . '</a>';
+ }
+
+ //close album_widget_container div
+ echo "</div>";
+ } else {
+
+ echo '<div id="no_album_found">';
+ echo '<p class="pages_add_title">'.elgg_echo("album:none").'</p>';
+ if ($owner && ($owner->canWriteToContainer($_SESSION['user']))){
+ echo '<a class="add_topic_button" href='.$CONFIG->url .'pg/photos/new/'.$owner->username.'>'.elgg_echo("album:add").'</a>';
+ echo '</div>';
+ }
+
+ }
+ //close group_albums_widget div
+ echo "</div>";
+?> \ No newline at end of file
diff --git a/views/default/tidypics/icon.php b/views/default/tidypics/icon.php
new file mode 100644
index 000000000..614fa3ad0
--- /dev/null
+++ b/views/default/tidypics/icon.php
@@ -0,0 +1,41 @@
+<?php
+ /**
+ * Elgg tidypic icon
+ * Optionally you can specify a size.
+ *
+ * @package ElggFile
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ global $CONFIG;
+
+if($vars['album']){
+ echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/album.gif\" border=\"0\" />";
+}
+else{
+
+ $mime = $vars['mimetype'];
+ if (isset($vars['thumbnail'])) {
+ $thumbnail = $vars['thumbnail'];
+ } else {
+ $thumbnail = false;
+ }
+
+ $size = $vars['size'];
+ if ($size != 'large') {
+ $size = 'small';
+ }
+
+ if ($thumbnail && strpos($mime, "image/")!==false)
+ echo "<img src=\"{$vars['url']}action/tidypics/icon?file_guid={$vars['file_guid']}\" border=\"0\" />";
+ else
+ {
+ if ($size == 'large')
+ echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/general_lrg.gif\" border=\"0\" />";
+ else
+ echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/general.gif\" border=\"0\" />";
+ }
+}
+?> \ No newline at end of file
diff --git a/views/default/tidypics/menu.php b/views/default/tidypics/menu.php
new file mode 100644
index 000000000..4368993dd
--- /dev/null
+++ b/views/default/tidypics/menu.php
@@ -0,0 +1,16 @@
+<?php
+
+ /**
+ * Elgg hoverover extender for tidypics
+ *
+ * @package ElggFile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+?>
+
+ <p class="user_menu_file <?php if(get_context() == 'photos') echo 'profile_select';?>">
+ <a href="<?php echo $vars['url']; ?>pg/photos/owned/<?php echo $vars['entity']->username; ?>"><?php echo elgg_echo("albums"); ?></a>
+ </p> \ No newline at end of file