aboutsummaryrefslogtreecommitdiff
path: root/mod/guidtool
diff options
context:
space:
mode:
Diffstat (limited to 'mod/guidtool')
-rw-r--r--mod/guidtool/actions/delete.php21
-rw-r--r--mod/guidtool/export.php25
-rw-r--r--mod/guidtool/format_picker.php26
-rw-r--r--mod/guidtool/import.php25
-rw-r--r--mod/guidtool/index.php46
-rw-r--r--mod/guidtool/languages/en.php32
-rw-r--r--mod/guidtool/manifest.xml10
-rw-r--r--mod/guidtool/start.php128
-rw-r--r--mod/guidtool/view.php22
-rw-r--r--mod/guidtool/views/default/forms/guidtool/export.php23
-rw-r--r--mod/guidtool/views/default/forms/guidtool/format.php40
-rw-r--r--mod/guidtool/views/default/forms/guidtool/import.php26
-rw-r--r--mod/guidtool/views/default/guidtool/gallery.php29
-rw-r--r--mod/guidtool/views/default/guidtool/listing.php39
-rw-r--r--mod/guidtool/views/default/guidtool/profile.php16
-rw-r--r--mod/guidtool/views/default/object/guidtoolwrapper.php21
16 files changed, 0 insertions, 529 deletions
diff --git a/mod/guidtool/actions/delete.php b/mod/guidtool/actions/delete.php
deleted file mode 100644
index 36126ee10..000000000
--- a/mod/guidtool/actions/delete.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
- global $CONFIG;
-
- admin_gatekeeper();
- action_gatekeeper();
-
- $guid = (int)get_input('guid');
- $entity = get_entity($guid);
-
- if ($entity)
- {
- if ($entity->delete())
- system_message(sprintf(elgg_echo('guidtool:deleted'), $guid));
- else
- register_error(sprintf(elgg_echo('guidtool:notdeleted'), $guid));
- }
- else
- register_error(sprintf(elgg_echo('guidtool:notdeleted'), $guid));
-
- forward($_SERVER['HTTP_REFERER']);
-?> \ No newline at end of file
diff --git a/mod/guidtool/export.php b/mod/guidtool/export.php
deleted file mode 100644
index 732307a25..000000000
--- a/mod/guidtool/export.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- admin_gatekeeper();
- set_context('admin');
-
- $entity_guid = get_input('entity_guid');
-
- // Render the file upload page
- $title = elgg_echo('guidbrowser:export');
- $body = elgg_view_title($title);
- $body .= elgg_view("forms/guidtool/export", array('entity_guid' => $entity_guid));
-
- $body = elgg_view_layout('two_column_left_sidebar', '', $body);
-
- page_draw($title, $body);
-?> \ No newline at end of file
diff --git a/mod/guidtool/format_picker.php b/mod/guidtool/format_picker.php
deleted file mode 100644
index 4055612bd..000000000
--- a/mod/guidtool/format_picker.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- global $CONFIG;
-
- admin_gatekeeper();
- set_context('admin');
-
- $formats = guidtool_get_import_actions();
-
- $title = elgg_echo("guidtool:pickformat");
- $body = elgg_view_title($title);
- $body .= elgg_view('forms/guidtool/format', array('formats' => $formats));
-
- $body = elgg_view_layout('two_column_left_sidebar', '', $body);
-
- page_draw($title, $body);
-?> \ No newline at end of file
diff --git a/mod/guidtool/import.php b/mod/guidtool/import.php
deleted file mode 100644
index 2d89bc5a4..000000000
--- a/mod/guidtool/import.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- admin_gatekeeper();
- set_context('admin');
-
- $format = get_input('format', 'opendd');
-
- // Render the file upload page
- $title = elgg_echo("guidtool:import");
- $body = elgg_view_title($title);
- $body .= elgg_view("forms/guidtool/import", array('format' => $format, 'forward_url'));
-
- $body = elgg_view_layout('two_column_left_sidebar', '', $body);
-
- page_draw($title, $body);
-?> \ No newline at end of file
diff --git a/mod/guidtool/index.php b/mod/guidtool/index.php
deleted file mode 100644
index 42abaae3b..000000000
--- a/mod/guidtool/index.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- admin_gatekeeper();
- set_context('admin');
-
- $title = elgg_echo("guidtool");
- $body = elgg_view_title($title);
-
- $context = get_context();
- set_context('search');
-
- $limit = get_input('limit', 10);
- $offset = get_input('offset');
-
- // Get entities
- $entities = get_entities("","","","",$limit, $offset);
- $count = get_entities("","","","",$limit, $offset, true);
-
- $wrapped_entries = array();
-
- foreach ($entities as $e)
- {
- $tmp = new ElggObject();
- $tmp->subtype = 'guidtoolwrapper';
- $tmp->entity = $e;
- $wrapped_entries[] = $tmp;
- }
-
- $body .= elgg_view_entity_list($wrapped_entries, $count, $offset, $limit, false);
-
- set_context($context);
-
-// Display main admin menu
- page_draw($title,elgg_view_layout("two_column_left_sidebar", '', $body));
-?> \ No newline at end of file
diff --git a/mod/guidtool/languages/en.php b/mod/guidtool/languages/en.php
deleted file mode 100644
index 1c6d90c18..000000000
--- a/mod/guidtool/languages/en.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- $english = array(
-
- /**
- * Menu items and titles
- */
-
- 'guidtool' => 'GUID Tool',
- 'guidtool:browse' => 'Browse GUIDs',
- 'guidtool:import' => 'Import GUID data',
- 'guidtool:import:desc' => 'Paste the data you want to import in following window, this must be in "%s" format.',
-
- 'guidtool:pickformat' => 'Please select the format that you wish to import or export.',
-
- 'guidbrowser:export' => 'Export',
-
- 'guidtool:deleted' => 'GUID %d deleted',
- 'guidtool:notdeleted' => 'GUID %d not deleted',
- );
-
- add_translation("en",$english);
-?> \ No newline at end of file
diff --git a/mod/guidtool/manifest.xml b/mod/guidtool/manifest.xml
deleted file mode 100644
index ed3e323ee..000000000
--- a/mod/guidtool/manifest.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin_manifest>
- <field key="author" value="Curverider Ltd" />
- <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-2009" />
- <field key="licence" value="GNU Public License version 2" />
- <field key="elgg_version" value="2009021901" />
-</plugin_manifest> \ No newline at end of file
diff --git a/mod/guidtool/start.php b/mod/guidtool/start.php
deleted file mode 100644
index 8dc9dd65a..000000000
--- a/mod/guidtool/start.php
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- /**
- * Initialise the tool and set menus.
- */
- function guidtool_init()
- {
- global $CONFIG;
-
- /*if (isadminloggedin())
- {
- 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');
-
- // Register some actions
- register_action("guidtool/delete",false, $CONFIG->pluginspath . "guidtool/actions/delete.php", true);
-
- }
-
- /**
- * Post init gumph.
- */
- function guidtool_page_setup()
- {
- global $CONFIG;
-
- if ((isadminloggedin()) && (get_context()=='admin'))
- {
- add_submenu_item(elgg_echo('guidtool:browse'), $CONFIG->wwwroot."pg/guidtool/");
- add_submenu_item(elgg_echo('guidtool:import'), $CONFIG->wwwroot."pg/guidtool/import/");
- }
- }
-
- /**
- * 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 'view' :
- if ((isset($page[1]) && (!empty($page[1])))) {
- add_submenu_item('GUID:'.$page[1], $CONFIG->url . "pg/guidtool/view/{$page[1]}/");
- add_submenu_item(elgg_echo('guidbrowser:export'), $CONFIG->url . "pg/guidtool/export/{$page[1]}/");
- }
-
- case 'export':
-
- if ((isset($page[1]) && (!empty($page[1])))) {
-
- set_input('entity_guid', $page[1]);
- if ($page[0] == 'view')
- include($CONFIG->pluginspath . "guidtool/view.php");
- else
- {
- if ((isset($page[2]) && (!empty($page[2])))) {
- set_input('format', $page[2]);
- include($CONFIG->pluginspath . "guidtool/export.php");
- } else {
- set_input('forward_url', $CONFIG->url . "pg/guidtool/export/$page[1]/");
- include($CONFIG->pluginspath . "guidtool/format_picker.php");
- }
- }
- }
- else include($CONFIG->pluginspath . "guidtool/index.php");
- break;
- case 'import' :
- if ((isset($page[1]) && (!empty($page[1])))) {
- set_input('format', $page[1]);
- include($CONFIG->pluginspath . "guidtool/import.php");
- } else {
- set_input('forward_url', $CONFIG->url . "pg/guidtool/import/");
- include($CONFIG->pluginspath . "guidtool/format_picker.php");
- }
- break;
- default:
- include($CONFIG->pluginspath . "guidtool/index.php");
- }
- }
- else
- include($CONFIG->pluginspath . "guidtool/index.php");
- }
-
- /**
- * Get a list of import actions
- *
- */
- function guidtool_get_import_actions()
- {
- global $CONFIG;
-
- $return = array();
-
- foreach ($CONFIG->actions as $action => $handler)
- {
- if (strpos($action, "import/")===0)
- $return[] = substr($action, 7);
- }
-
- return $return;
- }
-
- // Initialise log
- register_elgg_event_handler('init','system','guidtool_init');
- register_elgg_event_handler('pagesetup','system','guidtool_page_setup');
-?> \ No newline at end of file
diff --git a/mod/guidtool/view.php b/mod/guidtool/view.php
deleted file mode 100644
index ba6302d70..000000000
--- a/mod/guidtool/view.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- $entity_guid = get_input('entity_guid');
-
- // Render the file upload page
- $title = "GUID: $entity_guid";
- $body = elgg_view_title($title);
- $body .= elgg_view("guidtool/profile", array('entity_guid' => $entity_guid));
-
- $body = elgg_view_layout('two_column_left_sidebar', '', $body);
-
- page_draw($title, $body);
-?> \ No newline at end of file
diff --git a/mod/guidtool/views/default/forms/guidtool/export.php b/mod/guidtool/views/default/forms/guidtool/export.php
deleted file mode 100644
index f8b07368a..000000000
--- a/mod/guidtool/views/default/forms/guidtool/export.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- global $CONFIG;
-
- $format = $vars['format'];
- if (!$format) $format = 'opendd';
-
- $entity_guid = get_input('entity_guid');
-
-
-?>
-<div id="export">
-<?php echo elgg_view('output/text', array('value' => htmlentities(file_get_contents($CONFIG->url . "export/$format/$entity_guid/"), ENT_QUOTES, 'UTF-8'))) ?>
-</div> \ No newline at end of file
diff --git a/mod/guidtool/views/default/forms/guidtool/format.php b/mod/guidtool/views/default/forms/guidtool/format.php
deleted file mode 100644
index 2d3cfa976..000000000
--- a/mod/guidtool/views/default/forms/guidtool/format.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- $formats = $vars['formats'];
-
- if (!$formats)
- $formats = array('opendd');
-
- $format = get_input('format');
- if ($format)
- {
- forward(get_input('forward_url') . $format . "/");
- exit;
- }
-
-?>
-
-<div class="contentWrapper">
- <form method="get">
- <select name="format">
- <?php
- foreach ($formats as $format)
- {
- ?>
- <option value="<?php echo $format; ?>"><?php echo $format; ?></option>
- <?php
- }
- ?>
- </select>
- <input type="submit" class="submit_button" value="<?php echo elgg_echo("go"); ?>" />
- </form>
-</div> \ 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
deleted file mode 100644
index f9348bffa..000000000
--- a/mod/guidtool/views/default/forms/guidtool/import.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- global $CONFIG;
-
- $format = $vars['format'];
- if (!$format) $format = 'opendd';
-
-
- $formbody = "<div class=\"contentWrapper\"><p>" . sprintf(elgg_echo('guidtool:import:desc'), $format) . "</p>" .
- elgg_view('input/plaintext', array('internalname' => 'data')) . elgg_view('input/submit', array('value' => elgg_echo("save")));
-?>
-<div>
-<?php
- echo elgg_view('input/form', array('body' => $formbody, 'action' => "{$CONFIG->url}action/import/$format"))
-?>
-</div>
-</div> \ No newline at end of file
diff --git a/mod/guidtool/views/default/guidtool/gallery.php b/mod/guidtool/views/default/guidtool/gallery.php
deleted file mode 100644
index 23148ee50..000000000
--- a/mod/guidtool/views/default/guidtool/gallery.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- global $CONFIG;
-
- $entity = $vars['entity']->entity;
- $by = $entity->getOwnerEntity();
-
-
- $strap = $entity->title ? $entity->title : $entity->name;
- $info .= "<p><b><a href=\"{$CONFIG->url}pg/guidtool/view/{$entity->guid}/\">[GUID:{$entity->guid}] " . get_class($entity) . " " . get_subtype_from_id($entity->subtype) . "</a></b> $strap</p>";
-
- $desc = $entity->description ? substr($entity->description, 0, 100) : "";
- $info .= "<p>$desc</p>";
-
- $info .= "<div>";
- if ($by) $info .= elgg_echo('by') . " <a href=\"".$by->getURL()."\">{$by->name}</a> ";
- $info .= " " . friendly_time($entity->time_created )."</div>";
-
- echo elgg_view_listing($icon, $info);
-?> \ No newline at end of file
diff --git a/mod/guidtool/views/default/guidtool/listing.php b/mod/guidtool/views/default/guidtool/listing.php
deleted file mode 100644
index d543b8e03..000000000
--- a/mod/guidtool/views/default/guidtool/listing.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- global $CONFIG;
-
- $entity = $vars['entity']->entity;
- $by = $entity->getOwnerEntity();
-
- $icon = elgg_view(
- 'graphics/icon', array(
- 'entity' => $entity,
- 'size' => 'small',
- )
- );
-
- $ts = time();
- $token = generate_action_token($ts);
-
- $controllinks = "<a href=\"{$CONFIG->url}pg/guidtool/export/{$entity->guid}/\">".elgg_echo('export')."</a> ";
- if ($entity->canEdit())
- $controllinks .= elgg_view('output/confirmlink', array('text' => elgg_echo('delete'), 'href' => "{$CONFIG->url}action/guidtool/delete?guid={$entity->guid}&__elgg_token=$token&__elgg_ts=$ts"));
-
- $strap = $entity->title ? $entity->title : $entity->name;
- $info .= "<p><b><a href=\"{$CONFIG->url}pg/guidtool/view/{$entity->guid}/\">[GUID:{$entity->guid}] " . get_class($entity) . " " . get_subtype_from_id($entity->subtype) . "</a></b> $strap</p>";
-
- $info .= "<div>";
- if ($by) $info .= elgg_echo('by') . " <a href=\"".$by->getURL()."\">{$by->name}</a> ";
- $info .= " " . friendly_time($entity->time_created )." [$controllinks]</div>";
-
- echo elgg_view_listing($icon, $info);
-?> \ No newline at end of file
diff --git a/mod/guidtool/views/default/guidtool/profile.php b/mod/guidtool/views/default/guidtool/profile.php
deleted file mode 100644
index 6f76f7b3f..000000000
--- a/mod/guidtool/views/default/guidtool/profile.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- $entity_guid = $vars['entity_guid'];
-
-
- echo elgg_view('export/entity', array('entity' => get_entity($entity_guid)));
-?> \ No newline at end of file
diff --git a/mod/guidtool/views/default/object/guidtoolwrapper.php b/mod/guidtool/views/default/object/guidtoolwrapper.php
deleted file mode 100644
index 49845ad7a..000000000
--- a/mod/guidtool/views/default/object/guidtoolwrapper.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
- /**
- * Elgg GUID Tool
- *
- * @package ElggGUIDTool
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- if ($vars['full']) {
- echo elgg_view("guidtool/profile",$vars);
- } else {
- if (get_input('search_viewtype') == "gallery") {
- echo elgg_view('guidtool/gallery',$vars);
- } else {
- echo elgg_view("guidtool/listing",$vars);
- }
- }
-?> \ No newline at end of file