| verzia 1.2, 2005/08/13 23:06:20 |
verzia 1.3, 2006/01/16 13:25:26 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/admin/inc/functions.inc.php,v 1.1 2005/06/05 12:13:28 nepto Exp $ */ |
/* $Platon: Metafox/admin/inc/functions.inc.php,v 1.2 2005/08/13 23:06:20 nepto Exp $ */ |
| |
|
| /* MAINTAINANCE: This file is maintained in Metafox project and distributed |
/* MAINTAINANCE: This file is maintained in Metafox project and distributed |
| across the particular projects accordingly. */ |
across the particular projects accordingly. */ |
| |
|
| function ezin_admin_check_list_privileges($priv) |
function ezin_admin_check_list_privileges($priv) /* {{{ */ |
| { |
{ |
| return stristr($priv, 'L') !== false; |
return stristr($priv, 'L') !== false; |
| } |
} /* }}} */ |
| |
|
| function ezin_admin_check_full_list_privileges($priv) |
function ezin_admin_check_full_list_privileges($priv) /* {{{ */ |
| { |
{ |
| return strstr($priv, 'L') !== false; |
return strstr($priv, 'L') !== false; |
| } |
} /* }}} */ |
| |
|
| function ezin_admin_check_restricted_list_privileges($priv) |
function ezin_admin_check_restricted_list_privileges($priv) /* {{{ */ |
| { |
{ |
| return strstr($priv, 'l') !== false; |
return strstr($priv, 'l') !== false; |
| } |
} /* }}} */ |
| |
|
| |
function ezin_admin_word_clean($content) /* {{{ */ |
| |
{ |
| |
global $ezin_sys, $ezin_cfg; |
| |
$content = preg_replace('|<!--\s+[^>]*\s+-->|mi', '', $content); |
| |
$content = preg_replace('|<font[^>]*>|mi', '', $content); |
| |
$content = preg_replace('|</font[^>]*>|mi', '', $content); |
| |
$content = preg_replace('|<span[^>]*>|mi', '', $content); |
| |
$content = preg_replace('|</span[^>]*>|mi', '', $content); |
| |
$content = preg_replace('|<div[^>]*>|mi', '', $content); |
| |
$content = preg_replace('|</div[^>]*>|mi', '', $content); |
| |
$content = preg_replace('|</p[^>]*>|mi', '', $content); |
| |
//$content = preg_replace('|[\x0a]|mi', '~', $content); // TODO: fix this, not working |
| |
$content = preg_replace('|\s*</i><i>\s*|mi', '', $content); |
| |
$content = preg_replace('|\s+|mi', ' ', $content); |
| |
$content = preg_replace('|\s*<p[^>]*>\s*|mi', "\n\r\n\r", $content); |
| |
|
| |
$content = trim($content); |
| |
$tag = sprintf("<!--\n\tMS-Word cleaned by %s/%s\n\tat localtime %s\n-->\n", |
| |
$ezin_sys['software']['name'], $ezin_sys['software']['version'], |
| |
date($ezin_cfg['format_datetime'])); |
| |
return $tag.$content; |
| |
} /* }}} */ |
| |
|
| |
/* Modeline for ViM {{{ |
| |
* vim: set ts=4: |
| |
* vim600: fdm=marker fdl=0 fdc=0: |
| |
* }}} */ |
| |
|
| ?> |
?> |