Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzegit committed May 27, 2018
1 parent e73b0f7 commit a7bacf0
Show file tree
Hide file tree
Showing 21 changed files with 260 additions and 378 deletions.
1 change: 1 addition & 0 deletions index.php
Expand Up @@ -20,6 +20,7 @@
define('SESSION_START', true);

header('Content-type:text/html; charset=utf-8');
header('X-Powered-By: InstantCMS');

require_once 'bootstrap.php';

Expand Down
3 changes: 3 additions & 0 deletions system/controllers/content/model.php
Expand Up @@ -2332,6 +2332,7 @@ public function getContentItems($ctype_name, $callback = null){
$table_name = $this->table_prefix . $ctype_name;

$this->select('u.nickname', 'user_nickname');
$this->select('u.avatar', 'user_avatar');
$this->select('f.title', 'folder_title');
$this->join('{users}', 'u FORCE INDEX (PRIMARY)', 'u.id = i.user_id');
$this->joinLeft('content_folders', 'f', 'f.id = i.folder_id');
Expand All @@ -2352,6 +2353,7 @@ public function getContentItems($ctype_name, $callback = null){
$item['user'] = array(
'id' => $item['user_id'],
'nickname' => $item['user_nickname'],
'avatar' => $item['user_avatar'],
'is_friend' => $user->isFriend($item['user_id'])
);

Expand Down Expand Up @@ -2394,6 +2396,7 @@ public function getContentItem($ctype_name, $id, $by_field = 'id'){
$item['user'] = array(
'id' => $item['user_id'],
'nickname' => $item['user_nickname'],
'avatar' => $item['user_avatar'],
'avatar' => $item['user_avatar']
);

Expand Down
2 changes: 2 additions & 0 deletions system/controllers/messages/frontend.php
Expand Up @@ -270,6 +270,8 @@ public function sendEmail($to, $letter, $data = array(), $is_nl2br_text = true){
$letter['text'] = $mailer->parseSubject($letter['text']);
$letter['text'] = $mailer->parseAttachments($letter['text']);

list($letter, $is_nl2br_text) = cmsEventsManager::hook('process_email_letter', array($letter, $is_nl2br_text));

$mailer->setBodyHTML( ($is_nl2br_text ? nl2br($letter['text']) : $letter['text']) );

$result = $mailer->send();
Expand Down
13 changes: 13 additions & 0 deletions system/controllers/messages/hooks/queue_send_email.php
Expand Up @@ -4,6 +4,17 @@ class onMessagesQueueSendEmail extends cmsAction {

public function run($attempt, $to, $letter, $is_nl2br_text = null){

$before_send = cmsEventsManager::hook('before_send_email', array(
'send_email' => true,
'success' => false,
'to' => $to,
'letter' => $letter
));

if(!$before_send['send_email']){
return $before_send['success'];
}

$mailer = new cmsMailer();

$mailer->addTo($to['email'], $to['name']);
Expand All @@ -27,6 +38,8 @@ public function run($attempt, $to, $letter, $is_nl2br_text = null){
$letter['text'] = $mailer->parseSubject($letter['text']);
$letter['text'] = $mailer->parseAttachments($letter['text']);

list($letter, $is_nl2br_text) = cmsEventsManager::hook('process_email_letter', array($letter, $is_nl2br_text));

$mailer->setBodyHTML( (!empty($is_nl2br_text) ? nl2br($letter['text']) : $letter['text']) );

$result = $mailer->send();
Expand Down
6 changes: 5 additions & 1 deletion system/controllers/photos/actions/delete.php
@@ -1,6 +1,6 @@
<?php

class actionPhotosDelete extends cmsAction{
class actionPhotosDelete extends cmsAction {

public function run($photo_id = null){

Expand Down Expand Up @@ -28,8 +28,12 @@ public function run($photo_id = null){

$album = cmsCore::getModel('content')->getContentItem('albums', $photo['album_id']);

list($album, $photo) = cmsEventsManager::hook('photos_before_delete', array($album, $photo));

$this->model->deletePhoto($photo);

list($album, $photo) = cmsEventsManager::hook('photos_after_delete', array($album, $photo));

$this->cms_template->renderJSON(array(
'success' => true,
'album_url' => href_to('albums', $album['slug'].'.html')
Expand Down
6 changes: 4 additions & 2 deletions system/controllers/typograph/hooks/html_filter.php
Expand Up @@ -53,7 +53,7 @@ private function getJevix(){
// Устанавливаем разрешённые теги. (Все не разрешенные теги считаются запрещенными.)
$jevix->cfgAllowTags(array(
'p', 'br', 'span', 'div',
'a', 'img',
'a', 'img', 'input', 'label',
'b', 'i', 'u', 's', 'del', 'em', 'strong', 'sup', 'sub', 'hr', 'font',
'ul', 'ol', 'li',
'table', 'tbody', 'thead', 'tfoot', 'tr', 'td', 'th',
Expand All @@ -65,7 +65,7 @@ private function getJevix(){

// Устанавливаем коротие теги. (не имеющие закрывающего тега)
$jevix->cfgSetTagShort(array(
'br', 'img', 'hr', 'embed'
'br', 'img', 'hr', 'embed', 'input'
));

// Устанавливаем преформатированные теги. (в них все будет заменятся на HTML сущности)
Expand All @@ -86,6 +86,8 @@ private function getJevix(){
$jevix->cfgAllowTagParams('a', array('href' => '#link', 'name' => '#text', 'target' => '#text', 'class' => '#text'));
$jevix->cfgAllowTagParams('img', array('src', 'style' => '#text', 'alt' => '#text', 'title' => '#text', 'align' => array('right', 'left', 'center'), 'width' => '#int', 'height' => '#int', 'hspace' => '#int', 'vspace' => '#int', 'class' => '#text'));
$jevix->cfgAllowTagParams('span', array('style' => '#text'));
$jevix->cfgAllowTagParams('input', array('tabindex' => '#text', 'type' => '#text', 'id' => '#text'));
$jevix->cfgAllowTagParams('label', array('class' => '#text', 'for' => '#text'));
$jevix->cfgAllowTagParams('object', array('width' => '#int', 'height' => '#int', 'data' => array('#domain'=>array('youtube.com','rutube.ru','vimeo.com','vk.com')), 'type' => '#text'));
$jevix->cfgAllowTagParams('param', array('name' => '#text', 'value' => '#text'));
$jevix->cfgAllowTagParams('embed', array('src' => array('#domain'=>array('youtube.com','rutube.ru','vimeo.com','vk.com')), 'type' => '#text','allowscriptaccess' => '#text', 'allowfullscreen' => '#text','width' => '#int', 'height' => '#int', 'flashvars'=> '#text', 'wmode'=> '#text'));
Expand Down
8 changes: 6 additions & 2 deletions system/core/user.php
Expand Up @@ -99,7 +99,9 @@ public function __construct(){

self::setCookie('guest_date_log', time(), 31536000);

self::sessionSet('user:date_log', $_date_log);
if (!self::isSessionSet('user:date_log')){
self::sessionSet('user:date_log', $_date_log);
}

}

Expand Down Expand Up @@ -163,7 +165,9 @@ public function loadAuthUser($user_id) {
// сохраним дату в сессии и обновим в базе
if (!self::isSessionSet('user:date_log') || ((time()-self::USER_ONLINE_INTERVAL) >= strtotime($user['date_log']))){

self::sessionSet('user:date_log', $user['date_log']);
if (!self::isSessionSet('user:date_log')){
self::sessionSet('user:date_log', $user['date_log']);
}

$model->updateUserDateLog($user_id);

Expand Down
2 changes: 1 addition & 1 deletion templates/default/controllers/comments/list.tpl.php
Expand Up @@ -65,7 +65,7 @@

<?php if (($user->is_logged && cmsUser::isAllowed('comments', 'add')) || (!$user->is_logged && $is_guests_allowed)){ ?>
<div id="comments_add_form">
<?php if ($is_karma_allowed || $is_guests_allowed){ ?>
<?php if ($is_karma_allowed || (!$user->is_logged && $is_guests_allowed)){ ?>
<div class="preview_box"></div>
<form action="<?php echo $this->href_to('submit'); ?>" method="post">
<?php echo html_csrf_token($csrf_token_seed); ?>
Expand Down
11 changes: 9 additions & 2 deletions wysiwyg/redactor/files/lang/ru.js
Expand Up @@ -50,7 +50,7 @@ $.Redactor.opts.langs['ru'] = {
text: 'Текст',
mailto: 'Эл. почта',
web: 'URL',
video_html_code: 'Код видео ролика или ссылка на YouTube/Vimeo',
video_html_code: 'Код видео ролика или ссылка на YouTube/Vimeo/Facebook',
file: 'Файл',
upload: 'Загрузить',
download: 'Скачать',
Expand All @@ -74,6 +74,13 @@ $.Redactor.opts.langs['ru'] = {
alignment: 'Выравнивание',
filename: 'Название (необязательно)',
edit: 'Редактировать',
center: 'По центру'
center: 'По центру',
spoiler: 'Спойлер',
spoiler_name: 'Название спойлера',
spoiler_text: 'Текст спойлера',
smiles: 'Смайлы',
undo: 'Отменить',
redo: 'Вернуть',
formalize: 'Оформление'
};
})( jQuery );
80 changes: 0 additions & 80 deletions wysiwyg/redactor/files/plugins/clips/index.html

This file was deleted.

55 changes: 0 additions & 55 deletions wysiwyg/redactor/files/plugins/fontcolor/index.html

This file was deleted.

55 changes: 0 additions & 55 deletions wysiwyg/redactor/files/plugins/fontfamily/index.html

This file was deleted.

0 comments on commit a7bacf0

Please sign in to comment.