mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-28 20:45:00 +03:00
fix fields
This commit is contained in:
parent
a12760731d
commit
842c911000
|
@ -32,8 +32,20 @@ class ModuleTopic_EntityTopicType extends Entity {
|
||||||
array('name, name_many','string','max'=>200,'min'=>1,'allowEmpty'=>false),
|
array('name, name_many','string','max'=>200,'min'=>1,'allowEmpty'=>false),
|
||||||
array('code','regexp','pattern'=>"#^[a-z0-9_]{1,30}$#",'allowEmpty'=>false),
|
array('code','regexp','pattern'=>"#^[a-z0-9_]{1,30}$#",'allowEmpty'=>false),
|
||||||
array('code','code_unique'),
|
array('code','code_unique'),
|
||||||
|
array('name','check_name'),
|
||||||
|
array('name_many','check_name_many'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public function ValidateCheckName() {
|
||||||
|
$this->setName(htmlspecialchars($this->getName()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ValidateCheckNameMany() {
|
||||||
|
$this->setNameMany(htmlspecialchars($this->getNameMany()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function ValidateCodeUnique() {
|
public function ValidateCodeUnique() {
|
||||||
if ($oType=$this->Topic_GetTopicTypeByCode($this->getCode())) {
|
if ($oType=$this->Topic_GetTopicTypeByCode($this->getCode())) {
|
||||||
if ($oType->getId()!=$this->getId()) {
|
if ($oType->getId()!=$this->getId()) {
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
{* Заголовок топика *}
|
{* Заголовок топика *}
|
||||||
{include file='forms/fields/form.field.text.tpl'
|
{include file='forms/fields/form.field.text.tpl'
|
||||||
sFieldName = 'topic[topic_title]'
|
sFieldName = 'topic[topic_title]'
|
||||||
sFieldValue = {($oTopicEdit) ? $oTopicEdit->getTitle() : '' }
|
sFieldValue = {(($oTopicEdit) ? $oTopicEdit->getTitle() : '')|escape:'html' }
|
||||||
sFieldEntityField = 'topic_title'
|
sFieldEntityField = 'topic_title'
|
||||||
sFieldEntity = 'ModuleTopic_EntityTopic'
|
sFieldEntity = 'ModuleTopic_EntityTopic'
|
||||||
sFieldNote = $aLang.topic_create_title_notice
|
sFieldNote = $aLang.topic_create_title_notice
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
{* TODO: Max length for poll and link *}
|
{* TODO: Max length for poll and link *}
|
||||||
{include file='forms/fields/form.field.textarea.tpl'
|
{include file='forms/fields/form.field.textarea.tpl'
|
||||||
sFieldName = 'topic[topic_text_source]'
|
sFieldName = 'topic[topic_text_source]'
|
||||||
sFieldValue = {($oTopicEdit) ? $oTopicEdit->getTextSource() : '' }
|
sFieldValue = {(($oTopicEdit) ? $oTopicEdit->getTextSource() : '')|escape:'html' }
|
||||||
sFieldRules = 'required="true" rangelength="[2,'|cat:$oConfig->Get('module.topic.max_length')|cat:']"'
|
sFieldRules = 'required="true" rangelength="[2,'|cat:$oConfig->Get('module.topic.max_length')|cat:']"'
|
||||||
sFieldLabel = $aLang.topic_create_text
|
sFieldLabel = $aLang.topic_create_text
|
||||||
sFieldClasses = 'width-full js-editor'}
|
sFieldClasses = 'width-full js-editor'}
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
{* Теги *}
|
{* Теги *}
|
||||||
{include file='forms/fields/form.field.text.tpl'
|
{include file='forms/fields/form.field.text.tpl'
|
||||||
sFieldName = 'topic[topic_tags]'
|
sFieldName = 'topic[topic_tags]'
|
||||||
sFieldValue = {($oTopicEdit) ? $oTopicEdit->getTags() : '' }
|
sFieldValue = {(($oTopicEdit) ? $oTopicEdit->getTags() : '')|escape:'html' }
|
||||||
sFieldRules = 'required="true" rangetags="[1,15]"'
|
sFieldRules = 'required="true" rangetags="[1,15]"'
|
||||||
sFieldNote = $aLang.topic_create_tags_notice
|
sFieldNote = $aLang.topic_create_tags_notice
|
||||||
sFieldLabel = $aLang.topic_create_tags
|
sFieldLabel = $aLang.topic_create_tags
|
||||||
|
|
Loading…
Reference in a new issue