aboutsummaryrefslogtreecommitdiff
path: root/mod/twitterservice/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-26 00:51:28 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-26 00:51:28 +0000
commit16539579880fbdc0136b815ea5d26c57f2399cb1 (patch)
tree7ed00311c0c31835377c73076f10e17671c1c1a1 /mod/twitterservice/views
parent2a81ce2acb9548220d02d47394158712d395ad34 (diff)
downloadelgg-16539579880fbdc0136b815ea5d26c57f2399cb1.tar.gz
elgg-16539579880fbdc0136b815ea5d26c57f2399cb1.tar.bz2
moved twitterservice into core
git-svn-id: http://code.elgg.org/elgg/trunk@7930 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/twitterservice/views')
-rw-r--r--mod/twitterservice/views/default/settings/twitterservice/edit.php40
-rw-r--r--mod/twitterservice/views/default/twitterservice/css.php12
-rw-r--r--mod/twitterservice/views/default/twitterservice/login.php16
-rw-r--r--mod/twitterservice/views/default/twitterservice/metatags.php21
-rw-r--r--mod/twitterservice/views/default/usersettings/twitterservice/edit.php21
5 files changed, 110 insertions, 0 deletions
diff --git a/mod/twitterservice/views/default/settings/twitterservice/edit.php b/mod/twitterservice/views/default/settings/twitterservice/edit.php
new file mode 100644
index 000000000..01897db23
--- /dev/null
+++ b/mod/twitterservice/views/default/settings/twitterservice/edit.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ *
+ */
+$insert_view = elgg_view('twittersettings/extend');
+
+$consumer_key_string = elgg_echo('twitterservice:consumer_key');
+$consumer_key_view = elgg_view('input/text', array(
+ 'internalname' => 'params[consumer_key]',
+ 'value' => $vars['entity']->consumer_key,
+ 'class' => 'text_input',
+));
+
+$consumer_secret_string = elgg_echo('twitterservice:consumer_secret');
+$consumer_secret_view = elgg_view('input/text', array(
+ 'internalname' => 'params[consumer_secret]',
+ 'value' => $vars['entity']->consumer_secret,
+ 'class' => 'text_input',
+));
+
+$sign_on_with_twitter_string = elgg_echo('twitterservice:login');
+$sign_on_with_twitter_view = elgg_view('input/pulldown', array(
+ 'internalname' => 'params[sign_on]',
+ 'options_values' => array(
+ 'yes' => elgg_echo('option:yes'),
+ 'no' => elgg_echo('option:no'),
+ ),
+ 'value' => $vars['entity']->sign_on ? $vars['entity']->sign_on : 'no',
+));
+
+$settings = <<<__HTML
+<div id="twitterservice_site_settings">
+ <div>$insert_view</div>
+ <div>$consumer_key_string $consumer_key_view</div>
+ <div>$consumer_secret_string $consumer_secret_view</div>
+ <div>$sign_on_with_twitter_string $sign_on_with_twitter_view</div>
+</div>
+__HTML;
+
+echo $settings;
diff --git a/mod/twitterservice/views/default/twitterservice/css.php b/mod/twitterservice/views/default/twitterservice/css.php
new file mode 100644
index 000000000..572144067
--- /dev/null
+++ b/mod/twitterservice/views/default/twitterservice/css.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Elgg TwitterService CSS
+ */
+?>
+
+#twitterservice_site_settings .text_input {
+ width: 350px;
+}
+#login_with_twitter {
+ padding: 10px 0 0 0;
+}
diff --git a/mod/twitterservice/views/default/twitterservice/login.php b/mod/twitterservice/views/default/twitterservice/login.php
new file mode 100644
index 000000000..8db63af36
--- /dev/null
+++ b/mod/twitterservice/views/default/twitterservice/login.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ *
+ */
+
+$url = "{$vars['url']}pg/twitterservice/forward";
+
+$login = <<<__HTML
+<div id="login_with_twitter">
+ <a href="$url">
+ <img src="{$vars['url']}mod/twitterservice/graphics/sign_in_with_twitter.gif" alt="Twitter" />
+ </a>
+</div>
+__HTML;
+
+echo $login;
diff --git a/mod/twitterservice/views/default/twitterservice/metatags.php b/mod/twitterservice/views/default/twitterservice/metatags.php
new file mode 100644
index 000000000..1335cd759
--- /dev/null
+++ b/mod/twitterservice/views/default/twitterservice/metatags.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Adds required HTML head tags for Twitter Services.
+ *
+ * @package TwitterService
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @copyright Curverider Ltd 2010
+ */
+
+if ($api_key = get_plugin_setting('consumer_key', 'twitterservice')) {
+ $tags = <<<__HTML
+<script src="http://platform.twitter.com/anywhere.js?id=$api_key&v=1" type="text/javascript"></script>
+<script type="text/javascript">
+ twttr.anywhere(function (T) {
+ T(".twitter_anywhere").hovercards();
+ });
+</script>
+__HTML;
+
+ echo $tags;
+}
diff --git a/mod/twitterservice/views/default/usersettings/twitterservice/edit.php b/mod/twitterservice/views/default/usersettings/twitterservice/edit.php
new file mode 100644
index 000000000..95a2a2fd6
--- /dev/null
+++ b/mod/twitterservice/views/default/usersettings/twitterservice/edit.php
@@ -0,0 +1,21 @@
+<?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');
+
+echo '<p>' . elgg_echo('twitterservice:usersettings:description') . '</p>';
+
+if (!$access_key || !$access_secret) {
+ // send user off to validate account
+ $request_link = twitterservice_get_authorize_url();
+ echo '<p>' . sprintf(elgg_echo('twitterservice:usersettings:request'), $request_link) . '</p>';
+} else {
+ $url = "{$CONFIG->site->url}pg/twitterservice/revoke";
+ echo '<p class="twitter_anywhere">' . sprintf(elgg_echo('twitterservice:usersettings:authorized'), $twitter_name) . '</p>';
+ echo '<p>' . sprintf(elgg_echo('twitterservice:usersettings:revoke'), $url) . '</p>';
+}