Ejemplo n.º 1
0
function extractConfig($carouselName)
{
    $path = CAROUSEL_DIR;
    $carouselObj = new pbalan\CarouselBuilder\CarouselBuilder();
    $dirObj = new pbalan\DirectoryParser\DirectoryParser();
    $listCarousel = $carouselObj->findConfig($path);
    if (true === is_array($listCarousel) && count($listCarousel) > 0) {
        if (in_array($path . '/carousel-store.json', $listCarousel)) {
            $listCarousel = $path . '/carousel-store.json';
        } else {
            $listCarousel = '';
        }
    }
    $content = "{\r\n}";
    $listCarousel = $carouselObj->createConfig(CAROUSEL_DIR, $content);
    $content = $dirObj->readFile($listCarousel);
    $carouselName = explode('_', basename($carouselName));
    if (true === isset($carouselName[1]) && false === empty($carouselName[1])) {
        $dimensionArr = explode('x', $carouselName[1]);
    } else {
        $dimensionArr = array();
    }
    if (true === isset($carouselName[0])) {
        $carouselName = $carouselName[0];
    } else {
        $carouselName = $carouselName;
    }
    $carouselList = json_decode($content, true);
    $carousels = $carouselObj->verifyExist($carouselList, $carouselName);
    $carousels = $carousels[0];
    return $carousels;
}
Ejemplo n.º 2
0
     $dirObj = new pbalan\DirectoryParser\DirectoryParser();
     $carouselObj = new pbalan\CarouselBuilder\CarouselBuilder();
     $listCarousel = $carouselObj->findConfig($path);
     if (true === is_array($listCarousel) && count($listCarousel) > 0) {
         if (in_array($path . '/carousel-store.json', $listCarousel)) {
             $listCarousel = $path . '/carousel-store.json';
         } else {
             $listCarousel = '';
         }
     }
     if (empty($listCarousel)) {
         $content = "{\r\n}";
         $listCarousel = $carouselObj->createConfig(CAROUSEL_DIR, $content);
         //echo "carousel-store.json configuration file was not found on the system"; exit;
     }
     $content = $dirObj->readFile($listCarousel);
     $carouselList = json_decode($content, true);
     $carousels = $carouselObj->verifyExist($carouselList);
     $moreCarousels = $carouselObj->checkMoreCarosuel(CAROUSEL_DIR);
     $display['carousels'] = $carousels;
 }
 if (true === isset($formPosts[$id]['formComponents']) && true === is_array($formPosts[$id]['formComponents'])) {
     foreach ($formPosts[$id]['formComponents'] as $key => $val) {
         if (true === is_array($val)) {
             foreach ($val as $k => $v) {
                 $display = array_merge($display, array($key . "_" . $k => $v));
             }
         } else {
             $display = array_merge($display, array($key => $val));
         }
     }