diff --git a/css/media.css b/css/media.css index cf466b7..2eec2ee 100644 --- a/css/media.css +++ b/css/media.css @@ -13,6 +13,39 @@ display: none; } +/* Remove the default border */ +.ui-widget-content { + border: none; +} + +#media-browser-tabset { + +} + +#media-dialog-tabs-wrapper { + height: 2.6em; + padding-left: 10px; +} + + +#media-dialog-tabs-wrapper h2.media-browser-title { + float: left; +} + +#media-browser-tabset ul.tabs { + padding: 0; + border: none; +} + +/* Reset the height to match the browser */ +#media-browser-tabset ul.tabs.primary li a:link { + height: 2em; +} + +.media-browser-tab.ui-tabs-panel { + border: 1px solid #cccccc; +} + /* Media item */ .media-item { @@ -20,10 +53,12 @@ border: 1px solid #CCCCCC; padding: 5px; width: 100px; + height: 100px; } .media-item img { height: auto; + max-height: 80px; width: 100%; } diff --git a/includes/media.browser.inc b/includes/media.browser.inc index fb13c65..969a322 100644 --- a/includes/media.browser.inc +++ b/includes/media.browser.inc @@ -138,7 +138,7 @@ function media_browser($selected = NULL) { '#suffix' => '', ); $output['tabset']['list'] = array( - '#markup' => theme('item_list', array('items' => $tabs)), + '#markup' => theme('media_dialog_tabs', array('tabs' => $tabs)), ); $output['tabset']['plugins'] = $plugin_output; diff --git a/includes/media.theme.inc b/includes/media.theme.inc index d801baa..2d2a399 100644 --- a/includes/media.theme.inc +++ b/includes/media.theme.inc @@ -23,6 +23,8 @@ function theme_media_file_list($element) { /** * Default theming function for creating the browser frame. * + * @NOTE this function seems to have been depricated. Can it be removed? + * * Assumes an array of file objects as $files and an * array of $parameters * @@ -232,3 +234,22 @@ function theme_media_formatter_large_icon($variables) { } return theme('image', $variables); } + + +/** + * Renders the tabs on the media browser page. + * + * @param type $variables + * @return type + */ +function theme_media_dialog_tabs($variables) { + $html = "
\n"; + $html .= theme('item_list', array( + 'items' => $variables['tabs'], + 'attributes' => array('class' => 'tabs primary') + ) + ); + $html .= "

" . t('Select a file') . "

\n"; + $html .= "
\n"; + return $html; +} \ No newline at end of file diff --git a/js/media.popups.js b/js/media.popups.js index f2d9518..c8e5fa2 100644 --- a/js/media.popups.js +++ b/js/media.popups.js @@ -305,9 +305,9 @@ Drupal.media.popups.getDialogOptions = function () { modal: true, draggable: false, resizable: false, - minWidth: 600, - width: 800, - height: 550, + minWidth: 500, + width: 670, + height: 280, position: 'center', overlay: { backgroundColor: '#000000', diff --git a/media.module b/media.module index a2a5a4b..e7010bf 100644 --- a/media.module +++ b/media.module @@ -283,6 +283,12 @@ function media_theme() { 'file' => 'includes/media.theme.inc', ), + // Plugin tabs + 'media_dialog_tabs' => array( + 'variables' => array('tabs'), + 'file' => 'includes/media.theme.inc', + ), + // Media form API element type. 'media_element' => array( 'render element' => 'element', @@ -685,10 +691,10 @@ function media_library() { $path . '/js/media.popups.js' => array('group' => JS_DEFAULT), ), 'dependencies' => array( - array('media', 'media_base'), array('system', 'ui.resizable'), array('system', 'ui.draggable'), array('system', 'ui.dialog'), + array('media', 'media_base'), ), ); @@ -701,13 +707,14 @@ function media_library() { $path . '/js/media.browser.js' => array('group' => JS_DEFAULT), ), 'css' => array( + // @NOTE this file does not exist $path . '/css/media.browser.css' => array('group' => CSS_DEFAULT), ), 'dependencies' => array( - array('media', 'media_base'), array('system', 'ui.tabs'), array('system', 'ui.draggable'), array('system', 'ui.dialog'), + array('media', 'media_base'), ), );