From fb987d61ba52a9abcd6580d33501dac8948e9c84 Mon Sep 17 00:00:00 2001 From: Jayaram R Pai Date: Wed, 16 Jul 2014 18:51:03 +0530 Subject: fixed aicte book list display --- textbook_companion.module | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 = "ed: {$row->edition}"; + } + if($row->year) { + if($row->edition) { + $year = ", pub: {$row->year}"; + } else { + $year = "pub: {$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, ); } } -- cgit