diff --git a/protected/humhub/docs/guide/admin/asynchronous-tasks.md b/protected/humhub/docs/guide/admin/asynchronous-tasks.md index 5c6e9fdfee..fade86503a 100644 --- a/protected/humhub/docs/guide/admin/asynchronous-tasks.md +++ b/protected/humhub/docs/guide/admin/asynchronous-tasks.md @@ -44,7 +44,7 @@ Supervisor is a process monitoring tool for Linux. It automatically starts, moni Example configuration (e.g. /etc/supervisor/conf.d/humhub.conf): -```conf +``` [program:humhub-workers] process_name=%(program_name)s_%(process_num)02d command=/usr/bin/php /protected/yii queue/listen --verbose=1 --color=0 @@ -151,4 +151,4 @@ To enable this driver you need to add following block to your local configuratio ### Sync and Instant Queue -The [[humhub\components\queue\driver\Sync]] and [[humhub\components\queue\driver\Instant]] queues are used in test and development environments without cron jobs. +The [[humhub\modules\queue\driver\Sync]] and [[humhub\modules\queue\driver\Instant]] queues are used in test and development environments without cron jobs. diff --git a/protected/humhub/docs/guide/developer/console.md b/protected/humhub/docs/guide/developer/console.md index c097dc38cd..7722f2fae6 100644 --- a/protected/humhub/docs/guide/developer/console.md +++ b/protected/humhub/docs/guide/developer/console.md @@ -33,14 +33,13 @@ public static function onConsoleApplicationInit($event) { $application = $event->sender; $application->controllerMap['translation'] = commands\TranslationController::className(); } - ``` ## Integrity Checker The integrity checker is a command which validates and if necessary repairs the application database. -If you want to add own checking methods for your module to it, you can intercept the [[humhub\controllers\IntegrityController::EVENT_ON_RUN]] event. +If you want to add own checking methods for your module to it, you can intercept the [[humhub\commands\IntegrityController::EVENT_ON_RUN]] event. Example callback implementation: diff --git a/protected/humhub/docs/guide/developer/content.md b/protected/humhub/docs/guide/developer/content.md index 18c10af288..7045e37f66 100644 --- a/protected/humhub/docs/guide/developer/content.md +++ b/protected/humhub/docs/guide/developer/content.md @@ -267,7 +267,7 @@ class Example extends ContentContainerActiveRecord } ``` ->Info: For more information about permissions, please see the [Permission Section](module-permissions.md). +> Info: For more information about permissions, please see the [Permission Section](module-permissions.md). ### Other content features @@ -400,7 +400,7 @@ TBD - Always linked to particual Content, inherits access rules from it - Examples: Like, File, Comment -- Can be nested (e.g. Container -> Content -> Addon (Comment) -> Addon (Like) +- Can be nested (e.g. `Container -> Content -> Addon (Comment) -> Addon (Like)`) ## Content Streams diff --git a/protected/humhub/docs/guide/developer/files.md b/protected/humhub/docs/guide/developer/files.md index 3eaa2e8a62..0580435e9c 100644 --- a/protected/humhub/docs/guide/developer/files.md +++ b/protected/humhub/docs/guide/developer/files.md @@ -59,7 +59,7 @@ if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->sa ``` ### Read Files -To read mapped files of an ActiveRecord, use the [humhub\modules\file\components\FileManager]] via [[humhub\components\ActiveRecords::getFileManager]]. +To read mapped files of an ActiveRecord, use the [[humhub\modules\file\components\FileManager]] via [[humhub\components\ActiveRecord::getFileManager]]. ```php @@ -82,13 +82,15 @@ Converters are used to create variants (e.g. different file formats or images si All converted files (variants) will be automatically stored with the original file. Example usage: + ```php + $file = \humhub\modules\file\models\File::findOne(['guid' => 'your file guid']); $previewImage = new \humhub\modules\file\converter\PreviewImage(); if ($previewImage->applyFile($file)) { - // Can create preview of given file - echo $previewImage->getUrl(); + // Can create preview of given file + echo $previewImage->getUrl(); } ``` diff --git a/protected/humhub/docs/guide/developer/i18n.md b/protected/humhub/docs/guide/developer/i18n.md index f994f0fe4b..98f67d4576 100644 --- a/protected/humhub/docs/guide/developer/i18n.md +++ b/protected/humhub/docs/guide/developer/i18n.md @@ -25,4 +25,6 @@ Base Category Naming Examples: Example message creation command for module with id *example*: -> php yii message/extract-module *example* +``` +php yii message/extract-module *example* +``` diff --git a/protected/humhub/docs/guide/developer/javascript-actions.md b/protected/humhub/docs/guide/developer/javascript-actions.md index 1acec034cf..b313d9df34 100644 --- a/protected/humhub/docs/guide/developer/javascript-actions.md +++ b/protected/humhub/docs/guide/developer/javascript-actions.md @@ -8,7 +8,7 @@ The action handler uses the `client` module for calling an url defined by `data- ###### View: -```php +```html ``` @@ -99,7 +99,7 @@ var someAction = function(evt) { - `$form`: In case your $trigger is of `type="submit"` or has a `data-action-submit` attribute, the action event will include a jquery instance of the sorrounding form or the form set by the $target. ###### View: -```php +```html diff --git a/protected/humhub/docs/guide/developer/javascript-client.md b/protected/humhub/docs/guide/developer/javascript-client.md index 6b96d44e8c..c03878d3cd 100644 --- a/protected/humhub/docs/guide/developer/javascript-client.md +++ b/protected/humhub/docs/guide/developer/javascript-client.md @@ -66,7 +66,6 @@ client.get(evt).then(...); // Provide action event and additional ajax options client.get(evt, {...}).then(...); - ``` The `submit` function requires either an form selector, form jquery node or an action event as first argument. @@ -136,7 +135,6 @@ return [ 'enablePjax' => false ] ] - ``` ##### Disable Pjax for specific links diff --git a/protected/humhub/docs/guide/developer/javascript-components.md b/protected/humhub/docs/guide/developer/javascript-components.md index 64ca149810..f5ee47d008 100644 --- a/protected/humhub/docs/guide/developer/javascript-components.md +++ b/protected/humhub/docs/guide/developer/javascript-components.md @@ -11,7 +11,7 @@ Components consist of a root node, which can be accessed by `this.$` within your ###### View: -```php +```html
@@ -46,7 +46,7 @@ After clicking the button of the previous example the `action` module will searc If you need the instance of your component, for example in another module, you can retrieve it by calling `Component.instance`: -```Javascript +```javascript humhub.module('example.two', function(module, require, $) { var Component = require('action').Component; @@ -66,7 +66,7 @@ Components can be nested, which can be handy for example if you want to implemen ###### View: -```php +```html
...
...
@@ -75,7 +75,7 @@ Components can be nested, which can be handy for example if you want to implemen ###### Module: -```Javascript +```javascript humhub.module('example.mylist', function(module, require, $) { var object = require('util').object; var Component = require('action').Component; @@ -132,7 +132,7 @@ A Widgets `init` function is called once the widget is created. A Widget is crea > Note: If you load a Widget by an ajax call, make sure to apply the `ui.additions` on your inserted dom nodes, otherwise the `data-ui-init` behavriour won't be recognized. ###### View: -```php +```html @@ -167,7 +167,7 @@ Your widgets option can be set by using `data-*` attributes on your Widgets root The Widgets `getDefaultOptions()` method can be used to define default Widget options. ###### View: -```php +```html
@@ -213,7 +213,7 @@ TBD #### JsWidget class -In order to implement a Yii widget responsible for rendering your widgets markup, you can implement a PHP class derivated of [[humhub\widgets\JSWidget]] as in the following examples. +In order to implement a Yii widget responsible for rendering your widgets markup, you can implement a PHP class derivated of [[humhub\widgets\JsWidget]] as in the following examples. Here are some of the available attributes of the JSWidget class: diff --git a/protected/humhub/docs/guide/developer/models.md b/protected/humhub/docs/guide/developer/models.md index f002dceb46..8651e130fd 100644 --- a/protected/humhub/docs/guide/developer/models.md +++ b/protected/humhub/docs/guide/developer/models.md @@ -86,7 +86,7 @@ class uninstall extends Migration The integrity check is a command which validates and if necessary repairs the application database. -If you want to add own checking methods for your module to it, you can intercept the [[humhub\controllers\IntegrityController::EVENT_ON_RUN]] event. +If you want to add own checking methods for your module to it, you can intercept the [[humhub\commands\IntegrityController::EVENT_ON_RUN]] event. Example callback implementation: diff --git a/protected/humhub/docs/guide/developer/module-change-behavior.md b/protected/humhub/docs/guide/developer/module-change-behavior.md index ab0ecaf2a3..3b1be4f2e3 100644 --- a/protected/humhub/docs/guide/developer/module-change-behavior.md +++ b/protected/humhub/docs/guide/developer/module-change-behavior.md @@ -138,7 +138,7 @@ public static function onCreateSomeWidget($event) ### Append widget content In some cases you may want to append or otherwise manipulate the output of a widget. For this use-case you can listen to the -[[yii\base\Widget::EVENT_AFTER_RUN]] event. The following example appends the output of `MyWidgetToAppend` to the result of +[yii\base\Widget::EVENT_AFTER_RUN](https://www.yiiframework.com/doc/api/2.0/yii-base-widget#EVENT_AFTER_RUN-detail) event. The following example appends the output of `MyWidgetToAppend` to the result of `SomeWidgetIWantToExtend`: **config.php:** diff --git a/protected/humhub/docs/guide/developer/modules-users.md b/protected/humhub/docs/guide/developer/modules-users.md index 5489bf55b4..e0a9b7e29b 100644 --- a/protected/humhub/docs/guide/developer/modules-users.md +++ b/protected/humhub/docs/guide/developer/modules-users.md @@ -4,7 +4,7 @@ Users User Component --------------------- -The [[\humhub\modules\user\component\User]] component can be accessed by `Yii::$app->user` and beside others provides the following +The [[\humhub\modules\user\components\User]] component can be accessed by `Yii::$app->user` and beside others provides the following features: - Access the [user identity](#user-identity) of the currently logged in user: @@ -84,7 +84,7 @@ public static function onUserSoftDelete(UserEvent $event) The hard delete option will wipe all data in relation with the deleted user. HumHub objects created by the user like comments, files, posts, notification or activities will automatically be removed with the user profile. -Example 'config.php': +Example '**config.php**': ```php $this->message, 'url' => $this->url, - 'someTextField' => 'Some text' + 'someTextField' => 'Some text' ); } - - // ... - + // ... } - ``` @@ -47,12 +43,10 @@ It's also required to handle/implement the [[\humhub\modules\search\engine\Searc Example: ```php - public static function onSearchRebuild($event) { foreach (models\NonContent::find()->all() as $obj) { \Yii::$app->search->add($obj); } } - ``` diff --git a/protected/humhub/docs/guide/developer/settings.md b/protected/humhub/docs/guide/developer/settings.md index dfea271ddc..aa9e10b59e 100644 --- a/protected/humhub/docs/guide/developer/settings.md +++ b/protected/humhub/docs/guide/developer/settings.md @@ -38,7 +38,7 @@ Save a serialized setting: $value = $module->settings->setSerialized($key, [['complex' => 'value']]) ``` -> Note `setSerialized` will use `Json::encode()` to serialize. +> Note: `setSerialized` will use `Json::encode()` to serialize. **Delete setting:** diff --git a/protected/humhub/docs/guide/developer/stream.md b/protected/humhub/docs/guide/developer/stream.md index 911b8d669a..fcb2a92e54 100644 --- a/protected/humhub/docs/guide/developer/stream.md +++ b/protected/humhub/docs/guide/developer/stream.md @@ -45,7 +45,7 @@ class WallEntry extends \humhub\modules\content\widgets\WallEntry **mymodule\widgets\views\wallEntry.php**: -```php +```html
title ?> myContent ?> diff --git a/protected/humhub/docs/guide/developer/testing.md b/protected/humhub/docs/guide/developer/testing.md index 894e63d93f..a8a715d97a 100644 --- a/protected/humhub/docs/guide/developer/testing.md +++ b/protected/humhub/docs/guide/developer/testing.md @@ -68,7 +68,9 @@ php yii migrate/up --includeModuleMigrations=1 --interactive=0 - Install test environment: -`php yii installer/auto` +``` +php yii installer/auto +``` - Set `HUMHUB_PATH` system variable @@ -107,13 +109,9 @@ For running a test for a specific environment you'll have to set te `--env` argu Example for running all functional tests of a tasks module in a master environment: 1. Create a file `@mymodule/tests/config/env/master/test.php` with the following content: - -``` -return [ - 'humhub_root' => '/pathToMasterBranch' -]; -``` - + return [ + 'humhub_root' => '/pathToMasterBranch' + ]; 2. If needed set further HumHub settings in `tasks/tests/config/env/master/funtional.php` 3. Run `codecept run functional --env master` diff --git a/protected/humhub/docs/guide/developer/widgets.md b/protected/humhub/docs/guide/developer/widgets.md index f42e0d4389..9be9375467 100644 --- a/protected/humhub/docs/guide/developer/widgets.md +++ b/protected/humhub/docs/guide/developer/widgets.md @@ -168,7 +168,7 @@ your `SimpleWidget.prototype.init` function. ### Reloadable JsWidgets Often you want to reload your widget in order to update parts of your view. This can be achieved by implementing the -[[humhub\widget\Reloadable]] interface and providing a reload-url in your `getReloadUrl()` as in the following example +[[humhub\widgets\Reloadable]] interface and providing a reload-url in your `getReloadUrl()` as in the following example ```php class ReloadableWidget extends JsWidget implements Reloadable @@ -177,7 +177,7 @@ class ReloadableWidget extends JsWidget implements Reloadable public function getReloadUrl() { - return ['/mymodule/widget/reload', 'id' => $this->modle->id]; + return ['/mymodule/widget/reload', 'id' => $this->id]; } } ``` diff --git a/protected/humhub/docs/guide/theme/mail.md b/protected/humhub/docs/guide/theme/mail.md index 51e438395d..b2ba349b40 100644 --- a/protected/humhub/docs/guide/theme/mail.md +++ b/protected/humhub/docs/guide/theme/mail.md @@ -13,11 +13,13 @@ Since the CSS support in mail templates is very limited, you may need to access You can access all CSS variables defined in `variables.less` by calling `Yii::$app->view->theme->variable('variableName');`. Example: -``` + +```html ... ... ... - \ No newline at end of file + +``` \ No newline at end of file diff --git a/protected/humhub/docs/guide/theme/migrate-0.20.md b/protected/humhub/docs/guide/theme/migrate-0.20.md index c2c4d0dad9..ee91ebb70c 100644 --- a/protected/humhub/docs/guide/theme/migrate-0.20.md +++ b/protected/humhub/docs/guide/theme/migrate-0.20.md @@ -6,19 +6,22 @@ Follow this steps to migrate an older theme ot 0.20: 1. Get the latest **style.css** [here](https://github.com/humhub/humhub/blob/v0.11/css/style.css) and copy it to **webroot/themes/yourtheme/css/** -2. Open the file ``head.php`` in **/themes/yourtheme/views/layouts/** +2. Open the file `head.php` in **/themes/yourtheme/views/layouts/** 3. Remove this code snippet: -`` - -`` + + `` 4. To load the old **style.css**, insert this code to the first line: -`` - -`` -5. Change the structure of all reference calls for your additional theme files from -```` to ````. + `` -6. Check if everything works well, and fix optical issues at your theme file, if necessery. \ No newline at end of file +5. Change the structure of all reference calls for your additional theme files from: + + `` + + to: + + `` + +6. Check if everything works well, and fix optical issues at your theme file, if necessary. \ No newline at end of file diff --git a/protected/humhub/docs/guide/theme/migrate-1.2.md b/protected/humhub/docs/guide/theme/migrate-1.2.md index 39a1b77f47..543dfbab84 100644 --- a/protected/humhub/docs/guide/theme/migrate-1.2.md +++ b/protected/humhub/docs/guide/theme/migrate-1.2.md @@ -27,19 +27,19 @@ The new stream javascript rewrite requires some additional data-* attributes, wh Please check the following files for changes, in case your theme does overwrite those files: -- protected/humhub/modules/stream/widget/views/stream.php -- protected/humhub/modules/content/views/layouts/wallEntry.php +- `protected/humhub/modules/stream/widget/views/stream.php` +- `protected/humhub/modules/content/views/layouts/wallEntry.php` The same applies to the activity stream: -- protected/humhub/modules/activity/widget/views/activityStream.php -- protected/humhub/modules/activity/views/layouts/web.php +- `protected/humhub/modules/activity/widget/views/activityStream.php` +- `protected/humhub/modules/activity/views/layouts/web.php` ## Legacy Themes Old themes, should check the following file for changes: -- humhub/themes/HumHub/css/theme.deprecated.less +- `humhub/themes/HumHub/css/theme.deprecated.less` > Note: This file will not be maintained in the future. @@ -56,11 +56,13 @@ humhub module with an `init` function for your initialization logic. You can also disable pjax by using the following configuration param in your `protected/config/common.php`: +```php return [ 'params' => [ 'enablePjax' => false, ] ] +``` > Note: Since pjax provides a major performance boost, you should consider merging your Theme to the new pjax logic. @@ -76,44 +78,44 @@ The old **ekko lighbox** was replaced by the [blueimp ](https://blueimp.github.i does overwrite a view with gallery images, you'll have to use the new **data-ui-gallery** attribute instead of the **data-toggle** and **data-gallery** attributes. Please check the following files: -- modules/file/widgets/views/showFiles.php -- modules/space/widgets/views/header.php -- modules/tour/views/tour/welcome.php -- modules/user/widgets/views/profileHeader.php +- `modules/file/widgets/views/showFiles.php` +- `modules/space/widgets/views/header.php` +- `modules/tour/views/tour/welcome.php` +- `modules/user/widgets/views/profileHeader.php` ## JS Rewrite: The JS Rewrite removed many inline script blocks from views and uses the new Javascript Module System with data-* attributes. Many UI Components and Widget had been rewritten. - **General Rewrite**: - - modules/like/widget/views/likeLink.php - - modules/admin/views/setting/design.php - - modules/space/views/create/invite.php - - modules/space/views/membership/invite.php - - modules/comment/widget/views/showComment.php - - modules/files/widget/views/showFiles.php - - modules/post/widget/views/post.php + - `modules/like/widget/views/likeLink.php` + - `modules/admin/views/setting/design.php` + - `modules/space/views/create/invite.php` + - `modules/space/views/membership/invite.php` + - `modules/comment/widget/views/showComment.php` + - `modules/files/widget/views/showFiles.php` + - `modules/post/widget/views/post.php` - **Richtext rewrite**: - - modules/comment/widget/views/form.php - - modules/comment/views/comment/edit.php - - modules/post/views/post/edit.php - - modules/post/widget/views/form.php + - `modules/comment/widget/views/form.php` + - `modules/comment/views/comment/edit.php` + - `modules/post/views/post/edit.php` + - `modules/post/widget/views/form.php` - **UserPicker rewrite**: - - modules/admin/views/group/edit.php - - modules/admin/views/group/members.php - - modules/content/widgets/views/wallCreateContentForm.php + - `modules/admin/views/group/edit.php` + - `modules/admin/views/group/members.php` + - `modules/content/widgets/views/wallCreateContentForm.php` - **TabbedForm**: - - modules/admin/views/user/add.php - - modules/admin/views/user/edit.php - - modules/user/views/account/_userProfileLayout.php - - modules/user/views/account/_userSettingsLayout.php + - `modules/admin/views/user/add.php` + - `modules/admin/views/user/edit.php` + - `modules/user/views/account/_userProfileLayout.php` + - `modules/user/views/account/_userSettingsLayout.php` - **Space Picker** - - modules/admin/views/group/edit.php - - modules/admin/views/setting/basic.php - - modules/search/views/search/index.php + - `modules/admin/views/group/edit.php` + - `modules/admin/views/setting/basic.php` + - `modules/search/views/search/index.php` - **Refactored**: - - modules/search/views/search/index.php + - `modules/search/views/search/index.php` - **Pjax** - - modules/tour/widgets/views/tourPanel.php + - `modules/tour/widgets/views/tourPanel.php` - **Notification**: - - modules/notification/widget/views/overview.php \ No newline at end of file + - `modules/notification/widget/views/overview.php` \ No newline at end of file diff --git a/protected/humhub/docs/guide/theme/structure.md b/protected/humhub/docs/guide/theme/structure.md index c49f0a4dbc..90d0f75aaa 100644 --- a/protected/humhub/docs/guide/theme/structure.md +++ b/protected/humhub/docs/guide/theme/structure.md @@ -32,6 +32,7 @@ Once you created an own theme folder, you need to enable it in the administratio This overview shows a complete theme folder structure including own less and view files. +``` /themes/ /mytheme/ - My Theme Name /css/ - Your theme css files (optional) @@ -51,3 +52,4 @@ This overview shows a complete theme folder structure including own less and vie /widgets/ - Links to /someModule/widgets/views/ someWidget.php - Overwritten widget view /widgets/ - Links to /protected/widget/views +``` \ No newline at end of file