aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorhabeascodice <habeascodice@federated.social>2014-10-07 16:13:22 -0700
committerhabeascodice <habeascodice@federated.social>2014-10-07 16:13:22 -0700
commitc01a9839577a5fc3a8965713e206616edc586c74 (patch)
treec9aa6cf42c2146bf5cee0a11a37ba6c93ef401d3 /include/bbcode.php
parent6b40c2cd090d1c406b3e1cd7ad135baff21bfd54 (diff)
parentd94f6f7c53fbb01a76a6d3beb14968d02ebb3afa (diff)
downloadvolse-hubzilla-c01a9839577a5fc3a8965713e206616edc586c74.tar.gz
volse-hubzilla-c01a9839577a5fc3a8965713e206616edc586c74.tar.bz2
volse-hubzilla-c01a9839577a5fc3a8965713e206616edc586c74.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 0803ed365..d7a5ac457 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -159,6 +159,14 @@ function bb_parse_app($match) {
}
+function bb_parse_element($match) {
+ $j = json_decode(base64url_decode($match[1]),true);
+ if($j) {
+ $o = EOL . '<a href="' . z_root() . '" foo="baz" onclick="importElement(\'' . $match[1] . '\'); return false;" >' . t('Install design element: ') . $j['pagetitle'] . '</a>' . EOL;
+ }
+ return $o;
+}
+
function bb_qr($match) {
return '<img class="zrl" src="' . z_root() . '/photo/qr?f=&qr=' . urlencode($match[1]) . '" alt="' . t('QR code') . '" title="' . htmlspecialchars($match[1],ENT_QUOTES,'UTF-8') . '" />';
}
@@ -700,6 +708,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = preg_replace_callback("/\[app\](.*?)\[\/app\]/ism",'bb_parse_app', $Text);
}
+ if(strpos($Text,'[/element]') !== false) {
+ $Text = preg_replace_callback("/\[element\](.*?)\[\/element\]/ism",'bb_parse_element', $Text);
+ }
+
// html5 video and audio
if (strpos($Text,'[/video]') !== false) {