コード例 #1
0
/**
* Prints a row containing an <input type="text" />
*
* @param	string	Title for row
* @param	string	Name for input field
* @param	string	Value for input field
* @param	boolean	Whether or not to htmlspecialchars the input field value
* @param	integer	Size for input field
* @param	integer	Max length for input field
* @param	string	Text direction for input field
* @param	mixed	If specified, overrides the default CSS class for the input field
*/
function print_color_input_row($title, $name, $value = '', $htmlise = true, $size = 35, $maxlength = 0, $direction = '', $inputclass = false)
{
    global $vbulletin, $numcolors, $stylevar;
    $direction = verify_text_direction($direction);
    print_label_row($title, "<div id=\"ctrl_{$name}\">\n\t\t\t<input style=\"float:{$stylevar['left']}; margin-{$stylevar['right']}: 4px\" type=\"text\" class=\"" . iif($inputclass, $inputclass, 'bginput') . "\" name=\"{$name}\" id=\"color_{$numcolors}\" value=\"" . iif($htmlise, htmlspecialchars_uni($value), $value) . "\" size=\"{$size}\"" . iif($maxlength, " maxlength=\"{$maxlength}\"") . " dir=\"{$direction}\" tabindex=\"1\"" . iif($vbulletin->debug, " title=\"name=&quot;{$name}&quot;\"") . " onchange=\"preview_color({$numcolors})\" />\n\t\t\t<div style=\"float:{$stylevar['left']}\" id=\"preview_{$numcolors}\" class=\"colorpreview\" onclick=\"open_color_picker({$numcolors}, event)\"></div>\n\t\t</div>", '', 'top', $name);
    $numcolors++;
}
コード例 #2
0
/**
* Prints a row containing a <textarea>
*
* @param	string	Title for row
* @param	string	Name for textarea field
* @param	string	Value for textarea field
* @param	integer	Number of rows for textarea field
* @param	integer	Number of columns for textarea field
* @param	boolean	Whether or not to htmlspecialchars the textarea field value
* @param	boolean	Whether or not to show the 'large edit box' button
* @param	string	Text direction for textarea field
* @param	mixed	If specified, overrides the default CSS class for the textare field
*/
function print_textarea_row($title, $name, $value = '', $rows = 4, $cols = 40, $htmlise = true, $doeditbutton = true, $direction = '', $textareaclass = false)
{
    global $vbphrase, $vbulletin;
    $direction = verify_text_direction($direction);
    if (!$doeditbutton or strpos($name, '[') !== false) {
        $openwindowbutton = '';
    } else {
        $openwindowbutton = '<p><input type="button" unselectable="on" value="' . $vbphrase['large_edit_box'] . '" class="button" style="font-weight:normal" onclick="window.open(\'textarea.php?dir=' . $direction . '&name=' . $name . '\',\'textpopup\',\'resizable=yes,scrollbars=yes,width=\' + (screen.width - (screen.width/10)) + \',height=600\');" /></p>';
    }
    $vbulletin->textarea_id = 'ta_' . $name . '_' . fetch_uniqueid_counter();
    //$resizer = "<p><input type=\"button\" class=\"button\" onclick=\"return resize_textarea(1, '{$vbulletin->textarea_id}')\" value=\"$vbphrase[increase_size]\" style=\"font-size:10px; font-weight:normal; width:85px\" /><br /><input type=\"button\" class=\"button\" onclick=\"return resize_textarea(-1, '{$vbulletin->textarea_id}')\" value=\"$vbphrase[decrease_size]\" style=\"font-size:10px; font-weight:normal; width:85px\" /></p>";
    // trigger hasLayout for IE to prevent template box from jumping (#22761)
    $ie_reflow_css = is_browser('ie') ? 'style="zoom:1"' : '';
    $resizer = "<div class=\"smallfont\"><a href=\"#\" {$ie_reflow_css} onclick=\"return resize_textarea(1, '{$vbulletin->textarea_id}')\">{$vbphrase['increase_size']}</a> <a href=\"#\" {$ie_reflow_css} onclick=\"return resize_textarea(-1, '{$vbulletin->textarea_id}')\">{$vbphrase['decrease_size']}</a></div>";
    print_label_row($title . $openwindowbutton, "<div id=\"ctrl_{$name}\"><textarea name=\"{$name}\" id=\"{$vbulletin->textarea_id}\"" . iif($textareaclass, " class=\"{$textareaclass}\"") . " rows=\"{$rows}\" cols=\"{$cols}\" wrap=\"virtual\" dir=\"{$direction}\" tabindex=\"1\"" . iif($vbulletin->debug, " title=\"name=&quot;{$name}&quot;\"") . ">" . iif($htmlise, htmlspecialchars_uni($value), $value) . "</textarea>{$resizer}</div>", '', 'top', $name);
}
コード例 #3
0
/**
* Prints a row containing an <input type="text" />
*
* @param	string	Title for row
* @param	string	Name for input field
* @param	string	Value for input field
* @param	boolean	Whether or not to htmlspecialchars the input field value
* @param	integer	Size for input field
* @param	integer	Max length for input field
* @param	string	Text direction for input field
* @param	mixed	If specified, overrides the default CSS class for the input field
*/
function print_color_input_row($title, $name, $value = '', $htmlise = true, $size = 35, $maxlength = 0, $direction = '', $inputclass = false)
{
	global $vbulletin, $numcolors;

	$direction = verify_text_direction($direction);

	print_label_row(
		$title,
		"<div id=\"ctrl_$name\">
			<input style=\"float:" . vB_Template_Runtime::fetchStyleVar('left') . "; margin-" . vB_Template_Runtime::fetchStyleVar('right') . ": 4px\" type=\"text\" class=\"" . iif($inputclass, $inputclass, 'bginput') . "\" name=\"$name\" id=\"color_$numcolors\" value=\"" . iif($htmlise, htmlspecialchars_uni($value), $value) . "\" size=\"$size\"" . iif($maxlength, " maxlength=\"$maxlength\"") . " dir=\"$direction\" tabindex=\"1\"" . iif($vbulletin->debug, " title=\"name=&quot;$name&quot;\"") . " onchange=\"preview_color($numcolors)\" />
			<div style=\"float:" . vB_Template_Runtime::fetchStyleVar('left') . "\" id=\"preview_$numcolors\" class=\"colorpreview\" onclick=\"open_color_picker($numcolors, event)\"></div>
		</div>",
		'', 'top', $name
	);

	$numcolors++;
}
コード例 #4
0
 }
 if (is_array($vbulletin->forumcache)) {
     foreach ($vbulletin->forumcache as $forumid => $forum) {
         if (array_search($forum['forumid'], $forums) !== false) {
             $sel = 1;
         } else {
             $sel = -1;
         }
         $radioname = 'forums[' . $forum['forumid'] . ']';
         print_label_row(construct_depth_mark($forum['depth'], '- - ') . ' ' . $forum['title'], "<span class=\"smallfont\"><strong>\n\t\t\t\t<label for=\"rb_1_{$radioname}\"><input type=\"radio\" name=\"{$radioname}\" value=\"1\" id=\"rb_1_{$radioname}\" tabindex=\"1\"" . iif($sel == 1, ' checked="checked"') . " />" . $vbphrase['yes'] . "</label>\n\t\t\t\t<label for=\"rb_0_{$radioname}\"><input type=\"radio\" name=\"{$radioname}\" value=\"-1\" for=\"rb_0_{$radioname}\" tabindex=\"1\"" . iif($sel == -1, ' checked="checked"') . " />" . $vbphrase['default'] . "</label>\n\t\t\t</strong></span>\n\t\t\t");
     }
 }
 print_table_break('', $OUTERTABLEWIDTH);
 print_table_header($vbphrase['cost'], 10);
 print_cells_row(array($vbphrase['us_dollars'], $vbphrase['pounds_sterling'], $vbphrase['euros'], $vbphrase['aus_dollars'], $vbphrase['cad_dollars'], $vbphrase['subscription_length'], $vbphrase['recurring'], $vbphrase['ccbill_subid'], $vbphrase['twocheckout_prodid'], $vbphrase['options']), 1);
 $direction = verify_text_direction('');
 $sub['cost'][] = array();
 foreach ($sub['cost'] as $i => $sub_occurence) {
     $usd = '<input type="text" class="bginput" name="sub[time][' . $i . '][cost][usd]" dir="' . $direction . '" tabindex="1" size="7" value="' . number_format($sub_occurence['cost']['usd'], 2, '.', '') . '" />';
     $gbp = '<input type="text" class="bginput" name="sub[time][' . $i . '][cost][gbp]" dir="' . $direction . '" tabindex="1" size="7" value="' . number_format($sub_occurence['cost']['gbp'], 2, '.', '') . '" />';
     $eur = '<input type="text" class="bginput" name="sub[time][' . $i . '][cost][eur]" dir="' . $direction . '" tabindex="1" size="7" value="' . number_format($sub_occurence['cost']['eur'], 2, '.', '') . '" />';
     $aud = '<input type="text" class="bginput" name="sub[time][' . $i . '][cost][aud]" dir="' . $direction . '" tabindex="1" size="7" value="' . number_format($sub_occurence['cost']['aud'], 2, '.', '') . '" />';
     $cad = '<input type="text" class="bginput" name="sub[time][' . $i . '][cost][cad]" dir="' . $direction . '" tabindex="1" size="7" value="' . number_format($sub_occurence['cost']['cad'], 2, '.', '') . '" />';
     $length = '<input type="text" class="bginput" name="sub[time][' . $i . '][length]" dir="' . $direction . '" tabindex="1" size="7" value="' . $sub_occurence['length'] . '" />';
     $length .= '<select name="sub[time][' . $i . '][units]" tabindex="1" class="bginput">' . construct_select_options(array('D' => $vbphrase['days'], 'W' => $vbphrase['weeks'], 'M' => $vbphrase['months'], 'Y' => $vbphrase['years']), $sub_occurence['units']) . "</select>\n";
     $recurring = '<input type="checkbox" name="sub[time][' . $i . '][recurring]" value="1" tabindex="1"' . ($sub_occurence['recurring'] ? ' checked="checked"' : '') . ' />';
     $ccbill = '<input type="text" class="bginput" name="sub[time][' . $i . '][ccbillsubid]" dir="' . $direction . '" tabindex="1" size="7" value="' . $sub_occurence['ccbillsubid'] . '" />';
     $twocheckout = '<input type="text" class="bginput" name="sub[time][' . $i . '][twocheckout_prodid]" dir="' . $direction . '" tabindex="1" size="7" value="' . $sub_occurence['twocheckout_prodid'] . '" />';
     $options = '<a href="#" onclick="return doRemove(\'sub[time][' . $i . ']\');">' . $vbphrase['delete'] . '</a>';
     print_cells_row(array($usd, $gbp, $eur, $aud, $cad, $length, $recurring, $ccbill, $twocheckout, $options));
 }
