mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-14 03:53:59 +02:00
Make refresh and search configurable
Signed-off-by: Marco Dickert <marco@misterunknown.de>
This commit is contained in:
@@ -40,6 +40,7 @@ class IFM {
|
|||||||
"rename" => 1,
|
"rename" => 1,
|
||||||
"zipnload" => 1,
|
"zipnload" => 1,
|
||||||
"createarchive" => 1,
|
"createarchive" => 1,
|
||||||
|
"search" => 1,
|
||||||
|
|
||||||
// gui controls
|
// gui controls
|
||||||
"showlastmodified" => 0,
|
"showlastmodified" => 0,
|
||||||
@@ -51,7 +52,8 @@ class IFM {
|
|||||||
"showhiddenfiles" => 1,
|
"showhiddenfiles" => 1,
|
||||||
"showpath" => 0,
|
"showpath" => 0,
|
||||||
"contextmenu" => 1,
|
"contextmenu" => 1,
|
||||||
"disable_mime_detection" => 0
|
"disable_mime_detection" => 0,
|
||||||
|
"showrefresh" => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
private $config = array();
|
private $config = array();
|
||||||
@@ -97,6 +99,8 @@ class IFM {
|
|||||||
$this->config['showhiddenfiles'] = getenv('IFM_GUI_SHOWHIDDENFILES') !== false ? intval( getenv('IFM_GUI_SHOWHIDDENFILES') ) : $this->config['showhiddenfiles'] ;
|
$this->config['showhiddenfiles'] = getenv('IFM_GUI_SHOWHIDDENFILES') !== false ? intval( getenv('IFM_GUI_SHOWHIDDENFILES') ) : $this->config['showhiddenfiles'] ;
|
||||||
$this->config['showpath'] = getenv('IFM_GUI_SHOWPATH') !== false ? intval( getenv('IFM_GUI_SHOWPATH') ) : $this->config['showpath'] ;
|
$this->config['showpath'] = getenv('IFM_GUI_SHOWPATH') !== false ? intval( getenv('IFM_GUI_SHOWPATH') ) : $this->config['showpath'] ;
|
||||||
$this->config['contextmenu'] = getenv('IFM_GUI_CONTEXTMENU') !== false ? intval( getenv('IFM_GUI_CONTEXTMENU') ) : $this->config['contextmenu'] ;
|
$this->config['contextmenu'] = getenv('IFM_GUI_CONTEXTMENU') !== false ? intval( getenv('IFM_GUI_CONTEXTMENU') ) : $this->config['contextmenu'] ;
|
||||||
|
$this->config['search'] = getenv('IFM_API_SEARCH') !== false ? intval( getenv('IFM_API_SEARCH') ) : $this->config['search'] ;
|
||||||
|
$this->config['showrefresh'] = getenv('IFM_GUI_REFRESH') !== false ? intval( getenv('IFM_GUI_REFRESH') ) : $this->config['showrefresh'] ;
|
||||||
|
|
||||||
// optional settings
|
// optional settings
|
||||||
if( getenv('IFM_SESSION_LIFETIME') !== false )
|
if( getenv('IFM_SESSION_LIFETIME') !== false )
|
||||||
@@ -140,8 +144,12 @@ f00bar;
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
{{#config.showrefresh}}
|
||||||
<li><a id="refresh"><span title="{{i18n.refresh}}" class="icon icon-arrows-cw"></span> <span class="visible-xs">{{i18n.refresh}}</span></a></li>
|
<li><a id="refresh"><span title="{{i18n.refresh}}" class="icon icon-arrows-cw"></span> <span class="visible-xs">{{i18n.refresh}}</span></a></li>
|
||||||
|
{{/config.showrefresh}}
|
||||||
|
{{#config.search}}
|
||||||
<li><a id="search"><span title="{{i18n.search}}" class="icon icon-search"></span> <span class="visible-xs">{{i18n.search}}</span></a></li>
|
<li><a id="search"><span title="{{i18n.search}}" class="icon icon-search"></span> <span class="visible-xs">{{i18n.search}}</span></a></li>
|
||||||
|
{{/config.search}}
|
||||||
{{#config.upload}}
|
{{#config.upload}}
|
||||||
<li><a id="upload"><span title="{{i18n.upload}}" class="icon icon-upload"></span> <span class="visible-xs">{{i18n.upload}}</span></a></li>
|
<li><a id="upload"><span title="{{i18n.upload}}" class="icon icon-upload"></span> <span class="visible-xs">{{i18n.upload}}</span></a></li>
|
||||||
{{/config.upload}}
|
{{/config.upload}}
|
||||||
@@ -1756,6 +1764,7 @@ function IFM(params) {
|
|||||||
* @param object options - options for changing the directory
|
* @param object options - options for changing the directory
|
||||||
*/
|
*/
|
||||||
this.changeDirectory = function( newdir, options ) {
|
this.changeDirectory = function( newdir, options ) {
|
||||||
|
console.log("Change dir to: |"+newdir+"|");
|
||||||
options = options || {};
|
options = options || {};
|
||||||
config = { absolute: false, pushState: true };
|
config = { absolute: false, pushState: true };
|
||||||
jQuery.extend( config, options );
|
jQuery.extend( config, options );
|
||||||
@@ -2463,7 +2472,7 @@ function IFM(params) {
|
|||||||
searchresults.tBodies[0].addEventListener( 'click', function( e ) {
|
searchresults.tBodies[0].addEventListener( 'click', function( e ) {
|
||||||
if( e.target.classList.contains( 'searchitem' ) || e.target.parentElement.classList.contains( 'searchitem' ) ) {
|
if( e.target.classList.contains( 'searchitem' ) || e.target.parentElement.classList.contains( 'searchitem' ) ) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
self.changeDirectory( self.pathCombine( self.search.data.currentDir, e.target.dataset.folder || e.target.parentElement.dataset.foldera ), { absolute: true } );
|
self.changeDirectory(self.pathCombine(self.search.data.currentDir, e.target.dataset.folder || e.target.parentElement.dataset.folder), {absolute: true});
|
||||||
self.hideModal();
|
self.hideModal();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -2916,8 +2925,10 @@ function IFM(params) {
|
|||||||
// global key events
|
// global key events
|
||||||
switch( e.key ) {
|
switch( e.key ) {
|
||||||
case '/':
|
case '/':
|
||||||
e.preventDefault();
|
if (self.config.search) {
|
||||||
self.showSearchDialog();
|
e.preventDefault();
|
||||||
|
self.showSearchDialog();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -2925,9 +2936,10 @@ function IFM(params) {
|
|||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
e.preventDefault();
|
if (self.config.showrefresh) {
|
||||||
self.refreshFileTable();
|
e.preventDefault();
|
||||||
return;
|
self.refreshFileTable();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
if( self.config.upload ) {
|
if( self.config.upload ) {
|
||||||
@@ -3154,8 +3166,12 @@ function IFM(params) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// bind static buttons
|
// bind static buttons
|
||||||
document.getElementById( 'refresh' ).onclick = function() { self.refreshFileTable(); };
|
if (el_r = document.getElementById('refresh'))
|
||||||
document.getElementById( 'search' ).onclick = function() { self.showSearchDialog(); };
|
el_r.onclick = function() { self.refreshFileTable(); };
|
||||||
|
if (el_s = document.getElementById('search'))
|
||||||
|
el_s.onclick = function() { self.showSearchDialog(); };
|
||||||
|
//document.getElementById( 'refresh' ).onclick = function() { self.refreshFileTable(); };
|
||||||
|
//document.getElementById( 'search' ).onclick = function() { self.showSearchDialog(); };
|
||||||
if( self.config.createfile )
|
if( self.config.createfile )
|
||||||
document.getElementById( 'createFile' ).onclick = function() { self.showFileDialog(); };
|
document.getElementById( 'createFile' ).onclick = function() { self.showFileDialog(); };
|
||||||
if( self.config.createdir )
|
if( self.config.createdir )
|
||||||
@@ -3516,6 +3532,11 @@ f00bar;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function searchItems( $d ) {
|
private function searchItems( $d ) {
|
||||||
|
if( $this->config['search'] != 1 ) {
|
||||||
|
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['nopermissions'] ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( strpos( $d['pattern'], '/' ) !== false ) {
|
if( strpos( $d['pattern'], '/' ) !== false ) {
|
||||||
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['pattern_error_slashes'] ) );
|
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['pattern_error_slashes'] ) );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
@@ -3884,7 +3905,6 @@ f00bar;
|
|||||||
elseif ( ! $this->isFilenameValid( $d['filename'] ) )
|
elseif ( ! $this->isFilenameValid( $d['filename'] ) )
|
||||||
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['invalid_filename'] ) );
|
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['invalid_filename'] ) );
|
||||||
else {
|
else {
|
||||||
trigger_error("foo bar");
|
|
||||||
unset( $zip );
|
unset( $zip );
|
||||||
$dfile = $this->pathCombine( __DIR__, $this->config['tmp_dir'], uniqid( "ifm-tmp-" ) . ".zip" ); // temporary filename
|
$dfile = $this->pathCombine( __DIR__, $this->config['tmp_dir'], uniqid( "ifm-tmp-" ) . ".zip" ); // temporary filename
|
||||||
try {
|
try {
|
||||||
|
40
ifm.php
40
ifm.php
@@ -40,6 +40,7 @@ class IFM {
|
|||||||
"rename" => 1,
|
"rename" => 1,
|
||||||
"zipnload" => 1,
|
"zipnload" => 1,
|
||||||
"createarchive" => 1,
|
"createarchive" => 1,
|
||||||
|
"search" => 1,
|
||||||
|
|
||||||
// gui controls
|
// gui controls
|
||||||
"showlastmodified" => 0,
|
"showlastmodified" => 0,
|
||||||
@@ -51,7 +52,8 @@ class IFM {
|
|||||||
"showhiddenfiles" => 1,
|
"showhiddenfiles" => 1,
|
||||||
"showpath" => 0,
|
"showpath" => 0,
|
||||||
"contextmenu" => 1,
|
"contextmenu" => 1,
|
||||||
"disable_mime_detection" => 0
|
"disable_mime_detection" => 0,
|
||||||
|
"showrefresh" => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
private $config = array();
|
private $config = array();
|
||||||
@@ -97,6 +99,8 @@ class IFM {
|
|||||||
$this->config['showhiddenfiles'] = getenv('IFM_GUI_SHOWHIDDENFILES') !== false ? intval( getenv('IFM_GUI_SHOWHIDDENFILES') ) : $this->config['showhiddenfiles'] ;
|
$this->config['showhiddenfiles'] = getenv('IFM_GUI_SHOWHIDDENFILES') !== false ? intval( getenv('IFM_GUI_SHOWHIDDENFILES') ) : $this->config['showhiddenfiles'] ;
|
||||||
$this->config['showpath'] = getenv('IFM_GUI_SHOWPATH') !== false ? intval( getenv('IFM_GUI_SHOWPATH') ) : $this->config['showpath'] ;
|
$this->config['showpath'] = getenv('IFM_GUI_SHOWPATH') !== false ? intval( getenv('IFM_GUI_SHOWPATH') ) : $this->config['showpath'] ;
|
||||||
$this->config['contextmenu'] = getenv('IFM_GUI_CONTEXTMENU') !== false ? intval( getenv('IFM_GUI_CONTEXTMENU') ) : $this->config['contextmenu'] ;
|
$this->config['contextmenu'] = getenv('IFM_GUI_CONTEXTMENU') !== false ? intval( getenv('IFM_GUI_CONTEXTMENU') ) : $this->config['contextmenu'] ;
|
||||||
|
$this->config['search'] = getenv('IFM_API_SEARCH') !== false ? intval( getenv('IFM_API_SEARCH') ) : $this->config['search'] ;
|
||||||
|
$this->config['showrefresh'] = getenv('IFM_GUI_REFRESH') !== false ? intval( getenv('IFM_GUI_REFRESH') ) : $this->config['showrefresh'] ;
|
||||||
|
|
||||||
// optional settings
|
// optional settings
|
||||||
if( getenv('IFM_SESSION_LIFETIME') !== false )
|
if( getenv('IFM_SESSION_LIFETIME') !== false )
|
||||||
@@ -140,8 +144,12 @@ f00bar;
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
{{#config.showrefresh}}
|
||||||
<li><a id="refresh"><span title="{{i18n.refresh}}" class="icon icon-arrows-cw"></span> <span class="visible-xs">{{i18n.refresh}}</span></a></li>
|
<li><a id="refresh"><span title="{{i18n.refresh}}" class="icon icon-arrows-cw"></span> <span class="visible-xs">{{i18n.refresh}}</span></a></li>
|
||||||
|
{{/config.showrefresh}}
|
||||||
|
{{#config.search}}
|
||||||
<li><a id="search"><span title="{{i18n.search}}" class="icon icon-search"></span> <span class="visible-xs">{{i18n.search}}</span></a></li>
|
<li><a id="search"><span title="{{i18n.search}}" class="icon icon-search"></span> <span class="visible-xs">{{i18n.search}}</span></a></li>
|
||||||
|
{{/config.search}}
|
||||||
{{#config.upload}}
|
{{#config.upload}}
|
||||||
<li><a id="upload"><span title="{{i18n.upload}}" class="icon icon-upload"></span> <span class="visible-xs">{{i18n.upload}}</span></a></li>
|
<li><a id="upload"><span title="{{i18n.upload}}" class="icon icon-upload"></span> <span class="visible-xs">{{i18n.upload}}</span></a></li>
|
||||||
{{/config.upload}}
|
{{/config.upload}}
|
||||||
@@ -1756,6 +1764,7 @@ function IFM(params) {
|
|||||||
* @param object options - options for changing the directory
|
* @param object options - options for changing the directory
|
||||||
*/
|
*/
|
||||||
this.changeDirectory = function( newdir, options ) {
|
this.changeDirectory = function( newdir, options ) {
|
||||||
|
console.log("Change dir to: |"+newdir+"|");
|
||||||
options = options || {};
|
options = options || {};
|
||||||
config = { absolute: false, pushState: true };
|
config = { absolute: false, pushState: true };
|
||||||
jQuery.extend( config, options );
|
jQuery.extend( config, options );
|
||||||
@@ -2463,7 +2472,7 @@ function IFM(params) {
|
|||||||
searchresults.tBodies[0].addEventListener( 'click', function( e ) {
|
searchresults.tBodies[0].addEventListener( 'click', function( e ) {
|
||||||
if( e.target.classList.contains( 'searchitem' ) || e.target.parentElement.classList.contains( 'searchitem' ) ) {
|
if( e.target.classList.contains( 'searchitem' ) || e.target.parentElement.classList.contains( 'searchitem' ) ) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
self.changeDirectory( self.pathCombine( self.search.data.currentDir, e.target.dataset.folder || e.target.parentElement.dataset.foldera ), { absolute: true } );
|
self.changeDirectory(self.pathCombine(self.search.data.currentDir, e.target.dataset.folder || e.target.parentElement.dataset.folder), {absolute: true});
|
||||||
self.hideModal();
|
self.hideModal();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -2916,8 +2925,10 @@ function IFM(params) {
|
|||||||
// global key events
|
// global key events
|
||||||
switch( e.key ) {
|
switch( e.key ) {
|
||||||
case '/':
|
case '/':
|
||||||
e.preventDefault();
|
if (self.config.search) {
|
||||||
self.showSearchDialog();
|
e.preventDefault();
|
||||||
|
self.showSearchDialog();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -2925,9 +2936,10 @@ function IFM(params) {
|
|||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
e.preventDefault();
|
if (self.config.showrefresh) {
|
||||||
self.refreshFileTable();
|
e.preventDefault();
|
||||||
return;
|
self.refreshFileTable();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
if( self.config.upload ) {
|
if( self.config.upload ) {
|
||||||
@@ -3154,8 +3166,12 @@ function IFM(params) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// bind static buttons
|
// bind static buttons
|
||||||
document.getElementById( 'refresh' ).onclick = function() { self.refreshFileTable(); };
|
if (el_r = document.getElementById('refresh'))
|
||||||
document.getElementById( 'search' ).onclick = function() { self.showSearchDialog(); };
|
el_r.onclick = function() { self.refreshFileTable(); };
|
||||||
|
if (el_s = document.getElementById('search'))
|
||||||
|
el_s.onclick = function() { self.showSearchDialog(); };
|
||||||
|
//document.getElementById( 'refresh' ).onclick = function() { self.refreshFileTable(); };
|
||||||
|
//document.getElementById( 'search' ).onclick = function() { self.showSearchDialog(); };
|
||||||
if( self.config.createfile )
|
if( self.config.createfile )
|
||||||
document.getElementById( 'createFile' ).onclick = function() { self.showFileDialog(); };
|
document.getElementById( 'createFile' ).onclick = function() { self.showFileDialog(); };
|
||||||
if( self.config.createdir )
|
if( self.config.createdir )
|
||||||
@@ -3516,6 +3532,11 @@ f00bar;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function searchItems( $d ) {
|
private function searchItems( $d ) {
|
||||||
|
if( $this->config['search'] != 1 ) {
|
||||||
|
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['nopermissions'] ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( strpos( $d['pattern'], '/' ) !== false ) {
|
if( strpos( $d['pattern'], '/' ) !== false ) {
|
||||||
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['pattern_error_slashes'] ) );
|
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['pattern_error_slashes'] ) );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
@@ -3884,7 +3905,6 @@ f00bar;
|
|||||||
elseif ( ! $this->isFilenameValid( $d['filename'] ) )
|
elseif ( ! $this->isFilenameValid( $d['filename'] ) )
|
||||||
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['invalid_filename'] ) );
|
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['invalid_filename'] ) );
|
||||||
else {
|
else {
|
||||||
trigger_error("foo bar");
|
|
||||||
unset( $zip );
|
unset( $zip );
|
||||||
$dfile = $this->pathCombine( __DIR__, $this->config['tmp_dir'], uniqid( "ifm-tmp-" ) . ".zip" ); // temporary filename
|
$dfile = $this->pathCombine( __DIR__, $this->config['tmp_dir'], uniqid( "ifm-tmp-" ) . ".zip" ); // temporary filename
|
||||||
try {
|
try {
|
||||||
|
15
src/ifm.js
15
src/ifm.js
@@ -1594,9 +1594,10 @@ function IFM(params) {
|
|||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
e.preventDefault();
|
if (self.config.showrefresh) {
|
||||||
self.refreshFileTable();
|
e.preventDefault();
|
||||||
return;
|
self.refreshFileTable();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
if( self.config.upload ) {
|
if( self.config.upload ) {
|
||||||
@@ -1823,8 +1824,12 @@ function IFM(params) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// bind static buttons
|
// bind static buttons
|
||||||
document.getElementById( 'refresh' ).onclick = function() { self.refreshFileTable(); };
|
if (el_r = document.getElementById('refresh'))
|
||||||
document.getElementById( 'search' ).onclick = function() { self.showSearchDialog(); };
|
el_r.onclick = function() { self.refreshFileTable(); };
|
||||||
|
if (el_s = document.getElementById('search'))
|
||||||
|
el_s.onclick = function() { self.showSearchDialog(); };
|
||||||
|
//document.getElementById( 'refresh' ).onclick = function() { self.refreshFileTable(); };
|
||||||
|
//document.getElementById( 'search' ).onclick = function() { self.showSearchDialog(); };
|
||||||
if( self.config.createfile )
|
if( self.config.createfile )
|
||||||
document.getElementById( 'createFile' ).onclick = function() { self.showFileDialog(); };
|
document.getElementById( 'createFile' ).onclick = function() { self.showFileDialog(); };
|
||||||
if( self.config.createdir )
|
if( self.config.createdir )
|
||||||
|
11
src/main.php
11
src/main.php
@@ -41,6 +41,7 @@ class IFM {
|
|||||||
"rename" => 1,
|
"rename" => 1,
|
||||||
"zipnload" => 1,
|
"zipnload" => 1,
|
||||||
"createarchive" => 1,
|
"createarchive" => 1,
|
||||||
|
"search" => 1,
|
||||||
|
|
||||||
// gui controls
|
// gui controls
|
||||||
"showlastmodified" => 0,
|
"showlastmodified" => 0,
|
||||||
@@ -52,7 +53,8 @@ class IFM {
|
|||||||
"showhiddenfiles" => 1,
|
"showhiddenfiles" => 1,
|
||||||
"showpath" => 0,
|
"showpath" => 0,
|
||||||
"contextmenu" => 1,
|
"contextmenu" => 1,
|
||||||
"disable_mime_detection" => 0
|
"disable_mime_detection" => 0,
|
||||||
|
"showrefresh" => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
private $config = array();
|
private $config = array();
|
||||||
@@ -98,6 +100,8 @@ class IFM {
|
|||||||
$this->config['showhiddenfiles'] = getenv('IFM_GUI_SHOWHIDDENFILES') !== false ? intval( getenv('IFM_GUI_SHOWHIDDENFILES') ) : $this->config['showhiddenfiles'] ;
|
$this->config['showhiddenfiles'] = getenv('IFM_GUI_SHOWHIDDENFILES') !== false ? intval( getenv('IFM_GUI_SHOWHIDDENFILES') ) : $this->config['showhiddenfiles'] ;
|
||||||
$this->config['showpath'] = getenv('IFM_GUI_SHOWPATH') !== false ? intval( getenv('IFM_GUI_SHOWPATH') ) : $this->config['showpath'] ;
|
$this->config['showpath'] = getenv('IFM_GUI_SHOWPATH') !== false ? intval( getenv('IFM_GUI_SHOWPATH') ) : $this->config['showpath'] ;
|
||||||
$this->config['contextmenu'] = getenv('IFM_GUI_CONTEXTMENU') !== false ? intval( getenv('IFM_GUI_CONTEXTMENU') ) : $this->config['contextmenu'] ;
|
$this->config['contextmenu'] = getenv('IFM_GUI_CONTEXTMENU') !== false ? intval( getenv('IFM_GUI_CONTEXTMENU') ) : $this->config['contextmenu'] ;
|
||||||
|
$this->config['search'] = getenv('IFM_API_SEARCH') !== false ? intval( getenv('IFM_API_SEARCH') ) : $this->config['search'] ;
|
||||||
|
$this->config['showrefresh'] = getenv('IFM_GUI_REFRESH') !== false ? intval( getenv('IFM_GUI_REFRESH') ) : $this->config['showrefresh'] ;
|
||||||
|
|
||||||
// optional settings
|
// optional settings
|
||||||
if( getenv('IFM_SESSION_LIFETIME') !== false )
|
if( getenv('IFM_SESSION_LIFETIME') !== false )
|
||||||
@@ -451,6 +455,11 @@ f00bar;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function searchItems( $d ) {
|
private function searchItems( $d ) {
|
||||||
|
if( $this->config['search'] != 1 ) {
|
||||||
|
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['nopermissions'] ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( strpos( $d['pattern'], '/' ) !== false ) {
|
if( strpos( $d['pattern'], '/' ) !== false ) {
|
||||||
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['pattern_error_slashes'] ) );
|
$this->jsonResponse( array( "status" => "ERROR", "message" => $this->l['pattern_error_slashes'] ) );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
|
@@ -23,8 +23,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
{{#config.showrefresh}}
|
||||||
<li><a id="refresh"><span title="{{i18n.refresh}}" class="icon icon-arrows-cw"></span> <span class="visible-xs">{{i18n.refresh}}</span></a></li>
|
<li><a id="refresh"><span title="{{i18n.refresh}}" class="icon icon-arrows-cw"></span> <span class="visible-xs">{{i18n.refresh}}</span></a></li>
|
||||||
|
{{/config.showrefresh}}
|
||||||
|
{{#config.search}}
|
||||||
<li><a id="search"><span title="{{i18n.search}}" class="icon icon-search"></span> <span class="visible-xs">{{i18n.search}}</span></a></li>
|
<li><a id="search"><span title="{{i18n.search}}" class="icon icon-search"></span> <span class="visible-xs">{{i18n.search}}</span></a></li>
|
||||||
|
{{/config.search}}
|
||||||
{{#config.upload}}
|
{{#config.upload}}
|
||||||
<li><a id="upload"><span title="{{i18n.upload}}" class="icon icon-upload"></span> <span class="visible-xs">{{i18n.upload}}</span></a></li>
|
<li><a id="upload"><span title="{{i18n.upload}}" class="icon icon-upload"></span> <span class="visible-xs">{{i18n.upload}}</span></a></li>
|
||||||
{{/config.upload}}
|
{{/config.upload}}
|
||||||
|
Reference in New Issue
Block a user