summaryrefslogtreecommitdiffstats
path: root/lib/private/template/base.php
blob: a18c43bb2ca42d8ec66e8bebbf672fb067b75b1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
/**
 * @author Bart Visscher <bartv@thisnet.nl>
 * @author Björn Schießle <schiessle@owncloud.com>
 * @author Christopher Schäpers <kondou@ts.unde.re>
 * @author Jörn Friedrich Dreyer <jfd@butonic.de>
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>
 *
 * @copyright Copyright (c) 2015, ownCloud, Inc.
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

namespace OC\Template;

class Base {
	private $template; // The template
	private $vars; // Vars
	private $l10n; // The l10n-Object
	private $theme; // theme defaults

	/**
	 * @param string $template
	 * @param \OC_L10N $l10n
	 * @param \OC_Defaults $theme
	 */
	public function __construct( $template, $requesttoken, $l10n, $theme ) {
		$this->vars = array();
		$this->vars['requesttoken'] = $requesttoken;
		$this->l10n = $l10n;
		$this->template = $template;
		$this->theme = $theme;
	}

	/**
	 * @param string $serverroot
	 * @param string|false $app_dir
	 * @param string $theme
	 * @param string $app
	 */
	protected function getAppTemplateDirs($theme, $app, $serverroot, $app_dir) {
		// Check if the app is in the app folder or in the root
		if( file_exists($app_dir.'/templates/' )) {
			return array(
				$serverroot.'/themes/'.$theme.'/apps/'.$app.'/templates/',
				$app_dir.'/templates/',
			);
		}
		return array(
			$serverroot.'/themes/'.$theme.'/'.$app.'/templates/',
			$serverroot.'/'.$app.'/templates/',
		);
	}

	/**
	 * @param string $serverroot
	 * @param string $theme
	 */
	protected function getCoreTemplateDirs($theme, $serverroot) {
		return array(
			$serverroot.'/themes/'.$theme.'/core/templates/',
			$serverroot.'/core/templates/',
		);
	}

	/**
	 * Assign variables
	 * @param string $key key
	 * @param array|bool|integer|string $value value
	 * @return bool
	 *
	 * This function assigns a variable. It can be accessed via $_[$key] in
	 * the template.
	 *
	 * If the key existed before, it will be overwritten
	 */
	public function assign( $key, $value) {
		$this->vars[$key] = $value;
		return true;
	}

	/**
	 * Appends a variable
	 * @param string $key key
	 * @param mixed $value value
	 * @return boolean|null
	 *
	 * This function assigns a variable in an array context. If the key already
	 * exists, the value will be appended. It can be accessed via
	 * $_[$key][$position] in the template.
	 */
	public function append( $key, $value ) {
		if( array_key_exists( $key, $this->vars )) {
			$this->vars[$key][] = $value;
		}
		else{
			$this->vars[$key] = array( $value );
		}
	}

	/**
	 * Prints the proceeded template
	 * @return bool
	 *
	 * This function proceeds the template and prints its output.
	 */
	public function printPage() {
		$data = $this->fetchPage();
		if( $data === false ) {
			return false;
		}
		else{
			print $data;
			return true;
		}
	}

	/**
	 * Process the template
	 * @return string
	 *
	 * This function processes the template.
	 */
	public function fetchPage() {
		return $this->load($this->template);
	}

	/**
	 * doing the actual work
	 * @param string $file
	 * @return string content
	 *
	 * Includes the template file, fetches its output
	 */
	protected function load( $file, $additionalparams = null ) {
		// Register the variables
		$_ = $this->vars;
		$l = $this->l10n;
		$theme = $this->theme;

		if( !is_null($additionalparams)) {
			$_ = array_merge( $additionalparams, $this->vars );
		}

		// Include
		ob_start();
		include $file;
		$data = ob_get_contents();
		@ob_end_clean();

		// Return data
		return $data;
	}

}
{ color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2013-05-31 01:58+0200\n"
"PO-Revision-Date: 2013-05-30 23:15+0000\n"
"Last-Translator: I Robot <owncloud-bot@tmit.eu>\n"
"Language-Team: Burmese (Myanmar) (http://www.transifex.com/projects/p/owncloud/language/my_MM/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: my_MM\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#: ajax/share.php:97
#, php-format
msgid "User %s shared a file with you"
msgstr ""

#: ajax/share.php:99
#, php-format
msgid "User %s shared a folder with you"
msgstr ""

#: ajax/share.php:101
#, php-format
msgid ""
"User %s shared the file \"%s\" with you. It is available for download here: "
"%s"
msgstr ""

#: ajax/share.php:104
#, php-format
msgid ""
"User %s shared the folder \"%s\" with you. It is available for download "
"here: %s"
msgstr ""

#: ajax/vcategories/add.php:26 ajax/vcategories/edit.php:25
msgid "Category type not provided."
msgstr ""

#: ajax/vcategories/add.php:30
msgid "No category to add?"
msgstr "ထည့်ရန်ခေါင်းစဉ်မရှိဘူးလား"

#: ajax/vcategories/add.php:37
#, php-format
msgid "This category already exists: %s"
msgstr ""

#: ajax/vcategories/addToFavorites.php:26 ajax/vcategories/delete.php:27
#: ajax/vcategories/favorites.php:24
#: ajax/vcategories/removeFromFavorites.php:26
msgid "Object type not provided."
msgstr ""

#: ajax/vcategories/addToFavorites.php:30
#: ajax/vcategories/removeFromFavorites.php:30
#, php-format
msgid "%s ID not provided."
msgstr ""

#: ajax/vcategories/addToFavorites.php:35
#, php-format
msgid "Error adding %s to favorites."
msgstr ""

#: ajax/vcategories/delete.php:35 js/oc-vcategories.js:136
msgid "No categories selected for deletion."
msgstr "ဖျက်ရန်အတွက်ခေါင်းစဉ်မရွေးထားပါ"

#: ajax/vcategories/removeFromFavorites.php:35
#, php-format
msgid "Error removing %s from favorites."
msgstr ""

#: js/config.php:34
msgid "Sunday"
msgstr ""

#: js/config.php:35
msgid "Monday"
msgstr ""

#: js/config.php:36
msgid "Tuesday"
msgstr ""

#: js/config.php:37
msgid "Wednesday"
msgstr ""

#: js/config.php:38
msgid "Thursday"
msgstr ""

#: js/config.php:39
msgid "Friday"
msgstr ""

#: js/config.php:40
msgid "Saturday"
msgstr ""

#: js/config.php:45
msgid "January"
msgstr "ဇန်နဝါရီ"

#: js/config.php:46
msgid "February"
msgstr "ဖေဖော်ဝါရီ"

#: js/config.php:47
msgid "March"
msgstr "မတ်"

#: js/config.php:48
msgid "April"
msgstr "ဧပြီ"

#: js/config.php:49
msgid "May"
msgstr "မေ"

#: js/config.php:50
msgid "June"
msgstr "ဇွန်"

#: js/config.php:51
msgid "July"
msgstr "ဇူလိုင်"

#: js/config.php:52
msgid "August"
msgstr "ဩဂုတ်"

#: js/config.php:53
msgid "September"
msgstr "စက်တင်ဘာ"

#: js/config.php:54
msgid "October"
msgstr "အောက်တိုဘာ"

#: js/config.php:55
msgid "November"
msgstr "နိုဝင်ဘာ"

#: js/config.php:56
msgid "December"
msgstr "ဒီဇင်ဘာ"

#: js/js.js:286
msgid "Settings"
msgstr ""

#: js/js.js:718
msgid "seconds ago"
msgstr "စက္ကန့်အနည်းငယ်က"

#: js/js.js:719
msgid "1 minute ago"
msgstr "၁ မိနစ်အရင်က"

#: js/js.js:720
msgid "{minutes} minutes ago"
msgstr ""

#: js/js.js:721
msgid "1 hour ago"
msgstr "၁ နာရီ အရင်က"

#: js/js.js:722
msgid "{hours} hours ago"
msgstr ""

#: js/js.js:723
msgid "today"
msgstr "ယနေ့"

#: js/js.js:724
msgid "yesterday"
msgstr "မနေ့က"

#: js/js.js:725
msgid "{days} days ago"
msgstr ""

#: js/js.js:726
msgid "last month"
msgstr "ပြီးခဲ့သောလ"

#: js/js.js:727
msgid "{months} months ago"
msgstr ""

#: js/js.js:728
msgid "months ago"
msgstr ""

#: js/js.js:729
msgid "last year"
msgstr "မနှစ်က"

#: js/js.js:730
msgid "years ago"
msgstr "နှစ် အရင်က"

#: js/oc-dialogs.js:117
msgid "Choose"
msgstr "ရွေးချယ်"

#: js/oc-dialogs.js:121
msgid "Cancel"
msgstr "ပယ်ဖျက်မည်"

#: js/oc-dialogs.js:138 js/oc-dialogs.js:195
msgid "Error loading file picker template"
msgstr ""

#: js/oc-dialogs.js:161
msgid "Yes"
msgstr "ဟုတ်"

#: js/oc-dialogs.js:168
msgid "No"
msgstr "မဟုတ်ဘူး"

#: js/oc-dialogs.js:181
msgid "Ok"
msgstr "အိုကေ"

#: js/oc-vcategories.js:5 js/oc-vcategories.js:85 js/oc-vcategories.js:102
#: js/oc-vcategories.js:117 js/oc-vcategories.js:132 js/oc-vcategories.js:162
msgid "The object type is not specified."
msgstr ""

#: js/oc-vcategories.js:14 js/oc-vcategories.js:80 js/oc-vcategories.js:95
#: js/oc-vcategories.js:110 js/oc-vcategories.js:125 js/oc-vcategories.js:136
#: js/oc-vcategories.js:172 js/oc-vcategories.js:189 js/oc-vcategories.js:195
#: js/oc-vcategories.js:199 js/share.js:136 js/share.js:143 js/share.js:577
#: js/share.js:589
msgid "Error"
msgstr ""

#: js/oc-vcategories.js:179
msgid "The app name is not specified."
msgstr ""

#: js/oc-vcategories.js:194
msgid "The required file {file} is not installed!"
msgstr ""

#: js/share.js:30 js/share.js:45 js/share.js:87
msgid "Shared"
msgstr ""

#: js/share.js:90
msgid "Share"
msgstr ""

#: js/share.js:125 js/share.js:617
msgid "Error while sharing"
msgstr ""

#: js/share.js:136
msgid "Error while unsharing"
msgstr ""

#: js/share.js:143
msgid "Error while changing permissions"
msgstr ""

#: js/share.js:152
msgid "Shared with you and the group {group} by {owner}"
msgstr ""

#: js/share.js:154
msgid "Shared with you by {owner}"
msgstr ""

#: js/share.js:159
msgid "Share with"
msgstr ""

#: js/share.js:164
msgid "Share with link"
msgstr ""

#: js/share.js:167
msgid "Password protect"
msgstr ""

#: js/share.js:169 templates/installation.php:54 templates/login.php:26
msgid "Password"
msgstr "စကားဝှက်"

#: js/share.js:173
msgid "Email link to person"
msgstr ""

#: js/share.js:174
msgid "Send"
msgstr ""

#: js/share.js:178
msgid "Set expiration date"
msgstr "သက်တမ်းကုန်ဆုံးမည့်ရက်သတ်မှတ်မည်"

#: js/share.js:179
msgid "Expiration date"
msgstr "သက်တမ်းကုန်ဆုံးမည့်ရက်"

#: js/share.js:211
msgid "Share via email:"
msgstr "အီးမေးလ်ဖြင့်ဝေမျှမည် -"

#: js/share.js:213
msgid "No people found"
msgstr ""

#: js/share.js:251
msgid "Resharing is not allowed"
msgstr "ပြန်လည်ဝေမျှခြင်းခွင့်မပြုပါ"

#: js/share.js:287
msgid "Shared in {item} with {user}"
msgstr ""

#: js/share.js:308
msgid "Unshare"
msgstr ""

#: js/share.js:320
msgid "can edit"
msgstr "ပြင်ဆင်နိုင်"

#: js/share.js:322
msgid "access control"
msgstr ""

#: js/share.js:325
msgid "create"
msgstr "ဖန်တီးမည်"

#: js/share.js:328
msgid "update"
msgstr ""

#: js/share.js:331
msgid "delete"
msgstr "ဖျက်မည်"

#: js/share.js:334
msgid "share"
msgstr "ဝေမျှမည်"

#: js/share.js:368 js/share.js:564
msgid "Password protected"
msgstr "စကားဝှက်ဖြင့်ကာကွယ်ထားသည်"

#: js/share.js:577
msgid "Error unsetting expiration date"
msgstr ""

#: js/share.js:589
msgid "Error setting expiration date"
msgstr ""

#: js/share.js:604
msgid "Sending ..."
msgstr ""

#: js/share.js:615
msgid "Email sent"
msgstr ""

#: js/update.js:14
msgid ""
"The update was unsuccessful. Please report this issue to the <a "
"href=\"https://github.com/owncloud/core/issues\" target=\"_blank\">ownCloud "
"community</a>."
msgstr ""

#: js/update.js:18
msgid "The update was successful. Redirecting you to ownCloud now."
msgstr ""

#: lostpassword/controller.php:48
msgid "ownCloud password reset"
msgstr ""

#: lostpassword/templates/email.php:2
msgid "Use the following link to reset your password: {link}"
msgstr ""

#: lostpassword/templates/lostpassword.php:4
msgid ""
"The link to reset your password has been sent to your email.<br>If you do "
"not receive it within a reasonable amount of time, check your spam/junk "
"folders.<br>If it is not there ask your local administrator ."
msgstr ""

#: lostpassword/templates/lostpassword.php:12
msgid "Request failed!<br>Did you make sure your email/username was right?"
msgstr ""

#: lostpassword/templates/lostpassword.php:15
msgid "You will receive a link to reset your password via Email."
msgstr "အီးမေးလ်မှတစ်ဆင့် သင်၏စကားဝှက်ကို ပြန်ဖော်ရန်အတွက် Link တစ်ခုလက်ခံရရှိပါလိမ့်မယ်။"

#: lostpassword/templates/lostpassword.php:18 templates/installation.php:48
#: templates/login.php:19
msgid "Username"
msgstr "သုံးစွဲသူအမည်"

#: lostpassword/templates/lostpassword.php:21
msgid "Request reset"
msgstr ""

#: lostpassword/templates/resetpassword.php:4
msgid "Your password was reset"
msgstr "သင်၏စကားဝှက်ကိုပြန်ဖော်ပြီးပါပြီ။"

#: lostpassword/templates/resetpassword.php:5
msgid "To login page"
msgstr "ဝင်ရောက်သည့်စာမျက်နှာသို့"

#: lostpassword/templates/resetpassword.php:8
msgid "New password"
msgstr "စကားဝှက်အသစ်"

#: lostpassword/templates/resetpassword.php:11
msgid "Reset password"
msgstr ""

#: strings.php:5
msgid "Personal"
msgstr ""

#: strings.php:6
msgid "Users"
msgstr "သုံးစွဲသူ"

#: strings.php:7
msgid "Apps"
msgstr "Apps"

#: strings.php:8
msgid "Admin"
msgstr "အက်ဒမင်"

#: strings.php:9
msgid "Help"
msgstr "အကူအညီ"

#: templates/403.php:12
msgid "Access forbidden"
msgstr ""

#: templates/404.php:12
msgid "Cloud not found"
msgstr "မတွေ့ရှိမိပါ"

#: templates/edit_categories_dialog.php:4
msgid "Edit categories"
msgstr ""

#: templates/edit_categories_dialog.php:16
msgid "Add"
msgstr "ပေါင်းထည့်"

#: templates/installation.php:24 templates/installation.php:31
#: templates/installation.php:38
msgid "Security Warning"
msgstr "လုံခြုံရေးသတိပေးချက်"

#: templates/installation.php:25
msgid "Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)"
msgstr ""

#: templates/installation.php:26
msgid "Please update your PHP installation to use ownCloud securely."
msgstr ""

#: templates/installation.php:32
msgid ""
"No secure random number generator is available, please enable the PHP "
"OpenSSL extension."
msgstr ""

#: templates/installation.php:33
msgid ""
"Without a secure random number generator an attacker may be able to predict "
"password reset tokens and take over your account."
msgstr ""

#: templates/installation.php:39
msgid ""
"Your data directory and files are probably accessible from the internet "
"because the .htaccess file does not work."
msgstr ""

#: templates/installation.php:40
msgid ""
"For information how to properly configure your server, please see the <a "
"href=\"http://doc.owncloud.org/server/5.0/admin_manual/installation.html\" "
"target=\"_blank\">documentation</a>."
msgstr ""

#: templates/installation.php:44
msgid "Create an <strong>admin account</strong>"
msgstr "<strong>အက်ဒမင်အကောင့်</strong>တစ်ခုဖန်တီးမည်"

#: templates/installation.php:62
msgid "Advanced"
msgstr "အဆင့်မြင့်"

#: templates/installation.php:64
msgid "Data folder"
msgstr "အချက်အလက်ဖိုလ်ဒါလ်"

#: templates/installation.php:74
msgid "Configure the database"
msgstr ""

#: templates/installation.php:79 templates/installation.php:91
#: templates/installation.php:102 templates/installation.php:113
#: templates/installation.php:125
msgid "will be used"
msgstr ""

#: templates/installation.php:137
msgid "Database user"
msgstr "Database သုံးစွဲသူ"

#: templates/installation.php:144
msgid "Database password"
msgstr "Database စကားဝှက်"

#: templates/installation.php:149
msgid "Database name"
msgstr "Database အမည်"

#: templates/installation.php:159
msgid "Database tablespace"
msgstr ""

#: templates/installation.php:166
msgid "Database host"
msgstr ""

#: templates/installation.php:172
msgid "Finish setup"
msgstr "တပ်ဆင်ခြင်းပြီးပါပြီ။"

#: templates/layout.guest.php:40
msgid "web services under your control"
msgstr "သင်၏ထိန်းချုပ်မှု့အောက်တွင်ရှိသော Web services"

#: templates/layout.user.php:37
#, php-format
msgid "%s is available. Get more information on how to update."
msgstr ""

#: templates/layout.user.php:62
msgid "Log out"
msgstr ""

#: templates/login.php:9
msgid "Automatic logon rejected!"
msgstr ""

#: templates/login.php:10
msgid ""
"If you did not change your password recently, your account may be "
"compromised!"
msgstr ""

#: templates/login.php:12
msgid "Please change your password to secure your account again."
msgstr ""

#: templates/login.php:34
msgid "Lost your password?"
msgstr "သင်၏စကားဝှက်ပျောက်သွားပြီလား။"

#: templates/login.php:39
msgid "remember"
msgstr "မှတ်မိစေသည်"

#: templates/login.php:41
msgid "Log in"
msgstr "ဝင်ရောက်ရန်"

#: templates/login.php:47
msgid "Alternative Logins"
msgstr ""

#: templates/part.pagenavi.php:3
msgid "prev"
msgstr "ယခင်"

#: templates/part.pagenavi.php:20
msgid "next"
msgstr "နောက်သို့"

#: templates/update.php:3
#, php-format
msgid "Updating ownCloud to version %s, this may take a while."
msgstr ""