diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 6cb36fb26..1a1b8259e --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ report/ #ignore OSX .DS_Store files .DS_Store + +#netbeans project folder +nbproject diff --git a/boot.php b/boot.php old mode 100644 new mode 100755 index e230a13c6..b00419359 --- a/boot.php +++ b/boot.php @@ -546,9 +546,14 @@ class App { 'force_max_items' => 0, 'thread_allow' => true, 'stylesheet' => '', - 'template_engine' => 'internal', + 'template_engine' => 'smarty3', ); + // array of registered template engines ('name'=>'class name') + public $template_engines = array(); + // array of instanced template engines ('name'=>'instance') + public $template_engine_instance = array(); + private $ldelim = array( 'internal' => '', 'smarty3' => '{{' @@ -680,6 +685,16 @@ class App { $this->is_tablet = $mobile_detect->isTablet(); BaseObject::set_app($this); + + /** + * register template engines + */ + $dc = get_declared_classes(); + foreach ($dc as $k) { + if (in_array("ITemplateEngine", class_implements($k))){ + $this->register_template_engine($k); + } + } } function get_baseurl($ssl = false) { @@ -897,28 +912,79 @@ class App { return $this->curl_headers; } + + /** + * register template engine class + * if $name is "", is used class static property $class::$name + * @param string $class + * @param string $name + */ + function register_template_engine($class, $name = '') { + if ($name===""){ + $v = get_class_vars( $class ); + if(x($v,"name")) $name = $v['name']; + } + if ($name===""){ + echo "template engine $class cannot be registered without a name.\n"; + killme(); + } + $this->template_engines[$name] = $class; + } + + /** + * return template engine instance. If $name is not defined, + * return engine defined by theme, or default + * + * @param strin $name Template engine name + * @return object Template Engine instance + */ + function template_engine($name = ''){ + if ($name!=="") { + $template_engine = $name; + } else { + $template_engine = 'smarty3'; + if (x($this->theme, 'template_engine')) { + $template_engine = $this->theme['template_engine']; + } + } + + if (isset($this->template_engines[$template_engine])){ + if(isset($this->template_engine_instance[$template_engine])){ + return $this->template_engine_instance[$template_engine]; + } else { + $class = $this->template_engines[$template_engine]; + $obj = new $class; + $this->template_engine_instance[$template_engine] = $obj; + return $obj; + } + } + + echo "template engine $template_engine is not registered!\n"; killme(); + } + function get_template_engine() { return $this->theme['template_engine']; } - function set_template_engine($engine = 'internal') { + function set_template_engine($engine = 'smarty3') { - $this->theme['template_engine'] = 'internal'; + $this->theme['template_engine'] = $engine; - switch($engine) { + /*if ($engine) { case 'smarty3': - if(is_writable('view/tpl/smarty3/')) - $this->theme['template_engine'] = 'smarty3'; + if(!is_writable('view/tpl/smarty3/')) + echo "ERROR folder view/tpl/smarty3/ must be writable by webserver."; killme(); + break; default: break; - } + }*/ } - function get_template_ldelim($engine = 'internal') { + function get_template_ldelim($engine = 'smarty3') { return $this->ldelim[$engine]; } - function get_template_rdelim($engine = 'internal') { + function get_template_rdelim($engine = 'smarty3') { return $this->rdelim[$engine]; } diff --git a/include/ITemplateEngine.php b/include/ITemplateEngine.php new file mode 100755 index 000000000..53c1845f4 --- /dev/null +++ b/include/ITemplateEngine.php @@ -0,0 +1,11 @@ + "view/theme/$theme/tpl/smarty3/"); + $template_dirs = array('theme' => "view/theme/$theme/tpl/"); if( x($a->theme_info,"extends") ) - $template_dirs = $template_dirs + array('extends' => "view/theme/".$a->theme_info["extends"]."/tpl/smarty3/"); - $template_dirs = $template_dirs + array('base' => 'view/tpl/smarty3/'); + $template_dirs = $template_dirs + array('extends' => "view/theme/".$a->theme_info["extends"]."/tpl/"); + $template_dirs = $template_dirs + array('base' => 'view/tpl/'); $this->setTemplateDir($template_dirs); $this->setCompileDir('view/tpl/smarty3/compiled/'); @@ -41,3 +42,39 @@ class FriendicaSmarty extends Smarty { +class FriendicaSmartyEngine implements ITemplateEngine { + static $name ="smarty3"; + + public function __construct(){ + if(!is_writable('view/tpl/smarty3/')){ + echo "ERROR: folder view/tpl/smarty3/ must be writable by webserver."; killme(); + } + } + + // ITemplateEngine interface + public function replace_macros($s, $r) { + $template = ''; + if(gettype($s) === 'string') { + $template = $s; + $s = new FriendicaSmarty(); + } + foreach($r as $key=>$value) { + if($key[0] === '$') { + $key = substr($key, 1); + } + $s->assign($key, $value); + } + return $s->parsed($template); + } + + public function get_markup_template($file, $root=''){ + $template_file = theme_include($file, $root); + if($template_file) { + $template = new FriendicaSmarty(); + $template->filename = $template_file; + + return $template; + } + return ""; + } +} \ No newline at end of file diff --git a/include/plugin.php b/include/plugin.php old mode 100644 new mode 100755 index 31427e117..3ef97fba9 --- a/include/plugin.php +++ b/include/plugin.php @@ -569,24 +569,9 @@ function get_intltext_template($s) { function get_markup_template($s, $root = '') { - $a = get_app(); - - $template_eng = $a->get_template_engine(); - if($template_eng === 'internal') { - $template_file = theme_include($s, $root); - if($template_file) - return file_get_contents($template_file); - } - else { - $template_file = theme_include("$template_eng/$s", $root); - - if($template_file) { - $template = new FriendicaSmarty(); - $template->filename = $template_file; - - return $template; - } - } + $t = $a->template_engine(); + $template = $t->get_markup_template($s, $root); + return $template; } diff --git a/include/template_processor.php b/include/template_processor.php old mode 100644 new mode 100755 index 0b4b4142f..74acc9c67 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -1,7 +1,11 @@ -replace_macros($s, $r); + } + + // TemplateEngine interface + public function replace_macros($s, $r) { $this->r = $r; $s = $this->_build_nodes($s); @@ -265,14 +273,18 @@ $os=$s; $count++; $s = $this->var_replace($s); } - $t3 = dba_timer(); -// logger('macro timer: ' . sprintf('%01.4f %01.4f',$t3 - $t2, $t2 - $t1)); - return $s; } + + public function get_markup_template($file, $root='') { + $template_file = theme_include($file, $root); + if ($template_file) { + $content = file_get_contents($template_file); + } + return $content; + } } - $t = new Template; diff --git a/include/text.php b/include/text.php old mode 100644 new mode 100755 index c7210010c..3b3620f33 --- a/include/text.php +++ b/include/text.php @@ -1,44 +1,23 @@ replace) -// returns substituted string. - require_once("include/template_processor.php"); +require_once("include/friendica_smarty.php"); - +/** + * This is our template processor + * + * @param string|FriendicaSmarty $s the string requiring macro substitution, + * or an instance of FriendicaSmarty + * @param array $r key value pairs (search => replace) + * @return string substituted string + */ function replace_macros($s,$r) { - global $t; - -// $ts = microtime(); $a = get_app(); - if($a->get_template_engine() === 'smarty3') { - $output = ''; - if(gettype($s) !== 'NULL') { - $template = ''; - if(gettype($s) === 'string') { - $template = $s; - $s = new FriendicaSmarty(); - } - foreach($r as $key=>$value) { - if($key[0] === '$') { - $key = substr($key, 1); - } - $s->assign($key, $value); - } - $output = $s->parsed($template); - } - } - else { - $r = $t->replace($s,$r); + $t = $a->template_engine(); + $output = $t->replace_macros($s,$r); - $output = template_unescape($r); - } -// $tt = microtime() - $ts; -// $a->page['debug'] .= "$tt
\n"; return $output; } @@ -71,6 +50,8 @@ function random_string($size = 64,$type = RANDOM_STRING_HEX) { * They will be replaced with safer brackets. This may be filtered further * if these are not allowed either. * + * @param string $string Input string + * @return string Filtered string */ @@ -86,6 +67,13 @@ function notags($string) { // and allow them to be safely displayed. + +/** + * use this on "body" or "content" input where angle chars shouldn't be removed, + * and allow them to be safely displayed. + * @param string $string + * @return string + */ function escape_tags($string) { return(htmlspecialchars($string, ENT_COMPAT, 'UTF-8', false)); @@ -97,6 +85,12 @@ function escape_tags($string) { // used to generate initial passwords +/** + * generate a string that's random, but usually pronounceable. + * used to generate initial passwords + * @param int $len + * @return string + */ function autoname($len) { if($len <= 0) @@ -172,6 +166,11 @@ function autoname($len) { // returns escaped text. +/** + * escape text ($str) for XML transport + * @param string $str + * @return string Escaped text. + */ function xmlify($str) { $buffer = ''; diff --git a/util/precompile_smarty3.php b/util/precompile_smarty3.php new file mode 100755 index 000000000..65cb760ef --- /dev/null +++ b/util/precompile_smarty3.php @@ -0,0 +1,27 @@ +setTemplateDir($folders); + +$s->setCompileDir('view/tpl/smarty3/compiled/'); +$s->setConfigDir('view/tpl/smarty3/config/'); +$s->setCacheDir('view/tpl/smarty3/cache/'); + +$s->left_delimiter = "{{"; +$s->right_delimiter = "}}"; + +$s->compileAllTemplates('.tpl',true); \ No newline at end of file diff --git a/view/theme/redbasic/tpl/basic_theme_settings.tpl b/view/theme/redbasic/tpl/basic_theme_settings.tpl old mode 100644 new mode 100755 index 6f71a6a1a..33a34b292 --- a/view/theme/redbasic/tpl/basic_theme_settings.tpl +++ b/view/theme/redbasic/tpl/basic_theme_settings.tpl @@ -1,9 +1,14 @@ -{{inc field_select.tpl with $field=$font_size}}{{endinc}} +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} +{{include file="field_select.tpl" field=$font_size}} -{{inc field_select.tpl with $field=$line_height}}{{endinc}} +{{include file="field_select.tpl" field=$line_height}} -{{inc field_select.tpl with $field=$colour_scheme}}{{endinc}} +{{include file="field_select.tpl" field=$colour_scheme}}
- +
diff --git a/view/theme/redbasic/tpl/smarty3/basic_theme_settings.tpl b/view/theme/redbasic/tpl/smarty3/basic_theme_settings.tpl deleted file mode 100644 index 33a34b292..000000000 --- a/view/theme/redbasic/tpl/smarty3/basic_theme_settings.tpl +++ /dev/null @@ -1,14 +0,0 @@ -{{* - * AUTOMATICALLY GENERATED TEMPLATE - * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN - * - *}} -{{include file="field_select.tpl" field=$font_size}} - -{{include file="field_select.tpl" field=$line_height}} - -{{include file="field_select.tpl" field=$colour_scheme}} - -
- -
diff --git a/view/theme/redbasic/tpl/smarty3/theme_settings.tpl b/view/theme/redbasic/tpl/smarty3/theme_settings.tpl deleted file mode 100644 index f8d9f223c..000000000 --- a/view/theme/redbasic/tpl/smarty3/theme_settings.tpl +++ /dev/null @@ -1,26 +0,0 @@ -{{* - * AUTOMATICALLY GENERATED TEMPLATE - * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN - * - *}} -{{include file="field_select.tpl" field=$colour}} - -{{include file="field_input.tpl" field=$font_size}} - -{{include file="field_input.tpl" field=$line_height}} - -{{include file="field_select.tpl" field=$shadow}} - -{{include file="field_select.tpl" field=$navcolour}} - -{{include file="field_select.tpl" field=$displaystyle}} - -{{include file="field_input.tpl" field=$linkcolour}} - -{{include file="field_select.tpl" field=$iconset}} - -{{include file="field_select.tpl" field=$shiny}} - -
- -
diff --git a/view/theme/redbasic/tpl/theme_settings.tpl b/view/theme/redbasic/tpl/theme_settings.tpl old mode 100644 new mode 100755 index 6e7e079e0..f8d9f223c --- a/view/theme/redbasic/tpl/theme_settings.tpl +++ b/view/theme/redbasic/tpl/theme_settings.tpl @@ -1,21 +1,26 @@ -{{inc field_select.tpl with $field=$colour}}{{endinc}} +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} +{{include file="field_select.tpl" field=$colour}} -{{inc field_input.tpl with $field=$font_size}}{{endinc}} +{{include file="field_input.tpl" field=$font_size}} -{{inc field_input.tpl with $field=$line_height}}{{endinc}} +{{include file="field_input.tpl" field=$line_height}} -{{inc field_select.tpl with $field=$shadow}}{{endinc}} +{{include file="field_select.tpl" field=$shadow}} -{{inc field_select.tpl with $field=$navcolour}}{{endinc}} +{{include file="field_select.tpl" field=$navcolour}} -{{inc field_select.tpl with $field=$displaystyle}}{{endinc}} +{{include file="field_select.tpl" field=$displaystyle}} -{{inc field_input.tpl with $field=$linkcolour}}{{endinc}} +{{include file="field_input.tpl" field=$linkcolour}} -{{inc field_select.tpl with $field=$iconset}}{{endinc}} +{{include file="field_select.tpl" field=$iconset}} -{{inc field_select.tpl with $field=$shiny}}{{endinc}} +{{include file="field_select.tpl" field=$shiny}}
- +
diff --git a/view/tpl/404.tpl b/view/tpl/404.tpl old mode 100644 new mode 100755 index bf4d4e949..2d581ab8d --- a/view/tpl/404.tpl +++ b/view/tpl/404.tpl @@ -1 +1,6 @@ -

