diff options
author | Jayaram R Pai | 2014-07-16 18:51:03 +0530 |
---|---|---|
committer | Jayaram R Pai | 2014-07-16 18:51:03 +0530 |
commit | fb987d61ba52a9abcd6580d33501dac8948e9c84 (patch) | |
tree | 9e320259015fd335b0441973b49637579e263fd3 /textbook_companion.module | |
parent | 7e4ef0eb0ad89acc3a7d117879936b21e8586547 (diff) | |
download | scilab_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-x | textbook_companion.module | 20 |
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, ); } } |