aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Settings/Editor.php
blob: 92775f15488023df8ab68c3946e9d301b5fb348d (plain) (blame)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php

namespace Zotlabs\Module\Settings;


class Editor {

	function post() {
		check_form_security_token_redirectOnErr('/settings/editor', 'settings_editor');
	
		$features = self::get_features();

		process_features_post(local_channel(), $features, $_POST);
		
		build_sync_packet();
		return;
	}

	function get() {
		
		$features = self::get_features();
		$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');

		$tpl = get_markup_template("settings_module.tpl");

		$o .= replace_macros($tpl, array(
			'$rpath' => $rpath,
			'$action_url' => 'settings/editor',
			'$form_security_token' => get_form_security_token("settings_editor"),
			'$title' => t('Editor Settings'),
			'$features'  => process_features_get(local_channel(), $features),
			'$submit'    => t('Submit')
		));
	
		return $o;
	}

	function get_features() {
		$arr = [

			[
				'large_photos',   
				t('Large Photos'),              
				t('Include large (1024px) photo thumbnails in posts. If not enabled, use small (640px) photo thumbnails'),
				false,
				get_config('feature_lock','large_photos'),
			],

			[
				'content_encrypt', 
				t('Even More Encryption'),          
				t('Allow optional encryption of content end-to-end with a shared secret key'),
				false,
				get_config('feature_lock','content_encrypt'),
			],
			
			[
				'consensus_tools', 
				t('Enable Voting Tools'),      
				t('Provide a class of post which others can vote on'),
				false,
				get_config('feature_lock','consensus_tools'),
			],

			[
				'disable_comments', 
				t('Disable Comments'),      
				t('Provide the option to disable comments for a post'),
				false,
				get_config('feature_lock','disable_comments'),
			],

			[
				'delayed_posting', 
				t('Delayed Posting'),      
				t('Allow posts to be published at a later date'),
				false,
				get_config('feature_lock','delayed_posting'),
			],

			[ 	
				'content_expire',
				t('Content Expiration'),
				t('Remove posts/comments and/or private messages at a future time'), 
				false, 
				get_config('feature_lock','content_expire'),
			],

			[
				'suppress_duplicates', 
				t('Suppress Duplicate Posts/Comments'),  
				t('Prevent posts with identical content to be published with less than two minutes in between submissions.'),
				true,
				get_config('feature_lock','suppress_duplicates'),
			],

			[
				'auto_save_draft', 
				t('Auto-save drafts of posts and comments'),  
				t('Automatically saves post and comment drafts in local browser storage to help prevent accidental loss of compositions'),
				true,
				get_config('feature_lock','auto_save_draft'),
			]

		];

		return $arr;

	}

}