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

Доработка категорий #536

This commit is contained in:
Mzhelskiy Maxim 2014-09-25 17:34:20 +07:00
parent 0f87ba502f
commit f825f25377
3 changed files with 16 additions and 1 deletions

View file

@ -173,7 +173,7 @@ class ActionRegistration extends Action {
*/
if ($oUser->_Validate()) {
$this->Hook_Run('registration_validate_after', array('oUser'=>$oUser));
$oUser->setPassword(md5($oUser->getPassword()));
$oUser->setPassword(func_encrypt($oUser->getPassword()));
if ($this->User_Add($oUser)) {
$this->Hook_Run('registration_after', array('oUser'=>$oUser));
/**

View file

@ -496,5 +496,19 @@ class ModuleCategory extends ModuleORM {
$oType->Save();
}
}
/**
* Парсинг текста с учетом конкретной категории
*
* @param string $sText
* @param ModuleCategory_EntityCategory $oCategory
*
* @return string
*/
public function ParserText($sText,$oCategory) {
$this->Text_AddParams(array('oCategory'=>$oCategory));
$sResult=$this->Text_Parser($sText);
$this->Text_RemoveParams(array('oCategory'));
return $sResult;
}
}

View file

@ -27,6 +27,7 @@ class ModuleCategory_EntityCategory extends EntityORM {
*/
protected $aValidateRules=array(
array('title','string','max'=>200,'min'=>1,'allowEmpty'=>false),
array('description','string','max'=>5000,'min'=>1,'allowEmpty'=>true),
array('url','regexp','pattern'=>'/^[\w\-_]+$/i','allowEmpty'=>false),
array('order','number','integerOnly'=>true),
array('pid','parent_category'),