0
커뮤니티 도움말이 필요하므로 폴더 이름을 변경할 때 사용자 입력을 확인하는 플러그인을 만들어야합니다. 플러그인은 새 이름이 바뀐 폴더를 확인해야하며 저장하기 전에 찾은 공간을 제거해야합니다.CKFinder 플러그인 - PHP - 폴더 이름을 바꿀 때 공백을 제거하면
나는 removeFolderSpace 함수에 갇혀 있는데 어떻게 완료해야할지 모르겠다. 누군가가 기꺼이 도와 주면 크게 감사하겠습니다!
<?php
namespace CKSource\CKFinder\Plugin\FolderSpace;
use CKSource\CKFinder\Acl\Permission;
use CKSource\CKFinder\CKFinder;
use CKSource\CKFinder\Config;
use CKSource\CKFinder\Command\CommandAbstract;
use CKSource\CKFinder\Event\CKFinderEvent;
use CKSource\CKFinder\Event\RenameFolderEvent;
use CKSource\CKFinder\Filesystem\Folder\Folder;
use CKSource\CKFinder\Filesystem\Folder\WorkingFolder;
use CKSource\CKFinder\Plugin\PluginInterface;
use CKSource\CKFinder\Filesystem\Path;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class FolderSpace implements PluginInterface, EventSubscriberInterface
{
protected $app;
public function setContainer(CKFinder $app) {
$this->app = $app;
}
protected $requires = [
Permission::FOLDER_RENAME,
];
public function getDefaultConfig() {
return [];
}
public function removeFolderSpace(RenameFolderEvent $event) {
$config = $this->app['config'];
//$dispatcher = $this->app['dispatcher'];
// $dispatcher->addListener(CKFinderEvent::AFTER_COMMAND_RENAME_FILE, function(AfterCommandEvent $e) {
// });
$request = $event->getRequest();
$workingFolder = $this->app['working_folder'];
}
public static function getSubscribedEvents()
{
return [CKFinderEvent::AFTER_COMMAND_RENAME_FILE => 'removeFolderSpace'];
}
}
귀하의 코드는 CreateFolder를 명령에 근무하지만 폴더는 오류 및 화면 공백을 표시 이름을 바꿀 때마다 나는 RenameFolder 때와 프런트 엔드에서 ckfinder를 열었을 때마다 오류가 발생하지만 파일 구조에서 폴더 이름이 변경됩니다. 로그에 WorkingFolder가없는 것으로 표시됩니다. –