jedreview.php
3.76 KB
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
94
95
96
97
98
99
100
101
102
103
104
<?php
/* ======================================================
# Web357 Framework - Joomla! System Plugin v1.5.1
# -------------------------------------------------------
# For Joomla! 3.x
# Author: Yiannis Christodoulou (yiannis@web357.eu)
# Copyright (©) 2009-2018 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https://www.web357.eu/
# Support: support@web357.eu
# Last modified: 09 Feb 2018, 13:55:18
========================================================= */
defined('JPATH_BASE') or die;
require_once('elements_helper.php');
jimport('joomla.form.formfield');
class JFormFieldjedreview extends JFormField {
protected $type = 'jedreview';
protected function getInput()
{
return ' ';
}
protected function getLabel()
{
$html = '';
// get extension's details
$extension_type_single = $this->element['extension_type']; // component, module, plugin
$extension_type = $this->element['extension_type'].'s'; // components, modules, plugins
$extension_name = preg_replace('/(plg_|com_|mod_)/', '', $this->element['extension_name']);
$plugin_type = $this->element['plugin_type']; // system, authentication, content etc.
$plugin_folder = (!empty($plugin_type) && $plugin_type != '') ? $plugin_type.'/' : '';
$real_name = $this->element['real_name'];
$real_name = JText::_($real_name);
if (empty($extension_type) || empty($extension_name)):
JFactory::getApplication()->enqueueMessage("Error in XML. Please, contact us at support@web357.eu!", "error");
return false;
endif;
// BEGIN: get button links
switch ($extension_name):
case "cookiespolicynotificationbar":
$jed_link = 'http://extensions.joomla.org/extensions/extension/site-management/cookie-control/cookies-policy-notification-bar';
break;
case "countdown":
$jed_link = 'http://extensions.joomla.org/extensions/extension/calendars-a-events/events/count-down';
break;
case "datetime":
$jed_link = 'http://extensions.joomla.org/extensions/extension/calendars-a-events/time/display-date-time';
break;
case "contactinfo":
$jed_link = '';
break;
case "failedloginattempts":
$jed_link = 'http://extensions.joomla.org/extensions/extension/access-a-security/site-security/failed-login-attempts';
break;
case "loginasuser":
$jed_link = 'http://extensions.joomla.org/extensions/extension/clients-a-communities/user-management/login-as-user';
break;
case "monthlyarchive":
$jed_link = 'http://extensions.joomla.org/extensions/extension/news-display/articles-display/monthly-archive';
break;
case "fixedhtmltoolbar": // toolbar
$jed_link = 'http://extensions.joomla.org/extensions/extension/social-web/social-display/toolbar';
break;
case "vmcountproducts":
$jed_link = 'http://extensions.joomla.org/extensions/extension/extension-specific/virtuemart-extensions/virtuemart-count-products';
break;
case "vmsales":
$jed_link = 'http://extensions.joomla.org/extensions/extension/extension-specific/virtuemart-extensions/virtuemart-sales';
break;
case "supporthours":
$jed_link = 'http://extensions.joomla.org/extensions/extension/contacts-and-feedback/opening-hours/support-hours';
break;
case "fix404errorlinks":
$jed_link = 'http://extensions.joomla.org/extensions/extension/site-management/fix-404-error-links';
break;
default:
$jed_link = '';
endswitch;
// END: get button links
if (!empty($jed_link))
{
$html .= '<div class="w357frm_param_header">';
$html .= '<label>';
$html .= JText::_('W357FRM_HEADER_JED_REVIEW_AND_RATING');
$html .= '</label>';
$html .= '</div>';
$html .= '<div class="w357frm_leave_review_on_jed">'.sprintf(JText::_('W357FRM_LEAVE_REVIEW_ON_JED'), $jed_link, $real_name).'</div>';
}
return $html;
}
}