new password mail via notification()

new include/text.php::deindent() function
remove unused templates
This commit is contained in:
fabrixxm 2014-09-07 11:20:06 +02:00
parent d85bdd8fb0
commit 9a0c37eb47
30 changed files with 64 additions and 566 deletions

View file

@ -2229,3 +2229,22 @@ function is_a_date_arg($s) {
}
return false;
}
/**
* remove intentation from a text
*/
function deindent($text, $chr="[\t ]", $count=NULL) {
$text = fix_mce_lf($text);
$lines = explode("\n", $text);
if (is_null($count)) {
$m = array();
$k=0; while($k<count($lines) && strlen($lines[$k])==0) $k++;
preg_match("|^".$chr."*|", $lines[$k], $m);
$count = strlen($m[0]);
}
for ($k=0; $k<count($lines); $k++){
$lines[$k] = preg_replace("|^".$chr."{".$count."}|", "", $lines[$k]);
}
return implode("\n", $lines);
}