Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.0.0",
"version": "4.1.0",
"name": "CmsPlugin.name",
"description": "CmsPlugin.description",
"icon": "bi bi-circle",
Expand Down
18 changes: 13 additions & 5 deletions controllers/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ public function preAction()
// Use the same structure as that of the client portal for the company given
$this->structure->setDefaultView(APPDIR);
$this->structure->setView(null, 'client' . DS . $this->layout);
$this->structure->set(
'custom_head',
'<link href="' . Router::makeURI(str_replace('index.php/', '', WEBDIR) . $this->view->view_path)
. 'views/' . $this->view->view . '/css/styles.css" rel="stylesheet" type="text/css" />'
);

// A Bootstrap 5 client structure renders the Css helper and carries no custom_head, so
// the templates built on it load the stylesheet from views/{template}/main.pdt. Anything
// else is the other way around, and needs the link written into the head here, following
// the directory the view resolves to, which is settled per file when the view renders
if (self::getThemeFramework('client') !== self::FRAMEWORK_BOOTSTRAP_5) {
$view_dir = $this->getPluginViewDir('main') ?? $this->view->view;
$this->structure->set(
'custom_head',
'<link href="' . Router::makeURI(str_replace('index.php/', '', WEBDIR) . $this->view->view_path)
. 'views/' . $view_dir . '/css/styles.css" rel="stylesheet" type="text/css" />'
);
}

