Skip to content

Releases: LaravelRUS/SleepingOwlAdmin

4.24.108-beta: Merge pull request #76 from b4rtaz/development

06 Apr 19:41
Compare
Choose a tag to compare

4.23.107-beta: fix column filters

06 Apr 18:47
Compare
Choose a tag to compare
  • fixed datatablesAsync column filters

4.23.106-beta

06 Apr 18:17
Compare
Choose a tag to compare
  • fixed datatablesAsync
  • Added image validation (getimagesize) before upload

4.23.102-beta

02 Apr 08:56
Compare
Choose a tag to compare

4.23.101-beta

31 Mar 08:17
Compare
Choose a tag to compare
  • Fixed back redirect when you creating record from related section
  • Mark required fields with star
  • Fixed ckeditor form element
  • issue #57
  • issue #56
  • issue #62

Improved Wysiwyg manager

25 Mar 14:33
Compare
Choose a tag to compare

Added new wysiwyg editors

Tinymce

https://www.tinymce.com/

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

24 Mar 21:17
Compare
Choose a tag to compare

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:

  1. 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,
        ],
    ],
  2. 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',
        ],
    ],
  3. Setting up middleware

    By default auth middleware use default guard, selected in config/auth.php

    'defaults' => [
        'guard' => 'web', <- default
        ...
    ],

    You can change default guard to admin or change middleware in config/sleeping_owl.php to

    'middleware' => ['web', 'auth:admin'],

4.19.92-beta

24 Mar 14:43
Compare
Choose a tag to compare
  • 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

24 Mar 11:05
Compare
Choose a tag to compare
  • 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

23 Mar 08:14
Compare
Choose a tag to compare
  • Fixed restoring items with SoftDelete trait #44
  • Added binding Interfaces to Implementations