You are here

function galleria_html in Galleria 6

Menu callback to create just the HTML data that gets embedded in a lightbox. Only supports attached files Gallerias, not imagefield ones.

Parameters

$nid: node id to serve XML from

1 string reference to 'galleria_html'
galleria_menu in ./galleria.module
Implementation of hook_menu().

File

./galleria.module, line 154
Turns a node into a Galleria image gallery.

Code

function galleria_html($nid = NULL) {
  if (is_numeric($nid)) {
    $node = node_load($nid);

    // is this a galleria type?
    if (variable_get("galleria_{$node->type}", 0) == 1) {
      if (galleria_is_valid($node)) {

        // build the galleria
        galleria_includes();
        $output = theme('galleria_files', $node);

        // just blat it, short circuiting Drupal page load.
        print $output;
      }
      else {

        // don't bother setting error messages as this is done in the validation check
        return drupal_not_found();
      }
    }
    else {
      drupal_set_message(t('Node type is not selected as a Galleria. See README.txt for help.'), 'error');
    }
  }
}