###############################################################################
# CP_CreateGroup.src                                                          #
###############################################################################
# UltraBoard 2000 by UltraScripts.com, Inc.                                   #
# Scripts written by Jacky Wing Wa Yung, WebMaster@UltraScripts.com           #
# Available from http://www.UltraBoard.org/                                   #
# =========================================================================== #
# COPYRIGHT NOTICE :                                                          #
#                                                                             #
# Copyright (c) 1999-2000 UltraScripts.com, Inc. All Rights Reserved.         #
#                                                                             #
# This program is being distributed as shareware. It may be used and modified #
# free for personal, government or non-profit. Any commercial use must be     #
# registered. However, modified versions cannot be sold or distributed. You   #
# cannot alter the copyright and "powered by" notices throughout the scripts. #
# These notices must be clearly visible to the end users.                     #
#                                                                             #
# WARRANTY DISCLAIMER:                                                        #
#                                                                             #
# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT #
# ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR       #
# FITNESS FOR A PARTICULAR PURPOSE.                                           #
###############################################################################

package Source;

use strict;

sub CreateGroup {
  my ($ERROR) = @_;

  my %FORM;
  $FORM{'FORM_TITLE'}          = $UB::QUERY{'FORM_TITLE'};
  $FORM{'FORM_DESCRIPTION'}    = $UB::QUERY{'FORM_DESCRIPTION'};
  $FORM{'FORM_MAX_FILE_SIZE'}  = $UB::QUERY{'FORM_MAX_FILE_SIZE'};

  $FORM{'FORM_FILE_ATTACH'}    = &HTML::Checkbox (
    NAME    => "FORM_FILE_ATTACH",
    VALUE   => "1"               ,
    CHECKED => $UB::QUERY{'FORM_FILE_ATTACH'} || ""
  );

  &Standard::PrintHTMLHeader();
  print &HTML::Header;
  print<<HTML;
<form action="$SYSTEM::CP_URL/Panel.$SYSTEM::EXT" method="post" name="form">
<input type="hidden" name="action" value="DoCreateGroup">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr bgcolor="Gray">
    <td><font color="White"><b>
      <a href="$SYSTEM::CP_URL/Panel.$SYSTEM::EXT?action=body" target="UBBODY" class="address">Control Panel</a> / Member Group Management /  Create a new member group
    </b></font></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
          <td>
            <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
              <tr>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td>
HTML

  if ($ERROR ne "") {
    print<<HTML;
                        There were the following errors during creating member group.<br>
                        <table width="100%" border="0" cellspacing="2" cellpadding="2">
                          <tr>
                            <td><font color="#FF0000">$ERROR</font></td>
                          </tr>
                        </table>
                        Please make any changes and try again!<br>
HTML
  }

print<<HTML;
                      Please fill out all required (<font color="Red"><b>*</b></font>) fields.
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            &nbsp;<br>
            &nbsp;&nbsp;General Information
            <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolordark="White" bordercolorlight="Gray">
              <tr>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td width="100" valign="top" nowrap>Title <font color="Red"><b>*</b></font></td>
                      <td width="100%"><input type="text" name="FORM_TITLE" value="$FORM{'FORM_TITLE'}" size="45" style="width:100%" maxlength="128"></td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="enter the name of member group that you want to call. (128 chars. max.)"></td>
                    </tr>
                    <tr>
                      <td width="100" valign="top" nowrap>Description</td>
                      <td width="100%"><input type="text" name="FORM_DESCRIPTION" value="$FORM{'FORM_DESCRIPTION'}" size="45" style="width:100%" maxlength="256"></td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="write some words about this group that you want to say to your visitors. (256 chars. max.)"></td>
                    </tr>
                    <tr>
                      <td colspan="2">$FORM{'FORM_FILE_ATTACH'}Allow this group members to attach files in their message.</td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="if you want this group members have the permission of attach file in their message, then check this."></td>
                    </tr>
                    <tr>
                      <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Maximum file size that they can upload is <input type="text" name="FORM_MAX_FILE_SIZE" value="$FORM{'FORM_MAX_FILE_SIZE'}" size="6" maxlength="6"> KB.</td>
                      <td width="20" valign="top" nowrap><img src="$SYSTEM::IMAGE_URL/help.gif" width=20 height=20 border=0 alt="if you allowed file attachments then you need to set a maximum file size that members can upload. (measured in kilobytes)"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td align="right"><input type="submit" value="Create it">&nbsp;&nbsp;<input type="Reset" value="Cancel"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</form>
</body>
</html>
HTML
}

###############################################################################
1; # end of CP_CreateGroup.src file
###############################################################################