$message

+{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} +

{{$message}}

diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl old mode 100644 new mode 100755 index 7f20f3398..9f6556842 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -1,74 +1,79 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} -

$header

+

{{$header}}

-

$addr

+

{{$addr}}

-{{ if $notself }} +{{if $notself}}
-$tabs +{{$tabs}}
-{{ endif }} +{{/if}} -{{ if $self }} -
$autolbl
-{{ endif }} +{{if $self}} +
{{$autolbl}}
+{{/if}}
-{{ if $notself }} -{{ if $slide }} -

$lbl_slider

+{{if $notself}} +{{if $slide}} +

{{$lbl_slider}}

-$slide +{{$slide}} -{{ endif }} -{{ endif }} +{{/if}} +{{/if}} -

$permlbl

+

{{$permlbl}}

-
- - + + + -{{ if $noperms }} -
$noperms
-{{ endif }} +{{if $noperms}} +
{{$noperms}}
+{{/if}} -{{ if $is_pending }} -{{inc field_checkbox.tpl with $field=$unapproved }}{{endinc}} -{{ endif }} +{{if $is_pending}} +{{include file="field_checkbox.tpl" field=$unapproved}} +{{/if}}
-$quick +{{$quick}} - + - +
diff --git a/view/tpl/acl_selector.tpl b/view/tpl/acl_selector.tpl old mode 100644 new mode 100755 index e5231b0f8..aebef71ee --- a/view/tpl/acl_selector.tpl +++ b/view/tpl/acl_selector.tpl @@ -1,6 +1,11 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}}
- $showall + {{$showall}}
@@ -10,8 +15,8 @@ -

