SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/admin/page_import_options.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. use Sprout\Helpers\Csrf;
  17. use Sprout\Helpers\Enc;
  18. use Sprout\Helpers\Form;
  19. use Sprout\Helpers\Needs;
  20.  
  21.  
  22. Form::setData(['import_type' => 'none']);
  23.  
  24. Needs::fileGroup('underscore');
  25. Needs::fileGroup('sprout/cms_page_import_options');
  26. ?>
  27.  
  28.  
  29.  
  30. <form action="SITE/admin/import_action/page" method="post" id="main-form">
  31. <?php echo Csrf::token(); ?>
  32. <input type="hidden" name="timestamp" value="<?php echo (int)$_GET['timestamp']; ?>">
  33. <input type="hidden" name="ext" value="<?php echo Enc::html($_GET['ext']); ?>">
  34.  
  35.  
  36. <?php
  37. Form::nextFieldDetails('Import type', true);
  38. echo Form::multiradio('import_type', [], [
  39. 'none' => 'No splitting; import the whole document as a single page',
  40. 'heading' => 'Use headings',
  41. ]);
  42. ?>
  43.  
  44. <?php
  45. Form::nextFieldDetails('Parent page', true);
  46. echo Form::pageDropdown('parent_id');
  47. ?>
  48.  
  49.  
  50. <!-- Single page -->
  51. <div class="import-type" data-type="none">
  52. <?php
  53. Form::nextFieldDetails('Page name', true);
  54. echo Form::text('page_name');
  55. ?>
  56. </div>
  57.  
  58. <!-- Headings -->
  59. <div class="import-type" data-type="heading">
  60. <?php
  61. Form::nextFieldDetails('Top-level page name', true);
  62. echo Form::text('top_page_name');
  63. ?>
  64.  
  65. <?php
  66. Form::nextFieldDetails('Create pages for', true);
  67. echo Form::pageDropdown('heading_level', [], [
  68. 1 => 'Level 1 headings',
  69. 2 => 'Level 2 headings and above',
  70. 3 => 'Level 3 headings and above',
  71. ]);
  72. ?>
  73. </div>
  74.  
  75. <div class="preview"></div>
  76.  
  77.  
  78. <div class="action-bar">
  79. <button type="submit" class="button">Import document</button>
  80. </div>
  81. </form>
  82.