本文整理汇总了PHP中get_lang函数的典型用法代码示例。如果您正苦于以下问题:PHP get_lang函数的具体用法?PHP get_lang怎么用?PHP get_lang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_lang函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: validate_data
/**
* Validates imported data.
*/
function validate_data($users)
{
global $defined_auth_sources;
$errors = array();
$usernames = array();
if (is_array($users)) {
foreach ($users as $index => $user) {
// 1. Check whether mandatory fields have been set.
$mandatory_fields = array('LastName', 'FirstName');
if (api_get_setting('registration', 'email') == 'true') {
$mandatory_fields[] = 'Email';
}
foreach ($mandatory_fields as $key => $field) {
if (!isset($user[$field]) || strlen($user[$field]) == 0) {
$user['error'] = get_lang($field . 'Mandatory');
$errors[] = $user;
}
}
// 2. Check username.
if (!UserManager::is_username_empty($user['UserName'])) {
// 2.1. Check whether username was used twice in the import file.
if (isset($usernames[$user['UserName']])) {
$user['error'] = get_lang('UserNameUsedTwice');
$errors[] = $user;
}
$usernames[$user['UserName']] = 1;
// 2.2. Check whether username is allready in use in database.
if (!UserManager::is_username_available($user['UserName'])) {
$user['error'] = get_lang('UserNameNotAvailable');
$errors[] = $user;
}
// 2.3. Check whether username is too long.
if (UserManager::is_username_too_long($user['UserName'])) {
$user['error'] = get_lang('UserNameTooLong');
$errors[] = $user;
}
}
// 3. Check status.
if (isset($user['Status']) && !api_status_exists($user['Status'])) {
$user['error'] = get_lang('WrongStatus');
$errors[] = $user;
}
// 4. Check classname.
if (isset($user['ClassName']) && strlen($user['ClassName']) != 0) {
if (!ClassManager::class_name_exists($user['ClassName'])) {
$user['error'] = get_lang('ClassNameNotAvailable');
$errors[] = $user;
}
}
// 5. Check authentication source.
if (isset($user['AuthSource']) && strlen($user['AuthSource']) != 0) {
if (!in_array($user['AuthSource'], $defined_auth_sources)) {
$user['error'] = get_lang('AuthSourceNotAvailable');
$errors[] = $user;
}
}
}
}
return $errors;
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:63,代码来源:import.lib.php
示例2: reports_template_exercicesMultiCourses_getSQL
function reports_template_exercicesMultiCourses_getSQL()
{
// foreach quiz
$result = array();
$columns = Database::query('select r.id as kid, c.title as course, ' . 'r.child_name as test from ' . Database::get_main_table(TABLE_MAIN_REPORTS_KEYS) . ' r, ' . Database::get_main_table(TABLE_MAIN_COURSE) . ' c ' . 'where r.course_id=c.id and r.tool_id=' . reports_getToolId(TOOL_QUIZ) . ' order by r.course_id, r.child_name');
if (Database::num_rows($columns) == 0) {
die('<b>' . get_lang('no data found') . '</b>');
}
$query = 'select u.lastname Name, u.firstname Firstname';
$columns = Database::store_result($columns);
if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max') {
$function = $_REQUEST['tattempt'];
} else {
$function = 'avg';
}
foreach ($columns as $key => $column) {
$query .= ', ' . $function . '(k' . $key . '.score) as `' . $column['course'] . ' - ' . $column['test'] . '` ';
}
$query .= ' from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
foreach ($columns as $key => $column) {
// fixme sessions
$query .= 'left outer join ' . Database::get_main_table(TABLE_MAIN_REPORTS_VALUES) . ' k' . $key . ' on k' . $key . '.key_id = ' . $column['kid'] . ' and k' . $key . '.user_id = u.user_id ';
}
$query .= ' group by ';
foreach ($columns as $key => $column) {
// grouping attempt
$query .= 'k' . $key . '.attempt, ';
}
$query = substr($query, 0, -2);
// removing last ', ';
return $query;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:32,代码来源:exercicesMultiCourses.reports.php
示例3: MultipleAnswerCombinationTrueFalse
/**
* Constructor
*/
function MultipleAnswerCombinationTrueFalse()
{
parent::question();
$this->type = MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE;
$this->isContent = $this->getIsContent();
$this->options = array('1' => get_lang('True'), '0' => get_lang('False'), '2' => get_lang('DontKnow'));
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:10,代码来源:multiple_answer_combination_true_false.class.php
示例4: exec_ogp_module
function exec_ogp_module()
{
global $db;
global $view;
$group_id = $_REQUEST['group_id'];
if (!$db->isAdmin($_SESSION['user_id'])) {
$result = $db->getUserGroupList($_SESSION['user_id']);
foreach ($result as $row) {
if ($row['group_id'] == $group_id) {
$own_group = TRUE;
}
}
}
if (!$db->isAdmin($_SESSION['user_id']) && !isset($own_group)) {
echo "<p class='note'>" . get_lang('not_available') . "</p>";
return;
}
if (isset($_POST['add_user_to_group'])) {
$group_id = trim($_POST['group_id']);
$user_id = trim($_POST['user_to_add']);
$username = $db->getUserById($user_id);
$group_name = $db->getGroupById($group_id);
if (!$db->addUsertoGroup($user_id, $group_id)) {
print_failure(get_lang_f('could_not_add_user_to_group', $username['users_login'], $group_name['group_name']));
$view->refresh("?m=user_admin&p=show_groups");
return;
}
echo "<p class='success'>" . get_lang_f('successfully_added_to_group', $username['users_login'], $group_name['group_name']) . "</p>";
$db->logger(get_lang_f('successfully_added_to_group', $username['users_login'], $group_name['group_name']));
$view->refresh("?m=user_admin&p=show_groups");
}
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:32,代码来源:add_to_group.php
示例5: export
/**
* Export a whole Wiki to a single HTML String
* @return string Wiki content in HTML
*/
public function export()
{
$pageList = $this->wiki->allPagesByCreationDate();
$result = $this->_htmlHeader();
$result .= '<h1>' . $this->wiki->getTitle() . '</h1>' . "\n";
foreach ($pageList as $page) {
$wikiPage = new WikiPage($this->wiki->getDatabaseConnection(), $this->wiki->getConfig(), $this->wiki->getWikiId());
$wikiPage->loadPage($page['title']);
$this->setOpt('note_prefix', $page['title']);
if ($wikiPage->hasError()) {
$result .= '<h2><a name="' . $this->_makePageTitleAnchor($page['title']) . '">' . $page['title'] . '</a></h2>' . "\n";
$result .= get_lang("Could not load page %page", array('%page' => $page['title'])) . "\n";
$wikiPage = null;
} else {
$pgTitle = $wikiPage->getTitle();
if ('__MainPage__' === $pgTitle) {
$pgTitle = get_lang('Main page');
}
$result .= '<h2><a name="' . $this->_makePageTitleAnchor($page['title']) . '">' . $pgTitle . '</a></h2>' . "\n";
$content = $wikiPage->getContent();
$result .= $this->render($content) . "\n";
$wikiPage = null;
}
}
$result .= $this->_htmlFooter();
return $result;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:class.wiki2xhtmlexport.php
示例6: prepare_skill_box
function prepare_skill_box($skill, $position, $class)
{
$block_id = $skill['id'];
$extra_class = 'third_window';
if ($skill['parent_id'] == 0) {
$extra_class = 'second_window';
}
$this->html .= '<div id="block_' . $block_id . '" class = "open_block window ' . $extra_class . ' ' . $class . '" style = "top:' . $position['y'] . 'px; left:' . $position['x'] . 'px;">';
/*$gradebook_string = '';
if (!empty($skill['gradebooks'])) {
foreach ($skill['gradebooks'] as $gradebook) {
//uncomment this to show the gradebook tags
$gradebook_string .= Display::span($gradebook['name'], array('class'=>'label_tag gradebook','style'=>'width:50px')).'<br />';
}
} */
$content = $skill['name'];
$content .= '<div class="btn-group">';
$content .= Display::url(get_lang('Edit'), '#', array('id' => 'edit_block_' . $block_id, 'class' => 'edit_block btn'));
$content .= Display::url('+', '#', array('id' => 'edit_block_' . $block_id, 'class' => 'edit_block btn'));
$content .= '</div>';
$this->html .= $content . ' ' . $gradebook_string;
if ($this->type == 'edit' && $skill['parent_id'] != 0) {
//$this->html .= Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), '#', array('id'=>'edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('add.png', get_lang('Add'), array(), ICON_SIZE_SMALL), '#', array('id'=>'edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL), '#', array('id=>"edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('up.png', get_lang('Close'), array(), ICON_SIZE_SMALL), '#', array('id'=>'close_block_'.$block_id,'class'=>'close_block'));
//$this->html .= Display::url(Display::return_icon('down.png', get_lang('Open'), array(), ICON_SIZE_SMALL), '#', array('id'=>'open_block_'.$block_id,'class'=>'open_block'));
}
$this->html .= '</div>';
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:30,代码来源:skill.visualizer.lib.php
示例7: build_create
/**
* Builds the form
*/
protected function build_create()
{
$this->addElement('header', get_lang('MakeLink'));
$select = $this->addElement('select', 'select_link', get_lang('ChooseLink'), null, array('onchange' => 'document.create_link.submit()'));
$linkTypes = LinkFactory::get_all_types();
$select->addoption('[' . get_lang('ChooseLink') . ']', 0);
$courseCode = $this->category_object->get_course_code();
foreach ($linkTypes as $linkType) {
// The hot potatoe link will be added "inside" the exercise option.
if ($linkType == LINK_HOTPOTATOES) {
continue;
}
$link = $this->createLink($linkType, $courseCode);
// disable this element if the link works with a dropdownlist
// and if there are no links left
if (!$link->needs_name_and_description() && count($link->get_all_links()) == '0') {
$select->addoption($link->get_type_name(), $linkType, 'disabled');
} else {
if ($link->get_type() == LINK_EXERCISE) {
// Adding exercise
$select->addoption($link->get_type_name(), $linkType);
// Adding hot potatoes
$linkHot = $this->createLink(LINK_HOTPOTATOES, $courseCode);
$select->addoption(' ' . $linkHot->get_type_name(), LINK_HOTPOTATOES);
} else {
$select->addoption($link->get_type_name(), $linkType);
}
}
}
if (isset($this->extra)) {
$this->setDefaults(array('select_link' => $this->extra));
}
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:36,代码来源:linkform.class.php
示例8: getElementJS
/**
* Get the necessary javascript for this datepicker
* @return string
*/
private function getElementJS()
{
$js = null;
$id = $this->getAttribute('id');
$js .= "<script>\n \$(function() {\n /*\$('#{$id}').hide().datepicker({\n defaultDate: '" . $this->getValue() . "',\n dateFormat: 'yy-mm-dd',\n altField: '#{$id}_alt',\n altFormat: \"" . get_lang('DateFormatLongNoDayJS') . "\",\n showOn: 'both',\n buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true) . "',\n buttonImageOnly: true,\n buttonText: '" . get_lang('SelectDate') . "',\n changeMonth: true,\n changeYear: true,\n yearRange: 'c-60y:c+5y'\n });*/\n\n \$('#{$id}').datetimepicker({\n defaultDate: '" . $this->getValue() . "',\n format: 'YYYY-MM-DD'\n });\n\n });\n </script>";
return $js;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:11,代码来源:DatePicker.php
示例9: modify_filter
/**
* Filter to display the modify-buttons
*
* @param - int $id The reservation-id
*/
function modify_filter($id)
{
$out = ' <a href="m_reservation.php?action=accept&rid=' . $id . '" alt="' . get_lang('AutoAccept') . '"><img title="' . get_lang('AutoAccept') . '" alt="' . get_lang('AutoAccept') . '" src="../img/students.gif" /></a>';
$out .= '<a href="m_reservation.php?action=edit&id=' . $id . '" alt="' . get_lang('EditBookingPeriod') . '"><img title="' . get_lang('EditBookingPeriod') . '" alt="' . get_lang('EditBookingPeriod') . '" src="../img/edit.gif" /></a>';
$out .= ' <a href="m_reservation.php?action=delete&id=' . $id . '" alt="' . get_lang('DeleteBookingPeriod') . '" onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang("ConfirmDeleteBookingPeriod"))) . "'" . ')) return false;"><img title="' . get_lang('DeleteBookingPeriod') . '" alt="' . get_lang('DeleteBookingPeriod') . '" src="../img/delete.gif" /></a>';
return $out;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:12,代码来源:m_reservation.php
示例10: getToolbar
/**
* Get area wiki syntax toolbar
* @return string toolbar javascript code
*/
public function getToolbar()
{
$toolbar = '';
$toolbar .= '<script type="text/javascript" src="' . document_web_path() . '/js/toolbar.js"></script>' . "\n";
$toolbar .= "<script type=\"text/javascript\">if (document.getElementById) {\n var tb = new dcToolBar(document.getElementById('" . $this->attributeList['id'] . "'),\n 'wiki','" . get_module_url('CLWIKI') . "/img/toolbar/');\n\n tb.btStrong('" . get_lang('Bold') . "');\n tb.btEm('" . get_lang('Italic') . "');\n tb.btIns('" . get_lang('Underline') . "');\n tb.btDel('" . get_lang('Strike') . "');\n tb.btQ('" . get_lang('Inline quote') . "');\n tb.btCode('" . get_lang('Code') . "');\n tb.addSpace(10);\n tb.btBr('" . get_lang('Line break') . "');\n tb.addSpace(10);\n tb.btBquote('" . get_lang('Blockquote') . "');\n tb.btPre('" . get_lang('Preformated text') . "');\n tb.btList('" . get_lang('Unordered list') . "','ul');\n tb.btList('" . get_lang('Ordered list') . "','ol');\n tb.addSpace(10);\n tb.btLink('" . get_lang('External link') . "','" . get_lang('URL?') . "','" . get_lang('Language') . "','" . $GLOBALS['iso639_1_code'] . "');\n tb.btImgLink('" . get_lang('External image') . "','" . get_lang('URL') . "');\n tb.draw('');\n}\n</script>\n";
return $toolbar;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:11,代码来源:class.wiki2xhtmlarea.php
示例11: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->type = MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE;
$this->isContent = $this->getIsContent();
$this->options = array('1' => get_lang('True'), '0' => get_lang('False'), '2' => get_lang('DontKnow'));
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:10,代码来源:multiple_answer_combination_true_false.class.php
示例12: get_file_upload_errstring_from_errno
function get_file_upload_errstring_from_errno($errorLevel)
{
if (!defined('UPLOAD_ERR_CANT_WRITE')) {
// Introduced in PHP 5.1.0
define('UPLOAD_ERR_CANT_WRITE', 5);
}
switch ($errorLevel) {
case UPLOAD_ERR_OK:
$details = get_lang('No error');
case UPLOAD_ERR_INI_SIZE:
$details = get_lang('File too large. Notice : Max file size %size', array('%size' => get_cfg_var('upload_max_filesize')));
break;
case UPLOAD_ERR_FORM_SIZE:
$details = get_lang('File size exceeds');
break;
case UPLOAD_ERR_PARTIAL:
$details = get_lang('File upload incomplete');
break;
case UPLOAD_ERR_NO_FILE:
$details = get_lang('No file uploaded');
break;
case UPLOAD_ERR_NO_TMP_DIR:
$details = get_lang('Temporary folder missing');
break;
case UPLOAD_ERR_CANT_WRITE:
$details = get_lang('Failed to write file to disk');
break;
default:
$details = get_lang('Unknown error code %errCode%', array('%errCode%' => $errorLevel));
break;
}
return $details;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:33,代码来源:file.lib.php
示例13: __construct
/**
* constructor
* @path the path to a folder
* @calculateSubdir force to get the subdirectories information
*/
function __construct($path = null, $calculateSubdir = true)
{
$this->calculateSubdir = $calculateSubdir;
if (defined('CONFIG_SYS_FOLDER_SHOWN_ON_TOP')) {
$this->forceFolderOnTop = CONFIG_SYS_FOLDER_SHOWN_ON_TOP;
}
if (!is_null($path)) {
$this->currentFolderPath = $path;
} elseif (isset($_GET[$this->folderPathIndex]) && file_exists(base64_decode($_GET[$this->folderPathIndex])) && !is_file(base64_decode($_GET[$this->folderPathIndex]))) {
$this->currentFolderPath = api_htmlentities(Security::remove_XSS($_GET[$this->folderPathIndex]));
} elseif (isset($_SESSION[$this->lastVisitedFolderPathIndex]) && file_exists($_SESSION[$this->lastVisitedFolderPathIndex]) && !is_file($_SESSION[$this->lastVisitedFolderPathIndex])) {
$this->currentFolderPath = $_SESSION[$this->lastVisitedFolderPathIndex];
} else {
$this->currentFolderPath = CONFIG_SYS_DEFAULT_PATH;
}
$this->currentFolderPath = isUnderRoot($this->getCurrentFolderPath()) ? backslashToSlash(addTrailingSlash($this->getCurrentFolderPath())) : $this->currentFolderPath;
$this->currentFolderPath = base64_encode($this->currentFolderPath);
if ($this->calculateSubdir) {
// keep track of this folder path in session
$_SESSION[$this->lastVisitedFolderPathIndex] = $this->currentFolderPath;
}
if (is_dir($this->getCurrentFolderPath())) {
$file = new file($this->getCurrentFolderPath());
$folderInfo = $file->getFileInfo();
if (sizeof($folderInfo)) {
//for Chamilo in a name folder, replace num user by user names
if (preg_match('/sf_user_/', basename($this->getCurrentFolderPath()))) {
$userinfo = api_get_user_info(substr(basename($this->getCurrentFolderPath()), 8));
$this->currentFolderInfo['name'] = $userinfo['complete_name'];
} else {
$this->currentFolderInfo['name'] = str_replace('_', ' ', basename($this->getCurrentFolderPath()));
//for Chamilo. Prevent long directory name
}
if (preg_match('/shared_folder/', basename($this->getCurrentFolderPath()))) {
$this->currentFolderInfo['name'] = get_lang('UserFolders');
}
if (preg_match('/shared_folder_session_/', basename($this->getCurrentFolderPath()))) {
$session = explode('_', basename($this->getCurrentFolderPath()));
$session = strtolower($session[sizeof($session) - 1]);
$this->currentFolderInfo['name'] = get_lang('UserFolders') . ' (' . api_get_session_name($session) . ')*';
}
//end Chamilo
$this->currentFolderInfo['subdir'] = 0;
$this->currentFolderInfo['file'] = 0;
$this->currentFolderInfo['ctime'] = $folderInfo['ctime'];
$this->currentFolderInfo['mtime'] = $folderInfo['mtime'];
$this->currentFolderInfo['is_readable'] = $folderInfo['is_readable'];
$this->currentFolderInfo['is_writable'] = $folderInfo['is_writable'];
$this->currentFolderInfo['path'] = $this->getCurrentFolderPath();
$this->currentFolderInfo['path_base64'] = base64_encode($this->getCurrentFolderPath());
$this->currentFolderInfo['friendly_path'] = transformFilePath($this->getCurrentFolderPath());
$this->currentFolderInfo['type'] = 'folder';
$this->currentFolderInfo['cssClass'] = 'folder';
//$this->currentFolderInfo['flag'] = $folderInfo['flag'];
}
}
if ($calculateSubdir && !file_exists($this->getCurrentFolderPath())) {
die(ERR_FOLDER_NOT_FOUND . $this->getCurrentFolderPath());
}
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:65,代码来源:class.manager.php
示例14: exec_ogp_module
function exec_ogp_module()
{
global $db;
echo "<h2>" . get_lang('game_servers') . "</h2>";
echo "<p><a href='?m=user_games&p=add'>" . get_lang('add_new_game_home') . "</a></p>";
$game_homes = $db->getGameHomes();
if (empty($game_homes)) {
echo "<p>" . get_lang('no_game_homes_found') . "</p>";
return;
}
echo "<h2>" . get_lang('available_game_homes') . "</h2>";
echo '<table class="center">';
echo "<tr><th>" . get_lang('home_id') . "</th><th>" . get_lang('game_server') . "</th>\n <th>" . get_lang('game_type') . "</th>\n <th align='center'>" . get_lang('game_home') . "</th>\n <th>" . get_lang('game_home_name') . "</th><th>" . get_lang('actions') . "</th></tr>";
$i = 0;
sort($game_homes);
foreach ($game_homes as $row) {
echo "<tr class='tr" . $i++ % 2 . "'><td class='tdh'>{$row['home_id']}</td><td>" . $row['agent_ip'] . "</td>" . "<td class='tdh'>{$row['game_name']}</td><td>{$row['home_path']}<br><div class='size' id='" . $row["home_id"] . "' style='cursor:pointer;' >[" . get_lang('get_size') . "]</div></td><td class='tdh'>";
echo empty($row['home_name']) ? get_lang('not_available') : $row['home_name'];
echo "</td><td>\n <a href='?m=user_games&p=del&home_id={$row['home_id']}'>[" . get_lang('delete') . "]</a>\n <a href='?m=user_games&p=edit&home_id={$row['home_id']}'>[" . get_lang('edit') . "]</a>\n <a href='?m=user_games&p=clone&home_id={$row['home_id']}'>[" . get_lang('clone') . "]</a>\n </td></tr>";
}
echo "<tr><td colspan='3' style='border:none;' ></td><td style='border:none;' ><div style='float:left;margin-left:5px;' >" . get_lang('total_size') . ":</div><div class='size' id='total' " . "style='cursor:pointer;float:left;margin-left:5px;' >[" . get_lang('get_size') . "]</div></td><td colspan='2' style='border:none;' ></td></tr>";
echo "</table>";
?>
<script type="text/javascript">
$('.size').click(function(){
var $id = $(this).attr('id');
$.get( "home.php?m=user_games&type=cleared&p=get_size&home_id="+$id, function( data ) {
$('#'+$id+".size").text( data );
});
});
</script>
<?php
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:33,代码来源:show_homes.php
示例15: get_announcement_data
public function get_announcement_data($username, $password, $course_code, $announcement_id, $field)
{
if ($this->verifyUserPass($username, $password) == "valid") {
$htmlcode = false;
$user_id = UserManager::get_user_id_from_username($username);
$result = self::get_announcements($username, $course_code, $announcement_id);
while ($announcement = Database::fetch_array($result)) {
$announcements[] = $announcement;
}
switch ($field) {
case 'sender':
$field_table = "insert_user_id";
$sender = api_get_user_info($announcements[0][$field_table]);
$announcements[0][$field_table] = $sender['firstname'] . " " . $sender['lastname'];
break;
case 'title':
$htmlcode = true;
$field_table = "title";
break;
case 'date':
$field_table = "end_date";
break;
case 'content':
$htmlcode = true;
$field_table = "content";
$announcements[0][$field_table] = nl2br_revert($announcements[0][$field_table]);
break;
default:
$field_table = "title";
}
return htmlcode ? html_entity_decode($announcements[0][$field_table]) : $announcements[0][$field_table];
} else {
return get_lang('InvalidId');
}
}
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:35,代码来源:cm_webservice_announcements.php
示例16: lp_upload_quiz_main
function lp_upload_quiz_main()
{
// variable initialisation
$lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']) : null;
$form = new FormValidator('upload', 'POST', api_get_self() . '?' . api_get_cidreq() . '&lp_id=' . $lp_id, '', array('enctype' => 'multipart/form-data'));
$form->addElement('header', get_lang('ImportExcelQuiz'));
$form->addElement('file', 'user_upload_quiz', get_lang('FileUpload'));
$link = '<a href="../exercice/quiz_template.xls">' . Display::return_icon('export_excel.png', get_lang('DownloadExcelTemplate')) . get_lang('DownloadExcelTemplate') . '</a>';
$form->addElement('label', '', $link);
$table = new HTML_Table(array('class' => 'table'));
$tableList = array(UNIQUE_ANSWER => get_lang('UniqueSelect'), MULTIPLE_ANSWER => get_lang('MultipleSelect'), FILL_IN_BLANKS => get_lang('FillBlanks'), MATCHING => get_lang('Matching'), FREE_ANSWER => get_lang('FreeAnswer'), GLOBAL_MULTIPLE_ANSWER => get_lang('GlobalMultipleAnswer'));
$table->setHeaderContents(0, 0, get_lang('QuestionType'));
$table->setHeaderContents(0, 1, '#');
$row = 1;
foreach ($tableList as $key => $label) {
$table->setCellContents($row, 0, $label);
$table->setCellContents($row, 1, $key);
$row++;
}
$table = $table->toHtml();
$form->addElement('label', get_lang('QuestionType'), $table);
$form->addElement('checkbox', 'user_custom_score', null, get_lang('UseCustomScoreForAllQuestions'), array('id' => 'user_custom_score'));
$form->addElement('html', '<div id="options" style="display:none">');
$form->addElement('text', 'correct_score', get_lang('CorrectScore'));
$form->addElement('text', 'incorrect_score', get_lang('IncorrectScore'));
$form->addElement('html', '</div>');
$form->addRule('user_upload_quiz', get_lang('ThisFieldIsRequired'), 'required');
$form->add_progress_bar();
$form->addButtonUpload(get_lang('Upload'), 'submit_upload_quiz');
// Display the upload field
$form->display();
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:32,代码来源:upload_exercise.php
示例17: exec_ogp_module
function exec_ogp_module()
{
global $db;
echo '<h2>' . get_lang('users') . "</h2>";
echo "<p><a href='?m=user_admin&p=add'>" . get_lang('add_new_user') . "</a></p>";
echo '<table class="center" style="width: 100%;">';
echo '<tr><th>' . get_lang('actions') . "</th><th>" . get_lang('username') . "</th>";
echo "<th>" . get_lang('user_role') . "</th>";
echo "<th>" . get_lang('email_address') . "</th>";
echo "<th>" . get_lang('expires') . "</th>";
echo "<th>" . get_lang('ownedby') . "</th></tr>";
$result = $db->getUserList();
$i = 0;
foreach ($result as $row) {
// Show user's parent
$ownedBy = "";
if (is_null($row['users_parent'])) {
if ($row['users_role'] != "admin") {
$ownedBy = "Root Admin";
}
} else {
$ownedBy = $db->getUserById($row['users_parent']);
$ownedBy = $ownedBy['users_login'];
}
$user_expires = read_expire($row['user_expires']);
print "<tr class='tr" . $i++ % 2 . "'>";
print "<td><a href='?m=user_games&p=assign&user_id={$row['user_id']}'>[" . get_lang('assign_homes') . "]</a><br />\n <a href='?m=user_admin&p=del&user_id={$row['user_id']}'>[" . get_lang('delete') . "]</a><br />\n <a href='?m=user_admin&p=edit_user&user_id={$row['user_id']}'>[" . get_lang('edit_profile') . "]</a></td>\n <td>{$row['users_login']}</td><td>{$row['users_role']}</td>\n <td>{$row['users_email']}</td>\n <td>{$user_expires}</td>\n <td>{$ownedBy}</td></tr>";
}
echo '</table>';
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:30,代码来源:show_users.php
示例18: render
/**
* Render content
*/
public function render()
{
CssLoader::getInstance()->load('profile', 'all');
load_kernel_config('user_profile');
$userData = user_get_properties($this->userId);
$pictureUrl = '';
if (get_conf('allow_profile_picture')) {
$picturePath = user_get_picture_path($userData);
if ($picturePath && file_exists($picturePath)) {
$pictureUrl = user_get_picture_url($userData);
} else {
$pictureUrl = get_icon_url('nopicture');
}
}
$userFullName = claro_htmlspecialchars(get_lang('%firstName %lastName', array('%firstName' => $userData['firstname'], '%lastName' => $userData['lastname'])));
$dock = new ClaroDock('userProfileBox');
$template = new CoreTemplate('user_profilebox.tpl.php');
$template->assign('userId', $this->userId);
$template->assign('pictureUrl', $pictureUrl);
$template->assign('userFullName', $userFullName);
$template->assign('dock', $dock);
$template->assign('condensedMode', $this->condensedMode);
$template->assign('userData', $userData);
return $template->render();
}
开发者ID:rhertzog,项目名称:lcs,代码行数:28,代码来源:userprofilebox.lib.php
示例19: head
function head()
{
$lang = "en";
if (function_exists('get_lang')) {
// since Adminer 3.2.0
$lang = get_lang();
$lang = $lang == "zh" ? "zh-cn" : ($lang == "zh-tw" ? "zh" : $lang);
if (!file_exists(dirname($this->path) . "/langs/{$lang}.js")) {
$lang = "en";
}
}
?>
<script type="text/javascript" src="<?php
echo h($this->path);
?>
"></script>
<script type="text/javascript">
tinyMCE.init({
mode: 'none',
theme: 'advanced',
plugins: 'contextmenu,paste,table',
entity_encoding: 'raw',
theme_advanced_buttons1: 'bold,italic,link,unlink,|,sub,sup,|,bullist,numlist,|,cleanup,code',
theme_advanced_buttons2: 'tablecontrols',
theme_advanced_buttons3: '',
theme_advanced_toolbar_location: 'top',
theme_advanced_toolbar_align: 'left',
language: '<?php
echo $lang;
?>
'
});
</script>
<?php
}
开发者ID:ly95,项目名称:adminer,代码行数:35,代码来源:tinymce.php
示例20: lp_display_scorm
/**
* CLAROLINE
*
* @version $Revision: 14314 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @author Piraux Sebastien <[email protected]>
* @author Lederer Guillaume <[email protected]>
* @package CLLNP
* @since 1.8
*/
function lp_display_scorm($TABLELEARNPATHMODULE)
{
$out = '';
// change raw if value is a number between 0 and 100
if (isset($_POST['newRaw']) && is_num($_POST['newRaw']) && $_POST['newRaw'] <= 100 && $_POST['newRaw'] >= 0) {
$sql = "UPDATE `" . $TABLELEARNPATHMODULE . "`\n SET `raw_to_pass` = " . (int) $_POST['newRaw'] . "\n WHERE `module_id` = " . (int) $_SESSION['module_id'] . "\n AND `learnPath_id` = " . (int) $_SESSION['path_id'];
claro_sql_query($sql);
$dialogBoxContent = get_lang('Minimum raw to pass has been changed');
}
$out .= '<hr noshade="noshade" size="1" />';
//####################################################################################\\
//############################### DIALOG BOX SECTION #################################\\
//####################################################################################\\
if (!empty($dialogBoxContent)) {
$dialogBox = new DialogBox();
$dialogBox->success($dialogBoxContent);
$out .= $dialogBox->render();
}
// form to change raw needed to pass the exercise
$sql = "SELECT `lock`, `raw_to_pass`\n FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n WHERE LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
$learningPath_module = claro_sql_query_fetch_all($sql);
if (isset($learningPath_module[0]['lock']) && $learningPath_module[0]['lock'] == 'CLOSE' && isset($learningPath_module[0]['raw_to_pass'])) {
$out .= "\n\n" . '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . '<label for="newRaw">' . get_lang('Change minimum raw mark to pass this module (percentage) : ') . '</label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($learningPath_module[0]['raw_to_pass']) . '" name="newRaw" id="newRaw" size="3" maxlength="3" /> % ' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n\n";
}
return $out;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:37,代码来源:scorm.inc.php
注:本文中的get_lang函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论