/neutrino atomic edition 08/ext/manage.php

http://neutrino-cms.googlecode.com/ · PHP · 48 lines · 48 code · 0 blank · 0 comment · 5 complexity · 3ae54d693055aa9c62cb7bda02c713a9 MD5 · raw file

  1. <?php
  2. if(@$_v['edit_ext']){
  3. nae_ext_save($_POST);
  4. redirect(generate_link('action=ext'));
  5. }
  6. elseif(@$_v['readme']&&($readme='ext/'.str_replace(array('.','/'),'',$_v['readme']).'/readme.txt')&&file_exists($readme)){
  7. $text=file_get_contents($readme);
  8. print '<center><h1>'.$readme.'</h1></center>';
  9. print '<h2><a href="'.generate_link('action=ext').'">&lt;-- ?????</a></h2>';
  10. print '<div style="border:1px solid black; padding:5px;">'.str_replace(array("\n",' '),array('<br />',' '),htmlspecialchars($text)).'</div>';
  11. print '<h2><a href="'.generate_link('action=ext').'">&lt;-- ?????</a></h2>';
  12. }
  13. else{
  14. $d = dir2array($_s['ext_dir']);
  15. sort($d);
  16. ?>
  17. <form action="<?php echo generate_link('action=ext')?>" method="post">
  18. <style type="text/css">table.ext td{border-bottom:1px solid black;}table.ext th{border-bottom:3px solid black;border-right:1px solid black;text-align:center}</style>
  19. <table class="ext" cellspacing="0" width="100%" border="0" cellpadding="5" align="center">
  20. <tr>
  21. <th width="20%"><?php echo $_l['name_version']?></th>
  22. <th width="10%"><?php echo $_l['status']?></th>
  23. <th width="*"><?php echo $_l['description']?></th>
  24. </tr>
  25. <?php
  26. foreach ($d as $entry) {
  27. if (is_dir($_s['ext_dir'].'/'.$entry)) {
  28. $ext_list[$entry]=@$ext_ini[$entry];
  29. if(file_exists('ext/'.$entry.'/'.$entry.'.ini.php')) $entry_ini=parse_ini_file('ext/'.$entry.'/'.$entry.'.ini.php');
  30. echo '<tr>'.
  31. '<td><p>'.(file_exists('ext/'.$entry.'/'.$entry.'.php')?'<a href="'.(@$ext_list[$entry]==1?generate_link('ext='.$entry):'javascript:alert(\'??? ???? ????? ??????? ?? ???????? ??????????, ??????? ????? ??? ?????????? ???????? ? ????????? ?????????\')').'">'.$entry.'</a>':$entry).' <i>'.@$entry_ini['version'].'</i></p>'.(file_exists('ext/'.$entry.'/readme.txt')?('<a href="'.generate_link('action=ext&readme='.$entry).'" style="color:green;">readme</a>'):'').'</td>'.//??? ??????????
  32. '<td><select name="'.$entry.'">'.//?????? - ???????\????????? ??????????
  33. '<option value="1"';
  34. if(@$ext_list[$entry]==1)echo ' selected="selected"';
  35. echo '>'.$_l['on'].'</option><option value="0"';
  36. if(@$ext_list[$entry]==0)echo ' selected="selected"';
  37. echo '>'.$_l['off'].'</option></select></td>';//????????? ? ??????????
  38. echo '<td>'. @$entry_ini['description'] .'</td></tr>';//????????
  39. }
  40. }
  41. ?>
  42. <tr><th colspan="3" style="text-align:left">
  43. <input type="submit" name="edit_ext" id="go" value="<?php echo $_l['c_submit']?>" /><input type="reset" id="cansel" value="<?php echo $_l['c_reset']?>" /></th></tr>
  44. </table>
  45. <p align="center"><strong>?????????:</strong> ?? ?????? ???????? ??????????, ?????????????? ??????? ?? ? ????? <i>/ext/</i> ?????? ?????. ????? ????, ?? ????? ????? ???????????? ?? ???? ????????.</p>
  46. </form>
  47. <?php
  48. }