本文整理汇总了PHP中OW::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP OW::getLanguage方法的具体用法?PHP OW::getLanguage怎么用?PHP OW::getLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OW
的用法示例。
在下文中一共展示了OW::getLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$language = OW::getLanguage();
$config = OW::getConfig();
OW::getDocument()->setHeading(OW::getLanguage()->text('admin', 'heading_mobile_settings'));
OW::getDocument()->setHeadingIconClass('ow_ic_gear_wheel');
$settingsForm = new Form('mobile_settings');
$disableMobile = new CheckboxField('disable_mobile');
$disableMobile->setLabel($language->text('admin', 'mobile_settings_mobile_context_disable_label'));
$disableMobile->setDescription($language->text('admin', 'mobile_settings_mobile_context_disable_desc'));
$settingsForm->addElement($disableMobile);
$submit = new Submit('save');
$submit->setValue($language->text('admin', 'save_btn_label'));
$settingsForm->addElement($submit);
$this->addForm($settingsForm);
if (OW::getRequest()->isPost()) {
if ($settingsForm->isValid($_POST)) {
$data = $settingsForm->getValues();
$config->saveConfig('base', 'disable_mobile_context', (bool) $data['disable_mobile']);
OW::getFeedback()->info($language->text('admin', 'settings_submit_success_message'));
} else {
OW::getFeedback()->error('Error');
}
$this->redirect();
}
$disableMobile->setValue($config->getValue('base', 'disable_mobile_context'));
}
示例2: __construct
public function __construct($layout, $params)
{
parent::__construct();
if (empty($params['available'])) {
if (!empty($params['msg'])) {
$msg = $params['msg'];
} else {
$msg = OW::getLanguage()->text('base', 'authorization_failed_feedback');
}
$this->assign('authError', $msg);
return;
}
switch ($layout) {
case 'page':
$class = ' ow_photoview_info_onpage';
break;
default:
if ((bool) OW::getConfig()->getValue('photo', 'photo_view_classic')) {
$class = ' ow_photoview_pint_mode';
} else {
$class = '';
}
break;
}
$this->assign('class', $class);
$this->assign('layout', $layout);
}
示例3: process
public static function process($prefix, $key)
{
$languageService = BOL_LanguageService::getInstance();
$list = $languageService->findActiveList();
$currentLanguageId = OW::getLanguage()->getCurrentId();
$currentLangValue = "";
foreach ($list as $item) {
$keyDto = $languageService->findKey($prefix, $key);
if (empty($keyDto)) {
$prefixDto = $languageService->findPrefix($prefix);
$keyDto = $languageService->addKey($prefixDto->getId(), $key);
}
$value = trim($_POST['lang'][$item->getId()][$prefix][$key]);
if (mb_strlen(trim($value)) == 0 || $value == json_decode('"\\u00a0"')) {
$value = ' ';
}
$dto = $languageService->findValue($item->getId(), $keyDto->getId());
if ($dto !== null) {
$event = new OW_Event('admin.before_save_lang_value', array('dto' => $dto));
OW::getEventManager()->trigger($event);
if ($dto->getValue() !== $value) {
$languageService->saveValue($dto->setValue($value));
}
} else {
$dto = $languageService->addValue($item->getId(), $prefix, $key, $value);
}
if ((int) $currentLanguageId === (int) $item->getId()) {
$currentLangValue = $value;
}
}
exit(json_encode(array('result' => 'success', 'prefix' => $prefix, 'key' => $key, 'value' => $currentLangValue)));
}
示例4: __construct
public function __construct($ctrl)
{
parent::__construct('settings-form');
$configs = OW::getConfig()->getValues('yncontactimporter');
$ctrl->assign('configs', $configs);
$l = OW::getLanguage();
$miValidator = new IntValidator(1, 999);
$miValidator->setErrorMessage($l->text('yncontactimporter', 'max_validation_error', array('min' => 1, 'max' => 999)));
//Contacts per page
$textField['contact_per_page'] = new TextField('contact_per_page');
$textField['contact_per_page']->setLabel($l->text('yncontactimporter', 'settings_contact_per_page'))->setValue($configs['contact_per_page'])->addValidator($miValidator)->setRequired(true);
$this->addElement($textField['contact_per_page']);
//Maximum invite per times
$textField['max_invite_per_times'] = new TextField('max_invite_per_times');
$textField['max_invite_per_times']->setLabel($l->text('yncontactimporter', 'settings_max_invite_per_times'))->setValue($configs['max_invite_per_times'])->addValidator($miValidator)->setRequired(true);
$this->addElement($textField['max_invite_per_times']);
//Default invite message
$textField['default_invite_message'] = new Textarea('default_invite_message');
$textField['default_invite_message']->setLabel($l->text('yncontactimporter', 'settings_default_invite_message'))->setValue($configs['default_invite_message']);
$this->addElement($textField['default_invite_message']);
// Logo width
$textField['logo_width'] = new TextField('logo_width');
$textField['logo_width']->setLabel($l->text('yncontactimporter', 'settings_logo_width'))->setValue($configs['logo_width'])->addValidator($miValidator)->setRequired(true);
$this->addElement($textField['logo_width']);
// Logo Height
$textField['logo_height'] = new TextField('logo_height');
$textField['logo_height']->setLabel($l->text('yncontactimporter', 'settings_logo_height'))->setValue($configs['logo_height'])->addValidator($miValidator)->setRequired(true);
$this->addElement($textField['logo_height']);
$submit = new Submit('submit');
$submit->setValue($l->text('yncontactimporter', 'save_btn_label'));
$submit->addAttribute('class', 'ow_ic_save ow_positive');
$this->addElement($submit);
}
示例5: __construct
/**
* Class constructor
*
*/
public function __construct($plugins)
{
parent::__construct('configForm');
$language = OW::getLanguage();
$values = OW::getConfig()->getValues('uheader');
if ($plugins['photo']) {
$field = new CheckboxField('photo_share');
$field->setId('photo_share_check');
$field->setValue($values['photo_share']);
$this->addElement($field);
$field = new TextField('photo_album_name');
$field->setValue(OW::getLanguage()->text('uheader', 'default_photo_album_name'));
$field->setRequired();
$this->addElement($field);
}
$field = new TextField('cover_height');
$field->setValue($values['cover_height']);
$field->addValidator(new IntValidator(self::COVER_MIN_HEIGHT, self::COVER_MAX_HEIGHT));
$field->setRequired();
$this->addElement($field);
// submit
$submit = new Submit('save');
$submit->setValue($language->text('uheader', 'config_save_label'));
$this->addElement($submit);
}
示例6: getUploadErrorMessage
public function getUploadErrorMessage($errorCode)
{
$message = '';
if (!isset($errorCode)) {
return false;
}
$language = OW::getLanguage();
if ($errorCode != UPLOAD_ERR_OK) {
switch ($errorCode) {
case UPLOAD_ERR_INI_SIZE:
$message = $language->text('base', 'upload_file_max_upload_filesize_error');
break;
case UPLOAD_ERR_PARTIAL:
$message = $language->text('base', 'upload_file_file_partially_uploaded_error');
break;
case UPLOAD_ERR_NO_FILE:
$message = $language->text('base', 'upload_file_no_file_error');
break;
case UPLOAD_ERR_NO_TMP_DIR:
$error = $language->text('base', 'upload_file_no_tmp_dir_error');
$message;
case UPLOAD_ERR_CANT_WRITE:
$message = $language->text('base', 'upload_file_cant_write_file_error');
break;
case UPLOAD_ERR_EXTENSION:
$message = $language->text('base', 'upload_file_invalid_extention_error');
break;
default:
$message = $language->text('base', 'upload_file_fail');
}
}
return $message;
}
示例7: setCustomMetaInfo
public function setCustomMetaInfo()
{
OW::getDocument()->setDescription(null);
if (OW::getLanguage()->valueExist('base', "local_page_meta_tags_{$this->getDocumentKey()}")) {
OW::getDocument()->addCustomHeadInfo(OW::getLanguage()->text('base', "local_page_meta_tags_{$this->getDocumentKey()}"));
}
}
示例8: __construct
public function __construct($name)
{
parent::__construct($name);
$this->setAction(OW::getRouter()->urlForRoute('ocsaffiliates.action_signup'));
$this->setAjax();
$lang = OW::getLanguage();
$affName = new TextField('name');
$affName->setRequired(true);
$affName->setLabel($lang->text('ocsaffiliates', 'affiliate_name'));
$this->addElement($affName);
$email = new TextField('email');
$email->setRequired(true);
$email->setLabel($lang->text('ocsaffiliates', 'email'));
$email->addValidator(new EmailValidator());
$this->addElement($email);
$password = new PasswordField('password');
$password->setRequired(true);
$password->setLabel($lang->text('ocsaffiliates', 'password'));
$this->addElement($password);
$payment = new Textarea('payment');
$payment->setRequired(true);
$payment->setLabel($lang->text('ocsaffiliates', 'payment_details'));
$this->addElement($payment);
if (OW::getConfig()->getValue('ocsaffiliates', 'terms_agreement')) {
$terms = new CheckboxField('terms');
$validator = new RequiredValidator();
$validator->setErrorMessage($lang->text('ocsaffiliates', 'terms_required_msg'));
$terms->addValidator($validator);
$this->addElement($terms);
}
$submit = new Submit('signup');
$submit->setValue($lang->text('ocsaffiliates', 'signup_btn'));
$this->addElement($submit);
$this->bindJsFunction(Form::BIND_SUCCESS, "function(data){\n if ( !data.result ) {\n OW.error(data.error);\n }\n else {\n document.location.reload();\n }\n }");
}
示例9: __construct
public function __construct()
{
parent::__construct('FindWhiteIp');
$submit = new Submit('search');
$submit->setValue(OW::getLanguage()->text('watchdog', 'search'));
$this->addElement($submit);
}
示例10: payeer_add_admin_notification
function payeer_add_admin_notification(BASE_CLASS_EventCollector $coll)
{
$billingService = BOL_BillingService::getInstance();
if (!mb_strlen($billingService->getGatewayConfigValue(BILLINGPAYEER_CLASS_PayeerAdapter::GATEWAY_KEY, 'm_key')) && !mb_strlen($billingService->getGatewayConfigValue(BILLINGPAYEER_CLASS_PayeerAdapter::GATEWAY_KEY, 'm_shop'))) {
$coll->add(OW::getLanguage()->text('billingpayeer', 'plugin_configuration_notice', array('url' => OW::getRouter()->urlForRoute('billing_payeer_admin'))));
}
}
示例11: __construct
public function __construct()
{
parent::__construct('add-album');
$this->setAjax();
$this->setAjaxResetOnSuccess(FALSE);
$this->setAction(OW::getRouter()->urlFor('PHOTO_CTRL_Photo', 'ajaxResponder'));
$ajaxFunc = new HiddenField('ajaxFunc');
$ajaxFunc->setValue('ajaxMoveToAlbum');
$ajaxFunc->setRequired();
$this->addElement($ajaxFunc);
$fromAlbum = new HiddenField('from-album');
$fromAlbum->setRequired();
$fromAlbum->addValidator(new PHOTO_CLASS_AlbumOwnerValidator());
$this->addElement($fromAlbum);
$toAlbum = new HiddenField('to-album');
$this->addElement($toAlbum);
$photos = new HiddenField('photos');
$photos->setRequired();
$this->albumPhotosValidator = new AlbumPhotosValidator();
$photos->addValidator($this->albumPhotosValidator);
$this->addElement($photos);
$albumName = new TextField('album-name');
$albumName->setRequired();
$albumName->addValidator(new PHOTO_CLASS_AlbumNameValidator(FALSE));
$albumName->setHasInvitation(TRUE);
$albumName->setInvitation(OW::getLanguage()->text('photo', 'album_name'));
$albumName->addAttribute('class', 'ow_smallmargin');
$this->addElement($albumName);
$desc = new Textarea('desc');
$desc->setHasInvitation(TRUE);
$desc->setInvitation(OW::getLanguage()->text('photo', 'album_desc'));
$this->addElement($desc);
$this->addElement(new Submit('add'));
}
示例12: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
if (!OW::getUser()->isAdmin()) {
throw new AuthenticateException();
}
if (!OW::getRequest()->isAjax()) {
$document = OW::getDocument();
$document->setMasterPage(new ADMIN_CLASS_MasterPage());
$this->setPageTitle(OW::getLanguage()->text('admin', 'page_default_title'));
}
BOL_PluginService::getInstance()->checkManualUpdates();
$plugin = BOL_PluginService::getInstance()->findNextManualUpdatePlugin();
$handlerParams = OW::getRequestHandler()->getHandlerAttributes();
// TODO refactor shortcut below
if (!defined('OW_PLUGIN_XP') && $plugin !== null) {
if ($handlerParams['controller'] === 'ADMIN_CTRL_Plugins' && $handlerParams['action'] === 'manualUpdateRequest') {
//action
} else {
throw new RedirectException(OW::getRouter()->urlFor('ADMIN_CTRL_Plugins', 'manualUpdateRequest', array('key' => $plugin->getKey())));
}
}
// TODO temp admin pge inform event
function admin_check_if_admin_page()
{
return true;
}
OW::getEventManager()->bind('admin.check_if_admin_page', 'admin_check_if_admin_page');
}
示例13: __construct
/**
* Constructor.
*/
public function __construct($ajax = false)
{
parent::__construct();
$form = new Form('sign-in');
$form->setAction("");
$username = new TextField('identity');
$username->setRequired(true);
$username->setHasInvitation(true);
$username->setInvitation(OW::getLanguage()->text('base', 'component_sign_in_login_invitation'));
$form->addElement($username);
$password = new PasswordField('password');
$password->setHasInvitation(true);
$password->setInvitation('password');
$password->setRequired(true);
$form->addElement($password);
$remeberMe = new CheckboxField('remember');
$remeberMe->setValue(true);
$remeberMe->setLabel(OW::getLanguage()->text('base', 'sign_in_remember_me_label'));
$form->addElement($remeberMe);
$submit = new Submit('submit');
$submit->setValue(OW::getLanguage()->text('base', 'sign_in_submit_label'));
$form->addElement($submit);
$this->addForm($form);
if ($ajax) {
$form->setAjaxResetOnSuccess(false);
$form->setAjax();
$form->setAction(OW::getRouter()->urlFor('BASE_CTRL_User', 'ajaxSignIn'));
$form->bindJsFunction(Form::BIND_SUCCESS, 'function(data){if( data.result ){if(data.message){OW.info(data.message);}setTimeout(function(){window.location.reload();}, 1000);}else{OW.error(data.message);}}');
$this->assign('forgot_url', OW::getRouter()->urlForRoute('base_forgot_password'));
}
$this->assign('joinUrl', OW::getRouter()->urlForRoute('base_join'));
}
示例14: __construct
public function __construct($data)
{
$script = UTIL_JsGenerator::composeJsString('
OWM.bind("mailbox.ready", function(readyStatus){
if (readyStatus == 2){
OWM.conversation = new MAILBOX_Conversation({$params});
OWM.conversationView = new MAILBOX_MailConversationView({model: OWM.conversation});
}
});
', array('params' => $data));
OW::getDocument()->addOnloadScript($script);
OW::getLanguage()->addKeyForJs('mailbox', 'text_message_invitation');
$form = new MAILBOX_MCLASS_NewMailMessageForm($data['conversationId'], $data['opponentId']);
$this->addForm($form);
$this->assign('data', $data);
$this->assign('defaultAvatarUrl', BOL_AvatarService::getInstance()->getDefaultAvatarUrl());
$firstMessage = MAILBOX_BOL_ConversationService::getInstance()->getFirstMessage($data['conversationId']);
if (empty($firstMessage)) {
$actionName = 'send_message';
} else {
$actionName = 'reply_to_message';
}
$isAuthorized = OW::getUser()->isAuthorized('mailbox', $actionName);
if (!$isAuthorized) {
$status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', $actionName);
if ($status['status'] == BOL_AuthorizationService::STATUS_PROMOTED) {
$this->assign('sendAuthMessage', $status['msg']);
} elseif ($status['status'] != BOL_AuthorizationService::STATUS_AVAILABLE) {
$this->assign('sendAuthMessage', OW::getLanguage()->text('mailbox', $actionName . '_permission_denied'));
}
}
}
示例15: __construct
/**
* Class constructor
*
*/
public function __construct()
{
parent::__construct('configSaveForm');
$language = OW::getLanguage();
$configs = OW::getConfig()->getValues('googlelocation');
$element = new TextField('api_key');
$element->setValue($configs['api_key']);
$validator = new StringValidator(0, 40);
$validator->setErrorMessage($language->text('googlelocation', 'api_key_too_long'));
$element->addValidator($validator);
$this->addElement($element);
$options = array(GOOGLELOCATION_BOL_LocationService::DISTANCE_UNITS_MILES => $language->text('googlelocation', 'miles'), GOOGLELOCATION_BOL_LocationService::DISTANCE_UNITS_KM => $language->text('googlelocation', 'kms'));
$distanseUnits = new Selectbox('distanse_units');
$distanseUnits->setOptions($options);
$distanseUnits->setValue(GOOGLELOCATION_BOL_LocationService::getInstance()->getDistanseUnits());
$distanseUnits->setHasInvitation(false);
$this->addElement($distanseUnits);
$restrictions = new Selectbox('country_restriction');
$restrictions->setValue(!empty($configs['country_restriction']) ? $configs['country_restriction'] : null);
$restrictions->setOptions($this->countryList);
$restrictions->setInvitation(OW::getLanguage()->text('googlelocation', 'no_country_restriction'));
$this->addElement($restrictions);
$autofill = OW::getConfig()->getValue('googlelocation', 'auto_fill_location_on_search');
$autoFillLocationOnSearch = new CheckboxField('auto_fill_location_on_search');
$autoFillLocationOnSearch->setValue(empty($autofill) || $autofill == '0' ? false : $autofill);
$this->addElement($autoFillLocationOnSearch);
// submit
$submit = new Submit('save');
$submit->setValue($language->text('base', 'edit_button'));
$this->addElement($submit);
}