mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 06:08:21 +01:00
Small cleanup.
This commit is contained in:
parent
7556625914
commit
41d5ad4408
@ -36,6 +36,16 @@ class CoreApiAsset extends AssetBundle
|
|||||||
*/
|
*/
|
||||||
public $jsOptions = ['position' => \yii\web\View::POS_HEAD];
|
public $jsOptions = ['position' => \yii\web\View::POS_HEAD];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
public $depends = [
|
||||||
|
'yii\web\YiiAsset',
|
||||||
|
'yii\bootstrap\BootstrapAsset',
|
||||||
|
'yii\bootstrap\BootstrapPluginAsset',
|
||||||
|
'humhub\assets\BluebirdAsset',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
@ -60,19 +70,10 @@ class CoreApiAsset extends AssetBundle
|
|||||||
'js/humhub/humhub.ui.gallery.js',
|
'js/humhub/humhub.ui.gallery.js',
|
||||||
'js/humhub/humhub.ui.picker.js',
|
'js/humhub/humhub.ui.picker.js',
|
||||||
'js/humhub/humhub.ui.richtext.js',
|
'js/humhub/humhub.ui.richtext.js',
|
||||||
|
'js/humhub/humhub.ui.markdown.js',
|
||||||
'js/humhub/humhub.media.Jplayer.js',
|
'js/humhub/humhub.media.Jplayer.js',
|
||||||
// Note this should stay at last for other click event listeners beeing able to prevent pjax handling (e.g gallery)
|
// Note this should stay at last for other click event listeners beeing able to prevent pjax handling (e.g gallery)
|
||||||
'js/humhub/humhub.client.pjax.js',
|
'js/humhub/humhub.client.pjax.js',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
public $depends = [
|
|
||||||
'yii\web\YiiAsset',
|
|
||||||
'yii\bootstrap\BootstrapAsset',
|
|
||||||
'yii\bootstrap\BootstrapPluginAsset',
|
|
||||||
'humhub\assets\BluebirdAsset',
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,15 @@ class Formatter extends \yii\i18n\Formatter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the date pattern for the given $locale and $dateType, $timeType.
|
||||||
|
*
|
||||||
|
* @since 1.2.2
|
||||||
|
* @param int $dateType
|
||||||
|
* @param int $timeType
|
||||||
|
* @param null $locale
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
public function getDateTimePattern($dateType = IntlDateFormatter::SHORT, $timeType = IntlDateFormatter::SHORT, $locale = null) {
|
public function getDateTimePattern($dateType = IntlDateFormatter::SHORT, $timeType = IntlDateFormatter::SHORT, $locale = null) {
|
||||||
if(extension_loaded('intl')) {
|
if(extension_loaded('intl')) {
|
||||||
$locale = empty($locale) ? $this->locale : $locale;
|
$locale = empty($locale) ? $this->locale : $locale;
|
||||||
@ -55,6 +64,7 @@ class Formatter extends \yii\i18n\Formatter
|
|||||||
* Checks if the time pattern of a given $locale contains a meridiem (AM/PM).
|
* Checks if the time pattern of a given $locale contains a meridiem (AM/PM).
|
||||||
* If no $locale is provided the Formatter locale will be used.
|
* If no $locale is provided the Formatter locale will be used.
|
||||||
*
|
*
|
||||||
|
* @since 1.2.2
|
||||||
* @param null $locale
|
* @param null $locale
|
||||||
* @return bool if the locale uses a 12 hour (AM/PM) otherwise a 24 hour time format is used.
|
* @return bool if the locale uses a 12 hour (AM/PM) otherwise a 24 hour time format is used.
|
||||||
*/
|
*/
|
||||||
|
@ -29,6 +29,7 @@ HumHub Change Log
|
|||||||
- Enh: Added `humhub/widgts/Button::userPickerSelfSelect()` for creating self select button for userpickers.
|
- Enh: Added `humhub/widgts/Button::userPickerSelfSelect()` for creating self select button for userpickers.
|
||||||
- Enh: Added `humhub/widgts/Link::withAction()` for creating action based links
|
- Enh: Added `humhub/widgts/Link::withAction()` for creating action based links
|
||||||
- Enh: Added `SelectTimeZoneDropdown` widget
|
- Enh: Added `SelectTimeZoneDropdown` widget
|
||||||
|
- Enh: Added `Modal::closable` in order to respect `backdrop` and `keyboard` data setting of `Modal` and `ModalDialog` widget
|
||||||
|
|
||||||
1.2.1 (June 17, 2017)
|
1.2.1 (June 17, 2017)
|
||||||
- Fix: Invite error in french language
|
- Fix: Invite error in french language
|
||||||
|
@ -13,13 +13,13 @@ return [
|
|||||||
'id' => 'notification',
|
'id' => 'notification',
|
||||||
'class' => Module::className(),
|
'class' => Module::className(),
|
||||||
'isCoreModule' => true,
|
'isCoreModule' => true,
|
||||||
'events' => array(
|
'events' => [
|
||||||
array('class' => User::className(), 'event' => User::EVENT_BEFORE_DELETE, 'callback' => array(Events::className(), 'onUserDelete')),
|
['class' => User::className(), 'event' => User::EVENT_BEFORE_DELETE, 'callback' => [Events::className(), 'onUserDelete']],
|
||||||
array('class' => Space::className(), 'event' => Space::EVENT_BEFORE_DELETE, 'callback' => array(Events::className(), 'onSpaceDelete')),
|
['class' => Space::className(), 'event' => Space::EVENT_BEFORE_DELETE, 'callback' => [Events::className(), 'onSpaceDelete']],
|
||||||
array('class' => IntegrityController::className(), 'event' => IntegrityController::EVENT_ON_RUN, 'callback' => array(Events::className(), 'onIntegrityCheck')),
|
['class' => IntegrityController::className(), 'event' => IntegrityController::EVENT_ON_RUN, 'callback' => [Events::className(), 'onIntegrityCheck']],
|
||||||
array('class' => CronController::className(), 'event' => CronController::EVENT_ON_DAILY_RUN, 'callback' => array(Events::className(), 'onCronDailyRun')),
|
['class' => CronController::className(), 'event' => CronController::EVENT_ON_DAILY_RUN, 'callback' => [Events::className(), 'onCronDailyRun']],
|
||||||
array('class' => ActiveRecord::className(), 'event' => ActiveRecord::EVENT_BEFORE_DELETE, 'callback' => [Events::className(), 'onActiveRecordDelete']),
|
['class' => ActiveRecord::className(), 'event' => ActiveRecord::EVENT_BEFORE_DELETE, 'callback' => [Events::className(), 'onActiveRecordDelete']],
|
||||||
array('class' => LayoutAddons::className(), 'event' => LayoutAddons::EVENT_BEFORE_RUN, 'callback' => [Events::className(), 'onLayoutAddons'])
|
['class' => LayoutAddons::className(), 'event' => LayoutAddons::EVENT_BEFORE_RUN, 'callback' => [Events::className(), 'onLayoutAddons']]
|
||||||
),
|
],
|
||||||
];
|
];
|
||||||
?>
|
?>
|
@ -3,14 +3,14 @@
|
|||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
?><div class="panel panel-default">
|
?><div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<?php echo Yii::t('SpaceModule.views_admin_modules', '<strong>Space</strong> Modules'); ?>
|
<?= Yii::t('SpaceModule.views_admin_modules', '<strong>Space</strong> Modules'); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
||||||
<?php if (count($availableModules) == 0): ?>
|
<?php if (count($availableModules) == 0): ?>
|
||||||
<p><?php echo Yii::t('SpaceModule.views_admin_modules', 'Currently there are no modules available for this space!'); ?></p>
|
<p><?= Yii::t('SpaceModule.views_admin_modules', 'Currently there are no modules available for this space!'); ?></p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php echo Yii::t('SpaceModule.views_admin_modules', 'Enhance this space with modules.'); ?><br>
|
<?= Yii::t('SpaceModule.views_admin_modules', 'Enhance this space with modules.'); ?><br>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
@ -19,36 +19,36 @@ use yii\helpers\Html;
|
|||||||
<div class="media">
|
<div class="media">
|
||||||
<img class="media-object img-rounded pull-left" data-src="holder.js/64x64" alt="64x64"
|
<img class="media-object img-rounded pull-left" data-src="holder.js/64x64" alt="64x64"
|
||||||
style="width: 64px; height: 64px;"
|
style="width: 64px; height: 64px;"
|
||||||
src="<?php echo $module->getContentContainerImage($space); ?>">
|
src="<?= $module->getContentContainerImage($space); ?>">
|
||||||
|
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<h4 class="media-heading"><?php echo $module->getContentContainerName($space); ?>
|
<h4 class="media-heading"><?= $module->getContentContainerName($space); ?>
|
||||||
<?php if ($space->isModuleEnabled($moduleId)) : ?>
|
<?php if ($space->isModuleEnabled($moduleId)) : ?>
|
||||||
<small><span class="label label-success"><?php echo Yii::t('SpaceModule.views_admin_modules', 'Activated'); ?></span></small>
|
<small><span class="label label-success"><?= Yii::t('SpaceModule.views_admin_modules', 'Activated'); ?></span></small>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<p><?php echo $module->getContentContainerDescription($space); ?></p>
|
<p><?= $module->getContentContainerDescription($space); ?></p>
|
||||||
|
|
||||||
<?php if ($space->canDisableModule($moduleId)): ?>
|
<?php if ($space->canDisableModule($moduleId)): ?>
|
||||||
<a href="#" style="<?= $space->isModuleEnabled($moduleId) ? '' : 'display:none' ?>"
|
<a href="#" style="<?= $space->isModuleEnabled($moduleId) ? '' : 'display:none' ?>"
|
||||||
data-action-click="content.container.disableModule"
|
data-action-click="content.container.disableModule"
|
||||||
data-action-url="<?= $space->createUrl('/space/manage/module/disable', ['moduleId' => $moduleId]) ?>" data-reload="1"
|
data-action-url="<?= $space->createUrl('/space/manage/module/disable', ['moduleId' => $moduleId]) ?>" data-reload="1"
|
||||||
data-action-confirm="<?= Yii::t('SpaceModule.views_admin_modules', 'Are you sure? *ALL* module data for this space will be deleted!') ?>"
|
data-action-confirm="<?= Yii::t('SpaceModule.views_admin_modules', 'Are you sure? *ALL* module data for this space will be deleted!') ?>"
|
||||||
class="btn btn-sm btn-primary disable" data-ui-loader>
|
class="btn btn-sm btn-primary disable disable-module-<?= $moduleId ?>" data-ui-loader>
|
||||||
<?= Yii::t('SpaceModule.views_admin_modules', 'Disable') ?>
|
<?= Yii::t('SpaceModule.views_admin_modules', 'Disable') ?>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($module->getContentContainerConfigUrl($space) && $space->isModuleEnabled($moduleId)) : ?>
|
<?php if ($module->getContentContainerConfigUrl($space) && $space->isModuleEnabled($moduleId)) : ?>
|
||||||
<a href="<?= $module->getContentContainerConfigUrl($space) ?>" class="btn btn-sm btn-default">
|
<a href="<?= $module->getContentContainerConfigUrl($space) ?>" class="btn btn-sm btn-default configure-module-<?= $moduleId ?>">
|
||||||
<?= Yii::t('SpaceModule.views_admin_modules', 'Configure') ?>
|
<?= Yii::t('SpaceModule.views_admin_modules', 'Configure') ?>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<a href="#" style="<?= $space->isModuleEnabled($moduleId) ? 'display:none' : '' ?>"
|
<a href="#" style="<?= $space->isModuleEnabled($moduleId) ? 'display:none' : '' ?>"
|
||||||
data-action-click="content.container.enableModule" data-action-url="<?= $space->createUrl('/space/manage/module/enable', ['moduleId' => $moduleId]) ?>" data-reload="1"
|
data-action-click="content.container.enableModule" data-action-url="<?= $space->createUrl('/space/manage/module/enable', ['moduleId' => $moduleId]) ?>" data-reload="1"
|
||||||
class="btn btn-sm btn-primary enable" data-ui-loader>
|
class="btn btn-sm btn-primary enable enable-module-<?= $moduleId ?>" data-ui-loader>
|
||||||
<?= Yii::t('SpaceModule.views_admin_modules', 'Enable') ?>
|
<?= Yii::t('SpaceModule.views_admin_modules', 'Enable') ?>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,7 +27,7 @@ if ($canInviteExternal && $model->hasErrors('inviteExternal')) {
|
|||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<ul id="tabs" class="nav nav-tabs tabs-center" data-tabs="tabs">
|
<ul id="tabs" class="nav nav-tabs tabs-center" data-tabs="tabs">
|
||||||
<li class="<?= $isInviteTabActiveClass ?> tab-internal">
|
<li class="<?= $isInviteTabActiveClass ?> tab-internal">
|
||||||
<a href="#internal"data-toggle="tab"><?= Yii::t('SpaceModule.views_space_invite', 'Pick users'); ?></a>
|
<a href="#internal" data-toggle="tab"><?= Yii::t('SpaceModule.views_space_invite', 'Pick users'); ?></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="<?= $isInviteExternalTabActiveClass ?> tab-external">
|
<li class="<?= $isInviteExternalTabActiveClass ?> tab-external">
|
||||||
<a href="#external" data-toggle="tab"><?= Yii::t('SpaceModule.views_space_invite', 'Invite by email'); ?></a>
|
<a href="#external" data-toggle="tab"><?= Yii::t('SpaceModule.views_space_invite', 'Invite by email'); ?></a>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'modules' => ['task'],
|
|
||||||
'fixtures' => [
|
'fixtures' => [
|
||||||
'default'
|
'default'
|
||||||
]
|
]
|
||||||
|
@ -125,6 +125,11 @@ abstract class BasePickerField extends InputWidget
|
|||||||
*/
|
*/
|
||||||
public $form;
|
public $form;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated since 1.2.2 use $name instead
|
||||||
|
*/
|
||||||
|
public $formName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model instance.
|
* Model instance.
|
||||||
*
|
*
|
||||||
@ -140,13 +145,6 @@ abstract class BasePickerField extends InputWidget
|
|||||||
*/
|
*/
|
||||||
public $attribute;
|
public $attribute;
|
||||||
|
|
||||||
/**
|
|
||||||
* Input form name.
|
|
||||||
* This can be set if no form and model is provided for custom input field setting.
|
|
||||||
*
|
|
||||||
* @var type
|
|
||||||
*/
|
|
||||||
public $formName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can be used to overwrite the default placeholder.
|
* Can be used to overwrite the default placeholder.
|
||||||
@ -163,7 +161,7 @@ abstract class BasePickerField extends InputWidget
|
|||||||
/**
|
/**
|
||||||
* If set to true the picker will be focused automatically.
|
* If set to true the picker will be focused automatically.
|
||||||
*
|
*
|
||||||
* @var type
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $focus = false;
|
public $focus = false;
|
||||||
|
|
||||||
@ -196,6 +194,11 @@ abstract class BasePickerField extends InputWidget
|
|||||||
{
|
{
|
||||||
\humhub\assets\Select2BootstrapAsset::register($this->view);
|
\humhub\assets\Select2BootstrapAsset::register($this->view);
|
||||||
|
|
||||||
|
//Only for compatibility
|
||||||
|
if(empty($this->name)) {
|
||||||
|
$this->name = $this->formName;
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->selection != null && !is_array($this->selection)) {
|
if ($this->selection != null && !is_array($this->selection)) {
|
||||||
$this->selection = [$this->selection];
|
$this->selection = [$this->selection];
|
||||||
}
|
}
|
||||||
@ -215,8 +218,8 @@ abstract class BasePickerField extends InputWidget
|
|||||||
} else if ($this->model != null) {
|
} else if ($this->model != null) {
|
||||||
return Html::activeDropDownList($this->model, $this->attribute, $selection, $options);
|
return Html::activeDropDownList($this->model, $this->attribute, $selection, $options);
|
||||||
} else {
|
} else {
|
||||||
$name = (!$this->formName) ? 'pickerField' : $this->formName;
|
$name = (!$this->name) ? 'pickerField' : $this->name;
|
||||||
return Html::dropDownList($name, $selection, [], $options);
|
return Html::dropDownList($name, $this->value, $selection, $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ namespace humhub\widgets;
|
|||||||
* MarkdownEditorWidget replaces a textarea element with bootstrap-markdown editor
|
* MarkdownEditorWidget replaces a textarea element with bootstrap-markdown editor
|
||||||
*
|
*
|
||||||
* @todo Allow multiple MarkdownEditorWidget instances on a page
|
* @todo Allow multiple MarkdownEditorWidget instances on a page
|
||||||
|
* @deprecated since 1.2.2 use MarkdownField instead
|
||||||
* @author luke
|
* @author luke
|
||||||
* @since 0.11
|
* @since 0.11
|
||||||
*/
|
*/
|
||||||
|
@ -12,7 +12,7 @@ use humhub\widgets\RichText;
|
|||||||
* @since 1.2
|
* @since 1.2
|
||||||
* @author buddha
|
* @author buddha
|
||||||
*/
|
*/
|
||||||
class RichtextField extends JsWidget
|
class RichtextField extends InputWidget
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,37 +29,6 @@ class RichtextField extends JsWidget
|
|||||||
*/
|
*/
|
||||||
public $minInput = 3;
|
public $minInput = 3;
|
||||||
|
|
||||||
/**
|
|
||||||
* If the ActiveForm is set, it will be used to create the picker field,
|
|
||||||
* otherwise it's created by Html::activeDropDownList
|
|
||||||
*
|
|
||||||
* @var \yii\widgets\ActiveForm
|
|
||||||
*/
|
|
||||||
public $form;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model instance. Requires the setting of an model $attribute.
|
|
||||||
*
|
|
||||||
* @var \yii\db\ActiveRecord
|
|
||||||
*/
|
|
||||||
public $model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model attribute which holds the picker value. The referenced model attribute has to be an
|
|
||||||
* array.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
public $attribute;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Input form name.
|
|
||||||
* This can be provided if no form and model is provided for custom input field setting.
|
|
||||||
*
|
|
||||||
* @var type
|
|
||||||
*/
|
|
||||||
public $name;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can be used to overwrite the default placeholder.
|
* Can be used to overwrite the default placeholder.
|
||||||
*
|
*
|
||||||
@ -98,14 +67,6 @@ class RichtextField extends JsWidget
|
|||||||
*/
|
*/
|
||||||
public $excludes = [];
|
public $excludes = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Can be used to set the value in case no $model and $attribute is provided.
|
|
||||||
* $model and $attribute is provided.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
public $value;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to true the picker will be focused automatically.
|
* If set to true the picker will be focused automatically.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
use humhub\libs\Html;
|
||||||
|
?>
|
||||||
<!-- Dialog -->
|
<!-- Dialog -->
|
||||||
<div class="<?= $dialogClass ?>">
|
|
||||||
|
<?= Html::beginTag('div', $options) ?>
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
@ -34,5 +38,4 @@
|
|||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
<?= Html::endTag('div') ?>
|
||||||
</div>
|
|
||||||
|
@ -92,11 +92,23 @@ humhub.module('ui.form.elements', function (module, require, $) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var toggleTimeZoneInput = function(evt) {
|
||||||
|
evt.$trigger.siblings('.timeZoneInputContainer:first').fadeToggle('fast');
|
||||||
|
};
|
||||||
|
|
||||||
|
var timeZoneSelected = function(evt) {
|
||||||
|
$toggleButton = evt.$trigger.parent().siblings('.timeZoneToggle:first');
|
||||||
|
$toggleButton.text(evt.$trigger.find('option:selected').text());
|
||||||
|
evt.$trigger.parent().hide();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.export({
|
module.export({
|
||||||
init: init,
|
init: init,
|
||||||
initCheckbox: initCheckbox,
|
initCheckbox: initCheckbox,
|
||||||
initRadio: initRadio
|
initRadio: initRadio,
|
||||||
|
toggleTimeZoneInput: toggleTimeZoneInput,
|
||||||
|
timeZoneSelected: timeZoneSelected
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user