コード例 #1
0
 /**
  * get front html from data
  */
 public function getHtmlFrontFromData($data)
 {
     $catID = UniteFunctionsUG::getVal($data, "catid");
     $galleryID = UniteFunctionsUG::getVal($data, "galleryID");
     UniteFunctionsUG::validateNumeric($catID, "category id");
     if (empty($galleryID)) {
         UniteFunctionsUG::throwError("The gallery ID not given");
     }
     //get thumb resolution param from the gallery
     $gallery = new UniteGalleryGallery();
     $gallery->initByID($galleryID);
     //validate if enable categories
     $enableCatTabs = $gallery->getParam('enable_category_tabs');
     $enableCatTabs = UniteFunctionsUG::strToBool($enableCatTabs);
     if ($enableCatTabs == false) {
         UniteFunctionsUG::throwError("The tabs functionality disabled");
     }
     //check that the category id inside the params
     $params = $gallery->getParams();
     $tabCatIDs = $gallery->getParam("categorytabs_ids");
     $arrTabIDs = explode(",", $tabCatIDs);
     if (in_array($catID, $arrTabIDs) == false) {
         UniteFunctionsUG::throwError("Get items not alowed for this category");
     }
     //get thumb size
     $thumbSize = $gallery->getParam("thumb_resolution");
     $bigImageSize = $gallery->getParam("big_image_resolution");
     //get arrItems
     $arrItems = $this->getCatItems($catID);
     //get items html
     $htmlItems = $this->getItemsHtmlFront($arrItems, $thumbSize, $bigImageSize);
     return $htmlItems;
 }