]> git.mxchange.org Git - friendica.git/commitdiff
only use Smarty if the view/smarty3/ directory is writable; location bug fix
authorZach Prezkuta <fermion@gmx.com>
Sun, 23 Dec 2012 13:16:35 +0000 (06:16 -0700)
committerZach Prezkuta <fermion@gmx.com>
Sun, 23 Dec 2012 13:16:35 +0000 (06:16 -0700)
20 files changed:
boot.php
include/conversation.php
view/theme/cleanzero/theme.php
view/theme/comix-plain/theme.php
view/theme/comix/theme.php
view/theme/darkbubble/theme.php
view/theme/darkzero/theme.php
view/theme/diabook/theme.php
view/theme/dispy/theme.php
view/theme/duepuntozero/theme.php
view/theme/facepark/theme.php
view/theme/frost-mobile/theme.php
view/theme/frost/theme.php
view/theme/greenzero/theme.php
view/theme/purplezero/theme.php
view/theme/quattro/theme.php
view/theme/slackr/theme.php
view/theme/smoothly/theme.php
view/theme/testbubble/theme.php
view/theme/vier/theme.php

index e8561a615014c062449beecc5700e8862dc0c7e4..08caf1a4509b1eca3bdc7f63b368944d04242920 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1946,3 +1946,18 @@ function clear_cache($basepath = "", $path = "") {
                closedir($dh);
        }
 }
+
+function set_template_engine(&$a, $engine = 'internal') {
+
+       $a->theme['template_engine'] = 'internal';
+
+       if(is_writable('view/smarty3/')) {
+               switch($engine) {
+                       case 'smarty3':
+                               $a->theme['template_engine'] = 'smarty3';
+                               break;
+                       default:
+                               break;
+               }
+       }
+}
index 9cc6a83427f841fc4becc9a04dd57eba39bcefd7..a5a6a992ff06d60e43700d57da20f0529d090bca 100644 (file)
@@ -920,7 +920,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
 
        $o = '';
 
