Skip to content

Commit

Permalink
store workspace show bookmark panel in session close #445
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-peugnet committed Nov 1, 2024
1 parent 948be64 commit d8348ab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions app/class/Workspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Workspace extends Item
protected bool $showeditorleftpanel = true;
protected bool $showeditorrightpanel = false;
protected bool $showeoptionspanel = false;
protected bool $showebookmarkspanel = true;

protected int $fontsize = 15;
protected string $mediadisplay = self::LIST;
protected string $highlighttheme = self::THEME_DEFAULT;
Expand Down Expand Up @@ -46,6 +48,11 @@ public function showeoptionspanel(): bool
return $this->showeoptionspanel;
}

public function showebookmarkspanel(): bool
{
return $this->showebookmarkspanel;
}

public function fontsize(): int
{
return $this->fontsize;
Expand Down Expand Up @@ -76,6 +83,11 @@ public function setshoweoptionspanel($show): void
$this->showeoptionspanel = boolval($show);
}

public function setshowebookmarkspanel($show): void
{
$this->showebookmarkspanel = boolval($show);
}

public function setfontsize($fontsize): void
{
$fontsize = intval($fontsize);
Expand Down
2 changes: 1 addition & 1 deletion app/view/templates/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<main class="home">

<?php $this->insert('homebookmark', ['publicbookmarks' => $publicbookmarks, 'personalbookmarks' => $personalbookmarks, 'queryaddress' => $queryaddress, 'display' => $display]) ?>
<?php $this->insert('homebookmark', ['publicbookmarks' => $publicbookmarks, 'personalbookmarks' => $personalbookmarks, 'queryaddress' => $queryaddress, 'display' => $display, 'workspace' => $workspace]) ?>

<?php $this->insert('homeopt', ['opt' => $opt, 'user' => $user, 'display' => $display, 'workspace' => $workspace]) ?>

Expand Down
2 changes: 1 addition & 1 deletion app/view/templates/homebookmark.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<aside id="bookmarks" class="toggle-panel-container">
<input id="showebookmarkspanel" name="showebookmarkspanel" value="1" class="toggle-panel-toggle" type="checkbox" checked form="workspace-form" >
<input id="showebookmarkspanel" name="showebookmarkspanel" value="1" class="toggle-panel-toggle" type="checkbox" form="workspace-form" <?= $workspace->showebookmarkspanel() === true ? 'checked' : '' ?>>
<label for="showebookmarkspanel" class="toggle-panel-label"><span><i class="fa fa-bookmark"></i></span></label>

<div class="toggle-panel" id="optionspanel">
Expand Down
1 change: 1 addition & 0 deletions app/view/templates/homemenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@
data-api="<?= $this->url('apiworkspaceupdate') ?>"
id="workspace-form" >
<input type="hidden" name="showeoptionspanel" value="0">
<input type="hidden" name="showebookmarkspanel" value="0">
<button type="submit">
<i class="fa fa-edit"></i>
<span class="text">save workspace</span>
Expand Down

0 comments on commit d8348ab

Please sign in to comment.