aboutsummaryrefslogtreecommitdiff
path: root/lib/tidypics.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-19 18:43:35 -0500
committercash <cash.costello@gmail.com>2011-11-19 18:43:35 -0500
commit98664daa72a390fe760b69116af8bfa9327826e3 (patch)
tree0c28594625cd810dcb2c22fc736191071c55b7fa /lib/tidypics.php
parent4562cfbb1a630b14fd194271f99f1f8c098dc38d (diff)
downloadelgg-98664daa72a390fe760b69116af8bfa9327826e3.tar.gz
elgg-98664daa72a390fe760b69116af8bfa9327826e3.tar.bz2
album creation and editing is working
Diffstat (limited to 'lib/tidypics.php')
-rw-r--r--lib/tidypics.php31
1 files changed, 31 insertions, 0 deletions
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;
+}
/*********************************************************************