title: Apply custom page template to content from Drupal 7 module
body: <p>I am developing a Drupal module. Part of it opens a pop-up window, displays some elements in it, and uses JavaScript to transfer input back to the main page.</p>
  
  <p>As this is a small window, I don't want it to display the full theme borders from the site's theme.</p>
  
  <p>In Drupal 6 I was able to achieve this with the following:</p>
  
  <pre><code>function MyPopupPageHandler() {
    @content = "Content...";
    //Add additional content to @content;
    print theme("page", @content);
  }
  </code></pre>
  
  <p>However, Drupal 7 expects the second parameter of the theme() function to be an array, and none of the examples I've seen show how I set the main content of the page.</p>
  
  <p>What I'd like is a custom page template in the module, that can be overridden by the site theme if it provides one.</p>
  
  <p>I would like to know:</p>
  
  <ol>
  <li>What elements do I need to put in the array I pass to the theme() function?</li>
  <li>What should I call my template file?</li>
  <li>How do I tell Drupal where to find my template, as it needs to be in the module by default?</li>
  </ol>
  
  <p>Appreciate any help you can offer.</p>
  
  <p>James</p>