Bug #24270 ยป new_em_beta2.patch
typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectsoap.php (revision ) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2010 Steffen Kamper <steffen@typo3.org>
|
||
* 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 2 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.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* 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!
|
||
***************************************************************/
|
||
class tx_em_Connection_ExtDirectSoap {
|
||
/**
|
||
* @var tx_em_Repository
|
||
*/
|
||
var $repository;
|
||
/**
|
||
* @var tx_em_Connection_Soap
|
||
*/
|
||
var $soap = NULL;
|
||
/**
|
||
* Keeps instance of settings class.
|
||
*
|
||
* @var tx_em_Settings
|
||
*/
|
||
static protected $objSettings;
|
||
/**
|
||
* @var array
|
||
*/
|
||
protected $settings;
|
||
/**
|
||
* @var array
|
||
*/
|
||
protected $accountData = NULL;
|
||
/**
|
||
* Constructor
|
||
*
|
||
* @return void
|
||
*/
|
||
public function __construct() {
|
||
$this->settings = $this->getSettingsObject()->getSettings();
|
||
/** @var $repository tx_em_Repository */
|
||
$this->repository = t3lib_div::makeInstance('tx_em_Repository', $this->settings['selectedRepository']);
|
||
if ($this->settings['fe_u'] && $this->settings['fe_p']) {
|
||
$this->setAccountData($this->settings['fe_u'], $this->settings['fe_p']);
|
||
}
|
||
}
|
||
/**
|
||
* Login test with user credentials
|
||
*
|
||
* @return array
|
||
*/
|
||
public function testUserLogin() {
|
||
if (is_array($this->accountData)) {
|
||
$login = false; #$this->soap->login($this->accountData['accountData']['username'], $this->accountData['accountData']['password']);
|
||
if ($login) {
|
||
$data = array(
|
||
'success' => TRUE,
|
||
'id' => $login
|
||
);
|
||
} else {
|
||
$data = array(
|
||
'success' => FALSE,
|
||
'error' => 'login failed'
|
||
);
|
||
}
|
||
} else {
|
||
$data = array(
|
||
'success' => FALSE,
|
||
'error' => 'No user login data'
|
||
);
|
||
}
|
||
return $data;
|
||
}
|
||
/**
|
||
* Show Info of extension record
|
||
*
|
||
* @param array $record
|
||
* @return string
|
||
*/
|
||
public function showRemoteExtInfo($record) {
|
||
return t3lib_div::view_array(array($record, $this->settings));
|
||
}
|
||
/**
|
||
* Checks validity of extension key
|
||
*
|
||
* @formHandler
|
||
* @param array $parameter
|
||
* @return array
|
||
*/
|
||
public function checkExtensionkey($parameter) {
|
||
$params = array(
|
||
'extensionKey' => $parameter['extkey']
|
||
);
|
||
$result = $this->soapCall('checkExtensionKey', $params);
|
||
$message = $this->getSoapResultMessageFromCode($result['resultCode']);
|
||
//debug(array($result,$parameter), $message);
|
||
if ($result['resultCode'] == 10501) {
|
||
$return = array(
|
||
'success' => TRUE,
|
||
'message' => $message,
|
||
'valid' => TRUE,
|
||
'raw' => $result
|
||
);
|
||
} else {
|
||
$return = array(
|
||
'success' => FALSE,
|
||
'message' => $message,
|
||
'raw' => $result
|
||
);
|
||
}
|
||
return $return;
|
||
}
|
||
/**
|
||
* Register extension key
|
||
*
|
||
* @formHandler
|
||
* @param array $parameter
|
||
* @return array
|
||
*/
|
||
public function registerExtensionkey($parameter) {
|
||
$params = array(
|
||
'registerExtensionKeyData' => array(
|
||
'extensionKey' => $parameter['extkey'],
|
||
'title' => $parameter['title'],
|
||
'description' => $parameter['description']
|
||
)
|
||
);
|
||
$result = $this->soapCall('registerExtensionKey', $params);
|
||
$message = $this->getSoapResultMessageFromCode($result['resultCode']);
|
||
//debug(array($result,$parameter), $message);
|
||
if ($result['resultCode'] == 10503) {
|
||
$return = array(
|
||
'success' => TRUE,
|
||
'message' => $message,
|
||
'valid' => TRUE,
|
||
'raw' => $result
|
||
);
|
||
} else {
|
||
$return = array(
|
||
'success' => FALSE,
|
||
'message' => $message,
|
||
'raw' => $result
|
||
);
|
||
}
|
||
return $return;
|
||
}
|
||
/**
|
||
* Get own extensions
|
||
*
|
||
* @return array
|
||
*/
|
||
public function getExtensions() {
|
||
$params = array(
|
||
'extensionKeyFilterOptions' => array(
|
||
'username' => $this->settings['fe_u']
|
||
)
|
||
);
|
||
$result = @$this->soapCall('getExtensionKeys', $params);
|
||
$data = $this->addUploads($result['extensionKeyData']);
|
||
if ($result['simpleResult']['resultCode'] == 10000 && $data !== NULL) {
|
||
$return = array(
|
||
'success' => TRUE,
|
||
'total' => count($result['extensionKeyData']),
|
||
'data' => $data,
|
||
'raw' => $result
|
||
);
|
||
} else {
|
||
$return = array(
|
||
'success' => FALSE,
|
||
'raw' => $result
|
||
);
|
||
}
|
||
return $return;
|
||
}
|
||
/**
|
||
* Delete extension key
|
||
*
|
||
* @param string $key
|
||
* @return void
|
||
*/
|
||
public function deleteExtensionKey($key) {
|
||
$params = array(
|
||
'extensionKey' => $key
|
||
);
|
||
$result = $this->soapCall('deleteExtensionKey', $params);
|
||
$message = $this->getSoapResultMessageFromCode($result['resultCode']);
|
||
if ($result['resultCode'] == 10000) {
|
||
$return = array(
|
||
'success' => TRUE,
|
||
'message' => $this->getSoapResultMessageFromCode(10505), // TER API doesn't send correct result code
|
||
'key' => $key
|
||
);
|
||
} else {
|
||
$return = array(
|
||
'success' => FALSE,
|
||
'message' => $message,
|
||
'key' => $key
|
||
);
|
||
}
|
||
return $return;
|
||
}
|
||
/**
|
||
* Transfer extension key to other user
|
||
*
|
||
* @param $key
|
||
* @param $user
|
||
* @return void
|
||
*/
|
||
public function transferExtensionKey($key, $user) {
|
||
$params = array(
|
||
'modifyExtensionKeyData' => array(
|
||
'extensionKey' => $key,
|
||
'ownerUsername' => $user
|
||
)
|
||
);
|
||
$result = $this->soapCall('modifyExtensionKey', $params);
|
||
$message = $this->getSoapResultMessageFromCode($result['resultCode']);
|
||
if ($result['resultCode'] == 10000) {
|
||
$return = array(
|
||
'success' => TRUE,
|
||
'message' => $message,
|
||
'key' => $key,
|
||
'user' => $user
|
||
);
|
||
} else {
|
||
$return = array(
|
||
'success' => FALSE,
|
||
'message' => $message,
|
||
'key' => $key,
|
||
'user' => $user
|
||
);
|
||
}
|
||
return $return;
|
||
}
|
||
/*
|
||
* protected class functions
|
||
*/
|
||
/**
|
||
* Sets the account data
|
||
*
|
||
* @param string $user
|
||
* @param string $password
|
||
* @return void
|
||
*/
|
||
protected function setAccountData($user, $password) {
|
||
$this->accountData = array(
|
||
'accountData' => array(
|
||
'username' => $user,
|
||
'password' => $password
|
||
)
|
||
);
|
||
$this->initSoap();
|
||
}
|
||
/**
|
||
* Init soap
|
||
*
|
||
* @return void
|
||
*/
|
||
protected function initSoap() {
|
||
if ($this->repository->getWsdlUrl()) {
|
||
/** @var $soap tx_em_Connection_Soap */
|
||
$this->soap = t3lib_div::makeInstance('tx_em_Connection_Soap');
|
||
$this->soap->init(
|
||
array(
|
||
'wsdl' => $this->repository->getWsdlUrl(),
|
||
//'authentication' => 'headers',
|
||
'soapoptions' =>
|
||
array(
|
||
'trace' => 1,
|
||
'exceptions' => 1
|
||
)
|
||
),
|
||
$this->settings['fe_u'],
|
||
$this->settings['fe_p']
|
||
);
|
||
}
|
||
}
|
||
/**
|
||
* @param $data
|
||
* @return bool|null|string|tx_em_Settings|unknown
|
||
*/
|
||
protected function addUploads($data) {
|
||
if (count((array) $data) === 0) {
|
||
return NULL;
|
||
}
|
||
foreach ($data as $key => $extkey) {
|
||
$row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
|
||
'extkey, count(version) as uploads',
|
||
'cache_extensions',
|
||
'extkey="' . $extkey['extensionkey'] . '" AND repository=1',
|
||
'extkey'
|
||
);
|
||
$data[$key]['uploads'] = intval($row['uploads']);
|
||
$data[$key]['hasUploads'] = (intval($row['uploads']) > 0);
|
||
}
|
||
return $data;
|
||
}
|
||
/**
|
||
* Get settings object
|
||
*
|
||
* @return tx_em_Settings
|
||
*/
|
||
protected function getSettingsObject() {
|
||
if (!is_object(self::$objSettings) && !(self::$objSettings instanceof tx_em_Settings)) {
|
||
self::$objSettings = t3lib_div::makeInstance('tx_em_Settings');
|
||
}
|
||
return self::$objSettings;
|
||
}
|
||
/**
|
||
* Executes a soap call
|
||
*
|
||
* @param $name
|
||
* @param $params
|
||
* @return string $response
|
||
*/
|
||
protected function soapCall($name, $params) {
|
||
try {
|
||
$response = $this->soap->call(
|
||
$name,
|
||
array_merge($this->accountData, $params),
|
||
$this->accountData['accountData']['username'],
|
||
$this->accountData['accountData']['password']
|
||
);
|
||
return $response;
|
||
} catch (SoapFault $error) {
|
||
return array(
|
||
'success' => FALSE,
|
||
'error' => $error->faultstring
|
||
);
|
||
}
|
||
}
|
||
/**
|
||
* Translates SOAP return codes to messages
|
||
*
|
||
* @param int $code
|
||
* @return string
|
||
*/
|
||
protected function getSoapResultMessageFromCode($code) {
|
||
switch ($code) {
|
||
case 10000:
|
||
return 'OK';
|
||
break;
|
||
case 102:
|
||
return 'User does not exists.';
|
||
break;
|
||
case 10500:
|
||
return 'Extensionkey already exists.';
|
||
break;
|
||
case 10501:
|
||
return 'Extensionkey does not exists.';
|
||
break;
|
||
case 10502:
|
||
return 'Extensionkey is not valid.';
|
||
break;
|
||
case 10503:
|
||
return 'Extensionkey was successful registered.';
|
||
break;
|
||
case 10504:
|
||
return 'Extension was successful upladed.';
|
||
break;
|
||
case 10505:
|
||
return 'Extension was successful deleted.';
|
||
break;
|
||
default:
|
||
return 'Unknow error occured.';
|
||
}
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/em/res/js/em_files.js (revision ) | ||
---|---|---|
/**
|
||
* ExtJS for the extension manager.
|
||
*
|
||
*
|
||
* @author Steffen Kamper <info@sk-typo3.de>
|
||
* @package TYPO3
|
||
* @subpackage extension manager
|
||
* @version $Id: $
|
||
*/
|
||
Ext.ns('TYPO3.EM');
|
||
TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
|
||
//border: false,
|
||
height: 400,
|
||
recordData: null,
|
||
isWindow: false,
|
||
initComponent:function() {
|
||
var editArea = new Ext.form.TextArea({
|
||
itemId: 'editarea',
|
||
ctCls: 'editareapanel',
|
||
enableKeyEvents: true,
|
||
listeners: {
|
||
change: function() {
|
||
//Ext.getComponent('editarea-save').enable();
|
||
},
|
||
keypress: function(textfield, event) {
|
||
event.stopPropagation();
|
||
},
|
||
specialkey: function(textfield, event) {
|
||
event.stopPropagation();
|
||
},
|
||
scope: this
|
||
}
|
||
});
|
||
var fileTree = new Ext.tree.TreePanel ({
|
||
//directFn: TYPO3.EM.ExtDirect.getExtFileTree,
|
||
itemId: 'extfiletree',
|
||
autoScroll: true,
|
||
containerScroll: true,
|
||
margins: '0 0 0 0',
|
||
cmargins: '0 0 0 0',
|
||
//useArrows: true,
|
||
root: {
|
||
text: 'Extension Files',
|
||
itemId: 'fileroot',
|
||
expanded: true
|
||
},
|
||
loader: {
|
||
directFn: TYPO3.EM.ExtDirect.getExtFileTree,
|
||
baseParams: {
|
||
extkey: this.recordData.extkey,
|
||
typeShort: this.recordData.typeShort,
|
||
baseNode: this.recordData.nodePath
|
||
},
|
||
paramsAsHash: true
|
||
},
|
||
listeners: {
|
||
click: function(node) { console.log(node.attributes.fileType);
|
||
var p = this.getComponent('editarea');
|
||
if (node.attributes.fileType === 'text') {
|
||
this.layout.center.panel.reloadButton.show().disable();
|
||
TYPO3.EM.ExtDirect.readExtFile(node.attributes.id , function(response) {
|
||
// load in textarea
|
||
editArea.setValue(response);
|
||
this.layout.center.panel.reloadButton.enable();
|
||
this.layout.center.panel.fileLabel.setText('File: ' + node.attributes.text);
|
||
this.layout.center.panel.saveButton.disable();
|
||
}, this);
|
||
}
|
||
if (node.attributes.fileType === 'image') {
|
||
var w = new Ext.Window({
|
||
width: 200,
|
||
height: 200,
|
||
title: node.attributes.text,
|
||
layout: 'fit',
|
||
items: [{
|
||
xtype: 'image',
|
||
src: TYPO3.settings.EM.siteUrl + node.attributes.id,
|
||
autoSize: true,
|
||
resizable: false,
|
||
renderTo: document.body
|
||
}]
|
||
}).show();
|
||
}
|
||
},
|
||
scope: this
|
||
}
|
||
});
|
||
Ext.apply(this, {
|
||
layout: 'border',
|
||
items: [{
|
||
region: 'west',
|
||
layout: 'fit',
|
||
split: true,
|
||
width: 260,
|
||
collapsible: true,
|
||
collapseMode: 'mini',
|
||
cls: 'filetree-panel',
|
||
hideCollapseTool: true,
|
||
items: [fileTree],
|
||
tbar: [{
|
||
iconCls: 'x-tbar-loading',
|
||
handler: function() {
|
||
fileTree.getRootNode().reload();
|
||
},
|
||
scope: this
|
||
}, '-', {
|
||
iconCls: 'x-btn-upload',
|
||
tooltip: 'upload'
|
||
}, {
|
||
iconCls: 'x-btn-download',
|
||
tooltip: 'download'
|
||
}]
|
||
}, {
|
||
region: 'center',
|
||
layout: 'fit',
|
||
margins: '0 0 0 0',
|
||
cmargins: '0 0 0 0',
|
||
border: false,
|
||
items: [editArea],
|
||
tbar: [{
|
||
iconCls: 'x-btn-filebrowser',
|
||
tooltip: 'open in new window',
|
||
ref: '../openWindowButton',
|
||
scope: this,
|
||
hidden: this.isWindow,
|
||
handler: function() {
|
||
var newEditor = new Ext.Window({
|
||
title: this.recordData.title + ' (' + this.recordData.extkey + ')',
|
||
width: 600,
|
||
height: 400,
|
||
layout: 'fit',
|
||
maximizable: true,
|
||
collapsible: true,
|
||
items: [{
|
||
xtype: 'extfilelist',
|
||
minHeight: 400,
|
||
recordData: this.recordData,
|
||
isWindow: true
|
||
}]
|
||
}).show();
|
||
}
|
||
}, {
|
||
xtype: 'tbseparator',
|
||
hidden: this.isWindow
|
||
}, {
|
||
iconCls: 'x-tbar-loading',
|
||
tooltip: 'reload the file',
|
||
ref: '../reloadButton',
|
||
scope: this,
|
||
hidden: true,
|
||
handler: function() {
|
||
this.layout.center.panel.reloadButton.disable();
|
||
TYPO3.EM.ExtDirect.readExtFile(fileTree.getSelectionModel().getSelectedNode().attributes.id , function(response) {
|
||
editArea.setValue(response);
|
||
this.layout.center.panel.reloadButton.enable();
|
||
}, this);
|
||
}
|
||
}, {
|
||
iconCls: 'x-btn-save',
|
||
tooltip: 'save',
|
||
ref: '../saveButton',
|
||
disabled: true,
|
||
scope: this,
|
||
handler: function() {
|
||
this.layout.center.panel.reloadButton.disable();
|
||
TYPO3.EM.ExtDirect.saveExtFile(
|
||
Ext.getComponent('extfiletree').getSelectionModel().getSelectedNode().attributes.id,
|
||
Ext.getComponent('editarea').getValue(),
|
||
function(response) {
|
||
this.layout.center.panel.saveButton.disable();
|
||
this.layout.center.panel.reloadButton.enable();
|
||
}, this);
|
||
}
|
||
}, '->', {
|
||
xtype: 'tbtext',
|
||
ref: '../fileLabel',
|
||
itemId: 'editarea-filename',
|
||
text: 'click on a file to load in editor ...'
|
||
}]
|
||
}]
|
||
});
|
||
TYPO3.EM.ExtFilelist.superclass.initComponent.apply(this, arguments);
|
||
},
|
||
fileClick: function(response) {
|
||
Ext.getComponent('editarea').setValue(response);
|
||
},
|
||
onRender: function() {
|
||
TYPO3.EM.ExtFilelist.superclass.onRender.apply(this, arguments);
|
||
}
|
||
});
|
||
// register xtype
|
||
Ext.reg('extfilelist', TYPO3.EM.ExtFilelist);
|
typo3/sysext/em/classes/extensions/class.tx_em_extensions_details.php (revision ) | ||
---|---|---|
$headerCol = $GLOBALS['LANG']->getLL('extInfoArray_inst_type');
|
||
$headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_type', $headerCol);
|
||
$dataCol = $this->api->typeLabels[$extInfo['type']] . ' - <em>' . $this->parentObject->typeDescr[$extInfo['type']] . '</em>';
|
||
$dataCol = $this->api->typeLabels[$extInfo['type']] . ' - <em>' . $this->api->typeDescr[$extInfo['type']] . '</em>';
|
||
$lines[] = array($headerCol, $dataCol);
|
||
... | ... | |
if (!t3lib_div::inList($this->parentObject->nameSpaceExceptions, $extKey)) {
|
||
$dataCol = t3lib_utility_Debug::viewarray($techInfo['NSerrors']);
|
||
} else {
|
||
$dataCol = $GLOBALS['TBE_TEMPLATE']->dfw($GLOBALS['LANG']->getLL('extInfoArray_exception'));
|
||
$dataCol = tx_em_Tools::dfw($GLOBALS['LANG']->getLL('extInfoArray_exception'));
|
||
}
|
||
}
|
typo3/sysext/em/ext_emconf.php (revision ) | ||
---|---|---|
########################################################################
|
||
# Extension Manager/Repository config file for ext "em".
|
||
#
|
||
# Auto generated 13-11-2010 01:00
|
||
# Auto generated 01-12-2010 23:35
|
||
#
|
||
# Manual updates:
|
||
# Only the data in the array - everything else is removed by next
|
||
... | ... | |
'author_company' => '',
|
||
'CGLcompliance' => '',
|
||
'CGLcompliance_note' => '',
|
||
'version' => '2.0.0',
|
||
'_md5_values_when_last_written' => 'a:40:{s:16:"ext_autoload.php";s:4:"e526";s:12:"ext_icon.gif";s:4:"3a30";s:17:"ext_localconf.php";s:4:"fd30";s:14:"ext_tables.php";s:4:"c5d9";s:14:"ext_tables.sql";s:4:"4997";s:25:"ext_tables_static+adt.sql";s:4:"3c1b";s:16:"classes/conf.php";s:4:"a8a0";s:17:"classes/index.php";s:4:"808a";s:61:"classes/connection/class.tx_em_connection_extdirectserver.php";s:4:"50cf";s:50:"classes/connection/class.tx_em_connection_soap.php";s:4:"1623";s:49:"classes/connection/class.tx_em_connection_ter.php";s:4:"e818";s:41:"classes/database/class.tx_em_database.php";s:4:"67e9";s:54:"classes/exception/class.tx_em_connection_exception.php";s:4:"8b14";s:59:"classes/exception/class.tx_em_extensionimport_exception.php";s:4:"62e2";s:56:"classes/exception/class.tx_em_extensionxml_exception.php";s:4:"fcfe";s:53:"classes/exception/class.tx_em_mirrorxml_exception.php";s:4:"ad05";s:47:"classes/exception/class.tx_em_xml_exception.php";s:4:"3679";s:53:"classes/extensions/class.tx_em_extensions_details.php";s:4:"5b9b";s:50:"classes/extensions/class.tx_em_extensions_list.php";s:4:"2b68";s:59:"classes/import/class.tx_em_import_extensionlistimporter.php";s:4:"dd13";s:56:"classes/import/class.tx_em_import_mirrorlistimporter.php";s:4:"c512";s:39:"classes/install/class.tx_em_install.php";s:4:"c861";s:64:"classes/parser/class.tx_em_parser_extensionxmlabstractparser.php";s:4:"d268";s:60:"classes/parser/class.tx_em_parser_extensionxmlpullparser.php";s:4:"c604";s:60:"classes/parser/class.tx_em_parser_extensionxmlpushparser.php";s:4:"3bcc";s:61:"classes/parser/class.tx_em_parser_mirrorxmlabstractparser.php";s:4:"802b";s:57:"classes/parser/class.tx_em_parser_mirrorxmlpullparser.php";s:4:"1054";s:55:"classes/parser/class.tx_em_parser_xmlabstractparser.php";s:4:"822b";s:54:"classes/parser/class.tx_em_parser_xmlparserfactory.php";s:4:"ae4d";s:45:"classes/repository/class.tx_em_repository.php";s:4:"58c6";s:53:"classes/repository/class.tx_em_repository_mirrors.php";s:4:"dc40";s:53:"classes/repository/class.tx_em_repository_utility.php";s:4:"ac3a";s:41:"classes/settings/class.tx_em_settings.php";s:4:"aaf1";s:55:"classes/tasks/class.tx_em_tasks_updateextensionlist.php";s:4:"f022";s:35:"classes/tools/class.tx_em_tools.php";s:4:"fd03";s:41:"classes/tools/class.tx_em_tools_unzip.php";s:4:"ffe1";s:46:"classes/tools/class.tx_em_tools_xmlhandler.php";s:4:"48bb";s:49:"classes/translations/class.tx_em_translations.php";s:4:"7a8b";s:61:"interfaces/interface.tx_em_index_checkdatabaseupdateshook.php";s:4:"7178";s:22:"language/locallang.xml";s:4:"5d2d";}',
|
||
'version' => '2.0.2beta2',
|
||
'_md5_values_when_last_written' => 'a:91:{s:16:"ext_autoload.php";s:4:"55c9";s:12:"ext_icon.gif";s:4:"2cc2";s:17:"ext_localconf.php";s:4:"fd30";s:14:"ext_tables.php";s:4:"4ef6";s:14:"ext_tables.sql";s:4:"5a42";s:25:"ext_tables_static+adt.sql";s:4:"3c1b";s:27:"classes/class.tx_em_api.php";s:4:"7b62";s:31:"classes/class.tx_em_develop.php";s:4:"98bd";s:40:"classes/class.tx_em_extensionmanager.php";s:4:"7ccc";s:16:"classes/conf.php";s:4:"d842";s:17:"classes/index.php";s:4:"7117";s:61:"classes/connection/class.tx_em_connection_extdirectserver.php";s:4:"ac98";s:59:"classes/connection/class.tx_em_connection_extdirectsoap.php";s:4:"daf8";s:50:"classes/connection/class.tx_em_connection_soap.php";s:4:"d1f9";s:49:"classes/connection/class.tx_em_connection_ter.php";s:4:"3d38";s:41:"classes/database/class.tx_em_database.php";s:4:"e6c0";s:54:"classes/exception/class.tx_em_connection_exception.php";s:4:"8b14";s:59:"classes/exception/class.tx_em_extensionimport_exception.php";s:4:"62e2";s:56:"classes/exception/class.tx_em_extensionxml_exception.php";s:4:"fcfe";s:53:"classes/exception/class.tx_em_mirrorxml_exception.php";s:4:"ad05";s:47:"classes/exception/class.tx_em_xml_exception.php";s:4:"3679";s:53:"classes/extensions/class.tx_em_extensions_details.php";s:4:"ae75";s:50:"classes/extensions/class.tx_em_extensions_list.php";s:4:"f74a";s:59:"classes/import/class.tx_em_import_extensionlistimporter.php";s:4:"62c8";s:56:"classes/import/class.tx_em_import_mirrorlistimporter.php";s:4:"3ea7";s:39:"classes/install/class.tx_em_install.php";s:4:"0c5c";s:64:"classes/parser/class.tx_em_parser_extensionxmlabstractparser.php";s:4:"d268";s:60:"classes/parser/class.tx_em_parser_extensionxmlpullparser.php";s:4:"c604";s:60:"classes/parser/class.tx_em_parser_extensionxmlpushparser.php";s:4:"3bcc";s:61:"classes/parser/class.tx_em_parser_mirrorxmlabstractparser.php";s:4:"802b";s:57:"classes/parser/class.tx_em_parser_mirrorxmlpullparser.php";s:4:"1054";s:57:"classes/parser/class.tx_em_parser_mirrorxmlpushparser.php";s:4:"b5f5";s:55:"classes/parser/class.tx_em_parser_xmlabstractparser.php";s:4:"911a";s:54:"classes/parser/class.tx_em_parser_xmlparserfactory.php";s:4:"f56a";s:45:"classes/repository/class.tx_em_repository.php";s:4:"5dbd";s:53:"classes/repository/class.tx_em_repository_mirrors.php";s:4:"dc40";s:53:"classes/repository/class.tx_em_repository_utility.php";s:4:"886d";s:41:"classes/settings/class.tx_em_settings.php";s:4:"68fc";s:55:"classes/tasks/class.tx_em_tasks_updateextensionlist.php";s:4:"7e39";s:35:"classes/tools/class.tx_em_tools.php";s:4:"050f";s:41:"classes/tools/class.tx_em_tools_unzip.php";s:4:"ffe1";s:46:"classes/tools/class.tx_em_tools_xmlhandler.php";s:4:"48bb";s:49:"classes/translations/class.tx_em_translations.php";s:4:"7a8b";s:61:"interfaces/interface.tx_em_index_checkdatabaseupdateshook.php";s:4:"7178";s:22:"language/locallang.xml";s:4:"2732";s:17:"res/css/t3_em.css";s:4:"274a";s:20:"res/icons/cancel.png";s:4:"757a";s:22:"res/icons/download.png";s:4:"c5b2";s:19:"res/icons/drive.png";s:4:"9520";s:25:"res/icons/filebrowser.png";s:4:"25b9";s:18:"res/icons/flag.png";s:4:"8798";s:19:"res/icons/image.png";s:4:"82ab";s:21:"res/icons/install.gif";s:4:"8d57";s:19:"res/icons/oodoc.gif";s:4:"744b";s:20:"res/icons/server.png";s:4:"92ce";s:22:"res/icons/settings.png";s:4:"30a1";s:19:"res/icons/tools.png";s:4:"16d9";s:23:"res/icons/uninstall.gif";s:4:"a77f";s:16:"res/js/em_app.js";s:4:"38e3";s:23:"res/js/em_components.js";s:4:"6517";s:18:"res/js/em_files.js";s:4:"efa9";s:22:"res/js/em_languages.js";s:4:"b9b0";s:20:"res/js/em_layouts.js";s:4:"0c4f";s:22:"res/js/em_locallist.js";s:4:"e321";s:27:"res/js/em_repositorylist.js";s:4:"7096";s:21:"res/js/em_settings.js";s:4:"d657";s:16:"res/js/em_ter.js";s:4:"a237";s:18:"res/js/em_tools.js";s:4:"8b1b";s:22:"res/js/em_usertools.js";s:4:"37ce";s:33:"res/js/overrides/ext_overrides.js";s:4:"3bc1";s:24:"res/js/ux/GridFilters.js";s:4:"b42c";s:27:"res/js/ux/custom_plugins.js";s:4:"a27f";s:28:"res/js/ux/fileuploadfield.js";s:4:"06a5";s:29:"res/js/ux/rowpanelexpander.js";s:4:"fc07";s:24:"res/js/ux/searchfield.js";s:4:"41a1";s:29:"res/js/ux/css/GridFilters.css";s:4:"78fa";s:27:"res/js/ux/css/RangeMenu.css";s:4:"c5f6";s:33:"res/js/ux/filter/BooleanFilter.js";s:4:"d67f";s:30:"res/js/ux/filter/DateFilter.js";s:4:"1d6d";s:26:"res/js/ux/filter/Filter.js";s:4:"5e35";s:30:"res/js/ux/filter/ListFilter.js";s:4:"a9ab";s:33:"res/js/ux/filter/NumericFilter.js";s:4:"abb4";s:32:"res/js/ux/filter/StringFilter.js";s:4:"0923";s:27:"res/js/ux/images/equals.png";s:4:"87b7";s:25:"res/js/ux/images/find.png";s:4:"9f1c";s:33:"res/js/ux/images/greater_than.png";s:4:"746c";s:30:"res/js/ux/images/less_than.png";s:4:"2fb7";s:38:"res/js/ux/images/sort_filtered_asc.gif";s:4:"9e7a";s:39:"res/js/ux/images/sort_filtered_desc.gif";s:4:"6d59";s:26:"res/js/ux/menu/ListMenu.js";s:4:"d6c1";s:27:"res/js/ux/menu/RangeMenu.js";s:4:"cc46";};',
|
||
'constraints' => array(
|
||
'depends' => array(
|
||
'cms' => '',
|
typo3/sysext/em/res/js/em_settings.js (revision ) | ||
---|---|---|
/**
|
||
* ExtJS for the extension manager.
|
||
*
|
||
*
|
||
* @author Steffen Kamper <info@sk-typo3.de>
|
||
* @package TYPO3
|
||
* @subpackage extension manager
|
||
* @version $Id: $
|
||
*/
|
||
Ext.ns('TYPO3.EM');
|
||
TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
|
||
border: false,
|
||
labelWidth: 240,
|
||
bodyStyle: 'padding:5px 5px 0',
|
||
initComponent: function() {
|
||
this.repositoryStore = new Ext.data.DirectStore({
|
||
storeId: 'repositoriessettings',
|
||
directFn: TYPO3.EM.ExtDirect.getRepositories,
|
||
idProperty: 'uid',
|
||
root: 'data',
|
||
totalProperty: 'length',
|
||
fields : ['title', 'uid', 'updated', 'count', 'selected', 'description', 'wsdl_url', 'mirror_url'],
|
||
paramsAsHash: true,
|
||
listeners: {
|
||
load: function(store) {
|
||
if (this.isLoaded) {
|
||
record = store.getById(this.repSettingsCombo.getValue()).data;
|
||
this.repositoryInfo(record);
|
||
}
|
||
},
|
||
scope: this
|
||
}
|
||
});
|
||
this.repSettingsCombo = new Ext.form.ComboBox({
|
||
id: 'repSettingsCombo',
|
||
mode: 'local',
|
||
width: 300,
|
||
triggerAction: 'all',
|
||
forceSelection: true,
|
||
editable: false,
|
||
name: 'selectedRepository',
|
||
hiddenName: 'selectedRepository',
|
||
displayField: 'title',
|
||
valueField: 'uid',
|
||
store: this.repositoryStore,
|
||
fieldLabel: 'Select Repository',
|
||
listeners: {
|
||
scope: this,
|
||
select: function(comboBox, newValue, oldValue) {
|
||
this.repositoryInfo(newValue.data);
|
||
TYPO3.EM.ExtDirect.saveSetting('selectedRepository', newValue.data.uid);
|
||
}
|
||
}
|
||
});
|
||
var mirrorData = TYPO3.settings.EM.extMirrors;
|
||
this.mirrorStore = new Ext.data.DirectStore({
|
||
storeId: 'em-mirror-store',
|
||
directFn: TYPO3.EM.ExtDirect.getMirrors,
|
||
idProperty: 'host',
|
||
root: 'data',
|
||
totalProperty: 'length',
|
||
fields: [
|
||
{name : 'title'},
|
||
{name : 'country'},
|
||
{name : 'host'},
|
||
{name : 'path'},
|
||
{name : 'sponsor'},
|
||
{name : 'link'},
|
||
{name : 'logo'}
|
||
]
|
||
});
|
||
var mirrorSm = new Ext.grid.CheckboxSelectionModel({
|
||
singleSelect: true,
|
||
header: '',
|
||
listeners: {
|
||
'selectionchange': function(selectionModel) {
|
||
var selectedMirror = '';
|
||
if (selectionModel.getSelected()) {
|
||
var sel = selectionModel.getSelected();
|
||
selectedMirror = sel.data.host;
|
||
this.getForm().setValues({selectedMirror: selectedMirror});
|
||
} else {
|
||
this.getForm().setValues({selectedMirror: ''});
|
||
}
|
||
TYPO3.EM.ExtDirect.saveSetting('selectedMirror', selectedMirror);
|
||
},
|
||
scope: this
|
||
}
|
||
});
|
||
var mirrorCm = new Ext.grid.ColumnModel([
|
||
mirrorSm,
|
||
{
|
||
id: 'mirror-title',
|
||
header: TYPO3.lang.mirror,
|
||
width: 200,
|
||
sortable: false,
|
||
menuDisabled: true,
|
||
fixed: true,
|
||
dataIndex: 'title',
|
||
hidable: false
|
||
},{
|
||
id: 'mirror-country',
|
||
header: TYPO3.lang.mirror_country,
|
||
width: 80,
|
||
sortable: false,
|
||
menuDisabled: true,
|
||
fixed: true,
|
||
dataIndex: 'country',
|
||
hidable: false
|
||
},{
|
||
id: 'mirror-host',
|
||
header: TYPO3.lang.mirror_url,
|
||
width: 180,
|
||
sortable: false,
|
||
menuDisabled: true,
|
||
fixed: true,
|
||
dataIndex: 'host',
|
||
hidable: false
|
||
},{
|
||
id: 'mirror-sponsor',
|
||
header: TYPO3.lang.mirror_sponsored_by,
|
||
width: 180,
|
||
sortable: false,
|
||
menuDisabled: true,
|
||
fixed: true,
|
||
dataIndex: 'sponsor',
|
||
hidable: false
|
||
},{
|
||
id: 'mirror-logo',
|
||
header: TYPO3.lang.mirror_logo_link,
|
||
width: 180,
|
||
sortable: false,
|
||
menuDisabled: true,
|
||
fixed: true,
|
||
dataIndex: 'logo',
|
||
hidable: false,
|
||
renderer: function(value, metaData, record, rowIndex, colIndex, store) {
|
||
if (value == '') {
|
||
return ''
|
||
} else {
|
||
return '<a href="' + record.data.link + '" title="' + record.data.sponsor + '" target="_blank"><img src="' + record.data.logo + '" alt="' + record.data.sponsor + '" title="' + record.data.sponsor + '" /></a>';
|
||
}
|
||
}
|
||
}
|
||
]);
|
||
Ext.apply(this, {
|
||
isLoaded: false,
|
||
items: [{
|
||
layout: 'hbox',
|
||
align: 'stretchmax',
|
||
border: false,
|
||
items: [{
|
||
width: 450,
|
||
border: false,
|
||
labelWidth: 100,
|
||
items: [{
|
||
xtype:'fieldset',
|
||
title: TYPO3.lang.user_settings,
|
||
collapsible: true,
|
||
defaults: {},
|
||
defaultType: 'textfield',
|
||
items :[
|
||
{
|
||
fieldLabel: TYPO3.lang.enter_repository_username,
|
||
name: 'fe_u'
|
||
}, {
|
||
fieldLabel: TYPO3.lang.enter_repository_password,
|
||
inputType: 'password',
|
||
name: 'fe_p'
|
||
},
|
||
new Ext.Container({
|
||
html: '<b>' + TYPO3.lang.notice + '</b> ' + TYPO3.lang.repository_password_info,
|
||
xtype: 'displayfield',
|
||
labelWidth: 1
|
||
})
|
||
],
|
||
buttons: [
|
||
{
|
||
text: TYPO3.lang.cmd_save,
|
||
iconCls: 'x-btn-save',
|
||
handler: function() {
|
||
this.saveFormHandler();
|
||
},
|
||
scope: this
|
||
}
|
||
]
|
||
}, {
|
||
xtype:'fieldset',
|
||
title: TYPO3.lang.repositories,
|
||
collapsible: true,
|
||
defaultType: 'textfield',
|
||
items :[
|
||
this.repSettingsCombo,
|
||
{
|
||
title: TYPO3.lang.repository_details,
|
||
xtype: 'panel',
|
||
id: 'repDescriptionDisplay',
|
||
record: null,
|
||
labelWidth: 0,
|
||
width: 420,
|
||
html: '',
|
||
bodyStyle: 'padding: 10px;',
|
||
buttons: [{
|
||
text: TYPO3.lang.cmd_edit,
|
||
iconCls: 'x-btn-edit',
|
||
ref: '../editRep',
|
||
handler: function() {
|
||
var record = this.repositoryStore.getById(this.repSettingsCombo.getValue());
|
||
var win = new TYPO3.EM.EditRepository({
|
||
title: 'Edit Repository "' + record.data.title + '"'
|
||
});
|
||
win.getComponent('repForm').getForm().setValues({
|
||
'title': record.data.title,
|
||
'description': record.data.description,
|
||
'wsdl_url': record.data.wsdl_url,
|
||
'mirror_url': record.data.mirror_url,
|
||
'rep': record.data.uid
|
||
});
|
||
win.show();
|
||
},
|
||
scope: this
|
||
}, ' ', {
|
||
text: TYPO3.lang.cmd_create,
|
||
iconCls: 'x-btn-new',
|
||
ref: '../newRep',
|
||
handler: function() {
|
||
var win = new TYPO3.EM.EditRepository({
|
||
isCreate: true,
|
||
title: 'Create new Repository'
|
||
}).show();
|
||
},
|
||
scope: this
|
||
}, ' ', {
|
||
text: TYPO3.lang.cmd_delete,
|
||
iconCls: 'x-btn-delete',
|
||
ref: '../deleteRep'
|
||
}]
|
||
}]
|
||
}]
|
||
}, {
|
||
flex: 1,
|
||
border: false,
|
||
items: [{
|
||
xtype:'fieldset',
|
||
title: TYPO3.lang.mirror_selection,
|
||
collapsible: true,
|
||
defaults: {},
|
||
items :[{
|
||
xtype: 'grid',
|
||
id: 'em-mirrorgrid',
|
||
stripeRows: true,
|
||
store: this.mirrorStore,
|
||
cm: mirrorCm,
|
||
sm: mirrorSm,
|
||
viewConfig: {
|
||
forceFit: true
|
||
},
|
||
height: 450
|
||
},{
|
||
xtype: 'hidden',
|
||
name: 'selectedMirror'
|
||
}]
|
||
}]
|
||
}]
|
||
}]
|
||
});
|
||
// call parent
|
||
TYPO3.EM.Settings.superclass.initComponent.apply(this, arguments);
|
||
} ,
|
||
saveFormHandler: function() {
|
||
this.getForm().submit({
|
||
waitMsg : 'Saving Settings...',
|
||
success: function(form, action) {
|
||
TYPO3.Flashmessage.display(TYPO3.Severity.information,'Settings', 'Settings were saved ', 5);
|
||
TYPO3.settings.EM.hasCredentials = (action.result.data.fe_u !== '' && action.result.data.fe_p !== '')
|
||
},
|
||
failure: function(form, action) {
|
||
if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
|
||
TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Error',
|
||
'Status:'+action.response.status+': '+
|
||
action.response.statusText, 5);
|
||
}
|
||
if (action.failureType === Ext.form.Action.SERVER_INVALID){
|
||
// server responded with success = false
|
||
TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Invalid', action.result.errormsg, 5);
|
||
}
|
||
}
|
||
});
|
||
},
|
||
repositoryInfo: function(record) {
|
||
var panel = Ext.getCmp('repDescriptionDisplay');
|
||
panel.update([
|
||
'<h1 class="h1Panel">',record.title, '</h1>',
|
||
'<p class="panelDescription">', record.description, '</p>',
|
||
'<p><b>', 'Mirror URL: ', '</b>', record.mirror_url, '<br />',
|
||
'<b>', 'WSDL URL: ', '</b>', record.wsdl_url, '</p>'
|
||
].join(''));
|
||
if (record.uid == 1) {
|
||
panel.editRep.disable();
|
||
panel.deleteRep.disable();
|
||
} else {
|
||
panel.editRep.enable();
|
||
panel.deleteRep.enable();
|
||
}
|
||
this.mirrorStore.load({
|
||
params: {
|
||
repository: this.repSettingsCombo.getValue()
|
||
},
|
||
callback: function() {
|
||
var mirror = this.getForm().getValues().selectedMirror;
|
||
if (mirror) {
|
||
var record = this.mirrorStore.getAt(this.mirrorStore.find('host', mirror));
|
||
Ext.getCmp('em-mirrorgrid').getSelectionModel().selectRecords([record]);
|
||
} else {
|
||
Ext.getCmp('em-mirrorgrid').getSelectionModel().selectFirstRow();
|
||
}
|
||
},
|
||
scope: this
|
||
});
|
||
},
|
||
onRender:function() {
|
||
// call parent
|
||
TYPO3.EM.Settings.superclass.onRender.apply(this, arguments);
|
||
Ext.apply(this.getForm(),{
|
||
api: {
|
||
load: TYPO3.EM.ExtDirect.settingsFormLoad,
|
||
submit: TYPO3.EM.ExtDirect.settingsFormSubmit
|
||
},
|
||
paramsAsHash: false
|
||
});
|
||
this.repositoryStore.load();
|
||
this.getForm().load({
|
||
success: function(form, response) {
|
||
record = this.repositoryStore.getById(this.repSettingsCombo.getValue()).data;
|
||
this.repositoryInfo(record);
|
||
this.isLoaded = true;
|
||
},
|
||
scope: this
|
||
});
|
||
}
|
||
});
|
||
// register xtype
|
||
Ext.reg('extsettings', TYPO3.EM.Settings);
|
||
// window with repository edit/create form
|
||
TYPO3.EM.EditRepository = Ext.extend(Ext.Window, {
|
||
isCreate: false,
|
||
width: 500,
|
||
height: 260,
|
||
layout: 'fit',
|
||
frame: true,
|
||
resizable: false,
|
||
modal: true,
|
||
caller: null,
|
||
initComponent : function() {
|
||
var form = new Ext.form.FormPanel({
|
||
//baseCls: 'x-plain',
|
||
border: false,
|
||
labelWidth: 80,
|
||
itemId: 'repForm',
|
||
bodyStyle:'padding:5px 5px 0',
|
||
width: 350,
|
||
defaults: {width: 380},
|
||
defaultType: 'textfield',
|
||
api: {
|
||
submit: TYPO3.EM.ExtDirect.repositoryEditFormSubmit
|
||
},
|
||
paramsAsHash: false,
|
||
items: [{
|
||
itemId: 'title',
|
||
fieldLabel: 'Title',
|
||
name: 'title'
|
||
}, {
|
||
itemId: 'description',
|
||
fieldLabel: 'Description',
|
||
xtype: 'textarea',
|
||
name: 'description',
|
||
height: 100
|
||
}, {
|
||
itemId: 'mirror_url',
|
||
fieldLabel: 'Mirror URL',
|
||
name: 'mirror_url'
|
||
}, {
|
||
itemId: 'wsdl_url',
|
||
fieldLabel: 'WSDL URL',
|
||
name: 'wsdl_url'
|
||
}, {
|
||
xtype: 'hidden',
|
||
name: 'create',
|
||
value: this.isCreate ? 1 : 0
|
||
}, {
|
||
xtype: 'hidden',
|
||
name: 'rep',
|
||
value: 0
|
||
}]
|
||
});
|
||
Ext.apply(this, {
|
||
items: form,
|
||
buttons : [{
|
||
text: 'Create',
|
||
iconCls: 'x-btn-save',
|
||
handler: function() {
|
||
this.repositoryUpdate(form, 1);
|
||
},
|
||
hidden: !this.isCreate,
|
||
scope: this
|
||
}, {
|
||
text: 'Update',
|
||
iconCls: 'x-btn-save',
|
||
handler: function() {
|
||
this.repositoryUpdate(form, 0);
|
||
},
|
||
hidden: this.isCreate,
|
||
scope: this
|
||
}, {
|
||
text: 'Cancel',
|
||
iconCls: 'x-btn-cancel',
|
||
handler: function() {
|
||
this.close();
|
||
},
|
||
scope: this
|
||
}]
|
||
});
|
||
TYPO3.EM.EditRepository.superclass.initComponent.call(this);
|
||
},
|
||
repositoryUpdate: function(form, type) {
|
||
form.getForm().submit({
|
||
waitMsg : type === 0 ? 'Saving Repository...' : 'Creating Repository ...',
|
||
success: function(form, action) {
|
||
TYPO3.Flashmessage.display(TYPO3.Severity.information,'Repository', 'Repository was ' + (type == 0 ? 'saved.' : 'created.'), 5);
|
||
Ext.StoreMgr.get('repositoriessettings').load();
|
||
this.close();
|
||
},
|
||
failure: function(form, action) {
|
||
if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
|
||
TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Error',
|
||
'Status:'+action.response.status+': '+
|
||
action.response.statusText, 5);
|
||
}
|
||
if (action.failureType === Ext.form.Action.SERVER_INVALID){
|
||
// server responded with success = false
|
||
TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Invalid', action.result.errormsg, 15);
|
||
}
|
||
},
|
||
scope: this
|
||
});
|
||
}
|
||
});
|
typo3/sysext/em/res/js/ux/menu/RangeMenu.js (revision ) | ||
---|---|---|
/*!
|
||
* Ext JS Library 3.1.1
|
||
* Copyright(c) 2006-2010 Ext JS, LLC
|
||
* licensing@extjs.com
|
||
* http://www.extjs.com/license
|
||
*/
|
||
Ext.ns('Ext.ux.menu');
|
||
/**
|
||
* @class Ext.ux.menu.RangeMenu
|
||
* @extends Ext.menu.Menu
|
||
* Custom implementation of Ext.menu.Menu that has preconfigured
|
||
* items for gt, lt, eq.
|
||
* <p><b><u>Example Usage:</u></b></p>
|
||
* <pre><code>
|
||
* </code></pre>
|
||
*/
|
||
Ext.ux.menu.RangeMenu = Ext.extend(Ext.menu.Menu, {
|
||
constructor : function (config) {
|
||
Ext.ux.menu.RangeMenu.superclass.constructor.call(this, config);
|
||
this.addEvents(
|
||
/**
|
||
* @event update
|
||
* Fires when a filter configuration has changed
|
||
* @param {Ext.ux.grid.filter.Filter} this The filter object.
|
||
*/
|
||
'update'
|
||
);
|
||
|
||
this.updateTask = new Ext.util.DelayedTask(this.fireUpdate, this);
|
||
|
||
var i, len, item, cfg, Cls;
|
||
for (i = 0, len = this.menuItems.length; i < len; i++) {
|
||
item = this.menuItems[i];
|
||
if (item !== '-') {
|
||
// defaults
|
||
cfg = {
|
||
itemId: 'range-' + item,
|
||
enableKeyEvents: true,
|
||
iconCls: this.iconCls[item] || 'no-icon',
|
||
listeners: {
|
||
scope: this,
|
||
keyup: this.onInputKeyUp
|
||
}
|
||
};
|
||
Ext.apply(
|
||
cfg,
|
||
// custom configs
|
||
Ext.applyIf(this.fields[item] || {}, this.fieldCfg[item]),
|
||
// configurable defaults
|
||
this.menuItemCfgs
|
||
);
|
||
Cls = cfg.fieldCls || this.fieldCls;
|
||
item = this.fields[item] = new Cls(cfg);
|
||
}
|
||
this.add(item);
|
||
}
|
||
},
|
||
/**
|
||
* @private
|
||
* called by this.updateTask
|
||
*/
|
||
fireUpdate : function () {
|
||
this.fireEvent('update', this);
|
||
},
|
||
|
||
/**
|
||
* Get and return the value of the filter.
|
||
* @return {String} The value of this filter
|
||
*/
|
||
getValue : function () {
|
||
var result = {}, key, field;
|
||
for (key in this.fields) {
|
||
field = this.fields[key];
|
||
if (field.isValid() && String(field.getValue()).length > 0) {
|
||
result[key] = field.getValue();
|
||
}
|
||
}
|
||
return result;
|
||
},
|
||
|
||
/**
|
||
* Set the value of this menu and fires the 'update' event.
|
||
* @param {Object} data The data to assign to this menu
|
||
*/
|
||
setValue : function (data) {
|
||
var key;
|
||
for (key in this.fields) {
|
||
this.fields[key].setValue(data[key] !== undefined ? data[key] : '');
|
||
}
|
||
this.fireEvent('update', this);
|
||
},
|
||
/**
|
||
* @private
|
||
* Handler method called when there is a keyup event on an input
|
||
* item of this menu.
|
||
*/
|
||
onInputKeyUp : function (field, e) {
|
||
var k = e.getKey();
|
||
if (k == e.RETURN && field.isValid()) {
|
||
e.stopEvent();
|
||
this.hide(true);
|
||
return;
|
||
}
|
||
|
||
if (field == this.fields.eq) {
|
||
if (this.fields.gt) {
|
||
this.fields.gt.setValue(null);
|
||
}
|
||
if (this.fields.lt) {
|
||
this.fields.lt.setValue(null);
|
||
}
|
||
}
|
||
else {
|
||
this.fields.eq.setValue(null);
|
||
}
|
||
|
||
// restart the timer
|
||
this.updateTask.delay(this.updateBuffer);
|
||
}
|
||
});
|
typo3/sysext/em/res/js/ux/css/RangeMenu.css (revision ) | ||
---|---|---|
/*!
|
||
* Ext JS Library 3.1.1
|
||
* Copyright(c) 2006-2010 Ext JS, LLC
|
||
* licensing@extjs.com
|
||
* http://www.extjs.com/license
|
||
*/
|
||
/**
|
||
* RangeMenu Styles
|
||
**/
|
||
.ux-rangemenu-gt {
|
||
background-image: url(../images/greater_than.png) !important;
|
||
}
|
||
.ux-rangemenu-lt {
|
||
background-image: url(../images/less_than.png) !important;
|
||
}
|
||
.ux-rangemenu-eq {
|
||
background-image: url(../images/equals.png) !important;
|
||
}
|
typo3/sysext/em/res/js/ux/filter/ListFilter.js (revision ) | ||
---|---|---|
/*!
|
||
* Ext JS Library 3.1.1
|
||
* Copyright(c) 2006-2010 Ext JS, LLC
|
||
* licensing@extjs.com
|
||
* http://www.extjs.com/license
|
||
*/
|
||
/**
|
||
* @class Ext.ux.grid.filter.ListFilter
|
||
* @extends Ext.ux.grid.filter.Filter
|
||
* <p>List filters are able to be preloaded/backed by an Ext.data.Store to load
|
||
* their options the first time they are shown. ListFilter utilizes the
|
||
* {@link Ext.ux.menu.ListMenu} component.</p>
|
||
* <p>Although not shown here, this class accepts all configuration options
|
||
* for {@link Ext.ux.menu.ListMenu}.</p>
|
||
*
|
||
* <p><b><u>Example Usage:</u></b></p>
|
||
* <pre><code>
|
||
var filters = new Ext.ux.grid.GridFilters({
|
||
...
|
||
filters: [{
|
||
type: 'list',
|
||
dataIndex: 'size',
|
||
phpMode: true,
|
||
// options will be used as data to implicitly creates an ArrayStore
|
||
options: ['extra small', 'small', 'medium', 'large', 'extra large']
|
||
}]
|
||
});
|
||
* </code></pre>
|
||
*
|
||
*/
|
||
Ext.ux.grid.filter.ListFilter = Ext.extend(Ext.ux.grid.filter.Filter, {
|
||
/**
|
||
* @cfg {Array} options
|
||
* <p><code>data</code> to be used to implicitly create a data store
|
||
* to back this list when the data source is <b>local</b>. If the
|
||
* data for the list is remote, use the <code>{@link #store}</code>
|
||
* config instead.</p>
|
||
* <br><p>Each item within the provided array may be in one of the
|
||
* following formats:</p>
|
||
* <div class="mdetail-params"><ul>
|
||
* <li><b>Array</b> :
|
||
* <pre><code>
|
||
options: [
|
||
[11, 'extra small'],
|
||
[18, 'small'],
|
||
[22, 'medium'],
|
||
[35, 'large'],
|
||
[44, 'extra large']
|
||
]
|
||
* </code></pre>
|
||
* </li>
|
||
* <li><b>Object</b> :
|
||
* <pre><code>
|
||
labelField: 'name', // override default of 'text'
|
||
options: [
|
||
{id: 11, name:'extra small'},
|
||
{id: 18, name:'small'},
|
||
{id: 22, name:'medium'},
|
||
{id: 35, name:'large'},
|
||
{id: 44, name:'extra large'}
|
||
]
|
||
* </code></pre>
|
||
* </li>
|
||
* <li><b>String</b> :
|
||
* <pre><code>
|
||
* options: ['extra small', 'small', 'medium', 'large', 'extra large']
|
||
* </code></pre>
|
||
* </li>
|
||
*/
|
||
/**
|
||
* @cfg {Boolean} phpMode
|
||
* <p>Adjust the format of this filter. Defaults to false.</p>
|
||
* <br><p>When GridFilters <code>@cfg encode = false</code> (default):</p>
|
||
* <pre><code>
|
||
// phpMode == false (default):
|
||
filter[0][data][type] list
|
||
filter[0][data][value] value1
|
||
filter[0][data][value] value2
|
||
filter[0][field] prod
|
||
// phpMode == true:
|
||
filter[0][data][type] list
|
||
filter[0][data][value] value1, value2
|
||
filter[0][field] prod
|
||
* </code></pre>
|
||
* When GridFilters <code>@cfg encode = true</code>:
|
||
* <pre><code>
|
||
// phpMode == false (default):
|
||
filter : [{"type":"list","value":["small","medium"],"field":"size"}]
|
||
// phpMode == true:
|
||
filter : [{"type":"list","value":"small,medium","field":"size"}]
|
||
* </code></pre>
|
||
*/
|
||
phpMode : false,
|
||
/**
|
||
* @cfg {Ext.data.Store} store
|
||
* The {@link Ext.data.Store} this list should use as its data source
|
||
* when the data source is <b>remote</b>. If the data for the list
|
||
* is local, use the <code>{@link #options}</code> config instead.
|
||
*/
|
||
/**
|
||
* @private
|
||
* Template method that is to initialize the filter and install required menu items.
|
||
* @param {Object} config
|
||
*/
|
||
init : function (config) {
|
||
this.dt = new Ext.util.DelayedTask(this.fireUpdate, this);
|
||
// if a menu already existed, do clean up first
|
||
if (this.menu){
|
||
this.menu.destroy();
|
||
}
|
||
this.menu = new Ext.ux.menu.ListMenu(config);
|
||
this.menu.on('checkchange', this.onCheckChange, this);
|
||
},
|
||
|
||
/**
|
||
* @private
|
||
* Template method that is to get and return the value of the filter.
|
||
* @return {String} The value of this filter
|
||
*/
|
||
getValue : function () {
|
||
return this.menu.getSelected();
|
||
},
|
||
/**
|
||
* @private
|
||
* Template method that is to set the value of the filter.
|
||
* @param {Object} value The value to set the filter
|
||
*/
|
||
setValue : function (value) {
|
||
this.menu.setSelected(value);
|
||
this.fireEvent('update', this);
|
||
},
|
||
/**
|
||
* @private
|
||
* Template method that is to return <tt>true</tt> if the filter
|
||
* has enough configuration information to be activated.
|
||
* @return {Boolean}
|
||
*/
|
||
isActivatable : function () {
|
||
return this.getValue().length > 0;
|
||
},
|
||
|
||
/**
|
||
* @private
|
||
* Template method that is to get and return serialized filter data for
|
||
* transmission to the server.
|
||
* @return {Object/Array} An object or collection of objects containing
|