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


PHP api_get_system_encoding函数代码示例

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


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

示例1: search_courses

 /**
  * Search for a list of available courses by title or code, based on
  * a given string
  * @param string String to search for
  * @param int Deprecated param
  * @return string A formatted, xajax answer block
  * @assert () === false
  */
 function search_courses($needle, $id)
 {
     global $tbl_course;
     $xajax_response = new XajaxResponse();
     $return = '';
     if (!empty($needle)) {
         // xajax send utf8 datas... datas in db can be non-utf8 datas
         $charset = api_get_system_encoding();
         $needle = api_convert_encoding($needle, $charset, 'utf-8');
         $needle = Database::escape_string($needle);
         // search courses where username or firstname or lastname begins likes $needle
         $sql = 'SELECT code, title FROM ' . $tbl_course . ' u ' . ' WHERE (title LIKE "' . $needle . '%" ' . ' OR code LIKE "' . $needle . '%" ' . ' ) ' . ' ORDER BY title, code ' . ' LIMIT 11';
         $rs = Database::query($sql);
         $i = 0;
         while ($course = Database::fetch_array($rs)) {
             $i++;
             if ($i <= 10) {
                 $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\'' . addslashes($course['code']) . '\',\'' . addslashes($course['title']) . ' (' . addslashes($course['code']) . ')' . '\')">' . $course['title'] . ' (' . $course['code'] . ')</a><br />';
             } else {
                 $return .= '...<br />';
             }
         }
     }
     $xajax_response->addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return));
     return $xajax_response;
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:34,代码来源:access_url_edit_courses_to_url_functions.lib.php

示例2: search_users

