Esempio n. 1
0
function build_review_stats()
{
    $avgrate = fetch_review_rating();
    if ($avgrate > 0) {
        echo "<h3>" . get_opendb_lang_var('review_stats') . "</h3>";
        echo "<dl class=\"reviewStats\">";
        $num_review = fetch_review_cnt();
        echo "<dt>" . get_opendb_lang_var('review(s)') . "</dt>";
        echo "<dd>" . $num_review . "</dd>";
        echo "<dt>" . get_opendb_lang_var('average_rating') . "</dt>";
        $attribute_type_r = fetch_attribute_type_r("S_RATING");
        echo "<dd>" . get_display_field($attribute_type_r['s_attribute_type'], NULL, 'review()', $avgrate, FALSE) . "</dd>";
        echo "</dl>";
    }
}
Esempio n. 2
0
function get_search_query_matrix($HTTP_VARS)
{
    function get_match_type($match)
    {
        if ($match == 'word') {
            return get_opendb_lang_var('word_match');
        } else {
            if ($match == 'partial') {
                return get_opendb_lang_var('partial_match');
            } else {
                if ($match == 'exact') {
                    return get_opendb_lang_var('exact_match');
                } else {
                    return NULL;
                }
            }
        }
    }
    $searches = array();
    if (strlen($HTTP_VARS['title']) > 0) {
        // Default title match is exact match.
        $HTTP_VARS['title_match'] = ifempty($HTTP_VARS['title_match'], 'exact');
        if ($HTTP_VARS['title_match'] == 'word' || $HTTP_VARS['title_match'] == 'partial') {
            if (is_null($HTTP_VARS['title_case'])) {
                $searches[] = array(prompt => get_opendb_lang_var('title') . ' (<em>' . get_match_type($HTTP_VARS['title_match']) . '</em>)', field => $HTTP_VARS['title']);
            } else {
                $searches[] = array(prompt => get_opendb_lang_var('title') . ' (<em>' . get_match_type($HTTP_VARS['title_match']) . ', ' . get_opendb_lang_var('case_sensitive') . '</em>)', field => $HTTP_VARS['title']);
            }
        } else {
            $searches[] = array(prompt => get_opendb_lang_var('title'), field => $HTTP_VARS['title']);
        }
    }
    if (strlen($HTTP_VARS['category']) > 0) {
        // If s_item_type defined, we can get at the s_attribute_type of the category value.
        if (strlen($HTTP_VARS['s_item_type']) > 0) {
            $attribute_type_r = fetch_sfieldtype_item_attribute_type_r($HTTP_VARS['s_item_type'], 'CATEGORY');
            $searches[] = array(prompt => get_opendb_lang_var('category'), field => get_item_display_field(NULL, $attribute_type_r, $HTTP_VARS['category'], FALSE));
        } else {
            $searches[] = array(prompt => get_opendb_lang_var('category'), field => $HTTP_VARS['category']);
        }
    }
    if (strlen($HTTP_VARS['owner_id']) > 0) {
        $username = fetch_user_name($HTTP_VARS['owner_id']);
        if (strlen($username) > 0) {
            $searches[] = array(prompt => get_opendb_lang_var('owner'), field => $username . ' (' . $HTTP_VARS['owner_id'] . ')');
        }
    }
    if (strlen($HTTP_VARS['s_item_type_group']) > 0) {
        $searches[] = array(prompt => get_opendb_lang_var('s_item_type_group'), field => $HTTP_VARS['s_item_type_group']);
    }
    if (is_array($HTTP_VARS['s_item_type'])) {
        $field = '';
        for ($i = 0; $i < count($HTTP_VARS['s_item_type']); $i++) {
            $item_type_r = fetch_item_type_r($HTTP_VARS['s_item_type'][$i]);
            $field .= theme_image($item_type_r['image'], $item_type_r['description'], 's_item_type');
        }
        $searches[] = array(prompt => get_opendb_lang_var('s_item_type'), field => $field);
    } else {
        if (strlen($HTTP_VARS['s_item_type']) > 0) {
            $item_type_r = fetch_item_type_r($HTTP_VARS['s_item_type']);
            $searches[] = array(prompt => get_opendb_lang_var('s_item_type'), field => theme_image($item_type_r['image'], $item_type_r['description'], 's_item_type'));
        }
    }
    if (is_numeric($HTTP_VARS['rating'])) {
        $attribute_type_r = fetch_cached_attribute_type_r('S_RATING');
        $searches[] = array(prompt => $attribute_type_r['prompt'], field => get_display_field($attribute_type_r['s_attribute_type'], NULL, 'review()', $HTTP_VARS['rating'], FALSE));
    }
    $attribute_type_r = NULL;
    if (strlen($HTTP_VARS['attribute_type']) > 0) {
        $attribute_type_r = fetch_cached_attribute_type_r($HTTP_VARS['attribute_type']);
        if (is_not_empty_array($attribute_type_r)) {
            $attribute_type_r['listing_link_ind'] = 'N';
            // Default title match is exact match.
            $HTTP_VARS['attr_match'] = ifempty($HTTP_VARS['attr_match'], 'exact');
            // Special category search, but ignore if category variable actually specified.
            if (strlen($HTTP_VARS['category']) == 0 && strlen($HTTP_VARS['attribute_val']) > 0 && $HTTP_VARS['attr_match'] == 'category') {
                // We do not want the Listing Link to be added to this display field
                $searches[] = array(prompt => $attribute_type_r['prompt'], field => get_item_display_field(NULL, $attribute_type_r, stripslashes($HTTP_VARS['attribute_val']), FALSE));
            } else {
                if (strlen($HTTP_VARS['attribute_val']) > 0) {
                    $HTTP_VARS['attribute_val'] = stripslashes($HTTP_VARS['attribute_val']);
                    if (starts_with($HTTP_VARS['attribute_val'], '"') && ends_with($HTTP_VARS['attribute_val'], '"')) {
                        $HTTP_VARS['attribute_val'] = substr($HTTP_VARS['attribute_val'], 1, -1);
                    }
                    $search = ifempty(get_item_display_field(NULL, $attribute_type_r, $HTTP_VARS['attribute_val'], FALSE), $HTTP_VARS['attribute_val']);
                } else {
                    if (strlen($HTTP_VARS['lookup_attribute_val']) > 0) {
                        $search = get_item_display_field(NULL, $attribute_type_r, stripslashes($HTTP_VARS['lookup_attribute_val']), FALSE);
                    }
                }
                if (!is_lookup_attribute_type($HTTP_VARS['attribute_type']) && $HTTP_VARS['attr_match'] != 'exact') {
                    $searches[] = array(prompt => $attribute_type_r['prompt'] . ' (<em>' . get_match_type($HTTP_VARS['attr_match']) . '</em>)', field => $search);
                } else {
                    $searches[] = array(prompt => $attribute_type_r['prompt'], field => $search);
                }
            }
        }
        //if(is_not_empty_array($attribute_type_r))
    } else {
        if (strlen($HTTP_VARS['attribute_val']) > 0) {
            // specified a search term without attribute type, this is a global search.
            if (is_null($HTTP_VARS['attr_case'])) {
                $searches[] = array(prompt => get_opendb_lang_var('attribute_val') . ' (<em>' . get_match_type(ifempty($HTTP_VARS['attr_match'], 'exact')) . '</em>)', field => stripslashes($HTTP_VARS['attribute_val']));
            } else {
                $searches[] = array(prompt => get_opendb_lang_var('attribute_val') . ' (<em>' . get_match_type(ifempty($HTTP_VARS['attr_match'], 'exact')) . ', ' . get_opendb_lang_var('case_sensitive') . '</em>)', field => stripslashes($HTTP_VARS['attribute_val']));
            }
        }
    }
    // add another search field if update_on value also specified.
    if (strlen($HTTP_VARS['attr_update_on']) > 0) {
        if (is_not_empty_array($attribute_type_r)) {
            $prompt = get_opendb_lang_var('attribute_prompt_updated', array('s_attribute_type' => $attribute_type_r['s_attribute_type'], 'prompt' => $attribute_type_r['prompt']));
        } else {
            $prompt = get_opendb_lang_var('attributes_updated');
        }
        if (strlen($HTTP_VARS['datetimemask']) > 0) {
            $searches[] = array(prompt => $prompt, field => $HTTP_VARS['attr_update_on'] . ' (' . $HTTP_VARS['datetimemask'] . ')');
        } else {
            $searches[] = array(prompt => $prompt, field => $HTTP_VARS['attr_update_on']);
        }
    } else {
        if (is_numeric($HTTP_VARS['attr_update_on_days'])) {
            if (is_not_empty_array($attribute_type_r)) {
                $prompt = get_opendb_lang_var('attribute_prompt_updated', array('s_attribute_type' => $attribute_type_r['s_attribute_type'], 'prompt' => $attribute_type_r['prompt']));
            } else {
                $prompt = get_opendb_lang_var('attributes_updated');
            }
            if ($HTTP_VARS['attr_update_on_days'] == '1') {
                $field = get_opendb_lang_var('one_day_ago');
            } else {
                if ($HTTP_VARS['attr_update_on_days'] == '7') {
                    $field = get_opendb_lang_var('one_week_ago');
                } else {
                    if ($HTTP_VARS['attr_update_on_days'] == '28') {
                        $field = get_opendb_lang_var('one_month_ago');
                    } else {
                        if ($HTTP_VARS['attr_update_on_days'] == '365') {
                            $field = get_opendb_lang_var('one_year_ago');
                        }
                    }
                }
            }
            $searches[] = array(prompt => $prompt, field => $field);
        }
    }
    if (strlen($HTTP_VARS['update_on']) > 0) {
        if (strlen($HTTP_VARS['datetimemask']) > 0) {
            $searches[] = array(prompt => get_opendb_lang_var('updated'), field => $HTTP_VARS['update_on'] . ' (' . $HTTP_VARS['datetimemask'] . ')');
        } else {
            $searches[] = array(prompt => get_opendb_lang_var('updated'), field => $HTTP_VARS['update_on']);
        }
    } else {
        if (is_numeric($HTTP_VARS['update_on_days'])) {
            if ($HTTP_VARS['update_on_days'] == '1') {
                $field = get_opendb_lang_var('one_day_ago');
            } else {
                if ($HTTP_VARS['update_on_days'] == '7') {
                    $field = get_opendb_lang_var('one_week_ago');
                } else {
                    if ($HTTP_VARS['update_on_days'] == '28') {
                        $field = get_opendb_lang_var('one_month_ago');
                    } else {
                        if ($HTTP_VARS['update_on_days'] == '365') {
                            $field = get_opendb_lang_var('one_year_ago');
                        }
                    }
                }
            }
            $searches[] = array(prompt => get_opendb_lang_var('updated'), field => $field);
        }
    }
    if (is_not_empty_array($HTTP_VARS['s_status_type']) > 0) {
        $search = '';
        for ($i = 0; $i < count($HTTP_VARS['s_status_type']); $i++) {
            if (strlen($search) > 0) {
                $search .= ' ';
            }
            $status_type_r = fetch_status_type_r($HTTP_VARS['s_status_type'][$i]);
            if (is_not_empty_array($status_type_r)) {
                $search .= format_display_value('%img%', $status_type_r['img'], 'Y', $status_type_r['description'], 's_status_type');
            }
        }
        if (strlen($search) > 0) {
            $searches[] = array(prompt => get_opendb_lang_var('s_status_type'), field => $search);
        }
    }
    if (strlen($HTTP_VARS['status_comment']) > 0) {
        // Default status_comment match is exact match.
        $HTTP_VARS['status_comment_match'] = ifempty($HTTP_VARS['status_comment_match'], 'exact');
        if ($HTTP_VARS['status_comment_match'] == 'word' || $HTTP_VARS['status_comment_match'] == 'partial' || $HTTP_VARS['status_comment_match'] == 'exact') {
            if (is_null($HTTP_VARS['status_comment_case'])) {
                $searches[] = array(prompt => get_opendb_lang_var('status_comment') . ' (<em>' . get_match_type($HTTP_VARS['status_comment_match']) . '</em>)', field => $HTTP_VARS['status_comment']);
            } else {
                $searches[] = array(prompt => get_opendb_lang_var('status_comment') . ' (<em>' . get_match_type($HTTP_VARS['status_comment_match']) . ', ' . get_opendb_lang_var('case_sensitive') . '</em>)', field => $HTTP_VARS['status_comment']);
            }
        } else {
            $searches[] = array(prompt => get_opendb_lang_var('status_comment'), field => $HTTP_VARS['status_comment']);
        }
    }
    if (is_numeric($HTTP_VARS['interest_level']) && $HTTP_VARS['interest_level'] > 0) {
        $searches[] = array(prompt => get_opendb_lang_var('interest'), field => theme_image("interest_1.gif", get_opendb_lang_var('interest'), 's_item_type'));
    }
    return $searches;
}
Esempio n. 3
0
function get_item_review_block($item_r)
{
    $buffer .= "<h3>" . get_opendb_lang_var('review(s)') . "</h3>";
    $result = fetch_review_rs($item_r['item_id']);
    if ($result) {
        $buffer .= "<ul>";
        while ($review_r = db_fetch_assoc($result)) {
            $action_links = NULL;
            $buffer .= "<li>";
            // even if already review author its possible to revoke rights to
            // edit / modify own reviews by revoking the PERM_USER_REVIEWER grant!
            if (is_user_granted_permission(PERM_ADMIN_REVIEWER) || is_user_granted_permission(PERM_USER_REVIEWER) && is_review_author($review_r['sequence_number'])) {
                $action_links_rs = NULL;
                if (get_opendb_config_var('item_review', 'update_support') !== FALSE) {
                    $action_links[] = array(url => "item_review.php?op=edit&sequence_number=" . $review_r['sequence_number'] . "&item_id=" . $item_r['item_id'] . "&instance_no=" . $item_r['instance_no'], text => get_opendb_lang_var('edit'));
                }
                if (get_opendb_config_var('item_review', 'delete_support') !== FALSE) {
                    $action_links[] = array(url => "item_review.php?op=delete&sequence_number=" . $review_r['sequence_number'] . "&item_id=" . $item_r['item_id'] . "&instance_no=" . $item_r['instance_no'], text => get_opendb_lang_var('delete'));
                }
                $buffer .= format_footer_links($action_links);
            }
            $buffer .= "<p class=\"author\">";
            $buffer .= get_opendb_lang_var('on_date_name_wrote_the_following', array('date' => get_localised_timestamp(get_opendb_config_var('item_display', 'review_datetime_mask'), $review_r['update_on']), 'fullname' => fetch_user_name($review_r['author_id']), 'user_id' => $review_r['author_id']));
            $buffer .= "</p>";
            $buffer .= "<p class=\"comments\">" . nl2br(trim($review_r['comment']));
            if ($review_r['item_id'] != $item_r['item_id']) {
                $buffer .= "<span class=\"reference\">" . get_opendb_lang_var('review_for_item_type_title', array('s_item_type' => $review_r['s_item_type'], 'item_id' => $review_r['item_id'])) . "</span>";
            }
            $buffer .= "</p>";
            $average = $review_r['rating'];
            $attribute_type_r = fetch_attribute_type_r("S_RATING");
            $buffer .= "<span class=\"rating\">" . get_display_field($attribute_type_r['s_attribute_type'], NULL, 'review()', $average, FALSE) . "</span>";
            $buffer .= "</li>";
        }
        //while
        $buffer .= "</ul>";
    } else {
        $buffer .= '<p>' . get_opendb_lang_var('no_item_reviews') . '</p>';
    }
    $action_links = NULL;
    if (is_user_granted_permission(PERM_USER_REVIEWER)) {
        $action_links[] = array(url => "item_review.php?op=add&item_id=" . $item_r['item_id'] . "&instance_no=" . $item_r['instance_no'], text => get_opendb_lang_var('review'));
        $buffer .= format_footer_links($action_links);
    }
    return $buffer;
}
Esempio n. 4
0
 echo "<ul class=\"tabMenu\" id=\"tab-menu\">";
 echo "<li id=\"menu-details\" class=\"first activeTab\" onclick=\"return activateTab('details')\">" . get_opendb_lang_var('details') . "</li>";
 echo "<li id=\"menu-instance_info\" onclick=\"return activateTab('instance_info')\">" . get_opendb_lang_var('instance_info') . "</li>";
 if (get_opendb_config_var('item_review', 'enable') !== FALSE) {
     echo "<li id=\"menu-reviews\" onclick=\"return activateTab('reviews')\">" . get_opendb_lang_var('review(s)') . "</li>";
 }
 echo "</ul>";
 echo "<div id=\"tab-content\">";
 echo "<div class=\"tabContent\" id=\"details\">";
 if (get_opendb_config_var('item_review', 'enable') !== FALSE) {
     $average = fetch_review_rating($item_r['item_id']);
     if ($average !== FALSE) {
         echo "<p class=\"rating\">";
         echo get_opendb_lang_var('rating') . ": ";
         $attribute_type_r = fetch_attribute_type_r('S_RATING');
         echo get_display_field($attribute_type_r['s_attribute_type'], NULL, 'review()', $average, FALSE);
         echo "</p>";
     }
 }
 $results = fetch_item_attribute_type_rs($item_r['s_item_type'], 'not_instance_field_types');
 if ($results) {
     echo "<table>";
     while ($item_attribute_type_r = db_fetch_assoc($results)) {
         if (has_role_permission($item_attribute_type_r['view_perm'])) {
             $display_type = trim($item_attribute_type_r['display_type']);
             if ($HTTP_VARS['mode'] == 'printable' && $item_attribute_type_r['printable_ind'] != 'Y' || strlen($display_type) == 0 && $item_attribute_type_r['input_type'] == 'hidden') {
                 // We allow the get_display_field to handle hidden variable, in case at some stage
                 // we might want to change the functionality of 'hidden' to something other than ignore.
                 $display_type = 'hidden';
             }
             if ($item_attribute_type_r['s_field_type'] == 'ITEM_ID') {
Esempio n. 5
0
 function writeRowImpl($row_column_rs)
 {
     if ($this->_toggle) {
         $this->rowclass = "oddRow";
     } else {
         $this->rowclass = "evenRow";
     }
     $this->_write("\n<tr class=\"" . $this->rowclass . "\">");
     for ($i = 0; $i < count($row_column_rs); $i++) {
         $header_column_r = $this->_header_column_rs[$i];
         $columnClass = NULL;
         if (strlen($header_column_r['fieldname']) > 0) {
             $columnClass = $header_column_r['fieldname'];
         }
         switch ($row_column_rs[$i]['column_type']) {
             case 'action_links':
                 $this->_write('<td class="action_links ' . $columnClass . '">');
                 $this->_write(ifempty(format_action_links($row_column_rs[$i]['action_links']), get_opendb_lang_var('not_applicable')));
                 $this->_write('</td>');
                 break;
             case 'username':
                 $this->_write('<td class="username ' . $columnClass . '">');
                 $user_id = $row_column_rs[$i]['user_id'];
                 $fullname = $row_column_rs[$i]['fullname'];
                 if ($user_id == get_opendb_session_var('user_id')) {
                     $this->_write(get_opendb_lang_var('current_user', array('fullname' => $fullname, 'user_id' => $user_id)));
                 } else {
                     $user_name = get_opendb_lang_var('user_name', array('fullname' => $fullname, 'user_id' => $user_id));
                     if ($this->_include_href_links && is_user_granted_permission(PERM_VIEW_USER_PROFILE)) {
                         $item_title = '';
                         // lets find the title column.
                         for ($j = 0; $j < count($row_column_rs); $j++) {
                             if ($row_column_rs[$j]['column_type'] == 'title') {
                                 $item_title = trim(strip_tags($row_column_rs[$j]['item_title']));
                                 break;
                             }
                         }
                         $url = "user_profile.php?uid=" . $user_id;
                         if (is_array($row_column_rs[$i]['extra_http_vars'])) {
                             $url .= "&" . get_url_string($row_column_rs[$i]['extra_http_vars']);
                         }
                         $url .= "&subject=" . urlencode(ifempty($item_title, get_opendb_lang_var('no_subject')));
                         $this->_write("<a href=\"{$url}\" title=\"" . htmlspecialchars(get_opendb_lang_var('user_profile')) . "\">{$user_name}</a>");
                     } else {
                         $this->_write($user_name);
                     }
                 }
                 $this->_write('</td>');
                 break;
             case 'interest':
                 // 					opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, "_xajax=" . $_xajax===NULL?"nulles":"nonnul");
                 $item_id = $row_column_rs[$i]['item_id'];
                 $instance_no = $row_column_rs[$i]['instance_no'];
                 $level = $row_column_rs[$i]['level'];
                 if ($level > 0) {
                     $this->addHelpEntry(get_opendb_lang_var('interest_help'), 'interest_1.gif', 'interest');
                     $new_level_value = 0;
                     $level_display .= "<img" . " id=\"interest_level_{$item_id}" . "_{$instance_no}\"" . " src=\"" . theme_image_src('interest_1.gif') . "\"" . " alt=\"" . get_opendb_lang_var('interest_remove') . "\"" . " title=\"" . get_opendb_lang_var('interest_remove') . "\"" . " onclick=\"xajax_ajax_update_interest_level('{$item_id}', '{$instance_no}', document.getElementById('new_level_value_{$item_id}\\_{$instance_no}').value);\"" . " style=\"cursor:pointer;\"" . " >";
                 } else {
                     $new_level_value = 1;
                     $level_display .= "<img" . " id=\"interest_level_{$item_id}" . "_{$instance_no}\"" . " src=\"" . theme_image_src('interest_0.gif') . "\"" . " alt=\"" . get_opendb_lang_var('interest_mark') . "\"" . " title=\"" . get_opendb_lang_var('interest_mark') . "\"" . " onclick=\"xajax_ajax_update_interest_level('{$item_id}','{$instance_no}', document.getElementById('new_level_value_{$item_id}\\_{$instance_no}').value);\"" . " style=\"cursor:pointer;\"" . " >";
                 }
                 $this->_write('<td class="interest ' . $columnClass . '">');
                 $this->_write("<input id=\"new_level_value_{$item_id}" . "_{$instance_no}\" type=\"hidden\" value=\"{$new_level_value}\" />");
                 $this->_write($level_display);
                 $this->_write('</td>');
                 break;
             case 'item_type_image':
                 $this->_write('<td class="item_type_image ' . $columnClass . '">');
                 $s_item_type = $row_column_rs[$i]['s_item_type'];
                 if (!is_array($this->_item_type_rs[$s_item_type]) || strlen($this->_item_type_rs[$s_item_type]['image']) == 0) {
                     $this->_item_type_rs[$s_item_type] = fetch_item_type_r($s_item_type);
                     // expand to the actual location once only.
                     if (strlen($this->_item_type_rs[$s_item_type]['image']) > 0) {
                         $this->_item_type_rs[$s_item_type]['image'] = theme_image_src($this->_item_type_rs[$s_item_type]['image']);
                     } else {
                         $this->_item_type_rs[$s_item_type]['image'] = 'none';
                     }
                     if (strlen($this->_item_type_rs[$s_item_type]['description']) > 0) {
                         $this->_item_type_rs[$s_item_type]['description'] = htmlspecialchars($this->_item_type_rs[$s_item_type]['description']);
                     } else {
                         $this->_item_type_rs[$s_item_type]['description'] = NULL;
                     }
                 }
                 if (strlen($this->_item_type_rs[$s_item_type]['image']) > 0 && $this->_item_type_rs[$s_item_type]['image'] != 'none') {
                     $this->_write(theme_image($this->_item_type_rs[$s_item_type]['image'], $this->_item_type_rs[$s_item_type]['description'], 's_item_type'));
                 } else {
                     // otherwise write the item type itself in place of the image.
                     $this->_write($s_item_type);
                 }
                 $this->_write('</td>');
                 break;
             case 'theme_image':
                 $this->_write('<td class="' . $columnClass . '">');
                 $this->_write(theme_image($row_column_rs[$i]['src'], htmlspecialchars($row_column_rs[$i]['title']), $row_column_rs[$i]['type']));
                 $this->_write('</td>');
                 break;
             case 'title':
                 $title_href_link = $row_column_rs[$i]['title_href_link'];
                 $is_item_reviewed = $row_column_rs[$i]['is_item_reviewed'];
                 $is_borrowed_or_returned = $row_column_rs[$i]['is_borrowed_or_returned'];
                 $item_title = '';
                 if ($this->_include_href_links && is_user_granted_permission(PERM_VIEW_ITEM_DISPLAY)) {
                     $item_title = '<a href="' . $title_href_link . '">' . $row_column_rs[$i]['item_title'] . '</a>';
                 } else {
                     $item_title = $row_column_rs[$i]['item_title'];
                 }
                 if ($is_item_reviewed) {
                     // show star if rated - Add it to the actual title, so we can do a bit more with title masks
                     $this->addHelpEntry(get_opendb_lang_var('item_reviewed'), 'rs.gif', 'item_reviewed');
                     $item_title .= theme_image('rs.gif', get_opendb_lang_var('item_reviewed'), 'item_reviewed');
                 }
                 if ($is_borrowed_or_returned) {
                     $this->addHelpEntry(get_opendb_lang_var('youve_borrow_or_return'), 'tick.gif', 'borrow_or_return');
                     $item_title .= theme_image("tick.gif", get_opendb_lang_var('youve_borrow_or_return'), 'borrow_or_return');
                     // show tick if previously borrowed or returned.
                 }
                 $this->_write('<td class="title ' . $columnClass . '">');
                 $this->_write($item_title);
                 $this->_write('</td>');
                 break;
             case 'coverimage':
                 $item_cover_image = $row_column_rs[$i]['item_cover_image'];
                 $title_href_link = $row_column_rs[$i]['title_href_link'];
                 $this->_write('<td class="coverimage ' . $columnId . 'Column">');
                 $file_r = file_cache_get_image_r($item_cover_image, 'listing');
                 if (is_array($file_r)) {
                     $cover_image_tag = '<img src="' . $file_r['thumbnail']['url'] . '"';
                     if (is_numeric($file_r['thumbnail']['width'])) {
                         $cover_image_tag .= ' width="' . $file_r['thumbnail']['width'] . '"';
                     }
                     if (is_numeric($file_r['thumbnail']['height'])) {
                         $cover_image_tag .= ' height="' . $file_r['thumbnail']['height'] . '"';
                     }
                     $cover_image_tag .= '>';
                     if ($this->_mode != 'printable' && $this->_include_href_links) {
                         $cover_image_tag = '<a href="' . $title_href_link . '">' . $cover_image_tag . '</a>';
                     }
                     $this->_write($cover_image_tag);
                 }
                 $this->_write('</td>');
                 break;
             case 'display':
                 $this->_write('<td class="' . $columnClass . '">');
                 $this->_write(get_display_field($row_column_rs[$i]['attribute_type'], $row_column_rs[$i]['prompt'], $row_column_rs[$i]['display_type'], $row_column_rs[$i]['value'], FALSE));
                 $this->_write('</td>');
                 break;
             case 'attribute_display':
                 $this->_write('<td class="' . $columnClass . '">');
                 $this->_write(get_item_display_field($row_column_rs[$i]['item_r'], $row_column_rs[$i]['attribute_type_r'], $row_column_rs[$i]['value'], FALSE));
                 $this->_write('</td>');
                 break;
             case 'checkbox':
                 $this->_write('<td class="checkbox">');
                 $value = $row_column_rs[$i]['value'];
                 $this->_write('<input type="checkbox" class="checkbox" name="' . $this->_header_column_rs[$i]['fieldname'] . '[]" value="' . $value . '">');
                 $this->_write('</td>');
                 break;
             default:
                 $this->_write('<td class="' . $columnClass . '">');
                 $this->_write($row_column_rs[$i]['value']);
                 $this->_write('</td>');
                 break;
         }
     }
     $this->_write("\n</tr>");
 }