16 import(
'lib.pkp.classes.plugins.ThemePlugin');
23 if (defined(
'SESSION_DISABLE_INIT'))
return true;
24 return parent::isActive();
37 $this->
addOption(
'typography',
'FieldOptions', [
39 'label' => __(
'plugins.themes.default.option.typography.label'),
40 'description' => __(
'plugins.themes.default.option.typography.description'),
43 'value' =>
'notoSans',
44 'label' => __(
'plugins.themes.default.option.typography.notoSans'),
47 'value' =>
'notoSerif',
48 'label' => __(
'plugins.themes.default.option.typography.notoSerif'),
51 'value' =>
'notoSerif_notoSans',
52 'label' => __(
'plugins.themes.default.option.typography.notoSerif_notoSans'),
55 'value' =>
'notoSans_notoSerif',
56 'label' => __(
'plugins.themes.default.option.typography.notoSans_notoSerif'),
60 'label' => __(
'plugins.themes.default.option.typography.lato'),
64 'label' => __(
'plugins.themes.default.option.typography.lora'),
67 'value' =>
'lora_openSans',
68 'label' => __(
'plugins.themes.default.option.typography.lora_openSans'),
71 'default' =>
'notoSans',
74 $this->
addOption(
'baseColour',
'FieldColor', [
75 'label' => __(
'plugins.themes.default.option.colour.label'),
76 'description' => __(
'plugins.themes.default.option.colour.description'),
77 'default' =>
'#1E6292',
80 $this->
addOption(
'showDescriptionInJournalIndex',
'FieldOptions', [
81 'label' => __(
'manager.setup.contextSummary'),
85 'label' => __(
'plugins.themes.default.option.showDescriptionInJournalIndex.option'),
90 $this->
addOption(
'useHomepageImageAsHeader',
'FieldOptions', [
91 'label' => __(
'plugins.themes.default.option.useHomepageImageAsHeader.label'),
92 'description' => __(
'plugins.themes.default.option.useHomepageImageAsHeader.description'),
96 'label' => __(
'plugins.themes.default.option.useHomepageImageAsHeader.option')
103 $this->
addStyle(
'stylesheet',
'styles/index.less');
106 $additionalLessVariables = array();
113 if ($this->
getOption(
'typography') ===
'notoSerif') {
116 '//fonts.googleapis.com/css?family=Noto+Serif:400,400i,700,700i',
117 array(
'baseUrl' =>
'')
119 $additionalLessVariables[] =
'@font: "Noto Serif", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;';
121 } elseif (strpos($this->
getOption(
'typography'),
'notoSerif') !==
false) {
123 'fontNotoSansNotoSerif',
124 '//fonts.googleapis.com/css?family=Noto+Sans:400,400i,700,700i|Noto+Serif:400,400i,700,700i',
125 array(
'baseUrl' =>
'')
129 if ($this->
getOption(
'typography') ==
'notoSerif_notoSans') {
130 $additionalLessVariables[] =
'@font-heading: "Noto Serif", serif;';
131 } elseif ($this->
getOption(
'typography') ==
'notoSans_notoSerif') {
132 $additionalLessVariables[] =
'@font: "Noto Serif", serif;@font-heading: "Noto Sans", serif;';
135 } elseif ($this->
getOption(
'typography') ==
'lato') {
138 '//fonts.googleapis.com/css?family=Lato:400,400i,900,900i',
139 array(
'baseUrl' =>
'')
141 $additionalLessVariables[] =
'@font: Lato, sans-serif;';
143 } elseif ($this->
getOption(
'typography') ==
'lora') {
146 '//fonts.googleapis.com/css?family=Lora:400,400i,700,700i',
147 array(
'baseUrl' =>
'')
149 $additionalLessVariables[] =
'@font: Lora, serif;';
151 } elseif ($this->
getOption(
'typography') ==
'lora_openSans') {
154 '//fonts.googleapis.com/css?family=Lora:400,400i,700,700i|Open+Sans:400,400i,700,700i',
155 array(
'baseUrl' =>
'')
157 $additionalLessVariables[] =
'@font: "Open Sans", sans-serif;@font-heading: Lora, serif;';
162 '//fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic',
163 array(
'baseUrl' =>
'')
169 if ($this->
getOption(
'baseColour') !==
'#1E6292') {
170 $additionalLessVariables[] =
'@bg-base:' . $this->
getOption(
'baseColour') .
';';
172 $additionalLessVariables[] =
'@text-bg-base:rgba(0,0,0,0.84);';
173 $additionalLessVariables[] =
'@bg-base-border-color:rgba(0,0,0,0.2);';
178 if (!empty($additionalLessVariables)) {
179 $this->
modifyStyle(
'stylesheet', array(
'addLessVariables' => join($additionalLessVariables)));
186 $url =
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css';
188 $url =
$request->getBaseUrl() .
'/lib/pkp/styles/fontawesome/fontawesome.css';
193 array(
'baseUrl' =>
'')
198 if ($context && $this->
getOption(
'useHomepageImageAsHeader')) {
201 $publicFilesDir =
$request->getBaseUrl() .
'/' . $publicFileManager->getContextFilesPath($context->getId());
203 $homepageImage = $context->getLocalizedData(
'homepageImage');
205 $homepageImageUrl = $publicFilesDir .
'/' . $homepageImage[
'uploadName'];
209 '.pkp_structure_head { background: center / cover no-repeat url("' . $homepageImageUrl .
'");}',
215 $min =
Config::getVar(
'general',
'enable_minified') ?
'.min' :
'';
217 $jquery =
'//ajax.googleapis.com/ajax/libs/jquery/' . CDN_JQUERY_VERSION .
'/jquery' . $min .
'.js';
218 $jqueryUI =
'//ajax.googleapis.com/ajax/libs/jqueryui/' . CDN_JQUERY_UI_VERSION .
'/jquery-ui' . $min .
'.js';
221 $jquery =
$request->getBaseUrl() .
'/lib/pkp/lib/vendor/components/jquery/jquery' . $min .
'.js';
222 $jqueryUI =
$request->getBaseUrl() .
'/lib/pkp/lib/vendor/components/jqueryui/jquery-ui' . $min .
'.js';
226 $this->
addScript(
'jQuery', $jquery, array(
'baseUrl' =>
''));
227 $this->
addScript(
'jQueryUI', $jqueryUI, array(
'baseUrl' =>
''));
228 $this->
addScript(
'jQueryTagIt',
$request->getBaseUrl() .
'/lib/pkp/js/lib/jquery/plugins/jquery.tag-it.js', array(
'baseUrl' =>
''));
231 $this->
addScript(
'popper',
'js/lib/popper/popper.js');
232 $this->
addScript(
'bsUtil',
'js/lib/bootstrap/util.js');
233 $this->
addScript(
'bsDropdown',
'js/lib/bootstrap/dropdown.js');
236 $this->
addScript(
'default',
'js/main.js');
265 return __(
'plugins.themes.default.name');
273 return __(
'plugins.themes.default.description');