| Línea 54... | 
            Línea 54... | 
          
          
            | 54 | 
                 */
  | 
            54 | 
                 */
  | 
          
          
            | 55 | 
                public static function encode_content_links($content) {
  | 
            55 | 
                public static function encode_content_links($content) {
  | 
          
          
            | 56 | 
                    global $CFG;
  | 
            56 | 
                    global $CFG;
  | 
          
          
            | Línea 57... | 
            Línea 57... | 
          
          
            | 57 | 
             
  | 
            57 | 
             
  | 
          
          
            | - | 
               | 
            58 | 
                    $base = preg_quote($CFG->wwwroot,"/");
  | 
          
          
            | Línea 58... | 
            Línea 59... | 
          
          
            | 58 | 
                    $base = preg_quote($CFG->wwwroot,"/");
  | 
            59 | 
                    $baseunquoted = $CFG->wwwroot;
  | 
          
          
            | 59 | 
             
  | 
            60 | 
             
  | 
          
          
            | 60 | 
                    // Link to the list of datas
  | 
            61 | 
                    // Link to the list of datas.
  | 
          
          
            | - | 
               | 
            62 | 
                    $search = '/(' . $base . '\/mod\/data\/index.php\?id\=)([0-9]+)/';
  | 
          
          
            | - | 
               | 
            63 | 
                    $content = preg_replace($search, '$@DATAINDEX*$2@$', $content);
  | 
          
          
            | - | 
               | 
            64 | 
             
  | 
          
          
            | - | 
               | 
            65 | 
                    // Link to the list of datas, urlencoded.
  | 
          
          
            | 61 | 
                    $search="/(".$base."\/mod\/data\/index.php\?id\=)([0-9]+)/";
  | 
            66 | 
                    $search = '/(' . urlencode($baseunquoted . '/mod/data/index.php?id=') . ')([0-9]+)/';
  | 
          
          
            | 62 | 
                    $content= preg_replace($search, '$@DATAINDEX*$2@$', $content);
  | 
            67 | 
                    $content = preg_replace($search, '$@DATAINDEXURLENCODED*$2@$', $content);
  | 
          
          
            | 63 | 
             
  | 
            68 | 
             
  | 
          
          
            | 64 | 
                    // Link to data view by moduleid
  | 
            69 | 
                    // Link to data view by moduleid.
  | 
          
          
            | - | 
               | 
            70 | 
                    $search = '/(' . $base . '\/mod\/data\/view.php\?id\=)([0-9]+)/';
  | 
          
          
            | - | 
               | 
            71 | 
                    $content = preg_replace($search, '$@DATAVIEWBYID*$2@$', $content);
  | 
          
          
            | - | 
               | 
            72 | 
             
  | 
          
          
            | - | 
               | 
            73 | 
                    // Link to data view by moduleid, urlencoded.
  | 
          
          
            | - | 
               | 
            74 | 
                    $search = '/(' . urlencode($baseunquoted . '/mod/data/view.php?id=') . ')([0-9]+)/';
  | 
          
          
            | - | 
               | 
            75 | 
                    $content = preg_replace($search, '$@DATAVIEWBYIDURLENCODED*$2@$', $content);
  | 
          
          
            | - | 
               | 
            76 | 
             
  | 
          
          
            | - | 
               | 
            77 | 
                    // Link to one "record" of the database.
  | 
          
          
            | - | 
               | 
            78 | 
                    $search = '/(' . $base . '\/mod\/data\/view.php\?d\=)([0-9]+)\&(amp;)rid\=([0-9]+)/';
  | 
          
          
            | - | 
               | 
            79 | 
                    $content = preg_replace($search, '$@DATAVIEWRECORD*$2*$4@$', $content);
  | 
          
          
            | - | 
               | 
            80 | 
             
  | 
          
          
            | - | 
               | 
            81 | 
                    // Link to one "record" of the database, urlencoded.
  | 
          
          
            | 65 | 
                    $search="/(".$base."\/mod\/data\/view.php\?id\=)([0-9]+)/";
  | 
            82 | 
                    $search = '/(' . urlencode($baseunquoted . '/mod/data/view.php?d=') . ')([0-9]+)%26rid%3D([0-9]+)/';
  | 
          
          
            | 66 | 
                    $content= preg_replace($search, '$@DATAVIEWBYID*$2@$', $content);
  | 
            83 | 
                    $content = preg_replace($search, '$@DATAVIEWRECORDURLENCODED*$2*$3@$', $content);
  | 
          
          
            | 67 | 
             
  | 
            84 | 
             
  | 
          
          
            | 68 | 
                    /// Link to database view by databaseid
  | 
            85 | 
                    // Link to database view by databaseid.
  | 
          
          
            | - | 
               | 
            86 | 
                    $search = '/(' . $base . '\/mod\/data\/view.php\?d\=)([0-9]+)/';
  | 
          
          
            | - | 
               | 
            87 | 
                    $content = preg_replace($search, '$@DATAVIEWBYD*$2@$', $content);
  | 
          
          
            | - | 
               | 
            88 | 
             
  | 
          
          
            | - | 
               | 
            89 | 
                    // Link to database view by databaseid, urlencoded.
  | 
          
          
            | - | 
               | 
            90 | 
                    $search = '/(' . urlencode($baseunquoted . '/mod/data/view.php?d=') . ')([0-9]+)/';
  | 
          
          
            | - | 
               | 
            91 | 
                    $content = preg_replace($search, '$@DATAVIEWBYDURLENCODED*$2@$', $content);
  | 
          
          
            | - | 
               | 
            92 | 
             
  | 
          
          
            | - | 
               | 
            93 | 
                    // Link to the edit page.
  | 
          
          
            | - | 
               | 
            94 | 
                    $search = '/(' . $base . '\/mod\/data\/edit.php\?id\=)([0-9]+)/';
  | 
          
          
            | - | 
               | 
            95 | 
                    $content = preg_replace($search, '$@DATAEDITBYID*$2@$', $content);
  | 
          
          
            | - | 
               | 
            96 | 
             
  | 
          
          
            | - | 
               | 
            97 | 
                    // Link to the edit page, urlencoded.
  | 
          
          
            | 69 | 
                    $search="/(".$base."\/mod\/data\/view.php\?d\=)([0-9]+)/";
  | 
            98 | 
                    $search = '/(' . urlencode($baseunquoted . '/mod/data/edit.php?id=') . ')([0-9]+)/';
  | 
          
          
            | 70 | 
                    $content= preg_replace($search,'$@DATAVIEWBYD*$2@$', $content);
  | 
            99 | 
                    $content = preg_replace($search, '$@DATAEDITBYIDURLENCODED*$2@$', $content);
  | 
          
          
            | 71 | 
             
  | 
            100 | 
             
  | 
          
          
            | 72 | 
                    /// Link to one "record" of the database
  | 
            101 | 
                    // Link to the edit page by databaseid.
  | 
          
          
            | - | 
               | 
            102 | 
                    $search = '/(' . $base . '\/mod\/data\/edit.php\?d\=)([0-9]+)/';
  | 
          
          
            | - | 
               | 
            103 | 
                    $content = preg_replace($search, '$@DATAEDITBYD*$2@$', $content);
  | 
          
          
            | - | 
               | 
            104 | 
             
  | 
          
          
            | - | 
               | 
            105 | 
                    // Link to the edit page by databaseid, urlencoded.
  | 
          
          
            | Línea 73... | 
            Línea 106... | 
          
          
            | 73 | 
                    $search="/(".$base."\/mod\/data\/view.php\?d\=)([0-9]+)\&(amp;)rid\=([0-9]+)/";
  | 
            106 | 
                    $search = '/(' . urlencode($baseunquoted . '/mod/data/edit.php?d=') . ')([0-9]+)/';
  | 
          
          
            | 74 | 
                    $content= preg_replace($search,'$@DATAVIEWRECORD*$2*$4@$', $content);
  | 
            107 | 
                    $content = preg_replace($search, '$@DATAEDITBYDURLENCODED*$2@$', $content);
  | 
          
          
            | 75 | 
             
  | 
            108 | 
             
  |