$this->base_uri = WEBDIR;
$this->view->base_uri = $this->base_uri;
Expand Down
14 changes: 7 additions & 7 deletions views/default/admin_main.pdt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
<thead>
<tr>
<th>
<a href="<?= $this->Html->safe($this->base_uri . 'plugin/cms/admin_main/index?sort=uri&order=' . ($sort == 'uri' ? $negate_order : $order));?>" class="ajax text-decoration-none">
<a href="<?php echo $this->Html->safe($this->base_uri . 'plugin/cms/admin_main/index?sort=uri&order=' . ($sort == 'uri' ? $negate_order : $order));?>" class="ajax text-decoration-none">
<?php $this->_('AdminMain.index.heading.uri'); ?>
<?php if ($sort == 'uri') { ?><i class="bi bi-chevron-<?= $order == 'asc' ? 'up' : 'down'; ?>"></i><?php } ?>
<?php if ($sort == 'uri') { ?><i class="bi bi-chevron-<?php echo $order == 'asc' ? 'up' : 'down'; ?>"></i><?php } ?>
</a>
</th>
<th>
<a href="<?= $this->Html->safe($this->base_uri . 'plugin/cms/admin_main/index?sort=title&order=' . ($sort == 'title' ? $negate_order : $order));?>" class="ajax text-decoration-none">
<a href="<?php echo $this->Html->safe($this->base_uri . 'plugin/cms/admin_main/index?sort=title&order=' . ($sort == 'title' ? $negate_order : $order));?>" class="ajax text-decoration-none">
<?php $this->_('AdminMain.index.heading.title'); ?>
<?php if ($sort == 'title') { ?><i class="bi bi-chevron-<?= $order == 'asc' ? 'up' : 'down'; ?>"></i><?php } ?>
<?php if ($sort == 'title') { ?><i class="bi bi-chevron-<?php echo $order == 'asc' ? 'up' : 'down'; ?>"></i><?php } ?>
</a>
</th>
<th style="width: 80px;"><?php $this->_('AdminMain.index.heading.options') ?></th>
Expand All @@ -43,11 +43,11 @@
<?php for ($i = 0; $i < $num_pages; $i++) { ?>
<?php $page = $pages[$i] ?>
<tr>
<td><?= $this->Html->safe($page->uri) ?></td>
<td><?= $this->Html->safe($page->title) ?></td>
<td><?php echo $this->Html->safe($page->uri) ?></td>
<td><?php echo $this->Html->safe($page->title) ?></td>
<td>
<div class="d-flex gap-2">
<a class="btn btn-sm btn-outline-secondary" href="<?= $this->Html->safe($this->base_uri . 'plugin/cms/admin_main/manage/?' . http_build_query(['uri' => $page->uri])) ?>" title="<?php $this->_('AdminMain.index.edit') ?>">
<a class="btn btn-sm btn-outline-secondary" href="<?php echo $this->Html->safe($this->base_uri . 'plugin/cms/admin_main/manage/?' . http_build_query(['uri' => $page->uri])) ?>" title="<?php $this->_('AdminMain.index.edit') ?>">
<i class="bi bi-pencil"></i>
</a>
<?php $this->Form->create($this->base_uri . 'plugin/cms/admin_main/delete', ['class' => 'd-inline']) ?>
Expand Down
12 changes: 6 additions & 6 deletions views/default/admin_main_manage.pdt
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@
</div>

<ul class="nav nav-tabs-connected" role="tablist">
<?php foreach ($languages as $i => $lang) { ?>
<?php foreach ($languages ?? [] as $i => $lang) { ?>
<li class="nav-item" role="presentation">
<button class="nav-link<?= ($lang->code ?? null) == Configure::get('Blesta.language') ? ' active' : '' ?>" data-bs-toggle="tab" data-bs-target="#tab-<?= $this->Html->safe($lang->code) ?>" type="button" role="tab">
<?= $this->Html->safe($lang->name ?? null) ?>
<button class="nav-link<?php echo ($lang->code ?? null) == Configure::get('Blesta.language') ? ' active' : '' ?>" data-bs-toggle="tab" data-bs-target="#tab-<?php echo $this->Html->safe($lang->code) ?>" type="button" role="tab">
<?php echo $this->Html->safe($lang->name ?? null) ?>
</button>
</li>
<?php } ?>
</ul>
<div class="tab-content tab-content-connected mb-3">
<?php foreach ($languages as $i => $lang) { ?>
<?php $page = (object)($vars[$lang->code] ?? $pages[$lang->code] ?? []); ?>
<div class="tab-pane fade<?= ($lang->code ?? null) == Configure::get('Blesta.language') ? ' show active' : '' ?>" id="tab-<?= $this->Html->safe($lang->code) ?>" role="tabpanel">
<div class="tab-pane fade<?php echo ($lang->code ?? null) == Configure::get('Blesta.language') ? ' show active' : '' ?>" id="tab-<?php echo $this->Html->safe($lang->code) ?>" role="tabpanel">
<div class="mb-3">
<?php $this->Form->label($this->_('AdminMain.manage.label.title', true), 'title-' . $lang->code, ['class' => 'form-label']); ?>
<?php $this->Form->fieldText('pages[' . $lang->code . '][title]', ($page->title ?? null), ['id' => 'title-' . $lang->code, 'class' => 'form-control']); ?>
Expand All @@ -48,7 +48,7 @@
<h6 class="alert-heading mb-2"><i class="bi bi-tags me-2"></i><?php $this->_('AdminMain.manage.label.tags'); ?></h6>
<div class="d-flex flex-wrap gap-2">
<?php foreach (($tags ?? []) as $tag) { ?>
<code><?= $this->Html->safe($tag ?? null) ?></code>
<code><?php echo $this->Html->safe($tag ?? null) ?></code>
<?php } ?>
</div>
</div>
Expand All @@ -63,7 +63,7 @@
</div>
<?php foreach ($content_types as $type => $name) {?>
<?php $current_type = $type == ($page->content_type ?? array_keys($content_types ?? [])[0] ?? null); ?>
<div class="mb-3 content <?= 'content_' . $type ?>"<?= $current_type ? '' : ' style="display:none"' ?>>
<div class="mb-3 content <?php echo 'content_' . $type ?>"<?php echo $current_type ? '' : ' style="display:none"' ?>>
<?php
$attributes = $current_type ? ['class' => 'form-control'] : ['disabled' => '', 'class' => 'form-control'];
switch($type) {
Expand Down
2 changes: 1 addition & 1 deletion views/default/structure.pdt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us" dir="ltr">
<head>
<title>Title</title>
<title><?php echo $this->Html->safe($title ?? '');?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->view_dir;?>css/styles.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
Expand Down
97 changes: 97 additions & 0 deletions views/meridian/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**
* CMS Plugin - Meridian client template
*
* Colors come from the Meridian design tokens so light and dark mode are
* handled without any extra rules.
*/

/* =============================================
Portal boxes
============================================= */
.portal-box .card {
background-color: var(--card-bg);
border: 1px solid var(--border-color);
margin-bottom: 20px;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-box .card:hover {
border-color: var(--primary);
box-shadow: var(--shadow-md);
}

.portal-box .card .card-body {
padding: 15px;
}

.portal-box a {
color: var(--text-primary);
text-decoration: none;
}

.portal-box i {
display: block;
text-align: center;
color: var(--text-muted);
transition: color 0.15s ease;
}

.portal-box a:hover i {
color: var(--primary);
}

.portal-box .card .card-body h4 {
border-bottom: none !important;
padding-bottom: 0 !important;
}

.portal-box h4,
.portal-box p {
text-align: center;
}

.portal-box p {
color: var(--text-muted);
margin-bottom: 0;
}

/* =============================================
Install notice
============================================= */
.thanks blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 14px;
border-left: 5px solid var(--border-color);
border-right: 5px solid var(--border-color);
background-color: var(--card-bg);
color: var(--text-primary);
}

/* =============================================
Icon sizes
-
Meridian maps the FontAwesome classes onto Bootstrap Icons but carries none of
the sizing classes, so page content written against them renders at 1em.
============================================= */
.fa-lg {
font-size: 1.33em;
line-height: 0.75em;
vertical-align: -0.0667em;
}

.fa-2x {
font-size: 2em;
}

.fa-3x {
font-size: 3em;
}

.fa-4x {
font-size: 4em;
}

.fa-5x {
font-size: 5em;
}
Binary file added views/meridian/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions views/meridian/main.pdt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
$this->Css->setFile('styles.css', 'head', $this->view_dir . 'css/');

echo $message ?? null;
echo $content ?? null;
13 changes: 13 additions & 0 deletions views/meridian/structure.pdt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $this->Html->safe($title ?? '');?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->view_dir;?>css/styles.css">
</head>

<body>
<?php echo $content ?? '';?>
</body>
</html>