aboutsummaryrefslogtreecommitdiff
path: root/mod/twitter/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/twitter/views')
-rw-r--r--mod/twitter/views/default/twitter/css.php63
-rw-r--r--mod/twitter/views/default/widgets/twitter/content.php42
-rw-r--r--mod/twitter/views/default/widgets/twitter/edit.php24
3 files changed, 129 insertions, 0 deletions
diff --git a/mod/twitter/views/default/twitter/css.php b/mod/twitter/views/default/twitter/css.php
new file mode 100644
index 000000000..eb0cda98a
--- /dev/null
+++ b/mod/twitter/views/default/twitter/css.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Elgg Twitter CSS
+ *
+ * @package ElggTwitter
+ */
+?>
+
+#twitter_widget {
+ margin:0 10px 0 10px;
+}
+#twitter_widget ul {
+ margin:0;
+ padding:0;
+}
+#twitter_widget li {
+ list-style-image:none;
+ list-style-position:outside;
+ list-style-type:none;
+ margin:0 0 5px 0;
+ padding:0;
+ overflow-x: hidden;
+ border: 2px solid #dedede;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+}
+#twitter_widget li span {
+ color:#666666;
+ background:white;
+
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+
+ padding:5px;
+ display:block;
+}
+p.visit_twitter a {
+ background:url(<?php echo elgg_get_site_url(); ?>mod/twitter/graphics/twitter16px.png) left no-repeat;
+ padding:0 0 0 20px;
+ margin:0;
+}
+p.twitter_username .input-text {
+ width:200px;
+}
+.visit_twitter {
+ background:white;
+
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+
+ padding:2px;
+ margin:0 0 5px 0;
+}
+#twitter_widget li > a {
+ display:block;
+ margin:0 0 0 4px;
+}
+#twitter_widget li span a {
+ display:inline !important;
+} \ No newline at end of file
diff --git a/mod/twitter/views/default/widgets/twitter/content.php b/mod/twitter/views/default/widgets/twitter/content.php
new file mode 100644
index 000000000..caefd369a
--- /dev/null
+++ b/mod/twitter/views/default/widgets/twitter/content.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * Elgg twitter view page
+ *
+ * @package ElggTwitter
+ */
+
+$username = $vars['entity']->twitter_username;
+
+if (empty($username)) {
+ echo "<p>" . elgg_echo("twitter:notset") . "</p>";
+ return;
+}
+
+$username_is_valid = preg_match('~^[a-zA-Z0-9_]{1,20}$~', $username);
+if (!$username_is_valid) {
+ echo "<p>" . elgg_echo("twitter:invalid") . "</p>";
+ return;
+}
+
+
+$num = $vars['entity']->twitter_num;
+if (empty($num)) {
+ $num = 5;
+}
+
+// @todo upgrade to 1.1 API https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline
+$script_url = "https://api.twitter.com/1/statuses/user_timeline/" . urlencode($username) . ".json"
+ . "?callback=twitterCallback2&count=" . (int) $num;
+
+?>
+<div id="twitter_widget">
+ <ul id="twitter_update_list"></ul>
+ <p class="visit_twitter"><?php echo elgg_view('output/url', array(
+ 'text' => elgg_echo("twitter:visit"),
+ 'href' => 'http://twitter.com/' . urlencode($username),
+ 'is_trusted' => true,
+ )) ?></p>
+ <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
+ <script type="text/javascript" src="<?php echo htmlspecialchars($script_url, ENT_QUOTES, 'UTF-8') ?>"></script>
+</div>
diff --git a/mod/twitter/views/default/widgets/twitter/edit.php b/mod/twitter/views/default/widgets/twitter/edit.php
new file mode 100644
index 000000000..c3fc6f0d5
--- /dev/null
+++ b/mod/twitter/views/default/widgets/twitter/edit.php
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Elgg twitter edit page
+ *
+ * @package ElggTwitter
+ */
+
+?>
+<div>
+ <?php echo elgg_echo("twitter:username"); ?>
+ <?php echo elgg_view('input/text', array(
+ 'name' => 'params[twitter_username]',
+ 'value' => $vars['entity']->twitter_username,
+ )) ?>
+</div>
+<div>
+ <?php echo elgg_echo("twitter:num"); ?>
+ <?php echo elgg_view('input/text', array(
+ 'name' => 'params[twitter_num]',
+ 'value' => $vars['entity']->twitter_num,
+ )) ?>
+ <span class="elgg-text-help"><?php echo elgg_echo("twitter:apibug"); ?></span>
+</div> \ No newline at end of file