Initial commit

This commit is contained in:
2020-01-27 08:56:08 +01:00
commit b7525048d6
27129 changed files with 3409855 additions and 0 deletions

View File

@@ -0,0 +1,142 @@
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Contest\Form\Base;
use Contest\Contest;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints\NotBlank;
/**
* Class AnswerCreateForm
* @package Contest\Form\Base
* @author TheliaStudio
*/
class AnswerCreateForm extends BaseForm
{
const FORM_NAME = "answer_create";
public function buildForm()
{
$translationKeys = $this->getTranslationKeys();
$fieldsIdKeys = $this->getFieldsIdKeys();
$this->addVisibleField($translationKeys, $fieldsIdKeys);
$this->addCorrectField($translationKeys, $fieldsIdKeys);
$this->addTitleField($translationKeys, $fieldsIdKeys);
$this->addDescriptionField($translationKeys, $fieldsIdKeys);
$this->addQuestionIdField($translationKeys, $fieldsIdKeys);
$this->addLocaleField();
}
public function addLocaleField()
{
$this->formBuilder->add(
'locale',
'hidden',
[
'constraints' => [ new NotBlank() ],
'required' => true,
]
);
}
protected function addVisibleField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("visible", "checkbox", array(
"label" => $this->translator->trans($this->readKey("visible", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("visible", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addCorrectField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("correct", "checkbox", array(
"label" => $this->translator->trans($this->readKey("correct", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("correct", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addTitleField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("title", "text", array(
"label" => $this->translator->trans($this->readKey("title", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("title", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addDescriptionField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("description", "textarea", array(
"label" => $this->translator->trans($this->readKey("description", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("description", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addQuestionIdField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("question_id", "integer", array(
"label" => $this->translator->trans($this->readKey("question_id", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("question_id", $fieldsIdKeys)],
"required" => true,
"constraints" => array(
new NotBlank(),
),
"attr" => array(
)
));
}
public function getName()
{
return static::FORM_NAME;
}
public function readKey($key, array $keys, $default = '')
{
if (isset($keys[$key])) {
return $keys[$key];
}
return $default;
}
public function getTranslationKeys()
{
return array();
}
public function getFieldsIdKeys()
{
return array(
"visible" => "answer_visible",
"correct" => "answer_correct",
"title" => "answer_title",
"description" => "answer_description",
"question_id" => "answer_question_id",
);
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Contest\Form\Base;
use Contest\Form\AnswerCreateForm as ChildAnswerCreateForm;
use Contest\Form\Type\AnswerIdType;
/**
* Class AnswerForm
* @package Contest\Form
* @author TheliaStudio
*/
class AnswerUpdateForm extends ChildAnswerCreateForm
{
const FORM_NAME = "answer_update";
public function buildForm()
{
parent::buildForm();
$this->formBuilder
->add("id", AnswerIdType::TYPE_NAME)
->remove("visible")
;
}
}

View File

@@ -0,0 +1,111 @@
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Contest\Form\Base;
use Contest\Contest;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints\NotBlank;
/**
* Class GameCreateForm
* @package Contest\Form\Base
* @author TheliaStudio
*/
class GameCreateForm extends BaseForm
{
const FORM_NAME = "game_create";
public function buildForm()
{
$translationKeys = $this->getTranslationKeys();
$fieldsIdKeys = $this->getFieldsIdKeys();
$this->addVisibleField($translationKeys, $fieldsIdKeys);
$this->addTitleField($translationKeys, $fieldsIdKeys);
$this->addDescriptionField($translationKeys, $fieldsIdKeys);
$this->addLocaleField();
}
public function addLocaleField()
{
$this->formBuilder->add(
'locale',
'hidden',
[
'constraints' => [ new NotBlank() ],
'required' => true,
]
);
}
protected function addVisibleField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("visible", "checkbox", array(
"label" => $this->translator->trans($this->readKey("visible", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("visible", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addTitleField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("title", "text", array(
"label" => $this->translator->trans($this->readKey("title", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("title", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addDescriptionField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("description", "textarea", array(
"label" => $this->translator->trans($this->readKey("description", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("description", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
public function getName()
{
return static::FORM_NAME;
}
public function readKey($key, array $keys, $default = '')
{
if (isset($keys[$key])) {
return $keys[$key];
}
return $default;
}
public function getTranslationKeys()
{
return array();
}
public function getFieldsIdKeys()
{
return array(
"visible" => "game_visible",
"title" => "game_title",
"description" => "game_description",
);
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Contest\Form\Base;
use Contest\Form\GameCreateForm as ChildGameCreateForm;
use Contest\Form\Type\GameIdType;
/**
* Class GameForm
* @package Contest\Form
* @author TheliaStudio
*/
class GameUpdateForm extends ChildGameCreateForm
{
const FORM_NAME = "game_update";
public function buildForm()
{
parent::buildForm();
$this->formBuilder
->add("id", GameIdType::TYPE_NAME)
->remove("visible")
;
}
}

View File

@@ -0,0 +1,115 @@
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Contest\Form\Base;
use Contest\Contest;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints\NotBlank;
/**
* Class ParticipateCreateForm
* @package Contest\Form\Base
* @author TheliaStudio
*/
class ParticipateCreateForm extends BaseForm
{
const FORM_NAME = "participate_create";
public function buildForm()
{
$translationKeys = $this->getTranslationKeys();
$fieldsIdKeys = $this->getFieldsIdKeys();
$this->addEmailField($translationKeys, $fieldsIdKeys);
$this->addWinField($translationKeys, $fieldsIdKeys);
$this->addGameIdField($translationKeys, $fieldsIdKeys);
$this->addCustomerIdField($translationKeys, $fieldsIdKeys);
}
protected function addEmailField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("email", "text", array(
"label" => $this->translator->trans($this->readKey("email", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("email", $fieldsIdKeys)],
"required" => true,
"constraints" => array(
new NotBlank(),
),
"attr" => array(
)
));
}
protected function addWinField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("win", "checkbox", array(
"label" => $this->translator->trans($this->readKey("win", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("win", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addGameIdField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("game_id", "integer", array(
"label" => $this->translator->trans($this->readKey("game_id", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("game_id", $fieldsIdKeys)],
"required" => true,
"constraints" => array(
new NotBlank(),
),
"attr" => array(
)
));
}
protected function addCustomerIdField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("customer_id", "integer", array(
"label" => $this->translator->trans($this->readKey("customer_id", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("customer_id", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
public function getName()
{
return static::FORM_NAME;
}
public function readKey($key, array $keys, $default = '')
{
if (isset($keys[$key])) {
return $keys[$key];
}
return $default;
}
public function getTranslationKeys()
{
return array();
}
public function getFieldsIdKeys()
{
return array(
"email" => "participate_email",
"win" => "participate_win",
"game_id" => "participate_game_id",
"customer_id" => "participate_customer_id",
);
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Contest\Form\Base;
use Contest\Form\ParticipateCreateForm as ChildParticipateCreateForm;
use Contest\Form\Type\ParticipateIdType;
/**
* Class ParticipateForm
* @package Contest\Form
* @author TheliaStudio
*/
class ParticipateUpdateForm extends ChildParticipateCreateForm
{
const FORM_NAME = "participate_update";
public function buildForm()
{
parent::buildForm();
$this->formBuilder
->add("id", ParticipateIdType::TYPE_NAME)
;
}
}

View File

@@ -0,0 +1,127 @@
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Contest\Form\Base;
use Contest\Contest;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints\NotBlank;
/**
* Class QuestionCreateForm
* @package Contest\Form\Base
* @author TheliaStudio
*/
class QuestionCreateForm extends BaseForm
{
const FORM_NAME = "question_create";
public function buildForm()
{
$translationKeys = $this->getTranslationKeys();
$fieldsIdKeys = $this->getFieldsIdKeys();
$this->addVisibleField($translationKeys, $fieldsIdKeys);
$this->addTitleField($translationKeys, $fieldsIdKeys);
$this->addDescriptionField($translationKeys, $fieldsIdKeys);
$this->addGameIdField($translationKeys, $fieldsIdKeys);
$this->addLocaleField();
}
public function addLocaleField()
{
$this->formBuilder->add(
'locale',
'hidden',
[
'constraints' => [ new NotBlank() ],
'required' => true,
]
);
}
protected function addVisibleField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("visible", "checkbox", array(
"label" => $this->translator->trans($this->readKey("visible", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("visible", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addTitleField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("title", "text", array(
"label" => $this->translator->trans($this->readKey("title", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("title", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addDescriptionField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("description", "textarea", array(
"label" => $this->translator->trans($this->readKey("description", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("description", $fieldsIdKeys)],
"required" => false,
"constraints" => array(
),
"attr" => array(
)
));
}
protected function addGameIdField(array $translationKeys, array $fieldsIdKeys)
{
$this->formBuilder->add("game_id", "integer", array(
"label" => $this->translator->trans($this->readKey("game_id", $translationKeys), [], Contest::MESSAGE_DOMAIN),
"label_attr" => ["for" => $this->readKey("game_id", $fieldsIdKeys)],
"required" => true,
"constraints" => array(
new NotBlank(),
),
"attr" => array(
)
));
}
public function getName()
{
return static::FORM_NAME;
}
public function readKey($key, array $keys, $default = '')
{
if (isset($keys[$key])) {
return $keys[$key];
}
return $default;
}
public function getTranslationKeys()
{
return array();
}
public function getFieldsIdKeys()
{
return array(
"visible" => "question_visible",
"title" => "question_title",
"description" => "question_description",
"game_id" => "question_game_id",
);
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Contest\Form\Base;
use Contest\Form\QuestionCreateForm as ChildQuestionCreateForm;
use Contest\Form\Type\QuestionIdType;
/**
* Class QuestionForm
* @package Contest\Form
* @author TheliaStudio
*/
class QuestionUpdateForm extends ChildQuestionCreateForm
{
const FORM_NAME = "question_update";
public function buildForm()
{
parent::buildForm();
$this->formBuilder
->add("id", QuestionIdType::TYPE_NAME)
->remove("visible")
;
}
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="AnswerCreateForm.php" server="51.254.220.106//web/" local="131351944800000000" remote="131351944800000000" />
<file name="AnswerUpdateForm.php" server="51.254.220.106//web/" local="131351944800000000" remote="131351944800000000" />
<file name="GameCreateForm.php" server="51.254.220.106//web/" local="131351944800000000" remote="131351944800000000" />
<file name="GameUpdateForm.php" server="51.254.220.106//web/" local="131351944800000000" remote="131351944800000000" />
<file name="ParticipateCreateForm.php" server="51.254.220.106//web/" local="131351944800000000" remote="131351944800000000" />
<file name="ParticipateUpdateForm.php" server="51.254.220.106//web/" local="131351944800000000" remote="131351944800000000" />
<file name="QuestionCreateForm.php" server="51.254.220.106//web/" local="131351944800000000" remote="131351944800000000" />
<file name="QuestionUpdateForm.php" server="51.254.220.106//web/" local="131351944800000000" remote="131351944800000000" />
</dwsync>