Commit bd335132 authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4750 (main_content block 'zone' parameter does not work for all content types)

parent 1f629a99
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -97,7 +97,8 @@ function render_catalogue_entry_box($row, $zone = '_SEARCH', $give_context = tru
    }

    $tpl_set = $catalogue_name;
    $display = get_catalogue_entry_map($row, $catalogue, 'SEARCH', $tpl_set, $root, null, null, false, true);
    $_breadcrumbs = null;
    $display = get_catalogue_entry_map($row, $catalogue, 'SEARCH', $tpl_set, $root, null, null, false, true, null, $_breadcrumbs, false, $zone);

    $breadcrumbs = mixed();
    if ($include_breadcrumbs) {
@@ -885,9 +886,10 @@ function catalogue_entries_manual_sort($fields, &$entries, $order_by, $direction
 * @param  ?integer $order_by Field index to order by (null: none)
 * @param  ?array $_breadcrumbs Write breadcrumbs into here (null: don't bother)
 * @param  boolean $force_view_all Whether to render everything
 * @param  ID_TEXT $zone The zone to display in
 * @return array A map of information relating to the entry. The map contains 'FIELDS' (Tempcode for all accumulated fields), 'FIELD_x' (for each field x applying to the entry), STAFF_DETAILS, COMMENT_DETAILS, RATING_DETAILS, VIEW_URL, BREADCRUMBS
 */
function get_catalogue_entry_map($entry, $catalogue, $view_type, $tpl_set, $root = null, $fields = null, $only_fields = null, $feedback_details = false, $breadcrumbs_details = false, $order_by = null, &$_breadcrumbs = null, $force_view_all = false)
function get_catalogue_entry_map($entry, $catalogue, $view_type, $tpl_set, $root = null, $fields = null, $only_fields = null, $feedback_details = false, $breadcrumbs_details = false, $order_by = null, &$_breadcrumbs = null, $force_view_all = false, $zone = '_SEARCH')
{
    $id = $entry['id'];
    $all_visible = true;
@@ -1023,8 +1025,6 @@ function get_catalogue_entry_map($entry, $catalogue, $view_type, $tpl_set, $root
        $map['COMMENT_COUNT'] = '1';
    }

    $zone = get_module_zone('catalogues');

    $separate_view_screen =
        (get_option('is_on_comments') == '1') && ($entry['allow_comments'] >= 1) ||
        /*(get_option('is_on_rating') == '1') && ($entry['allow_rating'] == 1) || We'll just allow inline rating */
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ function render_forum_box($row, $zone = '_SEARCH', $give_context = true, $includ
    if (!is_null($root)) {
        $map['keep_forum_root'] = $root;
    }
    $url = build_url($map, get_module_zone('forumview'));
    $url = build_url($map, $zone);

    $title = $give_context ? do_lang('CONTENT_IS_OF_TYPE', do_lang('FORUM'), $row['f_name']) : $row['f_name'];

+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ function render_group_box($row, $zone = '_SEARCH', $give_context = true, $guid =

    require_lang('cns');

    $url = build_url(array('page' => 'groups', 'type' => 'view', 'id' => $row['id']), get_module_zone('groups'));
    $url = build_url(array('page' => 'groups', 'type' => 'view', 'id' => $row['id']), $zone);

    $_title = cns_get_group_name($row['id']);
    $title = $give_context ? do_lang('CONTENT_IS_OF_TYPE', do_lang('USERGROUP'), $_title) : $_title;
+3 −2
Original line number Diff line number Diff line
@@ -28,9 +28,10 @@
 * @param  ?AUTO_LINK $root Virtual root to use (null: none)
 * @param  ID_TEXT $guid Overridden GUID to send to templates (blank: none)
 * @param  ?Tempcode $text_summary Text summary for result (e.g. highlighted portion of actual file from search result) (null: none)
 * @param  ID_TEXT $zone The zone to display in
 * @return Tempcode The isolated post.
 */
function render_post_box($row, $use_post_title = false, $give_context = true, $include_breadcrumbs = true, $root = null, $guid = '', $text_summary = null)
function render_post_box($row, $use_post_title = false, $give_context = true, $include_breadcrumbs = true, $root = null, $guid = '', $text_summary = null, $zone = '_SEARCH')
{
    if (is_null($row)) { // Should never happen, but we need to be defensive
        return new Tempcode();
@@ -162,7 +163,7 @@ function render_post_box($row, $use_post_title = false, $give_context = true, $i
    if (!is_null($root)) {
        $map['keep_forum_root'] = $root;
    }
    $post_url = build_url($map, get_module_zone('topicview'));
    $post_url = build_url($map, $zone);
    $post_url->attach('#post_' . strval($row['id']));
    if ($text_summary === null) {
        $just_post_row = db_map_restrict($row, array('id', 'p_post'), array('id' => 'p_id'));
+1 −1
Original line number Diff line number Diff line
@@ -135,6 +135,6 @@ class Hook_content_meta_aware_post
    {
        require_code('cns_posts2');

        return render_post_box($row, false, $give_context, $include_breadcrumbs, is_null($root) ? null : intval($root), $guid);
        return render_post_box($row, false, $give_context, $include_breadcrumbs, is_null($root) ? null : intval($root), $guid, null, $zone);
    }
}