1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

fix fields

This commit is contained in:
Mzhelskiy Maxim 2014-01-13 18:07:18 +07:00
parent a12760731d
commit 842c911000
2 changed files with 15 additions and 3 deletions

View file

@ -32,8 +32,20 @@ class ModuleTopic_EntityTopicType extends Entity {
array('name, name_many','string','max'=>200,'min'=>1,'allowEmpty'=>false),
array('code','regexp','pattern'=>"#^[a-z0-9_]{1,30}$#",'allowEmpty'=>false),
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() {
if ($oType=$this->Topic_GetTopicTypeByCode($this->getCode())) {
if ($oType->getId()!=$this->getId()) {

View file

@ -65,7 +65,7 @@
{* Заголовок топика *}
{include file='forms/fields/form.field.text.tpl'
sFieldName = 'topic[topic_title]'
sFieldValue = {($oTopicEdit) ? $oTopicEdit->getTitle() : '' }
sFieldValue = {(($oTopicEdit) ? $oTopicEdit->getTitle() : '')|escape:'html' }
sFieldEntityField = 'topic_title'
sFieldEntity = 'ModuleTopic_EntityTopic'
sFieldNote = $aLang.topic_create_title_notice
@ -79,7 +79,7 @@
{* TODO: Max length for poll and link *}
{include file='forms/fields/form.field.textarea.tpl'
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:']"'
sFieldLabel = $aLang.topic_create_text
sFieldClasses = 'width-full js-editor'}
@ -96,7 +96,7 @@
{* Теги *}
{include file='forms/fields/form.field.text.tpl'
sFieldName = 'topic[topic_tags]'
sFieldValue = {($oTopicEdit) ? $oTopicEdit->getTags() : '' }
sFieldValue = {(($oTopicEdit) ? $oTopicEdit->getTags() : '')|escape:'html' }
sFieldRules = 'required="true" rangetags="[1,15]"'
sFieldNote = $aLang.topic_create_tags_notice
sFieldLabel = $aLang.topic_create_tags