/**
* Prints a row containing an input for editing a stylevar
*
* @param	string	Stylevar title
* @param	string	Stylevar varname
* @param	integer	Size of text box
*/
function print_stylevar_row($title, $varname, $size = 30, $validation_regex = '', $failsafe_value = '')
{
    global $stylevars, $stylevar_info, $vbulletin;
    $color = fetch_inherited_color($stylevar_info["{$varname}"], $vbulletin->GPC['dostyleid']);
    $revertcode = construct_revert_code($stylevar_info["{$varname}"], 'stylevar', $varname);
    if ($help = construct_table_help_button("stylevar[{$varname}]")) {
        $helplink = " {$help}";
    }
    if ($validation_regex != '') {
        construct_hidden_code("stylevar[_validation][{$varname}]", htmlspecialchars_uni($validation_regex));
        construct_hidden_code("stylevar[_failsafe][{$varname}]", htmlspecialchars_uni($failsafe_value));
    }
    print_cells_row(array("<span title=\"\$stylevar[{$varname}]\">{$title}</span>", "<span class=\"smallfont\"><input type=\"text\" class=\"{$color}\" title=\"\$stylevar[{$varname}]\" name=\"stylevar[{$varname}]\" tabindex=\"1\" value=\"" . htmlspecialchars_uni($stylevars["{$varname}"]) . "\" size=\"{$size}\" dir=\"ltr\" /><br />{$revertcode['info']}</span>", "<span class=\"smallfont\">{$revertcode['revertcode']}</span>{$helplink}"));
}
/**
* Prints a two-cell row with arbitrary contents in each cell
*
* @param	string	HTML contents for first cell
* @param	string	HTML comments for second cell
* @param	string	CSS class for row - if not specified, uses alternating alt1/alt2 classes
* @param	string	Vertical alignment attribute for row (top / bottom etc.)
* @param	string	Name for help button
* @param	boolean	If true, set first cell to 30% width and second to 70%
*/
function print_label_row($title, $value = '&nbsp;', $class = '', $valign = 'top', $helpname = NULL, $dowidth = false)
{
    global $stylevar;
    if (!$class) {
        $class = fetch_row_bgclass();
    }
    if ($helpname !== NULL and $helpbutton = construct_table_help_button($helpname)) {
        $value = '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr valign="top"><td>' . $value . "</td><td align=\"{$stylevar['right']}\" style=\"padding-{$stylevar['left']}:4px\">{$helpbutton}</td></tr></table>";
    }
    if ($dowidth) {
        if (is_numeric($dowidth)) {
            $left_width = $dowidth;
            $right_width = 100 - $dowidth;
        } else {
            $left_width = 70;
            $right_width = 30;
        }
    }
    echo "<tr valign=\"{$valign}\">\n\t<td class=\"{$class}\"" . ($dowidth ? " width=\"{$left_width}%\"" : '') . ">{$title}</td>\n\t<td class=\"{$class}\"" . ($dowidth ? " width=\"{$right_width}%\"" : '') . ">{$value}</td>\n</tr>\n";
}
Beispiel #3
0
         define('CP_REDIRECT', $vbulletin->scriptpath);
         print_stop_message('rebuilt_bitfields_successfully');
     }
 } else {
     echo "<strong>error</strong>\n";
     print_r(vB_Bitfield_Builder::fetch_errors());
 }
 if ($_REQUEST['do'] == 'add') {
     // get a list of other usergroups to base this one off of
     print_form_header('usergroup', 'add');
     $groups = $db->query_read("SELECT usergroupid, title FROM " . TABLE_PREFIX . "usergroup ORDER BY title");
     $selectgroups = '';
     while ($group = $db->fetch_array($groups)) {
         $selectgroups .= "<option value=\"{$group['usergroupid']}\" " . iif($group['usergroupid'] == $vbulletin->GPC['defaultgroupid'], 'selected="selected"') . ">{$group['title']}</option>\n";
     }
     print_description_row(construct_table_help_button('defaultgroupid') . '<b>' . $vbphrase['create_usergroup_based_off_of_usergroup'] . '</b> <select name="defaultgroupid" tabindex="1" class="bginput">' . $selectgroups . '</select> <input type="submit" class="button" value="' . $vbphrase['go'] . '" tabindex="1" />', 0, 2, 'tfoot', 'center');
     print_table_footer();
 }
 print_form_header('usergroup', 'update');
 print_column_style_code(array('width: 70%', 'width: 30%'));
 if ($_REQUEST['do'] == 'add') {
     if (!empty($vbulletin->GPC['defaultgroupid'])) {
         // set defaults to this group's info
         $usergroup = $db->query_first("\n\t\t\t\tSELECT * FROM " . TABLE_PREFIX . "usergroup\n\t\t\t\tWHERE usergroupid = " . $vbulletin->GPC['defaultgroupid'] . "\n\t\t\t");
         $ug_bitfield = array();
         foreach ($vbulletin->bf_ugp as $permissiongroup => $fields) {
             $ug_bitfield["{$permissiongroup}"] = convert_bits_to_array($usergroup["{$permissiongroup}"], $fields);
         }
     } else {
         $ug_bitfield = array('genericoptions' => array('showgroup' => 1, 'showeditedby' => 1, 'isnotbannedgroup' => 1), 'forumpermissions' => array('canview' => 1, 'canviewothers' => 1, 'cangetattachment' => 1, 'cansearch' => 1, 'canthreadrate' => 1, 'canpostattachment' => 1, 'canpostpoll' => 1, 'canvote' => 1, 'canviewthreads' => 1), 'wolpermissions' => array('canwhosonline' => 1), 'genericpermissions' => array('canviewmembers' => 1, 'canmodifyprofile' => 1, 'canseeprofilepic' => 1, 'canusesignature' => 1, 'cannegativerep' => 1, 'canuserep' => 1, 'cansearchft_nl' => 1));
         // set default numeric permissions
Beispiel #4
0
log_admin_action(iif($vbulletin->GPC['moderatorid'] != 0, " moderator id = " . $vbulletin->GPC['moderatorid'], iif($vbulletin->GPC['nodeid'] != 0, "node id = " . $vbulletin->GPC['nodeid'])));
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['channel_manager_gforum']);
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// Legacy Hook 'channeladmin_start' Removed //
// ###################### Start add #######################
if ($_REQUEST['do'] == 'add' or $_REQUEST['do'] == 'edit') {
    $vbulletin->input->clean_array_gpc('r', array('nodeid' => vB_Cleaner::TYPE_UINT, 'defaultnodeid' => vB_Cleaner::TYPE_UINT, 'parentid' => vB_Cleaner::TYPE_UINT));
    if ($_REQUEST['do'] == 'add') {
        // get a list of other usergroups to base this one off of
        print_form_header('forum', 'add');
        print_description_row(construct_table_help_button('defaultnodeid') . '<b>' . $vbphrase['create_channel_based_off_of_channel'] . '</b> <select name="defaultnodeid" tabindex="1" class="bginput">' . construct_channel_chooser() . '</select> <input type="submit" class="button" value="' . $vbphrase['go'] . '" tabindex="1" />', 0, 2, 'tfoot', 'center');
        print_table_footer();
        if ($vbulletin->GPC['parentid'] == vB_Api::instanceInternal('Content_Channel')->fetchChannelByGUID(vB_Channel::MAIN_CHANNEL)) {
            print_stop_message2('cant_add_channel_to_root');
        }
        // Set Defaults;
        $channel = array('title' => '', 'description' => '', 'displayorder' => 1, 'parentid' => $vbulletin->GPC['parentid'], 'styleid' => '', 'styleoverride' => 0, 'cancontainthreads' => 1, 'options' => array('allowbbcode' => 1, 'allowsmilies' => 1));
        if (!empty($vbulletin->GPC['defaultnodeid'])) {
            $newchannel = vB_Api::instanceInternal('node')->getNode($vbulletin->GPC['defaultnodeid']);
            foreach (array_keys($channel) as $title) {
                $channel["{$title}"] = $newchannel["{$title}"];
            }
        }
        // Legacy Hook 'channeladmin_add_default' Removed //
        print_form_header('forum', 'update');
        print_table_header($vbphrase['add_new_forum_gforum']);
Beispiel #5
0
/**
* Prints a two-cell row with arbitrary contents in each cell
*
* @param	string	HTML contents for first cell
* @param	string	HTML comments for second cell
* @param	string	CSS class for row - if not specified, uses alternating alt1/alt2 classes
* @param	string	Vertical alignment attribute for row (top / bottom etc.)
* @param	string	Name for help button
* @param	boolean	If true, set first cell to 30% width and second to 70%
*/
function print_label_row($title, $value = '&nbsp;', $class = '', $valign = 'top', $helpname = NULL, $dowidth = false)
{
	if (!$class)
	{
		$class = fetch_row_bgclass();
	}

	if ($helpname !== NULL AND $helpbutton = construct_table_help_button($helpname))
	{
		$value = '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr valign="top"><td>' . $value . "</td><td align=\"" . vB_Template_Runtime::fetchStyleVar('right') . "\" style=\"padding-" . vB_Template_Runtime::fetchStyleVar('left') . ":4px\">$helpbutton</td></tr></table>";
	}

	if ($dowidth)
	{
		if (is_numeric($dowidth))
		{
			$left_width = $dowidth;
			$right_width = 100 - $dowidth;
		}
		else
		{
			$left_width = 70;
			$right_width = 30;
		}
	}

	echo "<tr valign=\"$valign\">
	<td class=\"$class\"" . ($dowidth ? " width=\"$left_width%\"" : '') . ">$title</td>
	<td class=\"$class\"" . ($dowidth ? " width=\"$right_width%\"" : '') . ">$value</td>\n</tr>\n";
}
/**
* Prints a two-cell row with arbitrary contents in each cell
*
* @param	string	HTML contents for first cell
* @param	string	HTML comments for second cell
* @param	string	CSS class for row - if not specified, uses alternating alt1/alt2 classes
* @param	string	Vertical alignment attribute for row (top / bottom etc.)
* @param	string	Name for help button
* @param	boolean	If true, set first cell to 30% width and second to 70%
* @param 	array 	Two element array of integers to set the colspans for first and second element (array[0] and array[1])
*/
function print_label_row($title, $value = '&nbsp;', $class = '', $valign = 'top', $helpname = NULL, $dowidth = false, $colspan = array(1, 1), $helpOptions = array())
{
    if (!$class) {
        $class = fetch_row_bgclass();
    }
    if ($helpname !== NULL and $helpbutton = construct_table_help_button($helpname, NULL, '', 0, $helpOptions)) {
        $value = '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr valign="top"><td>' . $value . "</td><td align=\"" . vB_Template_Runtime::fetchStyleVar('right') . "\" style=\"padding-" . vB_Template_Runtime::fetchStyleVar('left') . ":4px\">{$helpbutton}</td></tr></table>";
    }
    if ($dowidth) {
        if (is_numeric($dowidth)) {
            $left_width = $dowidth;
            $right_width = 100 - $dowidth;
        } else {
            $left_width = 70;
            $right_width = 30;
        }
    }
    $colattr = array();
    foreach ($colspan as $col) {
        if ($col < 1) {
            $colattr[] = '';
        } else {
            $colattr[] = ' colspan="' . $col . '" ';
        }
    }
    echo "<tr valign=\"{$valign}\">\n\t<td class=\"{$class}\"" . ($dowidth ? " width=\"{$left_width}%\"" : '') . $colattr[0] . ">{$title}</td>\n\t<td class=\"{$class}\"" . ($dowidth ? " width=\"{$right_width}%\"" : '') . $colattr[1] . ">{$value}</td>\n</tr>\n";
}