コード例 #1
0
ファイル: moodlelib.php プロジェクト: nadavkav/rtlMoodle
/**
 * Returns a list of picture names in the current or specified language
 *
 * @uses $CFG
 * @return array
 */
function get_list_of_pixnames($lang = '')
{
    global $CFG;
    if (empty($lang)) {
        $lang = current_language();
    }
    $string = array();
    $path = $CFG->dirroot . '/lang/en_utf8/pix.php';
    // always exists
    if (file_exists($CFG->dataroot . '/lang/' . $lang . '_local/pix.php')) {
        $path = $CFG->dataroot . '/lang/' . $lang . '_local/pix.php';
    } else {
        if (file_exists($CFG->dirroot . '/lang/' . $lang . '/pix.php')) {
            $path = $CFG->dirroot . '/lang/' . $lang . '/pix.php';
        } else {
            if (file_exists($CFG->dataroot . '/lang/' . $lang . '/pix.php')) {
                $path = $CFG->dataroot . '/lang/' . $lang . '/pix.php';
            } else {
                if ($parentlang = get_string('parentlanguage') and $parentlang != '[[parentlanguage]]') {
                    return get_list_of_pixnames($parentlang);
                    //return pixnames from parent language instead
                }
            }
        }
    }
    include $path;
    return $string;
}
コード例 #2
0
<?php

require "../../../../../../../config.php";
$id = optional_param('id', SITEID, PARAM_INT);
require_course_login($id);
@header('Content-Type: text/html; charset=utf-8');
$pixpath = "{$CFG->pixpath}/s";
$fullnames = get_list_of_pixnames();
$emoticons = array('smiley' => ':-)', 'biggrin' => ':-D', 'wink' => ';-)', 'mixed' => ':-/', 'thoughtful' => 'V-.', 'tongueout' => ':-P', 'cool' => 'B-)', 'approve' => '^-)', 'wideeyes' => '8-)', 'clown' => ':o)', 'sad' => ':-(', 'shy' => '8-.', 'blush' => ':-I', 'kiss' => ':-X', 'surprise' => '8-o', 'blackeye' => 'P-|', 'angry' => '8-[', 'dead' => 'xx-P', 'sleepy' => '|-.', 'evil' => '}-]');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>{#emoticons_dlg.title}</title>
	<script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
	<script type="text/javascript" src="js/emoticons.js?v=307"></script>
	<base target="_self" />
</head>
<body style="display: none">
	<div align="center">
<table class="dlg" cellpadding="0" cellspacing="2" width="100%">
<tr><td><table width="100%"><tr><td class="title" nowrap="nowrap"><?php 
print_string('chooseicon', 'editor');
?>
</td></tr></table></td></tr>
<tr>
<td>
    <table border="0" align="center" cellpadding="5">
      <tr valign="top">
        <td>
        <table border="0">