当前位置: 首页>>代码示例>>PHP>>正文


PHP lang函数代码示例

本文整理汇总了PHP中lang函数的典型用法代码示例。如果您正苦于以下问题:PHP lang函数的具体用法?PHP lang怎么用?PHP lang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了lang函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tickets_handle_on_milestone_add_links

/**
 * Handle on_milestone_add_links event
 *
 * @param Milestone $milestone
 * @param User $user
 * @param array $links
 * @return null
 */
function tickets_handle_on_milestone_add_links($milestone, $user, &$links)
{
    if ($user->getProjectPermission('ticket', $milestone->getProject()) >= PROJECT_PERMISSION_CREATE) {
        $links[lang('Ticket')] = tickets_module_add_ticket_url($milestone->getProject(), array('milestone_id' => $milestone->getId()));
    }
    // if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:15,代码来源:on_milestone_add_links.php

示例2: submitInfo

 public function submitInfo()
 {
     $this->load->model("settings_model");
     // Gather the values
     $values = array('nickname' => htmlspecialchars($this->input->post("nickname")), 'location' => htmlspecialchars($this->input->post("location")));
     // Change language
     if ($this->config->item('show_language_chooser')) {
         $values['language'] = $this->input->post("language");
         if (!is_dir("application/language/" . $values['language'])) {
             die("3");
         } else {
             $this->user->setLanguage($values['language']);
             $this->plugins->onSetLanguage($this->user->getId(), $values['language']);
         }
     }
     // Remove the nickname field if it wasn't changed
     if ($values['nickname'] == $this->user->getNickname()) {
         $values = array('location' => $this->input->post("location"));
     } elseif (strlen($values['nickname']) < 4 || strlen($values['nickname']) > 14 || !preg_match("/[A-Za-z0-9]*/", $values['nickname'])) {
         die(lang("nickname_error", "ucp"));
     } elseif ($this->internal_user_model->nicknameExists($values['nickname'])) {
         die("2");
     }
     if (strlen($values['location']) > 32 && !ctype_alpha($values['location'])) {
         die(lang("location_error", "ucp"));
     }
     $this->settings_model->saveSettings($values);
     $this->plugins->onSaveSettings($this->user->getId(), $values);
     die("1");
 }
开发者ID:saqar,项目名称:FusionCMS-themes-and-modules,代码行数:30,代码来源:settings.php

示例3: delAction

 /**
  * 删除
  */
 public function delAction()
 {
     $dir = base64_decode($this->get('name'));
     $name = $this->dir . $dir;
     $name = substr($name, -1) == '/' ? substr($name, 0, -1) : $name;
     if ($this->checkFileName($name)) {
         $this->adminMsg(lang('m-con-20'));
     }
     if ($this->dir == $name || $this->dir == $name . '/') {
         $this->adminMsg(lang('a-att-0'));
     }
     if (!file_exists($name)) {
         $this->adminMsg(lang('a-att-1', array('1' => $name)));
     }
     if (is_dir($name)) {
         //删除目录
         $this->delDir($name);
         $this->adminMsg(lang('a-att-2'), url('admin/attachment/index', array('dir' => base64_encode(str_replace(basename($dir), '', $dir)))), 3, 1, 1);
     }
     if (is_file($name)) {
         //删除文件
         unlink($name);
         $this->adminMsg(lang('a-att-3'), url('admin/attachment/index', array('dir' => base64_encode(str_replace(basename($dir), '', $dir)))), 3, 1, 1);
     }
 }
开发者ID:rainbow88,项目名称:hummel,代码行数:28,代码来源:AttachmentController.php

示例4: all_notification

 public function all_notification()
 {
     $data = $this->data;
     $data['menu_name']['nama'] = lang('lbl_notification');
     $data['menu_name']['keterangan'] = lang('lbl_all_notification');
     $data['datatable'] = "";
     $data['method'] = $this->method_master;
     $data['no_left_menu'] = TRUE;
     $data['this_modul'] = FALSE;
     $data['controller'] = $this->controller_notification;
     $data['notif'] = $this->model_basic->get_data($this->tbl_notifikasi, array('where_array' => array('id_group' => $data['user_level']), 'limit' => 20, 'sort_by' => 'id', 'sort' => 'DESC'))->result();
     foreach ($data['notif'] as $n) {
         $user = $this->model_basic->get_data($this->tbl_user, array('where_array' => array('id' => $n->id_user)))->row();
         $data['peg'][$n->id] = $this->model_basic->get_data($this->tbl_pegawai, array('where_array' => array('id' => $user->id_pegawai)))->row();
         $waktu = explode(' ', $n->tanggal);
         $data['waktu'][$n->id] = $this->mydate($waktu[0]) . ' ' . $waktu[1];
     }
     $data['breadcrumbs'] = array(1 => array('target' => $this->controller_notification . '/all_notification', 'nama' => $data['menu_name']['nama']));
     if (count($data['modul']) > 0) {
         $this->load->view('template/header', $data);
     } else {
         $this->load->view('template/header_no_module', $data);
     }
     $this->load->view('global/notification');
     $this->load->view('template/footer');
 }
开发者ID:92bayu,项目名称:juragan,代码行数:26,代码来源:notification.php

示例5: __construct

 /**
  * Constructor
  *
  * @see Filter::$options for the format of the options array
  *
  * @param array $options An associative array of options
  */
 public function __construct(array $options = array())
 {
     $this->name = 'filter_by_site';
     $this->label = 'site';
     $this->placeholder = lang('filter_by_site');
     $this->options = $options;
 }
开发者ID:vigm,项目名称:advancedMD,代码行数:14,代码来源:Site.php

示例6: display_settings

 /**
  * Display settings sub-form for this variable type
  *
  * @param      mixed     $var_id        The id of the variable: 'new' or numeric
  * @param      array     $var_settings  The settings of the variable
  * @return     array
  */
 function display_settings($var_id, $var_settings)
 {
     // -------------------------------------
     //  Init return value
     // -------------------------------------
     $r = array();
     // -------------------------------------
     //  Check current value from settings
     // -------------------------------------
     $rows = $this->get_setting('rows', $var_settings);
     // -------------------------------------
     //  Build settings for rows
     // -------------------------------------
     $r[] = array($this->setting_label(lang('variable_rows')), form_input(array('name' => $this->input_name('rows'), 'value' => $rows, 'maxlength' => '4', 'class' => 'x-small')));
     // -------------------------------------
     //  Build settings text_direction
     // -------------------------------------
     $dir_options = '';
     foreach (array('ltr', 'rtl') as $dir) {
         $dir_options .= '<label class="low-radio">' . form_radio($this->input_name('text_direction'), $dir, $this->get_setting('text_direction', $var_settings) == $dir) . ' ' . lang("text_direction_{$dir}") . '</label>';
     }
     $r[] = array($this->setting_label(lang('text_direction')), $dir_options);
     // -------------------------------------
     //  Return output
     // -------------------------------------
     return $r;
 }
开发者ID:kentonquatman,项目名称:iofa,代码行数:34,代码来源:vt.low_rte.php

示例7: userCakeAddUser

 public function userCakeAddUser()
 {
     global $db, $emailActivation, $websiteUrl, $db_table_prefix;
     //Construct a secure hash for the plain text password
     $secure_pass = generateHash($this->clean_password);
     //Construct a unique activation token
     $this->activation_token = generateActivationToken();
     //Do we need to send out an activation email?
     if ($emailActivation) {
         //User must activate their account first
         $this->user_active = 0;
         $mail = new userCakeMail();
         //Build the activation message
         $activation_message = lang("ACTIVATION_MESSAGE", array($websiteUrl, $this->activation_token));
         //Define more if you want to build larger structures
         $hooks = array("searchStrs" => array("#ACTIVATION-MESSAGE", "#ACTIVATION-KEY", "#USERNAME#"), "subjectStrs" => array($activation_message, $this->activation_token, $this->unclean_username));
         /* Build the template - Optional, you can just use the sendMail function 
         			Instead to pass a message. */
         if (!$mail->newTemplateMsg("new-registration.txt", $hooks)) {
             $this->mail_failure = true;
         } else {
             //Send the mail. Specify users email here and subject.
             //SendMail can have a third parementer for message if you do not wish to build a template.
             if (!$mail->sendMail($this->clean_email, "Επιβεβαιώστε την εγγραφή σας στο Σύλλογο Αποφοίτων")) {
                 $this->mail_failure = true;
             }
         }
     } else {
         //Instant account activation
         $this->user_active = 1;
     }
     //Insert the user into the database providing no errors have been found.
     $sql = "INSERT INTO `" . $db_table_prefix . "Users` (\n\t\t\t\t`Username`,\n\t\t\t\t`Username_Clean`,\n\t\t\t\t`Password`,\n\t\t\t\t`Email`,\n\t\t\t\t`ActivationToken`,\n\t\t\t\t`LastActivationRequest`,\n\t\t\t\t`LostPasswordRequest`, \n\t\t\t\t`Active`,\n\t\t\t\t`Group_ID`,\n\t\t\t\t`SignUpDate`,\n\t\t\t\t`LastSignIn`\n\t\t\t\t)\n\t\t \t\tVALUES (\n\t\t\t\t'" . $db->sql_escape($this->unclean_username) . "',\n\t\t\t\t'" . $db->sql_escape($this->clean_username) . "',\n\t\t\t\t'" . $secure_pass . "',\n\t\t\t\t'" . $db->sql_escape($this->clean_email) . "',\n\t\t\t\t'" . $this->activation_token . "',\n\t\t\t\t'" . time() . "',\n\t\t\t\t'0',\n\t\t\t\t'" . $this->user_active . "',\n\t\t\t\t'1',\n\t\t\t\t'" . time() . "',\n\t\t\t\t'0'\n\t\t\t\t)";
     return $db->sql_query($sql);
 }
开发者ID:skarabasakis,项目名称:alumniclub_usercake,代码行数:35,代码来源:class.newuser.php

示例8: getsetting

 function getsetting()
 {
     global $_G;
     $settings = $this->setting;
     if ($settings['catid']) {
         $settings['catid']['value'][] = array(0, lang('portalcp', 'block_all_category'));
         loadcache('portalcategory');
         foreach ($_G['cache']['portalcategory'] as $value) {
             if ($value['level'] == 0) {
                 $settings['catid']['value'][] = array($value['catid'], $value['catname']);
                 if ($value['children']) {
                     foreach ($value['children'] as $catid2) {
                         $value2 = $_G['cache']['portalcategory'][$catid2];
                         $settings['catid']['value'][] = array($value2['catid'], '-- ' . $value2['catname']);
                         if ($value2['children']) {
                             foreach ($value2['children'] as $catid3) {
                                 $value3 = $_G['cache']['portalcategory'][$catid3];
                                 $settings['catid']['value'][] = array($value3['catid'], '---- ' . $value3['catname']);
                             }
                         }
                     }
                 }
             }
         }
     }
     if ($settings['tag']) {
         $tagnames = article_tagnames();
         foreach ($tagnames as $k => $v) {
             $settings['tag']['value'][] = array($k, $v);
         }
     }
     return $settings;
 }
开发者ID:dalinhuang,项目名称:healthshop,代码行数:33,代码来源:block_article.php

示例9: site

 public function site()
 {
     $api = array("user_id" => $this->user->getId(), "username" => $this->user->getUsername(), "user_ip" => $this->input->ip_address());
     $vote_site_id = $this->input->post('id');
     //The site where we are voting for.
     if (!$vote_site_id) {
         die("Please specify topsite ID");
     }
     //Get the vote site info, returns false if the site does not exists!!
     $vote_site = $this->vote_model->getVoteSite($vote_site_id);
     //Check if they already voted with that ip.
     $can_vote = $this->vote_model->canVote($vote_site_id);
     //Check if that site exists and that the user didn't voted for it yet.
     if ($vote_site && $can_vote) {
         //Update the vp if needed or else just go to the url if we got vote callback enabled.
         if ($vote_site['callback_enabled']) {
             $vote_url = preg_replace("/\\{user_id\\}/", $this->user->getId(), $vote_site['vote_url']);
             if ($this->input->post("isFirefoxHerpDerp")) {
                 die($vote_url);
             }
             redirect($vote_url);
         } else {
             $this->vote_model->vote_log($api['user_id'], $api['user_ip'], $vote_site_id);
             $this->vote_model->updateVp($this->user->getId(), $vote_site['points_per_vote']);
             $this->plugins->onVote($api['user_id'], $vote_site);
             if ($this->input->post("isFirefoxHerpDerp")) {
                 die($vote_site['vote_url']);
             }
             redirect($vote_site['vote_url']);
         }
     } else {
         die(lang("already_voted", "vote"));
     }
 }
开发者ID:ahuraa,项目名称:Yekta-Cms,代码行数:34,代码来源:vote.php

示例10: index

 /**
  * Settings form
  * 
  * @param void
  * @return null
  */
 function index()
 {
     js_assign('test_svn_url', assemble_url('admin_source_test_svn'));
     $source_data = $this->request->post('source');
     if (!is_foreachable($source_data)) {
         $source_data = array('svn_path' => ConfigOptions::getValue('source_svn_path'), 'svn_config_dir' => ConfigOptions::getValue('source_svn_config_dir'), 'source_svn_use_output_redirect' => ConfigOptions::getValue('source_svn_use_output_redirect'), 'source_svn_trust_server_cert' => ConfigOptions::getValue('source_svn_trust_server_cert'));
     }
     // if
     if ($this->request->isSubmitted()) {
         $svn_path = array_var($source_data, 'svn_path', null);
         $svn_path = $svn_path ? with_slash($svn_path) : null;
         ConfigOptions::setValue('source_svn_path', $svn_path);
         $svn_config_dir = array_var($source_data, 'svn_config_dir') == '' ? null : array_var($source_data, 'svn_config_dir');
         ConfigOptions::setValue('source_svn_config_dir', $svn_config_dir);
         $svn_use_output_redirection = array_var($source_data, 'source_svn_use_output_redirect') == "1";
         ConfigOptions::setValue('source_svn_use_output_redirect', $svn_use_output_redirection);
         $svn_trust_server_certificate = array_var($source_data, 'source_svn_trust_server_cert') == "1";
         ConfigOptions::setValue('source_svn_trust_server_cert', $svn_trust_server_certificate);
         flash_success("Source settings successfully saved");
         $this->redirectTo('admin_source');
     }
     // if
     if (!RepositoryEngine::executableExists()) {
         $this->wireframe->addPageMessage(lang("SVN executable not found. You won't be able to use this module"), 'error');
     }
     // if
     $this->smarty->assign(array('source_data' => $source_data));
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:34,代码来源:SourceAdminController.class.php

示例11: reject

 public function reject($id)
 {
     $this->auth->checkIfOperationIsAllowed('reject_overtime');
     $this->load->model('users_model');
     $this->load->model('delegations_model');
     $extra = $this->overtime_model->getExtras($id);
     if (empty($extra)) {
         redirect('notfound');
     }
     $employee = $this->users_model->getUsers($extra['employee']);
     $is_delegate = $this->delegations_model->isDelegateOfManager($this->user_id, $employee['manager']);
     if ($this->user_id == $employee['manager'] || $this->is_hr || $is_delegate) {
         $this->overtime_model->rejectExtra($id);
         $this->sendMail($id);
         $this->session->set_flashdata('msg', lang('overtime_reject_flash_msg_success'));
         if (isset($_GET['source'])) {
             redirect($_GET['source']);
         } else {
             redirect('overtime');
         }
     } else {
         log_message('error', 'User #' . $this->user_id . ' illegally tried to reject extra #' . $id);
         $this->session->set_flashdata('msg', lang('overtime_reject_flash_msg_error'));
         redirect('leaves');
     }
 }
开发者ID:HarkiratGhotra,项目名称:application,代码行数:26,代码来源:overtime.php

示例12: latest_fotos_configure

 public function latest_fotos_configure($action = 'show_settings', $widget_data = array())
 {
     if ($this->dx_auth->is_admin() == FALSE) {
         exit;
     }
     switch ($action) {
         case 'show_settings':
             //$this->display_tpl('latest_fotos_form', array('widget' => $widget_data));
             $this->render('latest_fotos_form', array('widget' => $widget_data));
             break;
         case 'update_settings':
             $this->load->library('Form_validation');
             $this->form_validation->set_rules('limit', lang("Image limit", 'gallery'), 'trim|required|integer');
             if ($this->form_validation->run($this) == FALSE) {
                 showMessage(validation_errors(), false, 'r');
                 exit;
             }
             $data = array('limit' => $_POST['limit'], 'order' => $_POST['order']);
             $this->load->module('admin/widgets_manager')->update_config($widget_data['id'], $data);
             showMessage(lang("Settings have been saved", 'gallery'));
             if ($_POST['action'] == 'tomain') {
                 pjax('/admin/widgets_manager/index');
             }
             break;
         case 'install_defaults':
             $data = array('limit' => 5, 'order' => 'latest');
             $this->load->module('admin/widgets_manager')->update_config($widget_data['id'], $data);
             break;
     }
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:30,代码来源:gallery_widgets.php

示例13: creat_payment

 /**
  * [creat_payment 创建支付]
  * @param  [type] $buyer   [description]
  * @param  [type] $pids    [description]
  * @param  [type] $amount  [description]
  * @param  [type] $tel     [description]
  * @param  [type] $address [description]
  * @return [type]          [description]
  */
 public function creat_payment($buyer, $pids, $amount, $tel, $address, $channel)
 {
     $arr = explode(',', $pids);
     $total_fee = 0;
     $title_str = "";
     foreach ($arr as $k => $v) {
         //传递参数被篡改
         if (!is_numeric($v)) {
             $this->error->output('TRANSACT_DATA');
         }
         $p = $this->production_model->get_production_by_id($v);
         //商品不存在,已售出,下架
         if (empty($p) || $p['status'] == 1 || $p['status'] == 2) {
             $this->error->output('NO_GOOD');
         }
         $total_fee += (double) $p['price'];
         $title_str .= $p['name'] . ", ";
     }
     //显示价格被篡改
     if ($total_fee != $amount) {
         $this->error->output('TRANSACT_DATA');
     }
     $order_no = time() . 'u_' . $buyer;
     $subject = lang('BUY_SUBJECT');
     $body = $title_str;
     $extra_common_param = array('buyer' => $buyer, 'pids' => $pids, 'amount' => $amount, 'tel' => $tel, 'address' => $address);
     $extra_common_param = json_encode($extra_common_param);
     //创建支付
     switch ($channel) {
         case 'alipay':
             return $this->_alipay();
             break;
     }
 }
开发者ID:897475686,项目名称:vc,代码行数:43,代码来源:transaction_service.php

示例14: smarty_function_select_default_assignment_filter

/**
 * Render select_default_assignment_filter control
 * 
 * Parameters:
 * 
 * - user - User - User using the page
 * - value - integer - ID of selected filter
 * - optional - boolean - Value is optional?
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_select_default_assignment_filter($params, &$smarty)
{
    $user = array_var($params, 'user', null, true);
    $value = array_var($params, 'value', null, true);
    $optional = array_var($params, 'optional', true, true);
    $default_filter_id = (int) ConfigOptions::getValue('default_assignments_filter');
    $default_filter = $default_filter_id ? AssignmentFilters::findById($default_filter_id) : null;
    $options = array();
    if (instance_of($default_filter, 'AssignmentFilter') && $optional) {
        $options[] = option_tag(lang('-- System Default (:filter) --', array('filter' => $default_filter->getName())), '');
    }
    // if
    $grouped_filters = AssignmentFilters::findGrouped($user, true);
    if (is_foreachable($grouped_filters)) {
        foreach ($grouped_filters as $group_name => $filters) {
            $group_options = array();
            foreach ($filters as $filter) {
                $group_options[] = option_tag($filter->getName(), $filter->getId(), array('selected' => $value == $filter->getId()));
            }
            // foreach
            if (count($options) > 0) {
                $options[] = option_tag('', '');
            }
            // if
            $options[] = option_group_tag($group_name, $group_options);
        }
        // foreach
    }
    // if
    return select_box($options, $params);
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:44,代码来源:function.select_default_assignment_filter.php

示例15: getsetting

 function getsetting()
 {
     global $_G;
     $settings = $this->setting;
     if ($settings['fids']) {
         loadcache('forums');
         $settings['fids']['value'][] = array(0, lang('portalcp', 'block_all_forum'));
         foreach ($_G['cache']['forums'] as $fid => $forum) {
             $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')) . $forum['name']);
         }
     }
     if ($settings['sortids']) {
         $defaultvalue = '';
         $query = DB::query("SELECT typeid, name, special FROM " . DB::table('forum_threadtype') . " ORDER BY typeid DESC");
         while ($threadtype = DB::fetch($query)) {
             if ($threadtype['special']) {
                 if (empty($defaultvalue)) {
                     $defaultvalue = $threadtype['typeid'];
                 }
                 $settings['sortids']['value'][] = array($threadtype['typeid'], $threadtype['name']);
             }
         }
         $settings['sortids']['default'] = $defaultvalue;
     }
     return $settings;
 }
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:26,代码来源:block_sort.php


注:本文中的lang函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。