1 | <?php |
||
16 | class PluginUpsells |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var DomainInterface |
||
21 | */ |
||
22 | private $domain; |
||
23 | |||
24 | |||
25 | /** |
||
26 | * PluginUpsells constructor. |
||
27 | * |
||
28 | * @param DomainInterface $domain |
||
29 | */ |
||
30 | public function __construct(DomainInterface $domain) |
||
31 | { |
||
32 | $this->domain = $domain; |
||
33 | } |
||
34 | |||
35 | |||
36 | /** |
||
37 | * Hook in various upsells for the decaf version of EE. |
||
38 | */ |
||
39 | public function decafUpsells() |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Callback for `after_plugin_row` to add upsell info |
||
49 | * @param string $plugin_file |
||
50 | * @param array $plugin_data |
||
51 | * @param string $status |
||
52 | * @throws DomainException |
||
53 | */ |
||
54 | public function doPremiumUpsell($plugin_file, $plugin_data, $status) |
||
55 | { |
||
56 | if ($plugin_file === $this->domain->pluginBasename()) { |
||
57 | list($button_text, $button_url, $upsell_text) = $this->getAfterPluginRowDetails(); |
||
58 | echo '<tr class="plugin-update-tr ee-upsell-plugin-list-table active"> |
||
59 | <td colspan="3" class="plugin-update colspanchange"> |
||
60 | <div class="notice inline notice-alt"> |
||
61 | <div class="ee-upsell-container"> |
||
62 | <div class="ee-upsell-inner-container"> |
||
63 | <a href="' . $button_url . '"> |
||
64 | ' . $button_text . ' |
||
65 | </a> |
||
66 | </div> |
||
67 | <div class="ee-upsell-inner-container"> |
||
68 | <p>' . $upsell_text . '</p> |
||
69 | </div> |
||
70 | <div style="clear:both"></div> |
||
71 | </div> |
||
72 | </div> |
||
73 | </td> |
||
74 | </tr>'; |
||
75 | } |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * Provide the details used for the upsell container. |
||
80 | * @return array |
||
81 | */ |
||
82 | protected function getAfterPluginRowDetails() |
||
97 | } |
||
98 |