BUG 000 Change in the hook for the auth. sources plugins
This commit is contained in:
@@ -468,9 +468,9 @@ class headPublisher {
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$pluginJavascripts = $oPluginRegistry->getRegisteredJavascriptBy($filename);
|
||||
if (count($pluginJavascripts) > 0) {
|
||||
$jsPluginCacheName = '';
|
||||
if ($debug) {
|
||||
foreach ($pluginJavascripts as $pluginJsFile) {
|
||||
$jsPluginCacheName = '';
|
||||
if (substr($pluginJsFile, -3) != '.js') {
|
||||
$pluginJsFile .= '.js';
|
||||
}
|
||||
@@ -480,10 +480,14 @@ class headPublisher {
|
||||
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $jsPluginCacheName.".js";
|
||||
file_put_contents ( $cacheFilename, file_get_contents ( PATH_PLUGINS . $pluginJsFile ) );
|
||||
}
|
||||
if ($jsPluginCacheName != '') {
|
||||
$this->extJsScript [] = '/extjs/' . $jsPluginCacheName;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($pluginJavascripts as $pluginJsFile) {
|
||||
$jsPluginCacheName = '';
|
||||
if (substr($pluginJsFile, -3) !== '.js') {
|
||||
$pluginJsFile .= '.js';
|
||||
}
|
||||
@@ -498,11 +502,11 @@ class headPublisher {
|
||||
file_put_contents ( $cacheFilename, $content );
|
||||
}
|
||||
}
|
||||
if ($jsPluginCacheName != '') {
|
||||
$this->extJsScript [] = '/extjs/' . $jsPluginCacheName;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($jsPluginCacheName != '') {
|
||||
$this->extJsScript [] = '/extjs/' . $jsPluginCacheName;
|
||||
}
|
||||
}
|
||||
//end hook for registered javascripts from plugins
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ var comboStatusStore;
|
||||
var editForm;
|
||||
var contextMenu;
|
||||
var w;
|
||||
var actionButtons;
|
||||
|
||||
Ext.onReady(function(){
|
||||
Ext.QuickTips.init();
|
||||
@@ -126,19 +127,38 @@ Ext.onReady(function(){
|
||||
handler: GridByDefault
|
||||
});
|
||||
|
||||
actionButtons = _addPluginActions([newButton, '-', editButton, deleteButton, '-', usersButton, {xtype: 'tbfill'}, searchText, clearTextButton, searchButton]);
|
||||
|
||||
smodel = new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true,
|
||||
listeners:{
|
||||
rowselect: function(sm){
|
||||
rowselect: function(sm, index, record){
|
||||
editButton.enable();
|
||||
deleteButton.enable();
|
||||
usersButton.enable();
|
||||
if (typeof(_rowselect) !== 'undefined') {
|
||||
if (Ext.isArray(_rowselect)) {
|
||||
for (var i = 0; i < _rowselect.length; i++) {
|
||||
if (Ext.isFunction(_rowselect[i])) {
|
||||
_rowselect[i](sm, index, record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
rowdeselect: function(sm){
|
||||
rowdeselect: function(sm, index, record){
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
usersButton.disable();
|
||||
if (typeof(_rowdeselect) !== 'undefined') {
|
||||
if (Ext.isArray(_rowdeselect)) {
|
||||
for (var i = 0; i < _rowdeselect.length; i++) {
|
||||
if (Ext.isFunction(_rowdeselect[i])) {
|
||||
_rowdeselect[i](sm, index, record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -239,7 +259,7 @@ Ext.onReady(function(){
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar: [newButton, '-', editButton, deleteButton,'-',usersButton, {xtype: 'tbfill'}, searchText,clearTextButton,searchButton],
|
||||
tbar: actionButtons,
|
||||
bbar: bbarpaging,
|
||||
listeners: {
|
||||
rowdblclick: EditAuthSource,
|
||||
@@ -386,3 +406,48 @@ ImportUsers = function(){
|
||||
location.href = 'authSources_SearchUsers?sUID=' +rowSelected.data.AUTH_SOURCE_UID;
|
||||
}
|
||||
};
|
||||
|
||||
// Mover a un archivo m<>s gen<65>rico - Start
|
||||
var _pluginActionButtons = [];
|
||||
var _rowselect = [];
|
||||
var _rowdeselect = [];
|
||||
|
||||
var _addPluginActions = function(defaultActionButtons) {
|
||||
try {
|
||||
if (Ext.isArray(_pluginActionButtons)) {
|
||||
if (_pluginActionButtons.length > 0) {
|
||||
var positionToInsert = _tbfillPosition(defaultActionButtons);
|
||||
var leftActionButtons = defaultActionButtons.slice(0, positionToInsert);
|
||||
var rightActionButtons = defaultActionButtons.slice(positionToInsert, defaultActionButtons.length - 1);
|
||||
return leftActionButtons.concat(_pluginActionButtons.concat(rightActionButtons));
|
||||
}
|
||||
else {
|
||||
return defaultActionButtons;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return defaultActionButtons;
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
return defaultActionButtons;
|
||||
}
|
||||
};
|
||||
|
||||
var _tbfillPosition = function(actionButtons) {
|
||||
try {
|
||||
for (var i = 0; i < actionButtons.length; i++) {
|
||||
if (Ext.isObject(actionButtons[i])) {
|
||||
if (actionButtons[i].xtype == 'tbfill') {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
catch (error) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
// Mover a un archivo m<>s gen<65>rico - End
|
||||
Reference in New Issue
Block a user