diff --git a/trunk/includes/class/class.LSattr_html_rss.php b/trunk/includes/class/class.LSattr_html_rss.php
new file mode 100644
index 00000000..6f505427
--- /dev/null
+++ b/trunk/includes/class/class.LSattr_html_rss.php
@@ -0,0 +1,53 @@
+
+ */
+class LSattr_html_rss extends LSattr_html {
+
+ /**
+ * Ajoute l'attribut au formualaire passer en paramètre
+ *
+ * @param[in] &$form LSform Le formulaire
+ * @param[in] $idForm L'identifiant du formulaire
+ * @param[in] $data Valeur du champs du formulaire
+ *
+ * @retval LSformElement L'element du formulaire ajouté
+ */
+ function addToForm (&$form,$idForm,$data=NULL) {
+ $element=$form -> addElement('rss', $this -> name, $this -> config['label'],$this -> config, $this);
+ if(!$element) {
+ $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name);
+ return;
+ }
+ if ($data) {
+ $element -> setValue($data);
+ }
+ return $element;
+ }
+
+}
+
+?>
diff --git a/trunk/includes/class/class.LSattr_html_url.php b/trunk/includes/class/class.LSattr_html_url.php
new file mode 100644
index 00000000..b7ba0ada
--- /dev/null
+++ b/trunk/includes/class/class.LSattr_html_url.php
@@ -0,0 +1,53 @@
+
+ */
+class LSattr_html_url extends LSattr_html {
+
+ /**
+ * Ajoute l'attribut au formualaire passer en paramètre
+ *
+ * @param[in] &$form LSform Le formulaire
+ * @param[in] $idForm L'identifiant du formulaire
+ * @param[in] $data Valeur du champs du formulaire
+ *
+ * @retval LSformElement L'element du formulaire ajouté
+ */
+ function addToForm (&$form,$idForm,$data=NULL) {
+ $element=$form -> addElement('url', $this -> name, $this -> config['label'],$this -> config, $this);
+ if(!$element) {
+ $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name);
+ return;
+ }
+ if ($data) {
+ $element -> setValue($data);
+ }
+ return $element;
+ }
+
+}
+
+?>
diff --git a/trunk/includes/class/class.LSformElement.php b/trunk/includes/class/class.LSformElement.php
index 8296ee98..f75c2bfb 100644
--- a/trunk/includes/class/class.LSformElement.php
+++ b/trunk/includes/class/class.LSformElement.php
@@ -259,6 +259,15 @@ class LSformElement {
return '';
}
}
+
+ /**
+ * Retourne le titre du champ
+ *
+ * @retval string Titre du champ
+ **/
+ function getTitle() {
+ return $this -> form -> ldapObject -> getDisplayValue().' - '.$this -> getLabel();
+ }
}
?>
diff --git a/trunk/includes/class/class.LSformElement_rss.php b/trunk/includes/class/class.LSformElement_rss.php
new file mode 100644
index 00000000..a1ce75ca
--- /dev/null
+++ b/trunk/includes/class/class.LSformElement_rss.php
@@ -0,0 +1,87 @@
+
+ */
+
+class LSformElement_rss extends LSformElement {
+
+ /**
+ * Retourne les infos d'affichage de l'élément
+ *
+ * Cette méthode retourne les informations d'affichage de l'élement
+ *
+ * @retval array
+ */
+ function getDisplay(){
+ $return = $this -> getLabelInfos();
+ // value
+ if (!$this -> isFreeze()) {
+ $return['html'] = "
\n";
+ $GLOBALS['LSsession'] -> addJSscript('LSformElement_rss.js');
+ }
+ else {
+ $return['html'] = "\n";
+ }
+ return $return;
+ }
+
+ /**
+ * Retourne le code HTML d'un champ vide
+ *
+ * @retval string Code HTML d'un champ vide.
+ */
+ function getEmptyField() {
+ $multiple = $this -> getMultipleData();
+ return "".$multiple;
+ }
+}
+
+?>
diff --git a/trunk/includes/class/class.LSformElement_url.php b/trunk/includes/class/class.LSformElement_url.php
new file mode 100644
index 00000000..b20a4665
--- /dev/null
+++ b/trunk/includes/class/class.LSformElement_url.php
@@ -0,0 +1,88 @@
+
+ */
+
+class LSformElement_url extends LSformElement {
+
+ /**
+ * Retourne les infos d'affichage de l'élément
+ *
+ * Cette méthode retourne les informations d'affichage de l'élement
+ *
+ * @retval array
+ */
+ function getDisplay(){
+ $return = $this -> getLabelInfos();
+ // value
+ if (!$this -> isFreeze()) {
+ $return['html'] = "\n";
+ $GLOBALS['LSsession'] -> addJSscript('LSformElement_url.js');
+ }
+ else {
+ $return['html'] = "\n";
+ }
+ return $return;
+ }
+
+ /**
+ * Retourne le code HTML d'un champ vide
+ *
+ * @retval string Code HTML d'un champ vide.
+ */
+ function getEmptyField() {
+ $multiple = $this -> getMultipleData();
+ return " getTitle()."\"> ".$multiple;
+ }
+
+}
+
+?>
diff --git a/trunk/includes/js/LSdefault.js b/trunk/includes/js/LSdefault.js
index 56686957..b9539808 100644
--- a/trunk/includes/js/LSdefault.js
+++ b/trunk/includes/js/LSdefault.js
@@ -144,7 +144,7 @@ window.addEvent(window.ie ? 'load' : 'domready', function() {
varLSdefault = new LSdefault();
});
-LSdebug_active = 0;
+var LSdebug_active = 0;
function LSdebug() {
if (LSdebug_active != 1) return;
diff --git a/trunk/includes/js/LSform.js b/trunk/includes/js/LSform.js
index 0f9ca468..4678f52a 100644
--- a/trunk/includes/js/LSform.js
+++ b/trunk/includes/js/LSform.js
@@ -1,14 +1,25 @@
var LSform = new Class({
initialize: function(){
- $$('img.LSform-add-field-btn').each(function(el) {
- el.addEvent('click',this.onAddFieldBtnClick.bind(this,el));
+ this._modules=[];
+ this.initializeLSform_AddAndRemoveBtns();
+ },
+
+ initializeLSform_AddAndRemoveBtns: function(el) {
+ if (typeof(el) == 'undefined') {
+ el = document;
+ }
+ el.getElements('img[class=LSform-add-field-btn]').each(function(btn) {
+ btn.addEvent('click',this.onAddFieldBtnClick.bind(this,btn));
}, this);
-
- $$('img.LSform-remove-field-btn').each(function(el) {
- el.addEvent('click',this.onRemoveFieldBtnClick.bind(this,el));
+ el.getElements('img[class=LSform-remove-field-btn]').each(function(btn) {
+ btn.addEvent('click',this.onRemoveFieldBtnClick.bind(this,btn));
}, this);
},
+ addModule: function(name,obj) {
+ this._modules[name]=obj;
+ },
+
onAddFieldBtnClick: function(img){
var getAttrName = /LSform_add_field_btn_(.*)_.*/
var attrName = getAttrName.exec(img.id)[1];
@@ -36,12 +47,15 @@ var LSform = new Class({
var img = $(data.img);
li.set('html',data.html);
li.injectAfter(img.getParent());
- li.getElements('img[class=LSform-add-field-btn]').each(function(el) {
- el.addEvent('click',this.onAddFieldBtnClick.bind(this,el));
- }, this);
- li.getElements('img[class=LSform-remove-field-btn]').each(function(el) {
- el.addEvent('click',this.onRemoveFieldBtnClick.bind(this,el));
- }, this);
+ this.initializeLSform_AddAndRemoveBtns(li);
+ if (typeof(this._modules[data.fieldtype]) != "undefined") {
+ try {
+ this._modules[data.fieldtype].reinitialize(li);
+ }
+ catch(e) {
+ LSdebug('Pas de reinitialise pour ' + data.fieldtype);
+ }
+ }
}
},
diff --git a/trunk/includes/js/LSformElement_rss.js b/trunk/includes/js/LSformElement_rss.js
new file mode 100644
index 00000000..ecab313b
--- /dev/null
+++ b/trunk/includes/js/LSformElement_rss.js
@@ -0,0 +1,34 @@
+var LSformElement_rss = new Class({
+ initialize: function(){
+ this.initialiseLSformElement_rss();
+ if (typeof(varLSform) != "undefined") {
+ varLSform.addModule("LSformElement_rss",this);
+ }
+ },
+
+ initialiseLSformElement_rss: function(el) {
+ if (typeof(el) == 'undefined') {
+ el = document;
+ }
+ el.getElements('img.LSformElement_rss_btn').each(function(btn) {
+ btn.addEvent('click',this.onBtnClick.bind(this,btn));
+ }, this);
+ },
+
+ reinitialize: function(el) {
+ this.initialiseLSformElement_rss(el);
+ },
+
+ onBtnClick: function(btn) {
+ var href = btn.getParent().getFirst().href;
+ if (typeof(href)=="undefined") {
+ href = btn.getParent().getFirst().value;
+ }
+ if (href!="") {
+ window.open(href,'_blank');
+ }
+ }
+});
+window.addEvent(window.ie ? 'load' : 'domready', function() {
+ varLSformElement_rss = new LSformElement_rss();
+});
diff --git a/trunk/includes/js/LSformElement_url.js b/trunk/includes/js/LSformElement_url.js
new file mode 100644
index 00000000..acb2a6ce
--- /dev/null
+++ b/trunk/includes/js/LSformElement_url.js
@@ -0,0 +1,56 @@
+var LSformElement_url = new Class({
+ initialize: function(){
+ this.initialiseLSformElement_url();
+ if (typeof(varLSform) != "undefined") {
+ varLSform.addModule("LSformElement_url",this);
+ }
+ },
+
+ initialiseLSformElement_url: function(el) {
+ if (typeof(el) == 'undefined') {
+ el = document;
+ }
+ el.getElements('img.LSformElement_url_go_btn').each(function(btn) {
+ btn.addEvent('click',this.onGoBtnClick.bind(this,btn));
+ }, this);
+ el.getElements('img.LSformElement_url_add_favorite_btn').each(function(btn) {
+ btn.addEvent('click',this.onAddFavoriteBtnClick.bind(this,btn));
+ }, this);
+ },
+
+ reinitialize: function(el) {
+ this.initialiseLSformElement_url(el);
+ },
+
+ onGoBtnClick: function(btn) {
+ var href = btn.getParent().getFirst().href;
+ if (typeof(href)=="undefined") {
+ href = btn.getParent().getFirst().value;
+ }
+ if (href!="") {
+ window.open(href,'_blank');
+ }
+ },
+
+ onAddFavoriteBtnClick: function(btn) {
+ var href = btn.getParent().getFirst().value;
+ if (typeof(href)=="undefined") {
+ href = btn.getParent().getFirst().href;
+ }
+ var name = btn.getParent().getFirst().title;
+ if (href!="") {
+ if (window.sidebar) {
+ window.sidebar.addPanel(name,href,'');
+ }
+ else if(document.all) {
+ window.external.AddFavorite(href,name);
+ }
+ else {
+ alert('Fonctionnalité pas encore supportée pour votre navigateur.');
+ }
+ }
+ }
+});
+window.addEvent(window.ie ? 'load' : 'domready', function() {
+ varLSformElement_url = new LSformElement_url();
+});
diff --git a/trunk/index_ajax.php b/trunk/index_ajax.php
index 263d3977..899ef8d0 100644
--- a/trunk/index_ajax.php
+++ b/trunk/index_ajax.php
@@ -46,6 +46,7 @@ if (!isset($_ERRORS)) {
$data = array(
'html' => $form -> getEmptyField($_REQUEST['attribute']),
'img' => $_REQUEST['img'],
+ 'fieldtype' => get_class($form -> getElement($_REQUEST['attribute']))
);
}
}
diff --git a/trunk/modify.php b/trunk/modify.php
index 7bf7e94c..1d36856f 100644
--- a/trunk/modify.php
+++ b/trunk/modify.php
@@ -27,9 +27,6 @@ $GLOBALS['LSsession'] = new LSsession();
if($LSsession -> startLSsession()) {
- // Définition du Titre de la page
- $GLOBALS['Smarty'] -> assign('pagetitle',_('Modifier'));
-
if (isset($_POST['LSform_objecttype'])) {
$LSobject = $_POST['LSform_objecttype'];
}
@@ -64,6 +61,8 @@ if($LSsession -> startLSsession()) {
$object = new $LSobject();
if ($object -> loadData($dn)) {
+ // Définition du Titre de la page
+ $GLOBALS['Smarty'] -> assign('pagetitle',_('Modifier').' : '.$object -> getDisplayValue());
$form = $object -> getForm('modify');
if ($form->validate()) {
// MàJ des données de l'objet LDAP
diff --git a/trunk/select.php b/trunk/select.php
index ed24fd3f..b06ac619 100644
--- a/trunk/select.php
+++ b/trunk/select.php
@@ -225,6 +225,9 @@ if($LSsession -> startLSsession()) {
if ($GLOBALS['LSsession'] -> cacheSearch()) {
$_SESSION['LSsession']['LSsearch'][$hash]=$searchData;
}
+ if ($orderby) {
+ $sort=true;
+ }
}
$GLOBALS['Smarty']->assign('LSobject_list_nbresult',$searchData['LSobject_list_nbresult']);
diff --git a/trunk/templates/css/base.css b/trunk/templates/css/base.css
index 860e4a7f..b9acf97e 100644
--- a/trunk/templates/css/base.css
+++ b/trunk/templates/css/base.css
@@ -196,7 +196,6 @@ td.LSobject-list-names {
p.LSobject-list-page {
text-align: center;
margin: 0.5em;
- //width: 100%;
}
a.LSobject-list-page {
diff --git a/trunk/templates/images/rss.png b/trunk/templates/images/rss.png
new file mode 100644
index 00000000..677d87f9
Binary files /dev/null and b/trunk/templates/images/rss.png differ
diff --git a/trunk/templates/images/url_add.png b/trunk/templates/images/url_add.png
new file mode 100644
index 00000000..2e945076
Binary files /dev/null and b/trunk/templates/images/url_add.png differ
diff --git a/trunk/templates/images/url_go.png b/trunk/templates/images/url_go.png
new file mode 100644
index 00000000..5cc2b0dd
Binary files /dev/null and b/trunk/templates/images/url_go.png differ
diff --git a/trunk/view.php b/trunk/view.php
index 874b45cb..44e93ba2 100644
--- a/trunk/view.php
+++ b/trunk/view.php
@@ -326,7 +326,9 @@ if($LSsession -> startLSsession()) {
$searchData['objectList']=$objectList;
$searchData['LSview_actions'] = $LSview_actions;
-
+ if ($orderby) {
+ $sort=true;
+ }
}
if ((!isset($searchData['objectList'][0]['actions']))&&(!empty($searchData['objectList']))) {