From c118d77f0625fa70fe3cdadb23bcbeea96a0768c Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 20 Jun 2009 15:09:01 +0000 Subject: using built-in elgg checkbox view rather than custom --- actions/edit.php | 4 +++- views/default/input/cover_checkbox.php | 39 ---------------------------------- views/default/tidypics/forms/edit.php | 23 ++++++++++++-------- 3 files changed, 17 insertions(+), 49 deletions(-) delete mode 100644 views/default/input/cover_checkbox.php diff --git a/actions/edit.php b/actions/edit.php index 359e83fb0..f5c66a1d8 100644 --- a/actions/edit.php +++ b/actions/edit.php @@ -15,6 +15,8 @@ $access = get_input('access_id'); $tags = get_input('tidypicstags'); $subtype = get_input('subtype'); + $cover = get_input('cover'); + if (is_array($cover)) $cover = $cover[0]; $container_guid = get_input('container_guid'); @@ -59,7 +61,7 @@ } //if cover meta is sent from image save as metadata - if ($subtype == 'image' && get_input('cover') == elgg_echo('album:cover:yes')) { + if ($subtype == 'image' && $cover == elgg_echo('album:cover')) { $album = get_entity($container_guid); $album->cover = $entity->guid; } diff --git a/views/default/input/cover_checkbox.php b/views/default/input/cover_checkbox.php deleted file mode 100644 index 04132661d..000000000 --- a/views/default/input/cover_checkbox.php +++ /dev/null @@ -1,39 +0,0 @@ - $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 "
"; - } - -?> \ No newline at end of file diff --git a/views/default/tidypics/forms/edit.php b/views/default/tidypics/forms/edit.php index 533852413..a504cde60 100644 --- a/views/default/tidypics/forms/edit.php +++ b/views/default/tidypics/forms/edit.php @@ -72,21 +72,26 @@ guid; $container_guid = $vars['entity']->container_guid; - $cover_guid = get_entity($container_guid)->cover; - if($cover_guid == $vars['entity']->guid) - $cover = 'yes'; + + // should this image be the cover for the album - only ask for non-cover photos + // determine if it is already the cover + $img_guid = $vars['entity']->guid; + $album = get_entity($container_guid); + $cover_guid = $album->cover; + + if ($cover_guid != $img_guid) { ?>

- - "cover", "value" => $cover, 'options' => array(elgg_echo('album:cover:yes')))); ?> + "cover", + 'options' => array(elgg_echo("album:cover")), + )); +?>

-- cgit v1.2.3