diff options
-rwxr-xr-x | css/r_tbc_fixer.css (renamed from css/textbook_companion_fixer.css) | 0 | ||||
-rwxr-xr-x | js/r_tbc_fixer.js (renamed from js/textbook_companion_fixer.js) | 35 | ||||
-rwxr-xr-x[-rw-r--r--] | js/r_tbc_fixer_edit_category.js (renamed from js/textbook_companion_fixer_edit_category.js) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | r_tbc.module (renamed from textbook_companion_fixer.module) | 171 | ||||
-rwxr-xr-x | r_tbc_fixer.info | 5 | ||||
-rwxr-xr-x | r_tbc_fixer.module | 471 | ||||
-rwxr-xr-x | r_tbc_fixer_edit_book_category.inc (renamed from textbook_companion_fixer_edit_book_category.inc) | 40 | ||||
-rwxr-xr-x[-rw-r--r--] | r_tbc_fixer_email.inc (renamed from textbook_companion_fixer_email.inc) | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | r_tbc_fixer_settings.inc (renamed from textbook_companion_fixer_settings.inc) | 22 | ||||
-rwxr-xr-x | textbook_companion_fixer.info | 4 |
10 files changed, 601 insertions, 161 deletions
diff --git a/css/textbook_companion_fixer.css b/css/r_tbc_fixer.css index 1a91bb0..1a91bb0 100755 --- a/css/textbook_companion_fixer.css +++ b/css/r_tbc_fixer.css diff --git a/js/textbook_companion_fixer.js b/js/r_tbc_fixer.js index b655b05..dbb20d7 100755 --- a/js/textbook_companion_fixer.js +++ b/js/r_tbc_fixer.js @@ -1,7 +1,7 @@ (function($) { $(document).ready(function() { var basePath = Drupal.settings.basePath; - var modPath = basePath + "textbook_companion_fixer/"; + var modPath = basePath + "r_tbc_fixer/"; var modPath1 = basePath + "textbook_companion_fixer/aicte/book/"; $category = $("#fix-tbc-form #edit-category"); $book = $("#fix-tbc-form #edit-book"); @@ -42,39 +42,6 @@ $(".example-code-edit").hide(); $(".well").hide(); $(".update-button").hide(); - $category.change(function() { - reset("book", "chapter", "example", "caption"); - var category_id = $(this).val(); - if (category_id < 1) { - $(".select-book").hide(); - $(".select-chapter").hide(); - $(".enter-chapter-name").hide(); - $(".select-example").hide(); - $(".enter-caption").hide(); - $(".chapter-example-chk").hide(); - $(".example-code-edit").hide(); - (".well").hide(); - $(".update-button").hide(); - } else { - $(".select-book").show(); - $(".select-chapter").hide(); - $(".enter-chapter-name").hide(); - $(".chapter-example-chk").hide(); - $(".select-example").hide(); - $(".enter-caption").hide(); - $(".example-code-edit").hide(); - $(".well").hide(); - $(".update-button").hide(); - } - $.ajax({ - url: modPath + "ajax/category/" + category_id, - type: "POST", - dataType: "html", - success: function(data) { - $book.html(data); - } - }); - }); $book.change(function() { reset("chapter", "example", "caption"); var book_id = $(this).val(); diff --git a/js/textbook_companion_fixer_edit_category.js b/js/r_tbc_fixer_edit_category.js index bad5ec7..bad5ec7 100644..100755 --- a/js/textbook_companion_fixer_edit_category.js +++ b/js/r_tbc_fixer_edit_category.js diff --git a/textbook_companion_fixer.module b/r_tbc.module index bc8484c..3a601d6 100755..100644 --- a/textbook_companion_fixer.module +++ b/r_tbc.module @@ -1,137 +1,137 @@ <?php -require_once('textbook_companion_fixer_email.inc'); -include('textbook_companion_fixer_edit_book_category.inc'); -function textbook_companion_fixer_menu() +require_once('r_tbc_fixer_email.inc'); +include('r_tbc_fixer_edit_book_category.inc'); +function r_tbc_fixer_menu() { $items = array(); - $items["textbook_companion_fixer/caption"] = array( + $items["r_tbc_fixer/caption"] = array( "title" => "Edit TBC captions", - "page callback" => "scilab_fixer_caption_all", + "page callback" => "R_fixer_caption_all", "access arguments" => array( - "fix scilab_code_caption" + "fix R_code_caption" ), "type" => MENU_NORMAL_ITEM ); - $items["textbook_companion_fixer/aicte"] = array( + $items["r_tbc_fixer/aicte"] = array( "title" => "Add AICTE books", - "page callback" => "scilab_fixer_aicte_all", + "page callback" => "R_fixer_aicte_all", "access arguments" => array( - "fix scilab" + "fix R" ), "weight" => 30, "type" => MENU_NORMAL_ITEM ); - $items["textbook_companion_fixer/aicte/new"] = array( + $items["r_tbc_fixer/aicte/new"] = array( "title" => "Add AICTE books", - "page callback" => "scilab_fixer_aicte_all", + "page callback" => "R_fixer_aicte_all", "access arguments" => array( - "fix scilab" + "fix R" ), "weight" => 1, "type" => MENU_DEFAULT_LOCAL_TASK ); - $items["textbook_companion_fixer/aicte/edit"] = array( + $items["r_tbc_fixer/aicte/edit"] = array( "title" => "Edit AICTE books", - "page callback" => "scilab_fixer_aicte_edit_all", + "page callback" => "R_fixer_aicte_edit_all", "access arguments" => array( - "fix scilab" + "fix R" ), "weight" => 2, "type" => MENU_LOCAL_TASK ); - $items["textbook_companion_fixer/aicte/in"] = array( + $items["r_tbc_fixer/aicte/in"] = array( "title" => "Mark Indian edition books", - "page callback" => "scilab_fixer_aicte_in_all", + "page callback" => "R_fixer_aicte_in_all", "access arguments" => array( - "fix scilab" + "fix R" ), "type" => MENU_CALLBACK ); - $items["textbook_companion_fixer/code"] = array( + $items["r_tbc_fixer/code"] = array( "title" => "Edit TBC code", - "page callback" => "scilab_fixer_code_all", + "page callback" => "R_fixer_code_all", "access arguments" => array( - "fix scilab" + "fix R" ), "type" => MENU_NORMAL_ITEM ); - $items["textbook_companion_fixer/ajax"] = array( - "page callback" => "scilab_fixer_ajax", + $items["r_tbc_fixer/ajax"] = array( + "page callback" => "R_fixer_ajax", "access callback" => TRUE, "type" => MENU_CALLBACK ); - $items["textbook_companion_fixer/aicte/book/ajax"] = array( - "page callback" => "scilab_fixer_aicte_ajax", + $items["r_tbc_fixer/aicte/book/ajax"] = array( + "page callback" => "R_fixer_aicte_ajax", "access callback" => TRUE, "type" => MENU_CALLBACK ); - $items["textbook_companion_fixer/ajax/edit-book-category"] = array( - "page callback" => "textbook_companion_fixer_edit_book_category_ajax", + $items["r_tbc_fixer/ajax/edit-book-category"] = array( + "page callback" => "r_tbc_fixer_edit_book_category_ajax", "access callback" => TRUE, "type" => MENU_CALLBACK, - "file" => "textbook_companion_fixer_edit_book_category.inc" + "file" => "r_tbc_fixer_edit_book_category.inc" ); /* for admin */ - $items['admin/settings/textbook_companion_fixer_settings'] = array( + $items['admin/settings/r_tbc_fixer_settings'] = array( 'title' => 'textbook companion fixer Settings', 'description' => 'Textbook Companion Fixer Settings', 'page callback' => 'drupal_get_form', 'page arguments' => array( - 'textbook_companion_fixer_settings_form' + 'r_tbc_fixer_settings_form' ), 'access arguments' => array( 'administer textbook companion fixer settings' ), 'type' => MENU_NORMAL_ITEM, - 'file' => 'textbook_companion_fixer_settings.inc' + 'file' => 'r_tbc_fixer_settings.inc' ); // edit book categoery - $items["textbook_companion_fixer/edit_book_category"] = array( + $items["r_tbc_fixer/edit_book_category"] = array( "title" => "Edit Completed Books Category", - "page callback" => "textbook_companion_fixer_edit_book_proposal_all", + "page callback" => "r_tbc_fixer_edit_book_proposal_all", "access arguments" => array( - "fix scilab_textbook_category" + "fix R_textbook_category" ), "type" => MENU_NORMAL_ITEM, - 'file' => 'textbook_companion_fixer_edit_book_category.inc' + 'file' => 'r_tbc_fixer_edit_book_category.inc' ); - $items['textbook_companion_fixer/category_edit'] = array( + $items['r_tbc_fixer/category_edit'] = array( 'title' => 'Categorize', 'description' => 'Edit Completed Books Category', 'page callback' => 'drupal_get_form', 'page arguments' => array( - 'textbook_companion_fixer_category_edit_form' + 'r_tbc_fixer_category_edit_form' ), 'access arguments' => array( - 'fix scilab_textbook_category' + 'fix R_textbook_category' ), 'type' => MENU_NORMAL_ITEM, - 'file' => 'textbook_companion_fixer_edit_book_category.inc' + 'file' => 'r_tbc_fixer_edit_book_category.inc' ); return $items; } -function textbook_companion_fixer_permission() +function r_tbc_fixer_permission() { return array( - "fix scilab" => array( - "title" => t("fix scilab code"), + "fix R" => array( + "title" => t("fix R code"), 'restrict access' => TRUE ), - "fix scilab_code_caption" => array( - "title" => t("fix scilab code caption"), + "fix R_code_caption" => array( + "title" => t("fix R code caption"), 'restrict access' => TRUE ), "administer textbook companion fixer settings" => array( "title" => t("administer textbook companion fixer settings"), 'restrict access' => TRUE ), - "fix scilab_textbook_category" => array( - "title" => t("fix scilab textbook category"), + "fix R_textbook_category" => array( + "title" => t("fix R textbook category"), 'restrict access' => TRUE ) ); } -function scilab_fixer_caption_form($form, &$form_state) +function R_fixer_caption_form($form, &$form_state) { $form = array(); $form["wrapper"] = array( @@ -220,19 +220,20 @@ function scilab_fixer_caption_form($form, &$form_state) ); return $form; } -function scilab_fixer_caption_all() +function R_fixer_caption_all() { $page_content = ""; $page_content .= "<div id='fix-tbc-page'>"; $page_content .= "<center><span id='updating'>Updating...</span></center>"; $page_content .= "<span id='done'>Done.</span>"; - $scilab_fixer_caption_form = drupal_get_form("scilab_fixer_caption_form"); - $page_content .= drupal_render($scilab_fixer_caption_form); + $R_fixer_caption_form = drupal_get_form("R_fixer_caption_form"); + $page_content .= drupal_render($R_fixer_caption_form); $page_content .= "</div>"; $page_content .= "<small>* Selecting text from above code-area with mouse will add it to the caption textbox.</small>"; return $page_content; } -function scilab_fixer_ajax($item, $key) + +function R_fixer_ajax($item, $key) { $data = ""; global $user; @@ -328,8 +329,8 @@ function scilab_fixer_ajax($item, $key) /* sending email */ $email_to = $user->mail; $from = variable_get('textbook_companion_from_email', ''); - $bcc = variable_get('textbook_companion_fixer_bcc_emails', ''); - $cc = variable_get('textbook_companion_fixer_cc_emails', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); $params['example_updated']['example_id'] = $example_id; $params['example_updated']['user_id'] = $user->uid; $params['example_updated']['headers'] = array( @@ -341,9 +342,9 @@ function scilab_fixer_ajax($item, $key) 'Cc' => $cc, 'Bcc' => $bcc ); - if (!drupal_mail('textbook_companion_fixer', 'example_updated', $email_to, language_default(), $params, $from, TRUE)) { + if (!drupal_mail('r_tbc_fixer', 'example_updated', $email_to, language_default(), $params, $from, TRUE)) { $data .= 'Error sending email message.'; - } //!drupal_mail('textbook_companion_fixer', 'example_updated', $email_to, language_default(), $params, $from, TRUE) + } //!drupal_mail('r_tbc_fixer', 'example_updated', $email_to, language_default(), $params, $from, TRUE) } //$item == "update-example" else if ($item == "update-chapter") { $chapter_id = $_POST["chapter_id"]; @@ -358,8 +359,8 @@ function scilab_fixer_ajax($item, $key) /* sending email */ $email_to = $user->mail; $from = variable_get('textbook_companion_from_email', ''); - $bcc = variable_get('textbook_companion_fixer_bcc_emails', ''); - $cc = variable_get('textbook_companion_fixer_cc_emails', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); $params['chapter_updated']['chapter_id'] = $chapter_id; $params['chapter_updated']['user_id'] = $user->uid; $params['chapter_updated']['headers'] = array( @@ -371,9 +372,9 @@ function scilab_fixer_ajax($item, $key) 'Cc' => $cc, 'Bcc' => $bcc ); - if (!drupal_mail('textbook_companion_fixer', 'chapter_updated', $email_to, language_default(), $params, $from, TRUE)) { + if (!drupal_mail('r_tbc_fixer', 'chapter_updated', $email_to, language_default(), $params, $from, TRUE)) { $data .= 'Error sending email message.'; - } //!drupal_mail('textbook_companion_fixer', 'chapter_updated', $email_to, language_default(), $params, $from, TRUE) + } //!drupal_mail('r_tbc_fixer', 'chapter_updated', $email_to, language_default(), $params, $from, TRUE) } //$item == "update-chapter" else if ($item == "update-both") { $example_id = $_POST["example_id"]; @@ -396,8 +397,8 @@ function scilab_fixer_ajax($item, $key) /* sending email */ $email_to = $user->mail; $from = variable_get('textbook_companion_from_email', ''); - $bcc = variable_get('textbook_companion_fixer_bcc_emails', ''); - $cc = variable_get('textbook_companion_fixer_cc_emails', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); $params['example_updated']['example_id'] = $example_id; $params['example_updated']['user_id'] = $user->uid; $params['example_updated']['headers'] = array( @@ -409,9 +410,9 @@ function scilab_fixer_ajax($item, $key) 'Cc' => $cc, 'Bcc' => $bcc ); - if (!drupal_mail('textbook_companion_fixer', 'chapter_example_updated', $email_to, language_default(), $params, $from, TRUE)) { + if (!drupal_mail('r_tbc_fixer', 'chapter_example_updated', $email_to, language_default(), $params, $from, TRUE)) { $data .= 'Error sending email message.'; - } //!drupal_mail('textbook_companion_fixer', 'chapter_example_updated', $email_to, language_default(), $params, $from, TRUE) + } //!drupal_mail('r_tbc_fixer', 'chapter_example_updated', $email_to, language_default(), $params, $from, TRUE) } //$item == "update" else if ($item == "code" && $key) { $code = $_POST["code"]; @@ -449,7 +450,7 @@ function scilab_fixer_ajax($item, $key) echo $data; exit(); } -function scilab_fixer_aicte_ajax($item = "", $key = "") +function R_fixer_aicte_ajax($item = "", $key = "") { $data = ""; if ($item == "selected") { @@ -467,7 +468,7 @@ function scilab_fixer_aicte_ajax($item = "", $key = "") echo $data; exit(); } -function scilab_fixer_aicte_form($form, $form_state, $aicte_id = '') +function R_fixer_aicte_form($form, $form_state, $aicte_id = '') { /*$query = " SELECT * FROM textbook_companion_aicte @@ -533,7 +534,7 @@ function scilab_fixer_aicte_form($form, $form_state, $aicte_id = '') ); return $form; } -function scilab_fixer_aicte_form_validate($form, &$form_state) +function R_fixer_aicte_form_validate($form, &$form_state) { if (!$form_state["values"]["category"]) { form_set_error("category", "Please select a category."); @@ -545,7 +546,7 @@ function scilab_fixer_aicte_form_validate($form, &$form_state) form_set_error("year", "Please enter a valid year. eg: 2011."); } //!is_numeric($form_state["values"]["year"]) && strlen($form["values"]["year"]) != 4 } -function scilab_fixer_aicte_form_submit($form, &$form_state) +function R_fixer_aicte_form_submit($form, &$form_state) { $v = $form_state["values"]; if ($v["aicte_id"]) { @@ -594,19 +595,19 @@ function scilab_fixer_aicte_form_submit($form, &$form_state) drupal_set_message(t('Book added successfully'),'status'); } } -function scilab_fixer_aicte_all() +function R_fixer_aicte_all() { $page_content = ""; - $scilab_fixer_aicte_form = drupal_get_form("scilab_fixer_aicte_form"); - $page_content .= drupal_render($scilab_fixer_aicte_form); + $R_fixer_aicte_form = drupal_get_form("R_fixer_aicte_form"); + $page_content .= drupal_render($R_fixer_aicte_form); return $page_content; } -function scilab_fixer_aicte_edit_all($aicte_id = 0) +function R_fixer_aicte_edit_all($aicte_id = 0) { $page_content = ""; if ($aicte_id) { - $scilab_fixer_aicte_form = drupal_get_form("scilab_fixer_aicte_form", $aicte_id); - $page_content .= drupal_render($scilab_fixer_aicte_form); + $R_fixer_aicte_form = drupal_get_form("R_fixer_aicte_form", $aicte_id); + $page_content .= drupal_render($R_fixer_aicte_form); } //$aicte_id else { /*$query = " @@ -630,7 +631,7 @@ function scilab_fixer_aicte_edit_all($aicte_id = 0) "{$row->book}", "{$row->author}", "{$row->edition}", - l(t("Edit"), "textbook_companion_fixer/aicte/edit/{$row->id}") + l(t("Edit"), "r_tbc_fixer/aicte/edit/{$row->id}") ); if ($row->selected) { $check = "<input class='selected' type='checkbox' data-bid='{$row->id}' checked>"; @@ -649,7 +650,7 @@ function scilab_fixer_aicte_edit_all($aicte_id = 0) } return $page_content; } -function scilab_fixer_aicte_in_all() +function R_fixer_aicte_in_all() { $page_content = ""; /*$query = " @@ -699,7 +700,7 @@ function scilab_fixer_aicte_in_all() )); return $page_content; } -function scilab_fixer_code_form($form, &$form_state) +function R_fixer_code_form($form, &$form_state) { $form = array(); $form["code_edit"] = array( @@ -755,23 +756,23 @@ function scilab_fixer_code_form($form, &$form_state) ); return $form; } -function scilab_fixer_code_all() +function R_fixer_code_all() { $page_content = ""; $page_content .= "<div id='fix-tbc-page'>"; $page_content .= "<center><span id='updating'>Updating...</span></center>"; $page_content .= "<span id='done'>Done.</span>"; - $scilab_fixer_code_form = drupal_get_form("scilab_fixer_code_form"); - $page_content .= drupal_render($scilab_fixer_code_form); + $R_fixer_code_form = drupal_get_form("R_fixer_code_form"); + $page_content .= drupal_render($R_fixer_code_form); $page_content .= "</div>"; return $page_content; } -function textbook_companion_fixer_init() +function r_tbc_fixer_init() { - drupal_add_css(drupal_get_path("module", "textbook_companion_fixer") . "/css/textbook_companion_fixer.css"); - drupal_add_js(drupal_get_path("module", "textbook_companion_fixer") . "/js/textbook_companion_fixer.js"); - drupal_add_js(drupal_get_path("module", "textbook_companion_fixer") . "/js/textbook_companion_fixer_edit_category.js"); - //drupal_add_js(drupal_get_path("module", "scilab_fixer") . "/js/jquery-noconfilct.js"); - drupal_add_js(drupal_get_path("module", "textbook_companion_fixer") . "/js/selection.js"); + drupal_add_css(drupal_get_path("module", "r_tbc_fixer") . "/css/r_tbc_fixer.css"); + drupal_add_js(drupal_get_path("module", "r_tbc_fixer") . "/js/r_tbc_fixer.js"); + drupal_add_js(drupal_get_path("module", "r_tbc_fixer") . "/js/r_tbc_fixer_edit_category.js"); + //drupal_add_js(drupal_get_path("module", "R_fixer") . "/js/jquery-noconfilct.js"); + drupal_add_js(drupal_get_path("module", "r_tbc_fixer") . "/js/selection.js"); } diff --git a/r_tbc_fixer.info b/r_tbc_fixer.info new file mode 100755 index 0000000..79b1ac9 --- /dev/null +++ b/r_tbc_fixer.info @@ -0,0 +1,5 @@ +name = "R Textbook Companion fixer" +description = "Module to fix R code bugs" +version = "7.1.1" +core = "7.x" +package = IITB diff --git a/r_tbc_fixer.module b/r_tbc_fixer.module new file mode 100755 index 0000000..b89da85 --- /dev/null +++ b/r_tbc_fixer.module @@ -0,0 +1,471 @@ +<?php +require_once('r_tbc_fixer_email.inc'); +include('r_tbc_fixer_edit_book_category.inc'); +function r_tbc_fixer_menu() +{ + $items = array(); + $items["r_tbc_fixer/caption"] = array( + "title" => "Edit TBC captions", + "page callback" => "R_fixer_caption_all", + "access arguments" => array( + "fix R_code_caption" + ), + "type" => MENU_NORMAL_ITEM + ); + $items["r_tbc_fixer/code"] = array( + "title" => "Edit TBC code", + "page callback" => "R_fixer_code_all", + "access arguments" => array( + "fix R" + ), + "type" => MENU_NORMAL_ITEM + ); + $items["r_tbc_fixer/ajax"] = array( + "page callback" => "R_fixer_ajax", + "access callback" => TRUE, + "type" => MENU_CALLBACK + ); + $items["r_tbc_fixer/ajax/edit-book-category"] = array( + "page callback" => "r_tbc_fixer_edit_book_category_ajax", + "access callback" => TRUE, + "type" => MENU_CALLBACK, + "file" => "r_tbc_fixer_edit_book_category.inc" + ); + /* for admin */ + $items['admin/settings/r_tbc_fixer_settings'] = array( + 'title' => 'textbook companion fixer Settings', + 'description' => 'Textbook Companion Fixer Settings', + 'page callback' => 'drupal_get_form', + 'page arguments' => array( + 'r_tbc_fixer_settings_form' + ), + 'access arguments' => array( + 'administer textbook companion fixer settings' + ), + 'type' => MENU_NORMAL_ITEM, + 'file' => 'r_tbc_fixer_settings.inc' + ); + // edit book categoery + $items["r_tbc_fixer/edit_book_category"] = array( + "title" => "Edit Completed Books Category", + "page callback" => "r_tbc_fixer_edit_book_proposal_all", + "access arguments" => array( + "fix R_textbook_category" + ), + "type" => MENU_NORMAL_ITEM, + 'file' => 'r_tbc_fixer_edit_book_category.inc' + ); + $items['r_tbc_fixer/category_edit'] = array( + 'title' => 'Categorize', + 'description' => 'Edit Completed Books Category', + 'page callback' => 'drupal_get_form', + 'page arguments' => array( + 'r_tbc_fixer_category_edit_form' + ), + 'access arguments' => array( + 'fix R_textbook_category' + ), + 'type' => MENU_NORMAL_ITEM, + 'file' => 'r_tbc_fixer_edit_book_category.inc' + ); + return $items; +} +function r_tbc_fixer_permission() +{ + return array( + "fix R" => array( + "title" => t("fix R code"), + 'restrict access' => TRUE + ), + "fix R_code_caption" => array( + "title" => t("fix R code caption"), + 'restrict access' => TRUE + ), + "administer textbook companion fixer settings" => array( + "title" => t("administer textbook companion fixer settings"), + 'restrict access' => TRUE + ), + "fix R_textbook_category" => array( + "title" => t("fix R textbook category"), + 'restrict access' => TRUE + ) + ); +} + +function R_fixer_caption_form($form, &$form_state) +{ + $form = array(); + $form["wrapper"] = array( + "#type" => "fieldset", + "#title" => "Caption change form", + "#prefix" => "<div id='fix-tbc-form'>", + "#suffix" => "</div>" + ); + $form["wrapper"]["book"] = array( + "#type" => "select", + "#title" => t("Please select the book."), + "#options" => r_get_tbc_books(), + ); + $form["wrapper"]["chapter"] = array( + "#type" => "select", + "#title" => t("Please select the chapter"), + "#options" => array( + 0 => "Please select a chapter" + ), + "#prefix" => "<div class='select-chapter'>", + "#suffix" => "</div>" + ); + $form["wrapper"]["chapter_name"] = array( + "#type" => "textfield", + "#title" => t("Enter new chapter name"), + "#size" => 255, + "#maxlength" => 255, + "#attributes" => array( + "Style" => "width:100%" + ), + "#prefix" => "<div class='enter-chapter-name'>", + "#suffix" => "</div>" + ); + $form["wrapper"]["example"] = array( + "#type" => "select", + "#title" => t("Please select the example"), + "#description" => t("<span style='color:red'>*Double click on example caption you want to edit</span>"), + "#options" => array( + 0 => "Please select a example" + ), + "#prefix" => "<div class='select-example'>", + "#suffix" => "</div>" + ); + $form["wrapper"]["caption"] = array( + "#type" => "textfield", + "#title" => t("Enter new caption"), + "#attributes" => array( + "Style" => "width:100%" + ), + "#size" => 255, + "#maxlength" => 255, + "#prefix" => "<div class='enter-caption'>", + "#suffix" => "</div>" + ); + $form["wrapper"]["chapter_example"] = array( + "#markup" => "<input type='checkbox' name='chapterchk' value='chapter' class='chapter-caption-chk'> + Update Chapter caption</input><br> + <input type='checkbox' name='examplechk' value='example' class='example-caption-chk'> + Update Example caption</input>", + "#prefix" => "<div class='chapter-example-chk'>", + "#suffix" => "</div>" + ); + $form["wrapper"]["submit"] = array( + "#type" => "submit", + "#value" => "Update", + "#prefix" => "<div class='update-button'>", + "#suffix" => "</div>" + ); + $form["wrapper"]["code_wrapper"] = array( + "#type" => "fieldset", + "#description" => t("No code to display"), + "#attributes" => array( + "onclick" => "return check();" + ), + "#prefix" => "<div class='well'><pre id='edit-code' class='fix-caption-code'>", + "#suffix" => "</pre></div>" + ); + return $form; +} + +function R_fixer_caption_all() +{ + $page_content = ""; + $page_content .= "<div id='fix-tbc-page'>"; + $page_content .= "<center><span id='updating'>Updating...</span></center>"; + $page_content .= "<span id='done'>Done.</span>"; + $R_fixer_caption_form = drupal_get_form("R_fixer_caption_form"); + $page_content .= drupal_render($R_fixer_caption_form); + $page_content .= "</div>"; + $page_content .= "<small>* Selecting text from above code-area with mouse will add it to the caption textbox.</small>"; + return $page_content; +} + +function R_fixer_ajax($item, $key) +{ + $data = ""; + global $user; + if ($item == "category" && $key) { + /* $query = " + SELECT pre.id AS id, pre.book, pre.author FROM textbook_companion_preference pre + LEFT JOIN textbook_companion_proposal pro ON pro.id = pre.proposal_id + WHERE pro.proposal_status = 3 AND pre.approval_status = 1 AND pre.category = %d + ORDER BY pre.book ASC + "; + $result = db_query($query, $key);*/ + $query = db_select('textbook_companion_preference', 'pre'); + $query->fields('pre', array( + 'id', + 'book', + 'author' + )); + $query->leftJoin('textbook_companion_proposal', 'pro', 'pro.id = pre.proposal_id'); + $query->condition('pro.proposal_status', 3); + $query->condition('pre.approval_status', 1); + $query->condition('pre.category', $key); + $query->orderBy('pre.book', 'ASC'); + $result = $query->execute(); + $data .= "<option value='0'>Please select the book.</option>"; + while ($row = $result->fetchObject()) { + $data .= "<option value='{$row->id}'>{$row->book} ({$row->author})</option>"; + } //$row = $result->fetchObject() + } //$item == "category" && $key + else if ($item == "book" && $key) { + /*$query = "SELECT * FROM {textbook_companion_chapter} WHERE preference_id = %d ORDER BY number"; + $result = db_query($query, $key);*/ + $query = db_select('textbook_companion_chapter'); + $query->fields('textbook_companion_chapter'); + $query->condition('preference_id', $key); + $query->orderBy('number', 'ASC'); + $result = $query->execute(); + $data .= "<option value='0'>Please select the chapter.</option>"; + while ($row = $result->fetchObject()) { + $data .= "<option value='{$row->id}' data-chapterid='{$row->id}' data-chaptername='{$row->name}'>{$row->number}) {$row->name}</option>"; + } //$row = $result->fetchObject() + } //$item == "book" && $key + else if ($item == "chapter" && $key) { + /*$query = "SELECT * FROM {textbook_companion_example} WHERE chapter_id = %d ORDER BY number"; + $result = db_query($query, $key);*/ + $query = db_select('textbook_companion_example'); + $query->fields('textbook_companion_example'); + $query->condition('chapter_id', $key); + $query->orderBy('number', 'ASC'); + $result = $query->execute(); + $data .= "<option value='0'>Please select the example.</option>"; + while ($row = $result->fetchObject()) { + $data .= "<option value='{$row->id}' data-exampleid='{$row->caption}'>{$row->number} {$row->caption}</option>"; + } //$row = $result->fetchObject() + } //$item == "chapter" && $key + else if ($item == "example" && $key) { + + $result = db_query("select * from textbook_companion_preference tcp join textbook_companion_chapter tcc on tcp.id=tcc.preference_id join textbook_companion_example tce ON tcc.id=tce.chapter_id join textbook_companion_example_files tcef on tce.id=tcef.example_id where tcef.filetype= 'S' AND tcef.example_id= :example_id", array( + ':example_id' => $key + )); + $row = $result->fetchObject(); + /* fetching example file data */ + $uploads_dir = $_SERVER['DOCUMENT_ROOT'] . base_path() . "r_uploads/tbc_uploads/"; + $example_path = $uploads_dir. $row->directory_name. '/'. $row->filepath; + $example = file_get_contents($example_path); + $data .= "<div id='caption'>{$row->caption}</div>"; + $data .= "<div id='code'>{$example}</div>"; + } //$item == "example" && $key + else if ($item == "update-example") { + $example_id = $_POST["example_id"]; + $caption = $_POST["caption"]; + /*$query = " + UPDATE textbook_companion_example + SET caption = '%s' + WHERE id = %d + "; + $result = db_query($query, $caption, $example_id);*/ + $query = db_update('textbook_companion_example'); + $query->fields(array( + 'caption' => $caption + )); + $query->condition('id', $example_id); + $result = $query->execute(); + $data .= "Updated"; + /* sending email */ + $email_to = $user->mail; + $from = variable_get('textbook_companion_from_email', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); + $params['example_updated']['example_id'] = $example_id; + $params['example_updated']['user_id'] = $user->uid; + $params['example_updated']['headers'] = array( + 'From' => $from, + 'MIME-Version' => '1.0', + 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes', + 'Content-Transfer-Encoding' => '8Bit', + 'X-Mailer' => 'Drupal', + 'Cc' => $cc, + 'Bcc' => $bcc + ); + if (!drupal_mail('r_tbc_fixer', 'example_updated', $email_to, language_default(), $params, $from, TRUE)) { + $data .= 'Error sending email message.'; + } //!drupal_mail('r_tbc_fixer', 'example_updated', $email_to, language_default(), $params, $from, TRUE) + } //$item == "update-example" + else if ($item == "update-chapter") { + $chapter_id = $_POST["chapter_id"]; + $chapter_caption = $_POST["chapter_caption"]; + $query_chapter = db_update('textbook_companion_chapter'); + $query_chapter->fields(array( + 'name' => $chapter_caption + )); + $query_chapter->condition('id', $chapter_id); + $result_chapter = $query_chapter->execute(); + $data .= "Updated"; + /* sending email */ + $email_to = $user->mail; + $from = variable_get('textbook_companion_from_email', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); + $params['chapter_updated']['chapter_id'] = $chapter_id; + $params['chapter_updated']['user_id'] = $user->uid; + $params['chapter_updated']['headers'] = array( + 'From' => $from, + 'MIME-Version' => '1.0', + 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes', + 'Content-Transfer-Encoding' => '8Bit', + 'X-Mailer' => 'Drupal', + 'Cc' => $cc, + 'Bcc' => $bcc + ); + if (!drupal_mail('r_tbc_fixer', 'chapter_updated', $email_to, language_default(), $params, $from, TRUE)) { + $data .= 'Error sending email message.'; + } //!drupal_mail('r_tbc_fixer', 'chapter_updated', $email_to, language_default(), $params, $from, TRUE) + } //$item == "update-chapter" + else if ($item == "update-both") { + $example_id = $_POST["example_id"]; + $caption = $_POST["caption"]; + $chapter_id = $_POST["chapter_id"]; + $chapter_caption = $_POST["chapter_caption"]; + $query_exmaple = db_update('textbook_companion_example'); + $query_exmaple->fields(array( + 'caption' => $caption + )); + $query_exmaple->condition('id', $example_id); + $result_example = $query_exmaple->execute(); + $query_chapter = db_update('textbook_companion_chapter'); + $query_chapter->fields(array( + 'name' => $chapter_caption + )); + $query_chapter->condition('id', $chapter_id); + $result_chapter = $query_chapter->execute(); + $data .= "Updated"; + /* sending email */ + $email_to = $user->mail; + $from = variable_get('textbook_companion_from_email', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); + $params['example_updated']['example_id'] = $example_id; + $params['example_updated']['user_id'] = $user->uid; + $params['example_updated']['headers'] = array( + 'From' => $from, + 'MIME-Version' => '1.0', + 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes', + 'Content-Transfer-Encoding' => '8Bit', + 'X-Mailer' => 'Drupal', + 'Cc' => $cc, + 'Bcc' => $bcc + ); + if (!drupal_mail('r_tbc_fixer', 'chapter_example_updated', $email_to, language_default(), $params, $from, TRUE)) { + $data .= 'Error sending email message.'; + } //!drupal_mail('r_tbc_fixer', 'chapter_example_updated', $email_to, language_default(), $params, $from, TRUE) + } //$item == "update" + else if ($item == "code" && $key) { + $code = $_POST["code"]; + $result = db_query("select * from textbook_companion_preference tcp join textbook_companion_chapter tcc on tcp.id=tcc.preference_id join textbook_companion_example tce ON tcc.id=tce.chapter_id join textbook_companion_example_files tcef on tce.id=tcef.example_id where tcef.filetype= 'S' AND tcef.example_id= :example_id", array( + ':example_id' => $key + )); + $row = $result->fetchObject(); + $uploads_dir = $_SERVER['DOCUMENT_ROOT'] . base_path() . "r_uploads/tbc_uploads/"; + $example_path = $uploads_dir. $row->directory_name. '/'. $row->filepath; + file_put_contents($example_path, $code); + $data .= "updated"; + } //$item == "code" && $key + else if ($item == "ind-ed" && $key) { + $query = " + UPDATE textbook_companion_aicte + SET ind = !ind + WHERE id = :id + "; + $args = array( + ":id" => $key + ); + db_query($query, $args); + $data .= "updated"; + } //$item == "ind-ed" && $key + else { + $data = "<option value='0'>Please select a book</option>"; + } + echo $data; + exit(); +} + +function R_fixer_code_form($form, &$form_state) +{ + $form = array(); + $form["code_edit"] = array( + "#type" => "fieldset", + "#title" => "Code edit form", + "#prefix" => "<div id='fix-tbc-form'>", + "#suffix" => "</div>" + ); + $form["code_edit"]["book"] = array( + "#type" => "select", + "#title" => t("Please select the book."), + "#options" => r_get_tbc_books(), + ); + $form["code_edit"]["chapter"] = array( + "#type" => "select", + "#title" => t("Please select the chapter"), + "#options" => array( + 0 => "Please select a chapter" + ), + "#prefix" => "<div class='select-chapter'>", + "#suffix" => "</div>" + ); + $form["code_edit"]["example"] = array( + "#type" => "select", + "#title" => t("Please select the example"), + "#options" => array( + 0 => "Please select a example" + ), + "#prefix" => "<div class='select-example'>", + "#suffix" => "</div>" + ); + $form["code_edit"]["code"] = array( + "#type" => "textarea", + "#title" => t("Code Editor"), + '#resizable' => FALSE, + "#prefix" => "<div class='example-code-edit'>", + "#suffix" => "</div>" + ); + $form["code_edit"]["submit"] = array( + "#type" => "submit", + "#value" => "Update", + "#prefix" => "<div class='update-button'>", + "#suffix" => "</div>" + ); + return $form; +} +function R_fixer_code_all() +{ + $page_content = ""; + $page_content .= "<div id='fix-tbc-page'>"; + $page_content .= "<center><span id='updating'>Updating...</span></center>"; + $page_content .= "<span id='done'>Done.</span>"; + $R_fixer_code_form = drupal_get_form("R_fixer_code_form"); + $page_content .= drupal_render($R_fixer_code_form); + $page_content .= "</div>"; + return $page_content; +} + +function r_get_tbc_books(){ + $query = " + SELECT pre.id AS id, pre.book, pre.author FROM textbook_companion_preference pre + LEFT JOIN textbook_companion_proposal pro ON pro.id = pre.proposal_id + WHERE pro.proposal_status = 3 AND pre.approval_status = 1 + ORDER BY pre.book ASC + "; + $book_list = db_query($query); + $book[0] = "Select any book"; + while ($book_list_data = $book_list->fetchObject()) + { + $book[$book_list_data->id] .= $book_list_data->book; + } + return $book; +} +function r_tbc_fixer_init() +{ + drupal_add_css(drupal_get_path("module", "r_tbc_fixer") . "/css/r_tbc_fixer.css"); + drupal_add_js(drupal_get_path("module", "r_tbc_fixer") . "/js/r_tbc_fixer.js"); + drupal_add_js(drupal_get_path("module", "r_tbc_fixer") . "/js/r_tbc_fixer_edit_category.js"); + drupal_add_js(drupal_get_path("module", "r_tbc_fixer") . "/js/selection.js"); +} diff --git a/textbook_companion_fixer_edit_book_category.inc b/r_tbc_fixer_edit_book_category.inc index 1e5d01e..d25cec5 100755 --- a/textbook_companion_fixer_edit_book_category.inc +++ b/r_tbc_fixer_edit_book_category.inc @@ -1,5 +1,5 @@ <?php -function textbook_companion_fixer_edit_book_proposal_all() +function r_tbc_fixer_edit_book_proposal_all() { //get the book count $result = db_query("SELECT COUNT( pe.book ) AS book_count FROM {textbook_companion_preference} pe LEFT JOIN {textbook_companion_proposal} po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1 AND pe.category>0"); @@ -15,9 +15,9 @@ function textbook_companion_fixer_edit_book_proposal_all() $proposal_rows[] = array( $i, "{$preference_data->book} <br> <em>by {$preference_data->author}</em>", - _textbook_companion_fixer_list_of_category($preference_data->existing_category), + _r_tbc_fixer_list_of_category($preference_data->existing_category), _tbc_fixer_list_of_new_category($preference_data->pref_id), - l('Edit', 'textbook_companion_fixer/category_edit/' . $preference_data->pref_id) + l('Edit', 'r_tbc_fixer/category_edit/' . $preference_data->pref_id) ); $i++; } //$proposal_data = $proposal_q->fetchObject() @@ -44,7 +44,7 @@ function textbook_companion_fixer_edit_book_proposal_all() /******************************************************************************/ /**************************** CATEGORY EDIT FORM ******************************/ /******************************************************************************/ -function textbook_companion_fixer_category_edit_form($form, &$form_state) +function r_tbc_fixer_category_edit_form($form, &$form_state) { /* get current proposal */ $preference_id = arg(2); @@ -99,14 +99,14 @@ function textbook_companion_fixer_category_edit_form($form, &$form_state) '#markup' => '<input class="prefrence_id" type="hidden" name="pref_id" value="' . $preference_data->id . '">' ); $form["wrapper"]['main_category'] = array( - "#markup" => _textbook_companion_fixer_list_of_category_checkboxes() + "#markup" => _r_tbc_fixer_list_of_category_checkboxes() ); $form["wrapper"]['back'] = array( - '#markup' => l(t('Back'), 'textbook_companion_fixer/edit_book_category') + '#markup' => l(t('Back'), 'r_tbc_fixer/edit_book_category') ); return $form; } -function textbook_companion_fixer_edit_book_category_ajax() +function r_tbc_fixer_edit_book_category_ajax() { global $user; $data = ""; @@ -132,8 +132,8 @@ function textbook_companion_fixer_edit_book_category_ajax() /* sending email */ $email_to = $user->mail; $from = variable_get('textbook_companion_from_email', ''); - $bcc = variable_get('textbook_companion_fixer_bcc_emails', ''); - $cc = variable_get('textbook_companion_fixer_cc_emails', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); $params['category_updated']['pref_id'] = $_POST['pref_id']; $params['category_updated']['main_category'] = $main_category; $params['category_updated']['sub_category'] = $sub_category; @@ -147,7 +147,7 @@ function textbook_companion_fixer_edit_book_category_ajax() 'Cc' => $cc, 'Bcc' => $bcc ); - if (!drupal_mail('textbook_companion_fixer', 'new_category_updated', $email_to, language_default(), $params, $from, TRUE)) { + if (!drupal_mail('r_tbc_fixer', 'new_category_updated', $email_to, language_default(), $params, $from, TRUE)) { $data .= 'Error sending email message.'; } } //$_POST['action'] == "add" @@ -165,8 +165,8 @@ WHERE pref_id= :pref_id AND main_category= :main_category AND sub_category = :su /* sending email */ $email_to = $user->mail; $from = variable_get('textbook_companion_from_email', ''); - $bcc = variable_get('textbook_companion_fixer_bcc_emails', ''); - $cc = variable_get('textbook_companion_fixer_cc_emails', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); $params['subcategory_deleted']['pref_id'] = $_POST['pref_id']; $params['subcategory_deleted']['main_category'] = $main_category; $params['subcategory_deleted']['sub_category'] = $sub_category; @@ -180,7 +180,7 @@ WHERE pref_id= :pref_id AND main_category= :main_category AND sub_category = :su 'Cc' => $cc, 'Bcc' => $bcc ); - if (!drupal_mail('textbook_companion_fixer', 'new_subcategory_deleted', $email_to, language_default(), $params, $from, TRUE)) { + if (!drupal_mail('r_tbc_fixer', 'new_subcategory_deleted', $email_to, language_default(), $params, $from, TRUE)) { $data .= 'Error sending email message.'; } } //$_POST['action'] == "delete" @@ -197,8 +197,8 @@ WHERE pref_id= :pref_id AND main_category= :main_category /* sending email */ $email_to = $user->mail; $from = variable_get('textbook_companion_from_email', ''); - $bcc = variable_get('textbook_companion_fixer_bcc_emails', ''); - $cc = variable_get('textbook_companion_fixer_cc_emails', ''); + $bcc = variable_get('r_tbc_fixer_bcc_emails', ''); + $cc = variable_get('r_tbc_fixer_cc_emails', ''); $params['maincategory_deleted']['pref_id'] = $_POST['pref_id']; $params['maincategory_deleted']['main_category'] = $main_category; $params['maincategory_deleted']['user_id'] = $user->uid; @@ -211,7 +211,7 @@ WHERE pref_id= :pref_id AND main_category= :main_category 'Cc' => $cc, 'Bcc' => $bcc ); - if (!drupal_mail('textbook_companion_fixer', 'new_maincategory_deleted', $email_to, language_default(), $params, $from, TRUE)) { + if (!drupal_mail('r_tbc_fixer', 'new_maincategory_deleted', $email_to, language_default(), $params, $from, TRUE)) { $data .= 'Error sending email message.'; } } //$_POST['action'] == "delete-main-with-ub-category" @@ -251,7 +251,7 @@ function _tbc_fixer_list_of_category($category_id = NULL) } //$category_list_data = $category_list->fetchObject() return $category; } -function _textbook_companion_fixer_list_of_category($category_id) +function _r_tbc_fixer_list_of_category($category_id) { $category .= ""; $query = db_select('list_of_category'); @@ -324,7 +324,7 @@ function _tbc_fixer_list_of_ext_new_category($pref_id, $category_id) } //$category_list_data = $category_list->fetchObject() return $category; } -function _textbook_companion_fixer_list_of_category_checkboxes() +function _r_tbc_fixer_list_of_category_checkboxes() { $pref_id = arg(2); $query = db_select('list_of_category'); @@ -348,7 +348,7 @@ function _textbook_companion_fixer_list_of_category_checkboxes() <th>Selected sub categories</th> </tr> <tr> - <td rowspan='3'><select id='subcats-" . $category_list_data->category_id . "' name='subcats' class='main-subcategory' size='10' multiple name='subcat' data-cid='" . $category_list_data->category_id . "'>" . _textbook_companion_fixer_list_of_subcategory($pref_id, $category_list_data->category_id) . "</select> + <td rowspan='3'><select id='subcats-" . $category_list_data->category_id . "' name='subcats' class='main-subcategory' size='10' multiple name='subcat' data-cid='" . $category_list_data->category_id . "'>" . _r_tbc_fixer_list_of_subcategory($pref_id, $category_list_data->category_id) . "</select> <a href='JavaScript:void(0);' id='btn-add' class='select-main-subcategory-" . $category_list_data->category_id . "' data-cid='" . $category_list_data->category_id . "'>Add »</a> </td> <td rowspan='3'><a href='JavaScript:void(0);' id='btn-remove' class='select-main-subcategory-" . $category_list_data->category_id . "'data-cid='" . $category_list_data->category_id . "'>« Remove</a> @@ -361,7 +361,7 @@ function _textbook_companion_fixer_list_of_category_checkboxes() } //$category_list_data = $category_list->fetchObject() return $category; } -function _textbook_companion_fixer_list_of_subcategory($pref_id, $category_id) +function _r_tbc_fixer_list_of_subcategory($pref_id, $category_id) { $query = " SELECT los.subcategory_id as subcat_id,los.subcategory as sub_category diff --git a/textbook_companion_fixer_email.inc b/r_tbc_fixer_email.inc index 833e470..2779022 100644..100755 --- a/textbook_companion_fixer_email.inc +++ b/r_tbc_fixer_email.inc @@ -2,7 +2,7 @@ /** * Implementation of hook_mail(). */ -function textbook_companion_fixer_mail($key, &$message, $params) +function r_tbc_fixer_mail($key, &$message, $params) { global $user; $language = $message['language']; @@ -51,7 +51,7 @@ Caption : ' . $example_data->caption . ' Best Wishes, -Scilab TBC Team, +R TBC Team, FOSSEE, IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -91,7 +91,7 @@ Title of the chapter : ' . $chapter_data->name . ' Best Wishes, -Scilab TBC Team, +R TBC Team, FOSSEE, IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -140,7 +140,7 @@ Caption : ' . $example_data->caption . ' Best Wishes, -Scilab TBC Team, +R TBC Team, FOSSEE, IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -189,7 +189,7 @@ Sub category : '. $sub_category_data->subcategory .' Best Wishes, -Scilab TBC Team, +R TBC Team, FOSSEE, IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -238,7 +238,7 @@ Sub category : '. $sub_category_data->subcategory .' Best Wishes, -Scilab TBC Team, +R TBC Team, FOSSEE, IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name @@ -280,7 +280,7 @@ Main category : '. $main_category_data->maincategory .' Best Wishes, -Scilab TBC Team, +R TBC Team, FOSSEE, IIT Bombay', array( '!site_name' => variable_get('site_name', ''), '!user_name' => $user_data->name diff --git a/textbook_companion_fixer_settings.inc b/r_tbc_fixer_settings.inc index 25af64c..73a9b5b 100644..100755 --- a/textbook_companion_fixer_settings.inc +++ b/r_tbc_fixer_settings.inc @@ -1,6 +1,6 @@ <?php // $Id$ -function textbook_companion_fixer_settings_form($form,&$form_state) +function r_tbc_fixer_settings_form($form,&$form_state) { $form['to_emails'] = array( '#type' => 'textfield', @@ -9,7 +9,7 @@ function textbook_companion_fixer_settings_form($form,&$form_state) '#size' => 50, '#maxlength' => 255, '#required' => TRUE, - '#default_value' => variable_get('textbook_companion_fixer_to_emails', '') + '#default_value' => variable_get('r_tbc_fixer_to_emails', '') ); $form['bcc_emails'] = array( '#type' => 'textfield', @@ -18,7 +18,7 @@ function textbook_companion_fixer_settings_form($form,&$form_state) '#size' => 50, '#maxlength' => 255, '#required' => TRUE, - '#default_value' => variable_get('textbook_companion_fixer_bcc_emails', '') + '#default_value' => variable_get('r_tbc_fixer_bcc_emails', '') ); $form['cc_emails'] = array( '#type' => 'textfield', @@ -27,7 +27,7 @@ function textbook_companion_fixer_settings_form($form,&$form_state) '#size' => 50, '#maxlength' => 255, '#required' => TRUE, - '#default_value' => variable_get('textbook_companion_fixer_cc_emails', '') + '#default_value' => variable_get('r_tbc_fixer_cc_emails', '') ); $form['from_email'] = array( '#type' => 'textfield', @@ -36,7 +36,7 @@ function textbook_companion_fixer_settings_form($form,&$form_state) '#size' => 50, '#maxlength' => 255, '#required' => TRUE, - '#default_value' => variable_get('textbook_companion_fixer_from_email', '') + '#default_value' => variable_get('r_tbc_fixer_from_email', '') ); $form['submit'] = array( @@ -45,14 +45,14 @@ function textbook_companion_fixer_settings_form($form,&$form_state) ); return $form; } -function textbook_companion_fixer_settings_form_validate($form, &$form_state) +function r_tbc_fixer_settings_form_validate($form, &$form_state) { return; } -function textbook_companion_fixer_settings_form_submit($form, &$form_state) +function r_tbc_fixer_settings_form_submit($form, &$form_state) { - variable_set('textbook_companion_fixer_to_emails', $form_state['values']['to_emails']); - variable_set('textbook_companion_fixer_bcc_emails', $form_state['values']['bcc_emails']); - variable_set('textbook_companion_fixer_cc_emails', $form_state['values']['cc_emails']); - variable_set('textbook_companion_fixer_from_email', $form_state['values']['from_email']); + variable_set('r_tbc_fixer_to_emails', $form_state['values']['to_emails']); + variable_set('r_tbc_fixer_bcc_emails', $form_state['values']['bcc_emails']); + variable_set('r_tbc_fixer_cc_emails', $form_state['values']['cc_emails']); + variable_set('r_tbc_fixer_from_email', $form_state['values']['from_email']); } diff --git a/textbook_companion_fixer.info b/textbook_companion_fixer.info deleted file mode 100755 index bc72bc6..0000000 --- a/textbook_companion_fixer.info +++ /dev/null @@ -1,4 +0,0 @@ -name = Textbook Companion fixer -description = Module to fix scilab code bugs -core = 7.x -package = IITB |