aboutsummaryrefslogtreecommitdiff
path: root/mod/guidtool
diff options
context:
space:
mode:
Diffstat (limited to 'mod/guidtool')
-rw-r--r--mod/guidtool/import.php22
-rw-r--r--mod/guidtool/index.php27
-rw-r--r--mod/guidtool/languages/en.php25
-rw-r--r--mod/guidtool/manifest.xml9
-rw-r--r--mod/guidtool/start.php60
-rw-r--r--mod/guidtool/views/default/forms/guidtool/import.php23
6 files changed, 166 insertions, 0 deletions
diff --git a/mod/guidtool/import.php b/mod/guidtool/import.php
new file mode 100644
index 000000000..bab06135f
--- /dev/null
+++ b/mod/guidtool/import.php
@@ -0,0 +1,22 @@
+<?php
+ /**
+ * Elgg GUID Tool
+ *
+ * @package ElggGUIDTool
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ admin_gatekeeper();
+
+ // Render the file upload page
+ $title = elgg_echo("guidtool:import");
+ $body = elgg_view_title($title);
+ $body .= elgg_view("forms/guidtool/import");
+
+ $body = elgg_view_layout('one_column', $body);
+
+ page_draw($title, $body);
+?> \ No newline at end of file
diff --git a/mod/guidtool/index.php b/mod/guidtool/index.php
new file mode 100644
index 000000000..9494d8790
--- /dev/null
+++ b/mod/guidtool/index.php
@@ -0,0 +1,27 @@
+<?php
+ /**
+ * Elgg GUID Tool
+ *
+ * @package ElggGUIDTool
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+ admin_gatekeeper();
+
+ $context = get_context();
+ set_context('search');
+
+ $limit = get_input('limit', 10);
+ $offset = get_input('offset');
+
+
+
+// Display main admin menu
+ page_draw(elgg_echo("guidtool"),elgg_view_layout("one_column", $body));
+ set_context($context);
+?> \ No newline at end of file
diff --git a/mod/guidtool/languages/en.php b/mod/guidtool/languages/en.php
new file mode 100644
index 000000000..e74624605
--- /dev/null
+++ b/mod/guidtool/languages/en.php
@@ -0,0 +1,25 @@
+<?php
+ /**
+ * Elgg GUID Tool
+ *
+ * @package ElggGUIDTool
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ $english = array(
+
+ /**
+ * Menu items and titles
+ */
+
+ 'guidtool' => 'GUID Tool',
+ 'guidtool:browse' => 'Browse GUID',
+ 'guidtool:import' => 'Import',
+ 'guidtool:import:desc' => 'Paste the data you want to import in following window, this must be in "%s" format.',
+ );
+
+ add_translation("en",$english);
+?> \ No newline at end of file
diff --git a/mod/guidtool/manifest.xml b/mod/guidtool/manifest.xml
new file mode 100644
index 000000000..f8551969b
--- /dev/null
+++ b/mod/guidtool/manifest.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest>
+ <field key="author" value="Marcus Povey" />
+ <field key="version" value="1.0" />
+ <field key="description" value="Browse entities in the system, import and export." />
+ <field key="website" value="http://www.elgg.org/" />
+ <field key="copyright" value="(C) Curverider 2008" />
+ <field key="licence" value="GNU Public License version 2" />
+</plugin_manifest> \ No newline at end of file
diff --git a/mod/guidtool/start.php b/mod/guidtool/start.php
new file mode 100644
index 000000000..f658d5abf
--- /dev/null
+++ b/mod/guidtool/start.php
@@ -0,0 +1,60 @@
+<?php
+ /**
+ * Elgg GUID Tool
+ *
+ * @package ElggGUIDTool
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ /**
+ * Initialise the tool and set menus.
+ */
+ function guidtool_init()
+ {
+ global $CONFIG;
+
+ if (isloggedin())
+ {
+ add_menu(elgg_echo('guidtool'), $CONFIG->wwwroot . "pg/guidtool/",array(
+ menu_item(elgg_echo('guidtool:browse'), $CONFIG->wwwroot."pg/guidtool/"),
+ menu_item(elgg_echo('guidtool:import'), $CONFIG->wwwroot."pg/guidtool/import/"),
+ ),'guidtool');
+
+ }
+
+ // Register a page handler, so we can have nice URLs
+ register_page_handler('guidtool','guidtool_page_handler');
+ }
+
+ /**
+ * Log browser page handler
+ *
+ * @param array $page Array of page elements, forwarded by the page handling mechanism
+ */
+ function guidtool_page_handler($page)
+ {
+ global $CONFIG;
+
+ if (isset($page[0]))
+ {
+ switch ($page[0])
+ {
+ case 'import' :
+ include($CONFIG->pluginspath . "guidtool/import.php");
+ break;
+ default:
+ include($CONFIG->pluginspath . "guidtool/index.php");
+ }
+ }
+ else
+ include($CONFIG->pluginspath . "guidtool/index.php");
+ }
+
+
+
+ // Initialise log
+ register_elgg_event_handler('init','system','guidtool_init');
+?> \ No newline at end of file
diff --git a/mod/guidtool/views/default/forms/guidtool/import.php b/mod/guidtool/views/default/forms/guidtool/import.php
new file mode 100644
index 000000000..a2ee30406
--- /dev/null
+++ b/mod/guidtool/views/default/forms/guidtool/import.php
@@ -0,0 +1,23 @@
+<?php
+ /**
+ * Elgg GUID Tool
+ *
+ * @package ElggGUIDTool
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ global $CONFIG;
+
+ $format = $vars['format'];
+ if (!$format) $format = 'opendd';
+?>
+<div>
+<form action="<?php echo $CONFIG->url; ?>action/import/<?php echo $format; ?>" method="post">
+ <p><?php echo sprintf(elgg_echo('guidtool:import:desc'), $format); ?></p>
+ <?php echo elgg_view('input/longtext', array('internalname' => 'data')); ?>
+ <input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" />
+</form>
+</div> \ No newline at end of file