view.html.php
3.07 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
<?php
/**
* @copyright Copyright (c) 2009-2020 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
class JceViewProfile extends JViewLegacy
{
protected $state;
protected $item;
public $form;
/**
* Display the view.
*/
public function display($tpl = null)
{
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
$this->formclass = 'form-horizontal options-grid-form options-grid-form-full';
$this->plugins = $this->get('Plugins');
$this->rows = $this->get('Rows');
$this->available = $this->get('AvailableButtons');
$this->additional = $this->get('AdditionalPlugins');
// load language files
$language = JFactory::getLanguage();
$language->load('com_jce', JPATH_SITE);
$language->load('com_jce_pro', JPATH_SITE);
// set JLayoutHelper base path
JLayoutHelper::$defaultBasePath = JPATH_COMPONENT_ADMINISTRATOR;
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
JHtml::_('jquery.ui', array('core', 'sortable'));
$this->addToolbar();
parent::display($tpl);
// version hash
$hash = md5(WF_VERSION);
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_jce/media/css/profile.min.css?' . $hash);
$document->addScript('components/com_jce/media/js/core.min.js?' . $hash);
$document->addScript('components/com_jce/media/js/profile.min.js?' . $hash);
// default theme
$document->addStyleSheet(JURI::root(true) . '/components/com_jce/editor/tiny_mce/themes/advanced/skins/default/ui.admin.css?' . $hash);
}
/**
* Add the page title and toolbar.
*
* @since 2.7
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$canEdit = $user->authorise('core.create', 'com_jce');
JToolbarHelper::title(JText::_('WF_PROFILES_EDIT'), 'user');
// For new records, check the create permission.
if ($canEdit) {
JToolbarHelper::apply('profile.apply');
JToolbarHelper::save('profile.save');
JToolbarHelper::save2new('profile.save2new');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('profile.cancel');
} else {
JToolbarHelper::cancel('profile.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('WF_PROFILES_EDIT');
}
}