2012-03-24 15:20:49 +01:00
< ? php
/* Copyright ( C ) 2004 - 2007 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2004 - 2012 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2005 Simon Tosser < simon @ kornog - computing . com >
2018-10-27 14:43:12 +02:00
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ inodbox . com >
2012-03-24 15:20:49 +01:00
* Copyright ( C ) 2010 Pierre Morin < pierre . morin @ auguria . net >
2013-04-21 12:45:34 +02:00
* Copyright ( C ) 2013 Marcos García < marcosgdf @ gmail . com >
2012-03-24 15:20:49 +01:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2012-03-24 15:20:49 +01:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2012-04-14 13:25:26 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2012-03-24 15:20:49 +01:00
*/
/**
2012-03-25 22:47:37 +02:00
* \file htdocs / core / ajax / ajaxdirpreview . php
* \brief Service to return a HTML preview of a directory
2012-03-24 15:20:49 +01:00
* Call of this service is made with URL :
2012-03-25 22:47:37 +02:00
* ajaxdirpreview . php ? mode = nojs & action = preview & module = ecm & section = 0 & file = xxx
2012-03-24 15:20:49 +01:00
*/
if ( ! defined ( 'NOTOKENRENEWAL' )) define ( 'NOTOKENRENEWAL' , 1 ); // Disables token renewal
if ( ! defined ( 'NOREQUIREMENU' )) define ( 'NOREQUIREMENU' , '1' );
if ( ! defined ( 'NOREQUIREHTML' )) define ( 'NOREQUIREHTML' , '1' );
if ( ! defined ( 'NOREQUIREAJAX' )) define ( 'NOREQUIREAJAX' , '1' );
2012-06-24 17:49:52 +02:00
if ( ! isset ( $mode ) || $mode != 'noajax' ) // For ajax call
2012-03-25 22:47:37 +02:00
{
2012-08-22 23:11:24 +02:00
require_once '../../main.inc.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmdirectory.class.php' ;
2012-03-25 22:47:37 +02:00
2017-08-20 23:16:20 +02:00
$action = GETPOST ( 'action' , 'aZ09' );
$file = urldecode ( GETPOST ( 'file' , 'alpha' ));
$section = GETPOST ( " section " , 'alpha' );
$module = GETPOST ( " module " , 'alpha' );
$urlsource = GETPOST ( " urlsource " , 'alpha' );
2017-08-04 13:07:15 +02:00
$search_doc_ref = GETPOST ( 'search_doc_ref' , 'alpha' );
2012-03-25 22:47:37 +02:00
2012-07-08 23:22:22 +02:00
$sortfield = GETPOST ( " sortfield " , 'alpha' );
$sortorder = GETPOST ( " sortorder " , 'alpha' );
$page = GETPOST ( " page " , 'int' );
2017-06-06 10:53:53 +02:00
if ( empty ( $page ) || $page == - 1 ) { $page = 0 ; } // If $page is not defined, or '' or -1
2012-07-08 23:22:22 +02:00
$offset = $conf -> liste_limit * $page ;
$pageprev = $page - 1 ;
$pagenext = $page + 1 ;
if ( ! $sortorder ) $sortorder = " ASC " ;
if ( ! $sortfield ) $sortfield = " name " ;
2012-07-30 22:38:21 +02:00
2017-08-20 23:16:20 +02:00
$rootdirfordoc = $conf -> ecm -> dir_output ;
$upload_dir = dirname ( str_replace ( " ../ " , " / " , $rootdirfordoc . '/' . $file ));
2012-03-25 22:47:37 +02:00
$ecmdir = new EcmDirectory ( $db );
$result = $ecmdir -> fetch ( $section );
if ( ! $result > 0 )
{
2012-09-02 20:11:36 +02:00
//dol_print_error($db,$ecmdir->error);
//exit;
2012-03-25 22:47:37 +02:00
}
}
2012-06-24 17:49:52 +02:00
else // For no ajax call
2012-03-25 22:47:37 +02:00
{
2017-08-20 23:16:20 +02:00
$rootdirfordoc = $conf -> ecm -> dir_output ;
$ecmdir = new EcmDirectory ( $db );
2012-03-25 22:47:37 +02:00
$relativepath = '' ;
if ( $section > 0 )
{
$result = $ecmdir -> fetch ( $section );
if ( ! $result > 0 )
{
dol_print_error ( $db , $ecmdir -> error );
exit ;
}
2018-10-18 21:22:30 +02:00
$relativepath = $ecmdir -> getRelativePath (); // Example 'mydir/'
2012-03-25 22:47:37 +02:00
}
2018-10-18 21:22:30 +02:00
elseif ( GETPOST ( 'section_dir' ))
{
$relativepath = GETPOST ( 'section_dir' );
}
//var_dump($section.'-'.GETPOST('section_dir').'-'.$relativepath);
$upload_dir = $rootdirfordoc . '/' . $relativepath ;
2012-03-25 22:47:37 +02:00
}
2017-11-10 13:45:38 +01:00
if ( empty ( $url ))
{
if ( GETPOSTISSET ( 'website' )) $url = DOL_URL_ROOT . '/website/index.php' ;
else $url = DOL_URL_ROOT . '/ecm/index.php' ;
}
2012-03-24 15:20:49 +01:00
2018-05-26 23:52:52 +02:00
// Load translation files required by the page
2017-10-30 00:45:47 +01:00
$langs -> loadLangs ( array ( " ecm " , " companies " , " other " ));
2012-03-24 15:20:49 +01:00
// Security check
if ( $user -> societe_id > 0 ) $socid = $user -> societe_id ;
2012-03-25 22:47:37 +02:00
//print 'xxx'.$upload_dir;
2012-03-24 15:20:49 +01:00
// Security:
2017-08-20 23:16:20 +02:00
// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers.
2012-03-25 22:47:37 +02:00
if ( preg_match ( '/\.\./' , $upload_dir ) || preg_match ( '/[<>|]/' , $upload_dir ))
2012-03-24 15:20:49 +01:00
{
2012-03-25 22:47:37 +02:00
dol_syslog ( " Refused to deliver file " . $upload_dir );
2012-03-24 15:20:49 +01:00
// Do no show plain path in shown error message
2012-03-25 22:47:37 +02:00
dol_print_error ( 0 , $langs -> trans ( " ErrorFileNameInvalid " , $upload_dir ));
2012-03-24 15:20:49 +01:00
exit ;
}
2017-08-20 23:16:20 +02:00
// Check permissions
if ( $modulepart == 'ecm' )
{
if ( ! $user -> rights -> ecm -> read ) accessforbidden ();
}
if ( $modulepart == 'medias' )
{
// Always allowed
}
2012-03-24 15:20:49 +01:00
/*
* Action
*/
2012-06-08 23:48:53 +02:00
// None
2012-03-24 15:20:49 +01:00
/*
* View
*/
2012-03-25 22:47:37 +02:00
if ( ! isset ( $mode ) || $mode != 'noajax' )
2012-03-24 15:20:49 +01:00
{
2012-07-08 13:57:51 +02:00
// Ajout directives pour resoudre bug IE
2012-03-25 22:47:37 +02:00
header ( 'Cache-Control: Public, must-revalidate' );
header ( 'Pragma: public' );
2012-07-30 22:38:21 +02:00
2012-07-08 13:57:51 +02:00
top_httphead ();
2012-03-24 15:20:49 +01:00
}
2012-03-25 22:47:37 +02:00
$type = 'directory' ;
2012-03-24 15:20:49 +01:00
// This test if file exists should be useless. We keep it to find bug more easily
2012-03-25 22:47:37 +02:00
if ( ! dol_is_dir ( $upload_dir ))
2012-03-24 15:20:49 +01:00
{
2012-03-26 18:23:08 +02:00
// dol_mkdir($upload_dir);
/* $langs -> load ( " install " );
2012-03-25 22:47:37 +02:00
dol_print_error ( 0 , $langs -> trans ( " ErrorDirDoesNotExists " , $upload_dir ));
2012-03-26 18:23:08 +02:00
exit ; */
2012-03-24 15:20:49 +01:00
}
2016-12-13 01:19:33 +01:00
print '<!-- ajaxdirpreview type=' . $type . ' -->' . " \n " ;
2017-06-18 19:42:59 +02:00
//print '<!-- Page called with mode='.dol_escape_htmltag(isset($mode)?$mode:'').' type='.dol_escape_htmltag($type).' module='.dol_escape_htmltag($module).' url='.dol_escape_htmltag($url).' '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
2012-03-24 15:20:49 +01:00
2013-04-21 12:40:46 +02:00
$param = ( $sortfield ? '&sortfield=' . $sortfield : '' ) . ( $sortorder ? '&sortorder=' . $sortorder : '' );
2018-08-28 14:21:58 +02:00
if ( ! empty ( $websitekey )) $param .= '&website=' . $websitekey ;
if ( ! empty ( $pageid )) $param .= '&pageid=' . $pageid ;
2016-07-11 02:06:46 +02:00
2012-03-24 15:20:49 +01:00
2012-06-24 17:49:52 +02:00
// Dir scan
2012-03-24 15:20:49 +01:00
if ( $type == 'directory' )
{
2012-03-25 22:47:37 +02:00
$formfile = new FormFile ( $db );
$maxlengthname = 40 ;
2017-04-12 11:30:33 +02:00
$excludefiles = array ( '^SPECIMEN\.pdf$' , '^\.' , '(\.meta|_preview.*\.png)$' , '^temp$' , '^payments$' , '^CVS$' , '^thumbs$' );
2013-04-21 12:40:46 +02:00
$sorting = ( strtolower ( $sortorder ) == 'desc' ? SORT_DESC : SORT_ASC );
2012-03-25 22:47:37 +02:00
2017-08-20 23:16:20 +02:00
// Right area. If module is defined here, we are in automatic ecm.
2018-12-01 19:39:00 +01:00
$automodules = array ( 'company' , 'invoice' , 'invoice_supplier' , 'propal' , 'supplier_proposal' , 'order' , 'order_supplier' , 'contract' , 'product' , 'tax' , 'project' , 'fichinter' , 'user' , 'expensereport' , 'holiday' );
2013-04-21 12:40:46 +02:00
// TODO change for multicompany sharing
// Auto area for suppliers invoices
if ( $module == 'company' ) $upload_dir = $conf -> societe -> dir_output ;
// Auto area for suppliers invoices
else if ( $module == 'invoice' ) $upload_dir = $conf -> facture -> dir_output ;
// Auto area for suppliers invoices
2017-06-20 12:31:08 +02:00
else if ( $module == 'invoice_supplier' ) $upload_dir = $conf -> fournisseur -> facture -> dir_output ;
2017-11-05 01:00:15 +01:00
// Auto area for customers proposal
2013-04-21 12:40:46 +02:00
else if ( $module == 'propal' ) $upload_dir = $conf -> propal -> dir_output ;
2017-11-05 01:00:15 +01:00
// Auto area for suppliers proposal
else if ( $module == 'supplier_proposal' ) $upload_dir = $conf -> supplier_proposal -> dir_output ;
2013-04-21 12:40:46 +02:00
// Auto area for customers orders
else if ( $module == 'order' ) $upload_dir = $conf -> commande -> dir_output ;
// Auto area for suppliers orders
2017-06-20 12:31:08 +02:00
else if ( $module == 'order_supplier' ) $upload_dir = $conf -> fournisseur -> commande -> dir_output ;
2013-04-21 12:40:46 +02:00
// Auto area for suppliers invoices
else if ( $module == 'contract' ) $upload_dir = $conf -> contrat -> dir_output ;
// Auto area for products
else if ( $module == 'product' ) $upload_dir = $conf -> product -> dir_output ;
// Auto area for suppliers invoices
else if ( $module == 'tax' ) $upload_dir = $conf -> tax -> dir_output ;
// Auto area for projects
else if ( $module == 'project' ) $upload_dir = $conf -> projet -> dir_output ;
2014-08-05 15:24:49 +02:00
// Auto area for interventions
else if ( $module == 'fichinter' ) $upload_dir = $conf -> ficheinter -> dir_output ;
2014-08-05 16:01:40 +02:00
// Auto area for users
else if ( $module == 'user' ) $upload_dir = $conf -> user -> dir_output ;
2016-10-24 05:26:19 +02:00
// Auto area for expense report
else if ( $module == 'expensereport' ) $upload_dir = $conf -> expensereport -> dir_output ;
2018-12-01 19:39:00 +01:00
// Auto area for holiday
else if ( $module == 'holiday' ) $upload_dir = $conf -> holiday -> dir_output ;
2013-04-21 12:40:46 +02:00
2017-03-07 18:34:57 +01:00
// Automatic list
2013-04-21 12:40:46 +02:00
if ( in_array ( $module , $automodules ))
2012-03-24 15:20:49 +01:00
{
2012-09-02 15:03:55 +02:00
$param .= '&module=' . $module ;
2017-08-04 13:07:15 +02:00
if ( isset ( $search_doc_ref ) && $search_doc_ref != '' ) $param .= '&search_doc_ref=' . $search_doc_ref ;
2012-09-02 15:03:55 +02:00
$textifempty = ( $section ? $langs -> trans ( " NoFileFound " ) : ( $showonrightsize == 'featurenotyetavailable' ? $langs -> trans ( " FeatureNotYetAvailable " ) : $langs -> trans ( " NoFileFound " )));
2017-06-20 12:31:08 +02:00
if ( $module == 'company' ) $excludefiles [] = '^contact$' ; // The subdir 'contact' contains files of contacts with no id of thirdparty.
2017-08-04 13:07:15 +02:00
$filter = preg_quote ( $search_doc_ref , '/' );
$filearray = dol_dir_list ( $upload_dir , " files " , 1 , $filter , $excludefiles , $sortfield , $sorting , 1 );
2017-08-20 23:16:20 +02:00
$perm = $user -> rights -> ecm -> upload ;
$formfile -> list_of_autoecmfiles ( $upload_dir , $filearray , $module , $param , 1 , '' , $perm , 1 , $textifempty , $maxlengthname , $url , 1 );
2012-09-02 15:03:55 +02:00
}
2017-03-07 18:34:57 +01:00
// Manual list
2013-04-21 12:40:46 +02:00
else
2012-03-24 15:20:49 +01:00
{
2017-08-20 23:16:20 +02:00
if ( $module == 'medias' )
{
2018-10-18 21:22:30 +02:00
/*
$_POST is array like
'token' => string '062380e11b7dcd009d07318b57b71750' ( length = 32 )
'action' => string 'file_manager' ( length = 12 )
'website' => string 'template' ( length = 8 )
'pageid' => string '124' ( length = 3 )
'section_dir' => string 'mydir/' ( length = 3 )
'section_id' => string '0' ( length = 1 )
'max_file_size' => string '2097152' ( length = 7 )
'sendit' => string 'Envoyer fichier' ( length = 15 )
*/
$relativepath = GETPOST ( 'file' , 'alpha' ) ? GETPOST ( 'file' , 'alpha' ) : GETPOST ( 'section_dir' , 'alpha' );
2017-11-05 02:50:02 +01:00
if ( $relativepath && $relativepath != '/' ) $relativepath .= '/' ;
$upload_dir = $dolibarr_main_data_root . '/' . $module . '/' . $relativepath ;
2017-11-18 15:41:30 +01:00
if ( GETPOSTISSET ( 'website' ) || GETPOSTISSET ( 'file_manager' ))
2017-11-10 13:45:38 +01:00
{
$param .= '&file_manager=1' ;
if ( ! preg_match ( '/website=/' , $param )) $param .= '&website=' . urlencode ( GETPOST ( 'website' , 'alpha' ));
if ( ! preg_match ( '/pageid=/' , $param )) $param .= '&pageid=' . urlencode ( GETPOST ( 'pageid' , 'int' ));
2018-08-28 14:21:58 +02:00
//if (!preg_match('/backtopage=/',$param)) $param.='&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid);
2017-11-10 13:45:38 +01:00
}
2017-08-20 23:16:20 +02:00
}
else
{
$relativepath = $ecmdir -> getRelativePath ();
$upload_dir = $conf -> ecm -> dir_output . '/' . $relativepath ;
}
2012-10-03 20:10:29 +02:00
// If $section defined with value 0
2017-08-20 23:16:20 +02:00
if (( $section === '0' || empty ( $section )) && ( $module != 'medias' ))
2012-10-03 20:10:29 +02:00
{
2013-04-21 12:40:46 +02:00
$filearray = array ();
2012-10-03 20:10:29 +02:00
}
2017-08-20 23:16:20 +02:00
else
{
$filearray = dol_dir_list ( $upload_dir , " files " , 0 , '' , array ( '^\.' , '(\.meta|_preview.*\.png)$' , '^temp$' , '^CVS$' ), $sortfield , $sorting , 1 );
}
2013-04-21 12:40:46 +02:00
if ( $section )
{
$param .= '§ion=' . $section ;
2017-08-04 13:07:15 +02:00
if ( isset ( $search_doc_ref ) && $search_doc_ref != '' ) $param .= '&search_doc_ref=' . $search_doc_ref ;
2013-04-21 12:40:46 +02:00
$textifempty = $langs -> trans ( 'NoFileFound' );
}
2017-11-05 02:50:02 +01:00
else if ( $section === '0' )
{
if ( $module == 'ecm' ) $textifempty = '<br><div align="center"><font class="warning">' . $langs -> trans ( " DirNotSynchronizedSyncFirst " ) . '</font></div><br>' ;
else $textifempty = $langs -> trans ( 'NoFileFound' );
}
2013-04-21 12:40:46 +02:00
else $textifempty = ( $showonrightsize == 'featurenotyetavailable' ? $langs -> trans ( " FeatureNotYetAvailable " ) : $langs -> trans ( " ECMSelectASection " ));
2014-01-05 18:37:26 +01:00
2017-08-20 23:16:20 +02:00
if ( $module == 'medias' )
{
2017-11-10 15:29:12 +01:00
$useinecm = 2 ;
2017-08-20 23:16:20 +02:00
$modulepart = 'medias' ;
2017-11-10 13:45:38 +01:00
$perm = ( $user -> rights -> website -> write || $user -> rights -> emailing -> creer );
$title = 'none' ;
2017-08-20 23:16:20 +02:00
}
else
{
2017-11-10 13:45:38 +01:00
$useinecm = 1 ;
2017-08-20 23:16:20 +02:00
$modulepart = 'ecm' ;
$perm = $user -> rights -> ecm -> upload ;
2017-11-10 13:45:38 +01:00
$title = '' ; // Use default
2017-08-20 23:16:20 +02:00
}
2017-11-10 13:45:38 +01:00
// When we show list of files for ECM files, $filearray contains file list, and directory is defined with modulepart + section into $param
// When we show list of files for a directory, $filearray ciontains file list, and directory is defined with modulepart + $relativepath
//var_dump("title=".$title." modulepart=".$modulepart." useinecm=".$useinecm." perm=".$perm." relativepath=".$relativepath." param=".$param." url=".$url);
$formfile -> list_of_documents ( $filearray , '' , $modulepart , $param , 1 , $relativepath , $perm , $useinecm , $textifempty , $maxlengthname , $title , $url , 0 , $perm );
2012-03-24 15:20:49 +01:00
}
2012-03-25 22:47:37 +02:00
}
2014-01-05 18:37:26 +01:00
2017-11-18 15:41:30 +01:00
// Bottom of page
$useajax = 1 ;
if ( ! empty ( $conf -> dol_use_jmobile )) $useajax = 0 ;
if ( empty ( $conf -> use_javascript_ajax )) $useajax = 0 ;
if ( ! empty ( $conf -> global -> MAIN_ECM_DISABLE_JS )) $useajax = 0 ;
2014-01-05 18:37:26 +01:00
2017-11-18 15:41:30 +01:00
//$param.=($param?'?':'').(preg_replace('/^&/','',$param));
if ( $useajax || $action == 'delete' )
{
$urlfile = '' ;
if ( $action == 'delete' ) $urlfile = GETPOST ( 'urlfile' , 'alpha' );
if ( empty ( $section_dir )) $section_dir = GETPOST ( " file " , " alpha " );
$section_id = $section ;
require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php' ;
$useglobalvars = 1 ;
$form = new Form ( $db );
$formquestion [ 'urlfile' ] = array ( 'type' => 'hidden' , 'value' => $urlfile , 'name' => 'urlfile' ); // We must always put field, even if empty because it is fille by javascript later
$formquestion [ 'section' ] = array ( 'type' => 'hidden' , 'value' => $section , 'name' => 'section' ); // We must always put field, even if empty because it is fille by javascript later
$formquestion [ 'section_id' ] = array ( 'type' => 'hidden' , 'value' => $section_id , 'name' => 'section_id' ); // We must always put field, even if empty because it is fille by javascript later
$formquestion [ 'section_dir' ] = array ( 'type' => 'hidden' , 'value' => $section_dir , 'name' => 'section_dir' ); // We must always put field, even if empty because it is fille by javascript later
if ( ! empty ( $action ) && $action == 'file_manager' ) $formquestion [ 'file_manager' ] = array ( 'type' => 'hidden' , 'value' => 1 , 'name' => 'file_manager' );
2018-08-28 14:21:58 +02:00
if ( ! empty ( $websitekey )) $formquestion [ 'website' ] = array ( 'type' => 'hidden' , 'value' => $websitekey , 'name' => 'website' );
2017-11-18 15:41:30 +01:00
if ( ! empty ( $pageid ) && $pageid > 0 ) $formquestion [ 'pageid' ] = array ( 'type' => 'hidden' , 'value' => $pageid , 'name' => 'pageid' );
print $form -> formconfirm ( $url , $langs -> trans ( " DeleteFile " ), $langs -> trans ( " ConfirmDeleteFile " ), 'confirm_deletefile' , $formquestion , " no " ,( $useajax ? 'deletefile' : 0 ));
}
2014-01-05 18:37:26 +01:00
2017-11-18 15:41:30 +01:00
if ( $useajax )
{
print '<script type="text/javascript">' ;
// Enable jquery handlers on new generated HTML objects (same code than into lib_footer.js.php)
// Because the content is reloaded by ajax call, we must also reenable some jquery hooks
// Wrapper to manage document_preview
if ( $conf -> browser -> layout != 'phone' )
2014-01-05 18:37:26 +01:00
{
2017-11-18 15:41:30 +01:00
print " \n /* JS CODE TO ENABLE document_preview */ \n " ;
print '
jQuery ( document ) . ready ( function () {
jQuery ( " .documentpreview " ) . click ( function () {
console . log ( " We click on preview for element with href= " + $ ( this ) . attr ( \ ' href\ ' ) + " mime= " + $ ( this ) . attr ( \ ' mime\ ' ));
document_preview ( $ ( this ) . attr ( \ 'href\'), $(this).attr(\'mime\'), \'' . dol_escape_js ( $langs -> transnoentities ( " Preview " )) . ' \ ' );
return false ;
});
});
' . " \n " ;
2014-01-05 18:37:26 +01:00
}
2017-11-18 15:41:30 +01:00
// Enable jquery handlers button to delete files
print 'jQuery(document).ready(function() {' . " \n " ;
print ' jQuery(".deletefilelink").click(function(e) { ' . " \n " ;
print ' console.log("We click on button with class deletefilelink, param=' . $param . ', we set urlfile to "+jQuery(this).attr("rel"));' . " \n " ;
print ' jQuery("#urlfile").val(jQuery(this).attr("rel"));' . " \n " ;
//print ' jQuery("#section_dir").val(\'aaa\');'."\n";
print ' jQuery("#dialog-confirm-deletefile").dialog("open");' . " \n " ;
print ' return false;' . " \n " ;
print ' });' . " \n " ;
print '});' . " \n " ;
print '</script>' . " \n " ;
}
2012-03-24 15:20:49 +01:00
2012-05-23 23:23:57 +02:00
// Close db if mode is not noajax
if (( ! isset ( $mode ) || $mode != 'noajax' ) && is_object ( $db )) $db -> close ();