Commits

sembrestels  committed 620e9de

Fixing some bugs from last commit

  • Participants
  • Parent commits e9fd2b8

Comments (0)

Files changed (5)

File languages/en.php

 		"geomapping:nolocation" => "No map location",
 		"geomapping:title:missing" => "Remember to give a title to location!",
 		"geomapping:coords:missing" => "Click on map to select a location!",
+		"geomapping:access" => "Who can know about this location?",
 
 	);
 					

File views/default/forms/editmapfeature.php

 	$internalname = $vars['internalname'];
 	$body .= '<label>'.elgg_echo('title');
 	$body .= elgg_view('input/text',array('internalname'=>$internalname.'_title')).'</label>';
-	$body .= '<label class="right_column">'.elgg_echo('description');
-	$body .= elgg_view('input/longtext',array('internalname'=>$internalname.'_desc')).'</label>';
-	$body .= '<label class="right_column">'.elgg_echo('tags');
+	$body .= '<div class="right_column">';
+	$body .= '<label>'.elgg_echo('description');
+	$body .= elgg_view('input/plaintext',array('internalname'=>$internalname.'_desc')).'</label>';
+	$body .= '<label>'.elgg_echo('tags');
 	$body .= elgg_view('input/text',array('internalname'=>$internalname.'_tags')).'</label>';
+	$body .= '</div>';
 	$body .= '<label>'.elgg_echo('geomapping:coords').'</label>';
-	$body .= elgg_view('input/geomap',array('internalname'=>$internalname.'_coords'));
+	$body .= elgg_view('input/geomap',array('internalname'=>$internalname.'_coords','width'=>"54%"));
+	$body .= '<label>'.elgg_echo('geomapping:access');
+	$body .= elgg_view('input/access').'</label><br />';
 	$body .= elgg_view('input/button',
-		array('internalname'=>$internalname.'_button','value'=>elgg_echo('ok')));
+		array('type'=>'button', 'internalname'=>$internalname.'_button', 'value'=>elgg_echo('ok')));
 	echo $body;
 ?>

File views/default/geomapping/css.php

 }
 
 div.newlocation .right_column{
-	width: 50%;
+	width: 43%;
 	float: right;
-	margin-right: 20px;
+	margin-right: 10px;
 }

File views/default/input/geomap.php

 	elseif ($container_entity && $container_entity->zoom)
 		$zoom = $container_entity->zoom;
 
+	if(empty($vars['width'])){
+		$width = 400;
+	}
+	else{
+		$width = $vars['width'];
+	}
+
+	if(empty($vars['height'])){
+		$height = 300;
+	}
+	else{
+		$height = $vars['height'];
+	}
+
         echo elgg_view('geomapping/map', array(
                 'classname' => $classname,
                 'entity' => $entity,
                 'map_type' => 'input',
                 'lon' => $lon,
                 'lat' => $lat,
-		'width' => 400,
-		'height' => 300,
+		'width' => $width,
+		'height' => $height,
                 'zoom' => $zoom,
         ));
 	echo "<p><input type=\"text\" active=\"false\" readonly=\"readonly\" class=\"input-text\" value=\"$location\" name=\"".$vars['internalname']."\"/>";

File views/default/input/location.php

 		$("[name='"+n+"']").change(function(){
 			if(this.value==-1){
 				$('#'+n+'_newlocation').slideDown("slow");
+				location = '#'+ n +'_anchor';
 				$('[name="'+n+'_newmapfeature_title"]').focus();
 			}
 			else{
 				alert("<?php echo elgg_echo('geomapping:coords:missing'); ?>");
 			}
 			else{
-				$('option[value="-1"]').text(
-					"<?php echo elgg_echo('geomapping:newlocation:edit'); ?>");
-				if($('option[value="-2"]').length==0){
+				var newlocation_edit = "<?php
+					echo elgg_echo('geomapping:newlocation:edit'); ?>";
+				$('select[name='+n+'] option[value="-1"]').text(newlocation_edit);
+				$('#'+n+'_newlocation fieldset legend').text(newlocation_edit);
+				if($('select[name='+n+']option[value="-2"]').length==0){
 					$('<option value="-2">'+title+'</option>')
 						.insertBefore($('option[value="-1"]'))
 						.attr('selected','selected');
 						.attr('selected','selected');
 				}
 				$('#'+n+'_newlocation').slideUp("slow");
-				location = "#";
 			}
 		});
 	});
 	return strcmp($a->title, $b->title);
 }
 
-if ($map)
+if ($map) {
 	$locations = elgg_get_entities(array('type' => 'object', 'subtype' => 'mapfeature', 'container_guid'=>$map->guid, 'limit'=>300));
+}
 
-
-$body .= '<select name="'.$internalname.'">';
+$body .= '<a name="'.$internalname.'_anchor"></a><select name="'.$internalname.'">';
 $body .= '<option value="0">'.elgg_echo("geomapping:nolocation").'</option>';
 
-if (empty($map) || empty($locations)) {
-	$body = '';
-}
-else {
+if (!empty($map) && !empty($locations)) {
 	usort($locations, 'sort_locations');
 	foreach($locations as $location) {
 		if ($location->guid == $value)