diff --git a/include/class_msgPool.inc b/include/class_msgPool.inc index f3cb895a8f27109a9f53303fcc6c6410b0dab371..cac3a0a44b7d32174bc8f4ec90d3e91f2de1c755 100644 --- a/include/class_msgPool.inc +++ b/include/class_msgPool.inc @@ -398,22 +398,13 @@ class msgPool { * * \param string $name The entry duplicated */ - public static function duplicated($name, $dn = NULL, $ldapName = '', $description = '') + public static function duplicated($name, $dn = NULL) { - if (empty($name)) { - $fieldName = sprintf('<em>%s</em>', $ldapName); - } else { - $fieldName = sprintf(_('"%s"'), $name); - } if ($dn == NULL) { - $msg = sprintf(_('There is already an entry with this %s attribute in the system!'), $fieldName); + return sprintf(_("There is already an entry with this '%s' attribute in the system!"), $name); } else { - $msg = sprintf(_('The entry "%s" already use this %s attribute!'), $dn, $fieldName); - } - if (!empty($description)) { - $msg .= sprintf('<p class="description">%s</p>', $description); + return sprintf(_("The entry '%s' already use this '%s' attribute!"), $dn, $name); } - return $msg; } /*! @@ -421,18 +412,9 @@ class msgPool { * * \param string $name Name of the field */ - public static function required($name, $ldapName = '', $description = '') + public static function required($name) { - if (empty($name)) { - $fieldName = sprintf('<em>%s</em>', $ldapName); - } else { - $fieldName = sprintf(_('"%s"'), $name); - } - $msg = sprintf(_('The required field %s is empty!'), $fieldName); - if (!empty($description)) { - $msg .= sprintf('<p class="description">%s</p>', $description); - } - return $msg; + return sprintf(_("The required field '%s' is empty!"), $name); } /*! diff --git a/include/simpleplugin/attributes/class_SetAttribute.inc b/include/simpleplugin/attributes/class_SetAttribute.inc index e147531ef1247e147b15241ac3b3e8e6af6b933b..c04c7c93a7f61da25e20feb92ddb51ad22c72ad1 100644 --- a/include/simpleplugin/attributes/class_SetAttribute.inc +++ b/include/simpleplugin/attributes/class_SetAttribute.inc @@ -582,13 +582,7 @@ class OrderedArrayAttribute extends SetAttribute $this->attribute->loadPostValue(); $this->attribute->applyPostValue(); if ($error = $this->attribute->check()) { - $label = $this->getLabel(); - if (empty($label)) { - $label = '<em>'.$this->getLdapName().'</em>'; - } else { - $label = sprintf(_('"%s"'), $label); - } - msg_dialog::display(sprintf(_('Invalid value for %s'), $label), $error); + msg_dialog::display(sprintf(_('Invalid value for %s'), $this->getLabel()), $error); } else { $this->addPostValue($this->attribute->getValue()); } diff --git a/include/simpleplugin/class_Attribute.inc b/include/simpleplugin/class_Attribute.inc index e880555e50706f53c3c6995546ed37e4703bec5f..19b0672440b9280ed002392895495797a00e4eab 100644 --- a/include/simpleplugin/class_Attribute.inc +++ b/include/simpleplugin/class_Attribute.inc @@ -436,7 +436,7 @@ class Attribute global $config; $value = $this->getValue(); if ($this->isRequired() && !$this->disabled && (($value === "") || ($value === array()))) { - return msgPool::required($this->getLabel(), $this->getLdapName(), $this->getDescription()); + return msgPool::required($this->getLabel()); } elseif (($this->unique !== FALSE) && !$this->disabled) { $value = $this->computeLdapValue(); if (($value === "") || ($value === array())) { @@ -532,7 +532,7 @@ class Attribute continue; } - return msgPool::duplicated($this->getLabel(), $attrs['dn'], $this->getLdapName(), $this->getDescription()); + return msgPool::duplicated($this->getLabel(), $attrs['dn']); } } }