Skip to content

Commit

Permalink
add admin preview support
Browse files Browse the repository at this point in the history
  • Loading branch information
N6REJ committed Jul 31, 2020
1 parent 59c1ab8 commit 1fd649a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,14 @@ protected function addToolbar()
}

// Add a Template preview button
if ($this->preview->client_id === 0 && $this->type === 'home')
$client = (int) $this->preview->client_id === 1 ? 'administrator/' : '';

if ($this->type === 'home')
{
$bar->linkButton('preview')
->icon('fas fa-image')
->text('COM_TEMPLATES_BUTTON_PREVIEW')
->url(Uri::root() . 'index.php?tp=1&templateStyle=' . $this->preview->id)
->url(Uri::root() . $client . 'index.php?tp=1&templateStyle=' . $this->preview->id)
->attributes(['target' => '_new']);
}

Expand Down

0 comments on commit 1fd649a

Please sign in to comment.