diff options
author | friendica <info@friendica.com> | 2013-05-15 21:21:44 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-05-15 21:21:44 -0700 |
commit | b00c900fa2d999657b17caf577acea5ab772dec1 (patch) | |
tree | 5a8e325ac072278a6d77cb63055e748f9315c7e5 | |
parent | 343fb61badf0e58070314592a24397a8692d1f45 (diff) | |
download | volse-hubzilla-b00c900fa2d999657b17caf577acea5ab772dec1.tar.gz volse-hubzilla-b00c900fa2d999657b17caf577acea5ab772dec1.tar.bz2 volse-hubzilla-b00c900fa2d999657b17caf577acea5ab772dec1.zip |
fix intltext templates - maybe
-rwxr-xr-x | include/friendica_smarty.php | 21 | ||||
-rwxr-xr-x | include/plugin.php | 27 | ||||
-rw-r--r-- | view/en/htconfig.tpl | 20 |
3 files changed, 35 insertions, 33 deletions
diff --git a/include/friendica_smarty.php b/include/friendica_smarty.php index d242a6a42..e34fac003 100755 --- a/include/friendica_smarty.php +++ b/include/friendica_smarty.php @@ -86,4 +86,25 @@ class FriendicaSmartyEngine implements ITemplateEngine { } return ""; } + + public function get_intltext_template($file, $root='') { + $a = get_app(); + + if(file_exists("view/{$a->language}/$s")) + $template_file = "view/{$a->language}/$s"; + elseif(file_exists("view/en/$s")) + $template_file = "view/en/$s"; + else + $template_file = theme_include($file,$root); + if($template_file) { + $template = new FriendicaSmarty(); + $template->filename = $template_file; + + return $template; + } + return ""; + } + + + } diff --git a/include/plugin.php b/include/plugin.php index 8406c45e5..b65ca6e98 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -540,30 +540,11 @@ function theme_include($file, $root = '') { function get_intltext_template($s) { - global $a; - - if(! isset($a->language)) - $a->language = 'en'; - - $engine = ''; - if($a->get_template_engine() === 'smarty3') - $engine = "/smarty3"; - - $file = ''; - if(file_exists("view/{$a->language}$engine/$s")) - $file = "view/{$a->language}$engine/$s"; - elseif(file_exists("view/en$engine/$s")) - $file = "view/en$engine/$s"; - else - $file = "view/tpl/$engine/$s"; - if($engine === '/smarty3') { - $template = new FriendicaSmarty(); - $template->filename = $file; + $a = get_app(); + $t = $a->template_engine(); - return $template; - } - else - return file_get_contents($file); + $template = $t->get_intltext_template($s, $root); + return $template; } diff --git a/view/en/htconfig.tpl b/view/en/htconfig.tpl index e6c268070..493cb5d00 100644 --- a/view/en/htconfig.tpl +++ b/view/en/htconfig.tpl @@ -3,11 +3,11 @@ // Set the following for your MySQL installation // Copy or rename this file to .htconfig.php -$db_host = '$dbhost'; -$db_port = '$dbport'; -$db_user = '$dbuser'; -$db_pass = '$dbpass'; -$db_data = '$dbdata'; +$db_host = '{{$dbhost}}'; +$db_port = '{{$dbport}}'; +$db_user = '{{$dbuser}}'; +$db_pass = '{{$dbpass}}'; +$db_data = '{{$dbdata}}'; /* * Notice: Many of the following settings will be available in the admin panel @@ -25,13 +25,13 @@ $db_data = '$dbdata'; // Choose a legal default timezone. If you are unsure, use "America/Los_Angeles". // It can be changed later and only applies to timestamps for anonymous viewers. -$default_timezone = '$timezone'; +$default_timezone = '{{$timezone}}'; // What is your site name? -$a->config['system']['baseurl'] = '$siteurl'; +$a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Red Matrix"; -$a->config['system']['location_hash'] = '$site_id'; +$a->config['system']['location_hash'] = '{{$site_id}}'; // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting @@ -42,7 +42,7 @@ $a->config['system']['location_hash'] = '$site_id'; $a->config['system']['register_policy'] = REGISTER_OPEN; $a->config['system']['register_text'] = ''; -$a->config['system']['admin_email'] = '$adminmail'; +$a->config['system']['admin_email'] = '{{$adminmail}}'; // Maximum size of an imported message, 0 is unlimited @@ -54,7 +54,7 @@ $a->config['system']['maximagesize'] = 800000; // Location of PHP command line processor -$a->config['system']['php_path'] = '$phpath'; +$a->config['system']['php_path'] = '{{$phpath}}'; // Configure how we communicate with directory servers. // DIRECTORY_MODE_NORMAL = directory client, we will find a directory |