diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-01-16 08:55:42 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-01-16 08:55:42 +0100 |
commit | 9aadcb0bd40a8f773dc164f7dadc8c238fff9954 (patch) | |
tree | bd15059a020152b5dc59c265e22a27251efe0de4 /include | |
parent | 746ea5a3691a67ceb176352e8b6fcfe0f2dc99d6 (diff) | |
parent | 03f692f24fe543c740e5443223d8084b9ca0c4de (diff) | |
download | volse-hubzilla-9aadcb0bd40a8f773dc164f7dadc8c238fff9954.tar.gz volse-hubzilla-9aadcb0bd40a8f773dc164f7dadc8c238fff9954.tar.bz2 volse-hubzilla-9aadcb0bd40a8f773dc164f7dadc8c238fff9954.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 15 | ||||
-rw-r--r-- | include/features.php | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 775a91f9a..de32bd57a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -428,6 +428,16 @@ function bb_spoilertag($match) { return '<div onclick="openClose(\'opendiv-' . $rnd . '\'); return false;" class="fakelink">' . $openclose . '</div><blockquote id="opendiv-' . $rnd . '" style="display: none;">' . $text . '</blockquote>'; } +function bb_summary($match) { + $rnd1 = mt_rand(); + $rnd2 = mt_rand(); + $rnd3 = mt_rand(); + $rnd4 = mt_rand(); + + return $match[1] . '<div style="display: block;" id="opendiv-' . $rnd2 . '">' . $match[2] . '</div><div style="display: block;" id="opendiv-' . $rnd3 . '" onclick="openClose(\'opendiv-' . $rnd1 . '\'); openClose(\'opendiv-' . $rnd2 . '\'); openClose(\'opendiv-' . $rnd3 . '\'); openClose(\'opendiv-' . $rnd4 . '\'); return false;" class="fakelink">' . t('View article') . '</div><div style="display: none;" id="opendiv-' . $rnd4 . '" onclick="openClose(\'opendiv-' . $rnd1 . '\'); openClose(\'opendiv-' . $rnd2 . '\'); openClose(\'opendiv-' . $rnd3 . '\'); openClose(\'opendiv-' . $rnd4 . '\'); return false;" class="fakelink">' . t('View summary') . '</div><div id="opendiv-' . $rnd1 . '" style="display: none;">' . $match[3] . '</div>'; +} + + function bb_definitionList($match) { // $match[1] is the markup styles for the "terms" in the definition list. // $match[2] is the content between the [dl]...[/dl] tags @@ -1062,6 +1072,11 @@ function bbcode($Text, $options = []) { $Text = preg_replace_callback("/\[code(.*?)\](.*?)\[\/code\]/ism", 'bb_code_options', $Text); } + + if(strpos($Text,'[/summary]') !== false) { + $Text = preg_replace_callback("/^(.*?)\[summary\](.*?)\[\/summary\](.*?)$/ism", 'bb_summary', $Text); + } + // Check for [spoiler] text $endlessloop = 0; while ((strpos($Text, "[/spoiler]")!== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20)) { diff --git a/include/features.php b/include/features.php index 69eeed3e8..36eb74a9d 100644 --- a/include/features.php +++ b/include/features.php @@ -126,7 +126,7 @@ function get_features($filtered = true) { feature_level('cards',1), ], -/* reserved, work in progress + [ 'articles', t('Articles'), @@ -135,7 +135,7 @@ function get_features($filtered = true) { get_config('feature_lock','articles'), feature_level('articles',1), ], -*/ + [ 'nav_channel_select', t('Navigation Channel Select'), |