@@ -237,11 +237,14 @@ protected function copyOrMoveFile($destDir, $srcFile, &$error, &$success, $move
237
237
$ destFile = $ destUrlBase .$ destDir ."/ " .$ newName ;
238
238
}
239
239
}
240
+ $ srcNode = new AJXP_Node ($ realSrcFile );
241
+ $ destNode = new AJXP_Node ($ destFile );
240
242
if (!is_file ($ realSrcFile )) {
241
243
$ errors = array ();
242
244
$ succFiles = array ();
245
+ $ srcNode ->setLeaf (false );
243
246
if ($ move ) {
244
- AJXP_Controller::applyHook ("node.before_path_change " , array (new AJXP_Node ( $ realSrcFile ) ));
247
+ AJXP_Controller::applyHook ("node.before_path_change " , array ($ srcNode ));
245
248
if (file_exists ($ destFile )) $ this ->deldir ($ destFile , $ destRepoData );
246
249
$ res = rename ($ realSrcFile , $ destFile );
247
250
} else {
@@ -251,23 +254,24 @@ protected function copyOrMoveFile($destDir, $srcFile, &$error, &$success, $move
251
254
$ error [] = $ mess [114 ];
252
255
return ;
253
256
} else {
254
- AJXP_Controller::applyHook ("node.change " , array (new AJXP_Node ($ realSrcFile ), new AJXP_Node ($ destFile ), !$ move ));
257
+ $ destNode ->setLeaf (false );
258
+ AJXP_Controller::applyHook ("node.change " , array ($ srcNode , $ destNode , !$ move ));
255
259
}
256
260
} else {
257
261
if ($ move ) {
258
- AJXP_Controller::applyHook ("node.before_path_change " , array (new AJXP_Node ( $ realSrcFile ) ));
262
+ AJXP_Controller::applyHook ("node.before_path_change " , array ($ srcNode ));
259
263
if (file_exists ($ destFile )) unlink ($ destFile );
260
264
if (strcmp ($ srcWrapperName ,$ destWrapperName ) === 0 ){
261
265
$ res = rename ($ realSrcFile , $ destFile );
262
266
}else {
263
267
$ res = copy ($ realSrcFile , $ destFile );
264
268
}
265
- AJXP_Controller::applyHook ("node.change " , array (new AJXP_Node ( $ realSrcFile ), new AJXP_Node ( $ destFile ) , false ));
269
+ AJXP_Controller::applyHook ("node.change " , array ($ srcNode , $ destNode , false ));
266
270
} else {
267
271
try {
268
272
$ this ->filecopy ($ realSrcFile , $ destFile , $ srcWrapperName , $ destWrapperName );
269
273
$ this ->changeMode ($ destFile , $ destRepoData );
270
- AJXP_Controller::applyHook ("node.change " , array (new AJXP_Node ( $ realSrcFile ), new AJXP_Node ( $ destFile ) , true ));
274
+ AJXP_Controller::applyHook ("node.change " , array ($ srcNode , $ destNode , true ));
271
275
} catch (Exception $ e ) {
272
276
$ error [] = $ e ->getMessage ();
273
277
return ;
0 commit comments