You are here

function _ueditor_realpath in UEditor - 百度编辑器 8

Same name and namespace in other branches
  1. 7.3 ueditor.module \_ueditor_realpath()
  2. 7 editors/ueditor.inc \_ueditor_realpath()
  3. 7.2 ueditor.module \_ueditor_realpath()

Change %path to realpath.

2 calls to _ueditor_realpath()
UEditor::buildConfigurationForm in src/Plugin/Editor/UEditor.php
Form constructor.
UploadFileController::server in src/Controller/UploadFileController.php
Upload.

File

./ueditor.module, line 24
Provides integration with the UEditor WYSIWYG editor.

Code

function _ueditor_realpath($path, $auto = FALSE) {
  $site_path = \Drupal::service('site.path');
  $lib_path = drupal_get_path('module', 'ueditor') . '/lib';
  $mod_path = drupal_get_path('module', 'ueditor');
  $path = strtr($path, array(
    '%b' => base_path(),
    '%m' => $mod_path,
    '%l' => $lib_path,
    '%f' => Settings::get('file_public_path', $site_path . '/files'),
    '%d' => strtr(DRUPAL_ROOT, '\\', '/'),
    '%u' => \Drupal::currentUser()
      ->id(),
  ));
  $path = strtr($path, '\\', '/');
  if ($auto) {
    $path .= '/';
  }
  $path = str_replace('//', '/', $path);
  return $path;
}