/** * Will be called before an instance of this block is backed up, so that any links in * any links in any HTML fields on config can be encoded. * @return string */ function get_backup_encoded_config() { /// Prevent clone for non configured block instance. Delegate to parent as fallback. if (empty($this->config)) { return parent::get_backup_encoded_config(); } $data = clone $this->config; $data->text = backup_encode_absolute_links($data->text); return base64_encode(serialize($data)); }
function full_tag($tag, $level = 0, $endline = true, $content, $attributes = null) { global $CFG; //Here we encode absolute links $content = backup_encode_absolute_links($content); $st = start_tag($tag, $level, $endline, $attributes); $co = xml_tag_safe_content($content); $et = end_tag($tag, 0, true); return $st . $co . $et; }
function full_tag($tag, $level = 0, $endline = true, $content, $attributes = null) { global $CFG; //Here we encode absolute links // MDL-10770 if (is_null($content)) { $content = '$@NULL@$'; } else { $content = backup_encode_absolute_links($content); } $st = start_tag($tag, $level, $endline, $attributes); $co = xml_tag_safe_content($content); $et = end_tag($tag, 0, true); return $st . $co . $et; }
function backup_encode_absolute_links_in_config(&$config) { $config->text = backup_encode_absolute_links($config->text); }