summaryrefslogtreecommitdiff
path: root/core/views
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-16 23:58:48 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-16 23:58:48 +0000
commit71db2ca32a5393efcedcd3a5e4a541174de71c40 (patch)
tree5139b084ea6b89a913ef26eb230c73bb115d1b19 /core/views
parenta7b6409b7486132f0f5f923340f1af6d6bd7dfcd (diff)
Add a scaffolding tab that allows packaging up the installation for installation. At the moment, it just creates an *.sql table for each defined table. I still need to zip this and put some install code around it so it is self installing. The ajax call will build the tables, but it doesn't return the resilt correctly. What it does is return my json response(expected) and the entire welcome.html page as well (unexpected) and i'm havinf trouble figuring out why. Something stupid i bet
Diffstat (limited to 'core/views')
-rw-r--r--core/views/welcome.html.php7
-rw-r--r--core/views/welcome_package.html.php50
2 files changed, 56 insertions, 1 deletions
diff --git a/core/views/welcome.html.php b/core/views/welcome.html.php
index 4b9e8fa8..73deedb9 100644
--- a/core/views/welcome.html.php
+++ b/core/views/welcome.html.php
@@ -9,7 +9,7 @@
}
div.outer {
- width: 600px;
+ width: 650px;
background: white;
border: 1px solid black;
margin: 0 auto;
@@ -206,6 +206,7 @@
<li><a href="javascript:show('info')">Info</a></li>
<li><a href="javascript:show('benchmarks')">Benchmarks</a></li>
<li><a href="javascript:show('docs')">Docs</a></li>
+ <li><a href="javascript:show('package')">Packaging</a></li>
<? endif ?>
</ul>
@@ -484,6 +485,10 @@
</li>
</ul>
</div>
+
+ <div id="package" class="activity">
+ <?= $package ?>
+ </div>
</div>
</div>
</div>
diff --git a/core/views/welcome_package.html.php b/core/views/welcome_package.html.php
new file mode 100644
index 00000000..913e7820
--- /dev/null
+++ b/core/views/welcome_package.html.php
@@ -0,0 +1,50 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<script>
+$("#package").ready(function() {
+ ajaxify_package_form();
+});
+
+function ajaxify_package_form() {
+ $("#package form").ajaxForm({
+ dataType: "json",
+ success: function(data) {
+ if (data.result == "success") {
+ $("#package .success").html(data.message);
+ $("#package .success").removeClass("gHide");
+ $("#package .error").addClass("gHide");
+ } else {
+ $("#package .error").html(data.message);
+ $("#package .error").removeClass("gHide");
+ $("#package .success").addClass("gHide");
+ }
+ }
+ });
+};
+
+</script>
+<p>Press the button to package this the modules as an installation package.</p>
+<form action="<?= url::site("welcome/package") ?>" method="POST">
+ <table style="width: 400px">
+ <tr>
+ <th align="left">Include</th>
+ <th align="left">Module</th>
+ </tr>
+ <? foreach ($installed as $module_name => $required): ?>
+ <tr>
+ <td>
+ <input type="checkbox" name="include[]" value="<?= $module_name ?>" checked
+ <? if (!empty($required)): ?> disabled="disabled"<? endif ?>
+ />
+ </td>
+ <td><?= $module_name ?></td>
+ </tr>
+ <? endforeach ?>
+ <tr>
+ <td colspan="2" align="center">
+ <input type="Submit" value="Package" />
+ </td>
+ </tr>
+ </table>
+ <div id="SuccessMsg" class="success gHide"></div>
+ <div id="FailMsg" class="error gHide"></div>
+</form>