$admtxt

+

{{$admtxt}}

-{{ if $admin.update }} +{{if $admin.update}} -{{ endif }} +{{/if}} -{{ if $admin.plugins_admin }}

$plugadmtxt

{{ endif }} +{{if $admin.plugins_admin}}

{{$plugadmtxt}}

{{/if}} -

$logtxt

+

{{$logtxt}}

diff --git a/view/tpl/admin_logs.tpl b/view/tpl/admin_logs.tpl old mode 100644 new mode 100755 index b777cf420..6a2259500 --- a/view/tpl/admin_logs.tpl +++ b/view/tpl/admin_logs.tpl @@ -1,19 +1,24 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}}
-

$title - $page

+

{{$title}} - {{$page}}

-
- + + - {{ inc field_checkbox.tpl with $field=$debugging }}{{ endinc }} - {{ inc field_input.tpl with $field=$logfile }}{{ endinc }} - {{ inc field_select.tpl with $field=$loglevel }}{{ endinc }} + {{include file="field_checkbox.tpl" field=$debugging}} + {{include file="field_input.tpl" field=$logfile}} + {{include file="field_select.tpl" field=$loglevel}} -
+
-

$logname

-
$data
- - +

{{$logname}}

+
{{$data}}
+ +
diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl old mode 100644 new mode 100755 index 74b56bb4e..307814e87 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -1,15 +1,20 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}}
-

