diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-12 22:41:25 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-12 22:41:25 +0000 |
commit | da90ff55725a9118ce6111ab2b6371650bf78ade (patch) | |
tree | 937da734d50c8147ca8f2cc52791dabf430464c6 /mod/thewire/views/default/thewire | |
parent | cc6b7d1d223241e397e0d41354924e74606eeffc (diff) | |
download | elgg-da90ff55725a9118ce6111ab2b6371650bf78ade.tar.gz elgg-da90ff55725a9118ce6111ab2b6371650bf78ade.tar.bz2 |
a mostly completed port of JHU/APL wire plugin to 1.8
git-svn-id: http://code.elgg.org/elgg/trunk@8183 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/thewire/views/default/thewire')
-rw-r--r-- | mod/thewire/views/default/thewire/css.php | 36 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/forms/add.php | 31 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/metadata.php | 56 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/notfound.php | 17 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/profile_status.php | 16 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/reply.php | 11 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/view.php | 23 |
7 files changed, 104 insertions, 86 deletions
diff --git a/mod/thewire/views/default/thewire/css.php b/mod/thewire/views/default/thewire/css.php index d7beac105..c1c7b5bcb 100644 --- a/mod/thewire/views/default/thewire/css.php +++ b/mod/thewire/views/default/thewire/css.php @@ -1,12 +1,36 @@ <?php +/** + * The Wire CSS + */ - /** - * Elgg thewire CSS extender - * - * @package ElggTheWire - */ - ?> +/******************************** + The Wire +*********************************/ +#thewire-textarea { + height: 40px; + padding: 6px; +} +#thewire-characters-remaining { + text-align: right; + float: right; + font-weight: bold; + color: #333333; +} +.thewire-characters-remaining { + color:#333333; + border:none; + font-size: 100%; + font-weight: bold; + padding:0 2px 0 0; + margin:0; + text-align: right; + background: white; +} +<?php +return true; +?> + /* new wire post form */ .new_wire_post { margin:10px 0 15px 0; diff --git a/mod/thewire/views/default/thewire/forms/add.php b/mod/thewire/views/default/thewire/forms/add.php deleted file mode 100644 index 3ad968b3b..000000000 --- a/mod/thewire/views/default/thewire/forms/add.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - - /** - * Elgg thewire edit/add page - * - * @package ElggTheWire - * - */ - - $wire_user = get_input('wire_username'); - if (!empty($wire_user)) { $msg = '@' . $wire_user . ' '; } else { $msg = ''; } - -?> -<div class="new_wire_post clearfix"> -<h3><?php echo elgg_echo("thewire:doing"); ?></h3> -<?php //@todo JS 1.8: no ?> -<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/thewire/views/default/thewire/scripts/counter.js"></script> -<form action="<?php echo elgg_get_site_url(); ?>action/thewire/add" method="post" name="new_post"> - <?php - $action_txt = elgg_echo('post'); - $display .= "<textarea name='new_post_textarea' value='' onKeyDown=\"textCounter(document.new_post.new_post_textarea,document.new_post.remLen1,140)\" onKeyUp=\"textCounter(document.new_post.new_post_textarea,document.new_post.remLen1,140)\">{$msg}</textarea>"; - $display .= "<input type='submit' class='elgg-button-action' value='{$action_txt}' />"; - $display .= "<div class='character_count'><input readonly type=\"text\" name=\"remLen1\" size=\"3\" maxlength=\"3\" value=\"140\">"; - echo $display; - echo elgg_echo("thewire:charleft") . "</div>"; - echo elgg_view('input/securitytoken'); - ?> - <input type="hidden" name="method" value="site" /> -</form> -</div> -<?php echo elgg_view('input/urlshortener'); ?>
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/metadata.php b/mod/thewire/views/default/thewire/metadata.php new file mode 100644 index 000000000..f04345ed2 --- /dev/null +++ b/mod/thewire/views/default/thewire/metadata.php @@ -0,0 +1,56 @@ +<?php +/** + * + */ + +$entity = $vars['entity']; +$handler = elgg_get_array_value('handler', $vars, ''); + +?> +<ul class="elgg-list-metadata"> +<?php +if (elgg_is_logged_in()) { + echo '<li>'; + echo elgg_view('output/url', array( + 'href' => "pg/thewire/reply/$entity->guid", + 'text' => elgg_echo('thewire:reply'), + )); + echo '</li>'; +} + +if ($entity->reply) { + echo '<li>'; + echo elgg_view('output/url', array( + 'href' => "pg/thewire/previous/$entity->guid", + 'text' => elgg_echo('thewire:previous'), + )); + echo '</li>'; +} + +echo '<li>'; +echo elgg_view('output/url', array( + 'href' => 'pg/thewire/thread/' . $entity->wire_thread, + 'text' => elgg_echo('thewire:thread'), +)); +echo '</li>'; + + +// links to delete or edit. +if ($entity->canEdit() && $handler) { + + $delete_url = "action/$handler/delete?guid={$entity->getGUID()}"; + $delete_link = elgg_view('output/confirmlink', array( + 'href' => $delete_url, + 'text' => '<span class="elgg-icon elgg-icon-delete"></span>', + 'title' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + 'text_encode' => false, + )); + echo "<li>$delete_link</li>"; +} + +$likes = elgg_view_likes($entity); +echo "<li>$likes</li>"; + +?> +</ul>
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/notfound.php b/mod/thewire/views/default/thewire/notfound.php deleted file mode 100644 index a3d08fe18..000000000 --- a/mod/thewire/views/default/thewire/notfound.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - - /** - * Elgg shout not found page - * - * @package ElggShouts - */ - -?> - - <p> - <?php - - echo elgg_echo("thewire:notfound"); - - ?> - </p>
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/profile_status.php b/mod/thewire/views/default/thewire/profile_status.php index 29dc69329..9ff0c4d59 100644 --- a/mod/thewire/views/default/thewire/profile_status.php +++ b/mod/thewire/views/default/thewire/profile_status.php @@ -1,12 +1,11 @@ <?php - /** - * Latest wire post on profile activity page + * Latest wire post on profile page */ $owner = $vars['entity']->guid; -$url_to_wire = elgg_get_site_url() . "pg/thewire/" . $vars['entity']->username; - +$url_to_wire = elgg_get_site_url() . "pg/thewire/owner/" . $vars['entity']->username; + //grab the user's latest from the wire $params = array( 'types' => 'object', @@ -16,11 +15,10 @@ $params = array( ); $latest_wire = elgg_get_entities($params); -if ($latest_wire) { - foreach ($latest_wire as $lw) { - $content = $lw->description; - $time = "<p class='entity-subtext'> (" . elgg_view_friendly_time($lw->time_created) . ")</p>"; - } +if ($latest_wire && count($latest_wire) > 0) { + $latest_wire = $latest_wire[0]; + $content = thewire_filter($latest_wire->description); + $time = "<p class='entity-subtext'> (" . elgg_view_friendly_time($latest_wire->time_created) . ")</p>"; echo "<div class='wire_post'><div class='wire_post_contents clearfix radius8'>"; echo $content; diff --git a/mod/thewire/views/default/thewire/reply.php b/mod/thewire/views/default/thewire/reply.php new file mode 100644 index 000000000..3794e1454 --- /dev/null +++ b/mod/thewire/views/default/thewire/reply.php @@ -0,0 +1,11 @@ +<?php +/** + * Reply header + */ + +$post = $vars['post']; +$poster = $post->getOwnerEntity(); + +?> +<b><?php echo elgg_echo('thewire:replying', array($poster->name)); ?>: </b> +<?php echo $post->description;
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/view.php b/mod/thewire/views/default/thewire/view.php deleted file mode 100644 index 725643cd1..000000000 --- a/mod/thewire/views/default/thewire/view.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - - /** - * Elgg thewire view page - * - * @package ElggTheWire - * - * @uses $vars['entity'] An array of wire notes to view - * - */ - - // If there are any wire notes to view, view them - if (is_array($vars['entity']) && sizeof($vars['entity']) > 0) { - - foreach($vars['entity'] as $shout) { - - echo elgg_view_entity($shout); - - } - - } - -?>
\ No newline at end of file |