diff --git a/admin/templates/articles/article-edit.php b/admin/templates/articles/article-edit.php index 24e8d84..248cb07 100644 --- a/admin/templates/articles/article-edit.php +++ b/admin/templates/articles/article-edit.php @@ -4,6 +4,17 @@ $this -> user['id'], + 'expires' => time() + 60*20 +]; + +$_SESSION['rfm_akey'] = bin2hex(random_bytes(16)); +$_SESSION['rfm_akey_expires'] = time() + 20*60; +$_SESSION['can_use_rfm'] = true; +$rfmAkeyJS = $_SESSION['rfm_akey']; + ob_start(); ?>
@@ -63,7 +74,7 @@ ob_start(); 'value' => htmlspecialchars( $this -> article['languages'][ $lg['id'] ]['main_image'] ), 'icon_content' => 'przeglądaj', 'inline' => true, - 'icon_js' => "window.open ( '/libraries/filemanager-9.14.2/dialog.php?type=1&popup=1&field_id=main_image_" . $lg['id'] . "&akey=c3cb2537d25c0efc9e573d059d79c3b8', 'mywindow', 'location=1,status=1,scrollbars=1, width=1100,height=700');" + 'icon_js' => "window.open ( '/libraries/filemanager-9.14.2/dialog.php?type=1&popup=1&field_id=main_image_" . $lg['id'] . "&akey=" . $rfmAkeyJS . "', 'mywindow', 'location=1,status=1,scrollbars=1, width=1100,height=700');" ] ); ?> , #entry_, #table_of_contents_' ).ckeditor( { toolbar : 'MyToolbar', - height:'250' + height:'250', + filebrowserBrowseUrl: '/libraries/filemanager-9.14.2/dialog.php?type=2&editor=ckeditor&akey=', + filebrowserImageBrowseUrl: '/libraries/filemanager-9.14.2/dialog.php?type=1&editor=ckeditor&akey=', + filebrowserUploadUrl: '/libraries/filemanager-9.14.2/dialog.php?type=2&editor=ckeditor&upload=1&akey=', + filebrowserImageUploadUrl: '/libraries/filemanager-9.14.2/dialog.php?type=1&editor=ckeditor&upload=1&akey=' }); }); @@ -401,6 +416,9 @@ echo $grid -> draw(); $( "#images-uploader" ).pluploadQueue( { + multipart_params: { + upload_token: '', + }, runtimes: 'html5,flash,html4', init: { @@ -453,6 +471,9 @@ echo $grid -> draw(); $( "#files-uploader" ).pluploadQueue( { + multipart_params: { + upload_token: '', + }, runtimes: 'html5,flash,html4', init: { diff --git a/admin/templates/banners/banner-edit.php b/admin/templates/banners/banner-edit.php index 02ffcdf..dd811f6 100644 --- a/admin/templates/banners/banner-edit.php +++ b/admin/templates/banners/banner-edit.php @@ -4,6 +4,11 @@ \S::set_session( 'admin', true ); global $db; +$_SESSION['rfm_akey'] = bin2hex(random_bytes(16)); +$_SESSION['rfm_akey_expires'] = time() + 20*60; +$_SESSION['can_use_rfm'] = true; +$rfmAkeyJS = $_SESSION['rfm_akey']; + ob_start(); ?> @@ -80,7 +85,7 @@ ob_start(); 'id' => 'src_' . $lg['id'], 'value' => $this -> banner['languages'][ $lg['id'] ]['src'], 'icon_content' => 'przeglądaj', - 'icon_js' => "window.open ( 'http://" . $_SERVER['SERVER_NAME'] . "/libraries/filemanager-9.14.2/dialog.php?type=1&popup=1&field_id=src_" . $lg['id'] . "&akey=c3cb2537d25c0efc9e573d059d79c3b8', 'mywindow', 'location=1,status=1,scrollbars=1, width=1100,height=700');" + 'icon_js' => "window.open ( 'http://" . $_SERVER['SERVER_NAME'] . "/libraries/filemanager-9.14.2/dialog.php?type=1&popup=1&field_id=src_" . $lg['id'] . "&akey=" . $rfmAkeyJS . "', 'mywindow', 'location=1,status=1,scrollbars=1, width=1100,height=700');" ) ); ?> diff --git a/admin/templates/shop-producer/edit.php b/admin/templates/shop-producer/edit.php index c9139ba..5cd1393 100644 --- a/admin/templates/shop-producer/edit.php +++ b/admin/templates/shop-producer/edit.php @@ -2,6 +2,12 @@
@@ -30,7 +36,7 @@ ob_start(); 'id' => 'img', 'value' => $this -> producer['img'], 'icon_content' => 'przeglądaj', - 'icon_js' => "window.open ( 'http://" . $_SERVER['SERVER_NAME'] . "/libraries/filemanager-9.14.2/dialog.php?type=1&popup=1&field_id=img&akey=c3cb2537d25c0efc9e573d059d79c3b8', 'mywindow', 'location=1,status=1,scrollbars=1, width=1100,height=700');" + 'icon_js' => "window.open ( 'http://" . $_SERVER['SERVER_NAME'] . "/libraries/filemanager-9.14.2/dialog.php?type=1&popup=1&field_id=img&akey=" . $rfmAkeyJS . "', 'mywindow', 'location=1,status=1,scrollbars=1, width=1100,height=700');" ] ); ?>
diff --git a/admin/templates/shop-product/product-edit.php b/admin/templates/shop-product/product-edit.php index 528d301..d3ae45e 100644 --- a/admin/templates/shop-product/product-edit.php +++ b/admin/templates/shop-product/product-edit.php @@ -4,6 +4,17 @@ $this -> user['id'], + 'expires' => time() + 60*20 +]; + +$_SESSION['rfm_akey'] = bin2hex(random_bytes(16)); +$_SESSION['rfm_akey_expires'] = time() + 20*60; +$_SESSION['can_use_rfm'] = true; +$rfmAkeyJS = $_SESSION['rfm_akey']; + ob_start(); ?> @@ -119,7 +130,11 @@ ob_start(); $(function() { $('#short_description_, #description_').ckeditor({ toolbar: 'MyToolbar', - height: '250' + height: '250', + filebrowserBrowseUrl: '/libraries/filemanager-9.14.2/dialog.php?type=2&editor=ckeditor&akey=', + filebrowserImageBrowseUrl: '/libraries/filemanager-9.14.2/dialog.php?type=1&editor=ckeditor&akey=', + filebrowserUploadUrl: '/libraries/filemanager-9.14.2/dialog.php?type=2&editor=ckeditor&upload=1&akey=', + filebrowserImageUploadUrl: '/libraries/filemanager-9.14.2/dialog.php?type=1&editor=ckeditor&upload=1&akey=' }); }); @@ -208,7 +223,11 @@ ob_start(); $(function() { $('#tab_description_1_, #tab_description_2_').ckeditor({ toolbar: 'MyToolbar', - height: '250' + height: '250', + filebrowserBrowseUrl: '/libraries/filemanager-9.14.2/dialog.php?type=2&editor=ckeditor&akey=', + filebrowserImageBrowseUrl: '/libraries/filemanager-9.14.2/dialog.php?type=1&editor=ckeditor&akey=', + filebrowserUploadUrl: '/libraries/filemanager-9.14.2/dialog.php?type=2&editor=ckeditor&upload=1&akey=', + filebrowserImageUploadUrl: '/libraries/filemanager-9.14.2/dialog.php?type=1&editor=ckeditor&upload=1&akey=' }); }); @@ -826,6 +845,9 @@ echo $grid->draw(); }); $("#images-uploader").pluploadQueue({ + multipart_params: { + upload_token: '', + }, runtimes: 'html5,flash,html4', init: { Refresh: function(up) { @@ -874,6 +896,9 @@ echo $grid->draw(); }); $("#files-uploader").pluploadQueue({ + multipart_params: { + upload_token: '', + }, runtimes: 'html5,flash,html4', init: { Refresh: function(up) { diff --git a/admin/templates/update/main-view.php b/admin/templates/update/main-view.php index af81a3c..d22a1db 100644 --- a/admin/templates/update/main-view.php +++ b/admin/templates/update/main-view.php @@ -64,7 +64,7 @@ echo $grid -> draw(); ?> \admin\factory\Articles::article_details( (int)\S::get( 'id' ) ), + 'menus' => \admin\factory\Pages::menus_list(), + 'languages' => \admin\factory\Languages::languages_list(), + 'layouts' => \admin\factory\Layouts::layouts_list(), + 'user' => $user + ] ); } public static function view_list() diff --git a/autoload/admin/controls/class.ShopProduct.php b/autoload/admin/controls/class.ShopProduct.php index 9bb79f5..5a086bf 100644 --- a/autoload/admin/controls/class.ShopProduct.php +++ b/autoload/admin/controls/class.ShopProduct.php @@ -229,22 +229,29 @@ class ShopProduct } // edycja produktu - public static function product_edit() - { + public static function product_edit() { + global $user; + + if ( !$user ) { + header( 'Location: /admin/' ); + exit; + } + \admin\factory\ShopProduct::delete_nonassigned_images(); \admin\factory\ShopProduct::delete_nonassigned_files(); return \Tpl::view( 'shop-product/product-edit', [ - 'product' => \admin\factory\ShopProduct::product_details( (int) \S::get( 'id' ) ), - 'languages' => \admin\factory\Languages::languages_list(), - 'categories' => \admin\factory\ShopCategory::subcategories( null ), - 'layouts' => \admin\factory\Layouts::layouts_list(), - 'products' => \admin\factory\ShopProduct::products_list(), - 'dlang' => \front\factory\Languages::default_language(), - 'sets' => \shop\ProductSet::sets_list(), - 'producers' => \admin\factory\ShopProducer::all(), - 'units' => \admin\factory\Dictionaries::all_units() - ] ); + 'product' => \admin\factory\ShopProduct::product_details( (int) \S::get( 'id' ) ), + 'languages' => \admin\factory\Languages::languages_list(), + 'categories' => \admin\factory\ShopCategory::subcategories( null ), + 'layouts' => \admin\factory\Layouts::layouts_list(), + 'products' => \admin\factory\ShopProduct::products_list(), + 'dlang' => \front\factory\Languages::default_language(), + 'sets' => \shop\ProductSet::sets_list(), + 'producers' => \admin\factory\ShopProducer::all(), + 'units' => \admin\factory\Dictionaries::all_units(), + 'user' => $user + ] ); } // ajax_load_products ARCHIVE diff --git a/autoload/admin/view/class.Articles.php b/autoload/admin/view/class.Articles.php index 4722564..687c4cd 100644 --- a/autoload/admin/view/class.Articles.php +++ b/autoload/admin/view/class.Articles.php @@ -8,7 +8,7 @@ class Articles $tpl = new \Tpl; return $tpl -> render( 'articles/articles-browse-list' ); } - + public static function subpages_list( $pages, $article_pages, $parent_id = 0, $step = 1 ) { $tpl = new \Tpl(); @@ -18,21 +18,11 @@ class Articles $tpl -> article_pages = $article_pages; return $tpl -> render( 'articles/subpages-list' ); } - + public static function articles_list() { $tpl = new \Tpl; return $tpl -> render( 'articles/articles-list' ); } - - public static function article_edit( $article, $menus, $languages, $layouts ) - { - $tpl = new \Tpl; - $tpl -> article = $article; - $tpl -> menus = $menus; - $tpl -> languages = $languages; - $tpl -> layouts = $layouts; - return $tpl -> render( 'articles/article-edit' ); - } } ?> \ No newline at end of file diff --git a/templates/.DS_Store b/templates/.DS_Store index 35bede8..96797d4 100644 Binary files a/templates/.DS_Store and b/templates/.DS_Store differ