Ejemplo n.º 1
0
 function export()
 {
     global $game, $DB;
     $mform = $this->_form;
     $javame = $this->_customdata['javame'];
     $javame->type = optional_param('type', 0, PARAM_ALPHANUM);
     $javame->filename = $mform->getElementValue('filename');
     $javame->icon = $mform->getElementValue('icon');
     $javame->createdby = $mform->getElementValue('createdby');
     $javame->vendor = $mform->getElementValue('vendor');
     $javame->name = $mform->getElementValue('name');
     $javame->description = $mform->getElementValue('description');
     $javame->version = $mform->getElementValue('version');
     $javame->maxpicturewidth = $mform->getElementValue('maxpicturewidth');
     $javame->maxpictureheight = $mform->getElementValue('maxpictureheight');
     if (!$DB->update_record('game_export_javame', $javame)) {
         print_error("game_export_javame: not updated id={$javame->id}");
     }
     require_once "exportjavame.php";
     game_OnExportJavaME($game, $javame);
 }
function game_OnExport($gameid)
{
    $kind = $_POST['kind'];
    if ($kind == 'javame') {
        $javame->id = $_POST['id'];
        $javame->filename = $_POST['filename'];
        $javame->icon = $_POST['icon'];
        $javame->createdby = $_POST['createdby'];
        $javame->vendor = $_POST['vendor'];
        $javame->name = $_POST['name'];
        $javame->description = $_POST['description'];
        $javame->version = $_POST['version'];
        $javame->type = $_POST['type'];
        $javame->maxpicturewidth = $_POST['maxpicturewidth'];
        $javame->maxpictureheight = $_POST['maxpictureheight'];
        if (!update_record("game_export_javame", $javame)) {
            error("game_export_javame: not updated id={$javame->id}");
        }
        game_OnExportJavaME($gameid, $javame);
    } else {
        if ($kind == 'html') {
            $html->id = $_POST['id'];
            if (array_key_exists('type', $_POST)) {
                $html->type = $_POST['type'];
            } else {
                $html->type = '';
            }
            $html->filename = $_POST['filename'];
            $html->title = $_POST['title'];
            if (array_key_exists('maxpicturewidth', $_POST)) {
                $html->maxpicturewidth = $_POST['maxpicturewidth'];
            } else {
                $html->maxpicturewidth = 0;
            }
            if (array_key_exists('maxpictureheight', $_POST)) {
                $html->maxpictureheight = $_POST['maxpictureheight'];
            } else {
                $html->maxpictureheight = 0;
            }
            if (array_key_exists('checkbutton', $_POST)) {
                $html->checkbutton = $_POST['checkbutton'] ? 1 : 0;
            }
            if (array_key_exists('printbutton', $_POST)) {
                $html->printbutton = $_POST['printbutton'] ? 1 : 0;
            }
            if (!update_record("game_export_html", $html)) {
                error("game_export_html: not updated id={$html->id}");
            }
            $update = $_POST['update'];
            require_once "exporthtml.php";
            game_OnExportHTML($gameid, $html, $update);
        }
    }
}