Changeset 16711 for lang/actionscript
- Timestamp:
- 07/27/08 18:21:58 (4 months ago)
- Location:
- lang/actionscript/todoshare
- Files:
-
- 3 added
- 3 modified
-
index.cgi (modified) (2 diffs)
-
js/jsonScr.js (added)
-
jsonDB.html (modified) (1 diff)
-
perl/Obj.pm (modified) (2 diffs)
-
test/scriptTest.html (added)
-
test/tagTest.html (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/todoshare/index.cgi
r16697 r16711 10 10 use Tmpl; 11 11 use Obj; 12 use JSON2; 12 13 header; 13 14 my $id=$ENV{"QUERY_STRING"}; … … 44 45 sub disp { 45 46 &Tmpl::page({title=>$id},[span, 46 [ h2,"Infomation about$id"],47 [table ,sub {47 [strong,img(src=>"img/obj.png"),"$id"], 48 [table(id=>$id),sub { 48 49 my $p=shift; 49 50 my $res=&Obj::exe(["FINDREL",$id,any,any]); 50 51 for (@$res) { 51 $p->p([&tr, 52 my $action=["PROGN", 53 ["DELREL", $_->{obj},$_->{name},$_->{val}], 54 ["RMELEM", $_->{t} ] 55 ]; 56 $p->p([&tr(id=>$_->{t}), 52 57 [td,$_->{name}] , 53 [td,&Tmpl::link2obj($_->{val})] 58 [td,&Tmpl::link2obj($_->{val})], 59 [td, 60 [button(id=>, 61 onClick=>qq(alert(this.id)) 62 ) ,"Forget"] 63 ] 54 64 ]); 55 65 } -
lang/actionscript/todoshare/jsonDB.html
r16259 r16711 39 39 <BR> 40 40 <textarea rows=10 cols=40 name=cmd> 41 ["DELREL","obj://gorira","type","animal"] 41 42 ["GET",{ "from":"relation", 42 43 "where": {"obj":"obj://gorira"}} -
lang/actionscript/todoshare/perl/Obj.pm
r16697 r16711 91 91 $sth->finish; 92 92 return array($res); 93 } elsif ($cmd->[0] eq "DELETE") { 94 # ["DELETE",$from ,$where] 95 my $from = $cmd->[1]; 96 my $where=&where($cmd->[2]); 97 my $query=qq(delete from ).&escapeSymbol($from)." $where"; 93 98 99 my $sth=$db->prepare($query); 100 my $res=$sth->execute; 101 &log($cmd,$query); 102 if ($res) { 103 $res=["OK",$query]; 104 } else { 105 die ($query."- ".$sth->errstr); 106 } 107 $sth->finish; 108 return array($res); 109 94 110 } elsif ($cmd->[0] eq 'POST' or $cmd->[0] eq 'PUT' ) { 95 111 my $data=$cmd->[1]; … … 330 346 role=> &Session::getRole 331 347 }]); 348 } elsif ($cmd->[0] eq 'DELREL') { 349 # ["DELREL" , obj, name, val] 350 my $where={}; 351 $where->{obj} = $cmd->[1]; 352 $where->{name}= $cmd->[2]; 353 $where->{val} = $cmd->[3]; 354 $where->{role}=&Session::getRole; 355 return &exe(["DELETE",$relName,$where]); 332 356 } elsif ($cmd->[0] eq 'FINDREL') { 333 357 # ["FINDREL", obj , name ]
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)