$title - $page

+

{{$title}} - {{$page}}

    - {{ for $plugins as $p }} -
  • - - $p.2.name - $p.2.version - {{ if $p.2.experimental }} $experimental {{ endif }}{{ if $p.2.unsupported }} $unsupported {{ endif }} + {{foreach $plugins as $p}} +
  • + + {{$p.2.name}} - {{$p.2.version}} + {{if $p.2.experimental}} {{$experimental}} {{/if}}{{if $p.2.unsupported}} {{$unsupported}} {{/if}} -
    $p.2.description
    +
    {{$p.2.description}}
  • - {{ endfor }} + {{/foreach}}
diff --git a/view/tpl/admin_plugins_details.tpl b/view/tpl/admin_plugins_details.tpl old mode 100644 new mode 100755 index 931c7b83c..e81701732 --- a/view/tpl/admin_plugins_details.tpl +++ b/view/tpl/admin_plugins_details.tpl @@ -1,36 +1,41 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}}
-

$title - $page

+

{{$title}} - {{$page}}

-

$info.name - $info.version : $action

-

$info.description

+

{{$info.name}} - {{$info.version}} : {{$action}}

+

{{$info.description}}

-

$str_author - {{ for $info.author as $a }} - {{ if $a.link }}$a.name{{ else }}$a.name{{ endif }}, - {{ endfor }} +

{{$str_author}} + {{foreach $info.author as $a}} + {{if $a.link}}{{$a.name}}{{else}}{{$a.name}}{{/if}}, + {{/foreach}}

-

$str_maintainer - {{ for $info.maintainer as $a }} - {{ if $a.link }}$a.name{{ else }}$a.name{{ endif }}, - {{ endfor }} +

{{$str_maintainer}} + {{foreach $info.maintainer as $a}} + {{if $a.link}}{{$a.name}}{{else}}{{$a.name}}{{/if}}, + {{/foreach}}

- {{ if $screenshot }} - $screenshot.1 - {{ endif }} + {{if $screenshot}} + {{$screenshot.1}} + {{/if}} - {{ if $admin_form }} -

$settings

-
- $admin_form + {{if $admin_form}} +

{{$settings}}

+ + {{$admin_form}}
- {{ endif }} + {{/if}} - {{ if $readme }} + {{if $readme}}

Readme

- $readme + {{$readme}}
- {{ endif }} + {{/if}}
diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl old mode 100644 new mode 100755 index 47e952164..eaf067c27 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -1,3 +1,8 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}}
-

$title - $page

+

{{$title}} - {{$page}}

-
- + + - {{ inc field_input.tpl with $field=$sitename }}{{ endinc }} - {{ inc field_textarea.tpl with $field=$banner }}{{ endinc }} - {{ inc field_select.tpl with $field=$language }}{{ endinc }} - {{ inc field_select.tpl with $field=$theme }}{{ endinc }} - {{ inc field_select.tpl with $field=$theme_mobile }}{{ endinc }} - {{ inc field_select.tpl with $field=$theme_accessibility }}{{ endinc }} - {{ inc field_select.tpl with $field=$ssl_policy }}{{ endinc }} + {{include file="field_input.tpl" field=$sitename}} + {{include file="field_textarea.tpl" field=$banner}} + {{include file="field_select.tpl" field=$language}} + {{include file="field_select.tpl" field=$theme}} + {{include file="field_select.tpl" field=$theme_mobile}} + {{include file="field_select.tpl" field=$theme_accessibility}} + {{include file="field_select.tpl" field=$ssl_policy}} -
+
-

