From 6005959c37acf42042be7281521d1f37ff56e677 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 9 Jul 2010 04:48:16 +0000 Subject: Added ecml help for web service embeds. git-svn-id: http://code.elgg.org/elgg/trunk@6668 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/ecml/graphics/dailymotion.png | Bin 0 -> 179131 bytes mod/ecml/graphics/googlemaps.png | Bin 0 -> 150177 bytes mod/ecml/graphics/redlasso_1.png | Bin 0 -> 178296 bytes mod/ecml/graphics/redlasso_2.png | Bin 0 -> 162730 bytes mod/ecml/graphics/slideshare.png | Bin 0 -> 149631 bytes mod/ecml/graphics/vimeo.png | Bin 0 -> 174545 bytes mod/ecml/graphics/youtube.png | Bin 0 -> 158669 bytes mod/ecml/languages/en.php | 24 +++++++++++++++++++++ mod/ecml/start.php | 24 +++++++++++++++++---- mod/ecml/views/default/ecml/help/blip.tv.php | 12 +++++++++++ mod/ecml/views/default/ecml/help/dailymotion.php | 12 +++++++++++ mod/ecml/views/default/ecml/help/googlemaps.php | 12 +++++++++++ mod/ecml/views/default/ecml/help/livevideo.php | 12 +++++++++++ mod/ecml/views/default/ecml/help/redlasso.php | 13 +++++++++++ mod/ecml/views/default/ecml/help/slideshare.php | 12 +++++++++++ mod/ecml/views/default/ecml/help/vimeo.php | 12 +++++++++++ mod/ecml/views/default/ecml/help/youtube.php | 12 +++++++++++ mod/ecml/views/default/ecml/keyword_help.php | 18 ++++++++++++++++ .../views/default/ecml/keywords/googlemaps.php | 2 ++ mod/ecml/views/default/ecml/keywords/livevideo.php | 3 ++- .../views/default/embed/web_services/content.php | 11 ++++++++-- 21 files changed, 172 insertions(+), 7 deletions(-) create mode 100644 mod/ecml/graphics/dailymotion.png create mode 100644 mod/ecml/graphics/googlemaps.png create mode 100644 mod/ecml/graphics/redlasso_1.png create mode 100644 mod/ecml/graphics/redlasso_2.png create mode 100644 mod/ecml/graphics/slideshare.png create mode 100644 mod/ecml/graphics/vimeo.png create mode 100644 mod/ecml/graphics/youtube.png create mode 100644 mod/ecml/views/default/ecml/help/blip.tv.php create mode 100644 mod/ecml/views/default/ecml/help/dailymotion.php create mode 100644 mod/ecml/views/default/ecml/help/googlemaps.php create mode 100644 mod/ecml/views/default/ecml/help/livevideo.php create mode 100644 mod/ecml/views/default/ecml/help/redlasso.php create mode 100644 mod/ecml/views/default/ecml/help/slideshare.php create mode 100644 mod/ecml/views/default/ecml/help/vimeo.php create mode 100644 mod/ecml/views/default/ecml/help/youtube.php create mode 100644 mod/ecml/views/default/ecml/keyword_help.php (limited to 'mod') diff --git a/mod/ecml/graphics/dailymotion.png b/mod/ecml/graphics/dailymotion.png new file mode 100644 index 000000000..67950f81c Binary files /dev/null and b/mod/ecml/graphics/dailymotion.png differ diff --git a/mod/ecml/graphics/googlemaps.png b/mod/ecml/graphics/googlemaps.png new file mode 100644 index 000000000..6e4d2f490 Binary files /dev/null and b/mod/ecml/graphics/googlemaps.png differ diff --git a/mod/ecml/graphics/redlasso_1.png b/mod/ecml/graphics/redlasso_1.png new file mode 100644 index 000000000..caf3ae4f6 Binary files /dev/null and b/mod/ecml/graphics/redlasso_1.png differ diff --git a/mod/ecml/graphics/redlasso_2.png b/mod/ecml/graphics/redlasso_2.png new file mode 100644 index 000000000..2c7ba64a0 Binary files /dev/null and b/mod/ecml/graphics/redlasso_2.png differ diff --git a/mod/ecml/graphics/slideshare.png b/mod/ecml/graphics/slideshare.png new file mode 100644 index 000000000..19ecd6b75 Binary files /dev/null and b/mod/ecml/graphics/slideshare.png differ diff --git a/mod/ecml/graphics/vimeo.png b/mod/ecml/graphics/vimeo.png new file mode 100644 index 000000000..ae8b4086f Binary files /dev/null and b/mod/ecml/graphics/vimeo.png differ diff --git a/mod/ecml/graphics/youtube.png b/mod/ecml/graphics/youtube.png new file mode 100644 index 000000000..ed31af05a Binary files /dev/null and b/mod/ecml/graphics/youtube.png differ diff --git a/mod/ecml/languages/en.php b/mod/ecml/languages/en.php index dfe6b3f50..41172f2fd 100644 --- a/mod/ecml/languages/en.php +++ b/mod/ecml/languages/en.php @@ -17,18 +17,38 @@ $english = array( 'ecml:views:annotation_generic_comment' => 'Comments', // keywords + 'ecml:keywords:googlemaps' => 'Google Maps', 'ecml:keywords:googlemaps:desc' => 'Embed a Google Map.', 'ecml:keywords:googlemaps:usage' => '[googlemaps src="URL"] Use the link code from Google Maps as the src.', + 'ecml:keywords:slideshare' => 'Slide Share', 'ecml:keywords:slideshare:desc' => 'Embed a Slideshare slide.', 'ecml:keywords:slideshare:usage' => '[slideshare id="slideshare_id"] Use the Wordpress.com embed code.', + 'ecml:keywords:vimeo' => 'Vimeo', 'ecml:keywords:vimeo:desc' => 'Embed a Vimeo video.', 'ecml:keywords:videmo:usage' => '[videmo src="URL"] Use a standard Vimeo URL as the source.', + 'ecml:keywords:youtube' => 'YouTube', 'ecml:keywords:youtube:desc' => 'Embed a YouTube video.', 'ecml:keywords:youtube:usage' => '[youtube src="URL"] Use a standard YouTube URL as the source.', + 'ecml:keywords:blip.tv' => 'blip.tv', + 'ecml:keywords:blip.tv:desc' => 'Embed a blip.tv video.', + 'ecml:keywords:blip.tv:usage' => '[blip.tv ID] use the Wordpress.com embed code.', + + 'ecml:keywords:dailymotion' => 'Daily Motion', + 'ecml:keywords:dailymotion:desc' => 'Embed a Daily Motion video.', + 'ecml:keywords:dailymotion:usage' => '[dailymotion src="URL"] Use a standard Daily Motion URL as the source.', + + 'ecml:keywords:livevideo' => 'Live Video', + 'ecml:keywords:livevideo:desc' => 'Embed a Live Video video.', + 'ecml:keywords:livevideo:usage' => '[livevideo src="URL"] Use a standard livevideo URL as the source.', + + 'ecml:keywords:redlasso' => 'Red Lasso', + 'ecml:keywords:redlasso:desc' => 'Embed a Red Lasso video.', + 'ecml:keywords:redlasso:usage' => '[redlasso id="URL"] Use the Wordpress.com embed code.', + // keyword help 'ecml:keywords_title' => 'Keywords', 'ecml:keywords_instructions' => @@ -65,6 +85,10 @@ grid below. 'ecml:admin:cannot_save_permissions' => 'Cannot save ECML permissions!', 'ecml:admin:restricted' => 'Restricted', + // embed support + 'ecml:embed:web_services' => 'Web Services', + 'ecml:embed:instructions' => 'Select a service for instructions on how to get embed code or paste the code in directly.', + ); diff --git a/mod/ecml/start.php b/mod/ecml/start.php index 1c1bbd3fd..68b9f7360 100644 --- a/mod/ecml/start.php +++ b/mod/ecml/start.php @@ -86,9 +86,25 @@ function ecml_init() { * @param array $page */ function ecml_help_page_handler($page) { - $content = elgg_view('ecml/help'); - $body = elgg_view_layout('one_column_with_sidebar', $content); - echo page_draw(elgg_echo('ecml:help'), $body); + if (!isset($page[0]) || empty($page[0])) { + $content = elgg_view('ecml/help'); + $body = elgg_view_layout('one_column_with_sidebar', $content); + echo page_draw(elgg_echo('ecml:help'), $body); + } else { + // asking for detailed help about a keyword + $keyword = $page[0]; + $content = elgg_view('ecml/keyword_help', array('keyword' => $keyword)); + + if (get_input('ajax', FALSE)) { + echo $content; + exit; + } else { + $body = elgg_view_layout('one_column_with_sidebar', $content); + echo page_draw(elgg_echo('ecml:help'), $body); + } + } + + return TRUE; } /** @@ -261,7 +277,7 @@ function ecml_embed_web_services_hook($hook, $type, $value, $params) { // we're using a view override for this section's content // so only need to pass the name. $value['web_services'] = array( - 'name' => elgg_echo('embed:web_services') + 'name' => elgg_echo('ecml:embed:web_services') ); return $value; diff --git a/mod/ecml/views/default/ecml/help/blip.tv.php b/mod/ecml/views/default/ecml/help/blip.tv.php new file mode 100644 index 000000000..f462ab1e0 --- /dev/null +++ b/mod/ecml/views/default/ecml/help/blip.tv.php @@ -0,0 +1,12 @@ +' . elgg_echo('ecml:keywords:blip.tv') . ''; +echo '

