Create Module Drupal 7 – Part 2

In this tutorial, we will continue Drupal developpement sample of our module called myblock in part 1.
By implementing hook_help(), a module can make documentation available to the user for the module as a whole, or for

specific paths. For our example myblock module let us write this hook below :

myblock_help

It will display “Help” the following in Module details

 

myblock_admin

If we click on help we will have a documentation detail for our drupal module as below :

myblock_admin_help

hook_permission

This hook can supply permissions that the module defines, so that they can be selected on the user permissions page and used to grant or restrict access to actions the module performs. the array access mypage is the link between myblock_menu and myblock_permission.

myblock_menu

When module myblock is installed no permissions are in place so we get an unauthorized access to the meny ressource mypage.

myblock_no_permission

When module myblock permissions are allowed  so we get an authorized access to the meny ressource mypage.

myblock_menu1

Hope this tutorial will help you to start in drupal 7 developpement module with more confidence.

Cheers,

 

 

extradrmtech

Since 30 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions and medias protecting solutions. I am experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. Besides my work, I like to work freelance only on some wordpress projects because it is relaxing and delightful CMS for me. When not working, I like to dance salsa and swing and to have fun with my little family.

You may also like...