2017 © Pedro Peláez
 

yii2-extension yii2-roxymce

Integrate tinymce + roxy manager to yii2

image

phamxuanloc/yii2-roxymce

Integrate tinymce + roxy manager to yii2

  • Tuesday, September 27, 2016
  • by phamxuanloc
  • Repository
  • 2 Watchers
  • 0 Stars
  • 53 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 15 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

RoxyMce - Beautiful File manager for Tinymce

This allow to integrate TinyMce 4 with Roxy Fileman, (*1)

User story

I'm try to find a good file manager for tinymce for a long time.
elFinder is good, but too much function and it's not my style. MoxieManager maybe best with tinymce, but it's too much for me.
One day, I saw roxyman, immediately, I know it is all I need., (*2)

Install

Preferred way to install this extension through composer
Either run, (*3)

composer require phamxuanloc/yii2-roxymce "@dev"

Or add to require section of composer.json then run composer update, (*4)

"phamxuanloc/yii2-roxymce" : "@dev" 

Configure

Just add to config/web.php, (*5)

Simple config

[php]
    'modules'    => [
        'roxymce'  => [
            'class' => '\phamxuanloc\roxymce\Module',
        ]
    ]

Advanced config

[php]
    'modules'    => [
        'roxymce'  => [
            'class' => '\phamxuanloc\roxymce\Module',
            'config'=> [
            //all below is not required
                'FILES_ROOT'           => 'uploads/image', //The root directory of roxymce's resource, where can be uploaded to. if not existed, Roxy will auto create
                'DEFAULTVIEW'          => 'list', //default view when you call roxymce (thumb/list)
                'THUMBS_VIEW_WIDTH'    => '100', //default width of thumbs when thumb view activated
                'THUMBS_VIEW_HEIGHT'   => '100', //default height of thumbs when thumb view activated
                'MAX_IMAGE_WIDTH'      => '1000', //default maximum width of image allowed to upload
                'MAX_IMAGE_HEIGHT'     => '1000', //default maximum height of image allowed to upload
                'FORBIDDEN_UPLOADS'    => 'zip js jsp jsb mhtml mht xhtml xht php phtml php3 php4 php5 phps shtml jhtml pl sh py cgi exe application gadget hta cpl msc jar vb jse ws wsf wsc wsh ps1 ps2 psc1 psc2 msh msh1 msh2 inf reg scf msp scr dll msi vbs bat com pif cmd vxd cpl htpasswd htaccess', //default forbidden upload files extension
                'ALLOWED_UPLOADS'      => 'jpeg jpg png gif mov mp3 mp4 avi wmv flv mpeg', //default allowed upload files extension
                'FILEPERMISSIONS'      => '0644', //default file permissions
                'DIRPERMISSIONS'       => '0755', //default folder permissions
                'LANG'                 => 'en', //fix language interface. if NOT SET, language interface will auto follow Yii::$app->language
                'DATEFORMAT'           => 'dd/MM/yyyy HH:mm', //default datetime format
                'OPEN_LAST_DIR'        => 'yes', //default roxymce will open last dir where you leave
            ]
        ],
    ],

Usage

In your view file, call roxymce widget, (*6)

Include ActiveRecord Model

[php]
//example in action create
$model = new Post(); 
//example in action update
$model = Post::findOne(['id' => 1]); 
echo \phamxuanloc\roxymce\widgets\RoxyMceWidget::widget([
    'model'       => $model, //your Model, REQUIRED
    'attribute'   => 'content', //attribute name of your model, REQUIRED if using 'model' section
    'name'        => 'Post[content]', //default name of textarea which will be auto generated, NOT REQUIRED if using 'model' section
    'value'       => isset($_POST['Post']['content']) ? $_POST['Post']['content'] : $model->content, //default value of current textarea, NOT REQUIRED
    'action'      => Url::to(['roxymce/default']), //default roxymce action route, NOT REQUIRED
    'options'     => [//TinyMce options, NOT REQUIRED, see https://www.tinymce.com/docs/
        'title' => 'RoxyMCE',//title of roxymce dialog, NOT REQUIRED
    ],
    'htmlOptions' => [],//html options of this widget, NOT REQUIRED
]);

