From bf9291c23b5fe587e2226bf73c317bf76ea686a6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 20 Jun 2009 16:05:56 +0000 Subject: now using built-in radio input view --- views/default/input/multi_radio.php | 36 ------------------- views/default/tidypics/forms/edit_multi.php | 55 +++++++++++++++++------------ 2 files changed, 33 insertions(+), 58 deletions(-) delete mode 100644 views/default/input/multi_radio.php (limited to 'views') diff --git a/views/default/input/multi_radio.php b/views/default/input/multi_radio.php deleted file mode 100644 index 3e3bb1649..000000000 --- a/views/default/input/multi_radio.php +++ /dev/null @@ -1,36 +0,0 @@ - $option) { - - if ($vars['set'] != $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_multi.php b/views/default/tidypics/forms/edit_multi.php index 24755e9cf..01ffb3128 100644 --- a/views/default/tidypics/forms/edit_multi.php +++ b/views/default/tidypics/forms/edit_multi.php @@ -8,38 +8,49 @@ cover) $no_cover = true; + if (!$album_entity->cover) $no_cover = true; - foreach($file_array as $key => $file_guid){ + foreach ($file_array as $key => $file_guid){ $entity = get_entity($file_guid); $guid = $entity->guid; $body = $entity->description; $tags = $entity->tags; $container_guid = $entity->container_guid; - if($no_cover && !$cover) $cover = $guid; - - echo '
'; - echo '' . $title . ''; - echo '
'; - echo '

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

'; - echo '

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

"; - echo '

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

'; - echo '' . "\n"; - echo ''; - echo elgg_view("input/multi_radio", array( "internalname" => "cover", "value" => $guid, 'options' => array(elgg_echo('album:cover:yes')), 'set' => $cover)); - echo '
'; - echo '
'; + // 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/text",array("internalname" => "caption[$key]", "value" => $body,)) . "\n"; + echo "

"; + echo '

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

'; + echo '' . "\n"; + + 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