本文整理汇总了PHP中Language::GetGlobal方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::GetGlobal方法的具体用法?PHP Language::GetGlobal怎么用?PHP Language::GetGlobal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::GetGlobal方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCode
/**
*
* @return string
*/
public function getCode()
{
$res = "";
if ($this->cacheName != "" && Cache::contains("tables", $this->cacheName)) {
$res = Cache::getData("tables", $this->cacheName);
} else {
$res = "<table class='datatable'>";
$this->columns->actions = $this->actions;
$res .= $this->columns->getHeaderCode();
$res .= "<tbody>";
$rows_found = false;
if ($rows = DataBase::Current()->ReadRows($this->getSelect())) {
foreach ($rows as $row) {
$rows_found = true;
$res .= $this->columns->getBodyCode($row);
}
}
if (!$rows_found) {
$text = Language::GetGlobal()->Translate($this->noDataText);
$res .= "<tr><td colspan='" . $this->columns->count() . "'>" . htmlentities($text) . "</td></tr>";
}
$res .= "</tbody>";
$res .= "</table>";
if ($this->cacheName) {
Cache::setData("tables", $this->cacheName, $res);
}
}
return $res;
}
示例2: getDescription
/**
*
* @return string description of the plugin
*/
public function getDescription()
{
$res = "";
$tokens = array();
@(include Settings::getValue("root") . "system/plugins/" . $this->path . "/languages/" . strtolower(Language::GetGlobal()->language) . ".php");
if (isset($tokens['plugin_description'])) {
$res = $tokens['plugin_description'];
}
return $res;
}
示例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: displayEvents
private function displayEvents()
{
echo "<h2>" . Language::DirectTranslateHtml("EVENTS") . "</h2>";
$table = new Table();
$name = new TableColumn("UPPER(name)", "Name");
$table->columns->add($name);
$description = new TableColumn("CONCAT('{LANG:',UPPER(name),'_EVENTDESCRIPTION}')", Language::GetGlobal()->getString("WILL_BE_RAISED"));
$description->autoWidth = true;
$table->columns->add($description);
$table->condition = "dataType = '" . DataBase::Current()->EscapeString($_GET['show']) . "'";
$table->name = "{'dbprefix'}datatype_events";
$table->orderBy = "name";
$table->display();
}
示例5: getEditableCode
/**
*
* @return string
*/
public function getEditableCode()
{
$selected_301 = "";
$selected_302 = "";
if ($this->data['type'] == 301) {
$selected_301 = " selected=\"selected\"";
}
if ($this->data['type'] == 302) {
$selected_302 = " selected=\"selected\"";
}
$res = "\n <table style=\"width:80%\">\n <tr>\n <td style=\"width:100px\">" . Language::DirectTranslateHtml("TYPE") . ":</td>\n <td>\n <select name=\"redirect_type\">\n <option value=\"301\"" . $selected_301 . ">301 - " . Language::DirectTranslateHtml("MOVED_PERMANENTLY") . "</option>\n <option value=\"302\"" . $selected_302 . ">302 - " . Language::DirectTranslateHtml("MOVED_TEMPORARY") . "</option>\n </select>\n </td>\n </tr>\n <tr>\n <td>Ziel:</td>\n <td>\n <input type=\"url\" name=\"redirect_location\" style=\"width:80%\" value=\"" . $this->data['location'] . "\" />\n </td>\n </tr>\n </table>";
$change = htmlentities(Language::GetGlobal()->getString("CHANGE"));
return $res . "<input name=\"save\" type=\"submit\" value=\"" . $change . "\" target='_self' ; return true\" />";
}
示例6: display
public function display()
{
$page = new Page();
$page->loadProperties(DataBase::Current()->EscapeString($_GET['site']));
$host = Settings::getInstance()->get("host");
if (!isset($_GET['delete'])) {
$template = new Template();
$template->load("site_delete");
$template->assign_var("TITLE", $page->title);
$home = UrlRewriting::GetUrlByAlias("admin/home");
$template->assign_var("SITESURL", $home);
$delete = UrlRewriting::GetUrlByAlias("admin/pagedelete", "site=" . urlencode($_GET['site']) . "&delete=true");
$template->assign_var("DELETEURL", $delete);
$template->output();
} else {
if ($page->delete()) {
$template = new Template();
$template->load("message");
$message = str_ireplace("{VAR:TITLE}", $page->title, Language::GetGlobal()->getString("PAGE_DELETED"));
$template->assign_var("MESSAGE", $message);
$template->output();
}
}
}
示例7: __destruct
public function __destruct()
{
if ($this->changed) {
Cache::clear();
Language::GetGlobal()->ClearCache();
}
}
示例8: getEditableCode
/**
*
* @return string
*/
public function getEditableCode()
{
$change = htmnlentities(Language::GetGlobal()->getString("CHANGE"));
return "<input name=\"save\" type=\"submit\" value=\"" . $change . "\" onclick=\"form.action='" . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'] . "' ; target='_self' ; return true\" />";
}
示例9: display
public function display()
{
if (!isset($_POST['localalias'])) {
$template = new Template();
$template->load("site_new");
$template->assign_var("URL", $this->page->GetUrl());
if (!isset($_POST['alias'])) {
$_POST['alias'] = "";
}
$template->assign_var("ALIAS", $_POST['alias']);
if (substr($_SESSION['dir'], 0, 1) == "/" && $_SESSION['dir'] != "/") {
$template->assign_var("DIR", substr($_SESSION['dir'], 1) . "/");
} else {
if ($_SESSION['dir'] == '' || $_SESSION['dir'] == "/") {
$template->assign_var("DIR", "");
} else {
$template->assign_var("DIR", $_SESSION['dir'] . "/");
}
}
$template->assign_var("HOST", Settings::getInstance()->get("host"));
$template->assign_var("ENDING", ".html");
$types = Page::getPagesTypes();
if ($types) {
foreach ($types as $type) {
$index = $template->add_loop_item("TYPES");
$template->assign_loop_var("TYPES", $index, "CLASS", $type->class);
$template->assign_loop_var("TYPES", $index, "NAME", $type->name);
}
}
$template->output();
} else {
if ($_SESSION['dir']) {
$dir = DataBase::Current()->EscapeString($_SESSION['dir']) . "/";
} else {
$dir = "";
}
if (substr($dir, 0, 1) == "/") {
$dir = substr($dir, 1);
}
if ($this->isValidPagename($_POST['localalias'])) {
$id = Page::create($dir . DataBase::Current()->EscapeString($_POST['localalias']), DataBase::Current()->EscapeString($_POST['type']), $_POST['title']);
if ($id) {
$template = new Template();
$template->load("site_new_succeeded");
$url = UrlRewriting::GetUrlByAlias("admin/pageedit", "site=" . $dir . $_POST['localalias']);
$template->assign_var("URL", $url);
$template->output();
} else {
$failed = true;
}
} else {
$failed = true;
}
if (isset($failed)) {
$template = new Template();
$template->load("message");
$template->assign_var("MESSAGE", Language::GetGlobal()->getString("PAGE_NOT_CREATED"));
$template->output();
}
}
}
示例10: ReadRows
/**
*
* @param string $sql
* @return array
*/
public function ReadRows($sql)
{
$this->queries++;
$res = array();
$mysqlRes = $this->Execute($sql);
while ($row = $mysqlRes->fetch_object()) {
if (!Language::IsLoading()) {
$row = Language::GetGlobal()->replaceLanguageTokensByObject($row);
}
$res[] = $row;
}
unset($mysqlRes);
return $res;
}
示例11: getEditableCode
/**
*
* @return string
*/
public function getEditableCode()
{
$change = htmlentities(Language::GetGlobal()->getString("CHANGE"));
return "<input name=\"save\" type=\"submit\" value=\"" . $change . "\" onclick=\"form.action='" . UrlRewriting::GetUrlByAlias("admin/pageedit", "site=" . $this->page->alias) . "' ; target='_self' ; return true\" />";
}