You are here

function galleria_is_valid in Galleria 6

Check that the node is a valid Galleria.

2 calls to galleria_is_valid()
galleria_html in ./galleria.module
Menu callback to create just the HTML data that gets embedded in a lightbox. Only supports attached files Gallerias, not imagefield ones.
galleria_nodeapi in ./galleria.module
Implementation of hook_nodeapi().

File

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

Code

function galleria_is_valid($node) {
  $valid = FALSE;
  if (is_object($node)) {

    // are there attachments?
    if (!empty($node->files)) {
      if (!($valid = galleria_validate_file_extensions($node->files))) {
        galleria_set_message(t('Invalid Galleria: at least one attachment must be an image. See README.txt for help.'), 'error');
      }
    }
    else {
      galleria_set_message(t('Invalid Galleria: there are no attachments. See README.txt for help.'), 'error');
    }
  }
  else {
    galleria_set_message(t('Invalid Galleria: not a node. See README.txt for help.'), 'error');
  }
  return $valid;
}