18.10.2016 Views

Drupal 7 Module Development

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Node Access<br />

And we are done, right? Well, we have properly enforced our rules, which is a<br />

deny statement for users who do not pass the time threshold. However, we have<br />

not completed our function, since the API requires a return statement from every<br />

module, so we must add a final note that indicates our indifference to other rules.<br />

return NODE_ACCESS_IGNORE;<br />

Now we are done. In one simple module, in just sixteen lines of code (six of which<br />

are comments), we have changed the rules for content creation on our site. Here is<br />

the entire module (except for the delay.info file):<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!