本文整理汇总了PHP中e107::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getLanguage方法的具体用法?PHP e107::getLanguage怎么用?PHP e107::getLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: languagelinks_shortcode
/**
* Example usage:
* <code>
* <?php
* $SOME_TEMPLATE = '{LANGUAGELINKS}'; // render default (available) lan list, include current query string
* </code>
*
* <code>
* <?php
* $SOME_TEMPLATE = '{LANGUAGELINKS=English,Bulgarian}'; // render custom lan list, include current query string
* </code>
*
* <code>
* <?php
* $SOME_TEMPLATE = '{LANGUAGELINKS=English,Bulgarian|noquery}'; // render custom lan list, exclude query
* </code>
*
* <code>
* <?php
* $SOME_TEMPLATE = '{LANGUAGELINKS=|home}'; // render default (available) lan list, point always to site index
* </code>
*
* @param string $parm
*/
function languagelinks_shortcode($parm = '')
{
if (!defined('LANGLINKS_SEPARATOR')) {
define('LANGLINKS_SEPARATOR', ' | ');
}
$tmp = explode('|', $parm, 2);
$parm = $tmp[0];
$parms = array();
if (isset($tmp[1])) {
parse_str($tmp[1], $parms);
}
// ignore Query string if required by parms or external code, false by default
if (!defined('LANGLINKS_NOQUERY')) {
define('LANGLINKS_NOQUERY', isset($parms['noquery']));
}
if (!defined('LANGLINKS_HOME')) {
define('LANGLINKS_HOME', isset($parms['home']));
}
/*require_once(e_HANDLER.'language_class.php');
$slng = new language;*/
$slng = e107::getLanguage();
if (!empty($parm)) {
$languageList = explode(',', $parm);
} else {
$languageList = $slng->installed();
sort($languageList);
}
if (count($languageList) < 2) {
return;
}
foreach ($languageList as $languageFolder) {
$code = $slng->convert($languageFolder);
$name = $slng->toNative($languageFolder);
//$subdom = (isset($cursub[2])) ? $cursub[0] : '';
if (e107::getPref('multilanguage_subdomain')) {
$code = $languageFolder == e107::getPref('sitelanguage') ? 'www' : $code;
if (LANGLINKS_HOME) {
$link = str_replace($_SERVER['HTTP_HOST'], $code . '.' . e_DOMAIN, SITEURL);
} else {
$link = !LANGLINKS_NOQUERY ? str_replace($_SERVER['HTTP_HOST'], $code . '.' . e_DOMAIN, e_REQUEST_URL) : str_replace($_SERVER['HTTP_HOST'], $code . '.' . e_DOMAIN, e_REQUEST_SELF);
// excludes query string
}
} else {
// TODO - switch to elan=Language query when possible (now it'll break the old DOT query string format)
if (LANGLINKS_HOME) {
$link = SITEURL . '?elan=' . $code;
} else {
$e_QUERY = str_replace('[' . e_MENU . ']', "", e_QUERY);
$link = !LANGLINKS_NOQUERY ? e_REQUEST_SELF . '?[' . $code . ']' . $e_QUERY : e_REQUEST_SELF . '?elan=' . $code;
}
}
$class = $languageFolder == e_LANGUAGE ? 'languagelink_active' : 'languagelink';
$ret[] = "\n<a class='{$class}' href='{$link}'>{$name}</a>";
}
return implode(LANGLINKS_SEPARATOR, $ret);
}
示例2: copyUserData
/**
* Copy data read from the DB into the record to be returned.
* $target - e107_users table
* $source - phpbb_user table : https://wiki.phpbb.com/Table.phpbb_users
*/
function copyUserData(&$target, &$source)
{
// if ($this->copyUserInfo)
$target['user_id'] = $source['user_id'];
$target['user_name'] = $source['username'];
$target['user_loginname'] = $source['username'];
$target['user_password'] = $this->convertPassword($source['user_password']);
$target['user_email'] = $source['user_email'];
$target['user_signature'] = $this->convertText($source['user_sig']);
$target['user_image'] = $source['user_avatar'];
$target['user_hideemail'] = $source['user_allow_viewemail'];
$target['user_join'] = $source['user_regdate'];
$target['user_lastvisit'] = $source['user_lastvisit'];
$target['user_currentvisit'] = 0;
$target['user_admin'] = 0;
// $source['user_level'];
$target['user_lastpost'] = $source['user_lastpost_time'];
$target['user_chats'] = '';
$target['user_comments'] = '';
$target['user_ip'] = $source['user_ip'];
$target['user_ban'] = $this->convertUserBan($source['user_type']);
$target['user_prefs'] = '';
$target['user_visits'] = '';
$target['user_admin'] = $source['group_id'] == 5 || $source['user_type'] == 3 ? 1 : 0;
//user_type == 3 is 'founder'
$target['user_login'] = '';
$target['user_class'] = $this->convertUserclass($source['group_id']);
$target['user_perms'] = $source['user_type'] == 3 ? '0' : '';
$target['user_realm'] = '';
$target['user_pwchange'] = $source['user_passchg'];
$target['user_xup'] = '';
// Extended Fields.
$target['user_plugin_forum_viewed'] = 0;
$target['user_plugin_forum_posts'] = $source['user_posts'];
$target['user_timezone'] = $source['user_timezone'];
// source is decimal(5,2)
$target['user_language'] = e107::getLanguage()->convert($source['user_lang']);
// convert from 2-letter to full.
$target['user_location'] = $source['user_from'];
$target['user_icq'] = $source['user_icq'];
$target['user_aim'] = $source['user_aim'];
$target['user_yahoo'] = $source['user_yim'];
$target['user_msn'] = $source['user_msnm'];
$target['user_homepage'] = $source['user_website'];
$target['user_birthday'] = $this->convertBirthday($source['user_birthday']);
$target['user_occupation'] = $source['user_occ'];
$target['user_interests'] = $source['user_interests'];
return $target;
}
示例3: showLanguagePacks
/**
* List the installed language packs.
* @return
*/
function showLanguagePacks()
{
$frm = e107::getForm();
$ns = e107::getRender();
$tp = e107::getParser();
if (is_readable(e_ADMIN . "ver.php")) {
include e_ADMIN . "ver.php";
list($ver, $tmp) = explode(" ", $e107info['e107_version']);
}
$lans = e107::getLanguage()->installed();
$release_diz = defined("LANG_LAN_30") ? LANG_LAN_30 : "Release Date";
$compat_diz = defined("LANG_LAN_31") ? LANG_LAN_31 : "Compatibility";
$lan_pleasewait = deftrue('LAN_PLEASEWAIT') ? $tp->toJS(LAN_PLEASEWAIT) : "Please Wait";
$text = "<form id='lancheck' method='post' action='" . e_REQUEST_URI . "'>\n\t\t\t<table class='table table-striped'>";
$text .= "<thead>\n\t\t<tr>\n\t\t<th>" . ADLAN_132 . "</th>\n\t\t<th>" . $release_diz . "</th>\n\t\t<th>" . $compat_diz . "</th>\n\t\t<th>" . LAN_STATUS . "</td>\n\t\t<th style='width:25%;white-space:nowrap'>" . LAN_OPTIONS . "</td>\n\t\t</tr>\n\t\t</thead>\n\t\t";
require_once e_HANDLER . "xml_class.php";
$xm = new XMLParse();
foreach ($lans as $language) {
if ($language == "English") {
continue;
}
$metaFile = e_LANGUAGEDIR . $language . "/" . $language . ".xml";
if (is_readable($metaFile)) {
$rawData = file_get_contents($metaFile);
if ($rawData) {
$array = $xm->parse($rawData);
$value = $array['e107Language']['attributes'];
} else {
$value = array('date' => " ", 'compatibility' => ' ');
}
} else {
$value = array('date' => " ", 'compatibility' => ' ');
}
$errFound = isset($_SESSION['lancheck'][$language]['total']) && $_SESSION['lancheck'][$language]['total'] > 0 ? TRUE : FALSE;
$text .= "<tr>\n\t\t\t<td >" . $language . "</td>\n\t\t\t<td>" . $value['date'] . "</td>\n\t\t\t<td>" . $value['compatibility'] . "</td>\n\t\t\t<td>" . ($ver != $value['compatibility'] || $errFound ? ADMIN_FALSE_ICON : ADMIN_TRUE_ICON) . "</td>\n\t\t\t<td>";
// $text .= "<input type='submit' name='language_sel[{$language}]' value=\"".LAN_CHECK_2."\" class='btn btn-primary' />";
$text .= "<a href='" . e_REQUEST_URI . "&sub=verify&lan=" . $language . "' class='btn btn-primary' >" . LAN_CHECK_2 . "</a>";
$text .= "\n\t\t\t<input type='submit' name='ziplang[{$language}]' value=\"" . LANG_LAN_23 . "\" class='button' onclick=\"this.value = '" . $lan_pleasewait . "'\" /></td>\n\t\t\t</tr>";
}
$text .= "\n\n\t\t</tr></table>";
$text .= "<table class='table table-striped'>";
$text .= "<thead><tr><th>" . LAN_OPTIONS . "</th></tr></thead><tbody>";
$srch = array("[", "]");
$repl = array("<a rel='external' href='http://e107.org/content/About-Us:The-Team#translation-team'>", "</a>");
$diz = deftrue("LANG_LAN_28") ? LANG_LAN_28 : "Check this box if you're an [e107 certified translator].";
$checked = varset($_COOKIE['e107_certified']) == 1 ? true : false;
$text .= "<tr><td>";
$text .= $frm->checkbox('contribute_pack', 1, $checked, array('label' => str_replace($srch, $repl, $diz)));
$text .= "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td>";
// $echecked = varset($_SESSION['lancheck-errors-only']) == 1 ? true : false;
// $text .= $frm->checkbox('errorsonly',1,$echecked,array('label'=>$lan_displayerrors));
$text .= " </td>\n\n\t\t</tr>";
// $text .= "
// <tr>
// <td>".$frm->checkbox('non-core-plugs-themes',1,$echecked,array('label'=>$lan_displayerrors))."</td>
// </tr>
// ";
$text .= "</tbody></table>";
$text .= "</form>";
$text .= "<div class='smalltext center' style='padding-top:50px'>" . LANG_LAN_AGR . "</div>";
$text .= $this->onlineLanguagePacks();
return $text;
return;
}
示例4: setAliases
/**
* Set module aliases
* @param array $aliases
* @return eRouter
*/
public function setAliases($aliases = null)
{
if (null === $aliases) {
$lanCode = e107::getLanguage()->convert(e_LANGUAGE);
$aliases = e107::findPref('url_aliases/' . $lanCode, array());
}
$this->_aliases = $aliases;
return $this;
}
示例5: user_extended_edit
//.........这里部分代码省略.........
$ret .= $frm->checkbox($fname, $val, $curval == $val, array('label' => $label, 'required' => $struct['user_extended_struct_required']));
} else {
$chk = $curval == $val ? " checked='checked' " : "";
$ret .= "<input {$include} type='checkbox' name='{$fname}[]' value='{$val}' {$chk} /> {$label}<br />";
}
}
return $ret;
break;
case EUF_DROPDOWN:
//dropdown
$ret = "<select {$include} id='{$fid}' name='{$fname}' {$required} >\n";
$ret .= "<option value=''> </option>\n";
// ensures that the user chose it.
foreach ($choices as $choice) {
$choice = trim($choice);
$choice = deftrue($choice, $choice);
$sel = $curval == $choice ? " selected='selected' " : "";
$ret .= "<option value='{$choice}' {$sel}>{$choice}</option>\n";
}
$ret .= "</select>\n";
return $ret;
break;
case EUF_PREDEFINED:
// predefined list, shown in dropdown
$listRoot = trim($struct['user_extended_struct_values']);
// Base list name
$filename = e_CORE . 'sql/extended_' . $listRoot . '.php';
if (!is_readable($filename)) {
return 'No file: ' . $filename;
}
require_once $filename;
$className = 'extended_' . $listRoot;
if (!class_exists($className)) {
return '?????';
}
$temp = new $className();
if (!method_exists($className, 'getValue')) {
return '???-???';
}
$temp->pointerReset();
$ret = "<select id='{$fid}' {$include} name='{$fname}' {$required} >\n";
$ret .= "<option value=''> </option>\n";
// ensures that the user chooses it.
while (FALSE !== ($row = $temp->getValue(0, 'next'))) {
$val = key($row);
$choice = $temp->getValue($val, 'display');
$sel = $curval == $val ? " selected='selected' " : '';
$ret .= "<option value='{$val}' {$sel}>{$choice}</option>\n";
}
$ret .= "</select>\n";
return $ret;
case EUF_DB_FIELD:
//db_field
$sql = e107::getDb('ue');
$order = $choices[3] ? "ORDER BY " . $tp->toDB($choices[3], true) : "";
if ($sql->select($tp->toDB($choices[0], true), $tp->toDB($choices[1], true) . "," . $tp->toDB($choices[2], true), "1 {$order}")) {
$choiceList = $sql->db_getList('ALL', FALSE);
$ret = "<select id='{$fid}' {$include} name='{$fname}' {$required} >\n";
$ret .= "<option value=''> </option>\n";
// ensures that the user chose it.
foreach ($choiceList as $cArray) {
$cID = trim($cArray[$choices[1]]);
$cText = trim($cArray[$choices[2]]);
$sel = $curval == $cID ? " selected='selected' " : "";
$ret .= "<option value='{$cID}' {$sel}>{$cText}</option>\n";
}
$ret .= "</select>\n";
return $ret;
} else {
return "";
}
break;
case EUF_TEXTAREA:
//textarea
return "<textarea id='{$fid}' {$include} name='{$fname}' {$required} >{$curval}</textarea>";
break;
case EUF_DATE:
//date
if ($curval == '0000-00-00') {
$curval = '';
}
return e107::getForm()->datepicker($fname, $curval, 'format=yyyy-mm-dd');
break;
case EUF_LANGUAGE:
// language
$lanlist = e107::getLanguage()->installed();
sort($lanlist);
$ret = "<select {$include} id='{$fid}' name='{$fname}' {$required} >\n";
$ret .= "<option value=''> </option>\n";
// ensures that the user chose it.
foreach ($lanlist as $choice) {
$choice = trim($choice);
$sel = $curval == $choice || !USER && $choice == e_LANGUAGE ? " selected='selected' " : "";
$ret .= "<option value='{$choice}' {$sel}>{$choice}</option>\n";
}
$ret .= "</select>\n";
break;
}
return $ret;
}
示例6: getOtherNav
//.........这里部分代码省略.........
$tmp[4]['text'] = LAN_LOGOUT;
$tmp[4]['description'] = ADLAN_151;
$tmp[4]['link'] = e_ADMIN_ABS . 'admin.php?logout';
$tmp[4]['image'] = "";
$tmp[4]['image_large'] = '';
$tmp[4]['image_src'] = '';
$tmp[4]['image_large_src'] = '';
$tmp[4]['link_class'] = 'divider';
$tmp[5]['text'] = "e107 Website";
$tmp[5]['description'] = '';
$tmp[5]['link'] = 'http://e107.org';
$tmp[5]['image'] = E_16_E107;
$tmp[5]['image_large'] = '';
$tmp[5]['image_src'] = '';
$tmp[5]['image_large_src'] = '';
$tmp[5]['link_class'] = '';
$tmp[6]['text'] = "e107 on Twitter";
$tmp[6]['description'] = '';
$tmp[6]['link'] = 'http://twitter.com/e107';
$tmp[6]['image'] = E_16_TWITTER;
// "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";
$tmp[6]['image_large'] = '';
$tmp[6]['image_src'] = '';
$tmp[6]['image_large_src'] = '';
$tmp[6]['link_class'] = '';
$tmp[7]['text'] = "e107 on Facebook";
$tmp[7]['description'] = '';
$tmp[7]['link'] = 'https://www.facebook.com/e107CMS';
$tmp[7]['image'] = E_16_FACEBOOK;
// "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";
$tmp[7]['image_large'] = '';
$tmp[7]['image_src'] = '';
$tmp[7]['image_large_src'] = '';
$tmp[7]['link_class'] = '';
$tmp[8]['text'] = "e107 on Github";
$tmp[8]['description'] = '';
$tmp[8]['link'] = 'https://github.com/e107inc';
$tmp[8]['image'] = E_16_GITHUB;
// "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";
$tmp[8]['image_large'] = '';
$tmp[8]['image_src'] = '';
$tmp[8]['image_large_src'] = '';
$tmp[8]['link_class'] = '';
$menu_vars['logout']['text'] = ADMINNAME;
// ""; // ADMINNAME;
$menu_vars['logout']['link'] = '#';
$menu_vars['logout']['image'] = $tp->toGlyph('fa-user');
// "<i class='icon-user'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";
$menu_vars['logout']['image_src'] = LAN_LOGOUT;
$menu_vars['logout']['sub'] = $tmp;
}
if ($type == 'language') {
$slng = e107::getLanguage();
$languages = $slng->installed();
//array('English','French');
$multiDoms = array();
if ($langSubs = explode("\n", e107::getPref('multilanguage_subdomain'))) {
foreach ($langSubs as $v) {
$multiDoms[] = trim($v);
}
}
sort($languages);
if (count($languages) > 1) {
$c = 0;
foreach ($languages as $lng) {
$checked = "<i > </i> ";
$code = $slng->convert($lng);
if ($lng == e_LANGUAGE) {
$checked = $tp->toGlyph('ok') . " ";
$link = '#';
} elseif (in_array(e_DOMAIN, $multiDoms)) {
$code = $lng == e107::getPref('sitelanguage') ? 'www' : $code;
$link = str_replace($_SERVER['HTTP_HOST'], $code . '.' . e_DOMAIN, e_REQUEST_URL);
// includes query string
} else {
$get = $_GET;
$get['elan'] = $code;
$qry = http_build_query($get);
$link = e_REQUEST_SELF . '?' . $qry;
}
$tmp[$c]['text'] = $lng;
$tmp[$c]['description'] = '';
$tmp[$c]['link'] = $link;
$tmp[$c]['image'] = $checked;
$tmp[$c]['image_large'] = '';
$tmp[$c]['image_src'] = '';
$tmp[$c]['image_large_src'] = '';
$c++;
}
$menu_vars['language']['text'] = strtoupper(e_LAN);
// e_LANGUAGE;
$menu_vars['language']['link'] = '#';
$menu_vars['language']['image'] = $tp->toGlyph('fa-globe');
// "<i class='icon-globe'></i>" ;
$menu_vars['language']['image_src'] = null;
$menu_vars['language']['sub'] = $tmp;
}
}
return $menu_vars;
}
示例7: renderElement
//.........这里部分代码省略.........
case 'user_loginname':
case 'user_login':
case 'user_customtitle':
case 'user_email':*/
case 'user':
//user_id expected
// Just temporary solution, could be changed soon
if (!isset($parms['__options'])) {
$parms['__options'] = array();
}
if (!is_array($parms['__options'])) {
parse_str($parms['__options'], $parms['__options']);
}
if (empty($value) && varset($parms['currentInit'], USERID) !== 0 || vartrue($parms['current'])) {
$value = USERID;
if (vartrue($parms['current'])) {
$parms['__options']['readonly'] = true;
}
}
if (!is_array($value)) {
$value = $value ? e107::getSystemUser($value, true)->getUserData() : array();
// e107::user($value);
}
$colname = vartrue($parms['nameType'], 'user_name');
$parms['__options']['name'] = $colname;
if (!$value) {
$value = array();
}
$uname = varset($value[$colname]);
$value = varset($value['user_id'], 0);
$ret = $this->userpicker(vartrue($parms['nameField'], $key), $key, $uname, $value, vartrue($parms['__options']));
break;
case 'bool':
case 'boolean':
if (varset($parms['label']) === 'yesno') {
$lenabled = 'LAN_YES';
$ldisabled = 'LAN_NO';
} else {
$lenabled = vartrue($parms['enabled'], 'LAN_ENABLED');
$ldisabled = vartrue($parms['disabled'], 'LAN_DISABLED');
}
unset($parms['enabled'], $parms['disabled'], $parms['label']);
$ret = vartrue($parms['pre']) . $this->radio_switch($key, $value, defset($lenabled, $lenabled), defset($ldisabled, $ldisabled), $parms) . vartrue($parms['post']);
break;
case "checkbox":
$value = isset($parms['value']) ? $parms['value'] : $value;
$ret = vartrue($parms['pre']) . $this->checkbox($key, 1, $value, $parms) . vartrue($parms['post']);
break;
case 'method':
// Custom Function
$meth = !empty($attributes['method']) ? $attributes['method'] : $key;
$parms['field'] = $key;
$ret = call_user_func_array(array($this, $meth), array($value, 'write', $parms));
break;
case 'upload':
//TODO - from method
// TODO uploadfile SC is now processing uploads as well (add it to admin UI), write/readParms have to be added (see uploadfile.php parms)
$disbut = varset($parms['disable_button'], '0');
$ret = $tp->parseTemplate("{UPLOADFILE=" . (vartrue($parms['path']) ? e107::getParser()->replaceConstants($parms['path']) : e_UPLOAD) . "|nowarn&trigger=etrigger_uploadfiles&disable_button={$disbut}}");
break;
case 'hidden':
$value = isset($parms['value']) ? $parms['value'] : $value;
$ret = vartrue($parms['show']) ? $value ? $value : varset($parms['empty'], $value) : '';
$ret = $ret . $this->hidden($key, $value);
break;
case 'lanlist':
// installed languages
// installed languages
case 'language':
// all languages
$options = $attributes['type'] === 'language' ? e107::getLanguage()->getList() : e107::getLanguage()->getLanSelectArray();
$eloptions = vartrue($parms['__options'], array());
if (!is_array($eloptions)) {
parse_str($eloptions, $eloptions);
}
unset($parms['__options']);
if (vartrue($eloptions['multiple']) && !is_array($value)) {
$value = explode(',', $value);
}
$ret = vartrue($eloptions['pre']) . $this->selectbox($key, $options, $value, $eloptions) . vartrue($eloptions['post']);
break;
case null:
// Possibly used in db but should not be submitted in form. @see news_extended.
break;
default:
// No LAN necessary, debug only.
$ret = ADMIN ? "<span class='alert alert-error alert-danger'>" . LAN_ERROR . " Unknown 'type' : " . $attributes['type'] . "</span>" : $value;
break;
}
if (vartrue($parms['expand'])) {
$k = "exp-" . $this->name2id($key);
$text = "<a class='e-expandit e-tip' href='#{$k}'>" . $parms['expand'] . "</a>";
$text .= vartrue($parms['help']) ? '<div class="field-help">' . $parms['help'] . '</div>' : '';
$text .= "<div id='{$k}' class='e-hideme'>" . $ret . "</div>";
return $text;
} else {
$ret .= vartrue($parms['help']) ? '<div class="field-help">' . $tp->toHtml($parms['help'], false, 'defs') . '</div>' : '';
}
return $ret;
}
示例8: renderOnlineUsers
function renderOnlineUsers($data = false)
{
$ol = e107::getOnline();
$tp = e107::getParser();
$multilan = e107::getPref('multilanguage');
$panelOnline = "\n\t\t\t\t\n\t\t\t\t<table class='table table-condensed table-striped' >\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col style='width: 10%' />\n\t\t <col style='width: 25%' />\n\t\t\t\t\t<col style='width: 10%' />\n\t\t\t\t\t<col style='width: 40%' />\n\t\t\t\t\t<col style='width: auto' />";
$panelOnline .= !empty($multilan) ? "<col style='width: auto' />" : "";
// TODO LAN
$panelOnline .= "\n\n\t\t\t\t</colgroup>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr class='first'>\n\t\t\t\t\t\t<th>Timestamp</th>\n\t\t\t\t\t\t<th>Username</th>\n\t\t\t\t\t\t<th>IP</th>\n\t\t\t\t\t\t<th>Page</th>\n\t\t\t\t\t\t<th class='center'>Agent</th>";
$panelOnline .= !empty($multilan) ? "<th class='center'>Lang.</th>" : "";
$panelOnline .= "\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>";
$online = $ol->userList() + $ol->guestList();
if ($data == 'count') {
return count($online);
}
// echo "Users: ".print_a($online);
$lng = e107::getLanguage();
foreach ($online as $val) {
$panelOnline .= "\n\t\t\t<tr>\n\t\t\t\t<td class='nowrap'>" . e107::getDateConvert()->convert_date($val['user_currentvisit'], '%H:%M:%S') . "</td>\n\t\t\t\t<td>" . $this->renderOnlineName($val['online_user_id']) . "</td>\n\t\t\t\t<td>" . e107::getIPHandler()->ipDecode($val['user_ip']) . "</td>\n\t\t\t\t<td><a class='e-tip' href='" . $val['user_location'] . "' title='" . $val['user_location'] . "'>" . $tp->html_truncate(basename($val['user_location']), 50, "...") . "</a></td>\n\t\t\t\t<td class='center'><a class='e-tip' href='#' title='" . $val['user_agent'] . "'>" . $this->browserIcon($val) . "</a></td>";
$panelOnline .= !empty($multilan) ? "<td class='center'><a class='e-tip' href='#' title=\"" . $lng->convert($val['user_language']) . "\">" . $val['user_language'] . "</a></td>" : "";
$panelOnline .= "\n\t\t\t</tr>\n\t\t\t";
}
$panelOnline .= "</tbody></table>";
return $panelOnline;
}
示例9: installContentCheck
/**
* @param $name
*/
function installContentCheck($name)
{
$file = e_THEME . $name . "/install/install.xml";
$frm = e107::getForm();
$tp = e107::getParser();
if (!is_readable($file)) {
return false;
}
$mes = e107::getMessage();
$xmlArray = e107::getXml()->loadXMLfile($file, 'advanced');
$text = "\n\t\t<form action='" . e_SELF . "' method='post'>\n\t\t<div>\n\t\t<p>" . TPVLAN_58 . "<br />\n\t\t" . $tp->toHTML(TPVLAN_59, true) . ":<br />\n\t\t</p>\n\n\t\t<ul>";
$lng = e107::getLanguage();
foreach ($xmlArray['database']['dbTable'] as $key => $val) {
$count = count($val['item']);
$data = array('x' => $count, 'y' => $val['@attributes']['name']);
$text .= "<li>" . $tp->lanVars(TPVLAN_60, $data) . "</li>";
}
$text .= "</ul>\n\n\t\t<p>" . $tp->toHTML(TPVLAN_61, true) . "</p>\n\n\t\t" . $frm->admin_button('installContent', $name, 'warning', LAN_YES) . "\n\t\t" . $frm->admin_button('dismiss', 0, 'cancel', LAN_NO) . "\n\t\t</div>\n\t\t</form>\n\t\t";
// $text .= print_a($xmlArray, true);
$mes->addInfo($text);
}
示例10: clearCookie
/**
* Clear data set via self::setCookie()
* @param string $name
* @return redirection
*/
public function clearCookie($name)
{
$cookiename = e_COOKIE . "_" . $name;
$session = e107::getSession();
$session->clear($name)->clear($name . '_expire');
cookie($cookiename, null, null, e_HTTP, e107::getLanguage()->getCookieDomain());
return $this;
}
示例11: cookie
}
} else {
$newValue = $tp->toDB($value);
}
$core_pref->update($key, $newValue);
/*if($newValue != $core_pref->get($key))
{ // Changed value
$core_pref->set($key, $newValue);
$prefChanges[$key] = $newValue;
}*/
}
$core_pref->save(false);
// special case, do session cleanup, logout, redirect to login screen
if ($sessionRegenerate) {
// reset cookie
cookie($core_pref->get('cookie_name'), $_COOKIE[e_COOKIE], time() + 3600 * 24 * 30, e_HTTP, e107::getLanguage()->getCookieDomain());
cookie(e_COOKIE, null, null);
// regenerate session
$s = $_SESSION;
e107::getSession()->destroy();
$session = new e_core_session(array('name' => $core_pref->get('cookie_name')));
$_SESSION = $s;
}
}
if (e107::isInstalled('alt_auth')) {
$authlist[] = "e107";
$handle = opendir(e_PLUGIN . "alt_auth");
while ($file = readdir($handle)) {
if (preg_match("/^(.*)_auth\\.php/", $file, $match)) {
$authlist[] = $match[1];
}
示例12: renderElement
//.........这里部分代码省略.........
case 'userclass':
case 'userclasses':
$uc_options = vartrue($parms['classlist'], 'public,guest,nobody,member,admin,main,classes');
// defaults to 'public,guest,nobody,member,classes' (userclass handler)
unset($parms['classlist']);
$method = $attributes['type'] == 'userclass' ? 'uc_select' : 'uc_select';
if ($atrributes['type'] == 'userclasses') {
$parms['multiple'] = true;
}
$ret = $this->{$method}($key, $value, $uc_options, vartrue($parms, array()));
break;
/*case 'user_name':
case 'user_loginname':
case 'user_login':
case 'user_customtitle':
case 'user_email':*/
/*case 'user_name':
case 'user_loginname':
case 'user_login':
case 'user_customtitle':
case 'user_email':*/
case 'user':
//user_id expected
// Just temporary solution, could be changed soon
if (!isset($parms['__options'])) {
$parms['__options'] = array();
}
if (!is_array($parms['__options'])) {
parse_str($parms['__options'], $parms['__options']);
}
if (empty($value) && vartrue($parms['currentInit']) || vartrue($parms['current'])) {
$value = USERID;
if (vartrue($parms['current'])) {
$parms['__options']['readonly'] = true;
}
}
if (!is_array($value)) {
$value = $value ? e107::getSystemUser($value, true)->getUserData() : array();
// get_user_data($value);
}
$colname = vartrue($parms['nameType'], 'user_name');
$parms['__options']['name'] = $colname;
if (!$value) {
$value = array();
}
$uname = varset($value[$colname]);
$value = varset($value['user_id'], 0);
$ret = $this->userpicker(vartrue($parms['nameField'], $key . '_usersearch'), $key, $uname, $value, vartrue($parms['__options']));
break;
case 'bool':
case 'boolean':
$lenabled = vartrue($parms['enabled'], 'LAN_ENABLED');
$ldisabled = vartrue($parms['disabled'], 'LAN_DISABLED');
unset($parms['enabled'], $parms['disabled']);
$ret = $this->radio_switch($key, $value, defset($lenabled, $lenabled), defset($ldisabled, $ldisabled), $parms);
break;
case 'method':
// Custom Function
$ret = call_user_func_array(array($this, $key), array($value, 'write', $parms));
break;
case 'upload':
//TODO - from method
// TODO uploadfile SC is now processing uploads as well (add it to admin UI), write/readParms have to be added (see uploadfile.php parms)
$disbut = varset($parms['disable_button'], '0');
$ret = $tp->parseTemplate("{UPLOADFILE=" . (vartrue($parms['path']) ? e107::getParser()->replaceConstants($parms['path']) : e_UPLOAD) . "|nowarn&trigger=etrigger_uploadfiles&disable_button={$disbut}}");
break;
case 'hidden':
$ret = vartrue($parms['show']) ? $value ? $value : varset($parms['empty'], $value) : '';
$value = vartrue($parms['value']) ? $parms['value'] : $value;
echo "key=" . $key . "<br />value=" . $value;
$ret = $ret . $this->hidden($key, $value);
break;
case 'lanlist':
case 'language':
$options = e107::getLanguage()->getLanSelectArray();
$eloptions = vartrue($parms['__options'], array());
if (!is_array($eloptions)) {
parse_str($eloptions, $eloptions);
}
unset($parms['__options']);
if (vartrue($eloptions['multiple']) && !is_array($value)) {
$value = explode(',', $value);
}
$ret = vartrue($eloptions['pre']) . $this->selectbox($key, $options, $value, $eloptions) . vartrue($eloptions['post']);
break;
default:
$ret = $value;
break;
}
if (vartrue($parms['expand'])) {
$k = "exp-" . $this->name2id($key);
$text = "<a class='e-expandit e-tip' href='#{$k}'>" . $parms['expand'] . "</a>";
$text .= vartrue($parms['help']) ? '<div class="field-help">' . $parms['help'] . '</div>' : '';
$text .= "<div id='{$k}' class='e-hideme'>" . $ret . "</div>";
return $text;
} else {
$ret .= vartrue($parms['help']) ? '<div class="field-help">' . $tp->toHtml($parms['help'], false, 'defs') . '</div>' : '';
}
return $ret;
}
示例13: define
exit;
}
define('e_CAPTCHA_FONTCOLOR', '#F9A533');
// Required for a clean v1.x -> v2 upgrade.
$core = e107::getConfig('core');
if ($core->get('admintheme') != 'bootstrap' && $core->get('admintheme') != 'bootstrap3') {
$core->update('admintheme', 'bootstrap3');
$core->update('adminstyle', 'infopanel');
$core->update('admincss', 'admin_dark.css');
$core->set('e_jslib_core', array('prototype' => 'none', 'jquery' => 'auto'));
$core->save();
e107::getRedirect()->redirect(e_SELF);
}
// Check Admin-Perms for current language and redirect if necessary.
if (!getperms('0') && vartrue($pref['multilanguage']) && !getperms(e_LANGUAGE)) {
$lng = e107::getLanguage();
$tmp = explode(".", ADMINPERMS);
foreach ($tmp as $ln) {
if ($lng->isValid($ln)) {
$redirect = deftrue("MULTILANG_SUBDOMAIN") ? $lng->subdomainUrl($ln) : e_SELF . "?elan=" . $ln;
// echo "redirect to: ".$redirect;
e107::getRedirect()->go($redirect);
// break;
}
}
}
/* done in class2
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
@include_once(e_LANGUAGEDIR."English/admin/lan_admin.php");
*/
if (ADMIN) {
示例14: include_lan
*
* User information
*
* $URL$
* $Id$
*
*/
//HCL define('PAGE_NAME', 'Members');
require_once "class2.php";
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
// Next bit is to fool PM plugin into doing things
global $user;
$user['user_id'] = USERID;
// BC for v1.x template
$bcList = array('LAN_112' => 'LAN_USER_60', 'LAN_138' => 'LAN_USER_52', 'LAN_139' => 'LAN_USER_57', "LAN_142" => "LAN_USER_58", "LAN_145" => "LAN_USER_59", "LAN_146" => "LAN_USER_66", "LAN_147" => "LAN_USER_67", "LAN_148" => "LAN_USER_68", "LAN_149" => "LAN_USER_69", "LAN_308" => "LAN_USER_63", "LAN_403" => "LAN_USER_64", "LAN_404" => "LAN_USER_65", "LAN_419" => "LAN_USER_70", "LAN_425" => "LAN_USER_62");
e107::getLanguage()->bcDefs($bcList);
if (e_AJAX_REQUEST) {
if (vartrue($_POST['q'])) {
$q = filter_var($_POST['q'], FILTER_SANITIZE_STRING);
$l = vartrue($_POST['l']) ? intval($_POST['l']) : 10;
$db = e107::getDb();
if ($db->select("user", "user_id,user_name", "user_name LIKE '" . $q . "%' ORDER BY user_name LIMIT " . $l)) {
$data = array();
while ($row = $db->fetch()) {
$data[] = array('value' => $row['user_id'], 'label' => $row['user_name']);
}
if (count($data)) {
header('Content-type: application/json');
echo json_encode($data);
}
}
示例15: init
public function init()
{
$this->installedLanguages = e107::getLanguage()->installed();
$this->prefs['sitelanguage']['writeParms']['optArray'] = $this->installedLanguages;
$this->prefs['adminlanguage']['writeParms']['optArray'] = $this->installedLanguages;
}