Skip to content

Commit

Permalink
Basic implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rob006 committed Jun 4, 2017
1 parent a2df71e commit 38036c9
Show file tree
Hide file tree
Showing 7 changed files with 472 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
/vendor
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Robert Korulczyk
Copyright (c) 2017 Robert Korulczyk <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
64 changes: 62 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,62 @@
# yii-tinymce
TinyMCE editor integration for Yii 1.1
TinyMCE integration for Yii 1.1
===============================

Yii 1.1 extension that provides basic integration with [TinyMce editor](https://www.tinymce.com/).


Installation
------------

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

Either run

```shell
php composer.phar require rob006/yii-tinymce
```

or add

```json
"rob006/yii2-tinymce": "^1.0"
```

to the require section of your `composer.json` file.


Usage
-----

Basic usage:

```php
<?php $this->widget('TinyMceWidget', [
'model' => $model,
'attribute' => 'value',
]) ?>
```

Usage with custom settings and [Yiistrap](http://www.getyiistrap.com/) and [elFinder](https://github.com/rob006/yii-elfinder2) extensions integration.

```php
<?= $form->textAreaControlGroup($model, 'value', ['rows' => 6, 'span' => 8,]) ?>
<?php $this->widget('TinyMceWidget', [
'model' => $model,
'attribute' => 'value',
'dry_run' => true,
'fileManager' => [
'class' => 'TinyMceElFinder',
'popupConnectorRoute' => 'pageAssetsPopup',
'popupTitle' => 'Files',
],
'settings' => [
'content_css' => $this->getEditorStyles(),
],
]) ?>
```
Resources
---------

* [Extension page](https://github.com/rob006/yii-tinymce)
* [elFinder extension](https://github.com/rob006/yii-elfinder2)
* [TinyMce page](https://www.tinymce.com/)
37 changes: 37 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "rob006/yii-tinymce",
"description": "TinyMCE editor integration for Yii 1.1.",
"type": "yii-extension",
"keywords": ["yii", "extension", "TinyMCE", "widget", "elFinder"],
"minimum-stability": "dev",
"license": "MIT",
"authors": [
{
"name": "Robert Korulczyk",
"email": "[email protected]",
"homepage": "https://rob006.net/"
}
],
"support": {
"issues": "https://github.com/rob006/yii-tinymce/issues",
"source": "https://github.com/rob006/yii-tinymce"
},
"require": {
"php": ">=5.4.0",
"tinymce/tinymce": "^4.5.6",
"yiisoft/yii": "~1.1.18"
},
"autoload": {
"classmap": [
"src/"
]
},
"suggest": {
"rob006/yii-elfinder2": "Provides file manager integration with editor."
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}
161 changes: 161 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions src/TinyMceFileManager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file is part of the yii-tinymce.
*
* Copyright (c) 2017 Robert Korulczyk <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.md.
*/

/**
* Abstract FileManager class to use with TinyMce.
* For example see elFinder extension.
*
* @see https://github.com/rob006/yii-elfinder2
*
* @author Robert Korulczyk <[email protected]>
* @since 1.0.0
*/
abstract class TinyMceFileManager extends CComponent {

/**
* Initialize FileManager component, registers required JS.
*/
public function init() {
}

/**
* @return string JavaScript callback function, starts with "js:".
*/
abstract public function getFileBrowserCallback();
}
Loading

0 comments on commit 38036c9

Please sign in to comment.