<!-- This page defines the form to create or edit an instance of this module -->
<!-- It is used from /course/mod.php.  The whole instance is available as $form. -->

<?php // $Id: mod.html,v 1.5 2011-05-25 12:13:03 sarjona Exp $
require_once("../mod/jclic/lib.php");

/// First we check that form variables have been initialised
if (!isset($form->name)) {
    $form->name = '';
}
if (!isset($form->url)) {
    $form->url = '';
}
if (!isset($form->skin)) {
    $form->skin = '';
}
?>

<form name="form" method="post" action="mod.php">
<center>
<table cellpadding="5">
<tr valign="top">
    <td align="right"><b><?php  print_string("name") ?>:</b></td>
    <td align="left">
        <input type="text" name="name" size="30" value="<?php  p($form->name) ?>">
    </td>
</tr>
<tr valign="top">
    <td align="right"><b><?php  print_string("description", "jclic") ?>:</b></td>
    <td>
        <?php print_textarea($usehtmleditor, 10, 50, 680, 400, "description", (property_exists('form', 'description')!==FALSE?$form->description:"") ); ?>
    </td>
</tr>

<tr valign="top">
    <td align="right"><b><?php  print_string("url", "jclic") ?>:</b></td>
    <td align="left">
        <input type="text" name="url" size="80" value="<?php  p($form->url) ?>">
        <?php echo helpbutton('url', get_string('url','jclic'), 'jclic', true, false, '', true); ?>
    </td>
</tr>
<tr valign="top">
    <td align="right"></td>
    <td align="left">
        <?php
          $url = "/files/index.php?id=$course->id&choose=form.url"; 
          $strchooseafile = get_string("chooseafile", "resource");
				  button_to_popup_window ($url, 'coursefiles', $strchooseafile, 500, 750, $strchooseafile);
       ?>
    </td>
</tr>

<tr valign="top">
    <td align="right"><b><?php  print_string("skin", "jclic") ?>:</b></td>
    <td align="left">
        <?php $array = array('@default.xml' => 'default','@blue.xml' => 'blue','@orange.xml' => 'orange','@green.xml' => 'green','@simple.xml' => 'simple');
        $selected= $form->skin!=''?$form->skin:-1;
		echo choose_from_menu($array, 'skin', $selected, '');?>
    </td>
</tr>
<tr valign="top">
    <td align="right"><b><?php  print_string("size", "jclic") ?>:</b></td>
    <td align="left">
        <?php  print_string("width", "jclic") ?>: <input type="text" name="width" size="5" value="<?php  p(property_exists('form', 'width')!==FALSE?$form->width:'600') ?>">
        <?php  print_string("height", "jclic") ?>: <input type="text" name="height" size="5" value="<?php  p(property_exists('form', 'height')!==FALSE?$form->height:'400') ?>">
	
    </td>
</tr>
<tr valign="top">
    <td align="right"><b><?php  print_string("maxattempts", "jclic") ?>:</b></td>
    <td align="left">
        <?php $array = array(-1 => get_string('unlimited','jclic'), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 10 => 10);
        $selected= property_exists('form', 'maxattempts')!==FALSE?$form->maxattempts:-1;
	echo choose_from_menu($array, 'maxattempts', $selected, '');?>
    </td>
</tr>
<tr valign="top">
    <td align="right"><b><?php  print_string("avaluation", "jclic") ?>:</b></td>
    <td align="left">
        <?php $array = array('score' => get_string('avaluation_score','jclic'),'solved' => get_string('avaluation_solved','jclic'));
        $selected= property_exists('form', 'avaluation')!==FALSE?$form->avaluation:-1;
	echo choose_from_menu($array, 'avaluation', $selected, '');?>
    </td>
</tr>
<tr valign="top">
    <td align="right"><b><?php  print_string("maxgrade", "jclic") ?></span>:</b></td>
    <td align="left">
	 <input type="text" name="maxgrade" size="5" value="<?php  p(property_exists('form', 'maxgrade')!==FALSE?$form->maxgrade:100) ?>">
    </td>
</tr>



<!-- The following line for Moodle 1.5 prints the visibility setting form element -->
<?php print_visible_setting($form); ?>


</table>


<!-- These hidden variables are always the same -->
<input type="hidden" name=course        value="<?php  p($form->course) ?>" />
<input type="hidden" name="sesskey"     value="<?php  p($form->sesskey) ?>" />
<input type="hidden" name=coursemodule  value="<?php  p($form->coursemodule) ?>" />
<input type="hidden" name=section       value="<?php  p($form->section) ?>" />
<input type="hidden" name=module        value="<?php  p($form->module) ?>" />
<input type="hidden" name=modulename    value="<?php  p($form->modulename) ?>" />
<input type="hidden" name=instance      value="<?php  p($form->instance) ?>" />
<input type="hidden" name=mode          value="<?php  p($form->mode) ?>" />
<!--input type="button" value="<?php  print_string("preview") ?>" onclick="previewJClic(this.form);" /-->
<input type="submit" value="<?php  print_string("savechanges") ?>" />
<input type="submit" name="cancel" value="<?php  print_string("cancel") ?>" />
</center>

</form>
