File size: 2,285 Bytes
465d267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!--
  Matomo - free/libre analytics platform

  @link    https://matomo.org
  @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
-->

<template>
  <div v-content-intro>
    <h2>
      <EnrichedHeadline>{{ translate('CorePluginsAdmin_PluginsManagement') }}</EnrichedHeadline>
    </h2>

    <p>
      {{ translate('CorePluginsAdmin_PluginsExtendPiwik') }}
      {{ translate('CorePluginsAdmin_OncePluginIsInstalledYouMayActivateHere') }}

      <span
        v-if="isMarketplaceEnabled || isPluginUploadEnabled"
        v-html="$sanitize(teaserExtendMatomoByPluginText)"
        style="margin-right:3.5px"
      ></span>

      <span v-if="!isPluginsAdminEnabled" style="margin-right:3.5px">
        <br/>{{ translate('CorePluginsAdmin_DoMoreContactPiwikAdmins') }}
      </span>

      <span v-html="$sanitize(changeLookByManageThemesText)"></span>
    </p>
  </div>
  <InstallAllPaidPluginsButton v-if="isMarketplaceEnabled"
  />
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import {
  ContentIntro,
  EnrichedHeadline,
  translate,
  MatomoUrl,
} from 'CoreHome';
import InstallAllPaidPluginsButton
  from '../InstallAllPaidPluginsButton/InstallAllPaidPluginsButton.vue';

export default defineComponent({
  props: {
    isMarketplaceEnabled: Boolean,
    isPluginUploadEnabled: Boolean,
    isPluginsAdminEnabled: Boolean,
  },
  components: {
    EnrichedHeadline,
    InstallAllPaidPluginsButton,
  },
  directives: {
    ContentIntro,
  },
  computed: {
    teaserExtendMatomoByPluginText() {
      const link = `?${MatomoUrl.stringify({
        ...MatomoUrl.urlParsed.value,
        module: 'Marketplace',
        action: 'overview',
        sort: null,
        activated: null,
      })}`;

      return translate(
        'CorePluginsAdmin_TeaserExtendPiwikByPlugin',
        `<a href="${link}">`,
        '</a>',
        '<a href="#" class="uploadPlugin">',
        '</a>',
      );
    },
    changeLookByManageThemesText() {
      const link = `?${MatomoUrl.stringify({
        ...MatomoUrl.urlParsed.value,
        action: 'themes',
        activated: null,
      })}`;

      return translate(
        'CorePluginsAdmin_ChangeLookByManageThemes',
        `<a href="${link}">`,
        '</a>',
      );
    },
  },
});
</script>