-       $geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : '');
+       $geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
 
 /*     $plaintext = false;
        if( local_user() && (intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled(local_user(),'richtext')) )
index c7c0b2d640bd47f778750e12c72ecfdf110bac51..356a1b71cbe3098cded11d80fb4a16a8ab5b737a 100644 (file)
@@ -8,7 +8,7 @@
 $a->theme_info = array(
   'extends' => 'duepuntozero',
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function cleanzero_init(&$a) {
 $a->page['htmlhead'] .= <<< EOT
index a85d535a72ad472e7d256753a22025e8cdbf551e..4e5fd0d0e9b7745a86b480ac73ba61220d1d7250 100644 (file)
@@ -11,7 +11,7 @@
 $a->theme_info = array(
   'extends' => 'duepuntozero',
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 $a->page['htmlhead'] .= <<< EOT
 <script>
index 52aa0a927dcc45ac73ce4b13493c441b3a919f05..ce28ebf18938180190b935c98322fa8726210a95 100644 (file)
@@ -11,7 +11,7 @@
 $a->theme_info = array(
   'extends' => 'duepuntozero',
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 $a->page['htmlhead'] .= <<< EOT
 <script>
index 6a2266dd8067484a6e0b414987a4dd1f17fed0b2..ecd14da772ed017523d2bfe1df054545ae782298 100644 (file)
@@ -10,7 +10,7 @@
 $a->theme_info = array(
   'extends' => 'testbubble',
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 
 $a->page['htmlhead'] .= <<< EOT
index 9fa248ceacba6d36a928e30013c1531b8f9781ff..ceafdf59569571a7cbf4354b3b34bffaf5cdc0d1 100644 (file)
@@ -11,7 +11,7 @@
 $a->theme_info = array(
   'extends' => 'duepuntozero',
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function darkzero_init(&$a) {
 $a->page['htmlhead'] .= <<< EOT
index dbfe5a8e8c7884afdce478a467831a8231a3cc1d..becf1584e60ba2bd71ea4bcdcde4e6ade11e0dbb 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 $a = get_app();
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function get_diabook_config($key, $default = false) {
        if (local_user()) {
index 71e4e62e19a14d93dfa0ffcf8cc8e861f866f829..5168fa8e050b0a3202abee327479df610dc50146 100644 (file)
@@ -22,7 +22,7 @@ $a->theme_info = array(
     'family' => 'dispy',
        'version' => '1.2.2'
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function dispy_init(&$a) {
 
index 6c9048ad7e3257a517e383e66c33aac30393edb1..bf5a4111fd396d46937c77ab27386c580cfac28e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 $a->theme_info = array();
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function duepuntozero_init(&$a) {
 $a->page['htmlhead'] .= <<< EOT
index eeb484194809d8a20bde9e688cafd4adfa14bf71..ec1ab1c6712807b99e3cd097eb8b7db2b193047d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 $a->theme_info = array();
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 $a->page['htmlhead'] .= <<< EOT
 <script>
index 7a2602e602d7b4ea52e58f4de884bfccaf478acf..48dd3ef03dec958eb543679c922167add74780de 100644 (file)
@@ -15,7 +15,7 @@ $a->videowidth = 250;
 $a->videoheight = 200;
 $a->theme_thread_allow = false;
 $a->force_max_items = 10;
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function frost_mobile_content_loaded(&$a) {
 
index 3faf73d2fc948087461d5c3347e3dc2059d671e0..77ada64185b193586ed55a1f5dd2f8729f78f348 100644 (file)
@@ -13,7 +13,7 @@ $a->theme_info = array();
 $a->videowidth = 400;
 $a->videoheight = 330;
 $a->theme_thread_allow = false;
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function frost_content_loaded(&$a) {
 
index 0818091f635fca6136072ab6417c9a5d345bc218..09a63c040d20d07a549c89293687e911f4f71fcf 100644 (file)
@@ -2,7 +2,7 @@
 $a->theme_info = array(
   'extends' => 'duepuntozero',
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function greenzero_init(&$a) {
 $a->page['htmlhead'] .= <<< EOT
index a514da669ddb59fd2435abc0b8e1426ca4ae75f7..fc9d5f91c87888605618095db889c4a13fe95e32 100644 (file)
@@ -2,7 +2,7 @@
 $a->theme_info = array(
   'extends' => 'duepuntozero',
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function purplezero_init(&$a) {
 $a->page['htmlhead'] .= <<< EOT
index e21deb8ab536bc6fb4437e8fc7ecaf83c2b13e78..73d35a1628a966970a05f816a47647c9632a0b8e 100644 (file)
@@ -8,7 +8,7 @@
  */
  
 $a->theme_info = array();
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function quattro_init(&$a) {
 $a->page['htmlhead'] .= <<< EOT
index cbd028f7d6827db5169620f6ed853c0f0a5f497f..bc09299794a8d3c883bb900080407376cb02df95 100644 (file)
@@ -2,7 +2,7 @@
 $a->theme_info = array(
   'extends' => 'duepuntozero',
 );
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function slackr_init(&$a) {
 $a->page['htmlhead'] .= <<< EOT
index 3dff381b220487aa97cab4c04ded90c94844251d..742cb0d1e66959568b19fe51e41bcf80e997e8ad 100644 (file)
@@ -11,7 +11,7 @@
 
 $a = get_app();
 $a->theme_info = array();
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 function smoothly_init(&$a) {
        $cssFile = null;
index b71ab06f791efc0a05c3c408c4604c0ad5aacd0b..ab5d175fe5ee65102ca8cd3e5c50ef4395424e7c 100644 (file)
@@ -8,7 +8,7 @@
  * Maintainer: Mike Macgirvin <mike@macgirvin.com>
  */
 
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 $a->page['htmlhead'] .= <<< EOT
 <script>
index e9e638fa04217977121fb1623b909d54098f241d..f071c1bd067c5f55ffcc1e158b6c34cce2da9817 100644 (file)
@@ -7,7 +7,7 @@
  * Maintainer: Ike <http://pirati.ca/profile/heluecht>
  */
 
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
 $a->theme_info = array();