Пример #1
0
    $scormdocument = Database::get_course_table(TABLE_LP_MAIN);
    $sql = "SELECT id FROM {$scormdocument} WHERE path='" . Database::escape_string(api_substr($workWith, 1)) . "' OR path='" . Database::escape_string(substr($workWith, 1)) . "/.'";
    $result = Database::query($sql);
    if (Database::num_rows($result) == 1) {
        if ($row = Database::fetch_array($result)) {
            $sdi = $row['id'];
        }
    }
}
if (isset($sdi) && is_numeric($sdi) && $sdi > 0 && $sdi == (int) $sdi) {
    $mdObj = new mdobject($_course, $sdi);
    $workWith = $mdObj->mdo_path;
    $hdrInfo = ' ' . get_lang('WorkOn') . ' ' . ($workWith ? htmlspecialchars($workWith, ENT_QUOTES, $charset) . ', ' : '') . 'SD-id= ' . htmlspecialchars($sdi, ENT_QUOTES, $charset) . ($sdisub ? ' (' . htmlspecialchars($sdisub, ENT_QUOTES, $charset) . ')' : '');
} else {
    unset($sdi);
    $mdObj = new mdobject($_course, 0);
    if ($workWith) {
        $hdrInfo = ' (' . htmlspecialchars($workWith, ENT_QUOTES, $charset) . ': ' . get_lang('NotInDB') . ')';
    }
    unset($workWith);
}
define('UZYX', 'UZYX');
// magic word to repeat for all $sdisub
if ($sdiall = $sdisub == UZYX) {
    $sdisub = '';
    $sdiall = array();
    if ($dh = opendir($baseWorkDir . $workWith)) {
        while (false !== ($file = readdir($dh))) {
            if (ereg('^' . MFFNAME . '(.+)\\' . MFFDEXT . '$', $file, $regs)) {
                $sdiall[] = $regs[1];
            }
Пример #2
0
        	$sdi = $row['id'];
        }
    }
}

if (isset($sdi) && is_numeric($sdi) && $sdi > 0 && $sdi == (int) $sdi)
{
    $mdObj = new mdobject($_course, $sdi); $workWith = $mdObj->mdo_path;
    $hdrInfo = ' ' . get_lang('WorkOn') . ' ' .
        ($workWith ? htmlspecialchars($workWith, ENT_QUOTES, $charset) . ', ' : '') .
        'SD-id= ' . htmlspecialchars($sdi, ENT_QUOTES, $charset) .
        ($sdisub ? ' (' . htmlspecialchars($sdisub, ENT_QUOTES, $charset) . ')' : '');
}
else
{
    unset($sdi); $mdObj = new mdobject($_course, 0);
    if ($workWith) $hdrInfo = ' (' . htmlspecialchars($workWith, ENT_QUOTES, $charset) .
        ': ' . get_lang('NotInDB') . ')'; unset($workWith);
}

define('UZYX', 'UZYX');  // magic word to repeat for all $sdisub

