|
|
|
|
@ -6,7 +6,9 @@ use ChamiloSession as Session; |
|
|
|
|
/** |
|
|
|
|
* This is a code library for Chamilo. |
|
|
|
|
* It is included by default in every Chamilo file (through including the global.inc.php) |
|
|
|
|
* |
|
|
|
|
* This library is in process of being transferred to src/Chamilo/CoreBundle/Component/Utils/ChamiloApi. |
|
|
|
|
* Whenever a function is transferred to the ChamiloApi class, the places where it is used should include |
|
|
|
|
* the "use Chamilo\CoreBundle\Component\Utils\ChamiloApi;" statement. |
|
|
|
|
* @package chamilo.library |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
@ -8038,19 +8040,3 @@ function api_protect_limit_for_session_admin() |
|
|
|
|
function api_is_student_view_active() { |
|
|
|
|
return (isset($_SESSION['studentview']) && $_SESSION['studentview'] == "studentview"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Like strip_tags(), but leaves an additional space and removes only the given tags |
|
|
|
|
* @param string $string |
|
|
|
|
* @param array $tags Tags to be removed |
|
|
|
|
* @return string The original string without the given tags |
|
|
|
|
*/ |
|
|
|
|
function stripGivenTags($string, $tags) { |
|
|
|
|
foreach ($tags as $tag) { |
|
|
|
|
$string2 = preg_replace('#</' . $tag . '[^>]*>#i', ' ', $string); |
|
|
|
|
if ($string2 != $string) { |
|
|
|
|
$string = preg_replace('/<' . $tag . '[^>]*>/i', ' ', $string2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $string; |
|
|
|
|
} |