aboutsummaryrefslogtreecommitdiff
path: root/mod/twitterservice/views/default/usersettings/twitterservice/edit.php
blob: d3083d48f2ce444a838e9c86a03a8558cfc99a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/**
 * 
 */

$user_id = get_loggedin_userid();
$twitter_name = get_plugin_usersetting('twitter_name', $user_id, 'twitterservice');
$access_key = get_plugin_usersetting('access_key', $user_id, 'twitterservice');
$access_secret = get_plugin_usersetting('access_secret', $user_id, 'twitterservice');

$site_name = elgg_get_site_entity()->name;
echo '<p>' . elgg_echo('twitterservice:usersettings:description', array($site_name)) . '</p>';

if (!$access_key || !$access_secret) {
	// send user off to validate account
	$request_link = twitterservice_get_authorize_url();
	echo '<p>' . elgg_echo('twitterservice:usersettings:request', array($request_link, $site_name)) . '</p>';
} else {
	$url = elgg_get_site_url() . "pg/twitterservice/revoke";
	echo '<p class="twitter_anywhere">' . elgg_echo('twitterservice:usersettings:authorized', array($site_name, $twitter_name)) . '</p>';
	echo '<p>' . sprintf(elgg_echo('twitterservice:usersettings:revoke'), $url) . '</p>';
}