' . elgg_echo('ecml:keywords:blip.tv:desc') . '

'; +echo '

' . elgg_echo('ecml:keywords:blip.tv:usage') . '

'; + +?> + + \ No newline at end of file diff --git a/mod/ecml/views/default/ecml/help/dailymotion.php b/mod/ecml/views/default/ecml/help/dailymotion.php new file mode 100644 index 000000000..de4add4ff --- /dev/null +++ b/mod/ecml/views/default/ecml/help/dailymotion.php @@ -0,0 +1,12 @@ +' . elgg_echo('ecml:keywords:dailymotion') . ''; +echo '

' . elgg_echo('ecml:keywords:dailymotion:desc') . '

'; +echo '

' . elgg_echo('ecml:keywords:dailymotion:usage') . '

'; + +?> + + \ No newline at end of file diff --git a/mod/ecml/views/default/ecml/help/googlemaps.php b/mod/ecml/views/default/ecml/help/googlemaps.php new file mode 100644 index 000000000..4e99b4c73 --- /dev/null +++ b/mod/ecml/views/default/ecml/help/googlemaps.php @@ -0,0 +1,12 @@ +' . elgg_echo('ecml:keywords:googlemaps') . ''; +echo '

' . elgg_echo('ecml:keywords:googlemaps:desc') . '

