diff options
author | friendica <info@friendica.com> | 2014-10-06 17:47:17 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-10-06 17:47:17 -0700 |
commit | 03bbbdaf102eeb80731b062c0c269649c938f23d (patch) | |
tree | f3c8fd8a4335c93928247a8af81fb0d978d07011 /include | |
parent | 6e4f7383f154b906a6880d13d7c233b8ea7a5e6a (diff) | |
download | volse-hubzilla-03bbbdaf102eeb80731b062c0c269649c938f23d.tar.gz volse-hubzilla-03bbbdaf102eeb80731b062c0c269649c938f23d.tar.bz2 volse-hubzilla-03bbbdaf102eeb80731b062c0c269649c938f23d.zip |
shareable design elements
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 12 |
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) { |