Releases: LaravelRUS/SleepingOwlAdmin
Releases · LaravelRUS/SleepingOwlAdmin
4.24.108-beta: Merge pull request #76 from b4rtaz/development
- added Polish language
4.23.107-beta: fix column filters
- fixed datatablesAsync column filters
4.23.106-beta
- fixed datatablesAsync
- Added image validation (getimagesize) before upload
4.23.102-beta
- issue #65
4.23.101-beta
Improved Wysiwyg manager
Added new wysiwyg editors
Tinymce
AdminFormElement::wysiwyg('text', 'Text', 'tinymce')
Simplemde
https://github.com/NextStepWebs/simplemde-markdown-editor
// When you need to save markdown text in db
AdminFormElement::wysiwyg('comment', 'Comment', 'simplemde')->disableFilter();
// or when you need to save markdown text and filtered text db
AdminFormElement::wysiwyg('text', 'Text', 'simplemde')->setFilteredValueToField('text_html')
New methods in FormElement::wysiwyg
class
/**
* Disable filtering value before setting to model
*
* @return $this
*/
public function disableFilter();
/**
* Database field to storing filtered value (if it need)
*
* @param string $field
*
* @return $this
*/
public function setFilteredValueToField($field);
/**
* Set custom parameters to editor config
*
* @param array $parameters
*
* @return $this
*/
public function setParameters(array $parameters);
Added config sections for each editor
'wysiwyg' => [
'default' => 'ckeditor',
// Checkout http://docs.ckeditor.com/#!/api/CKEDITOR.config for more information.
'ckeditor' => [
'height' => 200,
],
// Checkout https://www.tinymce.com/docs/ for more information.
'tinymce' => [
'height' => 200,
],
// Checkout https://github.com/NextStepWebs/simplemde-markdown-editor for more information.
'simplemde' => [
'hideIcons' => ["side-by-side", "fullscreen"],
]
],
Improved editors registering
WysiwygManager::register('tinymce')
->js(null, '//cdn.tinymce.com/4/tinymce.min.js', ['jquery'])
->js('tinymce-init', 'js/tinymce-init.js', ['libraries']);
WysiwygManager::register('simplemde', new \SleepingOwl\Admin\Wysiwyg\MarkdownFilter())
->js(null, '//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js', ['jquery'])
->css(null, '//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
4.21.94-beta
Added new field wysiwyg
$form = AdminForm::form()->setItems([
...
AdminFormElement::wysiwyg('text', 'Text'), // Load default wysiwyg editor
// or
AdminFormElement::wysiwyg('text', 'Text', 'bootstrap-wysiwyg'),
]);
For creating custom wysiwyg editor you should
- register it
// Register package with editor id
PackageManager::add('ckeditor')
->js(null, 'http://cdn.ckeditor.com/4.5.7/standard/ckeditor.js', ['jquery'])
->js('ckeditor-init', public_path('js/ckeditor-init.js'), [''libraries'']);
WysiwygManager::register('ckeditor');
- create initialization javascript initialization javascript
// public_path('js/ckeditor-init.js')
window.Admin.Components.add('ckeditor', function() {
CKEDITOR.disableAutoInline = true;
switchOn_handler = function (textarea_id, params) {
var textarea = $('#' + textarea_id).hide();
return editor = CKEDITOR.replace(textarea_id, textarea.data());
};
switchOff_handler = function (editor, textarea_id) {
editor.destroy()
}
exec_handler = function (editor, command, textarea_id, data) {
switch (command) {
case 'insert':
editor.insertText(data);
break;
case 'changeHeight':
editor.resize('100%', data);
}
}
window.Admin.WYSIWYG.add(
'ckeditor',
switchOn_handler,
switchOff_handler,
exec_handler
);
});
Supporting of old authentication
If you want to migrate from old version< you can use old auth.
Steps:
-
Add new user provider in
config/auth.php
'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\User::class, ], 'administrators' => [ 'driver' => 'eloquent', 'model' => SleepingOwl\Admin\Auth\Administrator::class, ], ],
-
Add new guards or change existing in
config/auth.php
'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'administrators', // change existing provider ], // or add new 'admin' => [ 'driver' => 'session', 'provider' => 'administrators', ], ],
-
Setting up middleware
By default
auth
middleware use default guard, selected inconfig/auth.php
'defaults' => [ 'guard' => 'web', <- default ... ],
You can change default guard to
admin
or change middleware inconfig/sleeping_owl.php
to'middleware' => ['web', 'auth:admin'],
4.19.92-beta
- Navigation classes have been move to composer package
kodicomponents\navigation
for using in other project - Class has been moved to composer package
kodicomponents\support
for using in other projects and methods have been changed for more compatibility. setAttribute
->setHtmlAttribute
setAttributes
->setHtmlAttributes
getAttribute
->getHtmlAttribute
getAttributes
->getHtmlAttributes
hasAttribute
->hasHtmlAttribute
replaceAttribute
->replaceHtmlAttribute
removeAttribute
->removeHtmlAttribute
clearAttributes
->clearHtmlAttributes
hasClass
->hasClassProperty
4.18.92-beta
- issue #41
Now you can register events for section:
Available events: creating
, created
, updating
, updated
, deleting
, deleted
, restoring
, restored
Example
// Registering event from section class
AdminSection::registerModel(News::class, function (ModelConfiguration $model) {
...
$model->updating(function(ModelConfiguration $model, Model $item) {
Mail::send(...);
});
...
});
// Registering from ServisProvider or bootstrap.php
app('events')->listen("sleeping_owl.section.creating: App\Model\News", function() {
// do something
});
// or
Event::listen("sleeping_owl.section.creating: App\Model\News", function() {
// do something
});
- issue #43. Partly fixed custom filters.
- If section don't have a title, build it from model name
4.17.90-beta
- Fixed restoring items with SoftDelete trait #44
- Added binding Interfaces to Implementations