From c51b483f24936c8d04a54a6999412937ec21c49a Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Nov 2011 23:13:26 -0500 Subject: uploading photos through the basic interface works now --- views/default/forms/photos/basic_upload.php | 103 +++++++++--------------- views/default/forms/photos/batch/edit.php | 32 ++++++++ views/default/forms/photos/batch/edit/image.php | 39 +++++++++ views/default/object/album/full.php | 5 +- views/default/tidypics/forms/edit_multi.php | 59 -------------- 5 files changed, 112 insertions(+), 126 deletions(-) create mode 100644 views/default/forms/photos/batch/edit.php create mode 100644 views/default/forms/photos/batch/edit/image.php delete mode 100644 views/default/tidypics/forms/edit_multi.php (limited to 'views') diff --git a/views/default/forms/photos/basic_upload.php b/views/default/forms/photos/basic_upload.php index 55ab854a4..e4535814b 100644 --- a/views/default/forms/photos/basic_upload.php +++ b/views/default/forms/photos/basic_upload.php @@ -1,24 +1,22 @@ access_id; -$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics'); -if (!$maxfilesize) { - $maxfilesize = 5; -} - -$quota = get_plugin_setting('quota','tidypics'); +$maxfilesize = (float) elgg_get_plugin_setting('maxfilesize', 'tidypics'); +$quota = elgg_get_plugin_setting('quota', 'tidypics'); +/* if ($quota) { $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size"); $image_repo_size = (int)$image_repo_size_md->value; @@ -34,16 +32,6 @@ if ($quota) { $image_repo_size = $quota; } } - -?> -
-
- -

-
-
@@ -51,54 +39,37 @@ if ($quota) { -

-
-
...
-
-
    - ' . elgg_view("input/file",array('internalname' => "upload_$x")) . ''; - } - ?> -
-

-

- guid . '" />'; - } - if ($access_id) { - echo ''; - } - ?> - " onclick="displayProgress();" /> -

- -
- \ No newline at end of file +echo elgg_view('input/form', array( + 'body' => $form_body, + 'action' => 'action/photos/image/upload', + 'enctype' => 'multipart/form-data', +)); diff --git a/views/default/forms/photos/batch/edit.php b/views/default/forms/photos/batch/edit.php new file mode 100644 index 000000000..fa017ac96 --- /dev/null +++ b/views/default/forms/photos/batch/edit.php @@ -0,0 +1,32 @@ +getContainerEntity(); + +$images = elgg_get_entities_from_relationship(array( + 'type' => 'object', + 'subtype' => 'image', + 'relationship' => 'belongs_to_batch', + 'relationship_guid' => $batch->getGUID(), + 'inverse_relationship' => true, +)); + +echo ''; + +echo '
'; +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +echo '
'; diff --git a/views/default/forms/photos/batch/edit/image.php b/views/default/forms/photos/batch/edit/image.php new file mode 100644 index 000000000..bf982ed84 --- /dev/null +++ b/views/default/forms/photos/batch/edit/image.php @@ -0,0 +1,39 @@ +'; + +echo '
'; +echo elgg_view('output/img', array( + 'src' => $image->getSrcURL(), + 'alt' => $image->getTitle(), + 'class' => 'elgg-photo', +)); +echo '
'; + +echo '
'; +echo '
'; +echo elgg_view('input/text', array('name' => 'title[]', 'value' => $title,)); +echo '
'; + +echo '
'; +echo elgg_view('input/longtext', array('name' => 'caption[]')); +echo '
'; + +echo '
'; +echo elgg_view('input/tags', array('name' => 'tags[]')); +echo '
'; + +echo elgg_view('input/hidden', array('name' => 'guid[]', 'value' => $image->getGUID())); +echo '
'; + +echo ''; diff --git a/views/default/object/album/full.php b/views/default/object/album/full.php index 7484a48f3..4d2d8c88b 100644 --- a/views/default/object/album/full.php +++ b/views/default/object/album/full.php @@ -41,7 +41,10 @@ $params = array( $params = $params + $vars; $summary = elgg_view('object/elements/summary', $params); -$body = elgg_list_entities(array( +$body = elgg_view('output/longtext', array( + 'value' => $album->description, +)); +$body .= elgg_list_entities(array( 'type' => 'object', 'subtype' => 'image', 'container_guid' => $album->getGUID(), diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php deleted file mode 100644 index aba6fd324..000000000 --- a/views/default/tidypics/forms/edit_multi.php +++ /dev/null @@ -1,59 +0,0 @@ -container_guid); - -?> -
-
-getCoverImageGuid()) { - $no_cover = true; - } - - foreach ($images as $key => $image) { - $guid = $image->guid; - $body = $image->description; - $title = $image->title; - $tags = $image->tags; - - // first one is default cover if there isn't one already - if ($no_cover) { - $val = $guid; - $no_cover = false; - } - - echo '
'; - echo '' . $title . ''; - echo '
'; - echo '

'; - echo elgg_view("input/text", array("internalname" => "title[$key]", "value" => $title,)) . "\n"; - echo '

'; - echo '

"; - echo elgg_view("input/longtext",array("internalname" => "caption[$key]", "value" => $body, "class" => 'tidypics_caption_input',)) . "\n"; - echo "

"; - echo '

\n"; - echo elgg_view("input/tags", array( "internalname" => "tags[$key]","value" => $tags)) . "\n"; - echo '

'; - echo '' . "\n"; - echo elgg_view('input/securitytoken'); - - echo elgg_view("input/radio", array("internalname" => "cover", - "value" => $val, - 'options' => array( elgg_echo('album:cover') => $guid, - ), - )); - echo '
'; - echo '
'; - } - -?> - -

-
-
\ No newline at end of file -- cgit v1.2.3