'; +echo '

' . elgg_echo('ecml:keywords:googlemaps:usage') . '

'; + +?> + + \ No newline at end of file diff --git a/mod/ecml/views/default/ecml/help/livevideo.php b/mod/ecml/views/default/ecml/help/livevideo.php new file mode 100644 index 000000000..6f3244c45 --- /dev/null +++ b/mod/ecml/views/default/ecml/help/livevideo.php @@ -0,0 +1,12 @@ +' . elgg_echo('ecml:keywords:livevideo') . ''; +echo '

' . elgg_echo('ecml:keywords:livevideo:desc') . '

'; +echo '

' . elgg_echo('ecml:keywords:livevideo:usage') . '

'; + +?> + + \ No newline at end of file diff --git a/mod/ecml/views/default/ecml/help/redlasso.php b/mod/ecml/views/default/ecml/help/redlasso.php new file mode 100644 index 000000000..ec51cbcd2 --- /dev/null +++ b/mod/ecml/views/default/ecml/help/redlasso.php @@ -0,0 +1,13 @@ +' . elgg_echo('ecml:keywords:redlasso') . ''; +echo '

' . elgg_echo('ecml:keywords:redlasso:desc') . '

'; +echo '

' . elgg_echo('ecml:keywords:redlasso:usage') . '

