логика выставления текущего состоянии по архивным данным и данным из черновика

parent ef1d50d0
......@@ -22,6 +22,10 @@
overflow-y:auto;
}
.b-list_folders.active {
display: block;
}
.b-list_folders-item
{
position: relative;
......@@ -153,17 +157,18 @@
border-radius: 4px;
overflow: hidden;
cursor: pointer;
height: 450px;
height: calc(50vh - 30px);
}
.b-foto_inner-emul
.b-foto_inner-fict
{
height: 450px;
height: calc(50vh - 30px);
}
.b-foto_inner.single-row
{
height: auto;
max-height: calc(100vh - 60px);
}
.b-folder-content.has-selected .b-foto_inner.paired {
......
{"10-foto":{"1":["a1654670926-1.jpg","a1654670926-10.jpg"],"2":["a1654670926-2.jpg","a1654670926-3.jpg"],"3":["a1654670926-4.jpg","a1654670926-5.jpg"]},"2-foto":{"1":["a1654670926-1.jpg","a1654670926-2.jpg"]},"3-foto":{"1":["a1654665594-1.jpg","a1654665594-2.jpg"]},"4-foto":{"1":["a1654663117-1.jpg","a1654663117-2.jpg"]},"5-foto":"","6-foto":{"1":["a1654670995-1.jpg","a1654670995-3.jpg"],"2":["a1654670995-2.jpg","a1654670995-4.jpg"]},"7-foto":"","8-foto":"","9-foto":"","B-KazwCAcxM":{"1":["a1654670926-1.jpg","a1654670926-4.jpg"],"2":["a1654670926-2.jpg","a1654670926-3.jpg"]},"B24WGzEo8v_":"","B9RwSi4oPAh":""}
\ No newline at end of file
$(document).ready(function(){
console.log('AAA common.js');
//console.log('AAA common.js');
});
\ No newline at end of file
This diff is collapsed.
......@@ -45,13 +45,24 @@ class Index extends Common
{
chdir('public/fotos');
$dir = getcwd();
$dir_new = getcwd();
chdir('../..');
$folders = scandir($dir);
$folders_new = scandir($dir_new);
foreach ($folders as $key=>$folder_name) {
chdir('public/fotos-arch');
$dir_arch = getcwd();
chdir('../..');
$folders_arch = scandir($dir_arch);
foreach ($folders_new as $key=>$folder_name) {
if (strpos($folder_name, '.') > -1) {
unset($folders_new[$key]);
}
}
foreach ($folders_arch as $key=>$folder_name) {
if (strpos($folder_name, '.') > -1) {
unset($folders[$key]);
unset($folders_arch[$key]);
}
}
......@@ -70,7 +81,8 @@ class Index extends Common
'lang' => $request->getAttribute('layoutInfo')->getLang(),
'colors_active' => $this->container->get('config')['foto_conf']['colors_active'],
'pairs_count' => $this->container->get('config')['foto_conf']['pairs_count'],
'folders' => $folders,
'folders_new' => $folders_new,
'folders_arch' => $folders_arch,
'dir' => $dir,
];
......
......@@ -68,7 +68,8 @@ class Main extends Common
$response = $this->loadFolder($request);
break;
case self::LOAD_FOLDERS_LIST:
$response = $this->loadFoldersList($request);
//$response = $this->loadFoldersList($request);
$response = $this->getArchiveData($request);
break;
default:
}
......@@ -177,8 +178,7 @@ class Main extends Common
];
return new JsonResponse($resp);
}
private function loadFolder(ServerRequestInterface $request)
{
$data = $request->getParsedBody();
......@@ -215,7 +215,6 @@ class Main extends Common
return $response;
}
private function loadFoldersList(ServerRequestInterface $request)
{
$data = $request->getParsedBody();
......@@ -258,4 +257,18 @@ class Main extends Common
return $response;
}
private function getArchiveData(ServerRequestInterface $request)
{
chdir('public/');
$file_name = "fotos.dat";
$archive_data = json_decode(file_get_contents($file_name), true);
chdir('..');
$resp = [
'archive' => $archive_data
];
return new JsonResponse($resp);
}
}
\ No newline at end of file
......@@ -39,7 +39,8 @@ $form_load_link = $this->url('adm.main.loadfolder');
$form_loadlist_link = $this->url('adm.main.loadfolderslist');
$colors_active = $this->colors_active;
$folders = $this->folders;
$folders_new = $this->folders_new;
$folders_arch = $this->folders_arch;
$dir = $this->dir;
?>
......@@ -54,12 +55,15 @@ $dir = $this->dir;
</select>
<ul class="b-list_folders new" data-type="new">
<?php foreach ($folders as $folder): ?>
<?php foreach ($folders_new as $folder): ?>
<li class="b-list_folders-item" data-folder="<?= $folder ?>"><?= $folder ?><b></b></li>
<?php endforeach; ?>
</ul>
<ul class="b-list_folders arch" data-type="arch">
<?php foreach ($folders_arch as $folder): ?>
<li class="b-list_folders-item" data-folder="<?= $folder ?>"><?= $folder ?><b></b></li>
<?php endforeach; ?>
</ul>
<form id="load-folders-list-form" action="<?= $form_loadlist_link ?>" method="POST"></form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment