From d146923c93e58d604c44869238f406c714669826 Mon Sep 17 00:00:00 2001 From: pete Date: Tue, 16 Mar 2010 12:09:44 +0000 Subject: Updated Embed mod to new UI. git-svn-id: http://code.elgg.org/elgg/trunk@5415 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/embed/embed.php | 67 +++++---- mod/embed/images/button_spacer.gif | Bin 43 -> 0 bytes mod/embed/images/loading.gif | Bin 4421 -> 0 bytes mod/embed/images/media_modal.png | Bin 131886 -> 0 bytes mod/embed/start.php | 83 ++++++----- mod/embed/views/default/embed/css.php | 162 +++++++++------------- mod/embed/views/default/embed/js.php | 10 +- mod/embed/views/default/embed/link.php | 2 +- mod/embed/views/default/embed/media.php | 6 +- mod/embed/views/default/embed/pagination.php | 5 +- mod/embed/views/default/embed/simpletype.php | 64 ++++----- mod/embed/views/default/embed/tabs.php | 5 +- mod/embed/views/default/embed/upload.php | 147 ++++++++++---------- mod/embed/views/default/group/default/embed.php | 4 - mod/embed/views/default/object/default/embed.php | 4 - mod/embed/views/default/object/file/embed.php | 1 - mod/embed/views/default/object/file/embedlist.php | 14 +- mod/embed/views/default/site/default/embed.php | 8 +- mod/embed/views/default/user/default/embed.php | 8 +- 19 files changed, 266 insertions(+), 324 deletions(-) delete mode 100644 mod/embed/images/button_spacer.gif delete mode 100644 mod/embed/images/loading.gif delete mode 100644 mod/embed/images/media_modal.png diff --git a/mod/embed/embed.php b/mod/embed/embed.php index 461bbdebb..358547491 100644 --- a/mod/embed/embed.php +++ b/mod/embed/embed.php @@ -1,38 +1,37 @@ array('file')); - // This page can only be run from within the Elgg framework - if (!is_callable('elgg_view')) exit; - - // Get the name of the form field we need to inject into - $internalname = get_input('internalname'); - - if (!isloggedin()) exit; - - global $SESSION; - - $offset = (int) get_input('offset',0); - $simpletype = get_input('simpletype'); - $entity_types = array('object' => array('file')); - - if (empty($simpletype)) { - $count = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'owner_guid' => $SESSION['user']->guid, 'count' => TRUE)); - $entities = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset)); - } else { - $count = elgg_get_entities_from_metadata(array('metadata_name' => 'simpletype', 'metadata_value' => $simpletype, 'types' => 'object', 'subtypes' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset, 'count' => TRUE)); - $entities = elgg_get_entities_from_metadata(array('metadata_name' => 'simpletype', 'metadata_value' => $simpletype, 'types' => 'object', 'subtypes' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset)); - } - - $types = get_tags(0,10,'simpletype','object','file',$SESSION['user']->guid); - - // Echo the embed view - echo elgg_view('embed/media', array( - 'entities' => $entities, - 'internalname' => $internalname, - 'offset' => $offset, - 'count' => $count, - 'simpletype' => $simpletype, - 'limit' => 6, - 'simpletypes' => $types, - )); + if (empty($simpletype)) { + $count = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'owner_guid' => $SESSION['user']->guid, 'count' => TRUE)); + $entities = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset)); + } else { + $count = elgg_get_entities_from_metadata(array('metadata_name' => 'simpletype', 'metadata_value' => $simpletype, 'types' => 'object', 'subtypes' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset, 'count' => TRUE)); + $entities = elgg_get_entities_from_metadata(array('metadata_name' => 'simpletype', 'metadata_value' => $simpletype, 'types' => 'object', 'subtypes' => 'file', 'owner_guid' => $SESSION['user']->guid, 'limit' => 6, 'offset' => $offset)); + } + + $types = get_tags(0,10,'simpletype','object','file',$SESSION['user']->guid); + +// Echo the embed view + echo elgg_view('embed/media', array( + 'entities' => $entities, + 'internalname' => $internalname, + 'offset' => $offset, + 'count' => $count, + 'simpletype' => $simpletype, + 'limit' => 6, + 'simpletypes' => $types, + )); ?> \ No newline at end of file diff --git a/mod/embed/images/button_spacer.gif b/mod/embed/images/button_spacer.gif deleted file mode 100644 index 5bfd67a2d..000000000 Binary files a/mod/embed/images/button_spacer.gif and /dev/null differ diff --git a/mod/embed/images/loading.gif b/mod/embed/images/loading.gif deleted file mode 100644 index 5a9af96d2..000000000 Binary files a/mod/embed/images/loading.gif and /dev/null differ diff --git a/mod/embed/images/media_modal.png b/mod/embed/images/media_modal.png deleted file mode 100644 index 9d206901a..000000000 Binary files a/mod/embed/images/media_modal.png and /dev/null differ diff --git a/mod/embed/start.php b/mod/embed/start.php index b14767381..d6bdcc0c9 100644 --- a/mod/embed/start.php +++ b/mod/embed/start.php @@ -1,50 +1,49 @@ + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ - /** - * Elgg media embed plugin - * - * @package ElggEmbed - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - - /** - * Init function - * - */ - function embed_init() { - - // Extend useful views with stuff we need for our embed modal - elgg_extend_view('css','embed/css'); - elgg_extend_view('js/initialise_elgg','embed/js'); - elgg_extend_view('metatags','embed/metatags'); - elgg_extend_view('input/longtext','embed/link',10); - - // Page handler for the modal media embed - register_page_handler('embed','embed_page_handler'); - - } +/** + * Init function + * + */ + function embed_init() { - /** - * Runs the 'embed' script - * - */ - function embed_page_handler($page) { - - switch($page[0]) { - case 'upload': require_once(dirname(__FILE__) . '/upload.php'); - exit; - break; - default: require_once(dirname(__FILE__) . '/embed.php'); - exit; - break; - } + // Extend useful views with stuff we need for our embed modal + elgg_extend_view('css','embed/css'); + elgg_extend_view('js/initialise_elgg','embed/js'); + elgg_extend_view('metatags','embed/metatags'); + elgg_extend_view('input/longtext','embed/link',10); + // Page handler for the modal media embed + register_page_handler('embed','embed_page_handler'); + + } + +/** + * Runs the 'embed' script + * + */ + function embed_page_handler($page) { + + switch($page[0]) { + case 'upload': require_once(dirname(__FILE__) . '/upload.php'); + exit; + break; + default: require_once(dirname(__FILE__) . '/embed.php'); + exit; + break; } + + } - // Register the init action - register_elgg_event_handler('init','system','embed_init',10); +// Register the init action + register_elgg_event_handler('init','system','embed_init',10); ?> diff --git a/mod/embed/views/default/embed/css.php b/mod/embed/views/default/embed/css.php index 31d474a61..1b4f3ca80 100644 --- a/mod/embed/views/default/embed/css.php +++ b/mod/embed/views/default/embed/css.php @@ -1,15 +1,13 @@ - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.org/ - */ - +/** + * Elgg embed CSS - standard across all themes + * + * @package embed + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ ?> #facebox { @@ -24,7 +22,7 @@ } #facebox .body { padding: 10px; - background: white; + background-color: white; width: 730px; -webkit-border-radius: 12px; -moz-border-radius: 12px; @@ -49,10 +47,6 @@ #facebox .footer img.close_image:hover { background: url(mod/embed/images/close_button.gif) no-repeat left -31px; } -#facebox .footer a { - -moz-outline: none; - outline: none; -} #facebox_overlay { position: fixed; top: 0px; @@ -67,14 +61,49 @@ background-color: #000000; z-index: 9999; } - * html #facebox_overlay { /* ie6 hack */ position: absolute; height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); } +/* entity listing overrides */ +#media_upload, +#media_embed { + margin:0 5px 10px 5px; + padding:10px; + border:2px solid #dedede; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + background: #dedede; +} +#media_embed .entity_listing { + margin:0; + padding:0; + background-color: white; +} +#media_embed .entity_listing_info { + width:610px; +} +#media_upload .input_textarea { + height:100px; + width:682px; +} +#media_embed .embed_instructions { + margin:10px 0 5px 0; +} +a.embed_media { + margin:0; + float:right; + display:block; + text-align: right; + font-weight: normal; +} +label a.embed_media { + font-size:0.8em; +} + -/* EMBED MEDIA TABS */ +/* modal tabs */ #embed_media_tabs { margin:10px 0 0 10px; padding:0; @@ -90,15 +119,15 @@ } #embed_media_tabs ul li a { font-weight: bold; - font-size:1.35em; + font-size:1.2em; text-align: center; text-decoration: none; color:#b6b6b6; background: white; display: block; - padding: 0 10px 0 10px; + padding: 3px 10px 0 10px; margin:0 10px 0 10px; - height:25px; + height:20px; width:auto; border-top:2px solid #dedede; border-left:2px solid #dedede; @@ -108,9 +137,6 @@ -webkit-border-top-left-radius: 8px; -webkit-border-top-right-radius: 8px; } -/* IE6 fix */ -* html #embed_media_tabs ul li a { display: inline; } - #embed_media_tabs ul li a:hover { background:#b6b6b6; color:white; @@ -129,94 +155,40 @@ background: #dedede; color:#666666; position: relative; - /* top: 2px; - only needed if selected tab needs to sit over a border */ -} - -#mediaUpload, -#mediaEmbed { - margin:0 5px 10px 5px; - padding:10px; - border:2px solid #dedede; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - background: #dedede; -} -#mediaEmbed .search_listing { - margin:0 0 5px 0; - background: white; } +/* IE6 fix */ +* html #embed_media_tabs ul li a { display: inline; } -h1.mediaModalTitle { - /* color:#0054A7; */ - font-size:1.35em; - line-height:1.2em; - margin:0 0 0 8px; - padding:5px; -} -#mediaEmbed .pagination, -#mediaUpload .pagination { +/* Pagination (override core elgg css defaults) */ +#media_embed .pagination, +#media_upload .pagination { float:right; padding:5px; - background:white; + background-color:white; -webkit-border-radius: 5px; -moz-border-radius: 5px; } -#mediaUpload label { - font-size:120%; -} -#mediaEmbed p.embedInstructions { - margin:10px 0 5px 0; -} -a.embed_media { - margin:0; - float:right; - display:block; - text-align: right; - font-size:1.0em; - font-weight: normal; -} -label a.embed_media { - font-size:0.8em; -} - - - - -/* *************************************** - PAGINATION -*************************************** */ -#mediaEmbed .pagination .pagination_number { +#media_embed .pagination .pagination_number { border:1px solid #999999; color:#666666; } -#mediaEmbed .pagination .pagination_number:hover { - background:#aaaaaa; +#media_embed .pagination .pagination_number:hover { + background-color:#aaaaaa; color:black; } - -#mediaEmbed .pagination .pagination_previous, -#mediaEmbed .pagination .pagination_next { +#media_embed .pagination .pagination_previous, +#media_embed .pagination .pagination_next { border:1px solid #999999; color:#666666; } -#mediaEmbed .pagination .pagination_previous:hover, -#mediaEmbed .pagination .pagination_next:hover { - background:#aaaaaa; +#media_embed .pagination .pagination_previous:hover, +#media_embed .pagination .pagination_next:hover { + background-color:#aaaaaa; color:black; } -#mediaEmbed .pagination .pagination_currentpage { - background:#666666; +#media_embed .pagination .pagination_currentpage { + background-color:#666666; border:1px solid #666666; color:white; -} - - - - - - - - - - +} \ No newline at end of file diff --git a/mod/embed/views/default/embed/js.php b/mod/embed/views/default/embed/js.php index fa809ce23..71120e68f 100644 --- a/mod/embed/views/default/embed/js.php +++ b/mod/embed/views/default/embed/js.php @@ -89,16 +89,16 @@ settings: { opacity : 0.7, overlay : true, - loadingImage : 'mod/embed/images/loading.gif', - closeImage : 'mod/embed/images/button_spacer.gif', + loadingImage : '_graphics/ajax_loader_bw.gif', + closeImage : '_graphics/spacer.gif', imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ], faceboxHtml : '\ -