Merge branch 'master' of https://github.com/thelia/thelia into upload_management
# By Manuel Raynaud (14) and Etienne Roudeix (1) # Via Etienne Roudeix * 'master' of https://github.com/thelia/thelia: cache dataccessfunctions fire event on insert content in createmethod fix issue, default foler is set on content creation allow to create new content update default param of content model create content listener for crud management dispatch event in pre/post crud method for content model display content modification page create contentUpdateEvent create contentCreateEvent create ContentEvent create contentModificationForm create content controller change folder_id parm by parent in list folder view use placeholder in folder update route
This commit is contained in:
@@ -27,7 +27,7 @@ use Thelia\Core\Translation\Translator;
|
||||
|
||||
class ContentCreationForm extends BaseForm
|
||||
{
|
||||
protected function buildForm($change_mode = false)
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add("title", "text", array(
|
||||
@@ -40,9 +40,11 @@ class ContentCreationForm extends BaseForm
|
||||
)
|
||||
))
|
||||
->add("default_folder", "integer", array(
|
||||
"label" => Translator::getInstance()->trans("Default folder *"),
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
),
|
||||
"label_attr" => array("for" => "default_folder")
|
||||
))
|
||||
->add("locale", "text", array(
|
||||
"constraints" => array(
|
||||
|
||||
61
core/lib/Thelia/Form/ContentModificationForm.php
Normal file
61
core/lib/Thelia/Form/ContentModificationForm.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\StandardDescriptionFieldsTrait;
|
||||
|
||||
/**
|
||||
* Class ContentModificationForm
|
||||
* @package Thelia\Form
|
||||
* @author manuel raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class ContentModificationForm extends ContentCreationForm {
|
||||
use StandardDescriptionFieldsTrait;
|
||||
|
||||
protected function buildForm()
|
||||
{
|
||||
parent::buildForm();
|
||||
|
||||
$this->formBuilder
|
||||
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
|
||||
|
||||
->add("url", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Rewriten URL *"),
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label_attr" => array("for" => "rewritten_url")
|
||||
))
|
||||
;
|
||||
|
||||
// Add standard description fields, excluding title and locale, which a re defined in parent class
|
||||
$this->addStandardDescFields(array('title', 'locale'));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_content_modification";
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class FolderModificationForm extends FolderCreationForm
|
||||
|
||||
protected function buildForm()
|
||||
{
|
||||
parent::buildForm(true);
|
||||
parent::buildForm();
|
||||
|
||||
$this->formBuilder
|
||||
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
|
||||
|
||||
Reference in New Issue
Block a user