コード例 #5
0
 protected function print_textarea_row($title, $stylevarid, $input_type, $value, $stylevar_value)
 {
     global $vbphrase;
     $vb5_config =& vB::getConfig();
     $name = 'stylevar[' . $stylevarid . '][' . $input_type . ']';
     $textarea_id = 'ta_' . $name . '_' . fetch_uniqueid_counter();
     $value = htmlspecialchars_uni($value);
     $cols = 40;
     $rows = 20;
     $direction = verify_text_direction('');
     // trigger hasLayout for IE to prevent template box from jumping (#22761)
     $ie_reflow_css = is_browser('ie') ? 'style="zoom:1"' : '';
     $resizer = "<div class=\"smallfont sizetools\"><a class=\"increase\" href=\"#\" {$ie_reflow_css} onclick=\"return resize_textarea(1, '{$textarea_id}')\">{$vbphrase['increase_size']}</a> <a class=\"decrease\" href=\"#\" {$ie_reflow_css} onclick=\"return resize_textarea(-1, '{$textarea_id}')\">{$vbphrase['decrease_size']}</a></div>";
     $cell = "<div id=\"ctrl_{$name}\"><textarea name=\"{$name}\" id=\"{$textarea_id}\" rows=\"{$rows}\" cols=\"{$cols}\" wrap=\"virtual\" dir=\"{$direction}\" tabindex=\"1\"" . iif($vb5_config['Misc']['debug'], " title=\"name=&quot;{$name}&quot;\"") . ">" . $value . "</textarea>";
     $cell .= $this->fetch_stylevar_input($stylevarid, $input_type, $stylevar_value);
     $cell .= " {$resizer}</div>\n";
     print_label_row($title, $cell, '', 'top', $name);
     construct_hidden_code('stylevar[' . $stylevarid . '][original_' . $input_type . ']', $value, false);
 }
