aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Hq_controls.php
blob: 7b1fe817dcfe19b5bd97dfa0d1bfce9a7393086b (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
<?php

/**
 *   * Name: HQ Controls
 *   * Description: Control buttons for the HQ module
 *   * Author: Mario Vavti
 *   * Requires: hq
 */

namespace Zotlabs\Widget;

use Zotlabs\Lib\Apps;


class Hq_controls {

	function widget($options) {

		if (! local_channel())
			return;

		$entries = [
			'toggle_editor' => [
				'label' => t('Toggle post editor'),
				'href' => '#',
				'class' => 'btn jot-toggle',
				'type' => 'button',
				'icon' => 'pencil',
				'extra' => 'data-toggle="button"'
			]
		];

		if(Apps::system_app_installed(local_channel(), 'Notes')) {
			$entries['toggle_notes'] = [
				'label' => t('Toggle personal notes'),
				'href' => '#',
				'class' => 'btn notes-toggle',
				'type' => 'button',
				'icon' => 'sticky-note-o',
				'extra' => 'data-toggle="button"'
			];
		}

		return replace_macros(get_markup_template('hq_controls.tpl'),
			[
				'$entries' => $entries,
				'$wrapper_class' => $options['wrapper_class'],
				'$entry_class' => $options['entry_class']
			]
		);
	}
}