$registration

- {{ inc field_input.tpl with $field=$register_text }}{{ endinc }} - {{ inc field_select.tpl with $field=$register_policy }}{{ endinc }} +

{{$registration}}

+ {{include file="field_input.tpl" field=$register_text}} + {{include file="field_select.tpl" field=$register_policy}} -
+
-

$upload

- {{ inc field_input.tpl with $field=$maximagesize }}{{ endinc }} +

{{$upload}}

+ {{include file="field_input.tpl" field=$maximagesize}} -

$corporate

- {{ inc field_input.tpl with $field=$allowed_sites }}{{ endinc }} - {{ inc field_input.tpl with $field=$allowed_email }}{{ endinc }} - {{ inc field_checkbox.tpl with $field=$block_public }}{{ endinc }} - {{ inc field_checkbox.tpl with $field=$force_publish }}{{ endinc }} - {{ inc field_checkbox.tpl with $field=$no_community_page }}{{ endinc }} - {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }} +

{{$corporate}}

+ {{include file="field_input.tpl" field=$allowed_sites}} + {{include file="field_input.tpl" field=$allowed_email}} + {{include file="field_checkbox.tpl" field=$block_public}} + {{include file="field_checkbox.tpl" field=$force_publish}} + {{include file="field_checkbox.tpl" field=$no_community_page}} + {{include file="field_input.tpl" field=$global_directory}} -
+
-

$advanced

- {{ inc field_input.tpl with $field=$proxy }}{{ endinc }} - {{ inc field_input.tpl with $field=$proxyuser }}{{ endinc }} - {{ inc field_input.tpl with $field=$timeout }}{{ endinc }} - {{ inc field_input.tpl with $field=$delivery_interval }}{{ endinc }} - {{ inc field_input.tpl with $field=$poll_interval }}{{ endinc }} - {{ inc field_input.tpl with $field=$maxloadavg }}{{ endinc }} - {{ inc field_input.tpl with $field=$abandon_days }}{{ endinc }} +

{{$advanced}}

+ {{include file="field_input.tpl" field=$proxy}} + {{include file="field_input.tpl" field=$proxyuser}} + {{include file="field_input.tpl" field=$timeout}} + {{include file="field_input.tpl" field=$delivery_interval}} + {{include file="field_input.tpl" field=$poll_interval}} + {{include file="field_input.tpl" field=$maxloadavg}} + {{include file="field_input.tpl" field=$abandon_days}} -
+
diff --git a/view/tpl/admin_summary.tpl b/view/tpl/admin_summary.tpl old mode 100644 new mode 100755 index 99221c13e..76ac23d29 --- a/view/tpl/admin_summary.tpl +++ b/view/tpl/admin_summary.tpl @@ -1,39 +1,44 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}}
-

$title - $page

+

{{$title}} - {{$page}}

-
$queues.label
-
$queues.queue
+
{{$queues.label}}
+
{{$queues.queue}}
-
$pending.0
-
$pending.1 +
{{$pending.0}}
+
{{$pending.1}}
-
$users.0
-
$users.1
+
{{$users.0}}
+
{{$users.1}}
- {{ for $accounts as $p }} + {{foreach $accounts as $p}}
-
$p.0
-
{{ if $p.1 }}$p.1{{ else }}0{{ endif }}
+
{{$p.0}}
+
{{if $p.1}}{{$p.1}}{{else}}0{{/if}}
- {{ endfor }} + {{/foreach}}
-
$plugins.0
+
{{$plugins.0}}
- {{ for $plugins.1 as $p }} -
$p
- {{ endfor }} + {{foreach $plugins.1 as $p}} +
{{$p}}
+ {{/foreach}}
-
$version.0
-
$version.1 - $build +
{{$version.0}}
+
{{$version.1}} - {{$build}}
diff --git a/view/tpl/admin_users.tpl b/view/tpl/admin_users.tpl old mode 100644 new mode 100755 index 6de504e2a..136ce3c3e --- a/view/tpl/admin_users.tpl +++ b/view/tpl/admin_users.tpl @@ -1,9 +1,14 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}}
-

$title - $page

+

{{$title}} - {{$page}}

-
- + + -

$h_pending

- {{ if $pending }} +

{{$h_pending}}

+ {{if $pending}} - {{ for $th_pending as $th }}{{ endfor }} + {{foreach $th_pending as $th}}{{/foreach}} - {{ for $pending as $u }} + {{foreach $pending as $u}} - - - - + + + + - {{ endfor }} + {{/foreach}}
$th{{$th}}
$u.created$u.name{{$u.created}}{{$u.name}} - - + +
- -
- {{ else }} -

$no_pending

- {{ endif }} + +
+ {{else}} +

{{$no_pending}}

+ {{/if}} -

$h_users

- {{ if $users }} +