Sample HTML without ActiveRecord Model

[php]
echo \phamxuanloc\roxymce\widgets\RoxyMceWidget::widget([
    'name'        => 'content', //default name of textarea which will be auto generated, REQUIRED if not using 'model' section
    'value'       => isset($_POST['content']) ? $_POST['content'] : '', //default value of current textarea, NOT REQUIRED
    'action'      => Url::to(['roxymce/default']), //default roxymce action route, NOT REQUIRED
    'options'     => [//TinyMce options, NOT REQUIRED, see https://www.tinymce.com/docs/
        'title' => 'RoxyMCE',//title of roxymce dialog, NOT REQUIRED
    ],
    'htmlOptions' => [],//html options of this widget, NOT REQUIRED
]);

Sample HTML Input Demo

[php]

use yii\bootstrap\Modal;
Modal::begin([
    'header' => '

Hello world

', 'size' => Modal::SIZE_LARGE, 'id' => "modal" //'toggleButton' => ['label' => 'click me'], ]); echo "
"; Modal::end(); [html] <input type="text" id="filepath"/> <a href="#" onclick="return demoPopup();">Choose Picture</a> [javascript]

Screenshot & Demo

Demo

Please referrence to RoxyFileMan demo and scroll down to TinyMce section, (*7)

Thumb view

thumbview, (*8)

List view

listview, (*9)

Upload view

upload, (*10)

Resource

Bugs & Issues

Found some bugs? Just create an issue or fork it and send pull request, (*11)

The Versions

27/09 2016

dev-master

9999999-dev https://diclearn.com

Integrate tinymce + roxy manager to yii2

  Sources   Download

MIT

The Requires

  • ext-gd *
  • ext-mbstring *
  • ext-zip *
  • phamxuanloc/yii2-navatech-base @dev
  • bower-asset/tinymce-dist ^4.3
  • bower-asset/fontawesome ^4.0
  • bower-asset/jquery-dateformat ^1.0

 

yii2 tinymce file manager roxy fileman phamxuanloc

23/09 2016

dev-dev-2.x

dev-dev-2.x https://navatech.vn

Integrate tinymce + roxy manager to yii2

  Sources   Download

MIT

The Requires

  • ext-gd *
  • ext-mbstring *
  • ext-zip *
  • navatech/yii2-navatech-base @dev
  • bower-asset/tinymce-dist ^4.3
  • bower-asset/fontawesome ^4.0
  • bower-asset/jquery-dateformat ^1.0
  • bower-asset/bootstrap-select *
  • bower-asset/bootstrap-treeview *

 

yii2 tinymce file manager navatech roxy fileman

06/05 2016

1.0.4.1

1.0.4.1 https://navatech.vn

Integrate tinymce + roxy manager to yii2

  Sources   Download

MIT

The Requires

 

yii2 tinymce file manager navatech roxy fileman

05/05 2016

1.0.4.0

1.0.4.0

Integrate tinymce + roxy manager to yii2

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-gd *
  • ext-mbstring *
  • ext-zip *
  • navatech/yii2-navatech-base @dev
  • bower-asset/tinymce-dist ^4.3
  • bower-asset/fontawesome ^4.0
  • bower-asset/jquery-dateformat ^1.0

 

yii2 tinymce file manager navatech roxy fileman

21/02 2016

1.0.3

1.0.3.0

Integrate tinymce + roxy manager to yii2

  Sources   Download

MIT

The Requires

 

yii2 tinymce file manager navatech roxy fileman

21/02 2016

1.0.0

1.0.0.0

Integrate tinymce + roxy manager to yii2

  Sources   Download

MIT

The Requires

 

yii2 tinymce file manager navatech roxy fileman

21/02 2016

1.0.2

1.0.2.0

Integrate tinymce + roxy manager to yii2

  Sources   Download

MIT

The Requires

 

yii2 tinymce file manager navatech roxy fileman

16/02 2016

1.0.1

1.0.1.0

Integrate tinymce + roxy manager to yii2

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 tinymce file manager