Initial commit
This commit is contained in:
108
typo3conf/ext/metaseo/Resources/Public/Backend/Css/Default.css
Normal file
108
typo3conf/ext/metaseo/Resources/Public/Backend/Css/Default.css
Normal file
@@ -0,0 +1,108 @@
|
||||
.metaseo-search-highlight {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
.metaseo-cell-highlight {
|
||||
background-color: #FCFF91;
|
||||
}
|
||||
|
||||
.metaseo-warning {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.metaseo-url-https {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.metaseo-boolean {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.metaseo-default {
|
||||
color: #808080;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.metaseo-info-from-base {
|
||||
color: #969696;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.metaseo-info-from-overlay {
|
||||
|
||||
}
|
||||
|
||||
.metaseo-info-only-in-base {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.metaseo-grid-editable .x-grid3-body .x-grid3-cell {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.metaseo-grid-editable .x-grid3-body .x-grid3-cell:hover {
|
||||
background-color: #B3B3B3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.metaseo-grid-editable .x-grid3-body .x-grid3-cell:hover.metaseo-cell-highlight {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.metaseo-grid-editable .x-grid3-body .x-grid3-cell .t3-icon {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
right: -1px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: #B3B3B3;
|
||||
}
|
||||
|
||||
.metaseo-grid-editable .x-grid3-body .x-grid3-cell:hover .t3-icon {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.metaseo-cell-editable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.metaseo-cell-editable .t3-icon {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
.x-grid3-body .x-grid3-cell .metaseo-toolbar {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.x-grid3-body .x-grid3-cell .metaseo-toolbar .t3-icon {
|
||||
visibility: visible !important;
|
||||
position: static !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
td.center,
|
||||
th.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.t3-icon[onclick] {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
.icon-grid {
|
||||
background-image: url('../Icons/Delete.gif') !important;
|
||||
}
|
||||
|
||||
.delete {
|
||||
background-image: url('../Icons/Delete.gif') !important;
|
||||
}
|
||||
|
||||
.deletedPath {
|
||||
color: #ff0000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.x-window .x-window-body {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
BIN
typo3conf/ext/metaseo/Resources/Public/Backend/Icons/Delete.gif
Normal file
BIN
typo3conf/ext/metaseo/Resources/Public/Backend/Icons/Delete.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 350 B |
Binary file not shown.
|
After Width: | Height: | Size: 833 B |
Binary file not shown.
|
After Width: | Height: | Size: 833 B |
Binary file not shown.
|
After Width: | Height: | Size: 818 B |
Binary file not shown.
|
After Width: | Height: | Size: 754 B |
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,51 @@
|
||||
/* taken from powermail, thanks */
|
||||
|
||||
/* plugin for resize of grid in single container */
|
||||
Ext.namespace('Ext.ux.plugin');
|
||||
Ext.ux.plugin.FitToParent = Ext.extend(Object, {
|
||||
constructor: function (parent) {
|
||||
this.parent = parent;
|
||||
},
|
||||
init: function (c) {
|
||||
c.on('render', function (c) {
|
||||
c.fitToElement = Ext.get(this.parent
|
||||
|| c.getPositionEl().dom.parentNode);
|
||||
if (!c.doLayout) {
|
||||
this.fitSizeToParent();
|
||||
Ext.EventManager.onWindowResize(this.fitSizeToParent, this);
|
||||
}
|
||||
}, this, {
|
||||
single: true
|
||||
});
|
||||
if (c.doLayout) {
|
||||
c.monitorResize = true;
|
||||
c.doLayout = c.doLayout.createInterceptor(this.fitSizeToParent);
|
||||
}
|
||||
},
|
||||
fitSizeToParent: function () {
|
||||
// Uses the dimension of the current viewport, but removes the document header
|
||||
// and an additional margin of 40 pixels (e.g. Safari needs this addition)
|
||||
|
||||
var bodyHeight = Ext.getBody().getHeight();
|
||||
|
||||
if (Ext.get('typo3-docbody') && Ext.get('typo3-docbody').getHeight() >= bodyHeight) {
|
||||
bodyHeight = Ext.get('typo3-docbody').getHeight();
|
||||
}
|
||||
|
||||
this.fitToElement.setHeight(bodyHeight - this.fitToElement.getTop() - 40);
|
||||
var pos = this.getPosition(true), size = this.fitToElement.getViewSize();
|
||||
var width = size.width - pos[0];
|
||||
var height = size.height - pos[1];
|
||||
|
||||
if (width <= 400) {
|
||||
width = 400;
|
||||
}
|
||||
|
||||
if (height <= 400) {
|
||||
height = 400;
|
||||
}
|
||||
|
||||
this.setSize(width, height);
|
||||
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,177 @@
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Markus Blaschke <typo3@markus-blaschke.de> (metaseo)
|
||||
* (c) 2013 Markus Blaschke (TEQneers GmbH & Co. KG) <blaschke@teqneers.de> (tq_seo)
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
Ext.ns('MetaSeo');
|
||||
|
||||
MetaSeo = {
|
||||
|
||||
/**
|
||||
* Check if entry is in list
|
||||
*/
|
||||
inList: function (list, item) {
|
||||
return new RegExp(' ' + item + ' ').test(' ' + list + ' ');
|
||||
},
|
||||
|
||||
/**
|
||||
* Highlight text in grid
|
||||
*
|
||||
* @copyright Stefan Gehrig (TEQneers GmbH & Co. KG) <gehrig@teqneers.de>
|
||||
*/
|
||||
highlightText: function (node, search, cls) {
|
||||
search = search.toUpperCase();
|
||||
var skip = 0;
|
||||
if (node.nodeType == 3) {
|
||||
var pos = node.data.toUpperCase().indexOf(search);
|
||||
if (pos >= 0) {
|
||||
var spannode = document.createElement('span');
|
||||
spannode.className = cls || 'metaseo-search-highlight';
|
||||
var middlebit = node.splitText(pos);
|
||||
var middleclone = middlebit.cloneNode(true);
|
||||
spannode.appendChild(middleclone);
|
||||
middlebit.parentNode.replaceChild(spannode, middlebit);
|
||||
skip = 1;
|
||||
}
|
||||
} else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
|
||||
for (var i = 0; i < node.childNodes.length; ++i) {
|
||||
i += MetaSeo.highlightText(node.childNodes[i], search);
|
||||
}
|
||||
}
|
||||
return skip;
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if highlight text is available
|
||||
*
|
||||
* @copyright Markus Blaschke (TEQneers GmbH & Co. KG) <blaschke@teqneers.de>
|
||||
*/
|
||||
highlightTextExists: function (value, search) {
|
||||
var pos;
|
||||
search = search.toUpperCase();
|
||||
pos = value.toUpperCase().indexOf(search);
|
||||
return pos >= 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Severities for compatibility layer (compatible to old constants)
|
||||
*/
|
||||
Severity: {
|
||||
notice: -2,
|
||||
info: -1,
|
||||
success: 0,
|
||||
warning: 1,
|
||||
error: 2
|
||||
},
|
||||
|
||||
/**
|
||||
* Compatibility layer for Deprecation #62893 (7.0) and #66047 (7.2)
|
||||
* To be removed when support for versions older than 7 LTS is discontinued.
|
||||
*
|
||||
* This compatibility layer goes for the latest and greatest revision
|
||||
* and contains support for older infrastructure.
|
||||
*
|
||||
* @copyright Thomas Mayer (2bis10 IT-Services UG (haftungsbeschraenkt)) <thomas.mayer@2bis10.de>
|
||||
*/
|
||||
flashMessage: function(severity, title, message) {
|
||||
var duration = 3;
|
||||
var sev;
|
||||
if ((typeof top) === 'object') {
|
||||
if ('TYPO3' in top) {
|
||||
if ('Notification' in top.TYPO3) {
|
||||
switch (severity) {
|
||||
case this.Severity.notice:
|
||||
top.TYPO3.Notification.notice(title, message, duration);
|
||||
break;
|
||||
case this.Severity.success:
|
||||
top.TYPO3.Notification.success(title, message, duration);
|
||||
break;
|
||||
case this.Severity.warning:
|
||||
top.TYPO3.Notification.warning(title, message, duration);
|
||||
break;
|
||||
case this.Severity.error:
|
||||
top.TYPO3.Notification.error(title, message, duration);
|
||||
break;
|
||||
case this.Severity.info:
|
||||
default:
|
||||
top.TYPO3.Notification.info(title, message, duration);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ('Flashmessage' in top.TYPO3) {
|
||||
switch (severity) {
|
||||
case this.Severity.notice:
|
||||
sev = top.TYPO3.Severity.notice;
|
||||
break;
|
||||
case this.Severity.success:
|
||||
if ('success' in top.TYPO3.Severity) {
|
||||
sev = top.TYPO3.Severity.success;
|
||||
} else {
|
||||
sev = top.TYPO3.Severity.ok;
|
||||
}
|
||||
break;
|
||||
case this.Severity.warning:
|
||||
sev = top.TYPO3.Severity.warning;
|
||||
break;
|
||||
case this.Severity.error:
|
||||
sev = top.TYPO3.Severity.error;
|
||||
break;
|
||||
case this.Severity.info:
|
||||
default:
|
||||
if ('info' in TYPO3.Severity) {
|
||||
sev = top.TYPO3.Severity.info;
|
||||
} else {
|
||||
sev = top.TYPO3.Severity.information;
|
||||
}
|
||||
}
|
||||
top.TYPO3.Flashmessage.display(sev, title, message, duration);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (severity) {
|
||||
case this.Severity.notice:
|
||||
sev = TYPO3.Severity.notice;
|
||||
break;
|
||||
case this.Severity.success:
|
||||
if ('success' in TYPO3.Severity) {
|
||||
sev = TYPO3.Severity.success;
|
||||
} else {
|
||||
sev = TYPO3.Severity.ok;
|
||||
}
|
||||
break;
|
||||
case this.Severity.warning:
|
||||
sev = TYPO3.Severity.warning;
|
||||
break;
|
||||
case this.Severity.error:
|
||||
sev = TYPO3.Severity.error;
|
||||
break;
|
||||
case this.Severity.info:
|
||||
default:
|
||||
if ('info' in TYPO3.Severity) {
|
||||
sev = TYPO3.Severity.info;
|
||||
} else {
|
||||
sev = TYPO3.Severity.information;
|
||||
}
|
||||
}
|
||||
TYPO3.Flashmessage.display(sev, title, message, duration);
|
||||
}
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,588 @@
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Markus Blaschke <typo3@markus-blaschke.de> (metaseo)
|
||||
* (c) 2013 Markus Blaschke (TEQneers GmbH & Co. KG) <blaschke@teqneers.de> (tq_seo)
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
Ext.ns('MetaSeo.sitemap');
|
||||
|
||||
Ext.onReady(function () {
|
||||
Ext.QuickTips.init();
|
||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||
|
||||
MetaSeo.sitemap.grid.init();
|
||||
});
|
||||
|
||||
MetaSeo.sitemap.grid = {
|
||||
|
||||
init: function () {
|
||||
/****************************************************
|
||||
* grid storage
|
||||
****************************************************/
|
||||
|
||||
var ajaxUrl = TYPO3.settings.ajaxUrls[MetaSeo.sitemap.conf.ajaxController + '::index'];
|
||||
|
||||
var gridDs = new Ext.data.Store({
|
||||
storeId: 'MetaSeoSitemapRecordsStore',
|
||||
autoLoad: true,
|
||||
remoteSort: true,
|
||||
url: ajaxUrl,
|
||||
reader: new Ext.data.JsonReader({
|
||||
totalProperty: 'results',
|
||||
root: 'rows'
|
||||
}, [
|
||||
{name: 'uid', type: 'int'},
|
||||
{name: 'page_rootpid', type: 'int'},
|
||||
{name: 'page_uid', type: 'int'},
|
||||
{name: 'page_url', type: 'string'},
|
||||
{name: 'page_depth', type: 'int'},
|
||||
{name: 'page_language', type: 'int'},
|
||||
{name: 'page_change_frequency', type: 'int'},
|
||||
{name: 'page_type', type: 'int'},
|
||||
{name: 'tstamp', type: 'string'},
|
||||
{name: 'crdate', type: 'string'},
|
||||
{name: 'is_blacklisted', type: 'bool'},
|
||||
{name: 'tx_metaseo_is_exclude', type: 'bool'}
|
||||
]
|
||||
),
|
||||
sortInfo: {
|
||||
field: 'uid',
|
||||
direction: 'DESC'
|
||||
},
|
||||
baseParams: {
|
||||
pid: Ext.encode(MetaSeo.sitemap.conf.pid),
|
||||
pagerStart: 0,
|
||||
pagingSize: Ext.encode(MetaSeo.sitemap.conf.pagingSize),
|
||||
sort: MetaSeo.sitemap.conf.sortField,
|
||||
dir: MetaSeo.sitemap.conf.sortDir,
|
||||
criteriaFulltext: Ext.encode(MetaSeo.sitemap.conf.criteriaFulltext),
|
||||
criteriaPageUid: Ext.encode(MetaSeo.sitemap.conf.criteriaPageUid),
|
||||
criteriaPageLanguage: Ext.encode(MetaSeo.sitemap.conf.criteriaPageLanguage),
|
||||
criteriaPageDepth: Ext.encode(MetaSeo.sitemap.conf.criteriaPageDepth),
|
||||
criteriaIsBlacklisted: Ext.encode(MetaSeo.sitemap.conf.criteriaIsBlacklisted)
|
||||
},
|
||||
listeners: {
|
||||
beforeload: function () {
|
||||
this.baseParams.pagingSize = Ext.encode(MetaSeo.sitemap.conf.pagingSize);
|
||||
this.baseParams.criteriaFulltext = Ext.encode(MetaSeo.sitemap.conf.criteriaFulltext);
|
||||
this.baseParams.criteriaPageUid = Ext.encode(MetaSeo.sitemap.conf.criteriaPageUid);
|
||||
this.baseParams.criteriaPageLanguage = Ext.encode(MetaSeo.sitemap.conf.criteriaPageLanguage);
|
||||
this.baseParams.criteriaPageDepth = Ext.encode(MetaSeo.sitemap.conf.criteriaPageDepth);
|
||||
this.baseParams.criteriaIsBlacklisted = Ext.encode(MetaSeo.sitemap.conf.criteriaIsBlacklisted);
|
||||
this.removeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var function_filter = function (ob) {
|
||||
filterAction(ob, 'getItems');
|
||||
};
|
||||
|
||||
var filterAction = function (ob, cmd) {
|
||||
MetaSeo.sitemap.conf.criteriaFulltext = Ext.getCmp('searchFulltext').getValue();
|
||||
MetaSeo.sitemap.conf.criteriaPageUid = Ext.getCmp('searchPageUid').getValue();
|
||||
MetaSeo.sitemap.conf.criteriaPageLanguage = Ext.getCmp('searchPageLanguage').getValue();
|
||||
MetaSeo.sitemap.conf.criteriaPageDepth = Ext.getCmp('searchPageDepth').getValue();
|
||||
if (Ext.getCmp('searchIsBlacklisted').checked == true) {
|
||||
MetaSeo.sitemap.conf.criteriaIsBlacklisted = 1;
|
||||
} else {
|
||||
MetaSeo.sitemap.conf.criteriaIsBlacklisted = 0;
|
||||
}
|
||||
|
||||
gridDs.reload();
|
||||
};
|
||||
|
||||
var function_blacklist = function (ob) {
|
||||
rowAction(ob, "blacklist", MetaSeo.sitemap.conf.lang.messageBlacklistTitle, MetaSeo.sitemap.conf.lang.messageBlacklistQuestion)
|
||||
};
|
||||
|
||||
var function_whitelist = function (ob) {
|
||||
rowAction(ob, "whitelist", MetaSeo.sitemap.conf.lang.messageWhitelistTitle, MetaSeo.sitemap.conf.lang.messageWhitelistQuestion)
|
||||
};
|
||||
|
||||
var function_delete = function (ob) {
|
||||
rowAction(ob, "delete", MetaSeo.sitemap.conf.lang.messageDeleteTitle, MetaSeo.sitemap.conf.lang.messageDeleteQuestion)
|
||||
};
|
||||
|
||||
var function_delete_all = function (ob) {
|
||||
var ajaxUrl = TYPO3.settings.ajaxUrls[MetaSeo.sitemap.conf.ajaxController + '::deleteAll'];
|
||||
|
||||
var frmConfirm = new Ext.Window({
|
||||
xtype: 'form',
|
||||
width: 200,
|
||||
height: 'auto',
|
||||
modal: true,
|
||||
title: MetaSeo.sitemap.conf.lang.messageDeleteAllTitle,
|
||||
items: [
|
||||
{
|
||||
xtype: 'label',
|
||||
text: MetaSeo.sitemap.conf.lang.messageDeleteQuestion
|
||||
}
|
||||
],
|
||||
buttons: [
|
||||
{
|
||||
text: MetaSeo.sitemap.conf.lang.buttonYes,
|
||||
handler: function (cmp, e) {
|
||||
Ext.Ajax.request({
|
||||
url: ajaxUrl,
|
||||
params: {
|
||||
'pid': MetaSeo.sitemap.conf.pid
|
||||
},
|
||||
success: function (response) {
|
||||
// reload the records and the table selector
|
||||
gridDs.reload();
|
||||
},
|
||||
failure: function (response) {
|
||||
response = Ext.decode(response.responseText);
|
||||
if (response && response.error) {
|
||||
MetaSeo.flashMessage(MetaSeo.Severity.error, '', Ext.util.Format.htmlEncode(response.error));
|
||||
if (response.errorNumber) {
|
||||
console.log('ERROR: MetaSEO: ' + response.error + ' ' + response.errorNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
frmConfirm.destroy();
|
||||
}
|
||||
}, {
|
||||
text: MetaSeo.sitemap.conf.lang.buttonNo,
|
||||
handler: function (cmp, e) {
|
||||
frmConfirm.destroy();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
frmConfirm.show();
|
||||
};
|
||||
|
||||
|
||||
var rowAction = function (ob, cmd, confirmTitle, confirmText) {
|
||||
var recList = grid.getSelectionModel().getSelections();
|
||||
var ajaxUrl = TYPO3.settings.ajaxUrls[MetaSeo.sitemap.conf.ajaxController + '::' + cmd];
|
||||
|
||||
if (recList.length >= 1) {
|
||||
var uidList = [];
|
||||
for (i = 0; i < recList.length; i++) {
|
||||
uidList.push(recList[i].json.uid);
|
||||
}
|
||||
var frmConfirm = new Ext.Window({
|
||||
xtype: 'form',
|
||||
width: 200,
|
||||
height: 'auto',
|
||||
modal: true,
|
||||
title: confirmTitle,
|
||||
items: [
|
||||
{
|
||||
xtype: 'label',
|
||||
text: confirmText
|
||||
}
|
||||
],
|
||||
buttons: [
|
||||
{
|
||||
text: MetaSeo.sitemap.conf.lang.buttonYes,
|
||||
handler: function (cmp, e) {
|
||||
Ext.Ajax.request({
|
||||
url: ajaxUrl,
|
||||
params: {
|
||||
'uidList': Ext.encode(uidList),
|
||||
'pid': MetaSeo.sitemap.conf.pid
|
||||
},
|
||||
success: function (response) {
|
||||
// reload the records and the table selector
|
||||
gridDs.reload();
|
||||
},
|
||||
failure: function (response) {
|
||||
response = Ext.decode(response.responseText);
|
||||
if (response && response.error) {
|
||||
MetaSeo.flashMessage(MetaSeo.Severity.error, '', Ext.util.Format.htmlEncode(response.error));
|
||||
if (response.errorNumber) {
|
||||
console.log('ERROR: MetaSEO: ' + response.error + ' ' + response.errorNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
frmConfirm.destroy();
|
||||
}
|
||||
}, {
|
||||
text: MetaSeo.sitemap.conf.lang.buttonNo,
|
||||
handler: function (cmp, e) {
|
||||
frmConfirm.destroy();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
frmConfirm.show();
|
||||
|
||||
} else {
|
||||
// no row selected
|
||||
Ext.MessageBox.show({
|
||||
title: confirmTitle,
|
||||
msg: MetaSeo.sitemap.conf.lang.errorNoSelectedItemsBody,
|
||||
buttons: Ext.MessageBox.OK,
|
||||
minWidth: 300,
|
||||
minHeight: 200,
|
||||
icon: Ext.MessageBox.INFO
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/****************************************************
|
||||
* row checkbox
|
||||
****************************************************/
|
||||
var sm = new Ext.grid.CheckboxSelectionModel({
|
||||
singleSelect: false
|
||||
});
|
||||
|
||||
|
||||
/****************************************************
|
||||
* Renderer
|
||||
****************************************************/
|
||||
var dateToday = new Date().format("Y-m-d");
|
||||
var dateYesterday = new Date().add(Date.DAY, -1).format("Y-m-d");
|
||||
|
||||
var rendererDatetime = function (value, metaData, record, rowIndex, colIndex, store) {
|
||||
var ret = Ext.util.Format.htmlEncode(value);
|
||||
var qtip = Ext.util.Format.htmlEncode(value);
|
||||
|
||||
ret = ret.split(dateToday).join('<strong>' + MetaSeo.sitemap.conf.lang.today + '</strong>');
|
||||
ret = ret.split(dateYesterday).join('<strong>' + MetaSeo.sitemap.conf.lang.yesterday + '</strong>');
|
||||
|
||||
return '<div ext:qtip="' + qtip + '">' + ret + '</div>';
|
||||
};
|
||||
|
||||
|
||||
var rendererLanguage = function (value, metaData, record, rowIndex, colIndex, store) {
|
||||
var ret = '';
|
||||
var qtip = '';
|
||||
|
||||
if (MetaSeo.sitemap.conf.languageFullList[value]) {
|
||||
var lang = MetaSeo.sitemap.conf.languageFullList[value];
|
||||
|
||||
// Flag (if available)
|
||||
if (lang.flag) {
|
||||
ret += '<span class="t3-icon t3-icon-flags t3-icon-flags-' + Ext.util.Format.htmlEncode(lang.flag) + ' t3-icon-' + Ext.util.Format.htmlEncode(lang.flag) + '"></span>';
|
||||
ret += ' ';
|
||||
}
|
||||
|
||||
// Label
|
||||
ret += Ext.util.Format.htmlEncode(lang.label);
|
||||
qtip = Ext.util.Format.htmlEncode(lang.label);
|
||||
|
||||
} else {
|
||||
ret = value;
|
||||
}
|
||||
|
||||
return '<div ext:qtip="' + qtip + '">' + ret + '</div>';
|
||||
};
|
||||
|
||||
var rendererType = function (value, metaData, record, rowIndex, colIndex, store) {
|
||||
var ret = '';
|
||||
|
||||
if (MetaSeo.sitemap.conf.lang.sitemapPageType && MetaSeo.sitemap.conf.lang.sitemapPageType[value]) {
|
||||
ret = Ext.util.Format.htmlEncode(MetaSeo.sitemap.conf.lang.sitemapPageType[value]);
|
||||
} else {
|
||||
ret = '<i>[' + Ext.util.Format.htmlEncode(value) + ']</i>';
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
var rendererUrl = function (value, metaData, record, rowIndex, colIndex, store) {
|
||||
value = Ext.util.Format.htmlEncode(value);
|
||||
|
||||
var qtip = Ext.util.Format.htmlEncode(value);
|
||||
|
||||
return '<div ext:qtip="' + qtip + '">' + value + '</div>';
|
||||
};
|
||||
|
||||
var rendererBoolean = function (value, metaData, record, rowIndex, colIndex, store) {
|
||||
var ret;
|
||||
|
||||
if (value) {
|
||||
ret = "<b>" + MetaSeo.sitemap.conf.lang.labelYes + "</b>";
|
||||
} else {
|
||||
ret = MetaSeo.sitemap.conf.lang.labelNo;
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
/****************************************************
|
||||
* grid panel
|
||||
****************************************************/
|
||||
var grid = new Ext.grid.GridPanel({
|
||||
layout: 'fit',
|
||||
renderTo: MetaSeo.sitemap.conf.renderTo,
|
||||
store: gridDs,
|
||||
loadMask: true,
|
||||
plugins: [new Ext.ux.plugin.FitToParent()],
|
||||
columns: [
|
||||
sm,
|
||||
{
|
||||
id: 'page_uid',
|
||||
header: MetaSeo.sitemap.conf.lang.sitemap_page_uid,
|
||||
width: 10,
|
||||
sortable: true,
|
||||
dataIndex: 'page_uid',
|
||||
css: 'text-align: right;'
|
||||
},
|
||||
{
|
||||
id: 'page_url',
|
||||
header: MetaSeo.sitemap.conf.lang.sitemap_page_url,
|
||||
width: 'auto',
|
||||
sortable: true,
|
||||
dataIndex: 'page_url',
|
||||
renderer: rendererUrl
|
||||
}, {
|
||||
id: 'page_type',
|
||||
header: MetaSeo.sitemap.conf.lang.sitemap_page_type,
|
||||
width: 10,
|
||||
dataIndex: 'page_type',
|
||||
renderer: rendererType
|
||||
}, {
|
||||
id: 'page_depth',
|
||||
header: MetaSeo.sitemap.conf.lang.sitemap_page_depth,
|
||||
width: 10,
|
||||
sortable: true,
|
||||
dataIndex: 'page_depth',
|
||||
css: 'text-align: right;padding-right: 10px;'
|
||||
}, {
|
||||
id: 'page_rendererLanguage',
|
||||
header: MetaSeo.sitemap.conf.lang.sitemap_page_language,
|
||||
width: 15,
|
||||
sortable: true,
|
||||
dataIndex: 'page_language',
|
||||
renderer: rendererLanguage
|
||||
}, {
|
||||
id: 'is_blacklisted',
|
||||
header: MetaSeo.sitemap.conf.lang.sitemap_page_is_blacklisted,
|
||||
width: 10,
|
||||
sortable: true,
|
||||
dataIndex: 'is_blacklisted',
|
||||
renderer: rendererBoolean
|
||||
}, {
|
||||
id: 'tx_metaseo_is_exclude',
|
||||
header: MetaSeo.sitemap.conf.lang.page_tx_metaseo_is_exclude,
|
||||
width: 10,
|
||||
sortable: true,
|
||||
dataIndex: 'tx_metaseo_is_exclude',
|
||||
renderer: rendererBoolean
|
||||
}, {
|
||||
id: 'crdate',
|
||||
header: MetaSeo.sitemap.conf.lang.sitemap_crdate,
|
||||
width: 25,
|
||||
sortable: true,
|
||||
dataIndex: 'crdate',
|
||||
hidden: true,
|
||||
renderer: rendererDatetime
|
||||
}, {
|
||||
id: 'tstamp',
|
||||
header: MetaSeo.sitemap.conf.lang.sitemap_tstamp,
|
||||
width: 25,
|
||||
sortable: true,
|
||||
dataIndex: 'tstamp',
|
||||
hidden: true,
|
||||
renderer: rendererDatetime
|
||||
}
|
||||
],
|
||||
selModel: sm,
|
||||
stripeRows: true,
|
||||
autoExpandColumn: 'page_url',
|
||||
height: 350,
|
||||
width: '98%',
|
||||
frame: true,
|
||||
border: true,
|
||||
title: MetaSeo.sitemap.conf.lang.title,
|
||||
viewConfig: {
|
||||
forceFit: true,
|
||||
listeners: {
|
||||
refresh: function (view) {
|
||||
if (!Ext.isEmpty(MetaSeo.sitemap.conf.criteriaFulltext)) {
|
||||
view.el.select('.x-grid3-body .x-grid3-cell').each(function (el) {
|
||||
MetaSeo.highlightText(el.dom, MetaSeo.sitemap.conf.criteriaFulltext);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tbar: [
|
||||
MetaSeo.sitemap.conf.lang.labelSearchFulltext,
|
||||
{
|
||||
xtype: 'textfield',
|
||||
id: 'searchFulltext',
|
||||
fieldLabel: MetaSeo.sitemap.conf.lang.labelSearchFulltext,
|
||||
emptyText: MetaSeo.sitemap.conf.lang.emptySearchFulltext,
|
||||
listeners: {
|
||||
specialkey: function (f, e) {
|
||||
if (e.getKey() == e.ENTER) {
|
||||
function_filter(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{xtype: 'tbspacer', width: 10},
|
||||
MetaSeo.sitemap.conf.lang.labelSearchPageUid,
|
||||
{
|
||||
xtype: 'numberfield',
|
||||
id: 'searchPageUid',
|
||||
fieldLabel: MetaSeo.sitemap.conf.lang.labelSearchPageUid,
|
||||
emptyText: MetaSeo.sitemap.conf.lang.emptySearchPageUid,
|
||||
width: 50,
|
||||
listeners: {
|
||||
specialkey: function (f, e) {
|
||||
if (e.getKey() == e.ENTER) {
|
||||
function_filter(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{xtype: 'tbspacer', width: 10},
|
||||
MetaSeo.sitemap.conf.lang.labelSearchPageLanguage,
|
||||
{
|
||||
xtype: 'combo',
|
||||
id: 'searchPageLanguage',
|
||||
fieldLabel: MetaSeo.sitemap.conf.lang.labelSearchPageLanguage,
|
||||
emptyText: MetaSeo.sitemap.conf.lang.emptySearchPageLanguage,
|
||||
listeners: {
|
||||
select: function (f, e) {
|
||||
function_filter(this);
|
||||
}
|
||||
},
|
||||
forceSelection: true,
|
||||
editable: false,
|
||||
mode: 'local',
|
||||
triggerAction: 'all',
|
||||
store: new Ext.data.ArrayStore({
|
||||
id: 0,
|
||||
fields: [
|
||||
'id',
|
||||
'label',
|
||||
'flag'
|
||||
],
|
||||
data: MetaSeo.sitemap.conf.dataLanguage
|
||||
}),
|
||||
valueField: 'id',
|
||||
displayField: 'label',
|
||||
tpl: '<tpl for="."><div class="x-combo-list-item">{flag}{label}</div></tpl>'
|
||||
},
|
||||
{xtype: 'tbspacer', width: 10},
|
||||
MetaSeo.sitemap.conf.lang.labelSearchPageDepth,
|
||||
{
|
||||
xtype: 'combo',
|
||||
id: 'searchPageDepth',
|
||||
fieldLabel: MetaSeo.sitemap.conf.lang.labelSearchPageDepth,
|
||||
emptyText: MetaSeo.sitemap.conf.lang.emptySearchPageDepth,
|
||||
listeners: {
|
||||
select: function (f, e) {
|
||||
function_filter(this);
|
||||
}
|
||||
},
|
||||
forceSelection: true,
|
||||
editable: false,
|
||||
mode: 'local',
|
||||
triggerAction: 'all',
|
||||
store: new Ext.data.ArrayStore({
|
||||
id: 0,
|
||||
fields: [
|
||||
'id',
|
||||
'label'
|
||||
],
|
||||
data: MetaSeo.sitemap.conf.dataDepth
|
||||
}),
|
||||
valueField: 'id',
|
||||
displayField: 'label'
|
||||
},
|
||||
{xtype: 'tbspacer', width: 10},
|
||||
MetaSeo.sitemap.conf.lang.labelSearchIsBlacklisted,
|
||||
{
|
||||
xtype: 'checkbox',
|
||||
id: 'searchIsBlacklisted',
|
||||
listeners: {
|
||||
check: function (f, e) {
|
||||
function_filter(this);
|
||||
}
|
||||
}
|
||||
},
|
||||
{xtype: 'tbspacer', width: 10},
|
||||
{
|
||||
xtype: 'button',
|
||||
id: 'filterButton',
|
||||
text: MetaSeo.sitemap.conf.filterIcon,
|
||||
handler: function_filter
|
||||
}
|
||||
],
|
||||
bbar: [
|
||||
{
|
||||
id: 'recordPaging',
|
||||
xtype: 'paging',
|
||||
store: gridDs,
|
||||
pageSize: MetaSeo.sitemap.conf.pagingSize,
|
||||
displayInfo: true,
|
||||
displayMsg: MetaSeo.sitemap.conf.lang.pagingMessage,
|
||||
emptyMsg: MetaSeo.sitemap.conf.lang.pagingEmpty
|
||||
}, '->', {
|
||||
/****************************************************
|
||||
* Blacklist button
|
||||
****************************************************/
|
||||
|
||||
xtype: 'splitbutton',
|
||||
width: 80,
|
||||
id: 'blacklistButton',
|
||||
text: MetaSeo.sitemap.conf.lang.buttonBlacklist,
|
||||
title: MetaSeo.sitemap.conf.lang.buttonBlacklistHint,
|
||||
cls: 'x-btn-over',
|
||||
handleMouseEvents: false,
|
||||
handler: function_blacklist,
|
||||
menu: new Ext.menu.Menu({
|
||||
items: [
|
||||
// these items will render as dropdown menu items when the arrow is clicked:
|
||||
{text: MetaSeo.sitemap.conf.lang.buttonWhitelist, handler: function_whitelist}
|
||||
]
|
||||
})
|
||||
}, {
|
||||
/****************************************************
|
||||
* Delete button
|
||||
****************************************************/
|
||||
|
||||
xtype: 'splitbutton',
|
||||
width: 80,
|
||||
id: 'deleteButton',
|
||||
text: MetaSeo.sitemap.conf.lang.buttonDelete,
|
||||
title: MetaSeo.sitemap.conf.lang.buttonDeleteHint,
|
||||
iconCls: 'delete',
|
||||
cls: 'x-btn-over',
|
||||
handleMouseEvents: false,
|
||||
handler: function_delete,
|
||||
menu: new Ext.menu.Menu({
|
||||
items: [
|
||||
// these items will render as dropdown menu items when the arrow is clicked:
|
||||
{text: MetaSeo.sitemap.conf.lang.buttonDeleteAll, handler: function_delete_all}
|
||||
]
|
||||
})
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user