{{$h_users}}

+ {{if $users}} - {{ for $th_users as $th }}{{ endfor }} + {{foreach $th_users as $th}}{{/foreach}} - {{ for $users as $u }} + {{foreach $users as $u}} - - - - - - + + + + + + - {{ endfor }} + {{/foreach}}
$th{{$th}}
$u.nickname$u.account_created$u.account_service_class{{$u.nickname}}{{$u.account_created}}{{$u.account_service_class}} - - + +
- -
- {{ else }} + +
+ {{else}} NO USERS?!? - {{ endif }} + {{/if}}
diff --git a/view/tpl/album_edit.tpl b/view/tpl/album_edit.tpl old mode 100644 new mode 100755 index 56a7b73fc..36c07a9f0 --- a/view/tpl/album_edit.tpl +++ b/view/tpl/album_edit.tpl @@ -1,14 +1,19 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}}
-
+ - - + +
- - + +
diff --git a/view/tpl/api_config_xml.tpl b/view/tpl/api_config_xml.tpl old mode 100644 new mode 100755 index 3281e59dd..09aa00ac4 --- a/view/tpl/api_config_xml.tpl +++ b/view/tpl/api_config_xml.tpl @@ -1,24 +1,29 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} - $config.site.name - $config.site.server + {{$config.site.name}} + {{$config.site.server}} default - $config.site.logo + {{$config.site.logo}} true en - $config.site.email + {{$config.site.email}} UTC - $config.site.closed + {{$config.site.closed}} false - $config.site.private - $config.site.textlimit - $config.site.ssl - $config.site.sslserver + {{$config.site.private}} + {{$config.site.textlimit}} + {{$config.site.ssl}} + {{$config.site.sslserver}} 30 diff --git a/view/tpl/api_friends_xml.tpl b/view/tpl/api_friends_xml.tpl old mode 100644 new mode 100755 index 0ea7eb13b..e9c40293b --- a/view/tpl/api_friends_xml.tpl +++ b/view/tpl/api_friends_xml.tpl @@ -1,5 +1,10 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} - {{for $users as $user }} - {{inc api_user_xml.tpl }}{{endinc}} - {{endfor}} + {{foreach $users as $user}} + {{include file="api_user_xml.tpl"}} + {{/foreach}} diff --git a/view/tpl/api_ratelimit_xml.tpl b/view/tpl/api_ratelimit_xml.tpl old mode 100644 new mode 100755 index 36ec1993d..a34eb6723 --- a/view/tpl/api_ratelimit_xml.tpl +++ b/view/tpl/api_ratelimit_xml.tpl @@ -1,6 +1,11 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} - $hash.remaining_hits - $hash.hourly_limit - $hash.reset_time - $hash.resettime_in_seconds + {{$hash.remaining_hits}} + {{$hash.hourly_limit}} + {{$hash.reset_time}} + {{$hash.resettime_in_seconds}} diff --git a/view/tpl/api_status_xml.tpl b/view/tpl/api_status_xml.tpl old mode 100644 new mode 100755 index f6cd9c2c0..e3e80d2b1 --- a/view/tpl/api_status_xml.tpl +++ b/view/tpl/api_status_xml.tpl @@ -1,46 +1,51 @@ -{{ if $status }} - $status.created_at - $status.id - $status.text - $status.source - $status.truncated - $status.in_reply_to_status_id - $status.in_reply_to_user_id - $status.favorited - $status.in_reply_to_screen_name - $status.geo - $status.coordinates - $status.place - $status.contributors +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} +{{if $status}} + {{$status.created_at}} + {{$status.id}} + {{$status.text}} + {{$status.source}} + {{$status.truncated}} + {{$status.in_reply_to_status_id}} + {{$status.in_reply_to_user_id}} + {{$status.favorited}} + {{$status.in_reply_to_screen_name}} + {{$status.geo}} + {{$status.coordinates}} + {{$status.place}} + {{$status.contributors}} - $status.user.id - $status.user.name - $status.user.screen_name - $status.user.location - $status.user.description - $status.user.profile_image_url - $status.user.url - $status.user.protected - $status.user.followers - $status.user.profile_background_color - $status.user.profile_text_color - $status.user.profile_link_color - $status.user.profile_sidebar_fill_color - $status.user.profile_sidebar_border_color - $status.user.friends_count - $status.user.created_at - $status.user.favourites_count - $status.user.utc_offset - $status.user.time_zone - $status.user.profile_background_image_url - $status.user.profile_background_tile - $status.user.profile_use_background_image + {{$status.user.id}} + {{$status.user.name}} + {{$status.user.screen_name}} + {{$status.user.location}} + {{$status.user.description}} + {{$status.user.profile_image_url}} + {{$status.user.url}} + {{$status.user.protected}} + {{$status.user.followers}} + {{$status.user.profile_background_color}} + {{$status.user.profile_text_color}} + {{$status.user.profile_link_color}} + {{$status.user.profile_sidebar_fill_color}} + {{$status.user.profile_sidebar_border_color}} + {{$status.user.friends_count}} + {{$status.user.created_at}} + {{$status.user.favourites_count}} + {{$status.user.utc_offset}} + {{$status.user.time_zone}} + {{$status.user.profile_background_image_url}} + {{$status.user.profile_background_tile}} + {{$status.user.profile_use_background_image}} - $status.user.geo_enabled - $status.user.verified + {{$status.user.geo_enabled}} + {{$status.user.verified}} - $status.user.statuses_count - $status.user.lang - $status.user.contributors_enabled + {{$status.user.statuses_count}} + {{$status.user.lang}} + {{$status.user.contributors_enabled}} -{{ endif }} +{{/if}} diff --git a/view/tpl/api_test_xml.tpl b/view/tpl/api_test_xml.tpl old mode 100644 new mode 100755 index 7509a2dc1..df5009af5 --- a/view/tpl/api_test_xml.tpl +++ b/view/tpl/api_test_xml.tpl @@ -1 +1,6 @@ -$ok +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} +{{$ok}} diff --git a/view/tpl/api_timeline_atom.tpl b/view/tpl/api_timeline_atom.tpl old mode 100644 new mode 100755 index 9039220e7..00a28e390 --- a/view/tpl/api_timeline_atom.tpl +++ b/view/tpl/api_timeline_atom.tpl @@ -1,90 +1,95 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} StatusNet - $rss.self + {{$rss.self}} Friendika Friendika API feed - $rss.logo - $rss.atom_updated - - + {{$rss.logo}} + {{$rss.atom_updated}} + + http://activitystrea.ms/schema/1.0/person - $user.url - $user.name - - - - - + {{$user.url}} + {{$user.name}} + + + + + - $user.screen_name - $user.name + {{$user.screen_name}} + {{$user.name}} homepage - $user.url + {{$user.url}} true - + http://activitystrea.ms/schema/1.0/person - $user.contact_url - $user.name - - - - - - $user.screen_name - $user.name + {{$user.contact_url}} + {{$user.name}} + + + + + + {{$user.screen_name}} + {{$user.name}} homepage - $user.url + {{$user.url}} true - + - {{ for $statuses as $status }} + {{foreach $statuses as $status}} - $status.objecttype - $status.message_id - $status.text - $status.statusnet_html - - $status.verb - $status.published - $status.updated + {{$status.objecttype}} + {{$status.message_id}} + {{$status.text}} + {{$status.statusnet_html}} + + {{$status.verb}} + {{$status.published}} + {{$status.updated}} - - - + + + http://activitystrea.ms/schema/1.0/person - $status.user.url - $status.user.name - - + {{$status.user.url}} + {{$status.user.name}} + + - $status.user.screen_name - $status.user.name + {{$status.user.screen_name}} + {{$status.user.name}} homepage - $status.user.url + {{$status.user.url}} true - + - {{ endfor }} + {{/foreach}} diff --git a/view/tpl/api_timeline_rss.tpl b/view/tpl/api_timeline_rss.tpl old mode 100644 new mode 100755 index 40239273c..afad50aab --- a/view/tpl/api_timeline_rss.tpl +++ b/view/tpl/api_timeline_rss.tpl @@ -1,26 +1,31 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} Friendika - $rss.alternate - + {{$rss.alternate}} + Friendika timeline - $rss.language + {{$rss.language}} 40 - $user.link - $user.name's items - $user.profile_image_url + {{$user.link}} + {{$user.name}}'s items + {{$user.profile_image_url}} -{{ for $statuses as $status }} +{{foreach $statuses as $status}} - $status.user.name: $status.text - $status.text - $status.created_at - $status.url - $status.url - $status.source + {{$status.user.name}}: {{$status.text}} + {{$status.text}} + {{$status.created_at}} + {{$status.url}} + {{$status.url}} + {{$status.source}} -{{ endfor }} +{{/foreach}} diff --git a/view/tpl/api_timeline_xml.tpl b/view/tpl/api_timeline_xml.tpl old mode 100644 new mode 100755 index 4a32b411b..84148d17f --- a/view/tpl/api_timeline_xml.tpl +++ b/view/tpl/api_timeline_xml.tpl @@ -1,20 +1,25 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} -{{ for $statuses as $status }} - $status.text - $status.truncated - $status.created_at - $status.in_reply_to_status_id - $status.source - $status.id - $status.in_reply_to_user_id - $status.in_reply_to_screen_name - $status.geo - $status.favorited -{{ inc api_user_xml.tpl with $user=$status.user }}{{ endinc }} $status.statusnet_html - $status.statusnet_conversation_id - $status.url - $status.coordinates - $status.place - $status.contributors +{{foreach $statuses as $status}} + {{$status.text}} + {{$status.truncated}} + {{$status.created_at}} + {{$status.in_reply_to_status_id}} + {{$status.source}} + {{$status.id}} + {{$status.in_reply_to_user_id}} + {{$status.in_reply_to_screen_name}} + {{$status.geo}} + {{$status.favorited}} +{{include file="api_user_xml.tpl" user=$status.user}} {{$status.statusnet_html}} + {{$status.statusnet_conversation_id}} + {{$status.url}} + {{$status.coordinates}} + {{$status.place}} + {{$status.contributors}} -{{ endfor }} +{{/foreach}} diff --git a/view/tpl/api_user_xml.tpl b/view/tpl/api_user_xml.tpl old mode 100644 new mode 100755 index d286652c0..d7efcf3fb --- a/view/tpl/api_user_xml.tpl +++ b/view/tpl/api_user_xml.tpl @@ -1,46 +1,51 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} - $user.id - $user.name - $user.screen_name - $user.location - $user.description - $user.profile_image_url - $user.url - $user.protected - $user.followers_count - $user.friends_count - $user.created_at - $user.favourites_count - $user.utc_offset - $user.time_zone - $user.statuses_count - $user.following - $user.profile_background_color - $user.profile_text_color - $user.profile_link_color - $user.profile_sidebar_fill_color - $user.profile_sidebar_border_color - $user.profile_background_image_url - $user.profile_background_tile - $user.profile_use_background_image - $user.notifications - $user.geo_enabled - $user.verified - $user.lang - $user.contributors_enabled - {{ if $user.status }} - $user.status.created_at - $user.status.id - $user.status.text - $user.status.source - $user.status.truncated - $user.status.in_reply_to_status_id - $user.status.in_reply_to_user_id - $user.status.favorited - $user.status.in_reply_to_screen_name - $user.status.geo - $user.status.coordinates - $user.status.place - $user.status.contributors - {{ endif }} + {{$user.id}} + {{$user.name}} + {{$user.screen_name}} + {{$user.location}} + {{$user.description}} + {{$user.profile_image_url}} + {{$user.url}} + {{$user.protected}} + {{$user.followers_count}} + {{$user.friends_count}} + {{$user.created_at}} + {{$user.favourites_count}} + {{$user.utc_offset}} + {{$user.time_zone}} + {{$user.statuses_count}} + {{$user.following}} + {{$user.profile_background_color}} + {{$user.profile_text_color}} + {{$user.profile_link_color}} + {{$user.profile_sidebar_fill_color}} + {{$user.profile_sidebar_border_color}} + {{$user.profile_background_image_url}} + {{$user.profile_background_tile}} + {{$user.profile_use_background_image}} + {{$user.notifications}} + {{$user.geo_enabled}} + {{$user.verified}} + {{$user.lang}} + {{$user.contributors_enabled}} + {{if $user.status}} + {{$user.status.created_at}} + {{$user.status.id}} + {{$user.status.text}} + {{$user.status.source}} + {{$user.status.truncated}} + {{$user.status.in_reply_to_status_id}} + {{$user.status.in_reply_to_user_id}} + {{$user.status.favorited}} + {{$user.status.in_reply_to_screen_name}} + {{$user.status.geo}} + {{$user.status.coordinates}} + {{$user.status.place}} + {{$user.status.contributors}} + {{/if}} diff --git a/view/tpl/apps.tpl b/view/tpl/apps.tpl old mode 100644 new mode 100755 index 4c7f8c94c..01d9bb8c8 --- a/view/tpl/apps.tpl +++ b/view/tpl/apps.tpl @@ -1,7 +1,12 @@ -

