diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-02-25 12:16:53 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-02-25 12:16:53 +0000 |
commit | 4e0c1576475390faa2f1fb4c4dc2902a953f440e (patch) | |
tree | cd3a47df019344d7f6c938ebe31c60cfa9b03677 /views | |
download | elgg-4e0c1576475390faa2f1fb4c4dc2902a953f440e.tar.gz elgg-4e0c1576475390faa2f1fb4c4dc2902a953f440e.tar.bz2 |
First commit
Diffstat (limited to 'views')
20 files changed, 1064 insertions, 0 deletions
diff --git a/views/default/input/accessRead.php b/views/default/input/accessRead.php new file mode 100644 index 000000000..81392b19f --- /dev/null +++ b/views/default/input/accessRead.php @@ -0,0 +1,61 @@ +<?php
+
+ /**
+ * Elgg access level input
+ * this is a custom input that disables the given value, but passes the value discreetly
+ * we need this because using "disabled" inputs do not pass values and will store as default 0
+ *
+ * @package Elgg
+ * @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
+ * @link http://elgg.org/
+ *
+ * @uses $vars['value'] The current value, if any
+ * @uses $vars['js'] Any Javascript to enter into the input tag
+ * @uses $vars['internalname'] The name of the input field
+ *
+ */
+
+ $class = $vars['class'];
+ if (!$class) $class = "input-access";
+
+ //default no array sent get all normal select values
+ if (!is_array($vars['options']))
+ {
+ $vars['options'] = array();
+ $vars['options'] = get_write_access_array();
+ }
+
+ //if sending custom select values via array
+ if (is_array($vars['options']) && sizeof($vars['options']) > 0)
+ {
+
+ /* my hacks (pay no attention please =D )
+ //allow showing of group for write access
+ if($vars['group_write']) $vars['options'] = trigger_plugin_hook('access:collections:write','user',array('user_id' => $_SESSION['guid'], 'site_id' => 0),$vars['options']);
+ */
+
+ //developer check - to check the value being sent initially
+ //echo 'given value: '.$vars['value'].'<br>';
+
+ //if no value currently set - specify default
+ if (empty($vars['value']) && $vars['value'] != '0')
+ $vars['value'] = 2;
+
+
+ foreach($vars['options'] as $key => $option) {
+ if ($key == $vars['value']) {
+?>
+ <input type="text" value="<?php echo htmlentities($option, null, 'UTF-8'); ?>" class="<?php echo $class ?>" DISABLED>
+ <input type="hidden" name="<?php echo $vars['internalname']; ?>" value="<?php echo $key ;?>" <?php if (isset($vars['js'])) echo $vars['js']; ?> class="<?php echo $class; ?>">
+
+<?php
+ }
+ }
+
+
+ }
+
+?>
\ No newline at end of file diff --git a/views/default/input/cover_checkbox.php b/views/default/input/cover_checkbox.php new file mode 100644 index 000000000..48c7d51cc --- /dev/null +++ b/views/default/input/cover_checkbox.php @@ -0,0 +1,45 @@ +<?php
+
+ /**
+ * Elgg custom checkbox input used to define an album cover
+ * @ forms/edit.php
+ * i made custom check box because the default checkboxes allows for more than one box.
+ * it handles the checkboxes via arrays, but i only need one and i did not want to use time figuring it all out
+ * simple and sweet , one checkbox.
+ *
+ * @package Elgg
+ * @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
+ * @link http://elgg.org/
+ *
+ * @uses $vars['value'] The current value, if any
+ * @uses $vars['js'] Any Javascript to enter into the input tag
+ * @uses $vars['internalname'] The name of the input field
+ * @uses $vars['options'] An array of strings representing the options for the checkbox field
+ *
+ */
+ + $class = $vars['class']; + if (!$class) $class = "input-checkboxes"; +
+ foreach($vars['options'] as $label => $option) {
+ + if ($option != $vars['value']) {
+ $selected = "";
+ } else {
+ $selected = "checked = \"checked\"";
+ }
+
+ $labelint = (int) $label;
+ if ("{$label}" == "{$labelint}") {
+ $label = $option;
+ } + + $disabled = ""; + if ($vars['disabled']) $disabled = ' disabled="yes" ';
+ echo "<label><input type=\"checkbox\" $disabled {$vars['js']} name=\"{$vars['internalname']}\" {$selected} value=\"".htmlentities($option, null, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />";
+ }
+
+?>
\ No newline at end of file diff --git a/views/default/input/multi_radio.php b/views/default/input/multi_radio.php new file mode 100644 index 000000000..11f4c13b8 --- /dev/null +++ b/views/default/input/multi_radio.php @@ -0,0 +1,42 @@ +<?php
+
+ /**
+ * Elgg radio input
+ * Displays a radio input field
+ *
+ * @package Elgg
+ * @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
+ * @link http://elgg.org/
+ *
+ * @uses $vars['value'] The current value, if any
+ * @uses $vars['js'] Any Javascript to enter into the input tag
+ * @uses $vars['internalname'] The name of the input field
+ * @uses $vars['options'] An array of strings representing the options for the radio field
+ *
+ */
+
+ $class = $vars['class'];
+ if (!$class) $class = "input-checkboxes";
+
+ foreach($vars['options'] as $label => $option) {
+
+ if ($vars['set'] != $vars['value']) {
+ $selected = "";
+ } else {
+ $selected = "checked = \"checked\"";
+ }
+
+ $labelint = (int) $label;
+ if ("{$label}" == "{$labelint}") {
+ $label = $option;
+ }
+
+ $disabled = "";
+ if ($vars['disabled']) $disabled = ' disabled="yes" ';
+ echo "<label><input type=\"radio\" $disabled {$vars['js']} name=\"{$vars['internalname']}\" {$selected} value=\"".htmlentities($vars['value'], null, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />";
+ }
+
+?>
\ No newline at end of file diff --git a/views/default/object/album.php b/views/default/object/album.php new file mode 100644 index 000000000..b95d55eed --- /dev/null +++ b/views/default/object/album.php @@ -0,0 +1,137 @@ +<?php + /** + * Elgg file browser. + * File renderer. + * + * @package ElggFile + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @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 (get_context() == "search") { + + if (get_input('search_viewtype') == "gallery") { + //default gallery view for album listing @ /photos/owned/ + + //get album cover if one was set + if($file->cover) + $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$file->cover.'&size=small" border="0" class="album_cover" alt="thumbnail"/>'; + else + $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/img_error.jpg" class="album_cover" alt="new album">'; + + ?> + <div class="album_gallery_item"> + <a href="<?php echo $file->getURL();?>"><?php echo $title;?></a><br> + <a href="<?php echo $file->getURL();?>"><?php echo $album_cover;?></a><br> + <small><a href="<?php echo $vars['url'];?>pg/profile/<?php echo $owner->username;?>"><?php echo $owner->name;?></a> <?php echo $friendlytime;?><br> + <?php + //get the number of comments + $numcomments = elgg_count_comments($file); + if ($numcomments) + echo "<a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>"; + ?> + </small> + </div> + + <?php + } else { + //album list-entity view + + $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 = "<a href=\"{$file->getURL()}\">" . elgg_view("tidypics/icon", array('album' => true, 'size' => 'small')) . "</a>"; + + echo elgg_view_listing($icon, $info); + + } + + } else { + // individual album view +?> + <div id="pages_breadcrumbs"> +<?php + if (is_null(page_owner_entity()->username) || empty(page_owner_entity()->username)) { //when no owner available, link to world photos +?> + <a href="<?php echo $vars['url'] . 'pg/photos/world'; ?>"><?php echo elgg_echo("albums"); ?></a> > +<?php + } else { +?> + <a href="<?php echo $vars['url'] . 'pg/photos/owned/' . page_owner_entity()->username; ?>"><?php echo sprintf(elgg_echo("album:user"), page_owner_entity()->name); ?></a> > +<?php + } +?> + <?php echo $title; ?> + </div> + +<?php + echo '<div id="tidypics_title">'.$title.'</div>'; + echo '<div id="tidypics_desc">'.autop($desc).'</div>'; + + if ($file->canEdit()) { // add edits + // specific to my theme only + //add_submenu_item(elgg_echo('album:addpix'), $vars['url'] . "pg/photos/upload/". $file_guid , '', 'jade'); + //add_submenu_item(elgg_echo('album:edit'), $vars['url'] . "mod/tidypics/edit.php?file_guid=". $file_guid , '', 'jade'); + //add_submenu_item(elgg_echo('album:delete'), $vars['url'] . "action/tidypics/delete?file=". $file_guid , '', 'jade'); + +?> + <div id="tidypics_controls"> + <a href="<?php echo $vars['url'] . "pg/photos/upload/" . $file_guid ;?>"><?php echo elgg_echo('album:addpix');?></a> + <a href="<?php echo $vars['url']; ?>mod/tidypics/edit.php?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo('album:edit'); ?></a> + + <?php echo elgg_view('output/confirmlink',array( + 'href' => $vars['url'] . "action/tidypics/delete?file=" . $file->getGUID(), + 'text' => elgg_echo("album:delete"), + 'confirm' => elgg_echo("album:delete:confirm"), + )); + ?> + </div> +<?php + } + + // display the simple image views. Uses: via 'object/image.php' + $count = get_entities("object","image", $file_guid, '', 999); + + //build array for back | next links + $_SESSION['image_sort'] = array(); + + foreach($count as $image){ + array_push($_SESSION['image_sort'], $image->guid); + } + + if(count($count) > 0) + echo list_entities("object","image", $file_guid, 24, false); + else + echo elgg_echo('image:none'); + +?> + <div class="clearfloat"></div> + <div id="tidypics_info"> + <div class="object_tag_string"><?php echo elgg_view('output/tags',array('value' => $tags));?></div> + <?php echo elgg_echo('album:by');?> <b><a href="<?php echo $vars['url'] ;?>pg/profile/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b> <?php echo $friendlytime; ?><br> + <?php echo elgg_echo('image:total');?> <b><?php echo count($count);?></b><br> + </div> + +<?php + if ($vars['full']) { + echo elgg_view_comments($file); + } + +} +?> diff --git a/views/default/object/image.php b/views/default/object/image.php new file mode 100644 index 000000000..063ad09cb --- /dev/null +++ b/views/default/object/image.php @@ -0,0 +1,130 @@ +<?php + /** + + * image object views + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @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 (get_context() == "search") { //if this is the search view + + + if (get_input('search_viewtype') == "gallery") { + ?> + <div class="album_images"> + <a href="<?php echo $file->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $file_guid;?>&size=small" border="0" alt="thumbnail"/></a> + </div> + <?php + } + else{ + //image list-entity view + $info = '<p><a href="' .$file->getURL(). '">'.$title.'</a></p>'; + $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/photos/owned/{$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 = "<a href=\"{$file->getURL()}\">" . elgg_view("tidypics/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'small')) . "</a>"; + + echo elgg_view_listing($icon, $info); + } +} +else { //tidypics image display + + if (!$vars['full']) { //simple gallery view + +?> + <div class="album_images"> + <a href="<?php echo $file->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $file_guid;?>&size=small" border="0" alt="thumbnail"/></a> + </div> +<?php + } + else{ // individual full image view + + $album = get_entity($file->container_guid); + + //compile back | next links + $current = array_search($file_guid, $_SESSION['image_sort']); + + if(!$current){ // means we are no longer using the correct album array + + //rebuild the array -> + $count = get_entities("object","image", $album->guid, '', 999); + $_SESSION['image_sort'] = array(); + + foreach($count as $image){ + array_push($_SESSION['image_sort'], $image->guid); + } + + $current = array_search($file_guid, $_SESSION['image_sort']); + } + + if(!$current == 0) + $back = '<a href="' .$vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current-1] . '"><<' . elgg_echo('image:back') . '</a> '; + + if(array_key_exists(($current+1), $_SESSION['image_sort'])) + $next = ' <a href="' . $vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current+1] . '">' . elgg_echo('image:next') . '>></a>'; + +?> + <div id="pages_breadcrumbs"> +<?php + if (is_null(page_owner_entity()->username) || empty(page_owner_entity()->username)) { //when no owner available, link to world photos +?> + <a href="<?php echo $vars['url'] . 'pg/photos/world'; ?>"><?php echo elgg_echo("albums"); ?></a> > +<?php + } else { +?> + <a href="<?php echo $vars['url'] . 'pg/photos/owned/' . page_owner_entity()->username; ?>"><?php echo sprintf(elgg_echo("album:user"), page_owner_entity()->name); ?></a> > +<?php + } +?> + <a href="<?php echo $album->getURL(); ?>"><?php echo $album->title; ?></a> > + <?php echo $current+1 . ' / ' . sizeof($_SESSION['image_sort']); ?> + </div> +<?php + echo '<div id="tidypics_title">' . $title . '</div>'; + echo '<div id="tidypics_desc">' . autop($desc) . '</div>'; + echo '<div id="image_full">'; + echo '<div id="image_nav">' . $back . $next . '</div>'; + if($next) echo '<a href="' . $vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current+1] . '">'; + echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $file_guid . '&size=large" border="0" alt="' . $title . '"/>'; + if($next) echo '</a>'; + echo '</div>'; +?> + <div id="tidypics_controls"> + <a target="_new" href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo("image:download"); ?></a> +<?php + if ($file->canEdit()) { // add edit controls +?> + <a href="<?php echo $vars['url']; ?>mod/tidypics/edit.php?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo('image:edit'); ?></a> + <?php echo elgg_view('output/confirmlink',array( + 'href' => $vars['url'] . "action/tidypics/delete?file=" . $file->getGUID(), + 'text' => elgg_echo("image:delete"), + 'confirm' => elgg_echo("image:delete:confirm"), + )); + } + ?> + </div> + + <div id="tidypics_info"> + <div class="object_tag_string"><?php echo elgg_view('output/tags',array('value' => $tags));?></div> + <?php echo elgg_echo('image:by');?> <b><a href="<?php echo $vars['url']; ?>pg/profile/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b> <?php echo $friendlytime; ?><br> + </div> +<?php + echo elgg_view_comments($file); + } + +} +?>
\ No newline at end of file diff --git a/views/default/river/object/album/annotate.php b/views/default/river/object/album/annotate.php new file mode 100644 index 000000000..691b0c7ec --- /dev/null +++ b/views/default/river/object/album/annotate.php @@ -0,0 +1,13 @@ +<?php
+
+ $statement = $vars['statement'];
+ $performed_by = $statement->getSubject();
+ $object = $statement->getObject();
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("album:river:annotate"),$url) . " ";
+ $string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("album:river:item") . "</a>";
+
+ echo $string;
+
+?>
\ No newline at end of file diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php new file mode 100644 index 000000000..68553309c --- /dev/null +++ b/views/default/river/object/album/create.php @@ -0,0 +1,13 @@ +<?php
+
+ $statement = $vars['statement'];
+ $performed_by = $statement->getSubject();
+ $object = $statement->getObject();
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("album:river:created"),$url) . " ";
+ $string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("album:river:item") . "</a>";
+
+ echo $string;
+
+?>
\ No newline at end of file diff --git a/views/default/river/object/image/annotate.php b/views/default/river/object/image/annotate.php new file mode 100644 index 000000000..b0b1b8719 --- /dev/null +++ b/views/default/river/object/image/annotate.php @@ -0,0 +1,13 @@ +<?php
+
+ $statement = $vars['statement'];
+ $performed_by = $statement->getSubject();
+ $object = $statement->getObject();
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("image:river:annotate"),$url) . " ";
+ $string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("image:river:item") . "</a>";
+
+ echo $string;
+
+?>
\ No newline at end of file diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php new file mode 100644 index 000000000..3f5bbb5e8 --- /dev/null +++ b/views/default/river/object/image/create.php @@ -0,0 +1,13 @@ +<?php
+
+ $statement = $vars['statement'];
+ $performed_by = $statement->getSubject();
+ $object = $statement->getObject();
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("image:river:created"),$url) . " ";
+ $string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("image:river:item") . "</a>";
+
+ echo $string;
+
+?>
\ No newline at end of file diff --git a/views/default/settings/tidypics/edit.php b/views/default/settings/tidypics/edit.php new file mode 100644 index 000000000..2c63edff8 --- /dev/null +++ b/views/default/settings/tidypics/edit.php @@ -0,0 +1,10 @@ +<?php + $maxfilesize = $vars['entity']->maxfilesize; + if (!$maxfilesize) $maxfilesize = (int) 10240; //set the default maximum file size to 10MB (1024KB * 10 = 10240KB = 10MB) + +?> +<p> + <?php echo elgg_echo('tidypics:settings:maxfilesize'); ?> + + <?php echo elgg_view('input/text', array('internalname' => 'params[maxfilesize]', 'value' => $maxfilesize)); ?> +</p>
\ No newline at end of file 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 diff --git a/views/default/widgets/album_view/edit.php b/views/default/widgets/album_view/edit.php new file mode 100644 index 000000000..2d7c7708f --- /dev/null +++ b/views/default/widgets/album_view/edit.php @@ -0,0 +1,21 @@ +<p>
+ <?php echo elgg_echo("album:num_albums"); ?>:
+
+ <?php
+ if($vars['entity']->num_display == '') $vars['entity']->num_display = 5;
+ ?>
+ <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>
\ No newline at end of file diff --git a/views/default/widgets/album_view/view.php b/views/default/widgets/album_view/view.php new file mode 100644 index 000000000..347332971 --- /dev/null +++ b/views/default/widgets/album_view/view.php @@ -0,0 +1,53 @@ +<?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); + + 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->title . '"/>'; + else + $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/img_error.jpg" border="0" class="album_cover" alt="' . $album->title . '">'; + ?> + <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 + } + + //get a link to the users album + $users_album_url = $vars['url'] . "pg/photos/owned/" . $owner->username; + echo "<a href=\"{$users_album_url}\">" . elgg_echo('album:more') . "</a>"; + echo "</div>"; + + } else { + + echo '<p class="pages_add_title">'.elgg_echo("album:none").'</p>'; + + //check if owner has write rights. If so, let him edit the album + $container_guid = get_input('container_guid', $_SESSION['user']->getGUID()); + + if ($owner->username == get_entity($container_guid)->username){ + echo '<p class="pages_add"><a class="pages add" href='.$CONFIG->url .'pg/photos/new/'.$owner->username.'>'.elgg_echo("album:create").'</a></p>'; + } + + } +?>
\ No newline at end of file diff --git a/views/rss/object/file.php b/views/rss/object/file.php new file mode 100644 index 000000000..3bd84d076 --- /dev/null +++ b/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
+ * @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']; ?>action/file/download?file_guid=<?php echo $vars['entity']->getGUID(); ?>" length="<?php echo $vars['entity']->size(); ?>" type="<?php echo $vars['entity']->getMimeType(); ?>" />
+ </item>
|