Org.routamc.gallery

From OpenPSA Wiki

Jump to: navigation, search

This Component handles the display of photo galleries. The management and the display of individual photos is handled by org.routamc.photostream. Together, they form a replacement for net.siriux.photos.

A script exists to convert old net.siriux.photos galleries to the new format. It has to be called as a MidCOM URL Method:

http://YOURHOSTNAME/midcom-exec-org.routamc.photostream/convert_nsphotos.php


[edit] Changing subgallery behaviour

org.routamc.gallery handles subgalleries without images (but with sub-subgalleries) differently than net.siriux.photostream. To get the old behaviour back, you can manually patch handler/index.php to include the following:

<?php
             $photolinks = $qb->execute();
             if (count($photolinks) == 0)
             {
                //gallery has no images, try to see if it holds any subgalleries
                $nav = new midcom_helper_nav();
                $nodes = $nav->list_nodes($data['gallery'][MIDCOM_NAV_ID]);
                foreach ($nodes as $node_id)
                {
                    $node = $nav->get_node($node_id);
                    if ($node[MIDCOM_NAV_COMPONENT] == "org.routamc.gallery")
                    {
                        $qb2 = org_routamc_gallery_photolink_dba::new_query_builder();
                        $qb2->set_limit(1);
                        $qb2->add_constraint('node', '=', $node[MIDCOM_NAV_ID]);
                        $photolinks = $qb2->execute();
                        break;
                    }
                }
                if (count($photolinks) == 0)
                {
                    // Skip this gallery, it has no images
                    continue;
                }
             }
?>
Personal tools