'; + +?> + + + diff --git a/mod/ecml/views/default/ecml/help/slideshare.php b/mod/ecml/views/default/ecml/help/slideshare.php new file mode 100644 index 000000000..860c70cfc --- /dev/null +++ b/mod/ecml/views/default/ecml/help/slideshare.php @@ -0,0 +1,12 @@ +' . elgg_echo('ecml:keywords:slideshare') . ''; +echo '

' . elgg_echo('ecml:keywords:slideshare:desc') . '

'; +echo '

' . elgg_echo('ecml:keywords:slideshare:usage') . '

'; + +?> + + \ No newline at end of file diff --git a/mod/ecml/views/default/ecml/help/vimeo.php b/mod/ecml/views/default/ecml/help/vimeo.php new file mode 100644 index 000000000..24fd35e31 --- /dev/null +++ b/mod/ecml/views/default/ecml/help/vimeo.php @@ -0,0 +1,12 @@ +' . elgg_echo('ecml:keywords:vimeo') . ''; +echo '

' . elgg_echo('ecml:keywords:vimeo:desc') . '

'; +echo '

' . elgg_echo('ecml:keywords:vimeo:usage') . '

'; + +?> + + \ No newline at end of file diff --git a/mod/ecml/views/default/ecml/help/youtube.php b/mod/ecml/views/default/ecml/help/youtube.php new file mode 100644 index 000000000..42febde2c --- /dev/null +++ b/mod/ecml/views/default/ecml/help/youtube.php @@ -0,0 +1,12 @@ +' . elgg_echo('ecml:keywords:youtube') . ''; +echo '

' . elgg_echo('ecml:keywords:youtube:desc') . '

'; +echo '

' . elgg_echo('ecml:keywords:youtube:usage') . '

'; + +?> + + \ No newline at end of file diff --git a/mod/ecml/views/default/ecml/keyword_help.php b/mod/ecml/views/default/ecml/keyword_help.php new file mode 100644 index 000000000..6f9021fdd --- /dev/null +++ b/mod/ecml/views/default/ecml/keyword_help.php @@ -0,0 +1,18 @@ + 'embed')); $link_href = elgg_http_add_url_query_elements($src, array('source' => 'embed')); diff --git a/mod/ecml/views/default/ecml/keywords/livevideo.php b/mod/ecml/views/default/ecml/keywords/livevideo.php index b067b1ab6..47e132aac 100644 --- a/mod/ecml/views/default/ecml/keywords/livevideo.php +++ b/mod/ecml/views/default/ecml/keywords/livevideo.php @@ -16,7 +16,8 @@ $height = (isset($vars['height'])) ? $vars['height'] : 369; if ($src) { $parts = explode('/', $src); - $vid = $parts[1]; + $vid = $parts[0]; + // it automatically autostarts, but not passing it causes control issues $url = "http://www.livevideo.com/flvplayer/embed/$vid&autoStart=1"; diff --git a/mod/ecml/views/default/embed/web_services/content.php b/mod/ecml/views/default/embed/web_services/content.php index 42e9279c9..0f3fa330d 100644 --- a/mod/ecml/views/default/embed/web_services/content.php +++ b/mod/ecml/views/default/embed/web_services/content.php @@ -49,6 +49,8 @@ $embed = elgg_view('input/button', array( 'disabled' => TRUE )); +echo '

' . elgg_echo('ecml:embed:instructions') . '

'; +echo '
'; echo $input; echo '

ECML:

'; echo $keywords_html; @@ -70,7 +72,8 @@ $(function() { // counter for paused input to try to validate/generate a preview. var rest_timeout_id = null; var rest_min_time = 750; - var embed_generate_ecml_url = '/pg/ecml_generate'; + var embed_generate_ecml_url = 'pg/ecml_generate'; + var embed_ecml_keyword_help_url = 'pg/ecml/'; var internal_name = ''; var web_services_ecml_update = function() { @@ -161,8 +164,12 @@ $(function() { // manually specify the service $('.ecml_web_service a').click(function() { - select_service($(this).attr('class')); + select_service($(this).attr('class').split(' ')[0]); manual_selected_service = true; + + // show tip + var help_url = embed_ecml_keyword_help_url + selected_service + '?ajax=true'; + $('#embed_ecml_keyword_help').load(help_url); }); $('#embed_submit').click(function() { -- cgit v1.2.3