Index: inc/core/class.dc.core.php
===================================================================
--- inc/core/class.dc.core.php (révision 2566)
+++ inc/core/class.dc.core.php (copie de travail)
@@ -243,11 +243,18 @@
@param behavior string Behavior name
@param func callback Function to call
+ @param prepend boolean if true, insert behavior at first position
*/
- public function addBehavior($behavior,$func)
+ public function addBehavior($behavior,$func,$prepend=false)
{
if (is_callable($func)) {
- $this->behaviors[$behavior][] = $func;
+ if (!$prepend) {
+ $this->behaviors[$behavior][] = $func;
+ } else {
+ if (!isset($this->behaviors[$behavior]))
+ $this->behaviors[$behavior]=array();
+ array_unshift($this->behaviors[$behavior],$func);
+ }
}
}
@@ -1457,4 +1464,4 @@
}
//@}
}
-?>
\ No newline at end of file
+?>