if (($sdiall = ($sdisub == UZYX)))
{
	$sdisub = ''; $sdiall = array();
	if (($dh = opendir($baseWorkDir . $workWith)))
    {
        while (FALSE !== ($file = readdir($dh)))
            if (ereg('^'.MFFNAME.'(.+)\\'.MFFDEXT .'$', $file, $regs))
            	$sdiall[] = $regs[1];
        closedir($dh);
}
if (RNG != '*') {
    $urlp .= '&rng=' . urlencode(RNG);
}
// name of the language file that needs to be included
$language_file = LFN;
require '../inc/global.inc.php';
$nameTools = get_lang('Tool');
require api_get_path(SYS_CODE_PATH) . 'metadata/md_funcs.php';
$nameTools && get_lang('Sorry') or give_up('Language file ' . LFN . " doesn't define 'Tool' and 'Sorry'");
$_course = api_get_course_info();
isset($_course) or give_up(get_lang('Sorry'));
require api_get_path(LIBRARY_PATH) . 'xmd.lib.php';
require api_get_path(LIBRARY_PATH) . 'xht.lib.php';
require api_get_path(SYS_CODE_PATH) . 'metadata/md_' . strtolower(EID_TYPE) . '.php';
$mdObj = new mdobject($_course, EID_ID);
define('DR', $_SERVER['DOCUMENT_ROOT']);
define('SELF', api_get_self());
define('DIRECTORY', DR . ($self = substr(SELF, 0, strrpos(SELF, '/'))));
if (!file_exists(DIRECTORY)) {
    give_up('No such directory: ' . DIRECTORY);
}
// TEMPLATES FILE ------------------------------------------------------------->
$topdir = strtolower(realpath(DR));
// to stop search for .htt file
if (strpos(strtolower(realpath(DIRECTORY)), $topdir) !== 0) {
    give_up('Invalid directory: ' . DIRECTORY);
}
chdir(DIRECTORY);
for ($i = 0; $i < 10; $i++) {
    if (!file_exists(HTT . '.htt')) {
Пример #4
0
';
Display::display_header($nameTools);

// OPERATIONS ----------------------------------------------------------------->

if ($ufos) echo '<h3>', $ufos, ' ', get_lang('RemainingFor'), ' ',
        htmlspecialchars($lcn, ENT_QUOTES, $charset), '</h3>', "\n";

if (isset($slo)) echo '<h3>', $slo, '</h3>', "\n";  // selected links op

if (isset($slo))
if ($slo == get_lang('Create') && count($lceids))
{
    foreach ($lceids as $id => $eid)
    {
        $mdObj = new mdobject($_course, $id); $xht = $mdObj->mdo_define_htt();
        $mdStore->mds_put($eid, $mdt = $mdObj->mdo_generate_default_xml_metadata(),
            'mdxmltext', '?');
        $xht->xht_xmldoc = new xmddoc(explode("\n", $mdt));
        $mdStore->mds_put($eid, $xht->xht_fill_template('INDEXABLETEXT'),
            'indexabletext');
        echo '<span class="lbs" onClick="', "javascript: makeWindow('index.php?eid=",
            urlencode($eid), "', '', '')\">", htmlspecialchars($eid, ENT_QUOTES, $charset), '</span> ';
    }
    echo '<br>';
}
elseif ($slo == get_lang('Remove') && count($lceids))
{
    $mdStore->mds_delete_many($mceids); $aff = Database::affected_rows();

    echo $aff, ' MDEs/ ', count($lceids), ' ', get_lang('MdCallingTool'),
require 'md_' . strtolower(EID_TYPE) . '.php';
// name of the language file that needs to be included
$language_file = 'md_' . strtolower(EID_TYPE);
include '../inc/global.inc.php';
$this_section = SECTION_COURSES;
$nameTools = get_lang('Tool');
$nameTools && get_lang('Sorry') or give_up('Language file ' . $language_file . " doesn't define 'Tool' and 'Sorry'");
$_course = api_get_course_info();
isset($_course) or give_up(get_lang('Sorry'));
$is_allowed_to_edit = isset($_user['user_id']) && $is_courseMember && api_is_allowed_to_edit();
if (!$is_allowed_to_edit) {
    give_up(get_lang('Denied'));
}
$mdStore = new mdstore($is_allowed_to_edit);
// create table if needed
$mdObj = new mdobject($_course, 0);
require api_get_path(LIBRARY_PATH) . 'xmd.lib.php';
require api_get_path(LIBRARY_PATH) . 'xht.lib.php';
$xhtDoc = $mdObj->mdo_define_htt();
$mdObj->mdo_add_breadcrump_nav();
// see 'md_' . EID_TYPE . '.php'
Display::display_header($nameTools);
// OPERATIONS ----------------------------------------------------------------->
echo '<h3>', htmlspecialchars(EID_TYPE, ENT_QUOTES, $charset), '</h3>', "\n";
$result = $mdStore->mds_get_many('eid,mdxmltext', "eid LIKE '" . EID_TYPE . ".%'");
echo get_lang('TotalMDEs'), $total = Database::num_rows($result), "<br><br>\n";
if ($total > 100) {
    set_time_limit((int) ($total / 10));
}
while ($row = Database::fetch_array($result)) {
    $eid = $row['eid'];
Пример #6
0
    $urlp .= '&htt=' . urlencode(HTT);
}
if (DBG) {
    $urlp .= '&dbg=' . urlencode(DBG);
}
// name of the language file that needs to be included
$language_file = LFN;
require_once "../inc/global.inc.php";
$this_section = SECTION_COURSES;
$nameTools = get_lang('Tool');
$nameTools && get_lang('Sorry') or give_up('Language file ' . LFN . " doesn't define 'Tool' and 'Sorry'");
$_course = api_get_course_info();
isset($_course) or give_up(get_lang('Sorry'));
require api_get_path(LIBRARY_PATH) . 'xmd.lib.php';
require api_get_path(LIBRARY_PATH) . 'xht.lib.php';
$mdObj = new mdobject($_course, EID_ID);
// see 'md_' . EID_TYPE . '.php'
// Construct assoclist $langLangs from language table ------------------------->
$result = Database::query("SELECT isocode FROM " . Database::get_main_table(TABLE_MAIN_LANGUAGE) . " WHERE available='1' ORDER BY isocode ASC");
$sep = ":";
$langLangs = $sep . "xx" . $sep . "xx";
while ($row = Database::fetch_array($result)) {
    if ($isocode = $row['isocode']) {
        $langLangs .= ",, " . $isocode . $sep . $isocode;
    }
}
// XML and DB STUFF ----------------------------------------------------------->
$is_allowed_to_edit = isset($_user['user_id']) && $is_courseMember && api_is_allowed_to_edit();
$mdStore = new mdstore($is_allowed_to_edit);
if (($mdt_rec = $mdStore->mds_get(EID)) === FALSE) {
    // no record, default XML