1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-24 16:42:47 +02:00

fixed merge conflicts

This commit is contained in:
Marco Dickert
2017-07-18 13:32:38 +02:00
parent ede3ec86b8
commit 1171346cbe
5 changed files with 38 additions and 27 deletions

View File

@@ -333,7 +333,8 @@ function IFM( params ) {
* @param string content - content of the modal * @param string content - content of the modal
* @param object options - options for the modal * @param object options - options for the modal
*/ */
this.showModal = function( content, options = {} ) { this.showModal = function( content, options ) {
options = options || {};
var modal = $( document.createElement( 'div' ) ) var modal = $( document.createElement( 'div' ) )
.addClass( "modal fade" ) .addClass( "modal fade" )
.attr( 'id', 'ifmmodal' ) .attr( 'id', 'ifmmodal' )
@@ -522,7 +523,8 @@ function IFM( params ) {
* @param string newdir - target directory * @param string newdir - target directory
* @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 ) {
options = options || {};
config = { absolute: false, pushState: true }; config = { absolute: false, pushState: true };
jQuery.extend( config, options ); jQuery.extend( config, options );
if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir ); if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir );
@@ -1559,7 +1561,7 @@ function IFM( params ) {
*/ */
private function handleRequest() { private function handleRequest() {
if($_REQUEST["api"] == "getRealpath") { if( $_REQUEST["api"] == "getRealpath" ) {
if( isset( $_REQUEST["dir"] ) && $_REQUEST["dir"] != "" ) if( isset( $_REQUEST["dir"] ) && $_REQUEST["dir"] != "" )
echo json_encode( array( "realpath" => $this->getValidDir( $_REQUEST["dir"] ) ) ); echo json_encode( array( "realpath" => $this->getValidDir( $_REQUEST["dir"] ) ) );
else else
@@ -1599,7 +1601,7 @@ function IFM( params ) {
break; break;
} }
} else { } else {
print json_encode(array("status"=>"ERROR", "message"=>"No valid working directory")); print json_encode( array( "status" => "ERROR", "message" => "No valid working directory" ) );
} }
} }
exit( 0 ); exit( 0 );
@@ -1613,7 +1615,7 @@ function IFM( params ) {
else else
chdir( realpath( $this->config['root_dir'] ) ); chdir( realpath( $this->config['root_dir'] ) );
$this->mode = $mode; $this->mode = $mode;
if ( isset( $_REQUEST['api'] ) || $mode == "api" ) { if( isset( $_REQUEST['api'] ) || $mode == "api" ) {
$this->handleRequest(); $this->handleRequest();
} elseif( $mode == "standalone" ) { } elseif( $mode == "standalone" ) {
$this->getApplication(); $this->getApplication();
@@ -1642,7 +1644,7 @@ function IFM( params ) {
else { else {
$item = array(); $item = array();
$item["name"] = $result; $item["name"] = $result;
if( is_dir($result) ) { if( is_dir( $result ) ) {
$item["type"] = "dir"; $item["type"] = "dir";
if( $result == ".." ) if( $result == ".." )
$item["icon"] = "icon icon-up-open"; $item["icon"] = "icon icon-up-open";

View File

@@ -40,14 +40,14 @@ foreach( $IFM_SRC_PHPFILES as $file ) {
*/ */
file_put_contents( $IFM_BUILD_STANDALONE, $main ); file_put_contents( $IFM_BUILD_STANDALONE, $main );
file_put_contents( $IFM_BUILD_STANDALONE, $phpincludes, FILE_APPEND ); file_put_contents( $IFM_BUILD_STANDALONE, $phpincludes, FILE_APPEND );
file_put_contents( $IFM_BUILD_STANDALONE, array( file_put_contents( $IFM_BUILD_STANDALONE,
'', '
'/**', /**
' * start IFM', * start IFM
' */', */
'$ifm = new IFM();', $ifm = new IFM();
'$ifm->run();' $ifm->run();'
), FILE_APPEND ); , FILE_APPEND );
/** /**
* Build library * Build library

21
ifm.php
View File

@@ -333,7 +333,8 @@ function IFM( params ) {
* @param string content - content of the modal * @param string content - content of the modal
* @param object options - options for the modal * @param object options - options for the modal
*/ */
this.showModal = function( content, options = {} ) { this.showModal = function( content, options ) {
options = options || {};
var modal = $( document.createElement( 'div' ) ) var modal = $( document.createElement( 'div' ) )
.addClass( "modal fade" ) .addClass( "modal fade" )
.attr( 'id', 'ifmmodal' ) .attr( 'id', 'ifmmodal' )
@@ -522,7 +523,8 @@ function IFM( params ) {
* @param string newdir - target directory * @param string newdir - target directory
* @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 ) {
options = options || {};
config = { absolute: false, pushState: true }; config = { absolute: false, pushState: true };
jQuery.extend( config, options ); jQuery.extend( config, options );
if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir ); if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir );
@@ -1559,7 +1561,7 @@ function IFM( params ) {
*/ */
private function handleRequest() { private function handleRequest() {
if($_REQUEST["api"] == "getRealpath") { if( $_REQUEST["api"] == "getRealpath" ) {
if( isset( $_REQUEST["dir"] ) && $_REQUEST["dir"] != "" ) if( isset( $_REQUEST["dir"] ) && $_REQUEST["dir"] != "" )
echo json_encode( array( "realpath" => $this->getValidDir( $_REQUEST["dir"] ) ) ); echo json_encode( array( "realpath" => $this->getValidDir( $_REQUEST["dir"] ) ) );
else else
@@ -1599,7 +1601,7 @@ function IFM( params ) {
break; break;
} }
} else { } else {
print json_encode(array("status"=>"ERROR", "message"=>"No valid working directory")); print json_encode( array( "status" => "ERROR", "message" => "No valid working directory" ) );
} }
} }
exit( 0 ); exit( 0 );
@@ -1613,7 +1615,7 @@ function IFM( params ) {
else else
chdir( realpath( $this->config['root_dir'] ) ); chdir( realpath( $this->config['root_dir'] ) );
$this->mode = $mode; $this->mode = $mode;
if ( isset( $_REQUEST['api'] ) || $mode == "api" ) { if( isset( $_REQUEST['api'] ) || $mode == "api" ) {
$this->handleRequest(); $this->handleRequest();
} elseif( $mode == "standalone" ) { } elseif( $mode == "standalone" ) {
$this->getApplication(); $this->getApplication();
@@ -1642,7 +1644,7 @@ function IFM( params ) {
else { else {
$item = array(); $item = array();
$item["name"] = $result; $item["name"] = $result;
if( is_dir($result) ) { if( is_dir( $result ) ) {
$item["type"] = "dir"; $item["type"] = "dir";
if( $result == ".." ) if( $result == ".." )
$item["icon"] = "icon icon-up-open"; $item["icon"] = "icon icon-up-open";
@@ -2834,4 +2836,9 @@ class IFMZip {
} }
} }
} }
/** * start IFM */$ifm = new IFM();$ifm->run();
/**
* start IFM
*/
$ifm = new IFM();
$ifm->run();

View File

@@ -21,7 +21,8 @@ function IFM( params ) {
* @param string content - content of the modal * @param string content - content of the modal
* @param object options - options for the modal * @param object options - options for the modal
*/ */
this.showModal = function( content, options = {} ) { this.showModal = function( content, options ) {
options = options || {};
var modal = $( document.createElement( 'div' ) ) var modal = $( document.createElement( 'div' ) )
.addClass( "modal fade" ) .addClass( "modal fade" )
.attr( 'id', 'ifmmodal' ) .attr( 'id', 'ifmmodal' )
@@ -210,7 +211,8 @@ function IFM( params ) {
* @param string newdir - target directory * @param string newdir - target directory
* @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 ) {
options = options || {};
config = { absolute: false, pushState: true }; config = { absolute: false, pushState: true };
jQuery.extend( config, options ); jQuery.extend( config, options );
if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir ); if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir );

View File

@@ -115,7 +115,7 @@ class IFM {
*/ */
private function handleRequest() { private function handleRequest() {
if($_REQUEST["api"] == "getRealpath") { if( $_REQUEST["api"] == "getRealpath" ) {
if( isset( $_REQUEST["dir"] ) && $_REQUEST["dir"] != "" ) if( isset( $_REQUEST["dir"] ) && $_REQUEST["dir"] != "" )
echo json_encode( array( "realpath" => $this->getValidDir( $_REQUEST["dir"] ) ) ); echo json_encode( array( "realpath" => $this->getValidDir( $_REQUEST["dir"] ) ) );
else else
@@ -155,7 +155,7 @@ class IFM {
break; break;
} }
} else { } else {
print json_encode(array("status"=>"ERROR", "message"=>"No valid working directory")); print json_encode( array( "status" => "ERROR", "message" => "No valid working directory" ) );
} }
} }
exit( 0 ); exit( 0 );
@@ -169,7 +169,7 @@ class IFM {
else else
chdir( realpath( $this->config['root_dir'] ) ); chdir( realpath( $this->config['root_dir'] ) );
$this->mode = $mode; $this->mode = $mode;
if ( isset( $_REQUEST['api'] ) || $mode == "api" ) { if( isset( $_REQUEST['api'] ) || $mode == "api" ) {
$this->handleRequest(); $this->handleRequest();
} elseif( $mode == "standalone" ) { } elseif( $mode == "standalone" ) {
$this->getApplication(); $this->getApplication();
@@ -198,7 +198,7 @@ class IFM {
else { else {
$item = array(); $item = array();
$item["name"] = $result; $item["name"] = $result;
if( is_dir($result) ) { if( is_dir( $result ) ) {
$item["type"] = "dir"; $item["type"] = "dir";
if( $result == ".." ) if( $result == ".." )
$item["icon"] = "icon icon-up-open"; $item["icon"] = "icon icon-up-open";