function wm_editor_sanitize_selected($str)
{
    $res = urldecode($str);
    if (!preg_match("/^(LINK|NODE):/", $res)) {
        return "";
    }
    return wm_editor_sanitize_name($res);
}
Exemplo n.º 2
0
				    {
					    unset($map->links[$link->name]);
				    }
			    }
		    }           
    
		    unset($map->nodes[$target]);
    
		    $map->WriteConfig($mapfile);
		}
		break;

	case "clone_node":
		$map->ReadConfig($mapfile);

		$target = wm_editor_sanitize_name($_REQUEST['param']);
		if(isset($map->nodes[$target])) {
		    $log = "clone node ".$target;
    
		    $newnodename = $target;
		    do
		    {
			    $newnodename = $newnodename."_copy";
		    } while(isset($map->nodes[$newnodename]));
		    
		    $node = new WeatherMapNode;
		    $node->Reset($map);
		    $node->CopyFrom($map->nodes[$target]);
    
		    $node->name = $newnodename;
		    $node->x += 30;