コード例 #6
0
/**
* Prints a row containing an <input type="text" />
*
* @param	string	Title for row
* @param	string	Name for input field
* @param	string	Value for input field
* @param	boolean	Whether or not to htmlspecialchars the input field value
* @param	integer	Size for input field
* @param	integer	Max length for input field
* @param	string	Text direction for input field
* @param	mixed	If specified, overrides the default CSS class for the input field
*/
function print_color_input_row($title, $name, $value = '', $htmlise = true, $size = 35, $maxlength = 0, $direction = '', $inputclass = false)
{
    global $vbulletin, $numcolors;
    $vb5_config = vB::getConfig();
    $direction = verify_text_direction($direction);
    print_label_row($title, "<div id=\"ctrl_{$name}\">\n\t\t\t<input style=\"float:" . vB_Template_Runtime::fetchStyleVar('left') . "; margin-" . vB_Template_Runtime::fetchStyleVar('right') . ": 4px\" type=\"text\" class=\"" . iif($inputclass, $inputclass, 'bginput') . "\" name=\"{$name}\" id=\"color_{$numcolors}\" value=\"" . iif($htmlise, htmlspecialchars_uni($value), $value) . "\" size=\"{$size}\"" . iif($maxlength, " maxlength=\"{$maxlength}\"") . " dir=\"{$direction}\" tabindex=\"1\"" . iif($vb5_config['Misc']['debug'], " title=\"name=&quot;{$name}&quot;\"") . " onchange=\"preview_color({$numcolors})\" />\n\t\t\t<div style=\"float:" . vB_Template_Runtime::fetchStyleVar('left') . "\" id=\"preview_{$numcolors}\" class=\"colorpreview\" onclick=\"open_color_picker({$numcolors}, event)\"></div>\n\t\t</div>", '', 'top', $name);
    $numcolors++;
}