--- upm_file_popper-0.2.2.orig 2016-01-01 17:13:48.000000000 +0100 +++ upm_file_popper-0.2.2.new 2016-01-01 17:13:48.000000000 +0100 @@ -1,6 +1,6 @@ -if (txpinterface == 'admin') +if (@txpinterface == 'admin') { add_privs('upm_file_popper', '1,2,3,4,5'); register_callback('upm_file_popper', 'upm_file_popper'); add_privs('upm_file_popper_link', '1,2,3,4,5'); @@ -9,12 +9,25 @@ add_privs('upm_file_popper_js', '1,2,3,4,5'); register_callback('upm_file_popper_js', 'upm_file_popper_js', '', 1); add_privs('upm_file_popper_img', '1,2,3,4,5'); register_callback('upm_file_popper_img', 'upm_file_popper_img', '', 1); + + register_callback('upm_file_popper_menu', 'article_ui', 'extend_col_1'); + } + /** + * Insert upm_file_popper link in column 1 on the write-tab + * + * @param string $event (article_ui) + * @param string $step (extend_col_1) + */ + function upm_file_popper_menu($event, $step) { + return '

'.upm_file_popper_gTxt('attach_file').'

'; + } + // ------------------------------------------------------------- function upm_file_popper() { global $step, $prefs; @@ -88,13 +101,14 @@ css; extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method'))); + if ($sort === '') $sort = get_pref('file_sort_column', 'filename'); + if ($dir === '') $dir = get_pref('file_sort_dir', 'asc'); + $dir = ($dir == 'desc') ? 'desc' : 'asc'; - $dir = ($dir == 'desc') ? 'desc' : 'asc'; - switch ($sort) { case 'id': $sort_sql = "id $dir, filename asc"; break; @@ -183,11 +197,11 @@ if ($rs) { $sort_link = 'upm_file_popper'.a.'bm=true'; - echo startTable('list'), + echo startTable('','','txp-list'), tr( column_head('ID', 'id', $sort_link, true, $switch_dir, $crit, $search_method). column_head('file_name', 'filename', $sort_link, true, $switch_dir, $crit, $search_method). column_head('description', 'description', $sort_link, true, $switch_dir, $crit, $search_method). column_head('file_category', 'category', $sort_link, true, $switch_dir, $crit, $search_method). @@ -397,21 +411,21 @@ $('#upm_file_popper_start').val( $('body').val() ); // ------------------------------ // create and insert popup link - var w = 575; - var h = 375; + var w = 800; + var h = 500; var t = (screen.height) ? (screen.height - h) / 2 : 0; var l = (screen.width) ? (screen.width - w) / 2 : 0; var a = $(document.createElement('a')). text('$lang_attach_file'). attr({ target: '_blank', - href: '?event=upm_file_popper\u0026bm=1' + href: '?event=upm_file_popper\u0026bm=1\u0026sort=id\u0026dir=desc' }). click(function () { var upm_file_popper = window.open(this.href, 'upm_file_popper', 'top = '+t+', left = '+l+', width = '+w+', height = '+h+', toolbar = no, location = no, directories = no, status = yes, menubar = no, scrollbars = yes, copyhistory = no, resizable = yes'); upm_file_popper.focus(); return false;