aboutsummaryrefslogtreecommitdiff
path: root/activate.php
blob: 25d34338c328c44a0d40134d8f2d06bc9da5379b (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
<?php
/**
 * Activate Tidypics
 * 
 * @author Cash Costello
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
 */

// register classes
if (get_subtype_id('object', 'album')) {
	update_subtype('object', 'album', 'TidypicsAlbum');
} else {
	add_subtype('object', 'album', 'TidypicsAlbum');
}
if (get_subtype_id('object', 'image')) {
	update_subtype('object', 'image', 'TidypicsImage');
} else {
	add_subtype('object', 'image', 'TidypicsImage');
}

// set default settings
$plugin = elgg_get_plugin_from_id('tidypics');

$image_sizes = array();
$image_sizes['large_image_width'] = $image_sizes['large_image_height'] = 600;
$image_sizes['small_image_width'] = $image_sizes['small_image_height'] = 153;
$image_sizes['tiny_image_width'] = $image_sizes['tiny_image_height'] = 60;
$image_sizes = serialize($image_sizes);

$defaults = array(
	'tagging' => true,
	'view_count' => true,
	'uploader' => true,
	'exif' => true,
	'download_link' => true,

	'maxfilesize' => 5,
	'image_lib' => 'GD',

	'img_river_view' => 'batch',
	'album_river_view' => 'set',

	'image_sizes' => $image_sizes,

	'grp_perm_override' => true,
);

foreach ($defaults as $name => $value) {
	if ($plugin->getSetting($name) === null) {
		$plugin->setSetting($name, $value);
	}
}