<?php

 

      require_once(xcConfig::get("lib-path").'xgFactory.class.php');

 

      xcConfig::set("gallery-path","examples/integrated/");

      $root        = xcConfig::get("root-path");

      $url         = xcConfig::get("url");

      $folder      = xgFactory::createItem($url);

      $parent      = $folder->getParent();

      $columnCount = xcConfig::get("gallery-column-count");;

      //xgFactory::createItem($url);

 

      // for picLens

      echo "      <link rel=\"alternate\"  href=\"".$root."rss.php?url=".$url."\" type=\"application/rss+xml\" title=\"".$folder->getTitle()."\" id=\"gallery\" />\n";

 

      echo "      <div id=\"galleryContentBox\">\n";

 

      if($lang == "english"){

            echo "            <h3>Gallery integrated in the design of the website</h3>";

      }

      else{

            echo "            <h3>In das Design der Seite integrierte Galerie</h3>";

      }

 

      // Table with pictures

      echo "\n         <table id=\"gallery\">\n";

 

      $itemNr = 0;

      foreach ($folder->getChildren() as $item) {

 

            // new row

            if ($itemNr % $columnCount == 0) {

                  echo "                  <tr>\n";

            }

     

            // display item

            echo "                        <td><a href=\"".$root."image.php?url=".$item->getLink()."\">\n";

            echo "                              <img src=\"".$root."image.php?url=".$item->getThumbnailUrl()."\">\n";

 

            echo "                              <span style=\"display: none;\">#gallery ".$item->getGUID()."</span>\n";

            echo "                        </a></td>\n";

     

            // end of row

            if ($itemNr % $columnCount == $columnCount - 1) {

                  echo "                  </tr>\n";

            }

 

            $itemNr++;

      }

      echo "                        <td id=\"cellSourceCode\">\n";

      if($lang == "english"){

            echo "                              <a href=\"pages/sourceCodeGallery.html\" target=\"_blank\">Source Code</a><br>\n";

            echo "                              <a href=\"pages/configGallery.html\" target=\"_blank\">Config File</a><br>\n";

            echo "                              <a href=\"index.php?section=examples&lang=english\">Go back to examples</a>\n";

      }

      else {

            echo "                              <a href=\"pages/sourceCodeGallery.html\" target=\"_blank\">Quelltext</a><br>\n";

            echo "                              <a href=\"pages/configGallery.html\" target=\"_blank\">Konfigurationsdatei</a><br>\n";

            echo "                              <a href=\"index.php?section=examples\">Zur&uuml;ck zu den Beispielen</a>\n";

      }

      echo "                        </td>\n              </tr>\n";

      echo "            </table>\n";

      echo "      </div>\n";

 

      // Error div

      if (xcConfig::hasErrors()) {

     

            echo "      <div id=\"errors\">\n";

            echo "<b>ERROR LOG</b>";

            echo "<hr size=\"1\" style=\"color:#ccc\" />\n";

            foreach (xcConfig::getErrors() as $error) {

                  echo $error."<br />";

            }

            echo "      </div>\n";

      }

 

?>