Last active
December 12, 2015 03:09
-
-
Save hissy/4705216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('C5_EXECUTE') or die("Access Denied."); | |
class ContentBlockController extends Concrete5_Controller_Block_Content { | |
function translateTo($text) { | |
// keep links valid | |
// $url1 = str_replace('/', '\/', BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME); | |
$url2 = str_replace('/', '\/', BASE_URL . DIR_REL); | |
$url3 = View::url('/download_file', 'view_inline'); | |
$url3 = str_replace('/', '\/', $url3); | |
$url3 = str_replace('-', '\-', $url3); | |
$url4 = View::url('/download_file', 'view'); | |
$url4 = str_replace('/', '\/', $url4); | |
$url4 = str_replace('-', '\-', $url4); | |
$text = preg_replace( | |
array( | |
// '/' . $url1 . '\?cID=([0-9]+)/i', | |
'/' . $url3 . '([0-9]+)\//i', | |
'/' . $url4 . '([0-9]+)\//i', | |
'/' . $url2 . '/i'), | |
array( | |
// '{CCM:CID_\\1}', | |
'{CCM:FID_\\1}', | |
'{CCM:FID_DL_\\1}', | |
'{CCM:BASE_URL}') | |
, $text); | |
return $text; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment