Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
Никита Козин 12.11.2004 12:05
<html> <head> <title>Tinklapio administravimas</title> <link rel="stylesheet" type="text/css" href="/template/site.css"> </head> <body> <div id="adminmenu"> $sout[^table::load[/admin/submenu/submenu.cfg]] ^sout.menu{ <a class="sub_menu" href="$sout.url">$sout.name</a> }{::} </div> <div id="adminmain"> <script language="JavaScript"> function check() { if(document.in.value==''){alert('Iveskit tekstus')} } </script> $request:charset[windows-1257] ^if(-f "/menu/menu.cfg"){$menu[^table::load[/menu/menu.cfg]]}{$menu[^table::create{id name dep url key value view mname mbody mview finsec}] $menu[^menu.select($menu.view eq yes)]} ^use[/common/optxt.p] ^use[/common/divtables.p] $alert[Nera jokio tekstus sitemoje] ^if(-f "/txt/list.cfg"){$txtlist[^table::load[/txt/list.cfg]]}{$txtlist[^table::create{id fullname}]} ^if(def $txtlist && ^txtlist.count[] > 0){ <form method=POST> <table class="table_prod"> <thead class="table_prod_head"> <tr> <td class="table_prod_cell">Pasirinkti</td> <td class="table_prod_cell">Teksto pavadinimai</td> <td class="table_prod_cell">Meniu pozicija</td> </tr> </thead> <tbody class="table_prod_body"> ^txtlist.menu{ $tx[^txtlist.line[]] <tr onMouseOver="this.style.background='CaptionText'" onMouseOut="this.style.background='InactiveCaptionText'" style="cursor:pointer"> $mtxt[^menu.select($menu.key eq txt && $menu.value eq $txtlist.id)] <td class="table_prod_cell"><input id="table_$tx" type="checkbox" value="$txtlist.id" name="selected"></td> <td class="table_prod_cell"><label id="table_$tx">$txtlist.fullname</label></td> <td class="table_prod_cell">^if(^mtxt.count[]>0){$mtxt.name}{nera}</td> </tr> } </tbody> <tfoot class="table_prod_head"><tr style="cursor: pointer"> <td class="table_prod_cell" colspan=2><label for="form_del">Pazimetas tekstas</label></td> <td class="table_prod_cell"><input id="form_del" type="submit" value="Trinti" name="delete"> <input id="form_cancel" type="reset" value="clear" name="clr"></td> </tr></tfoot> </table> </form> ^if(def $form:delete && $form:tables.selected is table){ $rw[$form:tables.selected] ^rw.menu{$txtlist[^txtlist.select($txtlist.id ne $rw.field)] ^if(-f "/txt/$rw.field/text.tbl"){^file:delete[/txt/$rw.field/text.tbl]} $list[^file:list[/txt/$rw.field/photo/;\.jpg^$]] ^list.menu{^if(-f "/txt/$rw.field/photo/$list.name"){^file:delete[/txt/$rw.field/photo/$list.name]}} } ^txtlist.save[/txt/list.cfg] $response:location[/admin/text.html] } }{$alert} <form method=POST name="one"> <fieldset> <legend>Naujas tekstas</legend> <table> <tr> <td><label id="id_fullname">Teksto pavadinimas</label></td> <td><input id="id_fullname" type="text" value="$fullname" name="fullname"></td> </tr> </table> <label for="id_cont">Naujas tekstas</label><br> <textarea id="id_cont" rows="30" cols="64" style="overflow:visible" name="in" onChange="check()">$body</textarea><br> <input type="submit" value="ok" name="ok"> </fieldset> </form> ^if(def $form:ok && def $form:in && def $form:fullname){ $id[^math:random(999)] ^while(^txtlist.locate[id;$id]){$id[^math:random(999)]} $in[$form:in] $fullname[$form:fullname] $in[^in.match[\t][g]{ }] ^in.save[/txt/textin] $tbl[^table::load[nameless;/txt/textin]] ^file:delete[/txt/textin] $div[^math:random(999)] <form method=POST name="two"> <fieldset> <legend>Naujo teksto atributai</legend> <input type="hidden" name="id" value="$id"> <input type="hidden" name="fullname" value="$fullname"> <input type="hidden" name="div" value="$div"> <table> <thead> <tr> <td>Nr.</td> <td>Tekstas</td> <td>Teksto tipas</td> </tr> </thead> <tbody> ^tbl.menu{ $body[$tbl.0] $line[^tbl.line[]] $len(^body.length[]) $rows($len/50) <tr> <td>$line</td> <td><label id="id_txt_$line">$body</label> <input id="id_txt_$line" type="hidden" name="out" value="$line/$div/$body"> <fieldset> <legend>Nuortauka</legend> <input type="file" col="20" name="$line"> <label for="id_pos_$line">Pozicija</label> <select id="id_pos_$line" name="position"> ^if($rows>=4){<option value="$line/$div/nw">Kaire-virsuje</option> <option value="$line/$div/ne">Desine-virsuje</option>} ^if($rows>=10){ <option value="$line/$div/w">Kaire-vidurije</option> <option value="$line/$div/e">Desine-vidurije</option> } ^if($rows>=4){<option value="$line/$div/sw">Kaire-apacijoi</option> <option value="$line/$div/se">Desine-apacijoi</option>} <option value="$line/$div/bigd">Didelis apacijoi</option> <option value="$line/$div/bigu">Didelis virsui</option> </select> </fieldset> </td> <td> <select id="id_class_$line" name="class"> ^if($rows<=2){ <option value="$line/$div/header" name="class">Header</option> <option value="$line/$div/subheader" name="class">Subheader</option> <option value="$line/$div/sign" name="class">Signature</option> <option value="$line/$div/plain" name="class">Paprastas</option> <option value="$line/$div/exp" name="class">Šukis</option> }{ <option value="$line/$div/plain" name="class">Paprastas</option> <option value="$line/$div/anno" name="class">Anotacija</option> <option value="$line/$div/paragraph" name="class">Paragraph</option> } </select> </td> </tr> } </tbody> </table> <input type="submit" value="next" name="next"> </fieldset> </form> ^if(def $form:next){ $id[$form:id] $fullname[$form:fullname] $div[/$form:div/] $out[$form:tables.out] $position[$form:tables.position] $class[$form:tables.class] $position[^divtables[$position;$div]] $class[^divtables[$class;$div]] $mix[^divtables[$out;$div]] $chmix[^table::create{id value position class}] ^mix.menu{ $line[$mix.id] ^chmix.append{$mix.id $mix.value ^if(^position.locate[id;$mix.id]){$position.value} ^if(^class.locate[id;$mix.id]){$class.value}} $pic[$form:$line] ^if(def $pic){ ^pic.save[binary;/txt/$id/photo/${line}.jpg]} } $mix[$chmix] ^txtlist.append{$id $fullname} ^txtlist.save[/txt/list.cfg] ^mix.save[/txt/$id/text.tbl] $response:location[/admin/text.html] } } </div> </body> </html>