Document Manager Plugin for CakePHP 2.x

The Document Manager plugin provides an out of the box simple file management interface for any CakePHP 2.x application.

You define a base directory inside the webroot folder for your arborescence and inside you can create folders, upload/rename/delete files, browse them, obtain the absolute URL of any file in order to be able to link to it. Uploaded files informations are stored inside a Document table which allows to easily access them in your application. 

Moreover it can be hooked to an user management system to manage ownership of files and prevent files edition or deletion by other users. If you do not have an user management system, you can easily disable file ownership management to have an open system.

It requires jQuery to perform. It is styled with Bootstrap.

The source code can be found on GitHub : Document Manager Plugin for CakePHP.

Documented Behavior

A Documented Behavior inside the plugin allows to manage files associated to models of your applications and store their details in the documents table. Rather than having a 'datasheet_url' column inside a model's table, you declare a 'datasheet_id' and attach the behavior to your model :

public $actsAs = array(
	'DocumentManager.Documented' => array(
		'datasheet',
));

The document url and details will be saved in the documents table, while the foreign id of the new document will be stored inside the 'datasheet_id'.

When reading a model that behaves as a Document, associated documents URLs while automagically be splashed inside the result. In the previous example, a find() will return records having a 'datasheet' entry ($model['Model']['datasheet']) with a relative link to the file.

This page belongs to the following categories: news , CakePHP , Code , Plugin.

Comments

Danny 14/09/2013 12:19:44

Hi there Installed the application just like you mentioned. It all seems to work properly. The only thing I am struggling with is deletion of folders and files. They do delete correctly but i get redirected to an XML page that just displays the serialized array. When i go back to the folder and refresh the file is showing as deleted.

Chris 20/09/2013 11:39:57

Hey Danny, I think you do not have jQuery in your application, OR you load jQuery after the scripts of the plugin are loaded in "echo $this->fetch('css');"
Be sure to load jQuery as the first script and your problem should be fixed.

Add a comment

5105
Petits fours baked