Commit 968ce373 authored by BETTENFELD Vincent's avatar BETTENFELD Vincent
Browse files

comments on filter.php

parent d12cbbf6
......@@ -124,6 +124,8 @@ public function filter_iena_add_delimiters($pieces)
* @param $text
* @param array $options
* @return string
*
* Transform code for links into code for pop-up buttons
*/
function filter($text, array $options = array())
{
......@@ -131,7 +133,7 @@ function filter($text, array $options = array())
global $CFG;
global $PAGE;
// Récupérer le style pour appliquer le même
// Apply context style to buttons
if ($CFG->color_btn) {
$this->color_btn = $CFG->color_btn;
}
......@@ -151,17 +153,22 @@ function filter($text, array $options = array())
}
}
/* Looks for link(s) in the argument text and place them in the array named
matches */
preg_match_all('/<a href="(.*?)">(.*?)<\/a>/s', $text, $matches);
// ? remove tags opening links in new tab from $text ?
for ($i = 0; $i < count($matches[0]); $i++) {
if (strcmp($matches[1][$i], $matches[2][$i]) == 0) {
$text = str_replace($matches[0][$i], $matches[1][$i], $text);
}
}
// ? add start and end tags around links in $text ?
$pieces = explode($CFG->wwwroot . '/mod', $text);
$pieces = $this->filter_iena_add_delimiters($pieces);
//
for ($i = 0; $i < count($pieces); $i++) {
$pieces[$i] = ' ' . $pieces[$i];
$ini = strpos($pieces[$i], $this->start);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment