<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm writing a module to custom drupal for our needs.<div><br></div><div>My question is about including files.</div><div><br></div><div>I have some page callbacks, which are defined in my hook_menu function like so:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 130, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #660000">$items</span><span style="color: #000000">[</span>'mymodule/myaction'<span style="color: #000000">] = </span><span style="color: #0000ff">array</span><span style="color: #000000">(</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 130, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; </span>'title' <span style="color: #000000">=> </span>'Custom Action'<span style="color: #000000">,</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 130, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; </span>'page callback' <span style="color: #000000">=> </span>'mymodule_myaction'<span style="color: #000000">,</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; <span style="color: #008200">'type' </span>=> MENU_CALLBACK,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 130, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; </span>'file' <span style="color: #000000">=> </span>'mymodule.module'<span style="color: #000000">,</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 130, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; </span>'access callback' <span style="color: #000000">=> </span><span style="color: #0000ff">TRUE</span><span style="color: #000000">,</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; );</div><div>&nbsp;</div><div>However, common functions, such as `url()` cannot be used because they are not included.</div><div><br></div><div>I would have thought that `/includes/common.inc` would be already included, since drupal has got far enough to call my page callback function.</div><div><br></div><div>In my handler function, I have had to include:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 130, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #0000ff">require_once </span>'./includes/common.inc'<span style="color: #000000">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 130, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #0000ff">require_once </span>'./includes/path.inc'<span style="color: #000000">;</span></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div></div><div>to access drupal's functionality that I want.</div><div><br></div><div>Or have I missed something really obvious!!?</div><div><br></div><div>-matt</div><div><br></div></div></body></html>