1<?php 2require __DIR__ . '/../vendor/autoload.php'; 3 4$WIZ = new dokuwiki\plugin\dev\www\PluginWizard(); 5try { 6 $archive = $WIZ->handle(); 7 if($archive) { 8 header('Content-Type: application/zip'); 9 header('Content-Disposition: attachment; filename="plugin.zip"'); 10 echo $archive; 11 exit; 12 } 13} catch (Exception $e) { 14 // FIXME handle errors 15} 16 17header('Content-Type: text/html; charset=utf-8'); 18?> 19<html lang="en"> 20<head> 21 <title>DokuWiki Plugin Wizard</title> 22 <script type="text/javascript"> 23 const ACTION_EVENTS = <?php echo json_encode($WIZ->getEvents()); ?>; 24 </script> 25 26 <link rel="stylesheet" href="style.css" /> 27 <link rel="stylesheet" href="awesomplete.css" / 28</head> 29<body> 30<main> 31 <h1>DokuWiki Plugin Wizard</h1> 32 33 34 <div class="intro"> 35 <p> 36 This wizard generates a <a href="https://www.dokuwiki.org/devel:plugins">DokuWiki plugin</a> 37 skeleton to help you get started with coding your plugin. 38 Before using it you should familiarize your self with how plugins in DokuWiki work 39 and determine what components your plugin will need. 40 </p> 41 42 <p> 43 To use it, fill in the general plugin info and add plugin components. Once you're 44 done, click "create" and download your plugin skeleton. 45 </p> 46 47 <p> 48 Alternatively you can also use the <a href="https://www.dokuwiki.org/plugin:dev">dev plugin</a>. 49 This plugin will also come in handy when editing and extending your plugin later. 50 </p> 51 </div> 52 53 <noscript> 54 <div class="nojs"> 55 Sorry, this wizard needs JavaScript to do its magic. It will not work with your 56 current setup. 57 </div> 58 </noscript> 59 60 61 <form action="index.php" method="post" id="ajax__plugin_wiz"> 62 63 <section> 64 <div id="plugin_info"> 65 <h2>Plugin Information</h2> 66 67 <label> 68 <span>Plugin base name:</span> 69 <input type="text" name="base" required="required" pattern="^[a-z0-9]+$" 70 placeholder="yourplugin"> 71 <small>(lowercase, no special chars)</small> 72 </label> 73 74 <label> 75 <span>A short description of what the plugin does:</span> 76 <input type="text" name="desc" required="required" 77 placeholder="A plugin to flurb the blarg"> 78 </label> 79 80 <label> 81 <span>Your name:</span> 82 <input type="text" name="author" required="required" placeholder="Jane Doe"> 83 </label> 84 85 <label> 86 <span>Your E-Mail address:</span> 87 <input type="text" name="mail" required="required" placeholder="jane@example.com"> 88 </label> 89 90 <label> 91 <span>URL for the plugin:</span> 92 <input type="text" name="url" placeholder="https://www.dokuwiki.org/plugin:yourplugin"> 93 <small>(leave empty for default dokuwiki.org location)</small> 94 </label> 95 96 <label> 97 <input type="checkbox" name="use_lang" value="1"/> 98 <span>Use localization</span> 99 </label> 100 101 <label> 102 <input type="checkbox" name="use_conf" value="1"/> 103 <span>Use configuration</span> 104 </label> 105 106 <label> 107 <input type="checkbox" name="use_tests" value="1"/> 108 <span>Use unit tests</span> 109 </label> 110 </div> 111 112 <div id="plugin_components"> 113 <h2>Add Plugin Components</h2> 114 115 <label> 116 <span>Type:</span> 117 <select> 118 <?php foreach ($WIZ->getPluginTypes() as $type): ?> 119 <option value="<?php echo $type ?>"><?php echo ucfirst($type) ?></option> 120 <?php endforeach; ?> 121 </select> 122 </label> 123 124 <label> 125 <span>Add as a Sub-Component:</span> 126 <input type="text" value="" pattern="^[a-z0-9]+$" placeholder="subcomponent"/> 127 <small>(leave empty to add top level)</small> 128 </label> 129 130 <button type="button">Add Component</button> 131 132 <ul id="output"></ul> 133 134 </div> 135 </section> 136 137 <button type="submit" name="plugin_wiz_create">Create and Download<br>Plugin Skeleton</button> 138 139 </form> 140 141</main> 142<script src="awesomplete.min.js"></script> 143<script src="script.js"></script> 144</body> 145</html> 146