srag / commentsui
Comments ui
Requires
- php: >=7.2
- srag/dic: >=0.1.0
- srag/librarylanguageinstaller: >=0.1.0
- dev-main
- 0.14.0
- 0.13.1
- 0.13.0
- 0.12.10
- 0.12.9
- 0.12.8
- 0.12.7
- 0.12.6
- 0.12.5
- 0.12.4
- 0.12.3
- 0.12.2
- 0.12.1
- 0.12.0
- 0.11.0
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.6
- v0.7.5
- v0.7.4
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.13
- v0.4.12
- v0.4.11
- v0.4.10
- v0.4.9
- v0.4.8
- v0.4.7
- v0.4.6
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.1
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2022-07-18 08:09:21 UTC
README
Comments ui
This project is licensed under the GPL-3.0-only license
Usage
Composer
First add the following to your composer.json
file:
"require": { "srag/commentsui": ">=0.1.0" },
And run a composer install
.
If you deliver your plugin, the plugin has it's own copy of this library and the user doesn't need to install the library.
Tip: Because of multiple autoloaders of plugins, it could be, that different versions of this library exists and suddenly your plugin use an older or a newer version of an other plugin!
So I recommand to use srag/librariesnamespacechanger in your plugin.
Trait usage
Your class in this you want to use CommentsUI needs to use the trait CommentsUITrait
... use srag\CommentsUI\x\Utils\CommentsUITrait; ... class x { ... use CommentsUITrait; ...
Comment ActiveRecord
First you need to init the Comment
active record class with your own table name prefix. Please add this very early in your plugin code self::comments()->withTableNamePrefix(self::COMMENT_TABLE_NAME_PREFIX)->withPlugin(self::plugin());
Add an update step to your `dbupdate.php`
```php
...
<#x>
<?php
\srag\CommentsUI\x\Comment\Repository::getInstance()->installTables();
?>
and not forget to add an uninstaller step in your plugin class too
... self::comments()->dropTables(); ...
Async ctrl class
... use srag\CommentsUI\x\Ctrl\AbstractCtrl; ... /** * ... * * @ilCtrl_isCalledBy srag\Plugins\x\Comment\Ctrl\XCtrl: ilUIPluginRouterGUI */ class XCtrl extends AbstractCtrl { /** * @inheritDoc */ public function getCommentsArray(int $report_obj_id, int $report_user_id): array { ... } }
Languages
Expand you plugin class for installing languages of the library to your plugin
... /** * @inheritDoc */ public function updateLanguages(/*?array*/ $a_lang_keys = null) : void { parent::updateLanguages($a_lang_keys); self::comments()->installLanguages(); } ...
UI usage
... use srag\Plugins\x\Comment\Ctrl\XCtrl; ... self::output()->getHTML(self::commentsUI()->withPlugin(self::plugin())->withCtrlClass(new XCtrl()));
Requirements
- ILIAS 6.0 - 7.999
- PHP >=7.2