PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/branches/jsrewrite/jfx-private/modules/vms/actions/new-version/eval-code.php

http://jfxcms.googlecode.com/
PHP | 122 lines | 50 code | 54 blank | 18 comment | 3 complexity | 6e92d4d03ad18c365341ab4910a4ca89 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. <?php
  2. ############### COPYLEFT GPLv3 LICENSE ###############
  3. ##
  4. ## JFX Version 0.2.7
  5. ## Website Management Software
  6. ## www.jfxcms.com
  7. ##
  8. ## Copyright 2009 GPLv3 - http://www.opensource.org/licenses/gpl-3.0.html
  9. ##
  10. ## Anthony Gallon
  11. ## oi_antz@hotmail.com
  12. ##
  13. ## Permission is hereby granted to any person having a copy of this software
  14. ## to freely use and modify as required so long as the copyright notices
  15. ## and branding remain intact.
  16. ##
  17. ## Full license details available at http://www.jfxcms.com/license
  18. ##
  19. ############### COPYLEFT GPLv3 LICENSE ###############
  20. if(get('reset')==4){
  21. if(Antz_IntelliForm::submitted('confirm-reset')){
  22. $pData[4] = array();
  23. JFX::redirect($this->adminUrl.'/new-version/');
  24. }
  25. $formFields = array(
  26. array(
  27. 'type' => 'submit',
  28. 'name' => 'submitBtn',
  29. 'label' => '&nbsp;',
  30. 'value' => 'Reset Eval Code'
  31. )
  32. );
  33. echo JFX::makeRapidForm($formFields, 'Confirm Reset', 'confirm-reset');
  34. return;
  35. }
  36. $prevVersion = $VM->getCurrentVersion($pData[1]['package_id']);
  37. if(Antz_IntelliForm::submitted('eval-code')){
  38. $newParams = array(
  39. 'previous_version' => $prevVersion,
  40. 'eval_code' => post('code')
  41. );
  42. $pData[4] = $newParams;
  43. JFX::redirect($this->adminUrl.'/new-version/');
  44. }
  45. $formFields = array(
  46. array(
  47. 'value' => $prevVersion,
  48. 'disabled' => true,
  49. 'type' => 'text',
  50. 'name' => 'version',
  51. 'label' => 'Previous version'
  52. ),
  53. array(
  54. 'type' => 'code',
  55. 'class' => 'php',
  56. 'id' => 'vmsevalcode',
  57. 'name' => 'code',
  58. 'label' => 'Code',
  59. 'value' => post('code', $pData[4]['eval_code'])
  60. ),
  61. array(
  62. 'type' => 'submit',
  63. 'name' => 'submitBtn',
  64. 'label' => '&nbsp;',
  65. 'value' => 'Save'
  66. )
  67. );
  68. echo JFX::makeRapidForm($formFields, 'Upgrade Evaluation Code', 'eval-code');