Inital commit

This commit is contained in:
2020-11-19 15:36:28 +01:00
parent 71f32f83d3
commit 66ce4ee218
18077 changed files with 2166122 additions and 35184 deletions

View File

@@ -11,6 +11,7 @@ use Thelia\Files\FileModelInterface;
use Thelia\Files\FileModelParentInterface;
use Thelia\Form\BaseForm;
use Thelia\Form\ContentDocumentModification;
use Thelia\Form\Definition\AdminForm;
use Thelia\Model\Base\ContentDocument as BaseContentDocument;
use Thelia\Model\Breadcrumb\BreadcrumbInterface;
use Thelia\Model\Breadcrumb\FolderBreadcrumbTrait;
@@ -95,19 +96,7 @@ class ContentDocument extends BaseContentDocument implements BreadcrumbInterface
*/
public function getUpdateFormId()
{
return 'thelia.admin.content.document.modification';
}
/**
* Get the form instance used to change this object information
*
* @param \Thelia\Core\HttpFoundation\Request $request
*
* @return BaseForm the form
*/
public function getUpdateFormInstance(Request $request)
{
return new ContentDocumentModification($request);
return AdminForm::CONTENT_DOCUMENT_MODIFICATION;
}
/**
@@ -115,7 +104,14 @@ class ContentDocument extends BaseContentDocument implements BreadcrumbInterface
*/
public function getUploadDir()
{
return THELIA_LOCAL_DIR . 'media'.DS.'documents'.DS.'content';
$uploadDir = ConfigQuery::read('documents_library_path');
if ($uploadDir === null) {
$uploadDir = THELIA_LOCAL_DIR . 'media' . DS . 'documents';
} else {
$uploadDir = THELIA_ROOT . $uploadDir;
}
return $uploadDir . DS . 'content';
}
/**