<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content=text/html;charset=ISO-8859-7>
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><FONT size=2>mmm, the plugin was not designed to deal with
predefined/constant values.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>you need to extend the edit plugin and add something like this
at the end of the filterPostRequest function :</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> // look in $request
for any new feaures and insert the timestamp, var1, var2,
sessionid<BR> $r =
$request->getRequest();<BR> $nf =
array();<BR> foreach ($r as $key =>
$value) {<BR>
if (strpos($key, 'edit_feature_') !== false)
{<BR>
if (array_key_exists('operation', $value) && $value['operation'] ==
'insert')
{
<BR>
$value['timestamp'] =
date('Y-m-d');<BR>
$value['var1'] = 'default value for
var1';<BR>
$value['var2'] = 'default value for
var2';<BR>
$value['sessionid'] =
$r['PHPSESSID'];<BR>
$nf[$key] =
$value;<BR>
}<BR>
}<BR>
}<BR> // insert modified feature back
into $request<BR> foreach ($nf as $key
=> $value)
{<BR>
$request->setValue($key,
$value);<BR> }</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>see <A
href="http://www.cartoweb.org/doc/cw3.5/xhtml/dev.newplugin.html#dev.newplugin.adapting.extending">http://www.cartoweb.org/doc/cw3.5/xhtml/dev.newplugin.html#dev.newplugin.adapting.extending</A></FONT></DIV>
<DIV><FONT size=2>there are multiple example in the mailinglist archive about
extending plugins</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=nipapada@gmail.com href="mailto:nipapada@gmail.com">Nikos
Papadakis</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A
title=cartoweb-users@lists.maptools.org
href="mailto:cartoweb-users@lists.maptools.org">cartoweb-users@lists.maptools.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, September 25, 2008 4:38
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Cartoweb-users] Edit
plugin.</DIV>
<DIV><BR></DIV>O/H Oliver Christen έγραψε:
<BLOCKQUOTE cite=mid:5FEE0D1256674A91B17188E7D0C4D4EA@maunakea type="cite">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR>
<STYLE></STYLE>
<DIV>
<DIV><FONT size=2>please remove</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>{if $edit_allowed|default:''}<div
id="edit_div"<BR>
style="display:none"></div>{/if}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>from your template header section, it has absolutly
nothing to do there</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>that should go usualy in the body section, where you want
to see the selected elements array appear.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV></DIV></BLOCKQUOTE><BR>Thank you.<BR>I
placed the above statement where i should and now the plugin works!<BR>But now
i have a problem using the tools.<BR>I can select and edit all points that
alreadt exhist in the database!<BR>The problem i have is with points that
create myself.<BR>I can create them but when i move or delete them i get the
following error message.<BR><BR><PRE>Error [2, array_key_exists() [<A href="http://localhost/cartoweb3/htdocs/function.array-key-exists">function.array-key-exists</A>]: The first argument should be either a string or an integer, C:\ms4w\apps\cartoweb3\projects\mytest\plugins\edit\client\ClientEdit.php, 245]
With the configuration i have,each entry in the database has 7 columns wich are:
gid (integer),v_poi (integer),v_poi_point (integer),city (string),city_lat (string),label(string),the_geom(geometry).
The v_poi field has the same values with the gid field.
The v_poi_point field is always 0 (Strange shapefile source!!!)
In my map file i have choosen to edit only the attributes city,city_lat and label.
I guess that the problem with the points i create is that when they are written in the postgis database
their entries have the field gid filled,the other two fields (v_poi,v_poi_point) are not filled!
If i am right how can i fill them automatically with the proper values.(That is,v_poi equal to gid and v_poi_point=0).
Thank you very much!
</PRE><BR>
<P>
<HR>
<P></P>_______________________________________________<BR>Cartoweb-users
mailing
list<BR>Cartoweb-users@lists.maptools.org<BR>http://lists.maptools.org/mailman/listinfo/cartoweb-users<BR></BLOCKQUOTE></BODY></HTML>