]> git.mxchange.org Git - friendica.git/commitdiff
Disable richtext editor for frio - followup for #2938
authorMichael <heluecht@pirati.ca>
Tue, 29 Nov 2016 20:04:31 +0000 (20:04 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 29 Nov 2016 20:04:31 +0000 (20:04 +0000)
boot.php
include/features.php
view/theme/frio/theme.php

index 866e7165c744021c7ede2541a930725a4cc22706..d0215e81f2882334e53ddd043f5e1ade5aa77293 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -530,6 +530,7 @@ class App {
        public  $videoheight = 350;
        public  $force_max_items = 0;
        public  $theme_thread_allow = true;
+       public  $theme_richtext_editor = true;
        public  $theme_events_in_profile = true;
 
        /**
index 4856f0f19e8678529434b7222cf86c01d0ecbf55..64ab932d00cef7bc8cd0491ae1cd6dadde11dca5 100644 (file)
@@ -7,20 +7,27 @@
 
 /**
  * @brief check if feature is enabled
- * 
+ *
  * @return boolean
  */
-function feature_enabled($uid,$feature) {
-
-       $x = get_config('feature_lock',$feature);
-       if($x === false) {
-               $x = get_pconfig($uid,'feature',$feature);
-               if($x === false) {
-                       $x = get_config('feature',$feature);
-                       if($x === false)
+function feature_enabled($uid, $feature) {
+
+       if (($feature == 'richtext') AND !get_app()->theme_richtext_editor) {
+               return false;
+       }
+
+       $x = get_config('feature_lock', $feature);
+
+       if ($x === false) {
+               $x = get_pconfig($uid, 'feature', $feature);
+               if ($x === false) {
+                       $x = get_config('feature', $feature);
+                       if ($x === false) {
                                $x = get_feature_default($feature);
+                       }
                }
        }
+
        $arr = array('uid' => $uid, 'feature' => $feature, 'enabled' => $x);
        call_hooks('feature_enabled',$arr);
        return($arr['enabled']);
@@ -135,6 +142,11 @@ function get_features($filtered = true) {
                }
        }
 
+       // Remove the richtext editor setting if the theme doesn't support it
+       if (!get_app()->theme_richtext_editor) {
+               unset($arr['composition'][1]);
+       }
+
        call_hooks('get_features',$arr);
        return $arr;
 }
index 0547fdff146dfd0ca8d35a24ae3571ad60b4cc01..085d4d941f42e8db269d9cf73fae14a54d17a3c8 100644 (file)
@@ -16,6 +16,9 @@ function frio_init(&$a) {
        // disable the events module link in the profile tab
        $a->theme_events_in_profile = false;
 
+       // Disallow the richtext editor
+       $a->theme_richtext_editor = false;
+
        set_template_engine($a, 'smarty3');
 
        $baseurl = $a->get_baseurl();