(New page: To create a new resource type you should place the section below in your config.php file. Note that the options you can use are discribed in the [[CKFinder/Users Guide/CKFinder Configurati...) |
|||
(21 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | To create a new resource type you should place the section below in your config.php file. Note that the options you can use are discribed in the [[ | + | To create a new resource type you should place the section below in your config.php file. Note that the options you can use are discribed in the [[CKFinder_1.x/Developers Guide/PHP/Configuration/Resource Types/Built-in|Built-in resource types]] section. |
− | + | ||
− | Example: | + | Example: You want to create a resource type MSdocs which will only have files with the doc,ppt,xls extensions and be maximum 2 megabites large. |
− | You want to create a resource type MSdocs which will only have doc,ppt,xls extensions and be maximum 2 megabites large. | + | <source lang="php">$config['ResourceType'][] = Array( |
− | < | ||
− | $config['ResourceType'][] = Array( | ||
'name' => 'MSdocs', | 'name' => 'MSdocs', | ||
− | 'url' => $baseUrl . ' | + | 'url' => $baseUrl . 'MSdocs', |
− | 'directory' => $baseDir . ' | + | 'directory' => $baseDir . 'MSdocs', |
'maxSize' => 2M, | 'maxSize' => 2M, | ||
'allowedExtensions' => 'doc,ppt,xls,', | 'allowedExtensions' => 'doc,ppt,xls,', | ||
− | 'deniedExtensions' => ''); | + | 'deniedExtensions' => '');</source> |
− | </ | + | When loading CKFinder, the "type" querystring parameter can be used to display a specific type only. If "type" is omitted in the URL, the "DefaultResourceTypes" settings is used (may contain the resource type names separated by a comma). <br>If left empty, all types are loaded. If you want to limit the CKFinder to use only MSdocs resource type'','' use the following code'':'' |
− | + | <pre>$config['DefaultResourceTypes'] = 'MSdocs';</pre> | |
− | + | {{#CUSTOMTITLE:Adding new resource types}} | |
− | |||
− | <pre> | ||
− | $config['DefaultResourceTypes'] = 'MSdocs'; | ||
− | </pre> |
Latest revision as of 09:01, 28 May 2010
To create a new resource type you should place the section below in your config.php file. Note that the options you can use are discribed in the Built-in resource types section.
Example: You want to create a resource type MSdocs which will only have files with the doc,ppt,xls extensions and be maximum 2 megabites large.
$config['ResourceType'][] = Array( 'name' => 'MSdocs', 'url' => $baseUrl . 'MSdocs', 'directory' => $baseDir . 'MSdocs', 'maxSize' => 2M, 'allowedExtensions' => 'doc,ppt,xls,', 'deniedExtensions' => '');
When loading CKFinder, the "type" querystring parameter can be used to display a specific type only. If "type" is omitted in the URL, the "DefaultResourceTypes" settings is used (may contain the resource type names separated by a comma).
If left empty, all types are loaded. If you want to limit the CKFinder to use only MSdocs resource type, use the following code:
$config['DefaultResourceTypes'] = 'MSdocs';