Merge remote-tracking branch 'remotes/origin/master' into develop

# Conflicts:
#	protected/humhub/config/common.php
This commit is contained in:
Lucas Bartholemy 2018-11-22 11:48:27 +01:00
commit 9fb44d0789
9 changed files with 47 additions and 14 deletions

View File

@ -48,7 +48,7 @@ class Module extends \yii\base\Module
// Set settings component
$this->set('settings', [
'class' => SettingsManager::className(),
'class' => SettingsManager::class,
'moduleId' => $this->id
]);
}
@ -321,7 +321,10 @@ class Module extends \yii\base\Module
/**
* Returns a list of permission objects this module provides.
* If a ContentContainer is provided, the method should only return applicable permissions in content container context.
*
* If a content container is provided, the method should only return applicable permissions for the given container.
* This function should also make sure the module is installed on the given container in case the permission
* only affects installed features.
*
* @since 0.21
* @param \humhub\modules\content\components\ContentContainerActiveRecord $contentContainer optional contentcontainer

View File

@ -244,6 +244,21 @@ class ModuleManager extends Component
return (array_key_exists($id, $this->modules));
}
/**
* Returns weather or not the given module id belongs to an core module.
*
* @return bool
* @since 1.3.8
*/
public function isCoreModule($id)
{
if(!$this->hasModule($id)) {
return false;
}
return (in_array(get_class($this->getModule($id)), $this->coreModules));
}
/**
* Returns a module instance by id
*

View File

@ -2,6 +2,16 @@ HumHub Change Log
=================
1.3.8 (Unreleased)
---------------------------
- Fix #3359: Weekly summary e-mails are not sent in default configuration
- Fix #3365: Legacy richtext emojis not parsed in richtext preview
- Fix: Friendship button adds additional spaces
- Fix: SpaceController::actionHome throws 403 Http error for guests
1.3.7 (October 23, 2018)
---------------------------

View File

@ -43,7 +43,7 @@ class Events extends BaseObject
public static function onCronDailyRun($event)
{
Yii::$app->queue->push(new SendMailSummary(['interval' => MailSummary::INTERVAL_DAILY]));
if (date('N') == Yii::$app->getModule('activity')->weeklySummaryDay) {
if (date('w') == Yii::$app->getModule('activity')->weeklySummaryDay) {
Yii::$app->queue->push(new SendMailSummary(['interval' => MailSummary::INTERVAL_WEEKLY]));
}
}

View File

@ -11,6 +11,7 @@ namespace humhub\modules\content\components;
use humhub\modules\user\components\PermissionManager;
use humhub\modules\content\models\ContentContainerPermission;
use humhub\libs\BasePermission;
use Yii;
/**
* @inheritdoc

View File

@ -189,11 +189,12 @@ class ProsemirrorRichText extends AbstractRichText
protected function toUTF8Emoji($text)
{
return preg_replace_callback('/:(([A-Za-z0-9])+):/', function($match) {
// Note the ; was used in the legacy editor
return preg_replace_callback('/[:|;](([A-Za-z0-9])+)[:|;]/', function($match) {
$result = $match[0];
if(isset($match[1])) {
$result = array_key_exists($match[1], EmojiMap::MAP) ? EmojiMap::MAP[$match[1]] : $result;
$result = array_key_exists(strtolower($match[1]), EmojiMap::MAP) ? EmojiMap::MAP[strtolower($match[1])] : $result;
}
return $result;

View File

@ -7,8 +7,6 @@ use humhub\modules\friendship\models\Friendship;
/* @var $user \humhub\modules\user\models\User */
/* @var $friendshipState string */
?>
<?php if ($friendshipState === Friendship::STATE_FRIENDS) : ?>
<div class="btn-group">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@ -19,7 +17,7 @@ use humhub\modules\friendship\models\Friendship;
</ul>
</div>
<?php elseif ($friendshipState === Friendship::STATE_NONE) : ?>
<?= Html::a('<span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;' . Yii::t("FriendshipModule.base", "Add Friend"), Url::to(['/friendship/request/add', 'userId' => $user->id]), ['class' => 'btn btn-info', 'data-method' => 'POST', 'data-ui-loader' => '']); ?>
<?= Html::a('<span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;' . Yii::t("FriendshipModule.base", "Add Friend"), Url::to(['/friendship/request/add', 'userId' => $user->id]), ['class' => 'btn btn-info', 'data-method' => 'POST', 'data-ui-loader' => '']); ?>
<?php elseif ($friendshipState === Friendship::STATE_REQUEST_RECEIVED) : ?>
<div class="btn-group">
<?= Html::a(Yii::t("FriendshipModule.base", "Accept Friend Request"), Url::to(['/friendship/request/add', 'userId' => $user->id]), ['class' => 'btn btn-success', 'data-method' => 'POST', 'data-ui-loader' => '']); ?>

View File

@ -26,6 +26,8 @@ use yii\db\Expression;
* It show the space itself and handles all related tasks like following or
* memberships.
*
* @property-read Space $contentContainer
*
* @author Luke
* @package humhub.modules_core.space.controllers
* @since 0.5
@ -41,7 +43,7 @@ class SpaceController extends ContentContainerController
return [
'acl' => [
'class' => AccessControl::class,
'guestAllowedActions' => ['index', 'stream']
'guestAllowedActions' => ['index', 'home', 'stream']
]
];
}
@ -61,6 +63,7 @@ class SpaceController extends ContentContainerController
/**
* Generic Start Action for Profile
* @throws \yii\base\InvalidConfigException
*/
public function actionIndex()
{
@ -88,7 +91,8 @@ class SpaceController extends ContentContainerController
/**
* Default space homepage
*
* @return type
* @return string the rendering result.
* @throws \yii\base\InvalidConfigException
*/
public function actionHome()
{
@ -123,8 +127,7 @@ class SpaceController extends ContentContainerController
}
if (Yii::$app->request->isAjax) {
Yii::$app->response->format = 'json';
return ['success' => $success];
return $this->asJson(['success' => $success]);
}
return $this->redirect($space->getUrl());
@ -141,8 +144,7 @@ class SpaceController extends ContentContainerController
$success = $space->unfollow();
if (Yii::$app->request->isAjax) {
Yii::$app->response->format = 'json';
return ['success' => $success];
return $this->asJson(['success' => $success]);
}
return $this->redirect($space->getUrl());

View File

@ -77,6 +77,9 @@ class StreamViewer extends JsWidget
*/
public $messageStreamEmptyCss = "";
/**
* @inheritdoc
*/
public $jsWidget = 'stream.wall.WallStream';
/**