From 92ec25ec441330323e4fcbdfa33ebcf900420097 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 31 Oct 2010 12:47:25 +0000 Subject: integrated Jeff's batch code into trunk --- views/default/river/object/image/create.php | 2 +- .../default/river/object/tidypics_batch/create.php | 51 ++++++++++++++++++++++ views/default/tidypics/forms/ajax_upload.php | 3 +- views/default/tidypics/forms/settings.php | 6 +-- 4 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 views/default/river/object/tidypics_batch/create.php (limited to 'views') diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php index 8a0a8deff..9de043e91 100644 --- a/views/default/river/object/image/create.php +++ b/views/default/river/object/image/create.php @@ -5,7 +5,7 @@ $image = get_entity($vars['item']->object_guid); if ($image->title) { $title = $image->title; } else { - $title = "untitled"; + $title = elgg_echo("untitled"); } $url = "getURL()}\">{$performed_by->name}"; diff --git a/views/default/river/object/tidypics_batch/create.php b/views/default/river/object/tidypics_batch/create.php new file mode 100644 index 000000000..e7a4d1409 --- /dev/null +++ b/views/default/river/object/tidypics_batch/create.php @@ -0,0 +1,51 @@ +subject_guid); +$batch = get_entity($vars['item']->object_guid); +$album = get_entity($batch->container_guid); + +if (!$batch || !$album) { + return true; +} + +// Get images related to this batch +$images = elgg_get_entities_from_relationship(array( + 'relationship' => 'belongs_to_batch', + 'relationship_guid' => $batch->getGUID(), + 'inverse_relationship' => true, + 'types' => array('object'), + 'subtypes' => array('image'), + 'offset' => 0, + )); + +// nothing to show +if (!$images) { + return true; +} + +$user_link = "getURL()}\">{$performed_by->name}"; +$album_link = "" . $album->title . ""; +if (count($images) > 1) { + $image_text = elgg_echo("image:river:created:multiple"); + $string = sprintf($image_text, $user_link, count($images), $album_link); +} else { + $image_text = elgg_echo("image:river:created"); + $title = $images[0]->title; + if (!$title) { + $title = elgg_echo("untitled"); + } + $image_link = "getURL() . "\">" . $title . ""; + $string = sprintf($image_text, $user_link, $image_link, $album_link); +} + +$string .= "
"; + +if (count($images)) { + foreach($images as $image) { + $string .= "getURL() . "\"> wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> '; + } +} + +$string .= "
"; + +echo $string; diff --git a/views/default/tidypics/forms/ajax_upload.php b/views/default/tidypics/forms/ajax_upload.php index c703d293b..c81c9173d 100644 --- a/views/default/tidypics/forms/ajax_upload.php +++ b/views/default/tidypics/forms/ajax_upload.php @@ -112,7 +112,8 @@ $("#uploadify").uploadify({ { album_guid : 'guid; ?>', __elgg_token : '', - __elgg_ts : '' + __elgg_ts : '', + batch : '' } ); }, diff --git a/views/default/tidypics/forms/settings.php b/views/default/tidypics/forms/settings.php index dc5c02f15..c8a1b4bd9 100644 --- a/views/default/tidypics/forms/settings.php +++ b/views/default/tidypics/forms/settings.php @@ -93,7 +93,7 @@ $form_body .= elgg_view('input/pulldown', array( )); $form_body .= '
Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.

'; -if (is_callable('exec') && !in_array('exec',$disablefunc)) { +if (is_callable('exec') && !in_array('exec', $disablefunc)) { // Image Magick Path $im_path = $plugin->im_path; if(!$im_path) { @@ -108,14 +108,14 @@ if (is_callable('exec') && !in_array('exec',$disablefunc)) { $form_body .= '

' . elgg_echo('tidypics:settings:heading:river') . '

'; $img_river_view = $plugin->img_river_view; if (!$img_river_view) { - $img_river_view = '1'; + $img_river_view = 'batch'; } $form_body .= '

' . elgg_echo('tidypics:settings:img_river_view'); $form_body .= elgg_view('input/pulldown', array( 'internalname' => 'params[img_river_view]', 'options_values' => array( 'all' => 'all', - '1' => '1', + 'batch' => '1', 'none' => 'none', ), 'value' => $img_river_view -- cgit v1.2.3