shareable design elements

This commit is contained in:
friendica
2014-10-06 17:47:17 -07:00
parent 6e4f7383f1
commit 03bbbdaf10
7 changed files with 89 additions and 12 deletions

View File

@@ -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) {