summaryrefslogtreecommitdiff
path: root/textbook_companion.module
diff options
context:
space:
mode:
authorJayaram R Pai2014-07-16 18:51:03 +0530
committerJayaram R Pai2014-07-16 18:51:03 +0530
commitfb987d61ba52a9abcd6580d33501dac8948e9c84 (patch)
tree9e320259015fd335b0441973b49637579e263fd3 /textbook_companion.module
parent7e4ef0eb0ad89acc3a7d117879936b21e8586547 (diff)
downloadscilab_textbook_companion-fb987d61ba52a9abcd6580d33501dac8948e9c84.tar.gz
scilab_textbook_companion-fb987d61ba52a9abcd6580d33501dac8948e9c84.tar.bz2
scilab_textbook_companion-fb987d61ba52a9abcd6580d33501dac8948e9c84.zip
fixed aicte book list display
Diffstat (limited to 'textbook_companion.module')
-rwxr-xr-xtextbook_companion.module20
1 files changed, 19 insertions, 1 deletions
diff --git a/textbook_companion.module b/textbook_companion.module
index bdde9f4..e4e1a0e 100755
--- a/textbook_companion.module
+++ b/textbook_companion.module
@@ -524,9 +524,27 @@ function textbook_companion_aicte_proposal_form($form_state) {
$num_rows = mysql_num_rows($result);
if ($num_rows > 0) {
while($row = db_fetch_object($result)) {
+ /* fixing title string */
+ $title = "";
+ $edition = "";
+ $year = "";
+ $title = "{$row->book} by {$row->author}";
+ if($row->edition) {
+ $edition = "<i>ed</i>: {$row->edition}";
+ }
+ if($row->year) {
+ if($row->edition) {
+ $year = ", <i>pub</i>: {$row->year}";
+ } else {
+ $year = "<i>pub</i>: {$row->year}";
+ }
+ }
+ if($edition or $year) {
+ $title .= "({$edition} {$year})";
+ }
$form["wrapper"][$row->id] = array(
"#type" => "checkbox",
- "#title" => t("{$row->book} by {$row->author} ( ed: {$row->edition}, pub: {$row->year})"),
+ "#title" => $title,
);
}
}