diff options
-rwxr-xr-x | editcode.inc | 26 | ||||
-rwxr-xr-x | general.inc | 5 |
2 files changed, 24 insertions, 7 deletions
diff --git a/editcode.inc b/editcode.inc index 99c34ef..653fcf3 100755 --- a/editcode.inc +++ b/editcode.inc @@ -216,16 +216,32 @@ function upload_examples_edit_form($form, $form_state) '#title' => t('Existing Main or Source File'), '#markup' => $source_file ); - $form['sourcefile']['cur_source_checkbox'] = array( - '#type' => 'checkbox', - '#title' => t('Delete Existing Main or Source File'), - '#description' => 'Check to delete the existing Main or Source file.' + $form['sourcefile']['source_file_action'] = array( + '#type' => 'radios', + '#options' => array('1'=>"Replace<br>", 2=>"Delete"), + '#title' => t('Select Action'), + '#required' => TRUE ); $form['sourcefile']['sourcefile1'] = array( '#type' => 'file', '#title' => t('Upload New Main or Source File'), '#size' => 48, - '#description' => t("Upload new Main or Source file above if you want to replace the existing file. Leave blank if you want to keep using the existing file. <br />") . t('Allowed file extensions : ') . variable_get('textbook_companion_source_extensions', '') + '#description' => t("<Strong style='color:red' >Upload new Main or Source file above, if you want to replace the existing file. Leave blank if you want to keep using the existing file.</strong> <br />") . t('Allowed file extensions : ') . variable_get('textbook_companion_source_extensions', ''), + '#states' => array( + 'visible' => array( + ':input[name="source_file_action"]' => array('value' => '1'), + ), + ), + ); + $form['sourcefile']['cur_source_checkbox'] = array( + '#type' => 'checkbox', + '#title' => t('Delete Existing Main or Source File'), + '#description' => 'Check to delete the existing Main or Source file.', + '#states' => array( + 'visible' => array( + ':input[name="source_file_action"]' => array('value' => '2'), + ), + ), ); $form['sourcefile']['cur_source_file_id'] = array( '#type' => 'hidden', diff --git a/general.inc b/general.inc index 56e5828..792d9df 100755 --- a/general.inc +++ b/general.inc @@ -269,11 +269,12 @@ function list_examples() $example_data->caption, $approval_status, $example_files, - l('Edit', 'textbook_companion/code/edit/' . $example_data->id) . ' | ' . l('Delete', 'textbook_companion/code/delete/' . $example_data->id, array( + l('Edit', 'textbook_companion/code/edit/' . $example_data->id) + /*l('Edit', 'textbook_companion/code/edit/' . $example_data->id) . ' | ' . l('Delete', 'textbook_companion/code/delete/' . $example_data->id, array( 'attributes' => array( 'onClick' => 'return confirm("Are you sure you want to delete the example?")' ) - )) + ))*/ ), 'valign' => 'top' ); |