diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:56:18 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:56:18 -0300 |
commit | a7be81c3f81c807d43ed32965ee7ac11ebe71895 (patch) | |
tree | 71751c05eb80ae6e348790f3e46652c9dfe0be7d /mod/livestream/views | |
parent | f3beeb45f9f192aee6ede0c9b6f0fa8b8d82a9ef (diff) | |
parent | 059badecbc0be895c6165430e5096a9ab653027e (diff) | |
download | elgg-a7be81c3f81c807d43ed32965ee7ac11ebe71895.tar.gz elgg-a7be81c3f81c807d43ed32965ee7ac11ebe71895.tar.bz2 |
Merge commit '059badecbc0be895c6165430e5096a9ab653027e' as 'mod/livestream'
Diffstat (limited to 'mod/livestream/views')
-rwxr-xr-x | mod/livestream/views/default/delete.php | 37 | ||||
-rwxr-xr-x | mod/livestream/views/default/list.php | 15 | ||||
-rwxr-xr-x | mod/livestream/views/default/livestream/groupprofile_livestream.php | 32 | ||||
-rwxr-xr-x | mod/livestream/views/default/new.php | 27 | ||||
-rwxr-xr-x | mod/livestream/views/default/object/list.php | 14 | ||||
-rwxr-xr-x | mod/livestream/views/default/object/livestream.php | 38 | ||||
-rwxr-xr-x | mod/livestream/views/default/view.php | 50 |
7 files changed, 213 insertions, 0 deletions
diff --git a/mod/livestream/views/default/delete.php b/mod/livestream/views/default/delete.php new file mode 100755 index 000000000..b6121e9ce --- /dev/null +++ b/mod/livestream/views/default/delete.php @@ -0,0 +1,37 @@ +<?php + /** + * Elgg livestream plugin + * + * @package LiveStream + */ +$streamid = $vars['streamid']; +$item = livestream_get($streamid); + +?> +<div class="contentWrapper"> +<form action="<?php echo $vars['url']; ?>action/livestream/delete" enctype="multipart/form-data" method="post"> +<?php echo elgg_view('input/securitytoken'); ?> +<p> + <label> + <?php echo elgg_echo("livestream:delete:ask"); ?><br /> + </label> +</p> + + +<?php + if ($item->guid){ + echo elgg_view( + 'input/hidden', + array( + 'internalname' => 'stream_id', + 'options_values' => $options, + 'value' => $item->guid + ) + ); + } +?> + +<p><input type="submit" value="<?php echo elgg_echo('livestream:delete'); ?>" /></p> + +</form> +</div> diff --git a/mod/livestream/views/default/list.php b/mod/livestream/views/default/list.php new file mode 100755 index 000000000..a5b10465e --- /dev/null +++ b/mod/livestream/views/default/list.php @@ -0,0 +1,15 @@ +<?php +$page_owner = page_owner_entity(); +$offset = get_input('offset', 0); + +$options = Array( + 'type' => 'object', + 'subtype' => 'livestream', + 'container_guids' => Array($page_owner->guid), + 'offset' => $offset, + 'limit' => 4 +); + +echo elgg_list_entities($options); + +?>
\ No newline at end of file diff --git a/mod/livestream/views/default/livestream/groupprofile_livestream.php b/mod/livestream/views/default/livestream/groupprofile_livestream.php new file mode 100755 index 000000000..6cb8378a9 --- /dev/null +++ b/mod/livestream/views/default/livestream/groupprofile_livestream.php @@ -0,0 +1,32 @@ +<?php +$page_owner = elgg_get_page_owner_entity(); + +$options = array( + 'type' => 'object', + 'subtype' => 'livestream', + 'container_guid' => elgg_get_page_owner_guid(), + 'limit' => 6, + 'full_view' => false, + 'pagination' => false, +); + + +$content = elgg_list_entities($options); +$new_link = elgg_view('output/url', array( + 'href' => $CONFIG->wwwroot.'livestream/'.$page_owner->username.'/new/', + 'text' => elgg_echo('livestream:new_item'), +)); +$viewall_link = elgg_view('output/url', array( + 'href' => $CONFIG->wwwroot . "livestream/" . $page_owner->username, + 'text' => elgg_echo('livestream:viewall'), +)); + +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('livestream:group'), + 'content' => $content, + 'add_link' => $new_link, + 'all_link' => $viewall_link +)); + + +?> diff --git a/mod/livestream/views/default/new.php b/mod/livestream/views/default/new.php new file mode 100755 index 000000000..e318f70fd --- /dev/null +++ b/mod/livestream/views/default/new.php @@ -0,0 +1,27 @@ +<?php + /** + * Elgg livestream plugin + * + * @package LiveStream + * @todo JS validation + */ + + $form_body = ""; + $form_body.= elgg_echo("livestream:title")."<br />".elgg_view('input/text', array('internalname' => 'title', 'value' => ''))."<br />"; + $form_body.= elgg_echo("livestream:type")."<br />".elgg_view('input/radio', array('internalname' => 'mediatype', 'value' => '', 'options' => livestream_gettypes()))."<br />"; + $form_body.= elgg_echo("livestream:src").elgg_view('input/text', array('internalname' => 'src', 'value' => ''))."<br />"; + $form_body.= elgg_echo("livestream:width").elgg_view('input/text', array('internalname' => 'width', 'value' => '80'))."<br />"; + $form_body.= elgg_echo("livestream:height").elgg_view('input/text', array('internalname' => 'height', 'value' => '50'))."<br />"; + $form_body.= elgg_view( + 'input/hidden', + array( + 'internalname' => 'container_guid', + 'options_values' => $options, + 'value' => $vars['entity']->container_id?(int)$vars['entity']->container_id : page_owner() + ) + ); + $form_body.= "<input type='submit' value='".elgg_echo("livestream:save")."'>"; + echo elgg_view('input/form', array('body' => $form_body, 'action' => $vars['url']."action/livestream/new")); + + //$object = new ElggObject(); +?> diff --git a/mod/livestream/views/default/object/list.php b/mod/livestream/views/default/object/list.php new file mode 100755 index 000000000..9ab6789bd --- /dev/null +++ b/mod/livestream/views/default/object/list.php @@ -0,0 +1,14 @@ +<?php + $item = $vars['entity']; + $owner = livestream_get_owner($item); + + $row = " + <div class=\"contentWrapper\"> + <br /> + <a href=\"".$CONFIG->wwwroot."livestream/".$owner->username."/view/".$item->guid."\">".$item->title."</a> + </div> + "; + + echo elgg_echo($row); + +?> diff --git a/mod/livestream/views/default/object/livestream.php b/mod/livestream/views/default/object/livestream.php new file mode 100755 index 000000000..ea500aa10 --- /dev/null +++ b/mod/livestream/views/default/object/livestream.php @@ -0,0 +1,38 @@ +<?php +$item = livestream_get($vars['entity']->guid); + + +//foreach($data as $x => $item){ + $src = $item->src; + + $owner = livestream_get_owner($item); + + /* the following html code raises this funny notice + * + * NOTICE: SELECT e.* from elgg_users_entity u join elgg_entities e on e.guid=u.guid where + * + * u.username='com.fluendo.player.Cortado.class' + * + * and ( (e.access_id = -2\n\t\t\tAND e.owner_guid + * IN (\n\t\t\t\tSELECT guid_one FROM + * elgg_entity_relationships\n\t\t\t\tWHERE relationship='friend' AND guid_two=6\n\t\t\t)) + * OR (e.access_id IN (2,1,4,5,6)\n\t\t\tOR (e.owner_guid = 6)\n\t\t\tOR + * (\n\t\t\t\te.access_id = 0\n\t\t\t\tAND e.owner_guid = 6\n\t\t\t)\n\t\t) + * and e.enabled='yes') results cached, referer: + * http://localhost/lorea/elgg/livestream/alice + * + * */ + + $player = "<a href=\"".$CONFIG->wwwroot."livestream/".$owner->username."/view/".$item->guid."\">".$item->title."</a>"; + + $row = " + <div class=\"contentWrapper\"> + $player + </div> + "; + + + echo elgg_echo($row); +//} + +?> diff --git a/mod/livestream/views/default/view.php b/mod/livestream/views/default/view.php new file mode 100755 index 000000000..4c13dfbab --- /dev/null +++ b/mod/livestream/views/default/view.php @@ -0,0 +1,50 @@ +<?php + /** + * Elgg livestream plugin + * + * @package LiveStream + */ +$streamid = $vars['streamid']; +$item = livestream_get($streamid); + +if($item){ + $src = $item->src; + /* the following html code raises this funny notice + * + * NOTICE: SELECT e.* from elgg_users_entity u join elgg_entities e on e.guid=u.guid where + * + * u.username='com.fluendo.player.Cortado.class' + * + * and ( (e.access_id = -2\n\t\t\tAND e.owner_guid + * IN (\n\t\t\t\tSELECT guid_one FROM + * elgg_entity_relationships\n\t\t\t\tWHERE relationship='friend' AND guid_two=6\n\t\t\t)) + * OR (e.access_id IN (2,1,4,5,6)\n\t\t\tOR (e.owner_guid = 6)\n\t\t\tOR + * (\n\t\t\t\te.access_id = 0\n\t\t\t\tAND e.owner_guid = 6\n\t\t\t)\n\t\t) + * and e.enabled='yes') results cached, referer: + * http://localhost/lorea/elgg/livestream/alice + * + * */ + + $autoplay = ($item->autoplay) ? "autoplay" : ""; + + $row = " + <div> + $item->title<br /> + <video $autoplay src='$src' controls width=320 height=240> + <applet code='com.fluendo.player.Cortado.class' archive='cortado.jar' height='240' width='320'> + <param name='url' value='".$item->src."'> + <param name='local' value='false'> + <param name='keepaspect' value='true'> + <param name='".$item->mediatype."' value='true'> + <param name='bufferSize' value='60'> + </applet> + </video> + <br /> + </div> + "; + + echo elgg_echo($row); +} + + +?> |