<?php 
}
?>
            </select>
        <span class="help-block" id="warning_comment_allowed"></span>    
        </div>
    </div>
  <div id="formgroup_post_files" class="form-group">
    <label for="post_files" class="col-sm-2 control-label"><?php 
echo Lang::t('post_files');
?>
</label>

    <div class="col-sm-10">
<?php 
$c = new \Leap\View\InputFileMultiple("post_files", "post_files", $obj->post_files);
$c->p();
?>
                <span class="help-block" id="warning_post_files"></span>
    </div>
</div>
  
  
  <!-- channel tambahan -->
  <div id="formgroup_page_channel_id" class="form-group">
        <label for="page_channel_id" class="col-sm-2 control-label"><?php 
echo Lang::t('page_channel_id');
?>
</label>
        <div class="col-sm-10">
            <?php 
    function galleryOpen()
    {
        $gal = new Gallery();
        $gid = isset($_GET['gid']) ? addslashes($_GET['gid']) : '0';
        if ($gid == '0') {
            die("Please provide ID");
        }
        $gal->getByID($gid);
        $default = "Click here to enter description";
        if ($gal->gallery_description != "") {
            $default = $gal->gallery_description;
        }
        ?>
        <style>
            .gal_description{
                font-size: 1.2em;
                padding-bottom: 20px;
                padding-top: 0px;
            }

        </style>
        <div style="float: right; width: 100px;">
            <small><button onclick="lwclose('GalleryOpen');" class="btn btn-default btn-xs"><?php 
        echo Lang::t("back to gallery");
        ?>
</button></small>

        </div>
        <h1 id="h1_<?php 
        echo $gid;
        ?>
" contenteditable="true" onblur="galleryUpdateName(<?php 
        echo $gid;
        ?>
);"><?php 
        echo $gal->gallery_name;
        ?>
 &nbsp; </h1>
        <div id="galdesc_<?php 
        echo $gid;
        ?>
" class="gal_description" contenteditable="true" onblur="galleryUpdateDes(<?php 
        echo $gid;
        ?>
);"><?php 
        echo $default;
        ?>
</div>
        <div class="checkcarousel"><input <?php 
        if ($gal->gallery_carousel) {
            echo "checked";
        }
        ?>
 onclick="use_carousel(<?php 
        echo $gid;
        ?>
,this.checked);" type="checkbox"> use as Carousel?</div>

        <p class="bg-info howto">
            <?php 
        echo Lang::t("Please upload your pictures here. Select main picture of the album using checkbox.");
        ?>
        </p>
        <div id="progress2">
            <div class="bar" style="width: 0%;"></div>
        </div>

        <?php 
        $new = new \Leap\View\InputFileMultiple("pics", "pics", "");
        //alert($(\"input[name='pics']\").val()); //untuk test dibawah
        $new->uploaded_js_hook = "savePicsToGallery(\$(\"input[name='pics']\").val(),'" . $gid . "');\$(\"input[name='pics']\").val('');\$(\"input[type='file']\").val('');";
        $new->p();
        ?>
        <!--
        <input id="fileuploadGallery" type="file" name="files[]" data-url="<?php 
        echo _LANGPATH;
        echo $this->imageProcURL;
        ?>
" multiple>
        -->
        <div id="hasilalbum"></div>

        <style>
            .bar {
                height: 18px;
                background: green;
            }
            .gp_thumb{
                text-align: center;
                min-height: 150px;
            }
            #hasilalbum{
                padding-top: 20px;
            }
            .gp_menu{
                padding: 5px;
            }
        </style>
        <script>
            $.get("<?php 
        echo _LANGPATH;
        ?>
GalleryWeb/pictureInsert?gid=<?php 
        echo $gid;
        ?>
&img=0", function( data ) {
                $( "#hasilalbum" ).html( data );
                //alert( "Load was performed." );
            });
//            $(function () {
//                $('#fileuploadGallery').fileupload({
//                    dataType: 'json',
//                    // Enable image resizing, except for Android and Opera,
//                    // which actually support image resizing, but fail to
//                    // send Blob objects via XHR requests:
//                    disableImageResize: /Android(?!.*Chrome)|Opera/
//                        .test(window.navigator.userAgent),
//                    process:[
//                        {
//                            action: 'load',
//                            fileTypes: /^image\/(gif|jpeg|png)$/,
//                            maxFileSize: 20000000 // 20MB
//                        },
//                        {
//                            action: 'resize',
//                            maxWidth: 1920,
//                            maxHeight: 1200,
//                            minWidth: 800,
//                            minHeight: 600
//                        },
//                        {
//                            action: 'save'
//                        }
//                    ], // Force cropped images
//                    done: function (e, data) {
//                        $.each(data.result.files, function (index, file) {
//                            $('<p/>').text(file.name).appendTo($('#hasilalbum'));
//                            //update the database
//                            $.get("<?php 
        //=_LANGPATH;
        ?>
//GalleryWeb/pictureInsert?gid=<?php 
        //=$gid;
        ?>
//&img="+file.name, function( data ) {
//                                $( "#hasilalbum" ).html( data );
//                                //alert( "Load was performed." );
//                            });
//                        });
//                        $('#progress2 .bar').hide();
//                    },
//                    progressall: function (e, data) {
//                        var progress = parseInt(data.loaded / data.total * 100, 10);
//                        $('#progress2 .bar').show().css(
//                            'width',
//                            progress + '%'
//                        );
//                    }
//                });
//            });
        </script>



    <?php 
    }