本文整理汇总了PHP中Lang::t方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::t方法的具体用法?PHP Lang::t怎么用?PHP Lang::t使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::t方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTransaction
public function getTransaction($start_index, $results, $sort, $dir, $filter = false)
{
$query = "SELECT t.id_trans, t.date_creation, t.date_activated, t.paid, SUM(ti.price) as price, u.userid, u.firstname, u.lastname" . " FROM %adm_transaction as t" . " JOIN %adm_transaction_info as ti ON t.id_trans = ti.id_trans" . " JOIN %adm_user as u ON t.id_user = u.idst" . " WHERE 1";
$query .= " GROUP BY t.id_trans";
switch ($sort) {
case 'userid':
$query .= " ORDER BY u.userid " . $dir;
break;
case 'firstname':
$query .= " ORDER BY u.firstname " . $dir;
break;
case 'lastname':
$query .= " ORDER BY u.lastname " . $dir;
break;
case 'date_creation':
$query .= " ORDER BY t.date_creation " . $dir;
break;
case 'date_activated':
$query .= " ORDER BY t.date_activated " . $dir;
break;
}
$start_index === false ? '' : ($query .= " LIMIT " . $start_index . ", " . $results);
$result = sql_query($query);
$res = array();
while ($row = sql_fetch_assoc($result)) {
$row['userid'] = $this->acl_man->relativeId($row['userid']);
$row['date_creation'] = Format::date($row['date_creation'], 'datetime');
$row['date_activated'] = Format::date($row['date_activated'], 'datetime');
$row['paid'] = $row['paid'] == 1 ? Get::img('standard/status_active.png', Lang::t('_ACTIVATED', 'transaction')) : Get::img('standard/status_deactive.png', Lang::t('_NOT_ACTIVATED', 'transaction'));
$row['edit'] = '<a href="index.php?r=alms/transaction/mod&id_trans=' . $row['id_trans'] . '" title="' . Lang::t('_MOD', 'transaction') . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'transaction')) . '</a>';
$res[] = $row;
}
return $res;
}
示例2: getDateClassrooms
protected function getDateClassrooms($id_date)
{
$query = "SELECT DISTINCT classroom" . " FROM %lms_course_date_day" . " WHERE id_date = " . $id_date;
$result = sql_query($query);
$array_classroom = array();
while (list($id_classroom) = sql_fetch_row($result)) {
$array_classroom[$id_classroom] = $id_classroom;
}
$res = '';
$first = true;
if (isset($array_classroom[0])) {
$first = false;
$res .= Lang::t('_NOT_ASSIGNED', 'admin_date');
}
$query = "SELECT name" . " FROM %lms_classroom" . " WHERE idClassroom IN (" . implode(',', $array_classroom) . ")" . " ORDER BY name";
$result = sql_query($query);
while (list($name) = sql_fetch_row($result)) {
if ($first) {
$first = false;
$res .= $name;
} else {
$res .= ', ' . $name;
}
}
return $res;
}
示例3: getLabelsTask
public function getLabelsTask()
{
$start_index = Get::req('startIndex', DOTY_INT, 0);
$results = Get::req('results', DOTY_MIXED, Get::sett('visuItem', 25));
$sort = Get::req('sort', DOTY_MIXED, 'title');
$dir = Get::req('dir', DOTY_MIXED, 'asc');
$labels = $this->model->getLabels($start_index, $results, $sort, $dir);
$total_label = $this->model->getTotalLabelsCount();
$list = array();
$first = true;
$count = count($labels);
$counter = 0;
foreach ($labels as $value) {
$position = "";
if ($first) {
$position .= 'first';
$first = false;
}
$counter++;
if ($counter == $count) {
$position .= 'last';
}
$list[] = array('id_common_label' => $value[LABEL_ID_COMMON], 'title' => $value[LABEL_TITLE], 'description' => $this->_formatDescription($value[LABEL_DESCRIPTION], 100), 'position' => $position, 'sequence' => $value[LABEL_SEQUENCE], 'mod' => '<a href="index.php?r=alms/label/mod&id_common_label=' . $value[LABEL_ID_COMMON] . '" title="' . Lang::t('_MOD', 'label') . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'label')) . '</a>', 'del' => 'ajax.adm_server.php?r=alms/label/dellabel&id_common_label=' . $value[LABEL_ID_COMMON]);
}
$result = array('totalRecords' => $total_label, 'startIndex' => $start_index, 'sort' => $sort, 'dir' => $dir, 'rowsPerPage' => $results, 'results' => count($list), 'records' => $list);
echo $this->json->encode($result);
}
示例4: exportIt
public function exportIt($return)
{
return parent::exportIt($return);
$filename = $return['classname'] . "_" . date('Ymd');
$xls = new Excel($filename);
//$filename = $return['classname'] . "_" . date('Ymd') . ".xls";
//header("Content-Disposition: attachment; filename=\"$filename\"");
//header("Content-Type: application/vnd.ms-excel");
//$flag = false;
$xls->home();
foreach ($return['objs'] as $key => $obj) {
foreach ($obj as $name => $value) {
$xls->label(Lang::t($name));
$xls->right();
}
break;
}
$xls->down();
//print("\n");
foreach ($return['objs'] as $key => $obj) {
$xls->home();
foreach ($obj as $name => $value) {
$xls->label($value);
$xls->right();
}
$xls->down();
}
$xls->send();
exit;
}
示例5: actionIndex
public function actionIndex()
{
$this->hasPrivilege(Acl::ACTION_VIEW);
$this->pageTitle = Lang::t(Common::pluralize($this->resourceLabel));
$searchModel = Dept::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION], 'name');
$this->render('default/index', array('model' => $searchModel));
}
示例6: del
/**
* @param int $id contains the resource id
* @param string $back_url contains the back url (not used yet)
*/
function del($id, $back_url = NULL)
{
//checkPerm('view', false, 'storage');
unset($_SESSION['last_error']);
require_once _base_ . '/lib/lib.upload.php';
$path_to_file = '/appLms/' . Get::sett('pathlesson');
list($old_file) = sql_fetch_row(sql_query("\r\n\t\tSELECT path \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_materials_lesson \r\n\t\tWHERE idLesson = '" . $id . "'"));
$size = Get::file_size($GLOBALS['where_files_relative'] . $path_to_file . $old_file);
if ($old_file != '') {
sl_open_fileoperations();
if (!sl_unlink($path_to_file . $old_file)) {
sl_close_fileoperations();
$_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE', 'item');
return false;
}
sl_close_fileoperations();
if (isset($_SESSION['idCourse']) && defined("LMS")) {
$GLOBALS['course_descriptor']->subFileToUsedSpace(false, $size);
}
}
$delete_query = "\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_materials_lesson \r\n\t\tWHERE idLesson = '" . $id . "'";
if (!sql_query($delete_query)) {
$_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE', 'item');
return false;
}
return $id;
}
示例7: actionIndex
public function actionIndex()
{
$this->hasPrivilege();
$this->pageTitle = Lang::t($this->resourceLabel . 's');
$searchModel = ConsoleTasks::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION]);
$this->render('index', array('model' => $searchModel));
}
示例8: getAddEditForm
public function getAddEditForm($form_url, $data)
{
$this->loadJs();
$res = '';
$e = false;
if ($data['rule_id'] > 0) {
$e = true;
}
$res .= Form::openForm('main_form', $form_url);
$res .= Form::openElementSpace() . Form::getTextfield(Lang::t('_FROM', 'test'), 'from_score', 'from_score', 11, $e ? $data['from_score'] : '') . Form::getTextfield(Lang::t('_TO', 'test'), 'to_score', 'to_score', 11, $e ? $data['to_score'] : '') . '<br />' . '<p class="section_title">' . Lang::t('_COMPETENCES', 'test') . '</p>' . '<div id="competence_box"></div>' . '<div class="form_line_l">
<p><label for="input_add_competence" class="floating">' . Lang::t('_NAME', 'test') . '</label></p>
<div class="form_autocomplete_container">
<input type="text" maxlength="255" value="" name="input_add_competence" id="input_add_competence" class="textfield">
<a href="" id="link_add_competence"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
<div id="box_autocomplete_competence"></div>
</div>
</div>' . '<br />' . '<p class="section_title">' . Lang::t('_COURSES', 'test') . '</p>' . '<div id="course_box"></div>' . '<div class="form_line_l">
<p><label for="input_add_course" class="floating">' . Lang::t('_NEW_COURSE', 'test') . '</label></p>
<div class="form_autocomplete_container">
<input type="text" maxlength="255" value="" name="input_add_course" id="input_add_course" class="textfield">
<a href="" id="link_add_course"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
<div id="box_autocomplete_course"></div>
</div>
</div>' . '<br /><br />' . Form::getTextarea(Lang::t('_FEEDBACK_TEXT', 'test'), 'feedback_txt', 'feedback_txt', $e ? $data['feedback_txt'] : '') . Form::getHidden('rule_id', 'rule_id', (int) $data['rule_id']) . Form::getHidden('competences_list', 'competences_list', '') . Form::getHidden('courses_list', 'courses_list', '') . Form::getHidden('test_id', 'test_id', (int) $data['test_id']) . Form::getHidden('category_id', 'category_id', (int) $data['category_id']) . Form::getHidden('save', 'save', '1') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('btn_save', 'btn_save', Lang::t('_SAVE', 'test')) . Form::getButton('btn_cancel', 'btn_cancel', Lang::t('_UNDO', 'test')) . Form::closeButtonSpace();
$res .= Form::closeForm();
$res .= '<script type="text/javascript">
var course_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete&results=20' . '";
var competence_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?r=adm/competences/competences_autocomplete' . '";
var lang={"remove_item": "' . Lang::t('_DEL', 'test') . '"};
var course_arr=' . ($e && !empty($data['courses_list']) ? $data['courses_list'] : '{}') . ';
var competence_arr=' . ($e && !empty($data['competences_list']) ? $data['competences_list'] : '{}') . ';
</script>';
return $res;
}
示例9: saveIt
public static function saveIt($arr_objects, $filename = "")
{
if ($filename == "") {
$filename = date('Ymd') . ".xls";
}
//pr($arr_objects);
$file = fopen($filename, "w+");
//echo $filename;
//header("Content-Disposition: attachment; filename=\"$filename\"");
//header("Content-Type: application/vnd.ms-excel");
$flag = false;
$str = "";
foreach ($arr_objects as $key => $obj) {
foreach ($obj as $name => $value) {
$str .= Lang::t($name) . "\t";
}
break;
}
$str .= "\n";
foreach ($arr_objects as $key => $obj) {
foreach ($obj as $name => $value) {
$str .= $value . "\t";
}
$str .= "\n";
}
fwrite($file, $str);
fclose($file);
//exit;
//pr($file);
//pr($str);
}
示例10: create
/**
* function create()
*
* @param $back_url the url where the function retutn at the end of the operation
* @return nothing
*/
function create($id_poll, $back_poll)
{
if (!sql_query("\r\n\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\t( id_poll, type_quest, title_quest, sequence, page ) VALUES \r\n\t\t( \t'" . $id_poll . "', \r\n\t\t\t'" . $this->getQuestionType() . "', \r\n\t\t\t'<span class=\"text_bold\">" . Lang::t('_QUEST_BREAK_PAGE') . "</span>',\r\n\t\t\t'" . $this->_getNextSequence($id_poll) . "', \r\n\t\t\t'" . $this->_getPageNumber($id_poll) . "' ) ")) {
errorCommunication(def('_POLL_ERR_INS_QUEST') . getBackUi(Util::str_replace_once('&', '&', $back_poll), Lang::t('_BACK')));
}
Util::jump_to('' . $back_poll);
}
示例11: mod
public function mod()
{
$id_trans = Get::req('id_trans', DOTY_INT, 0);
if (isset($_POST['undo'])) {
Util::jump_to('index.php?r=alms/transaction/show');
}
if (isset($_POST['save']) || isset($_POST['not_paid'])) {
$product_to_activate = Get::req('product', DOTY_MIXED, array());
$id_user = Get::req('id_user', DOTY_MIXED, 0);
if ($this->model->saveTransaction($product_to_activate, $id_trans, $id_user)) {
$this->model->controlActivation($id_trans, isset($_POST['not_paid']));
Util::jump_to('index.php?r=alms/transaction/show&res=ok');
}
Util::jump_to('index.php?r=alms/transaction/show&res=err');
}
$transaction_info = $this->model->getTransactionInfo($id_trans);
$user_info = $this->acl_man->getUser($transaction_info['id_user'], false);
$user_info[ACL_INFO_USERID] = $this->acl_man->relativeId($user_info[ACL_INFO_USERID]);
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(false, Lang::t('_DETAILS', 'transaction'), Lang::t('_DETAILS', 'transaction'));
$ts = array('', '', 'min-cell', 'image');
$th = array(Lang::t('_CODE', 'transaction'), Lang::t('_NAME', 'transaction'), Lang::t('_PRICE', 'transaction'), Lang::t('_MARK_AS_PAID', 'transaction'));
$tb->setColsStyle($ts);
$tb->addHead($th);
foreach ($transaction_info['product'] as $product_info) {
$tb->addBody(array($product_info['code'], $product_info['name'], $product_info['price'], Form::getInputCheckbox('product_' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'], 'product[' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'] . ']', 1, $product_info['activated'], $product_info['activated'] ? ' disabled="disabled"' : '')));
}
$this->render('mod', array('transaction_info' => $transaction_info, 'user_info' => $user_info, 'tb' => $tb, 'id_trans' => $id_trans));
}
示例12: uppage
function uppage()
{
checkPerm('view', false, 'storage');
$back_url = urldecode($_POST['back_url']);
$insert_query = "\r\n\tUPDATE " . $GLOBALS['prefix_lms'] . "_htmlpage\r\n\tSET title = '" . (trim($_POST['title']) == '' ? Lang::t('_NOTITLE', 'htmlpage', 'lms') : $_POST['title']) . "',\r\n\t\ttextof = '" . $_POST['textof'] . "'\r\n\tWHERE idPage = '" . (int) $_POST['idPage'] . "'";
if (!sql_query($insert_query)) {
$_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE', 'htmlpage', 'lms');
Util::jump_to($back_url . '&mod_result=0');
}
if ($_FILES) {
$n = 0;
foreach ($_FILES as $_FILE) {
$n++;
$file = save_file($_FILE);
if ($file) {
$insert_query = "INSERT INTO " . $GLOBALS['prefix_lms'] . "_htmlpage_attachment SET file = '" . $file . "', title = '" . trim($_FILE['name']) . "', idpage = " . (int) $_POST['idPage'];
sql_query($insert_query);
}
}
}
if ($_POST['iddelattachment'] != '') {
$ids = explode(';', $_POST['iddelattachment']);
foreach ($ids as $id) {
if ($id) {
$query = "DELETE FROM learning_htmlpage_attachment WHERE id = " . $id;
mysql_query($query);
}
}
}
require_once $GLOBALS['where_lms'] . '/class.module/track.object.php';
Track_Object::updateObjectTitle($_POST['idPage'], 'htmlpage', $_POST['title']);
Util::jump_to($back_url . '&id_lo=' . $_POST['idPage'] . '&mod_result=1');
}
示例13: show
public function show()
{
Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
$rmodel = new AdminrulesAdm();
switch (Get::req('res', DOTY_ALPHANUM, "")) {
case 'ok_ins':
UIFeedback::info(Lang::t('_OPERATION_SUCCESSFUL', 'standard'));
break;
case 'err_ins':
UIFeedback::error(Lang::t('_OPERATION_FAILURE', 'standard'));
break;
default:
if ($rmodel->totalGroup() <= 0) {
UIFeedback::notice(Lang::t('_NO_PROFILE_SET', 'adminrules'));
}
break;
}
$rules_list_js = "";
if ($this->permissions['assign_profile']) {
$rules = $rmodel->getGroupForDropdown();
$rules_list_js .= '[';
$first = true;
foreach ($rules as $idst => $label) {
$rules_list_js .= ($first ? '' : ',') . '{"label":"' . $label . '","value":' . $idst . '}';
if ($first) {
$first = false;
}
}
$rules_list_js .= ']';
}
$this->render('show', array('filter_text' => $this->_getSessionValue('filter', ""), 'permissions' => $this->permissions, 'rules_list_js' => $rules_list_js));
}
示例14: drawCalendar
function drawCalendar()
{
checkPerm('view');
$size = importVar('size', false, 'max');
$width = "90%";
if ($size == "min") {
$width = "200px";
}
addCss('calendar_' . $size);
YuiLib::load('base,dragdrop');
Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar.js', true, true);
Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar_helper.js', true, true);
//permissions = permissions granted to the logged user according to his/her level and role
// 2 => can create/delete/modify all events
// 1 => can create/delete/modify only own events
// 0 => can view only
$permissions = 0;
if (checkPerm('mod', true)) {
$permissions = 2;
} elseif (checkPerm('personal', true)) {
$permissions = 1;
}
//mode="edit" => events can be added and edited according to given permissions
//mode="view" => events can only be viewed regardless the permissions
$GLOBALS['page']->add('<script type="text/javascript">' . ' setup_cal( null, ' . '\'lms\', ' . '\'lms\', ' . '\'edit\', ' . '\'' . $permissions . '\', ' . '\'' . Docebo::user()->getIdSt() . '\' ' . ');' . '</script>', 'page_head');
$GLOBALS['page']->add("\n" . getTitleArea(Lang::t('_CALENDAR', 'calendar'), 'calendar') . '<div class="std_block">' . '<div id="displayCalendar" style="clear: both; width:' . $width . '"></div>' . '<div class="nofloat"></div>' . '</div>', 'content');
}
示例15: actionIndex
public function actionIndex()
{
$this->hasPrivilege(Acl::ACTION_VIEW);
$this->pageTitle = Lang::t($this->resourceLabel . 's');
$this->showPageTitle = TRUE;
$this->render('index', array('model' => UserResources::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION], 'id')));
}