From 98664daa72a390fe760b69116af8bfa9327826e3 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Nov 2011 18:43:35 -0500 Subject: album creation and editing is working --- lib/tidypics.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'lib') diff --git a/lib/tidypics.php b/lib/tidypics.php index 8fcfc22c9..7eedb246d 100644 --- a/lib/tidypics.php +++ b/lib/tidypics.php @@ -59,6 +59,37 @@ function tp_get_img_dir() { return $file->getFilenameOnFilestore() . 'image/'; } +function tidypics_prepare_form_vars($entity = null) { + // input names => defaults + $values = array( + 'title' => '', + 'description' => '', + 'access_id' => ACCESS_DEFAULT, + 'tags' => '', + 'container_guid' => elgg_get_page_owner_guid(), + 'guid' => null, + 'entity' => $entity, + ); + + if ($entity) { + foreach (array_keys($values) as $field) { + if (isset($entity->$field)) { + $values[$field] = $entity->$field; + } + } + } + + if (elgg_is_sticky_form('tidypics')) { + $sticky_values = elgg_get_sticky_values('tidypics'); + foreach ($sticky_values as $key => $value) { + $values[$key] = $value; + } + } + + elgg_clear_sticky_form('tidypics'); + + return $values; +} /********************************************************************* -- cgit v1.2.3