$question) { if (qa_user_post_permit_error('permit_hide_show', $question) && qa_user_post_permit_error('permit_delete_hidden', $question)) { unset($questions[$index]); } } } // Get information for users $usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions)); // Create list of actual hidden postids and see which ones have dependents $qhiddenpostid = array(); foreach ($questions as $key => $question) $qhiddenpostid[$key] = isset($question['opostid']) ? $question['opostid'] : $question['postid']; $dependcounts = qa_db_postids_count_dependents($qhiddenpostid); // Prepare content for theme $qa_content = qa_content_prepare(); $qa_content['title'] = qa_lang_html('admin/recent_hidden_title'); $qa_content['error'] = isset($pageerror) ? $pageerror : qa_admin_page_error(); $qa_content['q_list'] = array( 'form' => array( 'tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array( 'code' => qa_get_form_security_code('admin/click'), ), ), 'qs' => array(), ); if (count($questions)) { foreach ($questions as $key => $question) { $elementid = 'p' . $qhiddenpostid[$key]; $htmloptions = qa_post_html_options($question); $htmloptions['voteview'] = false; $htmloptions['tagsview'] = !isset($question['opostid']); $htmloptions['answersview'] = false; $htmloptions['viewsview'] = false; $htmloptions['updateview'] = false; $htmloptions['contentview'] = true; $htmloptions['flagsview'] = true; $htmloptions['elementid'] = $elementid; $htmlfields = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, $htmloptions); if (isset($htmlfields['what_url'])) // link directly to relevant content $htmlfields['url'] = $htmlfields['what_url']; $htmlfields['what_2'] = qa_lang_html('main/hidden'); if (@$htmloptions['whenview']) { $updated = @$question[isset($question['opostid']) ? 'oupdated' : 'updated']; if (isset($updated)) $htmlfields['when_2'] = qa_when_to_html($updated, @$htmloptions['fulldatedays']); } $buttons = array(); $posttype = qa_strtolower(isset($question['obasetype']) ? $question['obasetype'] : $question['basetype']); if (!qa_user_post_permit_error('permit_hide_show', $question)) { // Possible values for popup: reshow_q_popup, reshow_a_popup, reshow_c_popup $buttons['reshow'] = array( 'tags' => 'name="admin_' . qa_html($qhiddenpostid[$key]) . '_reshow" onclick="return qa_admin_click(this);"', 'label' => qa_lang_html('question/reshow_button'), 'popup' => qa_lang_html(sprintf('question/reshow_%s_popup', $posttype)), ); } if (!qa_user_post_permit_error('permit_delete_hidden', $question) && !$dependcounts[$qhiddenpostid[$key]]) { // Possible values for popup: delete_q_popup, delete_a_popup, delete_c_popup $buttons['delete'] = array( 'tags' => 'name="admin_' . qa_html($qhiddenpostid[$key]) . '_delete" onclick="return qa_admin_click(this);"', 'label' => qa_lang_html('question/delete_button'), 'popup' => qa_lang_html(sprintf('question/delete_%s_popup', $posttype)), ); } if (count($buttons)) { $htmlfields['form'] = array( 'style' => 'light', 'buttons' => $buttons, ); } $qa_content['q_list']['qs'][] = $htmlfields; } } else $qa_content['title'] = qa_lang_html('admin/no_hidden_found'); $qa_content['navigation']['sub'] = qa_admin_sub_navigation(); $qa_content['script_rel'][] = 'qa-content/qa-admin.js?' . QA_VERSION; return $qa_content;