2017-03-02 130 views
2

在config.php文件中使用CkFinder V3可以設置不同的資源類型。在CkFinder的所有資源類型中創建子文件夾

設置工作,我在左側面板上的兩個「條目」名爲「我的圖像」和「我的視頻」獲取CkFinder。

現在,當我選擇文件夾「我的視頻」並創建一個子文件夾時,子文件夾將添加到「我的視頻」和「我的圖像」上。

我只需要在用戶決定的地方添加一個子文件夾。

我的配置有什麼問題?

$config['resourceTypes'][] = array(
    'name'    => 'Images', 
    'label'    => 'My Images', 
    'maxSize'   => '2M', 
    'allowedExtensions' => 'gif,jpeg,jpg,png', 
    'deniedExtensions' => '', 
    'backend'   => 'default' 
); 

$config['resourceTypes'][] = array(
    'name'    => 'Videos', 
    'label'    => 'My Videos', 
    'maxSize'   => '1G', 
    'allowedExtensions' => 'mp4', 
    'deniedExtensions' => '', 
    'backend'   => 'default' 
); 

回答

2

您已經定義指向同一個文件夾(default後端的根文件夾),因爲它們不定義directory兩種資源類型。要使用單獨的文件夾,請使用directory選項,如下所示:

$config['resourceTypes'][] = array(
    'name'    => 'Images', 
    'label'    => 'My Images', 
    'maxSize'   => '2M', 
    'allowedExtensions' => 'gif,jpeg,jpg,png', 
    'deniedExtensions' => '', 
    'directory'   => 'images', // ← 
    'backend'   => 'default' 
); 

$config['resourceTypes'][] = array(
    'name'    => 'Videos', 
    'label'    => 'My Videos', 
    'maxSize'   => '1G', 
    'allowedExtensions' => 'mp4', 
    'deniedExtensions' => '', 
    'directory'   => 'videos', // ← 
    'backend'   => 'default' 
); 
相關問題