root/releases/0.1.2a/units/display/function_init.php

Revision 2, 1.2 kB (checked in by sven, 3 years ago)

importing elgg-0.1.1a

Line 
1 <?php
2
3     // Display unit intialisation routines
4
5     // Variables used in basic templating
6         global $screen;
7         $screen['mainbody'] = "";
8         $screen['headers'] = "";
9         $screen['title'] = "";
10         $screen['menu'] = "";
11         $screen['sidebar'] = "";
12         $screen['footer'] = "";
13         $screen['messages'] = "";
14         
15     // Initialise RTF edit
16         $data['display:topofpage:headers'][] =  "<script language=\"JavaScript\" type=\"text/javascript\" src=\"/units/display/rtfedit/richtext.js\"></script>";
17     
18     // Function to sanitise RTF edit text
19     function RTESafe($strText) {
20         //returns safe code for preloading in the RTE
21         $tmpString = trim($strText);
22         
23         //convert all types of single quotes
24         $tmpString = str_replace(chr(145), chr(39), $tmpString);
25         $tmpString = str_replace(chr(146), chr(39), $tmpString);
26         $tmpString = str_replace("'", "&#39;", $tmpString);
27         
28         //convert all types of double quotes
29         $tmpString = str_replace(chr(147), chr(34), $tmpString);
30         $tmpString = str_replace(chr(148), chr(34), $tmpString);
31         
32         //replace carriage returns & line feeds
33         $tmpString = str_replace(chr(10), " ", $tmpString);
34         $tmpString = str_replace(chr(13), " ", $tmpString);
35         
36         return $tmpString;
37     }
38
39         
40 ?>
Note: See TracBrowser for help on using the browser.