|
|
| version 1.211, 2001/06/29 08:35:26 | version 1.347, 2001/10/02 07:48:37 |
|---|---|
| Line 1 | Line 1 |
| @auto[] | @auto[] |
| $form_id[19] | |
| $branch_id[] | |
| @main[] | @main[] |
| $SQL.connect-string[mysql://intranet:pwd@moko/intranet/cp1251_koi8] | $response:content-type[$.value[text/html] $.charset[windows-1251]] |
| ^connect[$SQL.connect-string]{ | #^regexp[]<hr> |
| ^content[] | #^mail[] |
| } | #^exec[] |
| #^fori[] | |
| #^connect[mysql://hren]{^void:sql{nothing}} | |
| ^xslt[] | |
| OK | |
| @heading[] | @regexp[] |
| ^if(def $form_id){Изменение}{Добавление} документа | $s[abcАБВ] |
| ^if(^s.match[б][i]){y}{n} | |
| @help[] | @mail[] |
| article_help.html | #$ORIGINS(1) |
| ^mail:send[ | |
| $.from[paf@design.ru] | |
| $.to[paf@design.ru] | |
| $.body[1 | |
| 2 | |
| 3] | |
| ] | |
| @content[] | @exec[] |
| $branches[^table:sql{select id, name from kb_branches}] | $a[^file::exec[fc.exe;a;b]] |
| ^if(def $form_id){ | $a.status|$a.stderr<hr> |
| $article[^table:sql{select id, name, txt, keywords, kb_branches_id from kb_documents where id='$form_id'}] | |
| $branch_id[$:article.kb_branches_id] | @fori[][i] |
| }{ | ^for[i](1;3){... =$i= ...} |
| $branch_id[$branch_id] | |
| } | @xslt[] |
| $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?> | |
| #<!DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"> | |
| <people> | |
| <man id="1"> | |
| <name>P«^;AFB</name> | |
| </man> | |
| <man id="2"> | |
| <name>ПИФ</name> | |
| </man> | |
| </people> | |
| }] | |
| ^show-xdoc2[$xdoc]<hr> | |
| #^show-xnode1[$xdoc]<hr> | |
| $people[^xdoc.select[*/man]] | |
| #^show1[] | |
| ^show-xnodes1[$people]<hr> | |
| #^people.0.owner.hren[] | |
| ^show-xnode1[^xdoc.select-single[*/man[2]/name];0;1]<hr> | |
| <form method=post action=article_save.html> | by id: |
| <p />Рубрика:<br> | ^show-xnode1[^xdoc.getElementById[1];0;1] |
| <select name="kb_branches_id" style="width:100%"> | <hr> |
| $branches{ | |
| ^menu{ | @show1[array] |
| <option value="$id" ^if($id eq $:branch_id){selected}>^if($id eq $:branch_id){•^;}{ ^;}$name</option> | ^for[i](0;^array._count[]-1){ |
| } | $x[$array.$i] |
| $x.firstChild.nodeValue: | |
| $pattributes[$x.parentNode.attributes] | |
| ^if(^pattributes._count[]){ | |
| $pattributes.id.name=$pattributes.id.nodeValue | |
| } | } |
| </select> | <br> |
| } | |
| <p />Название:<br> | |
| <input type=text name=name style="width:100%" value="$:article.name"> | |
| <p />Текст:<br> | |
| <textarea name=text style="width:100%" cols=80 rows=30>^untaint[html]{$:article.txt}</textarea> | |
| <p />Ключевые слова:<br> | |
| <input type=text name=keywords style="width:100%" value="$:article.keywords"> | |
| <input type=hidden name=id value="$form_id"> | |
| <p /> | @show-xnodes1[array][i] |
| <table cellspacing=0 cellpadding=0 border=0 width=100%> | ^for[i](0;^array._count[]-1){ |
| # <td>^submit[save]</td> | ^show-xnode1[$array.$i;0;1] |
| # ^if(def $form_id){<td align=right>^submit[delete]</td>} | } |
| </table> | |
| </form> | @show-xnode1[x;level;single][l] |
| ^if(def $x){ | |
| ^for[l](0;$level-1){ ^; ^; ^; ^;} | |
| ^if($x.nodeType == $xnode:ELEMENT_NODE){ | |
| <^;$x.nodeName | |
| $pairs[$x.attributes] | |
| ^if(def $pairs){ | |
| $names[^pairs._keys[]] | |
| ^names.menu{$names.key=$pairs.[$names.key].nodeValue } | |
| } | |
| >^; | |
| }{ | |
| [$x.nodeType] | |
| } | |
| ^if(def $x.nodeValue){$x.nodeValue}<br> | |
| ^show-xnode1[$x.firstChild]($level+1) | |
| ^if(!$single){ | |
| ^show-xnode1[$x.nextSibling]($level) | |
| } | |
| ^if($x.nodeType == $xnode:ELEMENT_NODE){ | |
| ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br> | |
| } | |
| } | |
| @show-xdoc2[xdoc] | |
| ^xdoc.save[save.xml; | |
| # $.encoding[windows-1251] | |
| $.method[xml] | |
| ] | |
| $file[^xdoc.file[ | |
| # $.encoding[windows-1251] | |
| $.method[html] | |
| ]] | |
| ^file.save[text;save_file.html] | |
| ^taint[^xdoc.string[]] | |
| # $.encoding[windows-1251] | |
| # $.method[xml] | |
| #]] |