function search_users($needle, $type)
{
    global $_configuration, $tbl_access_url_rel_user, $tbl_user, $user_anonymous, $current_user_id, $user_id;
    $xajax_response = new XajaxResponse();
    $return = '';
    if (!empty($needle) && !empty($type)) {
        // xajax send utf8 datas... datas in db can be non-utf8 datas
        $charset = api_get_system_encoding();
        $needle = api_convert_encoding($needle, $charset, 'utf-8');
        $assigned_users_to_hrm = UserManager::get_users_followed_by_drh($user_id);
        $assigned_users_id = array_keys($assigned_users_to_hrm);
        $without_assigned_users = '';
        if (count($assigned_users_id) > 0) {
            $without_assigned_users = " AND user.user_id NOT IN(" . implode(',', $assigned_users_id) . ")";
        }
        if ($_configuration['multiple_access_urls']) {
            $sql = "SELECT user.user_id, username, lastname, firstname FROM {$tbl_user} user LEFT JOIN {$tbl_access_url_rel_user} au ON (au.user_id = user.user_id)\n\t\t\tWHERE  " . (api_sort_by_first_name() ? 'firstname' : 'lastname') . " LIKE '{$needle}%' AND status NOT IN(" . DRH . ", " . SESSIONADMIN . ") AND user.user_id NOT IN ({$user_anonymous}, {$current_user_id}, {$user_id}) {$without_assigned_users} AND access_url_id = " . api_get_current_access_url_id() . "";
        } else {
            $sql = "SELECT user_id, username, lastname, firstname FROM {$tbl_user} user\n\t\t\tWHERE  " . (api_sort_by_first_name() ? 'firstname' : 'lastname') . " LIKE '{$needle}%' AND status NOT IN(" . DRH . ", " . SESSIONADMIN . ") AND user_id NOT IN ({$user_anonymous}, {$current_user_id}, {$user_id}) {$without_assigned_users}";
        }
        $rs = Database::query($sql);
        $return .= '<select id="origin" name="NoAssignedUsersList[]" multiple="multiple" size="20" style="width:340px;">';
        while ($user = Database::fetch_array($rs)) {
            $person_name = api_get_person_name($user['firstname'], $user['lastname']);
            $return .= '<option value="' . $user['user_id'] . '" title="' . htmlspecialchars($person_name, ENT_QUOTES) . '">' . $person_name . ' (' . $user['username'] . ')</option>';
        }
        $return .= '</select>';
        $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
    }
    return $xajax_response;
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:dashboard_add_users_to_user.php

示例3: sqlConnect

    public function sqlConnect()
    {
        if (!$this->connection_handler) {
            $this->connection_handler = @mysql_connect($this->connection['server'], $this->connection['login'], $this->connection['password'], true);

            // The system has not been designed to use special SQL modes that were introduced since MySQL 5
            @mysql_query("set session sql_mode='';", $this->connection_handler);

            @mysql_select_db($this->connection['base'], $this->connection_handler);

            // Initialization of the database connection encoding to be used.
            // The internationalization library should be already initialized.
            @mysql_query("SET SESSION character_set_server='utf8';", $this->connection_handler);
            @mysql_query("SET SESSION collation_server='utf8_general_ci';", $this->connection_handler);
            $system_encoding = api_get_system_encoding();
            if (api_is_utf8($system_encoding)) {
                // See Bug #1802: For UTF-8 systems we prefer to use "SET NAMES 'utf8'" statement in order to avoid a bizarre problem with Chinese language.
                @mysql_query("SET NAMES 'utf8';", $this->connection_handler);
            } else {
                @mysql_query("SET CHARACTER SET '" . Database::to_db_encoding($system_encoding) . "';", $this->connection_handler);
            }
        }

        return ($this->connection_handler) ? true : false;
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:25,代码来源:session_handler_memcache.class.php

示例4: search_sessions

function search_sessions($needle, $type)
{
    global $_configuration, $tbl_session_rel_access_url, $tbl_session, $user_id;
    $xajax_response = new XajaxResponse();
    $return = '';
    if (!empty($needle) && !empty($type)) {
        // xajax send utf8 datas... datas in db can be non-utf8 datas
        $charset = api_get_system_encoding();
        $needle = api_convert_encoding($needle, $charset, 'utf-8');
        $assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id);
        $assigned_sessions_id = array_keys($assigned_sessions_to_hrm);
        $without_assigned_sessions = '';
        if (count($assigned_sessions_id) > 0) {
            $without_assigned_sessions = " AND s.id NOT IN(" . implode(',', $assigned_sessions_id) . ")";
        }
        if ($_configuration['multiple_access_urls']) {
            $sql = " SELECT s.id, s.name FROM {$tbl_session} s LEFT JOIN {$tbl_session_rel_access_url} a ON (s.id = a.session_id)\n\t\t\t\t\t\tWHERE  s.name LIKE '{$needle}%' {$without_assigned_sessions} AND access_url_id = " . api_get_current_access_url_id() . "";
        } else {
            $sql = "SELECT s.id, s.name FROM {$tbl_session} s\n\t\t\t\tWHERE  s.name LIKE '{$needle}%' {$without_assigned_sessions} ";
        }
        $rs = Database::query($sql);
        $return .= '<select id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20" style="width:340px;">';
        while ($session = Database::fetch_array($rs)) {
            $return .= '<option value="' . $session['id'] . '" title="' . htmlspecialchars($session['name'], ENT_QUOTES) . '">' . $session['name'] . '</option>';
        }
        $return .= '</select>';
        $xajax_response->addAssign('ajax_list_sessions_multiple', 'innerHTML', api_utf8_encode($return));
    }
    return $xajax_response;
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:30,代码来源:dashboard_add_sessions_to_user.php

示例5: search_courses

function search_courses($needle, $type)
{
    global $_configuration, $tbl_course, $tbl_course_rel_access_url, $user_id;
    $xajax_response = new XajaxResponse();
    $return = '';
    if (!empty($needle) && !empty($type)) {
        // xajax send utf8 datas... datas in db can be non-utf8 datas
        $charset = api_get_system_encoding();
        $needle = api_convert_encoding($needle, $charset, 'utf-8');
        $needle = Database::escape_string($needle);
        $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
        $assigned_courses_code = array_keys($assigned_courses_to_hrm);
        foreach ($assigned_courses_code as &$value) {
            $value = "'" . $value . "'";
        }
        $without_assigned_courses = '';
        if (count($assigned_courses_code) > 0) {
            $without_assigned_courses = " AND c.code NOT IN(" . implode(',', $assigned_courses_code) . ")";
        }
        if ($_configuration['multiple_access_urls']) {
            $sql = "SELECT c.code, c.title FROM {$tbl_course} c LEFT JOIN {$tbl_course_rel_access_url} a ON (a.course_code = c.code)\n                WHERE  c.code LIKE '{$needle}%' {$without_assigned_courses} AND access_url_id = " . api_get_current_access_url_id() . "";
        } else {
            $sql = "SELECT c.code, c.title FROM {$tbl_course} c\n                WHERE  c.code LIKE '{$needle}%' {$without_assigned_courses} ";
        }
        $rs = Database::query($sql);
        $return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" style="width:340px;">';
        while ($course = Database::fetch_array($rs)) {
            $return .= '<option value="' . $course['code'] . '" title="' . htmlspecialchars($course['title'], ENT_QUOTES) . '">' . $course['title'] . ' (' . $course['code'] . ')</option>';
        }
        $return .= '</select>';
        $xajax_response->addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
    }
    return $xajax_response;
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:34,代码来源:dashboard_add_courses_to_user.php

示例6: search_users

 /**
  * Search users by username, firstname or lastname, based on the given
  * search string
  * @param string Search string
  * @param int Deprecated param
  * @return string Xajax response block
  * @assert () === false
  */
 public static function search_users($needle, $id)
 {
     global $tbl_user, $tbl_access_url_rel_user;
     $xajax_response = new XajaxResponse();
     $return = '';
     if (!empty($needle)) {
         // xajax send utf8 datas... datas in db can be non-utf8 datas
         $charset = api_get_system_encoding();
         $needle = api_convert_encoding($needle, $charset, 'utf-8');
         $needle = Database::escape_string($needle);
         // search users where username or firstname or lastname begins likes $needle
         $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
         $sql = 'SELECT u.user_id, username, lastname, firstname FROM ' . $tbl_user . ' u ' . ' WHERE (username LIKE "' . $needle . '%" ' . ' OR firstname LIKE "' . $needle . '%" ' . ' OR lastname LIKE "' . $needle . '%") ' . $order_clause . ' LIMIT 11';
         $rs = Database::query($sql);
         $i = 0;
         while ($user = Database::fetch_array($rs)) {
             $i++;
             if ($i <= 10) {
                 $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\'' . addslashes($user['user_id']) . '\',\'' . api_get_person_name(addslashes($user['firstname']), addslashes($user['lastname'])) . ' (' . addslashes($user['username']) . ')' . '\')">' . api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')</a><br />';
             } else {
                 $return .= '...<br />';
             }
         }
     }
     $xajax_response->addAssign('ajax_list_users', 'innerHTML', api_utf8_encode($return));
     return $xajax_response;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:35,代码来源:access_url_edit_users_to_url_functions.lib.php

示例7: search_sessions

 /**
  * Search sessions by name, based on a search string
  * @param string Search string
  * @param int Deprecated param
  * @return string Xajax response block
  * @assert () === false
  */
 function search_sessions($needle, $id)
 {
     global $tbl_session;
     $xajax_response = new XajaxResponse();
     $return = '';
     if (!empty($needle)) {
         // xajax send utf8 datas... datas in db can be non-utf8 datas
         $charset = api_get_system_encoding();
         $needle = api_convert_encoding($needle, $charset, 'utf-8');
         $needle = Database::escape_string($needle);
         // search sessiones where username or firstname or lastname begins likes $needle
         $sql = 'SELECT id, name FROM ' . $tbl_session . ' u
                 WHERE (name LIKE "' . $needle . '%")
                 ORDER BY name, id
                 LIMIT 11';
         $rs = Database::query($sql);
         $i = 0;
         while ($session = Database::fetch_array($rs)) {
             $i++;
             if ($i <= 10) {
                 $return .= '<a href="#" onclick="add_user_to_url(\'' . addslashes($session['id']) . '\',\'' . addslashes($session['name']) . ' (' . addslashes($session['id']) . ')' . '\')">' . $session['name'] . ' </a><br />';
             } else {
                 $return .= '...<br />';
             }
         }
     }
     $xajax_response->addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return));
     return $xajax_response;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:36,代码来源:access_url_edit_sessions_to_url_functions.lib.php

示例8: generate_course_code

/**
 * Generates a course code from a course title
 * @todo Such a function might be useful in other places too. It might be moved in the CourseManager class.
 * @todo the function might be upgraded for avoiding code duplications (currently, it might suggest a code that is already in use)
 * @param string A course title
 * @param string The course title encoding (defaults to type defined globally)
 * @return string A proposed course code
 * @assert (null,null) === false
 * @assert ('ABC_DEF', null) === 'ABCDEF'
 * @assert ('ABC09*^[%A', null) === 'ABC09A'
 */
function generate_course_code($course_title, $encoding = null)
{
    if (empty($encoding)) {
        $encoding = api_get_system_encoding();
    }
    return substr(preg_replace('/[^A-Z0-9]/', '', strtoupper(api_transliterate($course_title, 'X', $encoding))), 0, CourseManager::MAX_COURSE_LENGTH_CODE);
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:18,代码来源:add_course.lib.inc.php

示例9: make_lp

    /**
     * Gets html pages and compose them into a learning path
     * @param	array	The files that will compose the generated learning path. Unused so far.
     * @return	boolean	False if file does not exit. Nothing otherwise.
     */
    function make_lp($files = array()) {

        global $_course;
        // We get a content where ||page_break|| indicates where the page is broken.
        if (!file_exists($this->base_work_dir.'/'.$this->created_dir.'/'.$this->file_name.'.html')) { return false; }
        $content = file_get_contents($this->base_work_dir.'/'.$this->created_dir.'/'.$this->file_name.'.html');

        unlink($this->base_work_dir.'/'.$this->file_path);
        unlink($this->base_work_dir.'/'.$this->created_dir.'/'.$this->file_name.'.html');

        // The file is utf8 encoded and it seems to make problems with special quotes.
        // Then we htmlentities that, we replace these quotes and html_entity_decode that in good charset.
        $charset = api_get_system_encoding();
        $content = api_htmlentities($content, ENT_COMPAT, $this->original_charset);
        $content = str_replace('&rsquo;', '\'', $content);
        $content = api_convert_encoding($content, $charset, $this->original_charset);
        $content = str_replace($this->original_charset, $charset, $content);
        $content = api_html_entity_decode($content, ENT_COMPAT, $charset);

        // Set the path to pictures to absolute (so that it can be modified in fckeditor).
        $content = preg_replace("|src=\"([^\"]*)|i", "src=\"".api_get_path(REL_COURSE_PATH).$_course['path'].'/document'.$this->created_dir."/\\1", $content);

        list($header, $body) = explode('<BODY', $content);

        $body = '<BODY'.$body;

        // Remove font-family styles.
        $header = preg_replace("|font\-family[^;]*;|i", '', $header);

        // Chamilo styles.
        $my_style = api_get_setting('stylesheets');
        if (empty($my_style)) { $my_style = 'chamilo'; }
        $style_to_import = "<style type=\"text/css\">\r\n";
        $style_to_import .= '@import "'.api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/default.css";'."\n";        
        $style_to_import .= "</style>\r\n";
        $header = preg_replace("|</head>|i", "\r\n$style_to_import\r\n\\0", $header);

        // Line break before and after picture.
        $header = str_replace('p {', 'p {clear:both;', $header);

        $header = str_replace('absolute', 'relative', $header);

        switch ($this->split_steps) {
            case 'per_page': $this -> dealPerPage($header, $body); break;
            case 'per_chapter': $this -> dealPerChapter($header, $body); break;
        }
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:52,代码来源:openoffice_text.class.php

示例10: search_coachs

function search_coachs($needle)
{
    global $tbl_user;
    $xajax_response = new XajaxResponse();
    $return = '';
    if (!empty($needle)) {
        // xajax send utf8 datas... datas in db can be non-utf8 datas
        $charset = api_get_system_encoding();
        $needle = api_convert_encoding($needle, $charset, 'utf-8');
        $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
        // search users where username or firstname or lastname begins likes $needle
        $sql = 'SELECT username, lastname, firstname FROM ' . $tbl_user . ' user
				WHERE (username LIKE "' . $needle . '%"
				OR firstname LIKE "' . $needle . '%"
				OR lastname LIKE "' . $needle . '%")
				AND status=1' . $order_clause . ' LIMIT 10';
        if (api_is_multiple_url_enabled()) {
            $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
            $access_url_id = api_get_current_access_url_id();
            if ($access_url_id != -1) {
                $sql = 'SELECT username, lastname, firstname FROM ' . $tbl_user . ' user
				INNER JOIN ' . $tbl_user_rel_access_url . ' url_user ON (url_user.user_id=user.user_id)
				WHERE access_url_id = ' . $access_url_id . '  AND (username LIKE "' . $needle . '%"
				OR firstname LIKE "' . $needle . '%"
				OR lastname LIKE "' . $needle . '%")
				AND status=1' . $order_clause . ' LIMIT 10';
            }
        }
        $rs = Database::query($sql);
        while ($user = Database::fetch_array($rs)) {
            $return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\'' . $user['username'] . '\')">' . api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')</a><br />';
        }
    }
    $xajax_response->addAssign('ajax_list_coachs', 'innerHTML', api_utf8_encode($return));
    return $xajax_response;
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:36,代码来源:session_add.php

示例11: search_courses

 /**
  * Search for a session based on a given search string
  * @param string A search string
  * @param string A search box type (single or anything else)
  * @return string XajaxResponse
  * @assert ('abc','single') !== ''
  */
 function search_courses($needle, $type)
 {
     global $tbl_session;
     $xajax_response = new XajaxResponse();
     $return = '';
     if (!empty($needle) && !empty($type)) {
         // xajax send utf8 datas... datas in db can be non-utf8 datas
         $charset = api_get_system_encoding();
         $needle = api_convert_encoding($needle, $charset, 'utf-8');
         $needle = Database::escape_string($needle);
         $sql = 'SELECT * FROM ' . $tbl_session . ' WHERE name LIKE "' . $needle . '%" ORDER BY id';
         $rs = Database::query($sql);
         $course_list = array();
         $return .= '<select id="origin" name="NoSessionCategoryList[]" multiple="multiple" size="20" style="width:340px;">';
         while ($course = Database::fetch_array($rs)) {
             $course_list[] = $course['id'];
             $return .= '<option value="' . $course['id'] . '" title="' . htmlspecialchars($course['name'], ENT_QUOTES) . '">' . $course['name'] . '</option>';
         }
         $return .= '</select>';
         $xajax_response->addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
     }
     $_SESSION['course_list'] = $course_list;
     return $xajax_response;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:add_many_session_to_category_functions.lib.php

示例12: error_log

$msg = $_SESSION['oLP']->get_message();
error_log('New LP - Loaded lp_save : ' . $_SERVER['REQUEST_URI'] . ' from ' . $_SERVER['HTTP_REFERER'], 0);
?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
echo api_get_language_isocode();
?>
" lang="<?php 
echo api_get_language_isocode();
?>
">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo api_get_system_encoding();
?>
" />
<script language='javascript'>
<?php 
if ($_SESSION['oLP']->mode != 'fullscreen') {
}
?>
</script>

</head>
<body dir="<?php 
echo api_get_text_direction();
?>
">
</body></html>
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:lp_save.php

示例13: get_student_publication

    /**
     * Creates a list with all the assignments in it
     *
     * @return string
     */
    function get_student_publication()
    {
        global $charset;
        $table_work = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
        $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
        $sp_lang_var = api_convert_encoding(get_lang('LpAssignment'), $charset, api_get_system_encoding());
        $return = '<a href="#" onclick="javascript:popup(\'popUpDiv5\');" class="big_button four_buttons rounded grey_border assignement_button">' . $sp_lang_var . '</a>';
        $assignments_lang_var = api_convert_encoding(get_lang('Assignments'), $charset, api_get_system_encoding());
        $close_lang_var = api_convert_encoding(get_lang('Close'), $charset, api_get_system_encoding());
        $newassignment_lang_var = api_convert_encoding(get_lang('LpNewAssignment'), $charset, api_get_system_encoding());
        $return .= '<div id="popUpDiv5" class="author_popup gradient rounded_10 grey_border" style="display:none;">' . '<span class="title">' . $assignments_lang_var . '</span>' . '<a href="#" class="close" onclick="javascript:popup(\'popUpDiv5\');">' . $close_lang_var . '</a>';
        $return .= '<div id="resDoc" class="content">';
        $sql = "SELECT id,url FROM {$table_work} s INNER JOIN {$table_item_property} i ON s.id = i.ref WHERE i.insert_user_id = '" . api_get_user_id() . "' AND session_id = '" . api_get_session_id() . "' AND filetype='folder' AND i.tool = 'work' AND i.visibility=1 ";
        $a_work = array();
        $rs = Database::query($sql, __FILE__, __LINE__);
        while ($row = Database::fetch_array($rs)) {
            $a_work[] = $row;
        }
        foreach ($a_work as $work) {
            $return .= '<div class="lp_resource_element">';
            if (!empty($work['id'])) {
                $return .= '<img alt="" src="../img/assignment_22.png" style="margin-right:5px;" title="" />';
                $return .= '<a style="cursor:hand" style="vertical-align:middle"></a>
									<a href="' . api_get_self() . '?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;action=add_item&amp;type=' . TOOL_STUDENTPUBLICATION . '&amp;work_id=' . $work['id'] . '&amp;lp_id=' . $this->lp_id . '" style="vertical-align:middle">' . api_convert_encoding(substr($work['url'], 1), $charset, api_get_system_encoding()) . '</a>';
            }
            $return .= '</div>';
        }
        $return .= '<div class="lp_resource_element">';
        $return .= Display::return_icon('pixel.gif', '', array('class' => 'actionplaceholdericon actionnewlist', 'alt' => "' . {$newassignment_lang_var} . '", 'style' => 'margin-right:5px;', 'title' => "' . {$newassignment_lang_var} . '"));
        $return .= '<a href="../work/work.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;toolgroup=&curdirpath=/&createdir=1&origin=&gradebook=type=' . TOOL_STUDENTPUBLICATION . '&amp;lp_id=' . $this->lp_id . '">' . $newassignment_lang_var . '</a>';
        $return .= '</div>';
        $return .= '</div>';
        $return .= '</div>';
        return $return;
    }
开发者ID:Eidn,项目名称:shanghai,代码行数:40,代码来源:learnpath.class.php

示例14: searchUserGroupAjax

 /**
  * @param $needle
  * @return xajaxResponse
  */
 public static function searchUserGroupAjax($needle)
 {
     $response = new xajaxResponse();
     $return = '';
     if (!empty($needle)) {
         // xajax send utf8 datas... datas in db can be non-utf8 datas
         $charset = api_get_system_encoding();
         $needle = api_convert_encoding($needle, $charset, 'utf-8');
         $needle = Database::escape_string($needle);
         // search courses where username or firstname or lastname begins likes $needle
         $sql = 'SELECT id, name FROM ' . Database::get_main_table(TABLE_USERGROUP) . ' u
                 WHERE name LIKE "' . $needle . '%"
                 ORDER BY name
                 LIMIT 11';
         $result = Database::query($sql);
         $i = 0;
         while ($data = Database::fetch_array($result)) {
             $i++;
             if ($i <= 10) {
                 $return .= '<a
                 href="javascript: void(0);"
                 onclick="javascript: add_user_to_url(\'' . addslashes($data['id']) . '\',\'' . addslashes($data['name']) . ' \')">' . $data['name'] . ' </a><br />';
             } else {
                 $return .= '...<br />';
             }
         }
     }
     $response->addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return));
     return $response;
 }
开发者ID:daffef,项目名称:chamilo-lms,代码行数:34,代码来源:usergroup.lib.php

示例15: get_lang

                  if ($key < $number_of_courses - 1) { ?>
                    <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
                    <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?>
                    </a>
            <?php } else {
                    echo Display::display_icon('down_na.png', get_lang('Down'),'',22);
                  }?>
                </div>
                 <div style="float:left; margin-right:10px;">
                  <!-- cancel subscrioption-->
            <?php if ($course['status'] != 1) {
                    if ($course['unsubscr'] == 1) {
            ?>
                    <!-- changed link to submit to avoid action by the search tool indexer -->
                    <form action="<?php echo api_get_self(); ?>" method="post" onsubmit="javascript: if (!confirm('<?php echo addslashes(api_htmlentities(get_lang("ConfirmUnsubscribeFromCourse"), ENT_QUOTES, api_get_system_encoding())) ?>')) return false;">
                        <input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
                        <input type="hidden" name="unsubscribe" value="<?php echo $course['code']; ?>" />
                        <button class="btn" value="<?php echo get_lang('Unsubscribe'); ?>" name="unsub">
                            <?php echo get_lang('Unsubscribe'); ?>
                        </button>
                    </form>
                    </div>
              <?php }
                }
              ?>
            </td>
            </tr>
            <?php
            $key++;
        }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:30,代码来源:courses_list.php


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