本文整理汇总了PHP中intl_get函数的典型用法代码示例。如果您正苦于以下问题:PHP intl_get函数的具体用法?PHP intl_get怎么用?PHP intl_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了intl_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onSubmit
function onSubmit($vals)
{
// 1. prepare vals for insertion
if ($vals['contact_url'] == 'http://') {
$vals['contact_url'] = '';
}
if ($vals['loc_map'] == 'http://') {
$vals['loc_map'] = '';
}
$vals['details'] = nl2br(wordwrap(htmlentities_compat($vals['details']), 70, "\n", true));
if (!$vals['public'] || empty($vals['public'])) {
$vals['public'] = 'no';
}
if (!$vals['media'] || empty($vals['media'])) {
$vals['media'] = 'no';
}
if (!empty($vals['loc_addr2'])) {
$vals['loc_address'] .= "\n" . $vals['loc_addr2'];
}
$data = array('title' => $vals['title'], 'date' => $vals['date'], 'until_date' => $vals['end_date'], 'time' => $vals['time'], 'until_time' => $vals['end_time'], 'category' => $vals['category'], 'audience' => $vals['audience'], 'details' => $vals['details'], 'contact' => $vals['contact'], 'contact_email' => $vals['contact_email'], 'contact_phone' => $vals['contact_phone'], 'contact_url' => $vals['contact_url'], 'loc_name' => $vals['loc_name'], 'loc_address' => $vals['loc_address'], 'loc_city' => $vals['loc_city'], 'loc_province' => $vals['loc_province'], 'loc_country' => $vals['loc_country'], 'sponsor' => $vals['sponsor'], 'rsvp' => $vals['rsvp'], 'public' => $vals['public'], 'media' => $vals['media'], 'sitellite_status' => 'draft', 'sitellite_access' => 'public');
if (session_valid()) {
$data['sitellite_owner'] = session_username();
$data['sitellite_team'] = session_team();
}
// 2. submit event as 'draft'
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteevent_event');
$res = $rex->create($data, 'Event submission.');
$vals['id'] = $res;
// 3. email notification
@mail(appconf('submissions'), 'Event Submission Notice', template_simple('submission_email.spt', $vals));
// 4. thank you screen
page_title(intl_get('Thank You!'));
echo template_simple('submissions.spt');
}
示例2: sitesearch_filter_uptime
function sitesearch_filter_uptime($duration)
{
$days = floor($duration / 86400);
$hours = floor(($duration - $days * 86400) / 3600);
$mins = ceil(($duration - $days * 86400 - $hours * 3600) / 60);
return $days . ' ' . intl_get('days') . ', ' . $hours . ' ' . intl_get('hours') . ', ' . $mins . ' ' . intl_get('minutes');
}
示例3: sitepoll_virtual_enable_comments
function sitepoll_virtual_enable_comments(&$obj)
{
if ($obj->enable_comments == 'no') {
return intl_get('Disabled');
}
return db_shift('select count(*) from sitepoll_comment where poll = ?', $obj->id);
}
示例4: SitepresenterEditSlideForm
function SitepresenterEditSlideForm()
{
parent::MailForm();
$this->parseSettings('inc/app/sitepresenter/forms/edit/slide/settings.php');
page_add_script('
function cms_cancel (f) {
if (arguments.length == 0) {
window.location.href = "/index/cms-app";
} else {
if (f.elements["_return"] && f.elements["_return"].value.length > 0) {
window.location.href = f.elements["_return"].value;
} else {
window.location.href = "/index/sitepresenter-app";
}
}
return false;
}
');
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
global $cgi;
page_title(intl_get('Adding Slide to Presentation') . ': ' . db_shift('select title from sitepresenter_presentation where id = ?', $cgi->presentation));
$res = db_single('select * from sitepresenter_slide where id = ?', $cgi->id);
foreach (get_object_vars($res) as $k => $v) {
$this->widgets[$k]->setValue($v);
}
}
示例5: AppdocTranslationAddForm
function AppdocTranslationAddForm()
{
parent::MailForm();
$this->parseSettings('inc/app/appdoc/forms/translation/add/settings.php');
page_title(intl_get('Add Language'));
global $cgi;
if ($cgi->appname == 'GLOBAL') {
$this->_file = 'inc/lang/languages.php';
} else {
$this->_file = 'inc/app/' . $cgi->appname . '/lang/languages.php';
}
$list = array('no' => 'None');
$info = ini_parse($this->_file);
foreach ($info as $k => $v) {
$list[$k] = $v['name'];
}
$this->widgets['fallback']->setValues($list);
$this->widgets['default']->setValues(array('yes' => 'Yes', 'no' => 'No'));
if (count($list) == 1) {
$this->widgets['default']->setDefault('yes');
} else {
$this->widgets['default']->setDefault('no');
}
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="window.history.go (-1); return false"';
}
示例6: BoxchooserSettingsForm
function BoxchooserSettingsForm()
{
parent::MailForm();
page_title(intl_get('Box Settings'));
//set(array('title'=>'Add a Box'));
global $cgi;
//set
if (!$cgi->box) {
echo 'Missing parameter: box';
exit;
}
ini_add_filter('ini_filter_split_comma_single', array('rule 0', 'rule 1', 'rule 2', 'rule 3', 'rule 4', 'rule 5', 'rule 6', 'rule 7', 'rule 8', 'button 0', 'button 1', 'button 2', 'button 3', 'button 4', 'button 5', 'button 6', 'button 7', 'button 8'));
$this->_box_settings = ini_parse('inc/app/' . $cgi->app . '/boxes/' . $cgi->box . '/settings.php');
ini_clear();
unset($this->_box_settings['Meta']);
if (count($this->_box_settings) === 0) {
$this->onSubmit((array) $cgi);
return;
}
foreach ($this->_box_settings as $k => $v) {
$this->createWidget($k, $v);
}
$this->addWidget('hidden', 'app');
$this->addWidget('hidden', 'box');
$this->addWidget('hidden', 'name');
$w =& $this->addWidget('submit', 'sub');
$w->setValues(intl_get('Done'));
}
示例7: filter_translation_default
function filter_translation_default($v)
{
if ($v) {
return intl_get('Yes');
}
return intl_get('No');
}
示例8: SitetemplateEditsetForm
function SitetemplateEditsetForm()
{
parent::MailForm();
global $cgi;
$set = $cgi->set;
$this->parseSettings('inc/app/sitetemplate/forms/editset/settings.php');
$settings = array();
if (file_exists('inc/html/' . $set . '/config.ini.php')) {
$settings = ini_parse('inc/html/' . $set . '/config.ini.php', false);
}
$name = $settings['set_name'];
if (!$name) {
$name = $set;
}
$settings['set'] = $set;
//put form values into respective forms
foreach ($settings as $k => $v) {
$this->widgets[$k]->setDefault($v);
}
if (@file_exists('inc/html/' . $set . '/modes.php')) {
$this->widgets['modes']->setDefault(@join('', @file('inc/html/' . $set . '/modes.php')));
} else {
$this->widgets['modes']->setDefault($modesd);
}
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="history.go (-1); return false"';
page_title(intl_get('Editing Properties') . ': ' . $name);
}
示例9: onSubmit
function onSubmit($vals)
{
$vals['name'] = strtolower($vals['name']);
//make sure that file doesnt exit
if (file_exists('inc/html/' . $vals['set_name'] . '/' . $vals['name'] . '.css')) {
echo '<p>' . intl_get('A file with that name already exists. Choose a different file name.') . '</p>';
echo '<p>' . intl_get('Go <a href=javascript:history.back()>back</a> to choose a different file name.') . '</p>';
}
if (preg_match('/\\.css$/i', $vals['name'])) {
$ext = '';
} else {
$ext = '.css';
}
if (!file_overwrite('inc/html/' . $vals['set_name'] . '/' . $vals['name'] . $ext, $vals['body'])) {
page_title(intl_get('An Error Occurred'));
echo '<p>' . intl_get('The file was unable to be saved. Please verify your server settings before trying again.') . '</p>';
return;
}
umask(00);
chmod('inc/html/' . $vals['set_name'] . '/' . $vals['name'] . $ext, 0777);
list($set, $tpl) = explode('/', $vals['path']);
echo $set . ' ' . $tpl;
page_title('File Saved');
echo '<p><a href="' . site_prefix() . '/index/sitetemplate-templateselect-action?set_name=' . $vals['set_name'] . '">' . intl_get('Return to template set') . '</a></p>';
}
示例10: EditForm
function EditForm()
{
parent::MailForm();
global $cgi, $_helpdoc;
$this->addWidget('hidden', 'appname');
$this->addWidget('hidden', 'lang');
$this->addWidget('hidden', 'helpfile');
$w =& $this->addWidget('text', 'filename');
$w->alt = intl_get('File Name (ie. 001-about-myApp)');
$w->addRule('not empty', intl_get('You must specify a file name.'));
$w->addRule('not contains ".."', intl_get('Your file name contains invalid characters.'));
$w->setValue($cgi->helpfile);
$w =& $this->addWidget('text', 'title');
$w->alt = intl_get('Title');
$w->addRule('not empty', intl_get('You must specify a title.'));
$w->setValue($_helpdoc->title);
session_set('imagechooser_path', 'inc/app/' . $cgi->appname . '/pix');
$this->extra = 'onsubmit="xed_copy_value (this, \'body\')"';
$w =& $this->addWidget('xed.Widget.Xeditor', 'body');
$w->setValue($_helpdoc->body);
$w =& $this->addWidget('msubmit', 'submit_button');
$b =& $w->getButton();
$b->setValues(intl_get('Save'));
$b =& $w->addButton('submit_button');
$b->setValues(intl_get('Cancel'));
$b->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/appdoc-helpdoc-action?appname=' . $cgi->appname . '&lang=' . $cgi->lang . '\'; return false"';
}
示例11: onSubmit
function onSubmit($vals)
{
global $cgi;
if ($vals['submit_buttons'] == 'Cancel') {
header('Location: ' . $vals['refer']);
exit;
}
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteblog_post');
$id = $cgi->_key;
$subject = $vals['subject'];
$author = $vals['author'];
$status = $vals['status'];
$category = $vals['category'];
$created = $vals['created'];
$body = $vals['body'];
$data = array('subject' => $subject, 'author' => $author, 'status' => $status, 'category' => $category, 'created' => $created, 'body' => $body);
if (!empty($id)) {
if (!$data['created']) {
unset($data['created']);
}
$method = $rex->determineAction($id);
$rex->{$method}($id, $data);
} else {
if (!$data['created']) {
$data['created'] = date('Y-m-d H:i:s');
}
$id = $rex->create($data);
}
session_set('sitellite_alert', intl_get('Your item has been saved.'));
// view post
if (!empty($vals['_return'])) {
header('Location: ' . $vals['_return']);
} else {
header('Location: ' . site_prefix() . '/index/siteblog-post-action/id.' . $id . '/title.' . siteblog_filter_link_title($subject));
}
// ping blog directories via pingomatic.com
$host = 'rpc.pingomatic.com';
$path = '';
$out = template_simple('ping.spt', $obj);
$len = strlen($out);
$req = 'POST /' . $path . " HTTP/1.0\r\n";
$req .= 'User-Agent: Sitellite ' . SITELLITE_VERSION . "/SiteBlog\r\n";
$req .= 'Host: ' . $host . "\r\n";
$req .= "Content-Type: text/xml\r\n";
$req .= 'Content-Length: ' . $len . "\r\n\r\n";
$req .= $out . "\r\n";
if ($ph = @fsockopen($host, 80)) {
@fputs($ph, $req);
//echo '<pre>';
//echo htmlentities ($req);
while (!@feof($ph)) {
$res = @fgets($ph, 128);
//echo htmlentities ($res);
}
@fclose($ph);
}
exit;
}
示例12: ExampleContactForm
function ExampleContactForm()
{
parent::MailForm();
// load settings file
$this->parseSettings('inc/app/example/forms/contact/settings.php');
// set the page title
page_title(intl_get('Contact Us'));
}
示例13: usradm_msg
function usradm_msg($msg)
{
$messages = array('restored' => intl_get('The item has been restored.'), 'deleted' => intl_get('The items have been deleted.'), 'sent' => intl_get('Your message has been sent.'));
if (isset($messages[$msg])) {
return $messages[$msg];
} else {
return intl_get($msg);
}
}
示例14: onSubmit
function onSubmit($vals)
{
if (!@mail($this->member->email, $vals['subject'], $vals['message'], 'From: ' . $vals['email'])) {
page_title('Unknown Error');
echo '<p>' . intl_get('An error occurred trying to send the message. Please try again later.') . '</p>';
return;
}
page_title(intl_get('Message Sent'));
echo '<p>' . intl_get('Your message has been sent.') . '</p>';
}
示例15: onSubmit
function onSubmit($vals)
{
loader_import('news.Comment');
$c = new NewsComment();
$vals['ts'] = date('Y-m-d H:i:s');
unset($vals['submit_button']);
$c->modify($vals['id'], $vals);
page_title(intl_get('Comment Updated'));
echo template_simple('comment_updated.spt', $vals);
}