Запись [f:_dev/_cb_edit.php] < dev.sky.1.001
Версия 1.000
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 | <?php defined('START') and AUTH_OK or die; $useds = ['---', 'used', 'not used']; $edit = is_numeric($PVAL); $block = $u_profile_code && $u_profile_code < 4 ? '' : 'none'; function checkbox($p) { global $targets, $wona; return sprintf('%s type="checkbox"', $p > -1 ? ($targets[$p] ? ' checked' : '') : ($wona[-$p - 1] ? ' checked' : '')); } $sql = "~select left(p.status,2)='00' or c.package_id=0 as x, p.name as pname, c.* from _dev_codebase c left join _dev_packages p on (p.id = c.package_id) where c.id=$PVAL"; extract($edit ? sql($sql) : ['x' => 1, 'pname' => 0] + get_columns2('_dev_codebase', 3), EXTR_PREFIX_ALL, 'r'); list ($tabs, $vo_me, $vo_all, $targets, $status, $wona) = explode(' ', $r_status, 6); $d = ''; echo str_replace('%TITLE%', "Edit CBR - $TITLE", $start_html); ?> <form method="post" action="?cb_show=<?=$PVAL?>" id="f1"> <u><b>CODEBASE</b></u> explorer (EDIT - <span style="color:red"><?=$r_name?></span> - ID=<?=$r_id?>) <?php if ($r_x): $where = $u_profile_code == 1 ? '' : "where left(status,2)='00'"; $options = "select id, name from _dev_packages $where order by id"; ?> <?=pad()?>Package: <select id="pack" name="pack"<?=$d?>><option value="0">--not defined--<?=option($r_package_id, $options)?></select> <?php else: echo $r_pname ? "Package: <b>$r_pname</b>" : "--don't connected to Package--"; endif ?> <br><small><b><?=$r_comment?></b></small> <hr> </div><!-- fixed --> <div id="utbl"> <div id="mtop" style="display:none"></div> <?if(!$edit):?><div style="display:<?=$block?>">special ID: <input name="id" value="null" /></div><?endif?> name: <input name="name" value="<?=$r_name?>" /> <?=pad()?>comment: <input name="comment" value="<?=$r_comment?>" style="width:300px" /> <?=pad()?>rubric: <select name="rubric"><?=option($r_rubric_id, $dev_rubrics)?></select> <br> <?=pad()?>used: <?=yn($r_used)?> <?=pad()?>version: <?=$r_version?> <?=pad()?>last saved: <small><?=$r_dt_upd?></small> <?=pad().strlen($r_code)?> bytes <br> <?=pad()?>Code targets: <label><input name="t0"<?=checkbox(0)?>> localtask</label> <label><input name="t1"<?=checkbox(1)?>> optimized</label> <label><input name="t2"<?=checkbox(2)?>> idea</label> <label><input name="t3"<?=checkbox(3)?>> coresky</label> <label><input name="t4"<?=checkbox(4)?>> mystar</label><br> <?=pad()?>Code status: <select name="stat"><?=option($status, $code_statuses)?></select> <?=pad(10)?><label><input name="s0"<?=checkbox(-1)?>> waiting_votes</label> <?=pad(10)?><label><input name="s1"<?=checkbox(-2)?>> opened for new authors</label> <p> <textarea name="code" class="code" wrap=off><?=html(str_replace("\t", ' ', $r_code))?></textarea> <input type="hidden" name="childs" value="<?=$r_childs?>" /> <input type="hidden" name="parents" value="<?=$r_parents?>" /> <input type="hidden" name="votes" value="<?="$vo_me $vo_all"?>" /> <input type="hidden" name="author" value="<?=$r_author?>" /> <input type="hidden" name="referer" value="<?=REFERER?>" /> <input type="hidden" name="was_pack" value="<?=$r_package_id?>" /> <br> <div class="fr" style="margin-right:30px"> <!-- label>check PHP syntax <input name="php" type="checkbox"></label--><?=pad()?> <label>replace spaces with tabs <input name="tabs" type="checkbox"<?=$tabs?' checked':''?>></label> </div> <input type="submit" value="Save - F2" /><?=pad()?> <?if($edit):?><input type="button" onclick="key_Esc()" value="Show Record - Esc" /><?endif?> <input type="button" onclick="document.location.href='?cb_list'" value="List Records" /> </form> </div><!-- utbl --> <style type="text/css"> .code {width:98%;overflow: auto} #pack {font-size:10px} </style> <script type="text/javascript"> var f1 = $('f1'); function key_F2() { f1.submit(); } function key_Esc() { document.location.href='?<?php echo $edit ? "cb_show=$PVAL" : 'cb_list' ?>'; } function adjust(x, y) { f1.code.$({height: y - 250}) } f1.code.focus(); <?if($WHAT == 'cok'): ?>mtop('Clone record successfully created and opened for editing.', green);<?endif?> <?if(!$d_snapshot && $PVAL < 10000) echo sql("+select concat('auto_store(',ifnull(max(imemo)+1,1),')') from _dev_memory where id>1000")?> </script> |