diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-02-02 19:23:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-02 19:23:26 +0100 |
commit | a381c373b30ed04001ea31ff5c38e077edacaf18 (patch) | |
tree | ece5f4a9cf7e7d3a0ae5088f1f453cb572f02b3d /plugins | |
parent | bc3ce7ec2a652eec1441774958050cf83105560a (diff) | |
parent | 50142efd1b4b826f60b1e5673dba5ccbe26e0108 (diff) | |
download | Shaarli-a381c373b30ed04001ea31ff5c38e077edacaf18.tar.gz Shaarli-a381c373b30ed04001ea31ff5c38e077edacaf18.tar.zst Shaarli-a381c373b30ed04001ea31ff5c38e077edacaf18.zip |
Merge pull request #1074 from kalvn/feature/dailymarkdown
Executes daily hooks before creating columns.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/demo_plugin/demo_plugin.php | 12 | ||||
-rw-r--r-- | plugins/markdown/markdown.php | 23 |
2 files changed, 15 insertions, 20 deletions
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index b80a2b6d..f3a63b6a 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php | |||
@@ -378,17 +378,13 @@ function hook_demo_plugin_render_daily($data) | |||
378 | 378 | ||
379 | 379 | ||
380 | // Manipulate columns data | 380 | // Manipulate columns data |
381 | foreach ($data['cols'] as &$value) { | 381 | foreach ($data['linksToDisplay'] as &$value) { |
382 | foreach ($value as &$value2) { | 382 | $value['formatedDescription'] .= ' ಠ_ಠ'; |
383 | $value2['formatedDescription'] .= ' ಠ_ಠ'; | ||
384 | } | ||
385 | } | 383 | } |
386 | 384 | ||
387 | // Add plugin content at the end of each link | 385 | // Add plugin content at the end of each link |
388 | foreach ($data['cols'] as &$value) { | 386 | foreach ($data['linksToDisplay'] as &$value) { |
389 | foreach ($value as &$value2) { | 387 | $value['link_plugin'][] = 'DEMO'; |
390 | $value2['link_plugin'][] = 'DEMO'; | ||
391 | } | ||
392 | } | 388 | } |
393 | 389 | ||
394 | return $data; | 390 | return $data; |
diff --git a/plugins/markdown/markdown.php b/plugins/markdown/markdown.php index 1531549d..6b4aabf3 100644 --- a/plugins/markdown/markdown.php +++ b/plugins/markdown/markdown.php | |||
@@ -70,19 +70,18 @@ function hook_markdown_render_feed($data, $conf) | |||
70 | */ | 70 | */ |
71 | function hook_markdown_render_daily($data, $conf) | 71 | function hook_markdown_render_daily($data, $conf) |
72 | { | 72 | { |
73 | //var_dump($data);die; | ||
73 | // Manipulate columns data | 74 | // Manipulate columns data |
74 | foreach ($data['cols'] as &$value) { | 75 | foreach ($data['linksToDisplay'] as &$value) { |
75 | foreach ($value as &$value2) { | 76 | if (!empty($value['tags']) && noMarkdownTag($value['tags'])) { |
76 | if (!empty($value2['tags']) && noMarkdownTag($value2['tags'])) { | 77 | $value = stripNoMarkdownTag($value); |
77 | $value2 = stripNoMarkdownTag($value2); | 78 | continue; |
78 | continue; | ||
79 | } | ||
80 | $value2['formatedDescription'] = process_markdown( | ||
81 | $value2['formatedDescription'], | ||
82 | $conf->get('security.markdown_escape', true), | ||
83 | $conf->get('security.allowed_protocols') | ||
84 | ); | ||
85 | } | 79 | } |
80 | $value['formatedDescription'] = process_markdown( | ||
81 | $value['formatedDescription'], | ||
82 | $conf->get('security.markdown_escape', true), | ||
83 | $conf->get('security.allowed_protocols') | ||
84 | ); | ||
86 | } | 85 | } |
87 | 86 | ||
88 | return $data; | 87 | return $data; |
@@ -136,7 +135,7 @@ function hook_markdown_render_includes($data) | |||
136 | || $data['_PAGE_'] == Router::$PAGE_DAILY | 135 | || $data['_PAGE_'] == Router::$PAGE_DAILY |
137 | || $data['_PAGE_'] == Router::$PAGE_EDITLINK | 136 | || $data['_PAGE_'] == Router::$PAGE_EDITLINK |
138 | ) { | 137 | ) { |
139 | 138 | ||
140 | $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/markdown/markdown.css'; | 139 | $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/markdown/markdown.css'; |
141 | } | 140 | } |
142 | 141 | ||