本文整理汇总了PHP中Language::DirectTranslate方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::DirectTranslate方法的具体用法?PHP Language::DirectTranslate怎么用?PHP Language::DirectTranslate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::DirectTranslate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
public function load()
{
$this->headline = Language::DirectTranslate("plugin_menulistwidget_menus");
if (Cache::contains("menu", "widget_" . $_GET['dir'])) {
$this->content = Cache::getData("menu", "widget_" . $_GET['dir']);
} else {
if (!isset($_GET['dir']) || substr($_GET['dir'], 0, 1) == '.') {
$_GET['dir'] = "";
}
$template = new Template();
$template->load("plugin_menulistwidget_menulist");
$newmenuurl = UrlRewriting::GetUrlByAlias("admin/newmenu");
$template->assign_var("NEWMENUURL", $newmenuurl);
$menus = sys::getMenues($_GET['dir']);
foreach ($menus as $menu) {
$index = $template->add_loop_item("MENUS");
$template->assign_loop_var("MENUS", $index, "ID", $menu->id);
$template->assign_loop_var("MENUS", $index, "TITLE", $menu->name);
$template->assign_loop_var("MENUS", $index, "PAGES", $menu->count);
$editurl = UrlRewriting::GetUrlByAlias("admin/editmenu", "menu=" . $menu->id);
$template->assign_loop_var("MENUS", $index, "EDITURL", $editurl);
$deleteurl = UrlRewriting::GetUrlByAlias("admin/deletemenu", "menu=" . $menu->id);
$template->assign_loop_var("MENUS", $index, "DELETEURL", $deleteurl);
}
if (!$menus) {
$template->assign_var("NOMENUS", Language::DirectTranslate("plugin_menulistwidget_no_menus"));
} else {
$template->assign_var("NOMENUS", "");
}
$this->content = $template->getCode();
Cache::setData("menu", "widget_" . $_GET['dir'], $this->content);
}
}
示例2: display
public function display()
{
?>
<h2>Login</h2>
<?php
if (isset($_POST['name']) && $_POST['name']) {
if (User::Current()->login($_POST['name'], $_POST['password'])) {
echo Language::DirectTranslate("HELLO") . " " . User::Current()->name;
?>
<script language="JavaScript"><!--
var zeit=(new Date()).getTime();
var stoppZeit=zeit+4000;
while((new Date()).getTime()<stoppZeit){};
window.location.href="<?php
echo UrlRewriting::GetUrlByAlias("admin/home");
?>
";
// --></script>
<?php
} else {
echo Language::DirectTranslate("LOGIN_FAILED");
}
}
if (User::Current()->isGuest()) {
?>
<form method="POST">
<table>
<tr>
<td><?php
echo Language::DirectTranslate("USERNAME");
?>
:</td>
<td><input name="name" autofocus /></td>
</tr>
<tr>
<td><?php
echo Language::DirectTranslate("PASSWORD");
?>
:</td>
<td> <input name="password" type="password" /></td>
</tr>
</table>
<input type="submit" value="Login" />
</form>
<?php
} else {
?>
<script language="JavaScript"><!--
window.location.href="<?php
echo UrlRewriting::GetUrlByAlias("admin/home");
?>
";
// --></script>
<?php
}
}
示例3: getEditableCode
public function getEditableCode()
{
Cache::clear();
$change = htmlentities(Language::GetGlobal()->getString("CHANGE"));
$plugin_contactform_res = "<h3>" . Language::DirectTranslate("plugin_contactform_pagetypetitle") . "</h3>";
$settings = Settings::getRootInstance()->specify("plugin", "contactform");
if ($settings->get("contactform_mail") == "") {
$plugin_contactform_res .= "<p><a href=\"" . Settings::getInstance()->get("host") . "admin/pluginsettings.html?plugin=contactform\">" . Language::DirectTranslate("plugin_contactform_nomailfound") . "</a></p>";
}
$plugin_contactform_res .= "<input name=\"save\" type=\"submit\" value=\"" . $change . "\" onclick=\"form.action='" . UrlRewriting::GetUrlByAlias("admin/pageedit", "site=" . $this->page->alias) . "' ; target='_self' ; return true\" />";
return $plugin_contactform_res;
}
示例4: load
public function load()
{
$dir = '';
if (isset($_GET['dir']) && substr($_GET['dir'], 0, 1) != '.') {
$dir = $_GET['dir'];
}
$this->headline = Language::DirectTranslate("plugin_pagelistwidget_pages");
if (Cache::contains("page", "widget_" . $dir)) {
$this->content = Cache::getData("page", "widget_" . $dir);
} else {
$template = new Template();
$template->load("plugin_pagelistwidget_pagelist");
$pages = Page::getPagesByDir($dir);
if (substr($dir, 0, 1) == "/") {
$shortdir = substr($dir, 1);
} else {
$shortdir = $dir;
}
if ($pages) {
foreach ($pages as $page) {
$shortalias = substr($page->alias, strlen($shortdir));
if (substr($shortalias, 0, 1) == "/") {
$shortalias = substr($shortalias, 1);
} else {
$shortalias = $shortalias;
}
if (!strpos($shortalias, "/")) {
$host = Settings::getInstance()->get("host");
$index = $template->add_loop_item("PAGES");
$template->assign_loop_var("PAGES", $index, "TITLE", $page->title);
$template->assign_loop_var("PAGES", $index, "ALIAS", $shortalias);
$editurl = UrlRewriting::GetUrlByAlias("admin/pageedit", "site=" . $page->alias);
$template->assign_loop_var("PAGES", $index, "EDITURL", $editurl);
$deleteurl = UrlRewriting::GetUrlByAlias("admin/pagedelete", "site=" . $page->alias);
$template->assign_loop_var("PAGES", $index, "DELETEURL", $deleteurl);
$showurl = UrlRewriting::GetUrlByAlias($page->alias);
$template->assign_loop_var("PAGES", $index, "SHOWURL", $showurl);
}
}
$template->assign_var("NOPAGES", "");
} else {
$template->assign_var("NOPAGES", Language::DirectTranslate("plugin_pagelistwidget_no_pages"));
}
$this->content = $template->getCode();
if (isset($_GET['dir'])) {
Cache::setData("page", "widget_" . $_GET['dir'], $this->content);
}
}
}
示例5: load
public function load()
{
$this->headline = Language::DirectTranslate("plugin_formlistwidget_forms");
if (isset($_POST['plugin_formlistwidget_deleteid'])) {
$form = new Form($_POST['plugin_formlistwidget_deleteid']);
$form->Delete();
}
$template = new Template();
$template->load("plugin_formlistwidget_formlist");
$forms = Form::getByDir($_GET['dir']);
if ($forms) {
foreach ($forms as $form) {
$index = $template->add_loop_item("FORMS");
$template->assign_loop_var("FORMS", $index, "NAME", $form->name);
$template->assign_loop_var("FORMS", $index, "EDITURL", UrlRewriting::GetUrlByAlias("admin/formedit", "form=" . $form->id));
$template->assign_loop_var("FORMS", $index, "ID", $form->id);
}
$template->assign_var("NOFORMS", "");
} else {
$template->assign_var("NOFORMS", Language::DirectTranslate("plugin_formlistwidget_no_forms"));
}
$this->content = $template->getCode();
}
示例6: load
public function load()
{
$this->headline = "Updater";
include_once 'interfaces/iupdateimporter.php';
include_once 'interfaces/iupdatecommand.php';
if (Cache::contains("packages", "all")) {
$installedPackages = $this->content = Cache::getData("packages", "all");
} else {
$installedPackages = Plugin_Updater_Package::readFromDB();
Cache::setData("packages", "all", $installedPackages);
}
$path = "http://connect.contentlion.org/update.php?format=xml";
$i = 0;
if (is_array($installedPackages)) {
foreach ($installedPackages as $package) {
$path .= "&" . $package->getUpdateToken($i);
$i++;
}
}
$importer = new Plugin_Updater_UpdateXmlImporter();
$importer->importPath($path);
if ($importer->areUpdatesAvailible()) {
$host = Settings::getInstance()->get("host");
foreach ($importer->getUpdates() as $update) {
if (isset($_GET['update']) && $_GET['update'] == $update->getName()) {
$this->content .= "<br />" . Language::DirectTranslate("install_it") . " " . $update->getName() . "...";
$update->runUpdate();
Cache::clear();
$this->content .= "<br />" . htmlentities(Language::DirectTranslate("plugin_updater_install_complete"));
} else {
$this->content .= "<br />" . $update->getName() . " - <a href='" . $host . "admin/home.html?update=" . $update->getName() . "'>" . Language::DirectTranslate("plugin_updater_install") . "</a>";
}
}
} else {
$this->content = Language::DirectTranslate("plugin_updater_no_updates");
}
}
示例7: getEditableCode
/**
*
* @return string
*/
public function getEditableCode()
{
return '<p><input name="save" type="submit" value="' . Language::DirectTranslate("change") . '" onclick="form.action=\'' . UrlRewriting::GetUrlByAlias("admin/pageedit", "site=" . $this->page->alias) . '\' ; target=\'_self\' ; return true" /></p>';
}
示例8: getEditableCode
/**
*
* @return string
*/
public function getEditableCode()
{
return "<input name=\"save\" type=\"submit\" value=\"" . htmlentities(Language::DirectTranslate("CHANGE")) . "\" onclick=\"form.action='" . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'] . "' ; target='_self' ; return true\" />";
}
示例9: checkUploadFile
/**
*
* @param string $file
* @return boolean
*/
protected static function checkUploadFile($file)
{
$res = true;
self::$uploadFailure = "";
switch ($file['error']) {
case 0:
break;
case 1:
$res = false;
self::$uploadFailure = str_replace("{VAR:MAX_FILESIZE}", ini_get('upload_max_filesize'), Language::DirectTranslate("UPlOAD_FAILED_SIZE"));
break;
case 2:
$res = false;
self::$uploadFailure = str_replace("{VAR:MAX_FILESIZE}", IMAGE_MAX_IMAGE_SIZE, Language::DirectTranslate("UPlOAD_FAILED_IMAGE_SIZE"));
break;
case 3:
$res = false;
self::$uploadFailure = Language::DirectTranslate("UPlOAD_FAILED_PARTIALLY");
case 4:
$res = false;
self::$uploadFailure = Language::DirectTranslate("UPlOAD_FAILED_NONE");
}
return $res;
}
示例10: getEditableCode
/**
*
* @return string
*/
public function getEditableCode()
{
$url = UrlRewriting::GetUrlByAlias("admin/pageedit", "site=" . $this->page->alias);
return "<input name=\"save\" type=\"submit\" value=\"" . htmlentities(Language::DirectTranslate("CHANGE")) . "\" onclick=\"form.action='" . $url . "' ; target='_self' ; return true\" />";
}
示例11: replaceLanguageTokensByObject
/**
*
* @param mixed $obj
* @return mixed
*/
public function replaceLanguageTokensByObject($obj)
{
if ($obj) {
foreach ($obj as $key => $value) {
preg_match_all("/{LANG:([^}]+)}/", $value, $tokens, PREG_SET_ORDER);
foreach ($tokens as $token) {
$translation = Language::DirectTranslate($token[1]);
$obj->{$key} = str_ireplace($token[0], $translation, $obj->{$key});
}
}
}
return $obj;
}
示例12: replaceLanguageTokens
private function replaceLanguageTokens()
{
preg_match_all("/{LANG:(.+)}/", $this->template, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$translation = htmlentities(Language::DirectTranslate($match[1]));
$this->template = str_ireplace($match[0], $translation, $this->template);
}
}
示例13:
<div id="nav" class="box">
<?php
sys::displayGlobalMenu("<ul>", "</ul>", "<li>", " </li>", "");
?>
<!-- SEARCH -->
<form action="./suchen.html" method="post" id="search">
<div class="relative">
<div id="search-input"><input type="text" size="30" name="q" class="input-text" value="" placeholder="<?php
echo Language::DirectTranslate("plugin_search_placeholder");
?>
" /></div>
<div id="search-submit"><input name="searchstart" type="image" src="<?php
echo sys::getFullSkinPath();
?>
design/search-submit.png" value="<?php
echo Language::DirectTranslate("plugin_search_searchstart");
?>
" /></div>
</div> <!-- /relative -->
</form>
</div> <!-- /nav -->
<!-- TRAY -->
<div id="tray" class="box">
<p class="f-right">
<a href="#"><img src="<?php
echo sys::getFullSkinPath();
?>
design/ico-twitter.png" alt="Twitter" /></a>
<a href="#"><img src="<?php
echo sys::getFullSkinPath();
?>
示例14: Template
<?php
Cache::clear();
$settings = Settings::getRootInstance()->specify("plugin", "contactform");
$plugin_contactform_mail = $settings->get("contactform_mail");
$plugin_contactform_successmessage = $settings->get("contactform_successmessage");
if (isset($_POST['mail'])) {
Cache::clear();
if ($plugin_contactform_mail != $_POST['mail']) {
$settings->set("contactform_mail", $_POST['mail']);
}
if ($plugin_contactform_successmessage != $_POST['successmessage']) {
$settings->set("contactform_successmessage", $_POST['successmessage']);
}
$plugin_contactform_mail = $_POST['mail'];
$plugin_contactform_successmessage = $_POST['successmessage'];
Settings::forceReload();
echo Language::DirectTranslate("plugin_contactform_plugincontactformsaved");
}
$template = new Template();
$template->load("plugin_contactform_settings");
$template->assign_var("mail", htmlentities($plugin_contactform_mail));
$template->assign_var("successmessage", htmlentities($plugin_contactform_successmessage));
$template->output();
示例15: elseif
$plugin_analytics_system = "google";
} elseif (isset($_POST["analyticssystem"]) && $_POST["analyticssystem"] == "piwik") {
$plugin_analytics_system = "piwik";
}
$plugin_analytics_value = $settings->get("analytics_value", null, false);
if (isset($_POST['analytivssave'])) {
Cache::clear();
if ($settings->get("analytics_system", null, false) != $_POST["analyticssystem"]) {
$settings->set("analytics_system", $_POST["analyticssystem"]);
}
if ($plugin_analytics_value != $_POST["analyticsvalue"]) {
$settings->set("analytics_value", $_POST["analyticsvalue"]);
}
Cache::clear();
Settings::forceReload();
echo Language::DirectTranslate("plugin_analytics_saved");
}
unset($plugin_analytics_value);
$plugin_analytics_value = $settings->get("analytics_value", null, false);
if ($plugin_analytics_system == "google") {
Cache::clear();
$template->assign_var("SELECTEDGOOGLE", " selected=\"selected\"");
$template->assign_var("GOOGLEID", htmlentities($plugin_analytics_value));
$template->show_if("SHOWGOOGLE", true);
$template->show_if("SHOWPIWIK", false);
} elseif ($plugin_analytics_system == "piwik") {
Cache::clear();
$template->assign_var("SELECTEDPIWIK", " selected=\"selected\"");
$template->assign_var("PIWIKURL", htmlentities($plugin_analytics_value));
$template->show_if("SHOWGOOGLE", false);
$template->show_if("SHOWPIWIK", true);