aboutsummaryrefslogtreecommitdiff
path: root/mod/guidbrowser/index.php
blob: 49d6f88243ca9e5dd76a00adc69eb069b5a46650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
	/**
	 * Elgg GUID browser
	 * 
	 * @package ElggDevTools
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Marcus Povey <marcus@marcus-povey.co.uk>
	 * @copyright Curverider Ltd 2008
	 * @link http://elgg.com/
	 */

	require_once("../../engine/start.php");
	
	$eguid = get_input('eguid');
	$limit = get_input('limit', 10);
	$offset = get_input('offset');
	$type = get_input('type');
	$subtype = get_input('subtype');
	
	$action = get_input('subtype');
	$key = get_input('key');
	$value = get_input('value');
	
	$relationship = get_input('relationship');
	$guid2 = get_input('guid2');
	
	
	switch ($callaction)
	{
		case 'metadata' :
			if (!create_metadata($eguid, $key, $value))
				echo "Could not create metadata with $eguid:$key:$value";
		break;
			
		case 'annotations' :
			if (!create_annotation($eguid, $key, $value))
				echo "Could not create metadata with $eguid:$key:$value";
		break;

		case 'relationship' :
			if (!add_entity_relationship($eguid, $relationship, $guid2))
				echo "Could not create relationship between $eguid:$relationship:$guid2";
		break;
	}
		
	// Get the current page's owner
		$page_owner = page_owner_entity();
		
	// Display 
		$body = guidbrowser_display($offset, $limit, $type, $subtype);
		
	// Display page
		page_draw(elgg_echo("guidbrowser"), $body);
?>