explorer de fichier

This commit is contained in:
afornerot 2020-09-16 09:33:46 +02:00
parent 8f69cb0bc9
commit 2aff9d641b
4 changed files with 15 additions and 4 deletions

View File

@ -25,6 +25,7 @@ class FileController extends Controller
$subdirectory=$request->get("subdirectory");
$clear=$request->get("clear");
$view=$request->get("view");
$defaultview=$request->get("defaultview");
// Récupérer en session le dernier subdirectory visité
$sessionsubdirectory = $this->get('session')->get('sessionsubdirectory');
@ -46,7 +47,7 @@ class FileController extends Controller
// Récupérer en session le mode de visualisation
$sessionviewdirectory = $this->get('session')->get('sessionviewdirectory');
if(!is_array($sessionviewdirectory)) $sessionviewdirectory=[$directory=>"small"];
if(!is_array($sessionviewdirectory)) $sessionviewdirectory=[$directory=>$defaultview];
if($view) {
$sessionviewdirectory[$directory] = $view;
$this->get('session')->set('sessionviewdirectory',$sessionviewdirectory);

View File

@ -1117,7 +1117,7 @@ class InitDataCommand extends ContainerAwareCommand
$entityWidget->setBorder(true);
$entityWidget->setOpened(true);
$entityWidget->setAccess(["config","user","group"]);
$parameter = json_decode('{"fields": []}');
$parameter = json_decode('{"fields": [{"id": "modelist", "loc": "col1", "type": "modelist", "label": "Mode Affichage", "value": "0", "mandatory": "true"}]}');
$entityWidget->setParameter($parameter);
$em->persist($entityWidget);

View File

@ -1606,13 +1606,23 @@ class PagewidgetController extends Controller
]);
*/
// Parametres
$view="small";
foreach($entity->getParameter()["fields"] as $parameter) {
switch($parameter["id"]) {
case "modelist":
$view=($parameter["value"]==0?"small":"list");
break;
}
}
return $this->render($this->labelentity.':viewfile.html.twig', [
'entity' => $entity,
'canadd' => $canupdate,
'canupdate' => $canupdate,
'access' => $access,
'directory' => "widget-".$id,
'view' => $view,
]);

View File

@ -55,7 +55,7 @@
<div class="widgetbody" style="{{ stylewidgetbodyframe }}">
<iframe id="frame-{{directory}}" src="{{ path("cadoles_core_"~access~"_file_list",{'directory':directory}) }}" data-color="#{{colorbodyfont}}" style="{{ stylewidgetbodyframe }}" class="{% if not entity.autoajust %}notframeajust {% endif %}"></iframe>
<iframe id="frame-{{directory}}" src="{{ path("cadoles_core_"~access~"_file_list",{'directory':directory,'defaultview':view}) }}" data-color="#{{colorbodyfont}}" style="{{ stylewidgetbodyframe }}" class="{% if not entity.autoajust %}notframeajust {% endif %}"></iframe>
</div>
</div>