$title

+{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} +

{{$title}}

    - {{ for $apps as $ap }} -
  • $ap
  • - {{ endfor }} + {{foreach $apps as $ap}} +
  • {{$ap}}
  • + {{/foreach}}
diff --git a/view/tpl/atom_feed.tpl b/view/tpl/atom_feed.tpl old mode 100644 new mode 100755 index 2feb547ee..db553d99f --- a/view/tpl/atom_feed.tpl +++ b/view/tpl/atom_feed.tpl @@ -1,3 +1,8 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} - $feed_id - $feed_title - Friendica + {{$feed_id}} + {{$feed_title}} + Friendica - $hub - $salmon - $community + {{$hub}} + {{$salmon}} + {{$community}} - $feed_updated + {{$feed_updated}} - $name - $profile_page - - - $birthday + {{$name}} + {{$profile_page}} + + + {{$birthday}} diff --git a/view/tpl/atom_feed_dfrn.tpl b/view/tpl/atom_feed_dfrn.tpl old mode 100644 new mode 100755 index 0bae62b52..87d78a518 --- a/view/tpl/atom_feed_dfrn.tpl +++ b/view/tpl/atom_feed_dfrn.tpl @@ -1,3 +1,8 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} - $feed_id - $feed_title - Friendica + {{$feed_id}} + {{$feed_title}} + Friendica - $hub - $salmon - $community + {{$hub}} + {{$salmon}} + {{$community}} - $feed_updated + {{$feed_updated}} - $name - $profile_page - - - $birthday + {{$name}} + {{$profile_page}} + + + {{$birthday}} diff --git a/view/tpl/birthdays_reminder.tpl b/view/tpl/birthdays_reminder.tpl old mode 100644 new mode 100755 index 8db7d22f4..56749cd12 --- a/view/tpl/birthdays_reminder.tpl +++ b/view/tpl/birthdays_reminder.tpl @@ -1,10 +1,15 @@ -{{ if $count }} - -