--- /dev/null
+<?php
+/*******************************************************************************
+ * Copyright (C) 2007 Easter-eggs
+ * http://ldapsaisie.labs.libre-entreprise.org
+ *
+ * Author: See AUTHORS file in top-level directory.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+******************************************************************************/
+
+class LSconfirmBox {
+
+ /*
+ * Méthode chargeant les dépendances d'affichage
+ *
+ * @retval void
+ */
+ public static function loadDependenciesDisplay() {
+ LSsession :: addJSscript('LSconfirmBox.js');
+ LSsession :: addCssFile('LSconfirmBox.css');
+
+ LSsession :: addJSconfigParam('LSconfirmBox_labels', array(
+ 'title' => _('Confirmation'),
+ 'text' => _('You confirm your choice ?'),
+ 'validate' => _('Validate'),
+ 'cancel' => _('Cancel')
+ ));
+ }
+
+}
+
+?>
var LSconfirmBox = new Class({
initialize: function(options) {
this._options = options;
+ this.labels = varLSdefault.LSjsConfig['LSconfirmBox_labels'];
+ if (!$type(this.labels)) {
+ this.labels = {
+ title: 'Confirmation',
+ text: 'You confirm your choice ?',
+ validate: 'Validate',
+ cancel: 'Cancel'
+ };
+ }
this.create();
this.display();
},
this.title.set('html',this._options.title);
}
else {
- this.title.set('html','Confirmation');
+ this.title.set('html',this.labels.title);
};
this.title.injectInside(this.box)
this.text.set('html',this._options.text);
}
else {
- this.text.set('html','You confirm your choice ?');
+ this.text.set('html',this.labels.text);
}
this.text.injectInside(this.box);
this.confirmBtn.set('html',this._options.validate_label);
}
else {
- this.confirmBtn.set('html','Validate');
+ this.confirmBtn.set('html',this.labels.validate);
}
this.confirmBtn.injectInside(this.btnsBox);
this.confirmBtn.addEvent('click',this.confirm.bind(this));
this.cancelBtn.set('html',this._options.cancel_label);
}
else {
- this.cancelBtn.set('html','Cancel');
+ this.cancelBtn.set('html',this.labels.cancel);
}
this.cancelBtn.injectInside(this.btnsBox);
this.cancelBtn.addEvent('click',this.cancel.bind(this));
},
getStartStyles: function() {
- if (typeof(this._options.startElement) != 'undefined') {
+ if ($type(this._options.startElement)) {
var startStyles = {
top: this._options.startElement.getCoordinates().top,
left: this._options.startElement.getCoordinates().left,
- width: this._options.startElement.getStyle('width').toInt(),
+ width: this._options.startElement.getWidth().toInt(),
opacity: 0
};
}