mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Enh: Updated Translations (translate.humhub.org)
This commit is contained in:
commit
35a3a67b6f
@ -10,7 +10,6 @@ cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
|
@ -4,6 +4,9 @@
|
||||
set -ev
|
||||
|
||||
# Install chomedriver
|
||||
curl -s -L -o chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip \
|
||||
CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
|
||||
CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
|
||||
|
||||
curl "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O \
|
||||
&& unzip -o -d $HOME chromedriver_linux64.zip \
|
||||
&& chmod +x $HOME/chromedriver
|
||||
|
@ -1,8 +1,8 @@
|
||||
HumHub Changelog
|
||||
================
|
||||
|
||||
1.6.4 (Unreleased)
|
||||
------------------
|
||||
1.6.4 (October 9, 2020)
|
||||
-----------------------
|
||||
|
||||
This release also brings a [security update](https://github.com/yiisoft/yii2/security/advisories/GHSA-699q-wcff-g9mj) of the Yii2 framework. HumHub itself and the modules provided by our offical marketplace are not affected by this bug.
|
||||
|
||||
@ -13,6 +13,7 @@ This release also brings a [security update](https://github.com/yiisoft/yii2/sec
|
||||
- Fix #4384: Upgrade to Yii 2.0.38
|
||||
- Fix #4403: Space Picker Double HTML Encode
|
||||
- Fix #4385: Tour broken when profile start page is changed
|
||||
- Fix #4430: Invalid notifications breaks notification overview
|
||||
|
||||
|
||||
1.6.3 (September 9, 2020)
|
||||
|
@ -1,8 +1,9 @@
|
||||
HumHub Changelog
|
||||
================
|
||||
|
||||
1.7.0 (Unreleased)
|
||||
-----------------------
|
||||
1.7.0-beta.1 (October 15, 2020)
|
||||
-------------------------------
|
||||
|
||||
- Fix #4327: Internationalization of user approval/decline message text
|
||||
- Fix #4139: Dashboard post input on mobile cuts editor menu
|
||||
- Fix #4328: Top navigation overlaps post input richtext menu on dashboard page
|
||||
@ -12,12 +13,57 @@ HumHub Changelog
|
||||
- Fix #4230: Auto enable "Hide file info (name, size) for images on wall" option
|
||||
- Chg: Move CHANGELOG to humhub root
|
||||
- Fix #4330: Allow users with permission ManageUsers to modify profile images
|
||||
- Enh #4331: Added 'break-all' stylesheet option to stream entry layouts
|
||||
- Enh #4179: Removed deprecated mysql character set in log table migration
|
||||
- Enh #4324: Improved line break for menu entries with many characters
|
||||
- Fix #4186: Add Timezone validation rules to admin prerequisite view
|
||||
- Enh #4186: Add Timezone validation rules to admin prerequisite view
|
||||
- Enh #4378: Implemented generic ContentContainerActiveRecord::is() function
|
||||
- Enh #4310: Add "Can Like" Permission
|
||||
- Fix #4111: Issues Cropping Images
|
||||
- Enh #4283: Implemented UserMemberSince and UserLastLogin user's profile virtual fields
|
||||
- Fix #4385: Tour broken when profile start page is changed
|
||||
- Enh #3882: Rework of wall stream entry widget design and API
|
||||
- Enh #3882: Introduction of alternative `WallStreamModuleEntry` widget for collaborative content types
|
||||
- Chg #4397: Deprecated old wall entry widget and related stream logic (see `humhub\modules\stream\actions\LegacyStreamTrait.php`)
|
||||
- Fix #4391: ActiveRecord `created_at` and `updated_at` contains invalid value after save
|
||||
- Chg #4397: Default theme color alignment and new `@link` color variable
|
||||
- Enh #4419: Implementation of view context http header `HUMHUB-VIEW-CONTEXT`
|
||||
- Fix #4420: Uncaught Throwable destroys search layout
|
||||
- Enh #4421: Added `Html::addTooltip()` to add tooltips to an option array
|
||||
- Fix #4422: Invalid Html semantic in activity stream (`li` wrapped by `a`)
|
||||
- Enh #4423: Implemented icon alias configuration in ui module class
|
||||
- Enh #4424: Posts content with short text is emphasized
|
||||
- Enh #4425: Use of accessibility compatible icon tooltips
|
||||
- Fix #4408: JPlayer on mobile overflows stream content
|
||||
- Fix #4382: Use of proper word break style
|
||||
- Fix #3566: Bug in models/filetype/CheckboxList.php
|
||||
- Enh #4401: Allow to use less variable name in value of another less variable
|
||||
- Fix #4434: Fix title quoting for space icons in widget “Member in these spaces”
|
||||
- Fix #4428: Replace db Expression time now with func date('Y-m-d G:i:s')
|
||||
- Enh #4370: Add "about" to `Space` model
|
||||
- Enh #4370: Add `humhub\modules\space\widgets\MyMembership` to manage render user state in a space
|
||||
- Enh #4370: Add `humhub\modules\space\widgets\AboutPageSidebar` to manage about page sidebar
|
||||
- Enh #4370: Add `About Space` page
|
||||
- Fix #3994: Live event legitimation array include followed users
|
||||
- Fix #3994: Live event legitimation consider `cached` argument in processing data
|
||||
- Fix #4452: `humhub.ui.filter.getActiveFilterCount` returns wrong value with exclude array option
|
||||
- Fix #4452: Ignore `scope` profile filter in stream filter count and hasActiveFilters
|
||||
- Fix #4456: PHP8 deprecated warning for LessHelper::updateVariables()
|
||||
- Fix #4451: PHP Deprecated Warning in ProsemirrorRichText::replaceLinkExtension
|
||||
- Enh #4195: Increased scaled logo size for high res displays
|
||||
- Enh #4469: Added TextConverter maximum length
|
||||
- Enh #4469: Added file converter id attribute
|
||||
- Enh #3978: Added option to compress and resize images automatically on upload
|
||||
- Enh #3889: Prevent automatically resized site icons by manually added files (e.g. `/upload/icon/180x180.png`)
|
||||
- Enh #4458: Remove cacert.pem in order to avoid curl error
|
||||
- Enh #4467: Inject stream entries by event (experimental)
|
||||
- Fix #4473: Catch all Throwables when loading module configuration
|
||||
- Fix #4474: Loader not removed from event trigger
|
||||
- Enh #4476: Reworked TimeAgo widget
|
||||
- Chg #4482: Removed old legacy richtext editor which is deprecated since v1.3
|
||||
- Enh #4475: Add Console UserAdmin Command
|
||||
- Chg #4482: Removed old legacy richtext editor which is deprecated since v1.3
|
||||
- Enh #3851: Migrate components from ZendFramework to Laminas
|
||||
- Fix #4354: Set `about` as target url of space invitation notification
|
||||
- Fix #4493: Removed legacy ControllerAccess in notification ListController
|
||||
- Chng #4509: Removed `humhub\modules\space\widgets\Picker` which is deprecated since v1.2
|
||||
- Fix #4396: Submitting only picture in comment results in debug error.
|
||||
|
@ -129,11 +129,9 @@ module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-shell');
|
||||
|
||||
//grunt.registerTask('default', ['watch']);
|
||||
grunt.registerTask('build-assets', ['shell:buildAssets']);
|
||||
grunt.registerTask('build-search', ['shell:buildSearch']);
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"php": ">=7.1",
|
||||
"ext-exif": "*",
|
||||
"ext-zip": "*",
|
||||
"cebe/markdown": "1.0.2",
|
||||
@ -22,6 +22,9 @@
|
||||
"firebase/php-jwt": "^5.0",
|
||||
"jbroadway/urlify": "^1.0",
|
||||
"kartik-v/yii2-widgets": "*",
|
||||
"laminas/laminas-escaper": "^2.6",
|
||||
"laminas/laminas-ldap": "^2.10",
|
||||
"matthewbdaly/zendsearch": "^0.0.3",
|
||||
"mistic100/randomcolor": "^1.0",
|
||||
"npm-asset/animate.css": "*",
|
||||
"npm-asset/at.js": "^1.5.1",
|
||||
@ -30,7 +33,7 @@
|
||||
"npm-asset/blueimp-gallery": "2.36.0",
|
||||
"npm-asset/bootstrap-markdown": "2.10.*",
|
||||
"npm-asset/bootstrap-tour": "0.11.0",
|
||||
"npm-asset/clipboard-polyfill": "*",
|
||||
"npm-asset/clipboard-polyfill": "3.0.*",
|
||||
"npm-asset/font-awesome": "^4.7.0",
|
||||
"npm-asset/humhub-prosemirror-richtext": "1.0.26",
|
||||
"npm-asset/imagesloaded": "*",
|
||||
@ -47,7 +50,6 @@
|
||||
"npm-asset/socket.io-client": "^2.0",
|
||||
"npm-asset/swiped-events": "1.0.9",
|
||||
"npm-asset/timeago": "^1.6.3",
|
||||
"nqxcode/zendsearch": "^2.0",
|
||||
"phpoffice/phpspreadsheet": "^1.0",
|
||||
"raoul2000/yii2-jcrop-widget": "*",
|
||||
"twig/twig": "^1.0",
|
||||
@ -60,9 +62,9 @@
|
||||
"yiisoft/yii2-jui": "~2.0.0",
|
||||
"yiisoft/yii2-queue": "~2.3.0",
|
||||
"yiisoft/yii2-redis": "~2.0.0",
|
||||
"yiisoft/yii2-swiftmailer": "~2.0.0",
|
||||
"zendframework/zend-http": "*",
|
||||
"zendframework/zend-ldap": "^2.5"
|
||||
"yiisoft/yii2-swiftmailer": "~2.0.0"
|
||||
},
|
||||
"replace": {
|
||||
},
|
||||
"require-dev": {
|
||||
"codeception/codeception": "^4.0",
|
||||
@ -73,6 +75,7 @@
|
||||
"codeception/specify": "^1.0",
|
||||
"codeception/verify": "~0.5.0 || ~1.1.0",
|
||||
"symfony/browser-kit": ">=2.7 <=4.2.4",
|
||||
"phpcompatibility/php-compatibility": "*",
|
||||
"yiisoft/yii2-debug": "~2.1.0",
|
||||
"yiisoft/yii2-faker": "~2.0.0",
|
||||
"yiisoft/yii2-gii": "~2.1.0"
|
||||
@ -85,14 +88,14 @@
|
||||
],
|
||||
"config": {
|
||||
"process-timeout": 1800,
|
||||
"platform": {
|
||||
"php": "7.0"
|
||||
},
|
||||
"vendor-dir": "protected/vendor",
|
||||
"sort-packages": true,
|
||||
"fxp-asset": {
|
||||
"enabled": false
|
||||
}
|
||||
},
|
||||
"platform": {
|
||||
"php": "7.1"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-create-project-cmd": [
|
||||
|
1940
composer.lock
generated
1940
composer.lock
generated
File diff suppressed because it is too large
Load Diff
2041
package-lock.json
generated
2041
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -6,14 +6,13 @@
|
||||
"url": "git://github.com/humhub/humhub.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "^1.1.0",
|
||||
"grunt": "^1.3.0",
|
||||
"grunt-contrib-clean": "^1.1.0",
|
||||
"grunt-contrib-concat": "^1.0.1",
|
||||
"grunt-contrib-copy": "*",
|
||||
"grunt-contrib-cssmin": "^2.1.0",
|
||||
"grunt-contrib-less": "^2.0.0",
|
||||
"grunt-contrib-uglify": "^2.3.0",
|
||||
"grunt-contrib-watch": "^1.1.0",
|
||||
"grunt-shell": "^2.1.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ class Yii extends \yii\BaseYii
|
||||
* Class BaseApplication
|
||||
* Used for properties that are identical for both WebApplication and ConsoleApplication
|
||||
* @property-read \humhub\components\ModuleManager $moduleManager
|
||||
* @property-read \humhub\components\Controller $controller
|
||||
* @property-read \humhub\components\i18n\I18N $i18n
|
||||
* @property-read \humhub\components\mail\Mailer $mailer
|
||||
* @property-read \humhub\modules\ui\view\components\View $view
|
||||
@ -28,6 +29,7 @@ class Yii extends \yii\BaseYii
|
||||
* @property-read \humhub\components\AssetManager $assetManager
|
||||
* @property-read \humhub\modules\user\authclient\Collection $authClientCollection
|
||||
* @property-read \yii\queue\Queue $queue
|
||||
* @property-read \humhub\components\Request $request
|
||||
* @property-read \humhub\components\UrlManager $urlManager
|
||||
* @property-read \humhub\modules\live\components\Sender $live
|
||||
* @property-read \yii\mutex\Mutex $mutex
|
||||
@ -41,6 +43,7 @@ abstract class BaseApplication extends yii\base\Application
|
||||
* Class WebApplication
|
||||
* Include only Web application related components here
|
||||
* @property-read \humhub\modules\user\components\User $user
|
||||
* @property-read \humhub\components\mail\Mailer $mailer
|
||||
*/
|
||||
class WebApplication extends \humhub\components\Application
|
||||
{
|
||||
|
@ -21,11 +21,15 @@ class ClipboardJsAsset extends AssetBundle
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $sourcePath = '@npm/clipboard-polyfill';
|
||||
public $sourcePath = '@npm/clipboard-polyfill/dist/main';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $js = ['dist/clipboard-polyfill.js'];
|
||||
public $js = ['clipboard-polyfill.js'];
|
||||
|
||||
public $publishOptions = [
|
||||
'only' => ['clipboard-polyfill.js']
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -42,9 +42,9 @@ class CoreApiAsset extends WebStaticAssetBundle
|
||||
'js/humhub/humhub.ui.loader.js',
|
||||
'js/humhub/humhub.action.js',
|
||||
'js/humhub/humhub.ui.widget.js',
|
||||
'js/humhub/humhub.ui.view.js',
|
||||
'js/humhub/humhub.client.js',
|
||||
'js/humhub/humhub.ui.status.js',
|
||||
'js/humhub/humhub.ui.view.js',
|
||||
'js/humhub/humhub.ui.navigation.js', // Required here since we set the active navigation on each call
|
||||
'js/humhub/humhub.ui.modal.js', // Should be moved to CoreModuleScriptAssets later
|
||||
'js/humhub/humhub.ui.progress.js',
|
||||
|
@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\assets;
|
||||
|
||||
use yii\web\AssetBundle;
|
||||
|
||||
/**
|
||||
* jquery-highlight
|
||||
*
|
||||
* @author buddha
|
||||
* @deprecated since v1.3
|
||||
*/
|
||||
class PagedownConverterAsset extends AssetBundle
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $basePath = '@webroot-static';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $baseUrl = '@web-static';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $js = [
|
||||
'js/pagedown/Markdown.Converter.js',
|
||||
'js/pagedown/Markdown.Sanitizer.js',
|
||||
'js/pagedown/Markdown.Extra.js',
|
||||
];
|
||||
|
||||
}
|
@ -11,6 +11,7 @@ namespace humhub\components;
|
||||
use Yii;
|
||||
use humhub\modules\user\models\User;
|
||||
use humhub\modules\file\components\FileManager;
|
||||
use yii\db\Expression;
|
||||
|
||||
/**
|
||||
* Description of ActiveRecord
|
||||
@ -35,7 +36,7 @@ class ActiveRecord extends \yii\db\ActiveRecord implements \Serializable
|
||||
{
|
||||
if ($insert) {
|
||||
if ($this->hasAttribute('created_at') && $this->created_at == "") {
|
||||
$this->created_at = new \yii\db\Expression('NOW()');
|
||||
$this->created_at = date('Y-m-d G:i:s');
|
||||
}
|
||||
|
||||
if (isset(Yii::$app->user) && $this->hasAttribute('created_by') && $this->created_by == "") {
|
||||
@ -44,7 +45,7 @@ class ActiveRecord extends \yii\db\ActiveRecord implements \Serializable
|
||||
}
|
||||
|
||||
if ($this->hasAttribute('updated_at')) {
|
||||
$this->updated_at = new \yii\db\Expression('NOW()');
|
||||
$this->updated_at = date('Y-m-d G:i:s');
|
||||
}
|
||||
if (isset(Yii::$app->user) && $this->hasAttribute('updated_by')) {
|
||||
$this->updated_by = Yii::$app->user->id;
|
||||
@ -53,6 +54,22 @@ class ActiveRecord extends \yii\db\ActiveRecord implements \Serializable
|
||||
return parent::beforeSave($insert);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function afterSave($insert, $changedAttributes)
|
||||
{
|
||||
if ($this->hasAttribute('created_at') && $this->created_at instanceof Expression) {
|
||||
$this->created_at = date('Y-m-d G:i:s');
|
||||
}
|
||||
|
||||
if($this->hasAttribute('updated_at') && $this->updated_at instanceof Expression) {
|
||||
$this->updated_at = date('Y-m-d G:i:s');
|
||||
}
|
||||
|
||||
parent::afterSave($insert, $changedAttributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a unique id for this record/model
|
||||
*
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
namespace humhub\components;
|
||||
|
||||
use humhub\models\Setting;
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
@ -18,13 +19,18 @@ use Yii;
|
||||
*/
|
||||
class Request extends \yii\web\Request
|
||||
{
|
||||
/**
|
||||
* Http header name for view context information
|
||||
* @see \humhub\modules\ui\view\components\View::$viewContext
|
||||
*/
|
||||
const HEADER_VIEW_CONTEXT = 'HUMHUB-VIEW-CONTEXT';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if (\humhub\models\Setting::isInstalled()) {
|
||||
if (Setting::isInstalled()) {
|
||||
$secret = Yii::$app->settings->get('secret');
|
||||
if ($secret != "") {
|
||||
$this->cookieValidationKey = $secret;
|
||||
@ -35,4 +41,12 @@ class Request extends \yii\web\Request
|
||||
$this->cookieValidationKey = 'installer';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null the value of http header `HUMHUB-VIEW-CONTEXT`
|
||||
*/
|
||||
public function getViewContext()
|
||||
{
|
||||
return $this->getHeaders()->get(static::HEADER_VIEW_CONTEXT);
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ class Widget extends \yii\base\Widget
|
||||
$result = (empty($widget->widgetLayout)) ? $widget->run() : $widget->render($widget->widgetLayout, $widget->getLayoutViewParams()); ;
|
||||
$out = $widget->afterRun($result);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Throwable $e) {
|
||||
// close the output buffer opened above if it has not been closed already
|
||||
if (ob_get_level() > 0) {
|
||||
ob_end_clean();
|
||||
|
@ -74,7 +74,7 @@ class ModuleAutoLoader implements BootstrapInterface
|
||||
try {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
$modules[$folder] = require $folder . DIRECTORY_SEPARATOR . self::CONFIGURATION_FILE;
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Throwable $e) {
|
||||
Yii::error($e);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@ if (!defined('PKCS7_DETACHED')) {
|
||||
|
||||
$config = [
|
||||
'name' => 'HumHub',
|
||||
'version' => '1.7.0-dev',
|
||||
'version' => '1.7.0-beta.1',
|
||||
'basePath' => dirname(__DIR__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR,
|
||||
'bootstrap' => ['log', 'humhub\components\bootstrap\ModuleAutoLoader', 'queue', 'humhub\modules\ui\view\bootstrap\ThemeLoader'],
|
||||
'sourceLanguage' => 'en',
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
namespace humhub\libs;
|
||||
|
||||
use humhub\widgets\Button;
|
||||
use yii\grid\Column;
|
||||
use yii\helpers\Url;
|
||||
use humhub\libs\Html;
|
||||
@ -52,7 +53,8 @@ class ActionColumn extends Column
|
||||
}
|
||||
|
||||
$html = Html::beginTag('div', ['class' => 'btn-group dropdown-navigation']);
|
||||
$html .= Html::button('<i class="fa fa-cog"></i> <span class="caret"></span>', ['class' => 'btn btn-default dropdown-toggle', 'data-toggle' => 'dropdown']);
|
||||
$html .= Button::defaultType('<span class="caret"></span>')->cssClass('dropdown-toggle')
|
||||
->options(['data-toggle' => 'dropdown'])->icon('controls')->loader(false);
|
||||
$html .= Html::beginTag('ul', ['class' => 'dropdown-menu pull-right']);
|
||||
foreach ($actions as $title => $url) {
|
||||
if ($url === '---') {
|
||||
@ -89,7 +91,7 @@ class ActionColumn extends Column
|
||||
|
||||
/**
|
||||
* Builds the URL for a given Action
|
||||
*
|
||||
*
|
||||
* @param array $url
|
||||
* @param \yii\base\Model $model
|
||||
* @return string the url
|
||||
|
@ -29,8 +29,7 @@ class CURLHelper
|
||||
CURLOPT_SSL_VERIFYPEER => (Yii::$app->params['curl']['validateSsl']) ? true : false,
|
||||
CURLOPT_SSL_VERIFYHOST => (Yii::$app->params['curl']['validateSsl']) ? 2 : 0,
|
||||
CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS,
|
||||
CURLOPT_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS,
|
||||
CURLOPT_CAINFO => Yii::getAlias('@humhub/config/cacert.pem')
|
||||
CURLOPT_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS
|
||||
];
|
||||
|
||||
if (Yii::$app->settings->get('proxy.enabled')) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
namespace humhub\libs;
|
||||
|
||||
use humhub\modules\ui\icon\widgets\Icon;
|
||||
use humhub\modules\web\security\helpers\Security;
|
||||
use Yii;
|
||||
use yii\base\InvalidArgumentException;
|
||||
@ -114,7 +115,7 @@ class Html extends \yii\bootstrap\Html
|
||||
}
|
||||
|
||||
if (!isset($options['showIcon']) || $options['showIcon'] === true) {
|
||||
$label = '<i class="fa fa-arrow-left aria-hidden="true"></i> ' . $label;
|
||||
$label = Icon::get('back')->asString().' '. $label;
|
||||
}
|
||||
|
||||
if (empty($url)) {
|
||||
@ -185,6 +186,19 @@ class Html extends \yii\bootstrap\Html
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a tooltip to the given options array.
|
||||
* Note, this will overwrite the title attribute.
|
||||
*
|
||||
* @param $options
|
||||
* @param $tooltip
|
||||
*/
|
||||
public static function addTooltip(&$options, $tooltip)
|
||||
{
|
||||
static::addCssClass($options, 'tt');
|
||||
$options['title'] = $tooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a Bootstrap container tag.
|
||||
*
|
||||
|
@ -50,12 +50,12 @@ class LogoImage
|
||||
{
|
||||
if ($maxWidth === null) {
|
||||
// Will change in future!
|
||||
$maxWidth = 300;
|
||||
$maxWidth = 600;
|
||||
}
|
||||
|
||||
if ($maxHeight === null) {
|
||||
// Will change in future!
|
||||
$maxHeight = 40;
|
||||
$maxHeight = 80;
|
||||
}
|
||||
|
||||
$file = self::getFile($maxWidth, $maxHeight);
|
||||
|
@ -8,13 +8,26 @@
|
||||
|
||||
namespace humhub\libs;
|
||||
|
||||
/**
|
||||
* Class Sort
|
||||
*
|
||||
* @package humhub\libs
|
||||
*/
|
||||
class Sort
|
||||
{
|
||||
public static function sort(&$arr, $field = 'sortOrder')
|
||||
|
||||
/**
|
||||
* @param array $arr The input array.
|
||||
* @param string $field The attribute or array key to which holds the sort order
|
||||
* @param int $default The default sort order if field value is empty. Default PHP_INT_MAX
|
||||
*
|
||||
* @return array the sorted array
|
||||
*/
|
||||
public static function sort(&$arr, $field = 'sortOrder', $default = PHP_INT_MAX)
|
||||
{
|
||||
usort($arr, function($a, $b) use ($field) {
|
||||
$sortA = static::getSortValue($a, $field);
|
||||
$sortB = static::getSortValue($b, $field);
|
||||
usort($arr, function ($a, $b) use ($field, $default) {
|
||||
$sortA = static::getSortValue($a, $field, $default);
|
||||
$sortB = static::getSortValue($b, $field, $default);
|
||||
|
||||
if ($sortA == $sortB) {
|
||||
return 0;
|
||||
@ -28,14 +41,20 @@ class Sort
|
||||
return $arr;
|
||||
}
|
||||
|
||||
private static function getSortValue($obj, $field)
|
||||
/**
|
||||
* @param array|object $obj the object or array
|
||||
* @param string $field the field name
|
||||
* @param int $default the default sort order
|
||||
* @return int
|
||||
*/
|
||||
private static function getSortValue($obj, $field, $default)
|
||||
{
|
||||
if(is_array($obj) && isset($obj[$field])) {
|
||||
return $obj[$field] === null ? PHP_INT_MAX : $obj[$field];
|
||||
if (is_array($obj) && isset($obj[$field])) {
|
||||
return $obj[$field] === null ? $default : $obj[$field];
|
||||
}
|
||||
|
||||
if(property_exists($obj, $field)) {
|
||||
return $obj->$field === null ? PHP_INT_MAX : $obj->$field;
|
||||
if (property_exists($obj, $field)) {
|
||||
return $obj->$field === null ? $default : $obj->$field;
|
||||
}
|
||||
|
||||
return PHP_INT_MAX;
|
||||
|
@ -25,8 +25,8 @@ class UrlOembedHttpClient implements UrlOembedClient
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 15);
|
||||
|
||||
// Not available when open_basedir or safe_mode is set.
|
||||
if (!function_exists('ini_get') || !ini_get('open_basedir') || !ini_get('safe_mode')) {
|
||||
// Not available when open_basedir is set.
|
||||
if (!function_exists('ini_get') || !ini_get('open_basedir')) {
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,6 +8,8 @@
|
||||
|
||||
namespace humhub\modules\activity\actions;
|
||||
|
||||
use humhub\modules\content\widgets\stream\StreamEntryOptions;
|
||||
use humhub\modules\content\widgets\stream\WallStreamEntryOptions;
|
||||
use humhub\modules\stream\actions\ContentContainerStream;
|
||||
use humhub\modules\stream\models\ContentContainerStreamQuery;
|
||||
use humhub\modules\user\models\User;
|
||||
@ -30,12 +32,22 @@ class ActivityStreamAction extends ContentContainerStream
|
||||
*/
|
||||
public $activity = true;
|
||||
|
||||
/**
|
||||
* @return StreamEntryOptions
|
||||
*/
|
||||
public function initStreamEntryOptions()
|
||||
{
|
||||
return $this->activity
|
||||
? new StreamEntryOptions()
|
||||
: new WallStreamEntryOptions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function setActionSettings()
|
||||
protected function beforeApplyFilters()
|
||||
{
|
||||
parent::setActionSettings();
|
||||
parent::beforeApplyFilters();
|
||||
|
||||
if(!$this->activity) {
|
||||
return;
|
||||
|
@ -141,30 +141,33 @@ class MailSummary extends Component
|
||||
*/
|
||||
public function getActivities()
|
||||
{
|
||||
$stream = new DashboardStreamAction('stream', Yii::$app->controller);
|
||||
$stream->activity = true;
|
||||
$stream->limit = $this->maxActivityCount;
|
||||
$stream->mode = DashboardStreamAction::MODE_ACTIVITY;
|
||||
$stream->user = $this->user;
|
||||
$stream = new DashboardStreamAction('stream', Yii::$app->controller , [
|
||||
'activity' => true,
|
||||
'limit' => $this->maxActivityCount,
|
||||
'user' => $this->user,
|
||||
]);
|
||||
|
||||
$stream->init();
|
||||
$stream->activeQuery->andWhere(['>', 'content.created_at', $this->getLastSummaryDate()]);
|
||||
|
||||
$query = $stream->getStreamQuery()->query();
|
||||
$query->andWhere(['>', 'content.created_at', $this->getLastSummaryDate()]);
|
||||
|
||||
// Handle suppressed activities
|
||||
$suppressedActivities = $this->getSuppressedActivities();
|
||||
if (!empty($suppressedActivities)) {
|
||||
$stream->activeQuery->leftJoin('activity ax', 'ax.id=content.object_id');
|
||||
$stream->activeQuery->andWhere(['NOT IN', 'ax.class', $suppressedActivities]);
|
||||
$query->leftJoin('activity ax', 'ax.id=content.object_id');
|
||||
$query->andWhere(['NOT IN', 'ax.class', $suppressedActivities]);
|
||||
}
|
||||
|
||||
// Handle defined content container mode
|
||||
$limitContainer = $this->getLimitContentContainers();
|
||||
if (!empty($limitContainer)) {
|
||||
$mode = ($this->getLimitContentContainerMode() == MailSummaryForm::LIMIT_MODE_INCLUDE) ? 'IN' : 'NOT IN';
|
||||
$stream->activeQuery->andWhere([$mode, 'content.contentcontainer_id', $limitContainer]);
|
||||
$query->andWhere([$mode, 'content.contentcontainer_id', $limitContainer]);
|
||||
}
|
||||
|
||||
$activities = [];
|
||||
foreach ($stream->activeQuery->all() as $content) {
|
||||
foreach ($stream->getStreamQuery()->all() as $content) {
|
||||
try {
|
||||
$activity = $content->getPolymorphicRelation();
|
||||
if ($activity instanceof Activity) {
|
||||
|
@ -9,6 +9,7 @@
|
||||
namespace humhub\modules\activity\models;
|
||||
|
||||
use humhub\modules\activity\components\BaseActivity;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Exception;
|
||||
use yii\base\InvalidConfigException;
|
||||
@ -17,6 +18,7 @@ use humhub\modules\content\components\ContentActiveRecord;
|
||||
use humhub\modules\activity\components\ActivityWebRenderer;
|
||||
use humhub\components\behaviors\PolymorphicRelation;
|
||||
use yii\db\IntegrityException;
|
||||
use humhub\modules\activity\widgets\Activity as ActivityStreamEntryWidget;
|
||||
|
||||
/**
|
||||
* This is the model class for table "activity".
|
||||
@ -35,7 +37,7 @@ class Activity extends ContentActiveRecord
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $wallEntryClass = 'humhub\modules\activity\widgets\Activity';
|
||||
public $wallEntryClass = ActivityStreamEntryWidget::class;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
@ -111,27 +113,6 @@ class Activity extends ContentActiveRecord
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getWallOut($params = [])
|
||||
{
|
||||
$cacheKey = 'activity_wall_out_' . Yii::$app->language . '_' . $this->id;
|
||||
$output = false;
|
||||
|
||||
if ($output === false) {
|
||||
$activity = $this->getActivityBaseClass();
|
||||
if ($activity !== null) {
|
||||
$renderer = new ActivityWebRenderer();
|
||||
$output = $renderer->render($activity);
|
||||
Yii::$app->cache->set($cacheKey, $output);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the source object which belongs to this Activity.
|
||||
*
|
||||
|
@ -36,9 +36,7 @@ humhub.module('activity', function (module, require, $) {
|
||||
var instance;
|
||||
|
||||
|
||||
var ActivityStreamEntry = stream.StreamEntry.extend(function (id) {
|
||||
stream.StreamEntry.call(this, id);
|
||||
});
|
||||
var ActivityStreamEntry = stream.StreamEntry.extend();
|
||||
|
||||
ActivityStreamEntry.prototype.delete = function () {/* Not implemented */};
|
||||
ActivityStreamEntry.prototype.edit = function () {/* Not implemented */};
|
||||
|
@ -64,7 +64,7 @@ class ActivityStreamCest
|
||||
$I->see('Confirm post deletion');
|
||||
$I->click('Delete', '#globalModalConfirm');
|
||||
|
||||
$I->seeSuccess('The content has been deleted');
|
||||
$I->waitForElementNotVisible($newEntrySelector);
|
||||
|
||||
$I->amUser2(true);
|
||||
$I->waitForText('There are no activities yet.', null, '#activityStream');
|
||||
|
@ -5,6 +5,7 @@ namespace humhub\modules\activity\tests\codeception\unit;
|
||||
use humhub\modules\activity\tests\codeception\activities\TestActivityDefaultLayout;
|
||||
use humhub\modules\activity\tests\codeception\activities\TestViewActivity;
|
||||
use humhub\modules\activity\tests\codeception\activities\TestActivity;
|
||||
use humhub\modules\content\widgets\stream\StreamEntryWidget;
|
||||
use humhub\modules\post\models\Post;
|
||||
use humhub\modules\user\models\User;
|
||||
use tests\codeception\_support\HumHubDbTestCase;
|
||||
@ -17,7 +18,7 @@ class ActivityViewTest extends HumHubDbTestCase
|
||||
->about(Post::findOne(['id' => 1]))->create();
|
||||
|
||||
$this->assertNotNull($activity->record);
|
||||
$wallout = $activity->record->getWallOut();
|
||||
$wallout = StreamEntryWidget::renderStreamEntry($activity->record);
|
||||
$this->assertContains('My special activity view layout', $wallout);
|
||||
$this->assertContains('My special activity view content', $wallout);
|
||||
}
|
||||
@ -28,7 +29,7 @@ class ActivityViewTest extends HumHubDbTestCase
|
||||
->about(Post::findOne(['id' => 1]))->create();
|
||||
|
||||
$this->assertNotNull($activity->record);
|
||||
$wallout = $activity->record->getWallOut();
|
||||
$wallout = StreamEntryWidget::renderStreamEntry($activity->record);
|
||||
$this->assertContains('My special activity view layout without view', $wallout);
|
||||
$this->assertContains('Content of no view activity', $wallout);
|
||||
}
|
||||
@ -39,8 +40,8 @@ class ActivityViewTest extends HumHubDbTestCase
|
||||
->about(Post::findOne(['id' => 1]))->create();
|
||||
|
||||
$this->assertNotNull($activity->record);
|
||||
$wallout = $activity->record->getWallOut();
|
||||
$wallout = StreamEntryWidget::renderStreamEntry($activity->record);
|
||||
$this->assertContains('Content of default layout activity', $wallout);
|
||||
$this->assertContains('media-object img-rounded', $wallout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,43 +19,44 @@ use yii\helpers\Url;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php if ($clickable) : ?>
|
||||
<a href="<?= Url::to(['/activity/link', 'id' => $record->id])?>">
|
||||
<?php endif; ?>
|
||||
<li class="activity-entry" data-stream-entry data-action-component="activity.ActivityStreamEntry" data-content-key="<?= $record->content->id ?>">
|
||||
<div class="media">
|
||||
<?php if ($originator !== null) : ?>
|
||||
<!-- Show user image -->
|
||||
<?= $originator->getProfileImage()->render(32, ['class' => 'media-object', 'link' => false, 'htmlOptions' => ['class' => 'pull-left']]) ?>
|
||||
|
||||
<div class="media">
|
||||
<?php if ($originator !== null) : ?>
|
||||
<!-- Show user image -->
|
||||
<?= $originator->getProfileImage()->render(32, ['class' => 'media-object', 'link' => false, 'htmlOptions' => ['class' => 'pull-left']]) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Show space image, if you are outside from a space -->
|
||||
<?php if (!Yii::$app->controller instanceof ContentContainerController) : ?>
|
||||
<?php if ($record->content->container instanceof Space) : ?>
|
||||
<?=
|
||||
Image::widget([
|
||||
'space' => $record->content->container,
|
||||
'width' => 20,
|
||||
'htmlOptions' => [
|
||||
'class' => 'img-space pull-left',
|
||||
]
|
||||
])
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Show space image, if you are outside from a space -->
|
||||
<?php if (!Yii::$app->controller instanceof ContentContainerController) : ?>
|
||||
<?php if ($record->content->container instanceof Space) : ?>
|
||||
<?=
|
||||
Image::widget([
|
||||
'space' => $record->content->container,
|
||||
'width' => 20,
|
||||
'htmlOptions' => [
|
||||
'class' => 'img-space pull-left',
|
||||
]
|
||||
])
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<div class="media-body text-break">
|
||||
|
||||
<div class="media-body text-break">
|
||||
<!-- Show content -->
|
||||
<?= $content ?>
|
||||
<br>
|
||||
|
||||
<!-- Show content -->
|
||||
<?= $content ?>
|
||||
<br>
|
||||
|
||||
<!-- show time -->
|
||||
<?= TimeAgo::widget(['timestamp' => $record->content->created_at]) ?>
|
||||
</div>
|
||||
<!-- show time -->
|
||||
<?= TimeAgo::widget(['timestamp' => $record->content->created_at]) ?>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<?php if ($clickable) : ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
@ -9,10 +9,11 @@
|
||||
namespace humhub\modules\activity\widgets;
|
||||
|
||||
use humhub\modules\activity\components\ActivityWebRenderer;
|
||||
use humhub\modules\activity\components\BaseActivity;
|
||||
use humhub\modules\activity\models\Activity as ActivityModel;
|
||||
use humhub\modules\content\widgets\stream\StreamEntryWidget;
|
||||
use Yii;
|
||||
use humhub\modules\content\widgets\WallEntry;
|
||||
use humhub\modules\content\components\ContentActiveRecord;
|
||||
use humhub\modules\content\components\ContentAddonActiveRecord;
|
||||
use yii\base\Exception;
|
||||
|
||||
/**
|
||||
* ActivityWidget shows an activity.
|
||||
@ -21,28 +22,52 @@ use humhub\modules\content\components\ContentAddonActiveRecord;
|
||||
* @package humhub.modules_core.activity
|
||||
* @since 0.5
|
||||
*/
|
||||
class Activity extends WallEntry
|
||||
class Activity extends StreamEntryWidget
|
||||
{
|
||||
|
||||
protected $themePath = 'modules/activity';
|
||||
/**
|
||||
* @var ActivityModel is the current activity object.
|
||||
*/
|
||||
public $model;
|
||||
|
||||
/**
|
||||
* @var \humhub\modules\activity\models\Activity is the current activity object.
|
||||
* @inheritDoc
|
||||
*/
|
||||
public $activity;
|
||||
public $rootElement = 'li';
|
||||
|
||||
/**
|
||||
* @var integer If the Widget is linked to a wall entry id
|
||||
* @inheritDoc
|
||||
*/
|
||||
public $wallEntryId = 0;
|
||||
public $jsWidget = 'activity.ActivityStreamEntry';
|
||||
|
||||
/**
|
||||
* Runs the Widget
|
||||
* @return string rendered wall entry body without the layoutRoot wrapper
|
||||
* @throws Exception
|
||||
*/
|
||||
public function run()
|
||||
protected function renderBody()
|
||||
{
|
||||
// The render logic is overwritten by models\Activity::getWallOut()
|
||||
return '';
|
||||
$cacheKey = 'activity_wall_out_' . Yii::$app->language . '_' . $this->id;
|
||||
|
||||
$activity = $this->model->getActivityBaseClass();
|
||||
|
||||
$output = '';
|
||||
|
||||
if ($activity instanceof BaseActivity) {
|
||||
$renderer = new ActivityWebRenderer();
|
||||
$output = $renderer->render($activity);
|
||||
Yii::$app->cache->set($cacheKey, $output);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getAttributes()
|
||||
{
|
||||
return [
|
||||
'class' => 'activity-entry'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,11 @@ use yii\helpers\Url;
|
||||
*/
|
||||
class ActivityStreamViewer extends StreamViewer
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public $streamFilterNavigation = null;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
@ -1,10 +1,16 @@
|
||||
<?php
|
||||
|
||||
use humhub\libs\Html;
|
||||
use humhub\modules\admin\widgets\GroupManagerMenu;
|
||||
use humhub\modules\user\models\Group;
|
||||
use humhub\widgets\Button;
|
||||
|
||||
/* @var $group Group */
|
||||
|
||||
?>
|
||||
<div class="panel-body">
|
||||
<div class="pull-right">
|
||||
<?= Html::backButton(['index'], ['label' => Yii::t('AdminModule.base', 'Back to overview')]); ?>
|
||||
<?= Button::back(['index'], Yii::t('AdminModule.base', 'Back to overview'))?>
|
||||
</div>
|
||||
|
||||
<?php if (!$group->isNewRecord) : ?>
|
||||
@ -22,7 +28,7 @@ use humhub\libs\Html;
|
||||
<?php if ($group->is_admin_group) : ?>
|
||||
<div class="pull-right"><span class="label label-danger"><?= Yii::t('AdminModule.base', 'Administrative group'); ?></span> </div>
|
||||
<?php endif; ?>
|
||||
<?= \humhub\modules\admin\widgets\GroupManagerMenu::widget(['group' => $group]); ?>
|
||||
<?= GroupManagerMenu::widget(['group' => $group]); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?= $content; ?>
|
||||
|
@ -1,14 +1,19 @@
|
||||
<?php
|
||||
|
||||
use humhub\libs\ActionColumn;
|
||||
use humhub\modules\admin\models\GroupSearch;
|
||||
use humhub\modules\admin\widgets\GroupMenu;
|
||||
use humhub\widgets\Link;
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\Html;
|
||||
use humhub\widgets\GridView;
|
||||
|
||||
/* @var $searchModel GroupSearch*/
|
||||
?>
|
||||
<div class="panel-body">
|
||||
<div class="pull-right">
|
||||
<?= Html::a('<i class="fa fa-plus" aria-hidden="true"></i> ' . Yii::t('AdminModule.user', 'Create new group'), Url::to(['edit']), ['class' => 'btn btn-sm btn-success']); ?>
|
||||
<?= Link::success(Yii::t('AdminModule.user', 'Create new group'))->href(Url::to(['edit']))->sm()->icon('add') ?>
|
||||
</div>
|
||||
|
||||
|
||||
<h4><?= Yii::t('AdminModule.user', 'Manage groups'); ?></h4>
|
||||
|
||||
<div class="help-block">
|
||||
@ -16,12 +21,11 @@ use humhub\widgets\GridView;
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= \humhub\modules\admin\widgets\GroupMenu::widget(); ?>
|
||||
<?= GroupMenu::widget() ?>
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
<?php
|
||||
echo GridView::widget([
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'tableOptions' => ['class' => 'table table-hover'],
|
||||
@ -38,7 +42,7 @@ use humhub\widgets\GridView;
|
||||
}
|
||||
],
|
||||
[
|
||||
'class' => \humhub\libs\ActionColumn::class,
|
||||
'class' => ActionColumn::class,
|
||||
'actions' => function($group, $key, $index) {
|
||||
/* @var $group \humhub\modules\user\models\Group */
|
||||
if($group->is_admin_group && !Yii::$app->user->isAdmin()) {
|
||||
@ -54,6 +58,5 @@ use humhub\widgets\GridView;
|
||||
}
|
||||
],
|
||||
],
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
]) ?>
|
||||
</div>
|
||||
|
@ -1,33 +1,41 @@
|
||||
<?php
|
||||
|
||||
use humhub\modules\admin\assets\AdminGroupAsset;
|
||||
use humhub\modules\admin\models\forms\AddGroupMemberForm;
|
||||
use humhub\modules\admin\models\UserSearch;
|
||||
use humhub\modules\user\models\Group;
|
||||
use humhub\widgets\Button;
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use humhub\widgets\GridView;
|
||||
use humhub\modules\user\grid\ImageColumn;
|
||||
use humhub\modules\user\grid\DisplayNameColumn;
|
||||
use humhub\modules\user\widgets\UserPickerField;
|
||||
|
||||
\humhub\modules\admin\assets\AdminGroupAsset::register($this);
|
||||
/* @var $group Group */
|
||||
/* @var $addGroupMemberForm AddGroupMemberForm */
|
||||
/* @var $searchModel UserSearch */
|
||||
|
||||
AdminGroupAsset::register($this);
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@admin/views/group/_manageLayout.php', ['group' => $group]) ?>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<?php $form = ActiveForm::begin(['action' => ['/admin/group/add-members']]); ?>
|
||||
<div class="input-group select2-humhub-append">
|
||||
<?=
|
||||
humhub\modules\user\widgets\UserPickerField::widget([
|
||||
<?= UserPickerField::widget([
|
||||
'model' => $addGroupMemberForm,
|
||||
'attribute' => 'userGuids',
|
||||
'url' => Url::to(['/admin/group/new-member-search', 'id' => $group->id]),
|
||||
'placeholder' => Yii::t('AdminModule.user', 'Add new members...'),
|
||||
'focus' => true,
|
||||
])
|
||||
?>
|
||||
]) ?>
|
||||
<?= Html::activeHiddenInput($addGroupMemberForm, 'groupId', ['value' => $group->id]) ?>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-primary" style="height:40px;" data-ui-loader><i class="fa fa-plus"></i></button>
|
||||
<?= Button::primary()->submit()->style('height:40px')->icon('add') ?>
|
||||
</span>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
@ -39,7 +47,7 @@ use humhub\modules\user\grid\DisplayNameColumn;
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -86,11 +94,11 @@ use humhub\modules\user\grid\DisplayNameColumn;
|
||||
return false;
|
||||
},
|
||||
'delete' => function($url, $model) use ($group) {
|
||||
return Html::a('<i class="fa fa-times"></i>', '#', [
|
||||
'data-action-click' => 'admin.group.removeMember',
|
||||
'data-action-url' => Url::to(['remove-group-user', 'id' => $group->id, 'userId' => $model->id]),
|
||||
'title' => Yii::t('AdminModule.user', 'Remove from group'),
|
||||
'class' => 'btn btn-danger btn-xs tt']);
|
||||
return Button::danger()
|
||||
->tooltip(Yii::t('AdminModule.user', 'Remove from group'))
|
||||
->action('admin.group.removeMember', Url::to(['remove-group-user', 'id' => $group->id, 'userId' => $model->id]))
|
||||
->icon('remove')->xs()
|
||||
->confirm();
|
||||
}
|
||||
],
|
||||
],
|
||||
@ -100,4 +108,4 @@ use humhub\modules\user\grid\DisplayNameColumn;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->endContent(); ?>
|
||||
<?php $this->endContent(); ?>
|
||||
|
@ -71,7 +71,7 @@ $iconUrl = SiteIcon::getUrl(140);
|
||||
|
||||
<?= Button::danger()->id('admin-delete-logo-image')
|
||||
->action('admin.deletePageLogo', Url::to(['/admin/setting/delete-logo-image']))
|
||||
->style(LogoImage::hasImage() ? '' : 'display:none')->icon('times')->sm()->loader(false) ?>
|
||||
->style(LogoImage::hasImage() ? '' : 'display:none')->icon('remove')->sm()->loader(false) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -88,7 +88,7 @@ $iconUrl = SiteIcon::getUrl(140);
|
||||
|
||||
<?= Button::danger()->id('admin-delete-icon-image')
|
||||
->action('admin.deletePageIcon', Url::to(['/admin/setting/delete-icon-image']))
|
||||
->style(SiteIcon::hasImage() ? '' : 'display:none')->icon('times')->sm()->loader(false) ?>
|
||||
->style(SiteIcon::hasImage() ? '' : 'display:none')->icon('remove')->sm()->loader(false) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use humhub\widgets\Button;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use humhub\compat\CActiveForm;
|
||||
@ -9,7 +10,7 @@ use humhub\compat\CHtml;
|
||||
<?php $this->beginContent('@admin/views/setting/_advancedLayout.php') ?>
|
||||
|
||||
<div class="clearfix">
|
||||
<?= Html::a('<i class="fa fa-arrow-left" aria-hidden="true"></i> ' . Yii::t('AdminModule.settings', 'Back to overview'), Url::to(['setting/oembed']), ['class' => 'btn btn-default pull-right']); ?>
|
||||
<?= Button::back(Url::to(['setting/oembed']), Yii::t('AdminModule.settings', 'Back to overview')) ?>
|
||||
<h4 class="pull-left">
|
||||
<?php
|
||||
if ($prefix == "") {
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use humhub\modules\user\grid\DisplayNameColumn;
|
||||
use humhub\modules\user\grid\ImageColumn;
|
||||
use humhub\widgets\ModalButton;
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use humhub\modules\admin\widgets\SpaceGridView;
|
||||
@ -11,11 +12,13 @@ use humhub\modules\admin\grid\SpaceImageColumn;
|
||||
use humhub\modules\admin\models\SpaceSearch;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/* @var $searchModel SpaceSearch*/
|
||||
?>
|
||||
|
||||
<?= Html::a('<i class="fa fa-plus" aria-hidden="true"></i> ' . Yii::t('AdminModule.space', 'Add new space'), ['/space/create'], ['class' => 'btn btn-sm btn-success pull-right', 'data-target' => '#globalModal']); ?>
|
||||
<?= ModalButton::success(Yii::t('AdminModule.space', 'Add new space'))->load(['/space/create'])
|
||||
->icon('add')->right()->sm() ?>
|
||||
|
||||
<h4><?= Yii::t('AdminModule.space', 'Overview'); ?></h4>
|
||||
<h4><?= Yii::t('AdminModule.space', 'Overview') ?></h4>
|
||||
<div class="help-block">
|
||||
<?= Yii::t('AdminModule.space', 'This overview contains a list of each space with actions to view, edit and delete spaces.'); ?>
|
||||
</div>
|
||||
|
@ -15,10 +15,10 @@ use yii\helpers\Url;
|
||||
|
||||
|
||||
<?= Button::success(Yii::t('AdminModule.user', 'Add new field'))
|
||||
->icon('plus')->sm()->link(Url::to(['edit-field', 'categoryId' => $category->id]))->right()->style('margin-left:5px') ?>
|
||||
->icon('add')->sm()->link(Url::to(['edit-field', 'categoryId' => $category->id]))->right()->style('margin-left:5px') ?>
|
||||
|
||||
<?= Button::primary(Yii::t('AdminModule.user', 'Edit category'))
|
||||
->icon('pencil')->sm()->link(Url::to(['edit-category', 'id' => $category->id]))->right() ?>
|
||||
->icon('edit')->sm()->link(Url::to(['edit-category', 'id' => $category->id]))->right() ?>
|
||||
|
||||
|
||||
<?= GridView::widget([
|
||||
@ -81,7 +81,7 @@ use yii\helpers\Url;
|
||||
},
|
||||
'update' => function ($url, $category) {
|
||||
/* @var $model ProfileField */
|
||||
return Button::primary()->icon('pencil')->link(Url::to(['edit-field', 'id' => $category->id]))->sm();
|
||||
return Button::primary()->icon('edit')->link(Url::to(['edit-field', 'id' => $category->id]))->sm();
|
||||
},
|
||||
],
|
||||
],
|
||||
|
@ -16,7 +16,7 @@ foreach (ProfileFieldCategory::find()->orderBy('sort_order')->all() as $category
|
||||
}
|
||||
|
||||
$categoryItems[] = [
|
||||
'label' => Icon::get('plus', [
|
||||
'label' => Icon::get('add', [
|
||||
'htmlOptions' => [
|
||||
'title' => Yii::t('AdminModule.user', 'Add new category'),
|
||||
'class' => 'tt'
|
||||
|
@ -1,20 +1,28 @@
|
||||
<?php
|
||||
|
||||
use humhub\libs\Html;
|
||||
use humhub\compat\HForm;
|
||||
use humhub\widgets\Button;
|
||||
use humhub\widgets\ModalButton;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $hForm HForm */
|
||||
?>
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="clearfix">
|
||||
|
||||
<div class="pull-right">
|
||||
<?= Html::backButton(['index'], ['label' => Yii::t('AdminModule.base', 'Back to overview')]); ?>
|
||||
<?= Html::a('<i class="fa fa-paper-plane" aria-hidden="true"></i> ' . Yii::t('AdminModule.user', 'Send invite'), ['/user/invite'], ['class' => 'btn btn-success', 'data-target' => '#globalModal']); ?>
|
||||
<?= Button::back(['index'], Yii::t('AdminModule.base', 'Back to overview'))
|
||||
->right(false) ?>
|
||||
|
||||
<?= ModalButton::success(Yii::t('AdminModule.user', 'Send invite'))
|
||||
->load(['/user/invite'])->icon('invite')->sm() ?>
|
||||
</div>
|
||||
|
||||
<h4 class="pull-left"><?= Yii::t('AdminModule.user', 'Add new user'); ?></h4>
|
||||
<h4 class="pull-left"><?= Yii::t('AdminModule.user', 'Add new user') ?></h4>
|
||||
</div>
|
||||
<br>
|
||||
<?php $form = \yii\widgets\ActiveForm::begin(['options' => ['data-ui-widget' => 'ui.form.TabbedForm', 'data-ui-init' => '']]); ?>
|
||||
<?= $hForm->render($form); ?>
|
||||
<?php \yii\widgets\ActiveForm::end(); ?>
|
||||
<?php $form = ActiveForm::begin(['options' => ['data-ui-widget' => 'ui.form.TabbedForm', 'data-ui-init' => '']]); ?>
|
||||
<?= $hForm->render($form); ?>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
|
@ -21,7 +21,7 @@ use yii\widgets\ActiveForm;
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="pull-right">
|
||||
<?= Html::a('<i class="fa fa-plus" aria-hidden="true"></i> ' . Yii::t('AdminModule.user', 'Add new user'), ['/admin/user/add'], ['class' => 'btn btn-success btn-sm', 'data-ui-loader' => '']); ?>
|
||||
<?= Button::success(Yii::t('AdminModule.user', 'Add new user'))->icon('add')->sm()->link(['/admin/user/add']) ?>
|
||||
<?= ExportButton::widget(['filter' => 'UserSearch']) ?>
|
||||
</div>
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
namespace humhub\modules\comment;
|
||||
|
||||
use humhub\modules\comment\models\Comment;
|
||||
use humhub\modules\comment\permissions\CreateComment;
|
||||
use humhub\modules\comment\notifications\NewComment;
|
||||
use humhub\modules\content\components\ContentActiveRecord;
|
||||
use humhub\modules\space\models\Space;
|
||||
use Yii;
|
||||
@ -56,18 +58,24 @@ class Module extends \humhub\components\Module
|
||||
public function getNotifications()
|
||||
{
|
||||
return [
|
||||
'humhub\modules\comment\notifications\NewComment'
|
||||
NewComment::class
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given content object can be commented
|
||||
* Checks if given content object can be commented by current user
|
||||
*
|
||||
* @param Comment|ContentActiveRecord $object
|
||||
* @return boolean can comment
|
||||
* @throws \yii\base\Exception
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function canComment($object)
|
||||
{
|
||||
if(Yii::$app->user->isGuest) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only allow one level of subcomments
|
||||
if ($object instanceof Comment && $object->object_model === Comment::class) {
|
||||
return false;
|
||||
@ -77,7 +85,7 @@ class Module extends \humhub\components\Module
|
||||
|
||||
if ($content->container instanceof Space) {
|
||||
$space = $content->container;
|
||||
if (!$space->permissionManager->can(new permissions\CreateComment())) {
|
||||
if (!$space->permissionManager->can(CreateComment::class)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -8,21 +8,23 @@
|
||||
|
||||
namespace humhub\modules\comment\controllers;
|
||||
|
||||
use humhub\components\access\ControllerAccess;
|
||||
use humhub\components\Controller;
|
||||
use humhub\libs\Helpers;
|
||||
use humhub\modules\comment\models\forms\CommentForm;
|
||||
use humhub\modules\comment\Module;
|
||||
use humhub\modules\comment\widgets\Form;
|
||||
use humhub\modules\content\components\ContentActiveRecord;
|
||||
use humhub\modules\content\models\Content;
|
||||
use Yii;
|
||||
use yii\data\Pagination;
|
||||
use yii\web\HttpException;
|
||||
use yii\helpers\Url;
|
||||
use humhub\components\behaviors\AccessControl;
|
||||
use humhub\modules\comment\models\Comment;
|
||||
use humhub\modules\comment\widgets\Comment as CommentWidget;
|
||||
use humhub\modules\comment\widgets\ShowMore;
|
||||
use yii\web\BadRequestHttpException;
|
||||
use yii\web\ForbiddenHttpException;
|
||||
use yii\web\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* CommentController provides all comment related actions.
|
||||
@ -33,58 +35,40 @@ use yii\web\ForbiddenHttpException;
|
||||
*/
|
||||
class CommentController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
* @return array
|
||||
*/
|
||||
public function behaviors()
|
||||
public function getAccessRules()
|
||||
{
|
||||
return [
|
||||
'acl' => [
|
||||
'class' => AccessControl::class,
|
||||
'guestAllowedActions' => ['show']
|
||||
],
|
||||
'verbs' => [
|
||||
'class' => \yii\filters\VerbFilter::class,
|
||||
'actions' => [
|
||||
'post' => ['POST'],
|
||||
],
|
||||
],
|
||||
[ControllerAccess::RULE_LOGGED_IN_ONLY => ['post', 'edit', 'delete']],
|
||||
[ControllerAccess::RULE_POST => ['post']],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @var Comment|ContentActiveRecord The model to comment
|
||||
*/
|
||||
public $target;
|
||||
|
||||
|
||||
/**
|
||||
* @var Content
|
||||
*/
|
||||
public $content;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function beforeAction($action)
|
||||
{
|
||||
$modelClass = Yii::$app->request->get('objectModel', Yii::$app->request->post('objectModel'));
|
||||
$modelPk = (int)Yii::$app->request->get('objectId', Yii::$app->request->post('objectId'));
|
||||
$modelPk = (int) Yii::$app->request->get('objectId', Yii::$app->request->post('objectId'));
|
||||
|
||||
Helpers::CheckClassType($modelClass, [Comment::class, ContentActiveRecord::class]);
|
||||
$this->target = $modelClass::findOne(['id' => $modelPk]);
|
||||
|
||||
if ($this->target === null) {
|
||||
throw new HttpException(500, 'Could not find underlying content or content addon record!');
|
||||
if (!$this->target) {
|
||||
throw new NotFoundHttpException('Could not find underlying content or content addon record!');
|
||||
}
|
||||
|
||||
$this->content = $this->target->content;
|
||||
|
||||
if (!$this->content->canView()) {
|
||||
throw new HttpException(403, 'Access denied!');
|
||||
if (!$this->target->content->canView()) {
|
||||
throw new ForbiddenHttpException();
|
||||
}
|
||||
|
||||
return parent::beforeAction($action);
|
||||
@ -96,6 +80,8 @@ class CommentController extends Controller
|
||||
*/
|
||||
public function actionShow()
|
||||
{
|
||||
//TODO: Dont use query logic in controller layer...
|
||||
|
||||
$query = Comment::find();
|
||||
$query->orderBy('created_at DESC');
|
||||
$query->where(['object_model' => get_class($this->target), 'object_id' => $this->target->getPrimaryKey()]);
|
||||
@ -113,8 +99,8 @@ class CommentController extends Controller
|
||||
$output .= CommentWidget::widget(['comment' => $comment]);
|
||||
}
|
||||
|
||||
if (Yii::$app->request->get('mode') == 'popup') {
|
||||
return $this->renderAjax('showPopup', ['object' => $this->target, 'output' => $output, 'id' => $this->content->getUniqueId()]);
|
||||
if (Yii::$app->request->get('mode') === 'popup') {
|
||||
return $this->renderAjax('showPopup', ['object' => $this->target, 'output' => $output, 'id' => $this->target->content->getUniqueId()]);
|
||||
} else {
|
||||
return $this->renderAjaxContent($output);
|
||||
}
|
||||
@ -125,54 +111,54 @@ class CommentController extends Controller
|
||||
*/
|
||||
public function actionPost()
|
||||
{
|
||||
if (Yii::$app->user->isGuest || !$this->module->canComment($this->target)) {
|
||||
throw new ForbiddenHttpException(Yii::t('CommentModule.base', 'You are not allowed to comment.'));
|
||||
if (!$this->module->canComment($this->target)) {
|
||||
throw new ForbiddenHttpException();
|
||||
}
|
||||
|
||||
return Comment::getDb()->transaction(function ($db) {
|
||||
$message = Yii::$app->request->post('message');
|
||||
$files = Yii::$app->request->post('fileList');
|
||||
|
||||
if (empty(trim($message)) && empty($files)) {
|
||||
throw new BadRequestHttpException(Yii::t('CommentModule.base', 'The comment must not be empty!'));
|
||||
$form = new CommentForm($this->target);
|
||||
|
||||
if ($form->load(Yii::$app->request->post()) && $form->save()) {
|
||||
return $this->renderAjaxContent(CommentWidget::widget(['comment' => $form->comment]));
|
||||
}
|
||||
|
||||
$comment = new Comment(['message' => $message]);
|
||||
$comment->setPolyMorphicRelation($this->target);
|
||||
$comment->save();
|
||||
$comment->fileManager->attach($files);
|
||||
Yii::$app->response->statusCode = 400;
|
||||
|
||||
// Reload comment to get populated created_at field
|
||||
$comment->refresh();
|
||||
|
||||
return $this->renderAjaxContent(CommentWidget::widget(['comment' => $comment]));
|
||||
return $this->renderAjaxContent(Form::widget([
|
||||
'object' => $this->target,
|
||||
'model' => $form->comment
|
||||
]));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function actionEdit()
|
||||
public function actionEdit($id)
|
||||
{
|
||||
$comment = Comment::findOne(['id' => Yii::$app->request->get('id')]);
|
||||
$comment = $this->getComment($id);
|
||||
|
||||
if (!$comment->canEdit()) {
|
||||
throw new HttpException(403, Yii::t('CommentModule.base', 'Access denied!'));
|
||||
throw new ForbiddenHttpException();
|
||||
}
|
||||
|
||||
if ($comment->load(Yii::$app->request->post()) && $comment->save()) {
|
||||
|
||||
// Reload comment to get populated updated_at field
|
||||
$comment = Comment::findOne(['id' => $comment->id]);
|
||||
$form = new CommentForm($this->target, $comment);
|
||||
|
||||
if ($form->load(Yii::$app->request->post()) && $form->save()) {
|
||||
return $this->renderAjaxContent(CommentWidget::widget([
|
||||
'comment' => $comment,
|
||||
'comment' => $form->comment,
|
||||
'justEdited' => true
|
||||
]));
|
||||
} else if (Yii::$app->request->post()) {
|
||||
}
|
||||
|
||||
if (Yii::$app->request->post()) {
|
||||
Yii::$app->response->statusCode = 400;
|
||||
}
|
||||
|
||||
$submitUrl = Url::to(['/comment/comment/edit',
|
||||
'id' => $comment->id, 'objectModel' => $comment->object_model, 'objectId' => $comment->object_id]);
|
||||
'id' => $comment->id,
|
||||
'objectModel' => $comment->object_model,
|
||||
'objectId' => $comment->object_id
|
||||
]);
|
||||
|
||||
return $this->renderAjax('edit', [
|
||||
'comment' => $comment,
|
||||
@ -182,28 +168,61 @@ class CommentController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function actionLoad()
|
||||
/**
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws ForbiddenHttpException
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionLoad($id)
|
||||
{
|
||||
$comment = Comment::findOne(['id' => Yii::$app->request->get('id')]);
|
||||
$comment = $this->getComment($id);
|
||||
|
||||
if (!$comment->canRead()) {
|
||||
throw new HttpException(403, Yii::t('CommentModule.base', 'Access denied!'));
|
||||
throw new ForbiddenHttpException();
|
||||
}
|
||||
|
||||
return $this->renderAjaxContent(CommentWidget::widget(['comment' => $comment]));
|
||||
}
|
||||
|
||||
public function actionDelete()
|
||||
/**
|
||||
* @param $id
|
||||
* @return \yii\web\Response
|
||||
* @throws ForbiddenHttpException
|
||||
* @throws HttpException
|
||||
* @throws NotFoundHttpException
|
||||
* @throws \Throwable
|
||||
* @throws \yii\db\StaleObjectException
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->forcePostRequest();
|
||||
|
||||
$comment = Comment::findOne(['id' => Yii::$app->request->get('id')]);
|
||||
if ($comment !== null && $comment->canDelete()) {
|
||||
$comment->delete();
|
||||
return $this->asJson(['success' => true]);
|
||||
} else {
|
||||
throw new HttpException(500, Yii::t('CommentModule.base', 'Insufficent permissions!'));
|
||||
$comment = $this->getComment($id);
|
||||
|
||||
if(!$comment->canDelete()) {
|
||||
throw new ForbiddenHttpException();
|
||||
}
|
||||
|
||||
$comment->delete();
|
||||
|
||||
return $this->asJson(['success' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return Comment
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
private function getComment($id)
|
||||
{
|
||||
$comment = Comment::findOne(['id' => $id]);
|
||||
|
||||
if(!$comment) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
return $comment;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Premisos insuficients!',
|
||||
'Read full comment...' => 'Leyer tot o comentario',
|
||||
'Send' => 'Ninviar',
|
||||
'Show all {total} comments.' => 'Veyer totz os {total} comentarios.',
|
||||
'Show all {total} comments' => 'Veyer totz os {total} comentarios',
|
||||
'Show {count} more comments' => 'Veyer {count} comentarios mas',
|
||||
'Whenever a new comment was written.' => 'Quan un comentario s\'ha publicau.',
|
||||
'Write a new comment...' => 'Escribir un nuevo comentario...',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'ليست لديك الصلاحيات اللازمة!',
|
||||
'Read full comment...' => 'قراءة التعليق الكامل ...',
|
||||
'Send' => 'ارسل',
|
||||
'Show all {total} comments.' => 'عرض كل الـ {total} رداً',
|
||||
'Show all {total} comments' => 'عرض كل الـ {total} رداً',
|
||||
'Show {count} more comments' => 'عرض المزيد من الردود {count}',
|
||||
'The comment must not be empty!' => 'يجب ألا يكون التعليق فارغًا!',
|
||||
'Whenever a new comment was written.' => 'كلما تم كتابة تعليق جديد.',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Insufficent permissions!' => 'No tens suficients privilegis!',
|
||||
'Read full comment...' => 'Llegir el comentari sencer',
|
||||
'Send' => 'Envia',
|
||||
'Show all {total} comments.' => 'Mostra tots els {total} comentaris.',
|
||||
'Show all {total} comments' => 'Mostra tots els {total} comentaris',
|
||||
'Show {count} more comments' => 'Vore els següents {count} comentaris',
|
||||
'Whenever a new comment was written.' => 'Un nou comentari per sempre fou escrit',
|
||||
'Write a new comment...' => 'Escriu un nou comentari...',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Nedostatečná oprávnění!',
|
||||
'Read full comment...' => 'Přečíst celý komentář',
|
||||
'Send' => 'Odeslat',
|
||||
'Show all {total} comments.' => 'Zobrazit všech {total} komentářů.',
|
||||
'Show all {total} comments' => 'Zobrazit všech {total} komentářů',
|
||||
'Show {count} more comments' => 'Zobrazit dalších {count} komentářů',
|
||||
'Whenever a new comment was written.' => 'Kdykoli byl napsán nový komentář.',
|
||||
'Write a new comment...' => 'Napište komentář...',
|
||||
|
@ -30,7 +30,7 @@ return [
|
||||
'Insufficent permissions!' => 'Manglende adgang',
|
||||
'Read full comment...' => 'Læs fuld kommentar...',
|
||||
'Send' => 'Send',
|
||||
'Show all {total} comments.' => 'Vis alle {total} kommentarer.',
|
||||
'Show all {total} comments' => 'Vis alle {total} kommentarer',
|
||||
'Show {count} more comments' => 'Vis {count} yderligere kommentarer',
|
||||
'The comment must not be empty!' => 'Kommentaren må ikke være tom!',
|
||||
'Whenever a new comment was written.' => 'Når som helst en ny kommentar blev skrevet.',
|
||||
|
@ -15,7 +15,7 @@ return array (
|
||||
'Read full comment...' => 'Ganzen Kommentar lesen ...',
|
||||
'Reply' => 'Antworten',
|
||||
'Send' => 'Senden',
|
||||
'Show all {total} comments.' => 'Zeige alle {total} Kommentare.',
|
||||
'Show all {total} comments' => 'Zeige alle {total} Kommentare',
|
||||
'Show {count} more comments' => 'Zeige {count} weitere Kommentare',
|
||||
'The comment must not be empty!' => 'Der Kommentar darf nicht leer sein!',
|
||||
'Whenever a new comment was written.' => 'Immer, wenn ein neuer Kommentar geschrieben wurde.',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Ανεπαρκή δικαιώματα!',
|
||||
'Read full comment...' => 'Διαβάστε το πλήρες σχόλιο ...',
|
||||
'Send' => 'Στείλε',
|
||||
'Show all {total} comments.' => 'Εμφάνιση όλων των {total} σχολίων.',
|
||||
'Show all {total} comments' => 'Εμφάνιση όλων των {total} σχολίων',
|
||||
'Show {count} more comments' => 'Εμφάνιση {count} επιπλέον σχολίων',
|
||||
'The comment must not be empty!' => 'Το σχόλιο δεν πρέπει να είναι κενό!',
|
||||
'Whenever a new comment was written.' => 'Κάθε φορά που γράφετε ένα νέο σχόλιο.',
|
||||
|
@ -15,7 +15,7 @@ return array (
|
||||
'Read full comment...' => 'Leer el comentario completo...',
|
||||
'Reply' => 'Responder',
|
||||
'Send' => 'Enviar',
|
||||
'Show all {total} comments.' => 'Ver los {total} comentarios.',
|
||||
'Show all {total} comments' => 'Ver los {total} comentarios',
|
||||
'Show {count} more comments' => 'Mostrar {count} comentarios más',
|
||||
'The comment must not be empty!' => '¡El comentario no debe estar vacío!',
|
||||
'Whenever a new comment was written.' => 'Cuando un nuevo comentario sea escrito.',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'مجوز ناکافی!',
|
||||
'Read full comment...' => 'خواندن همهی دیدگاه...',
|
||||
'Send' => 'فرستادن',
|
||||
'Show all {total} comments.' => 'نمایش همهی {total} دیدگاه.',
|
||||
'Show all {total} comments' => 'نمایش همهی {total} دیدگاه.',
|
||||
'Show {count} more comments' => 'نمایش {count} دیدگاه بیشتر',
|
||||
'The comment must not be empty!' => 'دیدگاه نباید خالی باشد!',
|
||||
'Whenever a new comment was written.' => 'هرگاه که یک دیدگاه تازه نوشته شد.',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Ei lupaa!',
|
||||
'Read full comment...' => 'Lue koko kommentti',
|
||||
'Send' => 'Lähetä',
|
||||
'Show all {total} comments.' => 'Näytä kaikki {total} kommenttia.',
|
||||
'Show all {total} comments' => 'Näytä kaikki {total} kommenttia.',
|
||||
'Show {count} more comments' => 'Näytä {count} lisää',
|
||||
'The comment must not be empty!' => 'Komenttikenttä ei voi olla tyhjä!',
|
||||
'Whenever a new comment was written.' => 'Aina kun uusi kommentti kirjoitettaan.',
|
||||
|
@ -15,7 +15,7 @@ return array (
|
||||
'Read full comment...' => 'Lire le commentaire complet...',
|
||||
'Reply' => 'Répondre',
|
||||
'Send' => 'Envoyer',
|
||||
'Show all {total} comments.' => 'Afficher les commentaires précédents',
|
||||
'Show all {total} comments' => 'Afficher les commentaires précédents',
|
||||
'Show {count} more comments' => 'Afficher {count,plural,=1{le commentaire restant} other{# autres commentaires}}',
|
||||
'The comment must not be empty!' => 'Le commentaire ne doit pas être vide !',
|
||||
'Whenever a new comment was written.' => 'Chaque fois qu\'un nouveau commentaire a été écrit.',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Nedovoljno dopuštenje!',
|
||||
'Read full comment...' => 'Pročitaj sve..',
|
||||
'Send' => 'Pošalji',
|
||||
'Show all {total} comments.' => 'Prikaži sve {total} komentare.',
|
||||
'Show all {total} comments' => 'Prikaži sve {total} komentare',
|
||||
'Show {count} more comments' => 'Prikaži {count} više komentara',
|
||||
'Whenever a new comment was written.' => 'Kad god je napisan novi komentar.',
|
||||
'Write a new comment...' => 'Napiši novi komentar...',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Elégtelen jogosultságok!',
|
||||
'Read full comment...' => 'Az egész hozzászólás megtekintése...',
|
||||
'Send' => 'Mehet',
|
||||
'Show all {total} comments.' => 'Mind a(z) {total} hozzászólás megtekintése.',
|
||||
'Show all {total} comments' => 'Mind a(z) {total} hozzászólás megtekintése',
|
||||
'Show {count} more comments' => 'Még {count} hozzászólás megjelenítése',
|
||||
'The comment must not be empty!' => 'A hozzászólás nem lehet üres!',
|
||||
'Whenever a new comment was written.' => 'Amikor új hozzászólás érkezik.',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Izin tidak memadai!',
|
||||
'Read full comment...' => 'Baca full komentar..',
|
||||
'Send' => 'Kirim',
|
||||
'Show all {total} comments.' => 'Lihat semua {total} komentar.',
|
||||
'Show all {total} comments' => 'Lihat semua {total} komentar',
|
||||
'Show {count} more comments' => 'Lihat {count} komentar lainnya',
|
||||
'The comment must not be empty!' => 'Komentar tidak boleh kosong',
|
||||
'Whenever a new comment was written.' => 'Kapanpun sebuah komentar baru telah ditulis',
|
||||
|
@ -15,7 +15,7 @@ return array (
|
||||
'Read full comment...' => 'Leggi il commento completo...',
|
||||
'Reply' => 'Rispondi',
|
||||
'Send' => 'Invia',
|
||||
'Show all {total} comments.' => 'Mostra tutti i {total} commenti.',
|
||||
'Show all {total} comments' => 'Mostra tutti i {total} commenti',
|
||||
'Show {count} more comments' => 'Mostra altri {count} commenti',
|
||||
'The comment must not be empty!' => 'Il commento non può essere vuoto!',
|
||||
'Whenever a new comment was written.' => 'Ogni volta che è stato scritto un nuovo commento.',
|
||||
|
@ -26,7 +26,7 @@ return [
|
||||
'Edit' => '編集',
|
||||
'Insufficent permissions!' => '権限が不十分です!',
|
||||
'Send' => '送信',
|
||||
'Show all {total} comments.' => '合計{total}コメントを、すべて表示します。',
|
||||
'Show all {total} comments' => '合計{total}コメントを、すべて表示します。',
|
||||
'Write a new comment...' => '新規コメントを書く...',
|
||||
'comment' => 'コメント',
|
||||
'{displayName} wrote a new comment ' => '{displayName}さんが新しいコメントを書きました ',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -28,7 +28,7 @@ return [
|
||||
'Edit your comment...' => 'Redaguokite komentarą...',
|
||||
'Insufficent permissions!' => 'Neturite reikalingų leidimų!',
|
||||
'Send' => 'Išsiųsti',
|
||||
'Show all {total} comments.' => 'Rodyti visus {total} komentarus.',
|
||||
'Show all {total} comments' => 'Rodyti visus {total} komentarus',
|
||||
'Show {count} more comments' => 'Rodyti {count} daugiau komentarų',
|
||||
'Write a new comment...' => 'Parašykite naują komentarą...',
|
||||
'comment' => 'Komentaras',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Nepietiekamas tiesības!',
|
||||
'Read full comment...' => 'Lasīt visu komentāru...',
|
||||
'Send' => 'Sūtīt',
|
||||
'Show all {total} comments.' => 'Rādīt visus {total} komentārus.',
|
||||
'Show all {total} comments' => 'Rādīt visus {total} komentārus',
|
||||
'Show {count} more comments' => 'Rādīt vēl {count} komentārus',
|
||||
'Whenever a new comment was written.' => 'Ikreiz, kad jauns komentārs tika uzrakstīts.',
|
||||
'Write a new comment...' => 'Rakstīt jaunu komentāru...',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Manglende tillatelse.',
|
||||
'Read full comment...' => 'Les hele kommentaren...',
|
||||
'Send' => 'Send',
|
||||
'Show all {total} comments.' => 'Vis alle {total} kommentarer.',
|
||||
'Show all {total} comments' => 'Vis alle {total} kommentarer',
|
||||
'Show {count} more comments' => 'Vis {count} flere kommentarer',
|
||||
'The comment must not be empty!' => 'Kommentaren kan ikke være tom.',
|
||||
'Whenever a new comment was written.' => 'når noen skriver en kommentar i en av dine grupper',
|
||||
|
@ -15,7 +15,7 @@ return array (
|
||||
'Read full comment...' => 'Lees het volledige bericht...',
|
||||
'Reply' => 'Antwoord',
|
||||
'Send' => 'Verstuur',
|
||||
'Show all {total} comments.' => 'Toon alle {total} reacties.',
|
||||
'Show all {total} comments' => 'Toon alle {total} reacties',
|
||||
'Show {count} more comments' => 'Toon nog {count} reacties',
|
||||
'The comment must not be empty!' => 'De opmerking mag niet leeg zijn!',
|
||||
'Whenever a new comment was written.' => 'Wanneer er een nieuwe reactie is geschreven.',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
<<<<<<< HEAD
|
||||
return array (
|
||||
'<strong>Confirm</strong> comment deleting' => '<strong>Potwierdź</strong> usunięcie komentarza',
|
||||
'Access denied!' => 'Odmowa dostępu!',
|
||||
@ -25,3 +26,48 @@ return array (
|
||||
'comment' => 'Komentarz',
|
||||
'{displayName} wrote a new comment ' => '{displayName} napisał(a) nowy komentarz',
|
||||
);
|
||||
=======
|
||||
/**
|
||||
* Message translations.
|
||||
*
|
||||
* This file is automatically generated by 'yii message/extract' command.
|
||||
* It contains the localizable messages extracted from source code.
|
||||
* You may modify this file by translating the extracted messages.
|
||||
*
|
||||
* Each array element represents the translation (value) of a message (key).
|
||||
* If the value is empty, the message is considered as not translated.
|
||||
* Messages that no longer need translation will have their translations
|
||||
* enclosed between a pair of '@@' marks.
|
||||
*
|
||||
* Message string can be used with plural forms format. Check i18n section
|
||||
* of the guide for details.
|
||||
*
|
||||
* NOTE: this file must be saved in UTF-8 encoding.
|
||||
*/
|
||||
return [
|
||||
'<strong>Confirm</strong> comment deleting' => '<strong>Potwierdź</strong> usunięcie komentarza',
|
||||
'Access denied!' => 'Odmowa dostępu!',
|
||||
'Cancel' => 'Anuluj',
|
||||
'Cancel Edit' => 'Anuluj Edycję',
|
||||
'Comment' => 'Komentuj ',
|
||||
'Comment has been deleted' => 'Komentarz został usunięty',
|
||||
'Comments' => 'Komentarze ',
|
||||
'Delete' => 'Usuń',
|
||||
'Do you really want to delete this comment?' => 'Czy naprawdę chcesz usunąć ten komentarz?',
|
||||
'Edit' => 'Edytuj',
|
||||
'Edit your comment...' => 'Edytuj swój komentarz... ',
|
||||
'Insufficent permissions!' => 'Uprawnienia niedostateczne!',
|
||||
'Read full comment...' => 'Przeczytał cały komentarz...',
|
||||
'Send' => 'Wyślij',
|
||||
'Show all {total} comments' => 'Pokaż wszystkie {total} komentarze',
|
||||
'Show {count} more comments' => 'Pokaż {count} kolejnych komentarzy',
|
||||
'The comment must not be empty!' => 'Komentarz nie może być pusty!',
|
||||
'Whenever a new comment was written.' => 'Za każdym razem gdy zostanie napisany nowy komentarz.',
|
||||
'Write a new comment...' => 'Napisz nowy komentarz... ',
|
||||
'You are not allowed to comment.' => 'Nie jesteś uprawniony do komentowania.',
|
||||
'comment' => 'Komentarz ',
|
||||
'{displayName} wrote a new comment ' => '{displayName} napisał(a) nowy komentarz ',
|
||||
'Reply' => '',
|
||||
'Write a new reply...' => '',
|
||||
];
|
||||
>>>>>>> 440368890f445d06de6e14c99061b5e86ce98eb4
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Permissões insuficientes!',
|
||||
'Read full comment...' => 'Ler o comentário completo...',
|
||||
'Send' => 'Enviar',
|
||||
'Show all {total} comments.' => 'Mostrar todos {total} comentários.',
|
||||
'Show all {total} comments' => 'Mostrar todos {total} comentários',
|
||||
'Show {count} more comments' => 'Mostrar mais {count} comentários',
|
||||
'The comment must not be empty!' => 'O comentário não deve estar vazio!',
|
||||
'Whenever a new comment was written.' => 'Sempre que um novo comentário foi escrito.',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Permisiuni insuficiente!',
|
||||
'Read full comment...' => 'Citește tot comentariul...',
|
||||
'Send' => 'Trimite',
|
||||
'Show all {total} comments.' => 'Afișează toate cele {total} comentarii.',
|
||||
'Show all {total} comments' => 'Afișează toate cele {total} comentarii',
|
||||
'Show {count} more comments' => 'Afișează încă {count} comentarii',
|
||||
'The comment must not be empty!' => 'Comentariul nu poate fi gol!',
|
||||
'Whenever a new comment was written.' => 'Oricând un comentariu a fost scris.',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Недостаточно прав!',
|
||||
'Read full comment...' => 'Прочитать комментарий полностью...',
|
||||
'Send' => 'Отправить',
|
||||
'Show all {total} comments.' => 'Показать все комментарии в количестве {total} штук',
|
||||
'Show all {total} comments' => 'Показать все комментарии в количестве {total} штук',
|
||||
'Show {count} more comments' => 'Показать {count} комментариев',
|
||||
'The comment must not be empty!' => 'Комментарий не должен быть пустым!',
|
||||
'Whenever a new comment was written.' => 'Всякий раз, когда был написан новый комментарий.',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Otillräckliga rättigheter!',
|
||||
'Read full comment...' => 'Läs hela kommentaren...',
|
||||
'Send' => 'Skicka',
|
||||
'Show all {total} comments.' => 'Visa alla {total} kommentarer.',
|
||||
'Show all {total} comments' => 'Visa alla {total} kommentarer',
|
||||
'Show {count} more comments' => 'Visa {count} fler kommentarer',
|
||||
'The comment must not be empty!' => 'Kommentaren kan inte vara tom!',
|
||||
'Whenever a new comment was written.' => 'När en kommentar var skriven.',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Yetersiz izinler!',
|
||||
'Read full comment...' => 'Yorumu tam okuyun ...',
|
||||
'Send' => 'Gönder',
|
||||
'Show all {total} comments.' => '{total} diğer yorumu gör',
|
||||
'Show all {total} comments' => '{total} diğer yorumu gör',
|
||||
'Show {count} more comments' => 'Daha {count} fazla yorum göster',
|
||||
'The comment must not be empty!' => 'Yorum boş olmamalı!',
|
||||
'Whenever a new comment was written.' => 'Ne zaman yeni bir yorum yazılmış',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => 'Không đủ quyền!',
|
||||
'Read full comment...' => 'Đọc toàn bộ nội dung comment...',
|
||||
'Send' => 'Gửi',
|
||||
'Show all {total} comments.' => 'Hiển thị toàn bộ {total} comments.',
|
||||
'Show all {total} comments' => 'Hiển thị toàn bộ {total} comments',
|
||||
'Show {count} more comments' => 'Hiển thị thêm {count} comments',
|
||||
'The comment must not be empty!' => 'Bình luận không được phép rỗng!',
|
||||
'Whenever a new comment was written.' => 'Bất kể khi nào một comment mới được viết',
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
'Insufficent permissions!' => '权限不足!',
|
||||
'Read full comment...' => '阅读完整的评论...',
|
||||
'Send' => '发 送',
|
||||
'Show all {total} comments.' => '显示所有 {total} 条评论',
|
||||
'Show all {total} comments' => '显示所有 {total} 条评论',
|
||||
'Show {count} more comments' => '再展示 {count} 条评论',
|
||||
'Whenever a new comment was written.' => '每当一个新的评论被书写',
|
||||
'Write a new comment...' => '写新评论...',
|
||||
|
@ -32,7 +32,7 @@ return [
|
||||
'Read full comment...' => '',
|
||||
'Reply' => '',
|
||||
'Send' => '',
|
||||
'Show all {total} comments.' => '',
|
||||
'Show all {total} comments' => '',
|
||||
'Show {count} more comments' => '',
|
||||
'The comment must not be empty!' => '',
|
||||
'Whenever a new comment was written.' => '',
|
||||
|
@ -57,7 +57,6 @@ class Comment extends ContentAddonActiveRecord implements ContentOwner
|
||||
{
|
||||
return [
|
||||
[['message'], 'safe'],
|
||||
[['message'], 'required'],
|
||||
];
|
||||
}
|
||||
|
||||
|
119
protected/humhub/modules/comment/models/forms/CommentForm.php
Normal file
119
protected/humhub/modules/comment/models/forms/CommentForm.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
namespace humhub\modules\comment\models\forms;
|
||||
|
||||
use humhub\modules\comment\models\Comment;
|
||||
use humhub\modules\content\components\ContentActiveRecord;
|
||||
use Yii;
|
||||
use yii\web\ServerErrorHttpException;
|
||||
|
||||
/**
|
||||
* CommentForm
|
||||
* @package humhub\modules\comment\models\forms
|
||||
*
|
||||
* @since 0.5
|
||||
*/
|
||||
class CommentForm extends yii\base\Model
|
||||
{
|
||||
/**
|
||||
* The list of files attached to a comment
|
||||
* @var array
|
||||
*/
|
||||
public $fileList;
|
||||
|
||||
/**
|
||||
* @var Comment The model to comment
|
||||
*/
|
||||
public $comment;
|
||||
|
||||
/**
|
||||
* @var Comment|ContentActiveRecord The model to comment or other active content
|
||||
*/
|
||||
public $target;
|
||||
|
||||
public function __construct($target, $comment = null)
|
||||
{
|
||||
$this->target = $target;
|
||||
$this->comment = $comment ?? new Comment();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array validation rules for model attributes.
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['fileList'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function load($data, $formName = null)
|
||||
{
|
||||
return parent::load($data, $formName) | $this->comment->load($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $attributeNames
|
||||
* @param bool $clearErrors
|
||||
* @return bool
|
||||
* @throws ServerErrorHttpException
|
||||
*/
|
||||
public function validate($attributeNames = null, $clearErrors = true)
|
||||
{
|
||||
if(!empty($attributeNames)) {
|
||||
return parent::validate($attributeNames, $clearErrors);
|
||||
}
|
||||
|
||||
if(!$this->comment->validate() || !parent::validate($attributeNames, $clearErrors)) {
|
||||
$this->comment->addError('message', Yii::t('CommentModule.base', 'Comment could not be saved!'));
|
||||
}
|
||||
|
||||
if (!empty($this->comment->message)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allow empty message only with file attachments
|
||||
if (!empty($this->fileList) || (!$this->comment->isNewRecord && $this->comment->fileManager->find()->count())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->comment->addError('message', Yii::t('CommentModule.base', 'The comment must not be empty!'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the form
|
||||
*
|
||||
* @return boolean
|
||||
* @throws ServerErrorHttpException
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
if(!$this->validate()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->comment->setPolyMorphicRelation($this->target);
|
||||
|
||||
//check if model saved
|
||||
if ($this->comment->save()) {
|
||||
$this->comment->fileManager->attach($this->fileList);
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->comment->addError('message', Yii::t('CommentModule.base', 'Comment could not be saved!'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function formName()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
@ -10,14 +10,21 @@ humhub.module('comment', function (module, require, $) {
|
||||
|
||||
Form.prototype.submit = function (evt) {
|
||||
var that = this;
|
||||
client.submit(evt, {dataType: 'html'}).then(function (response) {
|
||||
var richText = that.getRichtext();
|
||||
that.addComment(response.html);
|
||||
that.getInput().val('').trigger('autosize.resize');
|
||||
richText.$.trigger('clear');
|
||||
that.getUpload().reset();
|
||||
}).catch(function (err) {
|
||||
module.log.error(err, true);
|
||||
client.submit(evt, {dataType: 'html'}).status({
|
||||
200: function (response) {
|
||||
var richText = that.getRichtext();
|
||||
that.addComment(response.html);
|
||||
that.getInput().val('').trigger('autosize.resize');
|
||||
richText.$.trigger('clear');
|
||||
that.getUpload().reset();
|
||||
that.$.find('.form-group').removeClass('has-error');
|
||||
that.$.find('.help-block-error').html('');
|
||||
},
|
||||
400: function (response) {
|
||||
that.replace(response.html);
|
||||
}
|
||||
}).catch(function (e) {
|
||||
module.log.error(e, true);
|
||||
});
|
||||
};
|
||||
|
||||
@ -142,7 +149,6 @@ humhub.module('comment', function (module, require, $) {
|
||||
that.highlight();
|
||||
that.$.find('.comment-cancel-edit-link:first').hide();
|
||||
that.$.find('.comment-edit-link:first').show();
|
||||
module.log.success('success.saved');
|
||||
},
|
||||
400: function (response) {
|
||||
that.setEditContent(response.html);
|
||||
@ -252,6 +258,7 @@ humhub.module('comment', function (module, require, $) {
|
||||
if (visible && !evt.$target.children('.comment_create').is(':visible')) {
|
||||
evt.$target.children('.comment_create').slideToggle(undefined, function() {
|
||||
evt.$target.find('.humhub-ui-richtext').trigger('focus');
|
||||
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -264,8 +271,8 @@ humhub.module('comment', function (module, require, $) {
|
||||
|
||||
$form.show();
|
||||
|
||||
evt.$target.slideToggle(undefined, function() {
|
||||
evt.$target.find('.humhub-ui-richtext').trigger('focus');
|
||||
evt.$target.slideToggle('fast', function() {
|
||||
evt.$target.find('.humhub-ui-richtext:last').trigger('focus');
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -29,7 +29,7 @@ class CommentCest
|
||||
|
||||
$I->click('.btn-comment-submit', $commentSection);
|
||||
|
||||
$I->seeError('The comment must not be empty!');
|
||||
$I->waitForText('The comment must not be empty!',null, $commentSection);
|
||||
|
||||
$I->fillField($commentSection.' .humhub-ui-richtext[contenteditable]', 'Test comment');
|
||||
|
||||
@ -37,5 +37,6 @@ class CommentCest
|
||||
|
||||
$I->waitForElementVisible('#comment-message-1');
|
||||
$I->see('Test comment','#comment-message-1');
|
||||
$I->dontSee('The comment must not be empty!',null, $commentSection);
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ $contentModule = Yii::$app->getModule('content');
|
||||
<?= UploadButton::widget([
|
||||
'id' => 'comment_upload_' . $comment->id,
|
||||
'model' => $comment,
|
||||
'tooltip' => Yii::t('ContentModule.base', 'Attach Files'),
|
||||
'dropZone' => '#comment_' . $comment->id,
|
||||
'preview' => '#comment_upload_preview_' . $comment->id,
|
||||
'progress' => '#comment_upload_progress_' . $comment->id,
|
||||
|
@ -40,11 +40,6 @@ class Comment extends Widget
|
||||
$loadUrl = Url::to(['/comment/comment/load',
|
||||
'objectModel' => $this->comment->object_model, 'objectId' => $this->comment->object_id, 'id' => $this->comment->id]);
|
||||
|
||||
$updatedAt = null;
|
||||
if (!empty($this->comment->updated_at) && $this->comment->created_at != $this->comment->updated_at) {
|
||||
$updatedAt = $this->comment->updated_at;
|
||||
}
|
||||
|
||||
return $this->render('comment', [
|
||||
'comment' => $this->comment,
|
||||
'user' => $this->comment->user,
|
||||
@ -53,7 +48,6 @@ class Comment extends Widget
|
||||
'editUrl' => $editUrl,
|
||||
'loadUrl' => $loadUrl,
|
||||
'createdAt' => $this->comment->created_at,
|
||||
'updatedAt' => $updatedAt,
|
||||
'canEdit' => $this->comment->canEdit(),
|
||||
'canDelete' => $this->comment->canDelete(),
|
||||
]);
|
||||
|
@ -29,6 +29,11 @@ class Form extends Widget
|
||||
*/
|
||||
public $object;
|
||||
|
||||
/**
|
||||
* @var Comment|null can be provided if comment validation failed, otherwise a dummy model will be created
|
||||
*/
|
||||
public $model;
|
||||
|
||||
/**
|
||||
* Executes the widget.
|
||||
*/
|
||||
@ -45,10 +50,15 @@ class Form extends Widget
|
||||
return '';
|
||||
}
|
||||
|
||||
if(!$this->model) {
|
||||
$this->model = new CommentModel();
|
||||
}
|
||||
|
||||
return $this->render('form', [
|
||||
'objectModel' => get_class($this->object),
|
||||
'objectId' => $this->object->getPrimaryKey(),
|
||||
'id' => $this->object->getUniqueId(),
|
||||
'model' => $this->model,
|
||||
'isNestedComment' => ($this->object instanceof CommentModel)
|
||||
]);
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use humhub\libs\Html;
|
||||
use humhub\modules\content\widgets\UpdatedIcon;
|
||||
use humhub\modules\ui\icon\widgets\Icon;
|
||||
use humhub\widgets\TimeAgo;
|
||||
use humhub\modules\content\widgets\richtext\RichText;
|
||||
use humhub\modules\user\widgets\Image as UserImage;
|
||||
@ -37,7 +39,7 @@ $module = Yii::$app->getModule('comment');
|
||||
<li class="dropdown ">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#"
|
||||
aria-label="<?= Yii::t('base', 'Toggle comment menu'); ?>" aria-haspopup="true">
|
||||
<i class="fa fa-angle-down"></i>
|
||||
<?= Icon::get('dropdownToggle') ?>
|
||||
</a>
|
||||
|
||||
<ul class="dropdown-menu pull-right">
|
||||
@ -45,11 +47,11 @@ $module = Yii::$app->getModule('comment');
|
||||
<li>
|
||||
<a href="#" class="comment-edit-link" data-action-click="edit"
|
||||
data-action-url="<?= $editUrl ?>">
|
||||
<i class="fa fa-pencil"></i> <?= Yii::t('CommentModule.base', 'Edit') ?>
|
||||
<?= Icon::get('edit')?> <?= Yii::t('CommentModule.base', 'Edit') ?>
|
||||
</a>
|
||||
<a href="#" class="comment-cancel-edit-link" data-action-click="cancelEdit"
|
||||
data-action-url="<?= $loadUrl ?>" style="display:none;">
|
||||
<i class="fa fa-pencil"></i> <?= Yii::t('CommentModule.base', 'Cancel Edit') ?>
|
||||
<?= Icon::get('edit')?> <?= Yii::t('CommentModule.base', 'Cancel Edit') ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -57,7 +59,7 @@ $module = Yii::$app->getModule('comment');
|
||||
<?php if ($canDelete): ?>
|
||||
<li>
|
||||
<a href="#" data-action-click="delete">
|
||||
<i class="fa fa-trash-o"></i> <?= Yii::t('CommentModule.base', 'Delete') ?>
|
||||
<?= Icon::get('delete') ?> <?= Yii::t('CommentModule.base', 'Delete') ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -65,14 +67,14 @@ $module = Yii::$app->getModule('comment');
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?= UserImage::widget(['user' => $user, 'width' => 40, 'htmlOptions' => ['class' => 'pull-left', 'data-contentcontainer-id' => $user->contentcontainer_id]]); ?>
|
||||
<?= UserImage::widget(['user' => $user, 'width' => 25, 'htmlOptions' => ['class' => 'pull-left', 'data-contentcontainer-id' => $user->contentcontainer_id]]); ?>
|
||||
<div>
|
||||
<div class="media-body">
|
||||
<h4 class="media-heading"><?= Html::containerLink($user); ?>
|
||||
<small><?= TimeAgo::widget(['timestamp' => $createdAt]); ?>
|
||||
<?php if ($updatedAt !== null): ?>
|
||||
· <span class="tt"
|
||||
title="<?= Yii::$app->formatter->asDateTime($updatedAt); ?>"><?= Yii::t('ContentModule.base', 'Updated'); ?></span>
|
||||
<h4 class="media-heading">
|
||||
<?= Html::containerLink($user) ?>
|
||||
<small>· <?= TimeAgo::widget(['timestamp' => $createdAt]) ?>
|
||||
<?php if ($comment->isUpdated()): ?>
|
||||
· <?= UpdatedIcon::getByDated($comment->updated_at) ?>
|
||||
<?php endif; ?>
|
||||
</small>
|
||||
</h4>
|
||||
@ -93,7 +95,7 @@ $module = Yii::$app->getModule('comment');
|
||||
<?= LikeLink::widget(['object' => $comment]); ?>
|
||||
</div>
|
||||
|
||||
<div class="nested-comments-root" style="margin-left:42px">
|
||||
<div class="nested-comments-root">
|
||||
<?= Comments::widget(['object' => $comment]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -22,7 +22,7 @@ use humhub\libs\Html;
|
||||
<?php if ($isLimited): ?>
|
||||
<a href="#" class="show show-all-link" data-ui-loader data-action-click="comment.showAll"
|
||||
data-action-url="<?= Url::to(['/comment/comment/show', 'objectModel' => $objectModel, 'objectId' => $objectId]) ?>">
|
||||
<?= Yii::t('CommentModule.base', 'Show all {total} comments.', ['{total}' => $total]) ?>
|
||||
<?= Yii::t('CommentModule.base', 'Show all {total} comments', ['{total}' => $total]) ?>
|
||||
</a>
|
||||
<hr class="comments-start-separator">
|
||||
<?php endif; ?>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user