本文整理汇总了PHP中GWF_HTML::lang方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_HTML::lang方法的具体用法?PHP GWF_HTML::lang怎么用?PHP GWF_HTML::lang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_HTML
的用法示例。
在下文中一共展示了GWF_HTML::lang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
private function send(GWF_User $user)
{
$form = $this->form($user);
if (false !== ($errors = $form->validate($this->module))) {
return $errors . $this->template($user);
}
$u = GWF_User::getStaticOrGuest();
$sendermail = $u->getValidMail();
if ($sendermail === '') {
$sendermail = Common::getPost('email');
}
if ($sendermail === '') {
$sendermail = GWF_HTML::lang('unknown');
}
$sendermail = GWF_HTML::display($sendermail);
$mail = new GWF_Mail();
$mail->setSender(GWF_BOT_EMAIL);
$mail->setReceiver($user->getValidMail());
$mail->setReply($sendermail);
$mail->setSubject($this->module->langUser($user, 'mail_subj_mail', $sendermail));
$mail->setBody($this->module->langUser($user, 'mail_subj_body', array($user->displayUsername(), $sendermail, GWF_Message::display($_POST['message']))));
if (false === $mail->sendToUser($user)) {
return GWF_HTML::err('ERR_MAIL_SENT');
}
return $this->module->message('msg_mailed', array($user->displayUsername()));
}
示例2: validate_username
public function validate_username(Module_WeChall $m, $arg)
{
if (false === ($this->user = GWF_User::getByName($arg))) {
return GWF_HTML::lang('ERR_UNKNOWN_USER');
}
return false;
}
示例3: validate_username
public function validate_username(Module_Ban $m, $arg)
{
if (false === ($this->user = GWF_User::getByName($arg))) {
$_POST['username'] = '';
return GWF_HTML::lang('ERR_UNKNOWN_USER');
}
return false;
}
示例4: getGuest
/**
* Get a fake Guest User.
* @return GWF_User
*/
public static function getGuest()
{
static $GUEST;
if (!isset($GUEST)) {
$GUEST = new GWF_User(array('user_id' => '0', 'user_options' => 0, 'user_name' => GWF_HTML::lang('guest'), 'user_password' => '', 'user_regdate' => '', 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT), 'user_email' => '', 'user_gender' => GWF_User::NO_GENDER, 'user_lastlogin' => '0', 'user_lastactivity' => time(), 'user_birthdate' => '', 'user_avatar_v' => '0', 'user_countryid' => '0', 'user_langid' => '0', 'user_langid2' => '0', 'user_level' => '0', 'user_title' => '', 'user_settings' => '', 'user_data' => '', 'user_credits' => '0.00'));
}
return $GUEST;
}
示例5: getFormEdit
private function getFormEdit($langid, $desc)
{
$buttons = array('edit[' . $langid . ']' => $this->module->lang('btn_edit'), 'default[' . $langid . ']' => $this->module->lang('btn_set_default'), 'delete[' . $langid . ']' => $this->module->lang('btn_delete'));
$default = $this->site->getVar('site_descr_lid');
$is_def = $default == $langid ? GWF_HTML::lang('yes') : GWF_HTML::lang('no');
$langname = GWF_Language::getByID($langid)->displayName();
$data = array('default' => array(GWF_Form::HEADLINE, $is_def, $this->module->lang('th_is_default')), 'langid' => array(GWF_Form::HEADLINE, $langname, $this->module->lang('th_site_language')), 'descr' => array(GWF_Form::MESSAGE, $desc, $this->module->lang('th_site_description')), 'btns' => array(GWF_Form::SUBMITS, $buttons));
return new GWF_Form($this, $data);
}
示例6: displayEndDate
public function displayEndDate()
{
if ($this->isWarning()) {
return '';
} elseif ('' === ($ends = $this->getVar('ban_ends'))) {
return GWF_HTML::lang('never');
} else {
return GWF_Time::displayDate($ends);
}
}
示例7: validate_user_name
public function validate_user_name(Module_Profile $m, $arg)
{
if (!($this->user_to_add = GWF_User::getByName($arg))) {
return GWF_HTML::lang('ERR_UNKNOWN_USER');
}
if ($this->user_to_add->getID() == GWF_Session::getUserID()) {
return $m->lang('err_self_whitelist');
}
return false;
}
示例8: validate_target
public function validate_target(Module_Language $m, $arg)
{
if (isset($_POST['all_targets'])) {
return false;
}
if (false === ($this->target = GWF_Language::getByID($arg))) {
return GWF_HTML::lang('ERR_UNKNOWN_LANGUAGE');
}
return false;
}
示例9: onLoginAs
public function onLoginAs()
{
$form = $this->getForm();
if (false !== ($error = $form->validate($this->module))) {
return $error . $this->templateLoginAs();
}
if (false === ($user = GWF_User::getByName($form->getVar('username')))) {
return GWF_HTML::lang('ERR_UNKNOWN_USER');
}
GWF_Session::onLogin($user);
return $this->module->message('msg_login_as', array($user->displayUsername()));
}
示例10: module_PageBuilder_monthly
function module_PageBuilder_monthly()
{
require_once GWF_CORE_PATH . 'module/PageBuilder/GWF_Page.php';
$enabled = GWF_Page::ENABLED;
$langid = GWF_Language::getCurrentID();
$db = gdo_db();
$t = GWF_TABLE_PREFIX . 'page';
$query = "SELECT IFNULL(p2.page_otherid,p1.page_otherid), IFNULL(p2.page_title,p1.page_title), IFNULL(p2.page_url,p1.page_url), IFNULL(p2.page_date,p1.page_date) FROM {$t} p1 LEFT JOIN {$t} p2 ON p1.page_otherid=p2.page_otherid AND p2.page_lang={$langid} WHERE p1.page_lang=0 ORDER BY 4 DESC";
if (false === ($result = $db->queryRead($query))) {
return '';
}
$first = NULL;
$tree = array();
while (false !== ($page = $db->fetchRow($result))) {
if ($first === NULL) {
$first = $page;
}
monthlyAddTree($tree, $page);
}
$db->free($result);
if (count($tree) === 0) {
return '';
}
// $first = $pages[key($pages)];
$currdate = $first[3];
list($y, $m, $d) = monthlySplit($currdate);
$cy = $y;
$cm = $m;
$cd = $d;
// $tree = monthlyGetTree($pages);
$back = '<div class="gwf_pb_monthly fr">' . PHP_EOL;
foreach ($tree as $year => $y2) {
$c = count($y2);
$back .= "<ol id=\"_pby{$year}\"><li>{$year}({$c})</li>\n";
foreach ($y2 as $m1 => $m2) {
$c = count($m2);
$month = GWF_HTML::lang('M' . ($m1 + 0));
$back .= "<li>{$year} {$month} ({$c})<ol>\n";
foreach ($m2 as $page) {
$url = htmlspecialchars(GWF_WEB_ROOT . $page[2]);
$title = htmlspecialchars($page[1]);
$back .= "<li><a href=\"{$url}\" title=\"{$title}\">{$title}</a></li>\n";
}
$back .= "</ol></li>\n";
}
$back .= "</ol>\n";
}
$back .= '</div>' . PHP_EOL;
return $back;
echo $back;
return;
}
示例11: grabFingerprint
/**
* Return a public key in hex format or false.
* @param string $key
*/
public static function grabFingerprint($file_content)
{
$gpg = gnupg_init();
if (false === ($result = gnupg_import($gpg, $file_content))) {
GWF_Log::logCritical('gnupg_import() failed');
GWF_Log::logCritical(GWF_HTML::lang('ERR_GENERAL', __FILE__, __LINE__));
return false;
}
if ($result['imported'] + $result['unchanged'] === 0) {
return false;
}
return $result['fingerprint'];
}
示例12: Upgrade_WeChall_5_03
function Upgrade_WeChall_5_03(Module_WeChall $module)
{
GWF_Website::addDefaultOutput(GWF_HTML::message('WC5', "Sites can have multiple warboxes now. (thx awe)"));
$module->includeClass('WC_Site');
$sites = GDO::table('WC_Site');
$columns = array('site_warport', 'site_warhost', 'site_war_rs', 'site_war_ip');
$back = '';
foreach ($columns as $column) {
if (!$sites->dropColumn($column)) {
$back .= GWF_HTML::lang('ERR_DATABASE', array(__FILE__, __LINE__));
}
}
return $back;
}
示例13: showAllSites
private function showAllSites()
{
if (false === ($sites = WC_Site::getSites('site_name ASC'))) {
return GWF_HTML::lang('ERR_DATABASE', array(__FILE__, __LINE__));
}
$back = '';
foreach ($sites as $site) {
$site instanceof WC_Site;
if ($site->getURL() !== '') {
$back .= $this->showSite($site);
}
}
return $back;
}
示例14: validate_langidMulti
public static function validate_langidMulti($langids, $allow_zero = false, $bitmask = self::TYPE_ALL)
{
# Zero and nothing
if (!is_array($langids)) {
return $allow_zero ? false : GWF_HTML::lang('ERR_UNKNOWN_LANGUAGE');
}
# Validate them all
foreach ($langids as $langid) {
if (!self::isValidLanguage($langid, false, $bitmask)) {
return GWF_HTML::lang('ERR_UNKNOWN_LANGUAGE');
}
}
return false;
}
示例15: implodeHuman
/**
* Implode an array like humans would do:
* Example: 1, 2, 3 and last
* @todo Make it recursive?
* @param array $array
* @return string
*/
public static function implodeHuman(array $array)
{
static $and = NULL;
$cnt = count($array);
if ($cnt <= 0) {
return '';
} elseif ($cnt === 1) {
return array_pop($array);
}
if ($and === NULL) {
$and = GWF_HTML::lang('and');
}
$last = array_pop($array);
return implode(', ', $array) . " {$and} {$last}";
}