SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/dbtools/module_builder_existing_upload.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2015 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 3 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16.  
  17.  
  18. use Sprout\Helpers\Form;
  19.  
  20.  
  21. if (!$temp_writeable) {
  22. echo "<ul class=\"messages\"><li class=\"error\">Temp dir not writeable :(</li></ul>\n";
  23. return;
  24. }
  25. ?>
  26.  
  27.  
  28. <p>This tool will create a module from an existing db_struct.xml file.</p>
  29.  
  30.  
  31. <form action="SITE/dbtools/moduleBuilderExistingUploadAction" method="post" enctype="multipart/form-data" class="white-box">
  32. <?php
  33. Form::nextFieldDetails('Upload db_struct.xml', true);
  34. echo Form::upload('file');
  35. ?>
  36.  
  37. <button type="submit" class="button icon-after icon-file_upload">Upload and process XML</button>
  38. </form>
  39.  
  40.  
  41. <form action="SITE/dbtools/moduleBuilderExistingUploadAction" method="post" class="white-box">
  42. <?php
  43. Form::nextFieldDetails('Use existing db_struct.xml', true);
  44. echo Form::dropdown('existing', [], $existing_files);
  45. ?>
  46.  
  47. <button type="submit" class="button icon-after icon-file_upload">Process XML</button>
  48. </form>
  49.  
  50.  
  51. <form action="SITE/dbtools/moduleBuilderExistingUploadAction" method="post" class="white-box">
  52. <?php
  53. Form::nextFieldDetails('Copy-n-paste XML content', true);
  54. echo Form::multiline('content', ['style' => 'font-family: monospace', 'rows' => 7]);
  55. ?>
  56.  
  57. <button type="submit" class="button icon-after icon-file_upload">Process XML</button>
  58. </form>
  59.