aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-02-27 14:55:34 -0800
committerzotlabs <mike@macgirvin.com>2017-02-27 14:55:34 -0800
commit1acfe53f742d2cdf6029e00bb16792ec962fa303 (patch)
treec52b9245e6e39fe56edc39ce88f04882fdf8c947
parent265eb2b440c5c079cca15ddb2e86f7acf48b5792 (diff)
parent69e145a630cdb5a11252b9043b8c8486fae7e54d (diff)
downloadvolse-hubzilla-1acfe53f742d2cdf6029e00bb16792ec962fa303.tar.gz
volse-hubzilla-1acfe53f742d2cdf6029e00bb16792ec962fa303.tar.bz2
volse-hubzilla-1acfe53f742d2cdf6029e00bb16792ec962fa303.zip
Merge branch '2.2RC' of https://github.com/redmatrix/hubzilla into 2.2RC_merge
-rw-r--r--CHANGELOG1
-rw-r--r--Zotlabs/Module/Admin/Site.php10
-rw-r--r--Zotlabs/Module/Admin/Themes.php2
-rw-r--r--Zotlabs/Module/Settings/Display.php13
-rw-r--r--Zotlabs/Module/Wiki.php8
-rw-r--r--Zotlabs/Render/Theme.php8
-rwxr-xr-xinclude/plugin.php2
-rw-r--r--view/theme/redbasic/php/theme.php4
-rw-r--r--view/tpl/hdr.tpl2
-rw-r--r--view/tpl/wiki.tpl2
10 files changed, 38 insertions, 14 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5b29b875d..487dd4331 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,5 @@
Hubzilla 2.2 (2017-??-??)
+ - Provide version compatibility check for themes (minversion, maxversion)
- Use chanlink_hash() instead of chanlink_url() where appropriate
- Use head_add_link() for feed discovery
- Provide HTTP header parser which honours continuation lines
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index 829ca71e4..b71e63030 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -163,6 +163,14 @@ class Site {
foreach($files as $file) {
$vars = '';
$f = basename($file);
+
+ $info = get_theme_info($f);
+ $compatible = check_plugin_versions($info);
+ if(!$compatible) {
+ $theme_choices[$f] = $theme_choices_mobile[$f] = sprintf(t('%s - (Incompatible)'), $f);
+ continue;
+ }
+
if (file_exists($file . '/library'))
continue;
if (file_exists($file . '/mobile'))
@@ -310,4 +318,4 @@ class Site {
));
}
-} \ No newline at end of file
+}
diff --git a/Zotlabs/Module/Admin/Themes.php b/Zotlabs/Module/Admin/Themes.php
index 63a9a1670..fc908ec8b 100644
--- a/Zotlabs/Module/Admin/Themes.php
+++ b/Zotlabs/Module/Admin/Themes.php
@@ -230,4 +230,4 @@ class Themes {
-} \ No newline at end of file
+}
diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php
index 67cecf1f5..ee404daba 100644
--- a/Zotlabs/Module/Settings/Display.php
+++ b/Zotlabs/Module/Settings/Display.php
@@ -130,12 +130,20 @@ class Display {
if($allowed_themes) {
foreach($allowed_themes as $th) {
$f = $th;
+
+ $info = get_theme_info($th);
+ $compatible = check_plugin_versions($info);
+ if(!$compatible) {
+ $mobile_themes[$f] = $themes[$f] = sprintf(t('%s - (Incompatible)'), $f);
+ continue;
+ }
+
$is_experimental = file_exists('view/theme/' . $th . '/experimental');
$unsupported = file_exists('view/theme/' . $th . '/unsupported');
$is_mobile = file_exists('view/theme/' . $th . '/mobile');
$is_library = file_exists('view/theme/'. $th . '/library');
- $mobile_themes["---"] = t("No special theme for mobile devices");
-
+ $mobile_themes['---'] = t("No special theme for mobile devices");
+
if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){
$theme_name = (($is_experimental) ? sprintf(t('%s - (Experimental)'), $f) : $f);
if (! $is_library) {
@@ -147,7 +155,6 @@ class Display {
}
}
}
-
}
}
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 32b484eea..15806ffc3 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -234,10 +234,8 @@ class Wiki extends \Zotlabs\Web\Controller {
$mimeType = $p['mimeType'];
- $rawContent = (($p['mimeType'] == 'text/bbcode')
- ? htmlspecialchars_decode(json_decode($p['content']),ENT_COMPAT)
- : htmlspecialchars_decode($p['content'],ENT_COMPAT)
- );
+ $rawContent = htmlspecialchars_decode(json_decode($p['content']),ENT_COMPAT);
+
$content = ($p['content'] !== '' ? $rawContent : '"# New page\n"');
// Render the Markdown-formatted page content in HTML
if($mimeType == 'text/bbcode') {
@@ -245,7 +243,7 @@ class Wiki extends \Zotlabs\Web\Controller {
}
else {
require_once('library/markdown.php');
- $html = Zlib\NativeWikiPage::generate_toc(zidify_text(purify_html(Markdown(Zlib\NativeWikiPage::bbcode(json_decode($content))))));
+ $html = Zlib\NativeWikiPage::generate_toc(zidify_text(purify_html(Markdown(Zlib\NativeWikiPage::bbcode($content)))));
$renderedContent = Zlib\NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName);
}
$showPageControls = $wiki_editor;
diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php
index dadb18051..3a0116abe 100644
--- a/Zotlabs/Render/Theme.php
+++ b/Zotlabs/Render/Theme.php
@@ -70,9 +70,15 @@ class Theme {
$chosen_theme = $_GET['theme_preview'];
// Allow theme selection of the form 'theme_name:schema_name'
-
$themepair = explode(':', $chosen_theme);
+ // Check if $chosen_theme is compatible with core. If not fall back to default
+ $info = get_theme_info($themepair[0]);
+ $compatible = check_plugin_versions($info);
+ if(!$compatible) {
+ $chosen_theme = '';
+ }
+
if($chosen_theme && (file_exists('view/theme/' . $themepair[0] . '/css/style.css') || file_exists('view/theme/' . $themepair[0] . '/php/style.php'))) {
return($themepair);
}
diff --git a/include/plugin.php b/include/plugin.php
index 045efb805..29474735e 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -471,6 +471,8 @@ function get_theme_info($theme){
'description' => '',
'author' => array(),
'version' => '',
+ 'minversion' => '',
+ 'maxversion' => '',
'compat' => '',
'credits' => '',
'maintainer' => array(),
diff --git a/view/theme/redbasic/php/theme.php b/view/theme/redbasic/php/theme.php
index 997b59750..95d5a2001 100644
--- a/view/theme/redbasic/php/theme.php
+++ b/view/theme/redbasic/php/theme.php
@@ -3,7 +3,9 @@
/**
* * Name: Redbasic
* * Description: Hubzilla standard theme
- * * Version: 1.0
+ * * Version: 2.0
+ * * MinVersion: 2.2RC
+ * * MaxVersion: 3.0
* * Author: Fabrixxm
* * Maintainer: Mike Macgirvin
* * Maintainer: Mario Vavti
diff --git a/view/tpl/hdr.tpl b/view/tpl/hdr.tpl
index 6a14906f6..577269b6f 100644
--- a/view/tpl/hdr.tpl
+++ b/view/tpl/hdr.tpl
@@ -1,5 +1,5 @@
<div id="banner" class="hidden-sm hidden-xs">{{$banner}}</div>
<ul id="nav-notifications-template" rel="template">
- <li class="{5}"><a href="{0}" title="{2} {3}"><img class="dropdown-menu-img-sm" data-src="{1}"><span class="contactname">{2}</span><span class="dropdown-sub-text">{3}<br>{4}</span></a></li>
+ <li class="{5}"><a href="{0}" title="{2} {3}"><img class="dropdown-menu-img-sm" data-src="{1}"><span class="contactname">{2}</span><span class="dropdown-sub-text">{3}<br>{4}</span><div class="clear"></div></a></li>
</ul>
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index af6b6800e..ea31c23a3 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -107,7 +107,7 @@
<script>
window.wiki_resource_id = '{{$resource_id}}';
window.wiki_page_name = '{{$page}}';
- window.wiki_page_content = {{if !$mimeType || $mimeType == 'text/markdown'}}{{$content}}{{else}}`{{$content}}`{{/if}};
+ window.wiki_page_content = `{{$content}}`;
window.wiki_page_commit = '{{$commit}}';
$("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary');