<?php

$stylepath = ( $stylevar[imgdir_button][0] == "/" || $stylevar[imgdir_button][0] == "h" ? "" : "{$Globals['vbulletin']}/" );

$comq = <<<PPPRINT
<!-- BEGIN TEMPLATE: quickcom.tmpl -->
<br />
PPPRINT;

if ( VB35 == "off" ) {
$comq .= <<<PPPRINT
<script type="text/javascript">
<!--
var WYSIWYG = 1;
var threadedmode = 1;
var minchars = $vboptions[postminchars];
var maxchars = $vboptions[postmaxchars];
var require_click = 0;
var must_click_message = "$vbphrase[click_quick_reply_icon]";
var istyles = new Array(); istyles = { $istyles_js };
var normalmode = false;
var vbphrase = {
	// wysiwyg only
	"wysiwyg_please_wait" : "$vbphrase[wysiwyg_please_wait]",
	"wysiwyg_initialized" : "$vbphrase[wysiwyg_initialized]",
	"wysiwyg_command_invalid" : "$vbphrase[wysiwyg_command_invalid]",
	"moz_must_select_text" : "$vbphrase[moz_must_select_text]",
	"moz_edit_config_file" : "$vbphrase[moz_edit_config_file]",
	"enter_tag_option" : "$vbphrase[enter_tag_option]",
	"must_select_text_to_use" : "$vbphrase[must_select_text_to_use]",
	"browser_is_safari_no_wysiwyg" : "$vbphrase[browser_is_safari_no_wysiwyg]",
	// standard only
	"enter_text_to_be_formatted" : "$vbphrase[enter_text_to_be_formatted]",
	"enter_link_text" : "$vbphrase[enter_link_text]",
	"enter_list_type" : "$vbphrase[enter_list_type]",
	"enter_list_item" : "$vbphrase[enter_list_item]",
	// both
	"must_enter_subject" : "$vbphrase[must_enter_subject]",
	"message_too_short" : "$vbphrase[message_too_short]",
	"enter_link_url" :  "$vbphrase[enter_link_url]",
	"enter_image_url" : "$vbphrase[enter_image_url]",
	"enter_email_link" : "$vbphrase[enter_email_link]"
};
//-->
</script>
PPPRINT;
}
else {
$comq .= <<<PPPRINT
<!-- scripts for quick reply and quick edit -->
<!-- EDITOR SCRIPTS -->
<script type="text/javascript" src="{$Globals['vbulletin']}/clientscript/vbulletin_textedit.js"></script>
<script type="text/javascript">
<!--
var istyles = new Array(); istyles = { $istyles_js };

var smiliewindow_x = 240;
var smiliewindow_y = 280;
var WYSIWYG = 1;
var threadedmode = 1;
var ignorequotechars = 1;


// vB Phrases
vbphrase["wysiwyg_please_wait"]          = "$vbphrase[wysiwyg_please_wait]";
vbphrase["wysiwyg_initialized"]          = "$vbphrase[wysiwyg_initialized]";
vbphrase["wysiwyg_command_invalid"]      = "$vbphrase[wysiwyg_command_invalid]";
vbphrase["moz_must_select_text"]         = "$vbphrase[moz_must_select_text]";
vbphrase["moz_edit_config_file"]         = "$vbphrase[moz_edit_config_file]";
vbphrase["enter_tag_option"]             = "$vbphrase[enter_tag_option]";
vbphrase["must_select_text_to_use"]      = "$vbphrase[must_select_text_to_use]";
vbphrase["browser_is_safari_no_wysiwyg"] = "$vbphrase[browser_is_safari_no_wysiwyg]";
vbphrase["enter_option_x_tag"]           = "$vbphrase[enter_option_x_tag]";
vbphrase["enter_text_to_be_formatted"]   = "$vbphrase[enter_text_to_be_formatted]";
vbphrase["enter_link_text"]              = "$vbphrase[enter_link_text]";
vbphrase["enter_list_type"]              = "$vbphrase[enter_list_type]";
vbphrase["enter_list_item"]              = "$vbphrase[enter_list_item]";
vbphrase["must_enter_subject"]           = "$vbphrase[must_enter_subject]";
vbphrase["message_too_short"]            = "$vbphrase[message_too_short]";
vbphrase["enter_link_url"]               = "$vbphrase[enter_link_url]";
vbphrase["enter_image_url"]              = "$vbphrase[enter_image_url]";
vbphrase["enter_email_link"]             = "$vbphrase[enter_email_link]";
vbphrase["iespell_not_installed"]        = "$vbphrase[iespell_not_installed]";
vbphrase["click_quick_reply_icon"]       = "$vbphrase[click_quick_reply_icon]";
vbphrase["insert_all"]                   = "$vbphrase[insert_all]";

//-->
</script>
<!-- END EDITOR SCRIPTS -->

<script type="text/javascript" src="{$Globals['vbulletin']}/clientscript/vbulletin_quick_edit.js"></script>
<!-- / scripts for quick reply and quick edit -->
PPPRINT;
}

if ( VB35 == "on" ) {
$comq .= <<<PPPRINT
<form name="vbform" method="post" action="{$Globals['maindir']}/comments.php" onsubmit="return vB_Editor['{$editorid}'].prepare_submit(0, 5)">
PPPRINT;
}
else {
$comq .= <<<PPPRINT
<form name="vbform" method="post" action="{$Globals['maindir']}/comments.php" onsubmit="return validatePost(this, this.subject.value, $vboptions[postminchars], $vboptions[postmaxchars]);" onreset="vB_RESET(this);">
PPPRINT;
}

$comq .= <<<PPPRINT
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<thead>
	<tr>
		<td class="tcat" colspan="2">
			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('quickreply');"><img id="collapseimg_quickreply" src="{$stylepath}$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_quickreply].gif" alt="" border="0" /></a>
			$vbphrase[quick_reply]
		</td>
	</tr>
</thead>
<tbody id="collapseobj_quickreply" style="$vbcollapse[collapseobj_quickreply]">
PPPRINT;

if ( !empty($ratedisplay) ) {
    if ( $alreadyrated == 1 ) {
$comq .= <<<PPPRINT
    <tr>
    <td class="{$Style['tddetails']}">
        {$Globals['pp_lang']['ratethis']}
    </td>
    <td class="{$Style['tddetails']}" align="left">
        $ratedisplay
    </td>
    </tr>
PPPRINT;
    }
    elseif ( $User['comments'] == 1 && $Globals['allowrate'] == "yes" && $User['userid'] != $iuserid ) {
$qratedisplay = <<<PPPRINT
    <tr>
    <td class="{$Style['tddetails']}" colspan="2" align="left">
        <input type="hidden" name="cat" value="$cat" />
        <input type="hidden" name="page" value="$page" />
        <input type="hidden" name="puserid" value="{$User['userid']}" />
        <input type="hidden" name="photo" value="$photo" />
        <input type="hidden" name="post" value="new" />
        $ratecode
    </td>
    </tr>
PPPRINT;

    $comq .= <<<PPPRINT
        <tr>
        <td class="{$Style['tddetails']}">
            {$Globals['pp_lang']['ratethis']}
        </td>
        <td class="{$Style['tddetails']}" align="left">
            <table class="{$Style['tddetails']}" width="402">
                $qratedisplay
            </table>
        </td>
        </tr>
PPPRINT;
    }
}

$comq .= <<<PPPRINT
        <tr>
        <td class="{$Style['tddetails']}">
            {$Globals['pp_lang']['comments']}:
        </td>
        <td class="{$Style['tddetails']}" align="center">
		<div class="">
PPPRINT;

if ( VB35 == "off" || VB3_ENHANCEDINT == "off" ) {
$comq .= <<<PPPRINT
			<table cellpadding="0" cellspacing="0" border="0" align="left">
			<tr>
				<td id="vBulletin_editor" align="left">
				<!-- <<<< indent back for ease of reading -->

<!-- standard quick reply -->

	<div id="controlbar">
	<table cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td><div class="imagebutton"><a href="#" onclick="return vbcode('B', '')"><img src="{$Globals['vbulletin']}/images/editor/bold.gif" alt="Bold" width="21" height="20" border="0" /></a></div></td>
		<td><div class="imagebutton"><a href="#" onclick="return vbcode('I', '')"><img src="{$Globals['vbulletin']}/images/editor/italic.gif" alt="Italic" width="21" height="20" border="0" /></a></div></td>
		<td><div class="imagebutton"><a href="#" onclick="return vbcode('U', '')"><img src="{$Globals['vbulletin']}/images/editor/underline.gif" alt="Underline" width="21" height="20" border="0" /></a></div></td>
		<td><img src="{$Globals['vbulletin']}/images/editor/separator.gif" alt="" width="6" height="20" /></td>
		<td><div class="imagebutton"><a href="#" onclick="return vbcode('QUOTE', '')"><img src="{$Globals['vbulletin']}/images/editor/quote.gif" alt="Wrap [QUOTE] tags around selected text" title="Wrap [QUOTE] tags around selected text" width="21" height="21" border="0" /></a></div></td>
	</tr>
	</table>
	</div>

	<div class="controlbar">
		<textarea name="message" id="qr_message" class="bginput" style="width:{$vbphrase[form_width]}; height:100px" cols="60" rows="5" tabindex="1"></textarea>
	</div>

	<script type="text/javascript" src="{$Globals['vbulletin']}/clientscript/vbulletin_editor.js"></script>
	<script type="text/javascript" src="{$Globals['vbulletin']}/clientscript/vbulletin_stdedit.js"></script>
PPPRINT;

if ( VB35 == "off" ) {
$comq .= <<<PPPRINT
<script type="text/javascript" src="{$Globals['vbulletin']}/clientscript/vbulletin_quickreply.js"></script>
PPPRINT;
}
else {
$comq .= <<<PPPRINT
<script type="text/javascript" src="{$Globals['vbulletin']}/clientscript/vbulletin_quick_reply.js"></script>
PPPRINT;
}

$comq .= <<<PPPRINT
<!-- / standard quick reply -->
PPPRINT;
}
else {
$comq .= <<<PPPRINT
        	<table cellpadding="0" cellspacing="0" border="0" align="left">
        	<tr>
        		<td id="vB_Editor_QR" class="vBulletin_editor" align="left">
                    $messagearea
PPPRINT;
}

$comq .= <<<PPPRINT
				<!-- >>>> outdent back to normal -->
				</td>
			</tr>
            </table>
        </td>
        </tr>
        <tr>
        <td class="{$Style['tddetails']}" colspan="2" align="center">
            <input type="hidden" name="cat" value="$cat" />
            <input type="hidden" name="page" value="$page" />
            <input type="hidden" name="puserid" value="{$User['userid']}" />
            <input type="hidden" name="photo" value="$photo" />
            <input type="hidden" name="post" value="new" />
            <input type="submit" value="{$Globals['pp_lang']['submit']}" />
        </td>
        </tr>

	</td>
</tr>
</tbody>
</table>
</form>
<!-- END TEMPLATE: quickcom.tmpl -->
PPPRINT;
?>
