diff options
Diffstat (limited to 'mod/thewire/views/default/thewire')
-rw-r--r-- | mod/thewire/views/default/thewire/css.php | 35 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/previous.php | 11 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/profile_status.php | 44 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/reply.php | 14 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/scripts/counter.js | 25 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/sidebar.php | 9 |
6 files changed, 138 insertions, 0 deletions
diff --git a/mod/thewire/views/default/thewire/css.php b/mod/thewire/views/default/thewire/css.php new file mode 100644 index 000000000..d11cce74a --- /dev/null +++ b/mod/thewire/views/default/thewire/css.php @@ -0,0 +1,35 @@ +<?php +/** + * The Wire CSS + */ + +?> +/******************************** +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; +} +.thewire-characters-remaining-warning { + color: #D40D12 !important; +} +.thewire-parent { + margin-left: 40px; +} diff --git a/mod/thewire/views/default/thewire/previous.php b/mod/thewire/views/default/thewire/previous.php new file mode 100644 index 000000000..e1ca83e24 --- /dev/null +++ b/mod/thewire/views/default/thewire/previous.php @@ -0,0 +1,11 @@ +<?php +/** + * Serve up html for a post + */ + +$guid = (int) get_input('guid'); + +$parent = thewire_get_parent($guid); +if ($parent) { + echo elgg_view_entity($parent); +} diff --git a/mod/thewire/views/default/thewire/profile_status.php b/mod/thewire/views/default/thewire/profile_status.php new file mode 100644 index 000000000..26e1403fe --- /dev/null +++ b/mod/thewire/views/default/thewire/profile_status.php @@ -0,0 +1,44 @@ +<?php +/** + * Latest wire post on profile page + * + * @uses $vars['entity'] User that owns this profile page + */ + +$owner = $vars['entity']->guid; + +//grab the user's latest from the wire +$params = array( + 'type' => 'object', + 'subtype' => 'thewire', + 'owner_guid' => $owner, + 'limit' => 1, +); +$latest_wire = elgg_get_entities($params); + +if ($latest_wire && count($latest_wire) > 0) { + $latest_wire = $latest_wire[0]; + $content = thewire_filter($latest_wire->description); + $time = "<p class='elgg-subtext'>(" . elgg_view_friendly_time($latest_wire->time_created) . ")</p>"; + + $button = ''; + if ($owner == elgg_get_logged_in_user_guid()) { + $url_to_wire = "thewire/owner/" . $vars['entity']->username; + $button = elgg_view('output/url', array( + 'text' => elgg_echo('thewire:update'), + 'href' => $url_to_wire, + 'class' => 'elgg-button elgg-button-action float-alt', + 'is_trusted' => true, + )); + } + + $body = $content . $time; + $content = elgg_view_image_block('', $body, array('image_alt' => $button)); + + echo <<< HTML +<div class="wire-status elgg-border-plain pam mbm clearfix"> + $content +</div> +HTML; + +} diff --git a/mod/thewire/views/default/thewire/reply.php b/mod/thewire/views/default/thewire/reply.php new file mode 100644 index 000000000..341b691b1 --- /dev/null +++ b/mod/thewire/views/default/thewire/reply.php @@ -0,0 +1,14 @@ +<?php +/** + * Reply header + */ + +$post = $vars['post']; +$poster = $post->getOwnerEntity(); +$poster_details = array( + htmlspecialchars($poster->name, ENT_QUOTES, 'UTF-8'), + htmlspecialchars($poster->username, ENT_QUOTES, 'UTF-8'), +); +?> +<b><?php echo elgg_echo('thewire:replying', $poster_details); ?>: </b> +<?php echo $post->description;
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/scripts/counter.js b/mod/thewire/views/default/thewire/scripts/counter.js new file mode 100644 index 000000000..0d416fa9a --- /dev/null +++ b/mod/thewire/views/default/thewire/scripts/counter.js @@ -0,0 +1,25 @@ +/** + * Elgg thewire text counter + * + * @package ElggTheWire + * + * @question - do we want users to be able to edit thewire? + * + * @uses $vars['entity'] Optionally, the note to view + +<!-- Dynamic Version by: Nannette Thacker --> +<!-- http://www.shiningstar.net --> +<!-- Original by : Ronnie T. Moore --> +<!-- Web Site: The JavaScript Source --> +<!-- Limit the number of characters per textarea --> +*/ + +function textCounter(field,cntfield,maxlimit) { + // if too long...trim it! + if (field.value.length > maxlimit) { + field.value = field.value.substring(0, maxlimit); + } else { + // otherwise, update 'characters left' counter + cntfield.value = maxlimit - field.value.length; + } +} diff --git a/mod/thewire/views/default/thewire/sidebar.php b/mod/thewire/views/default/thewire/sidebar.php new file mode 100644 index 000000000..a8aadd1f8 --- /dev/null +++ b/mod/thewire/views/default/thewire/sidebar.php @@ -0,0 +1,9 @@ +<?php +/** + * The wire sidebar + */ + +echo elgg_view('page/elements/tagcloud_block', array( + 'subtypes' => 'thewire', + 'owner_guid' => elgg_get_page_owner_guid(), +)); |