public function moveContentDirectory($source, $contentId = NULL) {
    if ($source === NULL) {
      return NULL;
    }

    // TODO: Remove $contentId and never copy temporary files into content folder. JI-366
    if ($contentId === NULL || $contentId == 0) {
      $target = $this->getEditorPath();
    }
    else {
      // Use content folder
      $target = "{$this->path}/content/{$contentId}";
    }

    $contentSource = $source . DIRECTORY_SEPARATOR . 'content';
    $contentFiles = array_diff(scandir($contentSource), array('.','..', 'content.json'));
    foreach ($contentFiles as $file) {
      if (is_dir("{$contentSource}/{$file}")) {
        self::copyFileTree("{$contentSource}/{$file}", "{$target}/{$file}");
      }
      else {
        copy("{$contentSource}/{$file}", "{$target}/{$file}");
      }
    }

    // TODO: Return list of all files so that they can be marked as temporary. JI-366
  }
public function moveContentDirectory($source, $contentId = NULL) {
    if ($source === NULL) {
      return NULL;
    }

    // TODO: Remove $contentId and never copy temporary files into content folder. JI-366
    if ($contentId === NULL || $contentId == 0) {
      $target = $this->getEditorPath();
    }
    else {
      // Use content folder
      $target = "{$this->path}/content/{$contentId}";
    }

    $contentSource = $source . DIRECTORY_SEPARATOR . 'content';
    $contentFiles = array_diff(scandir($contentSource), array('.','..', 'content.json'));
    foreach ($contentFiles as $file) {
      if (is_dir("{$contentSource}/{$file}")) {
        self::copyFileTree("{$contentSource}/{$file}", "{$target}/{$file}");
      }
      else {
        copy("{$contentSource}/{$file}", "{$target}/{$file}");
      }
    }

    // TODO: Return list of all files so that they can be marked as temporary. JI-366
  }
public function moveContentDirectory ( $ source , $ contentId = NULL ) { if ( $ source === NULL ) { return NULL ; } // TODO: Remove $contentId and never copy temporary files into content folder. JI-366 if ( $ contentId === NULL || $ contentId == 0 ) { $ target = $ this -> getEditorPath ( ) ; } else { // Use content folder $ target = "{$this->path}/content/{$contentId}" ; } $ contentSource = $ source . DIRECTORY_SEPARATOR . 'content' ; $ contentFiles = array_diff ( scandir ( $ contentSource ) , array ( '.' , '..' , 'content.json' ) ) ; foreach ( $ contentFiles as $ file ) { if ( is_dir ( "{$contentSource}/{$file}" ) ) { self :: copyFileTree ( "{$contentSource}/{$file}" , "{$target}/{$file}" ) ; } else { copy ( "{$contentSource}/{$file}" , "{$target}/{$file}" ) ; } } // TODO: Return list of all files so that they can be marked as temporary. JI-366 }
Copy a content from one directory to another. Defaults to cloning
content from the current temporary upload folder to the editor path.

@param string $source path to source directory
@param string $contentId Id of contentarray
Copy a content from one directory to another . Defaults to cloning content from the current temporary upload folder to the editor path .