本文整理汇总了PHP中Language::getActiveLanguageISO方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::getActiveLanguageISO方法的具体用法?PHP Language::getActiveLanguageISO怎么用?PHP Language::getActiveLanguageISO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::getActiveLanguageISO方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLocalesVariant
public function getLocalesVariant($id, $value, $iso = false)
{
$result = array();
$index = 0;
$locale = Language::getActiveLanguageISO();
$field = $this->getField($id);
$locales = new Locales('connection');
$list = $locales->getList();
$variants = $field[$locale]['variant'];
$size = sizeof($variants);
foreach ($list as $item) {
if (!isset($field[$item['iso']])) {
continue;
}
$variants = $field[$item['iso']]['variant'];
for ($i = 0; $i < $size; $i++) {
if (trim($variants[$i]) == trim($value)) {
$index = $i;
break;
}
}
}
foreach ($list as $lang) {
if (isset($field[$lang['iso']])) {
if ($iso) {
$result[$lang['iso']] = $field[$lang['iso']]['variant'][$index];
} else {
$result[] = $field[$lang['iso']]['variant'][$index];
}
}
}
return $result;
}
示例2: run
function run()
{
$theme = Settings::getValue('theme');
$module = ($result = explode('/', Request::get('module'))) && sizeof($result) > 1 ? $result[sizeof($result) - 1] : Request::get('module');
$this->template = App::getAppName() . strtoupper(substr($module, 0, 1)) . substr($module, 1) . strtoupper(substr(Request::get('action'), 0, 1)) . substr(Request::get('action'), 1);
$this->defaultVar = array('theme_name' => $theme, 'theme_url' => App::getAppUrl() . APP_TEMPLATES_DIR . DS . 'themes' . DS . $theme . DS, 'dir_include_frontend' => APP_DIR . DS . 'connection' . DS . APP_TEMPLATES_DIR . DS . 'frontend' . DS . 'include');
$assign = is_array($result = $this->execute()) ? $result : array();
if ($this->exit) {
return;
}
if ($this->notFound) {
$this->setSeoPage('404');
}
$seo = connectionSeoModel::create()->getByLocale($this->seoPage, Language::getActiveLanguageISO());
if (empty($this->default['page_title'])) {
$this->default['page_title'] = $seo['title'];
}
if (empty($this->default['page_meta']['description'])) {
$this->default['page_meta']['description'] = $seo['description'];
}
if (empty($this->default['page_meta']['keywords'])) {
$this->default['page_meta']['keywords'] = $seo['keywords'];
}
if ($this->notFound) {
$sourceAction = $this->fenom->fetch('themes/' . $theme . '/404.html', array_merge($assign, $this->defaultVar));
} else {
$sourceAction = $this->fenom->fetch(Request::get('module') . DS . $this->template . '.html', array_merge($assign, $this->defaultVar));
}
if ($this->frame) {
$this->fenom->display('themes/' . $theme . '/index.html', array_merge(array('action' => $sourceAction), $this->default, $this->defaultVar));
} else {
echo $sourceAction;
}
}
示例3: execute
function execute()
{
$lang = new Language();
$data = array();
array_map(function ($a) use(&$data) {
$data[$a['key']] = $a['value'];
}, $lang->getWords(Language::getActiveLanguageISO()));
echo '$Lang = ' . json_encode($data) . ';';
}
示例4: execute
function execute()
{
$fields = connectionFieldsModel::create()->where(array('filter' => true))->sort('sort', -1)->fetchAll();
$fields = array_map(function ($field) {
return connectionFieldsModel::create()->getFieldLocale($field['id'], Language::getActiveLanguageISO());
}, $fields);
$this->setSeoPage('advanced_search');
return array('fields' => $fields);
}
示例5: execute
function execute()
{
$user_id = Request::get('user_id');
$model = new connectionUserModel();
$user = $model->getFromId((int) $user_id);
if (!$user || $user['status'] != connectionUserModel::STATUS_PUBLISHED) {
$this->showNotFound();
return;
}
$userInfo = $model->getInfo((int) $user['id']);
$fieldsModel = new connectionFieldsModel();
$this->setSeoPage('profile');
return array('user_profile' => $userInfo, 'video' => connectionUserVideoModel::create()->where(array('user' => (int) $user_id, 'status' => 'published'))->sort('date', -1)->fetchAll(), 'fields' => array('info' => $fieldsModel->getGroupLocale('info', Language::getActiveLanguageISO(), true), 'interest' => $fieldsModel->getGroupLocale('interest', Language::getActiveLanguageISO(), true)));
}
示例6: execute
function execute()
{
if (Request::get('delete_attach') && Request::get('file')) {
$user = ConnectionHelper::userLogin();
$key = 'field_' . (int) Request::get('delete_attach');
if (isset($user[$key])) {
foreach ($user[$key] as $index => $value) {
if ($value['file'] == Request::get('file')) {
unset($user[$key][$index]);
}
}
connectionUserModel::create()->where(array('id' => (int) $user['id']))->update(array($key => array_values($user[$key])));
}
}
$model = new connectionFieldsModel();
return array('fields' => $model->getGroupLocale('info', Language::getActiveLanguageISO()));
}
示例7: execute
function execute()
{
$page_url = Request::get('page_url');
$model = new connectionPagesModel();
$page = $model->getPageFromUrl($page_url);
if (!$page) {
$this->showNotFound();
return;
}
$provider = new PageProviderFenom();
$this->fenom->addProvider("string", $provider, TEMP_DIR . DS . 'fenom' . DS . 'templates_c');
$page_content = $model->getLocalePage($page['id'], Language::getActiveLanguageISO());
$page_content['content'] = $this->fenom->fetch("string:" . $page['id'], array('theme_name' => Settings::getValue('theme')));
$this->setPageTitle($page_content['title']);
$this->setPageMeta('keywords', $page_content['meta']['keywords']);
$this->setPageMeta('description', $page_content['meta']['description']);
return array('page' => $page_content);
}
示例8: execute
function execute()
{
$model = connectionFaqPartModel::create();
$result = array();
if (!Request::get('part_url')) {
$partID = '0';
} else {
$part = $model->getPartByUrl(Request::get('part_url'), Language::getActiveLanguageISO());
if (!$part) {
$partID = '0';
} else {
$result['part'] = $part;
$partID = strval($part['id']);
}
}
$result['answers'] = connectionFaqAnswerModel::create()->getList($partID, Language::getActiveLanguageISO());
$this->setSeoPage('faq');
return $result;
}
示例9: load
static function load($app_name)
{
$apps = self::getAppList();
if (!isset($apps[$app_name])) {
return;
}
$app_dir = $apps[$app_name];
self::$activeAppName = strtolower($app_name);
self::$activeAppDir = $app_dir;
$route_file_name = String::glue($app_dir, DS, APP_CONFIG_DIR, DS, 'route.php');
if (php_sapi_name() != 'cli') {
try {
Route::setActive(Route::getPath(), file_exists($route_file_name) ? include $route_file_name : array(), true);
} catch (Exception $e) {
self::parseError($e, $app_name);
}
}
self::setDefaultParams();
// Abort this code, but later
if (!Auth::loged() && Core::isSecure(Request::get('module')) && Request::get('module') != 'login' && false) {
if (php_sapi_name() == 'cli') {
echo 'Auth Error';
exit;
}
Request::redirect('/login/' . (Request::get(Route::$path) ? '&return=' . Request::get(Route::$path) : ''));
}
//
Settings::load('core', CORE_CONFIG_DIR . DS);
self::loadDependences($app_dir);
Settings::load($app_name);
App::startApp($app_name);
try {
Load::Action($app_dir . DS, Request::get('action'));
} catch (Exception $e) {
self::parseError($e, $app_name);
}
App::endApp($app_name);
Language::translate(Language::getActiveLanguageISO());
}
示例10: add
public function add($feedback)
{
$from = null;
$data = array();
if (ConnectionHelper::isLogin()) {
$user = ConnectionHelper::userLogin();
$from = (int) $user['id'];
} else {
$ticket = array('subject' => htmlspecialchars($feedback['subject']), 'message' => nl2br(htmlspecialchars($feedback['message'])));
connectionNotificationModel::run(connectionNotificationModel::EVENT_NEW_FEEDBACK_ANONIMUS, array('user' => array('name' => htmlspecialchars($feedback['name']), 'email' => htmlspecialchars($feedback['email'])), 'ticket' => $ticket), Language::getActiveLanguageISO());
return $ticket;
}
foreach ($this->field as $field) {
if (!isset($feedback) || empty($feedback)) {
return false;
} else {
$data[$field] = htmlspecialchars($feedback[$field]);
}
}
$data['message'] = nl2br($data['message']);
if (is_null($from)) {
if (!isset($feedback['email']) || empty($feedback['email']) || !filter_var($feedback['email'], FILTER_VALIDATE_EMAIL)) {
return false;
}
if (!isset($feedback['name']) || empty($feedback['name'])) {
return false;
}
$data['contact'] = array('email' => htmlspecialchars($feedback['email']), 'name' => htmlspecialchars($feedback['name']));
} else {
$data['contact'] = $from;
}
$data['status'] = self::FEEDBACK_STATUS_NEW;
$data['date'] = strtotime('now');
$data['url'] = md5($data['date'] . $data['subject'] . uniqid());
$data['last_action'] = 'user';
if (isset($feedback['attachment']) && is_array($feedback['attachment'])) {
$data['attachment'] = $feedback['attachment'];
}
$id = $this->insert($data);
$data['id'] = $id;
connectionNotificationModel::run(connectionNotificationModel::EVENT_NEW_FEEDBACK, array('user' => ConnectionHelper::userLogin(), 'ticket' => $data), Language::getActiveLanguageISO());
return $id;
}
示例11: registration
public function registration($array)
{
$data = array();
if (!Validator::mapFields($this->regFields, $array, $data) || $this->getFromEmail($data['email'])) {
return false;
}
$data['country'] = (int) $data['country'];
// $data['confirmation'] = true;
$data['last_active'] = 0;
$data['last_login'] = 0;
$data['birth_date'] = (int) strtotime($data['birth_year'] . '-' . $data['birth_month'] . '-' . $data['birth_day']);
$data['date'] = strtotime('now');
$data['password'] = md5($data['password']);
$data['status'] = self::STATUS_DRAFT;
$data['lang'] = Language::getActiveLanguageISO();
$data['confirmation_email_id'] = md5($data['email'] . $data['date']);
$data['balance'] = (double) Settings::getValue('start_balance', 'connection');
unset($data['birth_day']);
unset($data['birth_month']);
unset($data['birth_year']);
$user = $this->insert($data);
$this->addHistory($user, self::HISTORY_REGISTRATION);
$this->changeStatus($user, self::STATUS_DRAFT);
$userInfo = $this->getInfo((int) $user);
connectionNotificationModel::run(connectionNotificationModel::EVENT_REGISTRATION, array('user' => $userInfo), Language::getActiveLanguageISO());
connectionNotificationModel::run(connectionNotificationModel::EVENT_EMAIL_CONFIRMATION, array('user' => $userInfo, 'link' => 'http://' . Settings::getValue('domain', 'connection') . '/?confirm_email=' . $data['confirmation_email_id']), Language::getActiveLanguageISO());
return true;
}
示例12: execute
function execute()
{
$model = new connectionFieldsModel();
return array('fields' => $model->getGroupLocale('interest', Language::getActiveLanguageISO()));
}
示例13: getSource
public function getSource($tpl, &$time)
{
$page_content = $this->model->getLocalePage($tpl, Language::getActiveLanguageISO());
return $page_content['content'];
}
示例14: getCountries
static function getCountries()
{
$model = new connectionCountryModel();
return $model->getList(Language::getActiveLanguageISO());
}