diff options
author | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-15 12:01:31 +0000 |
---|---|---|
committer | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-15 12:01:31 +0000 |
commit | e463f5079c9eef80350184cdb8af968dc416e90e (patch) | |
tree | 09b763caa2b477a85cd78146b6c38ee6fc3488d2 | |
parent | 67b6b75b0271228dbe0fd27656ec67c66001fc34 (diff) | |
download | elgg-e463f5079c9eef80350184cdb8af968dc416e90e.tar.gz elgg-e463f5079c9eef80350184cdb8af968dc416e90e.tar.bz2 |
Updates to Twitter and TwitterService UI.
git-svn-id: http://code.elgg.org/elgg/trunk@5398 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | mod/twitter/views/default/twitter/css.php | 31 | ||||
-rw-r--r-- | mod/twitter/views/default/widgets/twitter/view.php | 41 | ||||
-rw-r--r-- | mod/twitterservice/start.php | 29 | ||||
-rw-r--r-- | mod/twitterservice/views/default/usersettings/twitterservice/edit.php | 8 |
4 files changed, 45 insertions, 64 deletions
diff --git a/mod/twitter/views/default/twitter/css.php b/mod/twitter/views/default/twitter/css.php index f0e51ccb5..96b4d415f 100644 --- a/mod/twitter/views/default/twitter/css.php +++ b/mod/twitter/views/default/twitter/css.php @@ -1,26 +1,22 @@ -<?php - - /** - * Elgg Twitter CSS - * - * @package ElggTwitter - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - +<?php +/** + * Elgg Twitter CSS + * + * @package ElggTwitter + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ ?> #twitter_widget { margin:0 10px 0 10px; } - #twitter_widget ul { margin:0; padding:0; } - #twitter_widget li { background: url(<?php echo $vars['url']; ?>mod/twitter/graphics/thewire_speech_bubble.gif) no-repeat right bottom; list-style-image:none; @@ -30,7 +26,6 @@ padding:0; overflow-x: hidden; } - #twitter_widget li span { color:#666666; background:white; @@ -39,12 +34,14 @@ padding:5px; display:block; } - p.visit_twitter a { background:url(<?php echo $vars['url']; ?>mod/twitter/graphics/twitter.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; @@ -52,12 +49,10 @@ p.visit_twitter a { 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/view.php b/mod/twitter/views/default/widgets/twitter/view.php index 71caaf380..4ae0d7f27 100644 --- a/mod/twitter/views/default/widgets/twitter/view.php +++ b/mod/twitter/views/default/widgets/twitter/view.php @@ -1,22 +1,21 @@ -<?php - - /** - * Elgg twitter view page - * - * @package ElggTwitter - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - - //some required params - - $username = $vars['entity']->twitter_username; - $num = $vars['entity']->twitter_num; - - // if the twitter username is empty, then do not show - if($username){ +<?php + /** + * Elgg twitter view page + * + * @package ElggTwitter + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + + //some required params + + $username = $vars['entity']->twitter_username; + $num = $vars['entity']->twitter_num; + +// if the twitter username is empty, then do not show +if($username){ ?> @@ -27,9 +26,7 @@ <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/<?php echo $username; ?>.json?callback=twitterCallback2&count=<?php echo $num; ?>"></script> <?php } else { - - echo "<div class=\"contentWrapper\"><p>" . elgg_echo("twitter:notset") . ".</p></div>"; - + echo "<p>" . elgg_echo("twitter:notset") . ".</p>"; } ?> </div>
\ No newline at end of file diff --git a/mod/twitterservice/start.php b/mod/twitterservice/start.php index b387379f2..718db9ced 100644 --- a/mod/twitterservice/start.php +++ b/mod/twitterservice/start.php @@ -13,39 +13,28 @@ global $CONFIG; require_once($CONFIG->pluginspath . "twitterservice/vendors/twitter/twitter.class.php"); - function twitterservice_init() - { + function twitterservice_init() { // Listen for wire create event register_elgg_event_handler('create','object','twitterservice_wire_listener'); - } - /** - * Post a message to a twitter feed. - * - */ - function twitterservice_send($twittername, $twitterpass, $twittermessage) - { + // Post a message to a twitter feed. + function twitterservice_send($twittername, $twitterpass, $twittermessage) { $twitter = new Twitter($twittername, $twitterpass); - return $twitter->send($twittermessage); } - /** - * Listen for thewire and push messages accordingly. - */ - function twitterservice_wire_listener($event, $object_type, $object) - { + // Listen for thewire and push messages accordingly. + function twitterservice_wire_listener($event, $object_type, $object) { - if (($object) && ($object->subtype == get_subtype_id('object', 'thewire')) ) - { - if (get_plugin_usersetting('sendtowire', $object->owner_guid, 'twitterservice')=='yes') - { + if (($object) && ($object->subtype == get_subtype_id('object', 'thewire')) ) { + if (get_plugin_usersetting('sendtowire', $object->owner_guid, 'twitterservice')=='yes') { $twittername = get_plugin_usersetting('twittername', $object->owner_guid, 'twitterservice'); $twitterpass = get_plugin_usersetting('twitterpass', $object->owner_guid, 'twitterservice'); - if (($twittername) && ($twitterpass)) + if (($twittername) && ($twitterpass)) { twitterservice_send($twittername, $twitterpass, $object->description); + } } } } diff --git a/mod/twitterservice/views/default/usersettings/twitterservice/edit.php b/mod/twitterservice/views/default/usersettings/twitterservice/edit.php index eb4896756..e2d8b8785 100644 --- a/mod/twitterservice/views/default/usersettings/twitterservice/edit.php +++ b/mod/twitterservice/views/default/usersettings/twitterservice/edit.php @@ -1,9 +1,9 @@ -<p> +<p class="twitter_username"><label> <?php echo elgg_echo('twitterservice:twittername'); ?> <?php echo elgg_view('input/text', array('internalname' => 'params[twittername]', 'value' => $vars['entity']->twittername)); ?> -</p> -<p> +</label></p> +<p><label> <?php echo elgg_echo('twitterservice:twitterpass'); ?> <?php echo elgg_view('input/password', array('internalname' => 'params[twitterpass]', 'value' => $vars['entity']->twitterpass)); ?> -</p> +</label></p> <?php if (is_plugin_enabled('thewire')) { ?> <p> <?php echo elgg_echo('twitterservice:postwire'); ?> |