Exemple #1
0
 case 'parseAll':
     // start ModuleHandler
     global $ModuleHandler;
     $ModuleHandler = new ts_ModuleHandler();
     include_once 'functions/parseAll.func.php';
     parseAll();
     header('Location:?event=showModules');
     exit;
 case 'installModule':
     include_once 'functions/installModule.func.php';
     installModule();
     header('Location:?event=showModules');
     exit;
 case 'updateModule':
     include_once 'functions/updateModule.func.php';
     updateModule();
     header('Location:?event=showModules');
     exit;
 case 'uninstallModule':
     include_once 'functions/uninstallModule.func.php';
     uninstallModule();
     header('Location:?event=showModules');
     exit;
 case 'deleteModule':
     include_once 'functions/deleteModule.func.php';
     deleteModule();
     header('Location:?event=showModules');
     exit;
 case 'showStyles':
     // init database?
     include_once 'functions/initDatabase.func.php';
Exemple #2
0
        }
    }
    echo "</div><br /><br />";
}
if (isset($_GET[doInstall])) {
    installModule($_GET[name], $_GET[version], $_GET[doInstall], $_GET[md5], $_GET[size]);
    exit;
}
if (isset($_GET[remove])) {
    removeModule($_GET[remove], $_GET[version], $_GET[dest]);
    echo "<font color=lime>" . $strings["modules-js-removed"] . "<br />" . $strings["modules-js-pleaseWait"] . "</font><br />";
    echo "<script type='text/javascript'>setTimeout(\"window.location='index.php?modules'\", 800);</script>";
    exit;
}
if (isset($_GET[update])) {
    updateModule($_GET[name], $_GET[version], $_GET[md5], $_GET[size]);
    echo "<font color=lime>" . $strings["modules-js-updated"] . "<br />" . $strings["modules-js-pleaseWait"] . "</font><br />";
    exit;
}
if (isset($_GET[pin])) {
    pinToNav($_GET[pin], $_GET[dest], $_GET[startPage]);
    echo "<script type='text/javascript'>window.location = 'index.php?modules';</script>";
}
if (isset($_GET[unpin])) {
    unpinFromNav($_GET[unpin]);
    echo "<script type='text/javascript'>window.location = 'index.php?modules';</script>";
}
?>

<?php 
if (isset($_GET[MD5error])) {
    $ini += strlen($start);
    $len = strpos($string, $end, $ini) - $ini;
    return substr($string, $ini, $len);
}
// Setup variables
$courseID = $_POST['courseID'];
$moduleID = $_POST['moduleID'];
$moduleTitle = $_POST['moduleTitle'];
$primaryPage = $_POST['primaryPage'];
$secondaryTemplateCount = intval($_POST['secondaryPageCount']);
$assignmentCount = intval($_POST['assignmentCount']);
$discussionCount = intval($_POST['discussionCount']);
$quizCount = intval($_POST['quizCount']);
// Update the Module Title
$moduleParams = 'module[name]=' . $moduleTitle;
$moduleUpdate = updateModule($courseID, $moduleID, $moduleParams);
// Look for a module prefix
$explodedTitle = explode(":", $moduleTitle);
// if there is a module prefix, disect it
if (isset($explodedTitle[1])) {
    // Pull out the title
    $titleText = $explodedTitle[1];
    // break up the prefix to get the unit type and #
    $moduleIdentifier = $explodedTitle[0];
    $explodedIdentifier = explode(" ", $moduleIdentifier);
    if (isset($explodedIdentifier[1])) {
        $moduleUnit = $explodedIdentifier[0];
        $moduleNumber = $explodedIdentifier[1];
        $modulePrefix = $moduleUnit . ' ' . $moduleNumber . ': ';
    }
} else {