xlabs / boardbundle
Board bundle
Requires
- composer/installers: ~1.0
Requires (Dev)
- atm/commentbundle: ~1.0
- atm/emojisbundle: ~1.0
- doctrine/doctrine-bundle: ~1.4
- doctrine/orm: ^2.4.8
- dyninc/dyn-php: ^0.9.0
- friendsofsymfony/jsrouting-bundle: ^1.6
- qencode/api-client: 1.03.*
- xlabs/likebundle: ^1.0
- xlabs/resultcachebundle: ^1.0
Suggests
- symfony/asset: For using the AssetExtension
- symfony/expression-language: For using the ExpressionExtension
- symfony/finder: For using the finder
- symfony/form: For using the FormExtension
- symfony/http-kernel: For using the HttpKernelExtension
- symfony/routing: For using the RoutingExtension
- symfony/security: For using the SecurityExtension
- symfony/stopwatch: For using the StopwatchExtension
- symfony/templating: For using the TwigEngine
- symfony/translation: For using the TranslationExtension
- symfony/var-dumper: For using the DumpExtension
- symfony/yaml: For using the YamlExtension
README
Install through composer:
php -d memory_limit=-1 composer.phar require atm/boardbundle
In your AppKernel
public function registerbundles()
{
return [
...
...
new ATM\BoardBundle\ATMBoardBundle(),
];
}
Configuration sample
# app/config/config.yml
atm_board:
media_folder: Media folder.
user: Your user namespace.
image_width: width of the post image.
image_height: height of the post image.
watermark_image_small: small watermark path.
watermark_image_medium: medium watermark path.
watermark_image_big: big watermark path.
encoder_api_key: encoder api key from qencode.
encoder_profile_id: encoder profile id from qencode.
encoder_transfer_method_id: encoder profile id from qencode.
not_access_redirect_route: Redirect route when a user has no access to the board.
after_request_access_redirect_route: Redirect route after a request has sent to a user.
added_to_acl_redirect_route: Redirect route after a user is added to the acl.
removed_to_acl_redirect_route: Redirect route after a user is removed to the acl.
Routing
Append to the main routing file:
# app/config/routing.yml
atm_board:
resource: "@ATMBoardBundle/Controller/BoardController.php"
type: annotation
prefix: /
atm_board_admin:
resource: "@ATMBoardBundle/Controller/AdminController.php"
type: annotation
prefix: /
atm_board_qencode:
resource: "@ATMBoardBundle/Controller/QEncodeController.php"
type: annotation
prefix: /
Usage
First create a board using the following route:
{{ path('atm_board_create')
Once your board is created you can add post images, videos and texts. For videos you will need to start the rabbitMQ queue in your console:
- atm_board_encode_video:execute
The ACL
The board system also allows to give access to users that the owner of the board wants. First of all the user that wants access to your board has to send you a request using this route:
{{ path('atm_board_request_access') }}
The action of this route will throw the following event:
atm_board_request_access.event
In that event you can customize the way that the owner of the board will get the link to add the user that wants to check the board. That's the route for adding a user to a board's acl:
{{ path('atm_board_add_user_acl',{ 'boardId':board.id, 'userId':user.id }) }}
After adding the user to the board's acl the following event is thrown, with the board id and the user id added to the board acl as parameters:
atm_board_added_acl.event
If the owner of the board wants to remove a user from it's board that's the route to do that:
{{ path('atm_board_remove_user_acl',{ 'boardId':board.id, 'userId':user.id }) }}
This action throws the following event with the board id and the user id removed from the board acl as parameters
atm_board_deleted_acl.event
The Admin
The bundle has it's own admin panel to see all the users with a link to their boards, that's the route to the admin panel:
{{ path('atm_board_admin_index')