-
-
+
diff --git a/system/admin/views/layout.html.php b/system/admin/views/layout.html.php
index ba3eb73..8652db8 100644
--- a/system/admin/views/layout.html.php
+++ b/system/admin/views/layout.html.php
@@ -1,6 +1,6 @@
-
+
diff --git a/system/htmly.php b/system/htmly.php
index 5771af5..cffeb26 100644
--- a/system/htmly.php
+++ b/system/htmly.php
@@ -1824,6 +1824,14 @@ post('/admin/menu', function () {
}
});
+post('/admin/gallery', function () {
+
+ if (login()) {
+ $page = from($_REQUEST, 'page');
+ $images = image_gallery(null, $page, 40);
+ echo json_encode(array('images' => $images));
+ }
+});
// Show category page
get('/admin/categories', function () {
diff --git a/system/includes/functions.php b/system/includes/functions.php
index edaefbd..8750c40 100644
--- a/system/includes/functions.php
+++ b/system/includes/functions.php
@@ -222,19 +222,19 @@ function get_zip_files()
}
// Get images in content/images folder
-function get_gallery() {
- static $_gallery = array();
- if (empty($_gallery)) {
+function scan_images() {
+ static $_images = array();
+ if (empty($_images)) {
$tmp = array();
$tmp = glob('content/images/*', GLOB_NOSORT);
if (is_array($tmp)) {
foreach ($tmp as $file) {
- $_gallery[] = pathinfo($file);
+ $_images[] = pathinfo($file);
}
}
- usort($_gallery, "sortfile_d");
+ usort($_images, "sortfile_d");
}
- return $_gallery;
+ return $_images;
}
// usort function. Sort by filename.
diff --git a/system/resources/js/media.uploader.js b/system/resources/js/media.uploader.js
index f350325..0e7087c 100644
--- a/system/resources/js/media.uploader.js
+++ b/system/resources/js/media.uploader.js
@@ -8,6 +8,8 @@
$('#insertImageDialogFile').val('');
$('#insertMediaDialogURL').val('');
$('#insertMediaDialogFile').val('');
+ $('#gallery-1').html(initial_image);
+ $('#gallery-2').html(initial_image);
};
$('#insertMediaDialogInsert').click( function() {
$('.media-uploader').val('');