mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-16 23:00:51 +03:00
Merge branch 'master' of https://github.com/livestreet/livestreet
This commit is contained in:
commit
0abce2371a
|
@ -71,6 +71,8 @@ class ActionAjax extends Action {
|
|||
$this->AddEventPreg('/^autocompleter$/i','/^user$/','EventAutocompleterUser');
|
||||
|
||||
$this->AddEventPreg('/^comment$/i','/^delete$/','EventCommentDelete');
|
||||
$this->AddEventPreg('/^comment$/i','/^load$/','EventCommentLoad');
|
||||
$this->AddEventPreg('/^comment$/i','/^update$/','EventCommentUpdate');
|
||||
|
||||
$this->AddEventPreg('/^geo$/i','/^get/','/^regions$/','EventGeoGetRegions');
|
||||
$this->AddEventPreg('/^geo$/i','/^get/','/^cities$/','EventGeoGetCities');
|
||||
|
@ -1789,4 +1791,66 @@ class ActionAjax extends Action {
|
|||
$this->Viewer_AssignAjax('bState',$bState);
|
||||
$this->Viewer_AssignAjax('sTextToggle',$sTextToggle);
|
||||
}
|
||||
/**
|
||||
* Загрузка данных комментария для редактировоания
|
||||
*
|
||||
*/
|
||||
protected function EventCommentLoad() {
|
||||
/**
|
||||
* Комментарий существует?
|
||||
*/
|
||||
$idComment=getRequestStr('idComment',null,'post');
|
||||
if (!($oComment=$this->Comment_GetCommentById($idComment))) {
|
||||
return $this->EventErrorDebug();
|
||||
}
|
||||
if (!$oComment->isAllowEdit()) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('not_access'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
$sText=$oComment->getTextSource() ? $oComment->getTextSource() : $oComment->getText();
|
||||
$this->Viewer_AssignAjax('sText',$sText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Редактирование комментария
|
||||
*
|
||||
*/
|
||||
protected function EventCommentUpdate() {
|
||||
/**
|
||||
* Комментарий существует?
|
||||
*/
|
||||
$idComment=getRequestStr('comment_id',null,'post');
|
||||
if (!($oComment=$this->Comment_GetCommentById($idComment))) {
|
||||
return $this->EventErrorDebug();
|
||||
}
|
||||
if (!$oComment->isAllowEdit()) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('not_access'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
||||
$sText=getRequestStr('comment_text');
|
||||
/**
|
||||
* Проверяем текст комментария
|
||||
*/
|
||||
if (!$this->Validate_Validate('string',$sText,array('min'=>2,'max'=>10000,'allowEmpty'=>false))) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('topic_comment_add_text_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
}
|
||||
|
||||
$oComment->setText($this->Text_Parser($sText));
|
||||
$oComment->setTextSource($sText);
|
||||
$oComment->setDateEdit(date('Y-m-d H:i:s'));
|
||||
$oComment->setCountEdit($oComment->getCountEdit()+1);
|
||||
|
||||
if ($this->Comment_UpdateComment($oComment)) {
|
||||
$oViewerLocal=$this->Viewer_GetLocalViewer();
|
||||
$oViewerLocal->Assign('oUserCurrent',$this->oUserCurrent);
|
||||
$oViewerLocal->Assign('bOneComment',true);
|
||||
$oViewerLocal->Assign('oComment',$oComment);
|
||||
$sHtml=$oViewerLocal->Fetch($this->Comment_GetTemplateCommentByTarget($oComment->getTargetId(),$oComment->getTargetType()));
|
||||
$this->Viewer_AssignAjax('sHtml',$sHtml);
|
||||
} else {
|
||||
return $this->EventErrorDebug();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1160,7 +1160,7 @@ class ActionBlog extends Action {
|
|||
protected function SubmitComment() {
|
||||
|
||||
$oTopic = $this->Topic_GetTopicById(getRequestStr('cmt_target_id'));
|
||||
$sText = $this->Text_Parser(getRequestStr('comment_text'));
|
||||
$sText = getRequestStr('comment_text');
|
||||
$sParentId = (int)getRequest('reply');
|
||||
$oCommentParent = null;
|
||||
|
||||
|
@ -1199,7 +1199,8 @@ class ActionBlog extends Action {
|
|||
$oCommentNew->setTargetType('topic');
|
||||
$oCommentNew->setTargetParentId($oTopic->getBlog()->getId());
|
||||
$oCommentNew->setUserId($this->oUserCurrent->getId());
|
||||
$oCommentNew->setText($sText);
|
||||
$oCommentNew->setText($this->Text_Parser($sText));
|
||||
$oCommentNew->setTextSource($sText);
|
||||
$oCommentNew->setDate(date("Y-m-d H:i:s"));
|
||||
$oCommentNew->setUserIp(func_getIp());
|
||||
$oCommentNew->setPid($sParentId);
|
||||
|
|
|
@ -631,7 +631,7 @@ class ActionTalk extends Action {
|
|||
/**
|
||||
* Проверяем текст комментария
|
||||
*/
|
||||
$sText=$this->Text_Parser(getRequestStr('comment_text'));
|
||||
$sText=getRequestStr('comment_text');
|
||||
if (!func_check($sText,'text',2,3000)) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('talk_comment_add_text_error'),$this->Lang_Get('error'));
|
||||
return;
|
||||
|
@ -677,7 +677,8 @@ class ActionTalk extends Action {
|
|||
$oCommentNew->setTargetId($oTalk->getId());
|
||||
$oCommentNew->setTargetType('talk');
|
||||
$oCommentNew->setUserId($this->oUserCurrent->getId());
|
||||
$oCommentNew->setText($sText);
|
||||
$oCommentNew->setText($this->Text_Parser($sText));
|
||||
$oCommentNew->setTextSource($sText);
|
||||
$oCommentNew->setDate(date("Y-m-d H:i:s"));
|
||||
$oCommentNew->setUserIp(func_getIp());
|
||||
$oCommentNew->setPid($sParentId);
|
||||
|
|
|
@ -357,16 +357,46 @@ class ModuleACL extends Module {
|
|||
return false;
|
||||
}
|
||||
/**
|
||||
* Проверка на редактирование комментария
|
||||
*
|
||||
* @param ModuleComment_EntityComment $oComment
|
||||
* @param ModuleUser_EntityUser $oUser
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function IsAllowEditComment($oComment,$oUser) {
|
||||
if (!$oUser) {
|
||||
return false;
|
||||
}
|
||||
if (!in_array($oComment->getTargetType(),(array)Config::Get('module.comment.edit_target_allow'))) {
|
||||
return false;
|
||||
}
|
||||
if ($oUser->isAdministrator()) {
|
||||
return true;
|
||||
}
|
||||
if ($oComment->getUserId()==$oUser->getId() and $oUser->getRating()>=Config::Get('acl.update.comment.rating')) {
|
||||
/**
|
||||
* Проверяем на лимит времени
|
||||
*/
|
||||
if (!Config::Get('acl.update.comment.limit_time') or (time()-strtotime($oComment->getDate()) <= Config::Get('acl.update.comment.limit_time')) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Проверка на удаление комментария
|
||||
*
|
||||
* @param ModuleComment_EntityComment $oComment
|
||||
* @param ModuleUser_EntityUser $oUser
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function IsAllowDeleteComment($oComment,$oUser) {
|
||||
/**
|
||||
* Разрешаем если это админ сайта или автор комментария
|
||||
* Разрешаем если это админ сайта
|
||||
*/
|
||||
if ($oComment->getUserId()==$oUser->getId() or $oUser->isAdministrator()) {
|
||||
if ($oUser and $oUser->isAdministrator()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -94,6 +94,14 @@ class ModuleComment_EntityComment extends Entity {
|
|||
public function getText() {
|
||||
return $this->_getDataOne('comment_text');
|
||||
}
|
||||
/**
|
||||
* Возвращает исходный текст комментария
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTextSource() {
|
||||
return $this->_getDataOne('comment_text_source') ? $this->_getDataOne('comment_text_source') : '';
|
||||
}
|
||||
/**
|
||||
* Возвращает дату комментария
|
||||
*
|
||||
|
@ -102,6 +110,14 @@ class ModuleComment_EntityComment extends Entity {
|
|||
public function getDate() {
|
||||
return $this->_getDataOne('comment_date');
|
||||
}
|
||||
/**
|
||||
* Возвращает дату последнего редактирования комментария
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDateEdit() {
|
||||
return $this->_getDataOne('comment_date_edit');
|
||||
}
|
||||
/**
|
||||
* Возвращает IP пользователя
|
||||
*
|
||||
|
@ -126,6 +142,14 @@ class ModuleComment_EntityComment extends Entity {
|
|||
public function getCountVote() {
|
||||
return $this->_getDataOne('comment_count_vote');
|
||||
}
|
||||
/**
|
||||
* Возвращает количество редактирований комментария
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getCountEdit() {
|
||||
return $this->_getDataOne('comment_count_edit');
|
||||
}
|
||||
/**
|
||||
* Возвращает флаг удаленного комментария
|
||||
*
|
||||
|
@ -210,7 +234,35 @@ class ModuleComment_EntityComment extends Entity {
|
|||
public function getCountFavourite() {
|
||||
return $this->_getDataOne('comment_count_favourite');
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверка на разрешение редактировать комментарий
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function isAllowEdit() {
|
||||
return $this->ACL_IsAllowEditComment($this,$this->User_GetUserCurrent());
|
||||
}
|
||||
/**
|
||||
* Возвращает количество секунд в течении которых возможно редактирование
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getEditTimeRemaining() {
|
||||
$oUser=$this->User_GetUserCurrent();
|
||||
if (($oUser and $oUser->isAdministrator()) or !Config::Get('acl.update.comment.limit_time')) {
|
||||
return 0;
|
||||
}
|
||||
$iTime=Config::Get('acl.update.comment.limit_time')-(time()-strtotime($this->getDate()));
|
||||
return $iTime>0 ? $iTime : 0;
|
||||
}
|
||||
/**
|
||||
* Проверка на разрешение удалить комментарий
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function isAllowDelete() {
|
||||
return $this->ACL_IsAllowDeleteComment($this,$this->User_GetUserCurrent());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -285,6 +337,14 @@ class ModuleComment_EntityComment extends Entity {
|
|||
public function setText($data) {
|
||||
$this->_aData['comment_text']=$data;
|
||||
}
|
||||
/**
|
||||
* Устанавливает исходный текст комментария
|
||||
*
|
||||
* @param string $data
|
||||
*/
|
||||
public function setTextSource($data) {
|
||||
$this->_aData['comment_text_source']=$data;
|
||||
}
|
||||
/**
|
||||
* Устанавливает дату комментария
|
||||
*
|
||||
|
@ -294,7 +354,15 @@ class ModuleComment_EntityComment extends Entity {
|
|||
$this->_aData['comment_date']=$data;
|
||||
}
|
||||
/**
|
||||
* Устанвливает IP пользователя
|
||||
* Устанавливает дату последнего редактирования комментария
|
||||
*
|
||||
* @param string $data
|
||||
*/
|
||||
public function setDateEdit($data) {
|
||||
$this->_aData['comment_date_edit']=$data;
|
||||
}
|
||||
/**
|
||||
* Устанавливает IP пользователя
|
||||
*
|
||||
* @param string $data
|
||||
*/
|
||||
|
@ -317,6 +385,14 @@ class ModuleComment_EntityComment extends Entity {
|
|||
public function setCountVote($data) {
|
||||
$this->_aData['comment_count_vote']=$data;
|
||||
}
|
||||
/**
|
||||
* Устанавливает количество редактирований комментария
|
||||
*
|
||||
* @param int $data
|
||||
*/
|
||||
public function setCountEdit($data) {
|
||||
$this->_aData['comment_count_edit']=$data;
|
||||
}
|
||||
/**
|
||||
* Устанавливает флаг удаленности комментария
|
||||
*
|
||||
|
|
|
@ -509,14 +509,15 @@ class ModuleComment_MapperComment extends Mapper {
|
|||
target_parent_id,
|
||||
user_id,
|
||||
comment_text,
|
||||
comment_text_source,
|
||||
comment_date,
|
||||
comment_user_ip,
|
||||
comment_publish,
|
||||
comment_text_hash
|
||||
)
|
||||
VALUES(?, ?d, ?, ?d, ?d, ?, ?, ?, ?d, ?)
|
||||
VALUES(?, ?d, ?, ?d, ?d, ?, ?, ?, ?, ?d, ?)
|
||||
";
|
||||
if ($iId=$this->oDb->query($sql,$oComment->getPid(),$oComment->getTargetId(),$oComment->getTargetType(),$oComment->getTargetParentId(),$oComment->getUserId(),$oComment->getText(),$oComment->getDate(),$oComment->getUserIp(),$oComment->getPublish(),$oComment->getTextHash()))
|
||||
if ($iId=$this->oDb->query($sql,$oComment->getPid(),$oComment->getTargetId(),$oComment->getTargetType(),$oComment->getTargetParentId(),$oComment->getUserId(),$oComment->getText(),$oComment->getTextSource(),$oComment->getDate(),$oComment->getUserIp(),$oComment->getPublish(),$oComment->getTextHash()))
|
||||
{
|
||||
return $iId;
|
||||
}
|
||||
|
@ -624,16 +625,19 @@ class ModuleComment_MapperComment extends Mapper {
|
|||
$sql = "UPDATE ".Config::Get('db.table.comment')."
|
||||
SET
|
||||
comment_text= ?,
|
||||
comment_text_source= ?,
|
||||
comment_rating= ?f,
|
||||
comment_count_vote= ?d,
|
||||
comment_count_favourite= ?d,
|
||||
comment_count_edit= ?d,
|
||||
comment_date_edit= ?,
|
||||
comment_delete = ?d ,
|
||||
comment_publish = ?d ,
|
||||
comment_text_hash = ?
|
||||
WHERE
|
||||
comment_id = ?d
|
||||
";
|
||||
$res=$this->oDb->query($sql,$oComment->getText(),$oComment->getRating(),$oComment->getCountVote(),$oComment->getCountFavourite(),$oComment->getDelete(),$oComment->getPublish(),$oComment->getTextHash(),$oComment->getId());
|
||||
$res=$this->oDb->query($sql,$oComment->getText(),$oComment->getTextSource(),$oComment->getRating(),$oComment->getCountVote(),$oComment->getCountFavourite(),$oComment->getCountEdit(),$oComment->getDateEdit(),$oComment->getDelete(),$oComment->getPublish(),$oComment->getTextHash(),$oComment->getId());
|
||||
return $res===false or is_null($res) ? false : true;
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -32,6 +32,7 @@ class ModuleProperty extends ModuleORM {
|
|||
const PROPERTY_TYPE_SELECT='select';
|
||||
const PROPERTY_TYPE_DATE='date';
|
||||
const PROPERTY_TYPE_FILE='file';
|
||||
const PROPERTY_TYPE_IMAGE='image';
|
||||
/**
|
||||
* Список состояний типов объектов
|
||||
*/
|
||||
|
@ -48,7 +49,7 @@ class ModuleProperty extends ModuleORM {
|
|||
protected $aPropertyTypes=array(
|
||||
self::PROPERTY_TYPE_INT,self::PROPERTY_TYPE_FLOAT,self::PROPERTY_TYPE_VARCHAR,self::PROPERTY_TYPE_TEXT,
|
||||
self::PROPERTY_TYPE_CHECKBOX,self::PROPERTY_TYPE_TAGS,self::PROPERTY_TYPE_VIDEO_LINK,self::PROPERTY_TYPE_SELECT,
|
||||
self::PROPERTY_TYPE_DATE,self::PROPERTY_TYPE_FILE
|
||||
self::PROPERTY_TYPE_DATE,self::PROPERTY_TYPE_FILE,self::PROPERTY_TYPE_IMAGE
|
||||
);
|
||||
/**
|
||||
* Список разрешенных типов
|
||||
|
@ -757,6 +758,48 @@ class ModuleProperty extends ModuleORM {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Используется для создания дефолтных дополнительных полей при активации плагина
|
||||
*
|
||||
* @param array $aProperties Список полей
|
||||
* <pre>
|
||||
* array(
|
||||
* array(
|
||||
* 'data'=>array(
|
||||
* 'type'=>ModuleProperty::PROPERTY_TYPE_INT,
|
||||
* 'title'=>'Номер',
|
||||
* 'code'=>'number',
|
||||
* 'sort'=>100
|
||||
* ),
|
||||
* 'validate_rule'=>array(
|
||||
* 'min'=>10
|
||||
* ),
|
||||
* 'params'=>array(),
|
||||
* 'additional'=>array()
|
||||
* )
|
||||
* );
|
||||
* </pre>
|
||||
* @param string $sTargetType Тип объекта
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function CreateDefaultTargetPropertyFromPlugin($aProperties,$sTargetType) {
|
||||
foreach($aProperties as $aProperty) {
|
||||
$sResultMsg=$this->CreateTargetProperty($sTargetType,$aProperty['data'],true,$aProperty['validate_rule'],$aProperty['params'],$aProperty['additional']);
|
||||
if ($sResultMsg!==true and !is_object($sResultMsg)) {
|
||||
if (is_string($sResultMsg)) {
|
||||
$this->Message_AddErrorSingle($sResultMsg, $this->Lang_Get('error'), true);
|
||||
}
|
||||
/**
|
||||
* Отменяем добавление типа
|
||||
*/
|
||||
$this->RemoveTargetType($sTargetType,ModuleProperty::TARGET_STATE_NOT_ACTIVE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function RemoveValueByPropertyId($iPropertyId) {
|
||||
$bRes=$this->oMapper->RemoveValueByPropertyId($iPropertyId);
|
||||
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array('ModuleProperty_EntityValue_delete'));
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
class ModuleProperty_EntityValueType extends Entity {
|
||||
|
||||
protected $oValue=null;
|
||||
|
||||
public function getValueForDisplay() {
|
||||
// TODO: getValue() всегда вернет null
|
||||
return $this->getValueObject()->getValue();
|
||||
|
@ -59,6 +61,14 @@ class ModuleProperty_EntityValueType extends Entity {
|
|||
$this->resetAllValue();
|
||||
}
|
||||
|
||||
public function setValueObject($oValue) {
|
||||
$this->oValue=$oValue;
|
||||
}
|
||||
|
||||
public function getValueObject() {
|
||||
return $this->oValue;
|
||||
}
|
||||
|
||||
public function resetAllValue() {
|
||||
$oValue=$this->getValueObject();
|
||||
$oValue->setValueInt(null);
|
||||
|
|
|
@ -173,6 +173,7 @@ class ModuleProperty_EntityValueTypeFile extends ModuleProperty_EntityValueType
|
|||
* Сохраняем уникальный ключ для доступа к файлу
|
||||
*/
|
||||
$oValue->setValueVarchar(func_generator(32));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,217 @@
|
|||
<?php
|
||||
/**
|
||||
* LiveStreet CMS
|
||||
* Copyright © 2013 OOO "ЛС-СОФТ"
|
||||
*
|
||||
* ------------------------------------------------------
|
||||
*
|
||||
* Official site: www.livestreetcms.com
|
||||
* Contact e-mail: office@livestreetcms.com
|
||||
*
|
||||
* GNU General Public License, version 2:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* ------------------------------------------------------
|
||||
*
|
||||
* @link http://www.livestreetcms.com
|
||||
* @copyright 2013 OOO "ЛС-СОФТ"
|
||||
* @author Maxim Mzhelskiy <rus.engine@gmail.com>
|
||||
*
|
||||
*/
|
||||
|
||||
class ModuleProperty_EntityValueTypeImage extends ModuleProperty_EntityValueTypeFile {
|
||||
|
||||
public function getValueForDisplay() {
|
||||
/**
|
||||
* Показываем превью, в качестве изображения берем первый ресайз из списка размеров
|
||||
*/
|
||||
if ($aFile=$this->oValue->getDataOne('file') and isset($aFile['path'])) {
|
||||
$sSize=null;
|
||||
if ($aSizes=$this->oValue->getDataOne('image_sizes')) {
|
||||
$sSize=array_shift($aSizes);
|
||||
}
|
||||
$sWebPath=$this->Media_GetImageWebPath($aFile['path'],$sSize);
|
||||
return '<a href=""><img src="'.$sWebPath.'" class="js-lbx" /></a>';
|
||||
}
|
||||
return $this->getFileFullName();
|
||||
}
|
||||
|
||||
|
||||
public function getImageWebPath($sSize=null) {
|
||||
if ($aFile=$this->oValue->getDataOne('file') and isset($aFile['path'])) {
|
||||
return $this->Media_GetImageWebPath($aFile['path'],$sSize);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getImageSizes() {
|
||||
return $this->oValue->getDataOne('image_sizes');
|
||||
}
|
||||
|
||||
public function getImageSizeFirst() {
|
||||
if ($aSizes=$this->getImageSizes()) {
|
||||
return array_shift($aSizes);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function validate() {
|
||||
/**
|
||||
* Выполняем стандартные проверки для типа "Файл"
|
||||
*/
|
||||
$bRes=parent::validate();
|
||||
|
||||
$oProperty=$this->oValue->getProperty();
|
||||
|
||||
$aValue=$this->getValueForValidate();
|
||||
if (isset($aValue['tmp_name'])) {
|
||||
if(!$aImageInfo=(@getimagesize($aValue['tmp_name']))) {
|
||||
return 'Файл не является изображением';
|
||||
}
|
||||
/**
|
||||
* Проверяем на максимальную ширину
|
||||
*/
|
||||
if ($iWMax=$oProperty->getValidateRuleOne('width_max') and $iWMax<$aImageInfo[0]) {
|
||||
return 'Максимальная допустимая ширина изображения '.$iWMax.'px';
|
||||
}
|
||||
/**
|
||||
* Проверяем на максимальную высоту
|
||||
*/
|
||||
if ($iHMax=$oProperty->getValidateRuleOne('height_max') and $iHMax<$aImageInfo[1]) {
|
||||
return 'Максимальная допустимая высота изображения '.$iHMax.'px';
|
||||
}
|
||||
}
|
||||
|
||||
return $bRes;
|
||||
}
|
||||
|
||||
|
||||
public function beforeSaveValue() {
|
||||
$oProperty=$this->oValue->getProperty();
|
||||
if (!$aFile=$this->oValue->getDataOne('file_raw')) {
|
||||
return true;
|
||||
}
|
||||
$this->oValue->setDataOne('file_raw',null);
|
||||
/**
|
||||
* Удаляем предыдущий файл
|
||||
*/
|
||||
if (isset($aFile['remove']) or isset($aFile['name'])) {
|
||||
if ($aFilePrev=$this->oValue->getDataOne('file')) {
|
||||
$this->Media_RemoveImageBySizes($aFilePrev['path'],$this->oValue->getDataOne('image_sizes'),true);
|
||||
|
||||
$this->oValue->setDataOne('file',array());
|
||||
$this->oValue->setDataOne('image_sizes',array());
|
||||
$this->oValue->setValueVarchar(null);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aFile['name'])) {
|
||||
/**
|
||||
* Выполняем загрузку файла
|
||||
*/
|
||||
$aPathInfo=pathinfo($aFile['name']);
|
||||
$sFileName = func_generator(20);
|
||||
/**
|
||||
* Копируем загруженный файл
|
||||
*/
|
||||
$sDirTmp=Config::Get('path.tmp.server').'/property/';
|
||||
if (!is_dir($sDirTmp)) {
|
||||
@mkdir($sDirTmp,0777,true);
|
||||
}
|
||||
$sFileTmp=$sDirTmp.$sFileName;
|
||||
|
||||
if (move_uploaded_file($aFile['tmp_name'],$sFileTmp)) {
|
||||
$aParams=$this->Image_BuildParams('property.'.$oProperty->getTargetType().'.'.$oProperty->getType().'.'.$oProperty->getCode());
|
||||
/**
|
||||
* Если объект изображения не создан, возвращаем ошибку
|
||||
*/
|
||||
if($oImage=$this->Image_Open($sFileTmp,$aParams)) {
|
||||
$sPath=$oProperty->getSaveFileDir();
|
||||
/**
|
||||
* Сохраняем оригинальную копию
|
||||
*/
|
||||
if ($sFileResult=$oImage->saveSmart($sPath,$sFileName)) {
|
||||
/**
|
||||
* Сохраняем данные о файле
|
||||
*/
|
||||
$this->oValue->setDataOne('file',array(
|
||||
'path'=>$sFileResult,
|
||||
'size'=>filesize($sFileTmp),
|
||||
'name'=>htmlspecialchars($aPathInfo['filename']),
|
||||
'extension'=>htmlspecialchars($oImage->getFormat()),
|
||||
));
|
||||
$aSizes=$oProperty->getParam('sizes');
|
||||
/**
|
||||
* Сохраняем размеры
|
||||
*/
|
||||
$this->oValue->setDataOne('image_sizes',$aSizes);
|
||||
/**
|
||||
* Сохраняем уникальный ключ для доступа к файлу
|
||||
*/
|
||||
$this->oValue->setValueVarchar(func_generator(32));
|
||||
unset($oImage);
|
||||
/**
|
||||
* Генерируем ресайзы
|
||||
*/
|
||||
$this->Media_GenerateImageBySizes($sFileTmp,$sPath,$sFileName,$aSizes,$aParams);
|
||||
|
||||
$this->Fs_RemoveFileLocal($sFileTmp);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$this->Fs_RemoveFileLocal($sFileTmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function prepareValidateRulesRaw($aRulesRaw) {
|
||||
$aRules=array();
|
||||
$aRules['allowEmpty']=isset($aRulesRaw['allowEmpty']) ? false : true;
|
||||
|
||||
if (isset($aRulesRaw['size_max']) and is_numeric($aRulesRaw['size_max'])) {
|
||||
$aRules['size_max']=(int)$aRulesRaw['size_max'];
|
||||
}
|
||||
if (isset($aRulesRaw['width_max']) and is_numeric($aRulesRaw['width_max'])) {
|
||||
$aRules['width_max']=(int)$aRulesRaw['width_max'];
|
||||
}
|
||||
if (isset($aRulesRaw['height_max']) and is_numeric($aRulesRaw['height_max'])) {
|
||||
$aRules['height_max']=(int)$aRulesRaw['height_max'];
|
||||
}
|
||||
return $aRules;
|
||||
}
|
||||
|
||||
public function prepareParamsRaw($aParamsRaw) {
|
||||
$aParams=array();
|
||||
|
||||
$aParams['sizes']=array();
|
||||
if (isset($aParamsRaw['sizes']) and is_array($aParamsRaw['sizes'])) {
|
||||
foreach($aParamsRaw['sizes'] as $sSize) {
|
||||
if ($sSize and preg_match('#^(\d+)?(x)?(\d+)?([a-z]{2,10})?$#Ui',$sSize)) {
|
||||
$aParams['sizes'][]=htmlspecialchars($sSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
$aParams['types']=array();
|
||||
if (isset($aParamsRaw['types']) and is_array($aParamsRaw['types'])) {
|
||||
foreach($aParamsRaw['types'] as $sType) {
|
||||
if ($sType) {
|
||||
$aParams['types'][]=htmlspecialchars($sType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $aParams;
|
||||
}
|
||||
|
||||
public function getParamsDefault() {
|
||||
return array(
|
||||
'sizes'=>array(
|
||||
'150x150crop'
|
||||
),
|
||||
'types'=>array(
|
||||
'jpg','jpeg','gif','png'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -488,7 +488,12 @@ class ModuleTopic_EntityTopic extends Entity {
|
|||
*/
|
||||
public function getTypeObject() {
|
||||
if (!$this->_getDataOne('type_object')) {
|
||||
$this->_aData['type_object']=$this->Topic_GetTopicTypeByCode($this->getType());
|
||||
/**
|
||||
* Сначала смотрим среди загруженых активных типов, если нет, то делаем запрос к БД
|
||||
*/
|
||||
if (!($this->_aData['type_object']=$this->Topic_GetTopicType($this->getType()))) {
|
||||
$this->_aData['type_object']=$this->Topic_GetTopicTypeByCode($this->getType());
|
||||
}
|
||||
}
|
||||
return $this->_getDataOne('type_object');
|
||||
}
|
||||
|
|
|
@ -90,6 +90,8 @@ $config['acl']['create']['talk_comment']['limit_time'] = 10; // врем
|
|||
$config['acl']['create']['talk_comment']['limit_time_rating'] = 5; // рейтинг, выше которого перестаёт действовать ограничение по времени на отправку инбоксов
|
||||
$config['acl']['create']['wall']['limit_time'] = 20; // рейтинг, выше которого перестаёт действовать ограничение по времени на отправку сообщений на стену
|
||||
$config['acl']['create']['wall']['limit_time_rating'] = 0; // рейтинг, выше которого перестаёт действовать ограничение по времени на отправку сообщений на стену
|
||||
$config['acl']['update']['comment']['rating'] = -5; // порог рейтинга при котором юзер может редактировать комментарии
|
||||
$config['acl']['update']['comment']['limit_time'] = 60*3; // время в секундах после создания комментария, когда можно его отредактировать, если 0 то ограничение по времени не будет работать
|
||||
$config['acl']['vote']['comment']['rating'] = -3; // порог рейтинга при котором юзер может голосовать за комментарии
|
||||
$config['acl']['vote']['blog']['rating'] = -5; // порог рейтинга при котором юзер может голосовать за блог
|
||||
$config['acl']['vote']['topic']['rating'] = -7; // порог рейтинга при котором юзер может голосовать за топик
|
||||
|
@ -152,6 +154,7 @@ $config['module']['comment']['use_nested'] = false; // Использовать
|
|||
$config['module']['comment']['nested_per_page'] = 0; // Число комментов на одну страницу в топике, актуально только при use_nested = true
|
||||
$config['module']['comment']['nested_page_reverse'] = true; // Определяет порядок вывода страниц. true - последние комментарии на первой странице, false - последние комментарии на последней странице
|
||||
$config['module']['comment']['favourite_target_allow'] = array('topic'); // Список типов комментов, которые разрешено добавлять в избранное
|
||||
$config['module']['comment']['edit_target_allow'] = array('topic','talk'); // Список типов комментов, которые разрешено редактировать
|
||||
// Модуль Talk
|
||||
$config['module']['talk']['per_page'] = 30; // Число приватных сообщений на одну страницу
|
||||
$config['module']['talk']['encrypt'] = 'livestreet'; // Ключ XXTEA шифрования идентификаторов в ссылках
|
||||
|
@ -338,8 +341,11 @@ $config['router']['page']['subscribe'] = 'ActionSubscribe';
|
|||
$config['router']['page']['content'] = 'ActionContent';
|
||||
$config['router']['page']['property'] = 'ActionProperty';
|
||||
// Глобальные настройки роутинга
|
||||
$config['router']['config']['action_default'] = 'index';
|
||||
$config['router']['config']['action_not_found'] = 'error';
|
||||
$config['router']['config']['default']['action'] = 'index';
|
||||
$config['router']['config']['default']['event'] = null;
|
||||
$config['router']['config']['default']['params'] = null;
|
||||
$config['router']['config']['default']['request'] = null;
|
||||
$config['router']['config']['action_not_found'] = 'error';
|
||||
|
||||
/**
|
||||
* Настройки вывода блоков
|
||||
|
@ -460,6 +466,7 @@ $config['head']['default']['js'] = array(
|
|||
"___path.framework.frontend.web___/js/vendor/jquery.charcount.js",
|
||||
"___path.framework.frontend.web___/js/vendor/jquery.imagesloaded.js",
|
||||
"___path.framework.frontend.web___/js/vendor/jquery.fileupload.js",
|
||||
"___path.framework.frontend.web___/js/vendor/jquery.timers.js",
|
||||
"___path.framework.frontend.web___/js/vendor/notifier/jquery.notifier.js",
|
||||
"___path.framework.frontend.web___/js/vendor/prettify/prettify.js",
|
||||
"___path.framework.frontend.web___/js/vendor/parsley/parsley.js",
|
||||
|
|
|
@ -43,6 +43,8 @@ ls.comments = (function ($) {
|
|||
reply: '.js-comment-reply',
|
||||
fold: '.js-comment-fold',
|
||||
remove: '.js-comment-remove',
|
||||
update: '.js-comment-update',
|
||||
update_timer: '.js-comment-update-timer',
|
||||
scroll_to_child: '.js-comment-scroll-to-child',
|
||||
scroll_to_parent: '.js-comment-scroll-to-parent'
|
||||
},
|
||||
|
@ -51,6 +53,8 @@ ls.comments = (function ($) {
|
|||
text: '#form_comment_text',
|
||||
submit: '.js-comment-form-submit',
|
||||
preview: '.js-comment-form-preview',
|
||||
update_submit: '.js-comment-form-update-submit',
|
||||
update_cancel: '.js-comment-form-update-cancel',
|
||||
comment_id: '#form_comment_reply'
|
||||
},
|
||||
toolbar: {
|
||||
|
@ -100,6 +104,8 @@ ls.comments = (function ($) {
|
|||
text: $(this.options.selectors.form.text),
|
||||
submit: $(this.options.selectors.form.submit),
|
||||
preview: $(this.options.selectors.form.preview),
|
||||
update_cancel: $(this.options.selectors.form.update_cancel),
|
||||
update_submit: $(this.options.selectors.form.update_submit),
|
||||
comment_id: $(this.options.selectors.form.comment_id)
|
||||
},
|
||||
toolbar: {
|
||||
|
@ -172,6 +178,27 @@ ls.comments = (function ($) {
|
|||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Редактирование
|
||||
this.elements.container.on('click', this.options.selectors.comment.update, function(e) {
|
||||
var oElement = $(this),
|
||||
iCommentId = oElement.data('id');
|
||||
|
||||
_this.formToggle(iCommentId,false,true);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Отмена редактирования
|
||||
this.elements.form.update_cancel.on('click', function (e) {
|
||||
_this.formToggle(_this.iFormTargetId,false,true);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Сохранение после редактирования
|
||||
this.elements.form.update_submit.on('click', function (e) {
|
||||
_this.submitCommentUpdate(_this.elements.form.form,_this.iFormTargetId);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Сворачивание
|
||||
if (this.options.folding) {
|
||||
// Свернуть все
|
||||
|
@ -197,6 +224,8 @@ ls.comments = (function ($) {
|
|||
});
|
||||
}
|
||||
|
||||
this.initUpdateTimers();
|
||||
|
||||
ls.hook.run('ls_comments_init_after',[],this);
|
||||
};
|
||||
|
||||
|
@ -330,6 +359,7 @@ ls.comments = (function ($) {
|
|||
if (iCommentSelfId) {
|
||||
this.scrollToComment(this.getCommentById(iCommentSelfId));
|
||||
}
|
||||
this.initUpdateTimers();
|
||||
|
||||
ls.hook.run('ls_comments_load_after', [iTargetId, sTargetType, iCommentSelfId, bNotFlushNew, oResponse]);
|
||||
}
|
||||
|
@ -384,8 +414,9 @@ ls.comments = (function ($) {
|
|||
* @param {Number} iCommentId ID комментария
|
||||
* @param {Boolean} bNoFocus Переводить фокус на инпут с текстом или нет
|
||||
*/
|
||||
this.formToggle = function(iCommentId, bNoFocus) {
|
||||
this.formToggle = function(iCommentId, bNoFocus, bIsUpdate) {
|
||||
this.previewHide();
|
||||
bIsUpdate=bIsUpdate || false;
|
||||
|
||||
if (this.iFormTargetId == iCommentId && this.elements.form.form.is(':visible')) {
|
||||
this.elements.form.form.hide();
|
||||
|
@ -396,12 +427,92 @@ ls.comments = (function ($) {
|
|||
this.elements.form.form.insertAfter(iCommentId ? this.getCommentById(iCommentId) : this.elements.reply_root).show();
|
||||
this.elements.form.text.val('');
|
||||
this.elements.form.comment_id.val(iCommentId);
|
||||
/**
|
||||
* Показываем необходимые кнопки
|
||||
*/
|
||||
if (bIsUpdate) {
|
||||
this.elements.form.update_cancel.show();
|
||||
this.elements.form.update_submit.show();
|
||||
this.elements.form.submit.hide();
|
||||
/**
|
||||
* Загружаем исходный текст комментария
|
||||
*/
|
||||
this.loadCommentUpdate(iCommentId);
|
||||
} else {
|
||||
this.elements.form.update_cancel.hide();
|
||||
this.elements.form.update_submit.hide();
|
||||
this.elements.form.submit.show();
|
||||
}
|
||||
|
||||
this.iFormTargetId = iCommentId;
|
||||
|
||||
if ( ! bNoFocus ) this.elements.form.text.focus();
|
||||
};
|
||||
|
||||
this.loadCommentUpdate = function(iCommentId) {
|
||||
var sUrl = aRouter['ajax'] + 'comment/load/',
|
||||
oParams = { idComment: iCommentId };
|
||||
|
||||
ls.utils.formLock(this.elements.form.form);
|
||||
ls.hook.marker('loadBefore');
|
||||
|
||||
ls.ajax.load(sUrl, oParams, function(oResponse) {
|
||||
if (oResponse.bStateError) {
|
||||
ls.msg.error(null, oResponse.sMsg);
|
||||
} else {
|
||||
this.elements.form.text.val(oResponse.sText);
|
||||
}
|
||||
ls.hook.run('ls_comments_load_comment_update_after',[iCommentId, oResponse]);
|
||||
ls.utils.formUnlock(this.elements.form.form);
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
this.submitCommentUpdate = function(oForm, iCommentId) {
|
||||
var oData = oForm.serializeJSON(),
|
||||
sUrl = aRouter['ajax'] + 'comment/update/';
|
||||
|
||||
ls.utils.formLock(oForm);
|
||||
this.previewHide();
|
||||
oData.comment_id=iCommentId;
|
||||
ls.ajax.load(sUrl, oData, function(oResponse) {
|
||||
if (oResponse.bStateError) {
|
||||
ls.msg.error(null, oResponse.sMsg);
|
||||
} else {
|
||||
var wrap=$('<div></div>').html(oResponse.sHtml);
|
||||
var comment=this.getCommentById(iCommentId);
|
||||
comment.find(this.options.selectors.comment.update_timer).stopTime();
|
||||
comment.replaceWith(wrap.children('.js-comment'));
|
||||
this.aComments = $(this.options.selectors.comment.comment); // hack
|
||||
this.formToggle(iCommentId, true);
|
||||
this.initUpdateTimers();
|
||||
this.scrollToComment(this.getCommentById(iCommentId));
|
||||
}
|
||||
ls.hook.run('ls_comments_submit_comment_update_after', [oForm, iCommentId, oResponse]);
|
||||
ls.utils.formUnlock(oForm);
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
this.initUpdateTimers = function() {
|
||||
var _this=this;
|
||||
$(this.options.selectors.comment.update_timer).each(function(k,el){
|
||||
el=$(el);
|
||||
if (!el.data('isInit')) {
|
||||
el.data('isInit',true);
|
||||
el.everyTime(1000,function(){
|
||||
var seconds=parseInt(el.data('seconds'));
|
||||
seconds--;
|
||||
el.data('seconds',seconds);
|
||||
if (seconds>0) {
|
||||
el.text(ls.utils.timeRemaining(seconds));
|
||||
} else {
|
||||
el.parents(_this.options.selectors.comment.comment)
|
||||
.find(_this.options.selectors.comment.update).hide();
|
||||
el.stopTime();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Скрывает кнопку сворачивания у комментариев без дочерних комментариев
|
||||
*/
|
||||
|
|
|
@ -209,6 +209,11 @@ ls.media = (function ($) {
|
|||
$('.fotorama').fotorama();
|
||||
}.bind(this));
|
||||
|
||||
// Инициализация фоторамы после hедактирования коммента
|
||||
ls.hook.add('ls_comments_submit_comment_update_after',function(){
|
||||
$('.fotorama').fotorama();
|
||||
}.bind(this));
|
||||
|
||||
// После добавления комментария необходимо получить новый временный идентификатор и очистить галлерею
|
||||
ls.hook.add('ls_comments_add_after',function(){
|
||||
this.options.target_id='';
|
||||
|
|
|
@ -31,6 +31,7 @@ return array(
|
|||
'empty' => 'Тут ничего нет',
|
||||
'form_reset' => 'Очистить форму',
|
||||
'preview_text' => 'Предпросмотр',
|
||||
'times_declension' => 'раз;раза;раз',
|
||||
'error' => array(
|
||||
'add' => 'При добавлении возникла ошибка',
|
||||
'save' => 'Ошибка сохранения',
|
||||
|
@ -475,6 +476,7 @@ return array(
|
|||
'scroll_to_child' => 'Обратно к ответу',
|
||||
'target_author' => 'Автор',
|
||||
'url' => 'Ссылка на комментарий',
|
||||
'edit_info' => 'Комментарий отредактирован',
|
||||
),
|
||||
|
||||
// Сворачивание
|
||||
|
|
|
@ -91,4 +91,6 @@
|
|||
background: url(../images/icons.png) -168px 0 no-repeat;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.user.inactive { color: #aaa; cursor: help; }
|
||||
.user.inactive { color: #aaa; cursor: help; }
|
||||
|
||||
.hide { display: none; }
|
||||
|
|
|
@ -23,7 +23,13 @@
|
|||
{include 'forms/fields/form.field.hidden.tpl' sFieldName='reply' sFieldValue='0' sFieldId='form_comment_reply'}
|
||||
{include 'forms/fields/form.field.hidden.tpl' sFieldName='cmt_target_id' sFieldValue=$iTargetId}
|
||||
|
||||
{* Кнопки *}
|
||||
{* Кнопки создания *}
|
||||
{include 'forms/fields/form.field.button.tpl' sFieldName='submit_comment' sFieldText=$aLang.common.add sFieldStyle='primary' sFieldClasses='js-comment-form-submit'}
|
||||
|
||||
{* Кнопки редактирования *}
|
||||
{include 'forms/fields/form.field.button.tpl' sFieldName='submit_comment' sFieldType='button' sFieldText=$aLang.common.save sFieldStyle='primary' sFieldClasses='js-comment-form-update-submit hide'}
|
||||
{include 'forms/fields/form.field.button.tpl' sFieldName='submit_comment' sFieldType='button' sFieldText=$aLang.common.cancel sFieldClasses='js-comment-form-update-cancel fl-r hide'}
|
||||
|
||||
{* Общие кнопки *}
|
||||
{include 'forms/fields/form.field.button.tpl' sFieldText=$aLang.common.preview_text sFieldType='button' sFieldClasses='js-comment-form-preview'}
|
||||
</form>
|
|
@ -87,6 +87,15 @@
|
|||
{$oComment->getText()}
|
||||
</div>
|
||||
|
||||
{* Информация о редактировании *}
|
||||
{if $oComment->getDateEdit()}
|
||||
<div>
|
||||
{$aLang.comments.comment.edit_info}: {date_format date=$oComment->getDateEdit() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}
|
||||
{if $oComment->getCountEdit()>1}
|
||||
({$oComment->getCountEdit()} {$oComment->getCountEdit()|declension:$aLang.common.times_declension})
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{* Кнопки ответа, удаления и т.д. *}
|
||||
{if $oUserCurrent}
|
||||
|
@ -97,7 +106,18 @@
|
|||
|
||||
<li class="link-dotted comment-fold js-comment-fold open" data-id="{$oComment->getId()}" style="display: none"><a href="#">{$aLang.comments.folding.fold}</a></li>
|
||||
|
||||
{if $oUserCurrent and $oUserCurrent->isAdministrator()}
|
||||
{if $oComment->IsAllowEdit()}
|
||||
<li>
|
||||
<a href="#" class="link-dotted js-comment-update" data-id="{$oComment->getId()}">
|
||||
{$aLang.common.edit}
|
||||
{if $oComment->getEditTimeRemaining()}
|
||||
(<span class="js-comment-update-timer" data-seconds="{$oComment->getEditTimeRemaining()}"></span>)
|
||||
{/if}
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
{if $oComment->IsAllowDelete()}
|
||||
<li><a href="#" class="link-dotted js-comment-remove" data-id="{$oComment->getId()}">{($oComment->getDelete()) ? $aLang.comments.comment.restore : $aLang.common.remove}</a></li>
|
||||
{/if}
|
||||
|
||||
|
|
|
@ -22,9 +22,12 @@
|
|||
{/if}
|
||||
|
||||
{* Информация *}
|
||||
{if $oSession}
|
||||
{$sDateSessionLast={date_format date=$oSession->getDateLast() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}}
|
||||
{/if}
|
||||
{$aUserInfo = [
|
||||
[ 'label' => "{$aLang.user_date_last}:",
|
||||
'content' => ($oSession) ? {date_format date=$oSession->getDateLast() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"} : '—' ],
|
||||
'content' => ($oSession) ? $sDateSessionLast : '—' ],
|
||||
[ 'label' => "{$aLang.user_date_registration}:", 'content' => {date_format date=$oUser->getDateRegister() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"} ],
|
||||
[ 'label' => "{$aLang.vote.rating}:", 'content' => $oUser->getRating() ]
|
||||
]}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
{$oValue = $oProperty->getValue()}
|
||||
{$oValueType = $oValue->getValueTypeObject()}
|
||||
|
||||
{include file="forms/fields/form.field.file.tpl"
|
||||
sFieldName = "property[{$oProperty->getId()}][file]"
|
||||
sFieldClasses = 'width-300'
|
||||
sFieldNote = $oProperty->getDescription()
|
||||
sFieldLabel = $oProperty->getTitle()}
|
||||
|
||||
{$aFile=$oValue->getDataOne('file')}
|
||||
{if $aFile}
|
||||
<a href="{$oValueType->getImageWebPath()}" class="js-lbx" target="_blank"><img src="{$oValueType->getImageWebPath($oValueType->getImageSizeFirst())}" ></a> <br/>
|
||||
<label>
|
||||
<input type="checkbox" name="property[{$oProperty->getId()}][remove]" value="1"> — удалить изображение
|
||||
</label>
|
||||
<br/>
|
||||
{/if}
|
|
@ -0,0 +1,6 @@
|
|||
{$oValue=$oPropertyItem->getValue()}
|
||||
{$oValueType = $oValue->getValueTypeObject()}
|
||||
<div class="property-list-item">
|
||||
<div class="property-list-item-label">{$oPropertyItem->getTitle()}</div>
|
||||
<a href="{$oValueType->getImageWebPath()}" class="js-lbx" target="_blank"><img src="{$oValueType->getImageWebPath($oValueType->getImageSizeFirst())}" ></a> <br/>
|
||||
</div>
|
|
@ -1,10 +1,10 @@
|
|||
{if $oPropertyItem}
|
||||
{* Проверяем наличие катомного шаблона item.[type].[target_type].tpl *}
|
||||
{* Проверяем наличие кастомного шаблона item.[type].[target_type].tpl *}
|
||||
{$sTemplateType="property/item.{$oPropertyItem->getType()}.{$oPropertyItem->getTargetType()}.tpl"}
|
||||
{if $LS->Viewer_TemplateExists($sTemplateType)}
|
||||
{include $sTemplateType}
|
||||
{else}
|
||||
{* Проверяем наличие катомного шаблона item.[type].tpl *}
|
||||
{* Проверяем наличие кастомного шаблона item.[type].tpl *}
|
||||
{$sTemplateType="property/item.{$oPropertyItem->getType()}.tpl"}
|
||||
{if $LS->Viewer_TemplateExists($sTemplateType)}
|
||||
{include $sTemplateType}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 199491768fbee7258049713c1f24506b68d11c30
|
||||
Subproject commit ca9d2968f88d2ce934d5d810682e726149353358
|
|
@ -499,4 +499,12 @@ ADD INDEX ( `target_type` ) ;
|
|||
-- 21.03.2014
|
||||
ALTER TABLE `prefix_media_target` ADD `is_preview` TINYINT( 1 ) NOT NULL DEFAULT '0',
|
||||
ADD INDEX ( `is_preview` ) ;
|
||||
ALTER TABLE `prefix_media_target` ADD `data` TEXT NOT NULL ;
|
||||
ALTER TABLE `prefix_media_target` ADD `data` TEXT NOT NULL ;
|
||||
|
||||
|
||||
-- 24.04.2014
|
||||
ALTER TABLE `prefix_comment` ADD `comment_text_source` TEXT NOT NULL AFTER `comment_text` ;
|
||||
ALTER TABLE `prefix_comment` ADD `comment_date_edit` DATETIME NULL DEFAULT NULL AFTER `comment_date` ,
|
||||
ADD INDEX ( `comment_date_edit` ) ;
|
||||
ALTER TABLE `prefix_comment` ADD `comment_count_edit` INT NOT NULL DEFAULT '0' AFTER `comment_count_favourite` ,
|
||||
ADD INDEX ( `comment_count_edit` ) ;
|
Loading…
Reference in a new issue