view.html.php
9.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?php
// namespace administrator\components\com_jmap\views\seospider;
/**
* @package JMAP::SEOSPIDER::administrator::components::com_jmap
* @subpackage views
* @subpackage seospider
* @author Joomla! Extensions Store
* @copyright (C) 2015 - Joomla! Extensions Store
* @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
*/
defined ( '_JEXEC' ) or die ( 'Restricted access' );
/**
* @package JMAP::SEOSPIDER::administrator::components::com_jmap
* @subpackage views
* @subpackage seospider
* @since 3.8
*/
class JMapViewSeospider extends JMapView {
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addDisplayToolbar() {
JToolBarHelper::title( JText::_( 'COM_JMAP_SITEMAP_SEOSPIDER' ), 'jmap' );
// Check user permissions to edit record
if ($this->user->authorise('core.edit', 'com_jmap')) {
if($this->cparams->get('seospider_override_headings', 1) || $this->cparams->get('seospider_override_canonical', 1)) {
JToolBarHelper::custom('seospider.exportEntities', 'arrow-down-2', 'arrow-down-2', 'COM_JMAP_EXPORT_HEADINGS', false);
JToolBarHelper::custom('seospider.importEntities', 'upload', 'upload', 'COM_JMAP_IMPORT_HEADINGS', false);
}
JToolBarHelper::custom('seospider.exportXls', 'download', 'download', 'COM_JMAP_EXPORT_XLS', false);
}
JToolBarHelper::custom('cpanel.display', 'home', 'home', 'COM_JMAP_CPANEL', false);
}
/**
* Creates a dropdown box for selecting how many records to show per page with override
*
* @return string The HTML for the limit # input box.
*/
protected function getLimitBox() {
$limits = array();
$limit = $this->getModel ()->getState ( 'limit' );
// Make the option list.
for ($i = 5; $i <= 30; $i += 5)
{
$limits[] = JHtml::_('select.option', "$i");
}
$limits[] = JHtml::_('select.option', '50', JText::_('J50'));
$limits[] = JHtml::_('select.option', '100', JText::_('J100'));
$limits[] = JHtml::_('select.option', '200', JText::_('J200'));
$limits[] = JHtml::_('select.option', '500', JText::_('J500'));
$limits[] = JHtml::_('select.option', '1000', '1000');
$limits[] = JHtml::_('select.option', '2000', '2000');
$limits[] = JHtml::_('select.option', '5000', '5000');
$limits[] = JHtml::_('select.option', '0', JText::_('JALL'));
$selected = $limit == 0 ? 0 : $limit;
// Build the select list.
$html = JHtml::_(
'select.genericlist',
$limits,
'limit',
'class="inputbox input-small" size="1" onchange="Joomla.submitform();"',
'value',
'text',
$selected
);
return $html;
}
/**
* Default display listEntities
*
* @access public
* @param string $tpl
* @return void
*/
public function display($tpl = 'list') {
// Get main records
$rows = $this->get ( 'Data' );
$lists = $this->get ( 'Filters' );
$total = $this->get ( 'Total' );
$this->cparams = $this->getModel()->getComponentParams();
$doc = $this->document;
$this->loadJQuery($doc);
$this->loadJQueryUI($doc);
$this->loadBootstrap($doc);
$doc->addScript ( JUri::root ( true ) . '/administrator/components/com_jmap/js/seospider.js' );
$doc->addScript ( JUri::root ( true ) . '/administrator/components/com_jmap/js/filesources.js' );
$doc->addStylesheet ( JUri::root ( true ) . '/administrator/components/com_jmap/css/seospider.css' );
$doc->addScriptDeclaration("var jmap_baseURI='" . JUri::root() . "';");
$doc->addScriptDeclaration("var jmap_crawlerDelay=" . $this->cparams->get('seospider_crawler_delay', 500) . ";");
$doc->addScriptDeclaration("var jmap_overrideheadings=" . $this->cparams->get('seospider_override_headings', 1) . ";");
$doc->addScriptDeclaration("var jmap_overrideheadingsHtml=" . $this->cparams->get('seospider_override_headings_html', 0) . ";");
$doc->addScriptDeclaration("var jmap_overridecanonical=" . $this->cparams->get('seospider_override_canonical', 1) . ";");
// Inject js translations
$translations = array (
'COM_JMAP_SEOSPIDER_TITLE',
'COM_JMAP_SEOSPIDER_PROCESS_RUNNING',
'COM_JMAP_SEOSPIDER_STARTED_SITEMAP_GENERATION',
'COM_JMAP_SEOSPIDER_ERROR_STORING_FILE',
'COM_JMAP_SEOSPIDER_GENERATION_COMPLETE',
'COM_JMAP_SEOSPIDER_CRAWLING_LINKS',
'COM_JMAP_SEOSPIDER_NOAVAILABLE_LINK',
'COM_JMAP_SEOSPIDER_LINKVALID',
'COM_JMAP_SEOSPIDER_LINK_NOVALID',
'COM_JMAP_SEOSPIDER_NOINFO',
'COM_JMAP_SEOSPIDER_TITLE_TOOSHORT',
'COM_JMAP_SEOSPIDER_TITLE_TOOSHORT_DESC',
'COM_JMAP_SEOSPIDER_TITLE_TOOLONG',
'COM_JMAP_SEOSPIDER_TITLE_TOOLONG_DESC',
'COM_JMAP_SEOSPIDER_TITLE_MISSING',
'COM_JMAP_SEOSPIDER_TITLE_MISSING_DESC',
'COM_JMAP_SEOSPIDER_DESCRIPTION_TOOSHORT',
'COM_JMAP_SEOSPIDER_DESCRIPTION_TOOSHORT_DESC',
'COM_JMAP_SEOSPIDER_DESCRIPTION_TOOLONG',
'COM_JMAP_SEOSPIDER_DESCRIPTION_TOOLONG_DESC',
'COM_JMAP_SEOSPIDER_DESCRIPTION_MISSING',
'COM_JMAP_SEOSPIDER_DESCRIPTION_MISSING_DESC',
'COM_JMAP_SEOSPIDER_DIALOG_DUPLICATES_TITLE',
'COM_JMAP_SEOSPIDER_DIALOG_DUPLICATES_DESCRIPTION',
'COM_JMAP_SEOSPIDER_NOINDEX',
'COM_JMAP_SEOSPIDER_NOINDEX_DESC',
'COM_JMAP_SEOSPIDER_HEADERS_MISSING',
'COM_JMAP_SEOSPIDER_HEADERS_MISSING_DESC',
'COM_JMAP_SEOSPIDER_OPEN_DETAILS',
'COM_JMAP_SEOSPIDER_TITLE_DETAILS',
'COM_JMAP_SEOSPIDER_DESCRIPTION_DETAILS',
'COM_JMAP_SEOSPIDER_SELECTED_LINK_DETAILS',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_DIALOG_TITLE',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_LINK',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_FOCUS_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_CHOOSE_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_START',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_STARTED',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_RESULTS',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_ERROR',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_DIALOG_FOOTER',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_TITLE_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_TITLE_NOKEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_DESCRIPTION_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_DESCRIPTION_NOKEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_H1_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_H2_H3_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_HEADERS_NO_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_INURL_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_INURL_NOKEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_REPS_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_REPS_NOKEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_ALTIMAGES_KEYWORD',
'COM_JMAP_SEOSPIDER_CONTENT_ANALYSIS_ALTIMAGES_NOKEYWORD',
'COM_JMAP_SEOSPIDER_HEADINGS_DIALOG_TITLE',
'COM_JMAP_SEOSPIDER_HEADINGS_LINK',
'COM_JMAP_SEOSPIDER_HEADINGS_ORIGINAL_HEADING',
'COM_JMAP_SEOSPIDER_HEADINGS_OVERRIDE_HEADING',
'COM_JMAP_SEOSPIDER_HEADINGS_SAVE',
'COM_JMAP_SEOSPIDER_HEADINGS_DELETE',
'COM_JMAP_SEOSPIDER_HEADINGS_SAVED_MESSAGE',
'COM_JMAP_SEOSPIDER_HEADINGS_EDIT_OVERRIDE',
'COM_JMAP_SEOSPIDER_CANONICAL_DIALOG_TITLE',
'COM_JMAP_SEOSPIDER_CANONICAL_LINK',
'COM_JMAP_SEOSPIDER_CANONICAL_ORIGINAL_HEADING',
'COM_JMAP_SEOSPIDER_CANONICAL_OVERRIDE_HEADING',
'COM_JMAP_SEOSPIDER_CANONICAL_SAVE',
'COM_JMAP_SEOSPIDER_CANONICAL_DELETE',
'COM_JMAP_SEOSPIDER_CANONICAL_SAVING_OVERRIDE',
'COM_JMAP_SEOSPIDER_CANONICAL_DELETING_OVERRIDE',
'COM_JMAP_SEOSPIDER_CANONICAL_SAVED_MESSAGE',
'COM_JMAP_SEOSPIDER_CANONICAL_EDIT_OVERRIDE',
'COM_JMAP_SEOSPIDER_CANONICAL_EDIT_OVERRIDE_ACTIVE',
'COM_JMAP_CANONICAL_URL_REQUIRED',
'COM_JMAP_ROBOTS_REQUIRED',
'COM_JMAP_SEOSPIDER_HEADINGS_SAVING_OVERRIDE',
'COM_JMAP_SEOSPIDER_HEADINGS_DELETING_OVERRIDE',
'COM_JMAP_SEOSPIDER_HEADINGS_EDIT_OVERRIDE_ACTIVE',
'COM_JMAP_SEOSPIDER_PAGELOAD_FAST',
'COM_JMAP_SEOSPIDER_PAGELOAD_AVERAGE',
'COM_JMAP_SEOSPIDER_PAGELOAD_SLOW',
'COM_JMAP_EXPORT_XLS',
'COM_JMAP_REQUIRED',
'COM_JMAP_PICKFILE',
'COM_JMAP_STARTIMPORT',
'COM_JMAP_CANCELIMPORT'
);
$this->injectJsTranslations($translations, $doc);
$doc->addScriptDeclaration("
Joomla.submitbutton = function(pressbutton) {
Joomla.submitform( pressbutton );
if (pressbutton == 'seospider.exportEntities') {
jQuery('#adminForm input[name=task]').val('seospider.display');
}
return true;
};
");
$orders = array ();
$orders ['order'] = $this->getModel ()->getState ( 'order' );
$orders ['order_Dir'] = $this->getModel ()->getState ( 'order_dir' );
// Pagination view object model state populated
$pagination = new JPagination ( $total, $this->getModel ()->getState ( 'limitstart' ), $this->getModel ()->getState ( 'limit' ) );
$this->user = JFactory::getUser ();
$this->pagination = $pagination;
$this->link_type = $this->getModel ()->getState ('link_type', null);
$this->searchpageword = $this->getModel ()->getState ('searchpageword', null);
$this->dataRole = $this->cparams->get('linksanalyzer_indexing_analysis', 1) ? 'link' : 'neutral';
$this->lists = $lists;
$this->orders = $orders;
$this->items = $rows;
$this->limitValue = $this->getModel ()->getState ( 'limit' );
// Aggiunta toolbar
$this->addDisplayToolbar();
parent::display ( $tpl );
}
}