source: temp/test-xoops.ec-cube.net/html/modules/system/admin/users/userform.php @ 405

Revision 405, 9.6 KB checked in by root, 20 years ago (diff)
Line 
1<?php
2// $Id: userform.php,v 1.4 2005/08/03 12:40:00 onokazu Exp $
3//  ------------------------------------------------------------------------ //
4//                XOOPS - PHP Content Management System                      //
5//                    Copyright (c) 2000 XOOPS.org                           //
6//                       <http://www.xoops.org/>                             //
7//  ------------------------------------------------------------------------ //
8//  This program is free software; you can redistribute it and/or modify     //
9//  it under the terms of the GNU General Public License as published by     //
10//  the Free Software Foundation; either version 2 of the License, or        //
11//  (at your option) any later version.                                      //
12//                                                                           //
13//  You may not change or alter any portion of this comment or credits       //
14//  of supporting developers from this source code or any supporting         //
15//  source code which is considered copyrighted (c) material of the          //
16//  original comment or credit authors.                                      //
17//                                                                           //
18//  This program is distributed in the hope that it will be useful,          //
19//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
20//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
21//  GNU General Public License for more details.                             //
22//                                                                           //
23//  You should have received a copy of the GNU General Public License        //
24//  along with this program; if not, write to the Free Software              //
25//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
26//  ------------------------------------------------------------------------ //
27// Author: Kazumi Ono (AKA onokazu)                                          //
28// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
29// Project: The XOOPS Project                                                //
30// ------------------------------------------------------------------------- //
31
32$uid_label = new XoopsFormLabel(_AM_USERID, $uid_value);
33$uname_text = new XoopsFormText(_AM_NICKNAME, "username", 25, 25, $uname_value);
34$name_text = new XoopsFormText(_AM_NAME, "name", 30, 60, $name_value);
35$email_tray = new XoopsFormElementTray(_AM_EMAIL, "<br />");
36$email_text = new XoopsFormText("", "email", 30, 60, $email_value);
37$email_tray->addElement($email_text, true);
38$email_cbox = new XoopsFormCheckBox("", "user_viewemail", $email_cbox_value);
39$email_cbox->addOption(1, _AM_AOUTVTEAD);
40$email_tray->addElement($email_cbox);
41$url_text = new XoopsFormText(_AM_URL, "url", 30, 100, $url_value);
42//  $avatar_select = new XoopsFormSelect("", "user_avatar", $avatar_value);
43//  $avatar_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
44//  $avatar_select->addOptionArray($avatar_array);
45//  $a_dirlist = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
46//  $a_dir_labels = array();
47//  $a_count = 0;
48//  $a_dir_link = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=avatars&amp;start=".$a_count."','avatars',600,400);\">XOOPS</a>";
49//  $a_count = $a_count + count($avatar_array);
50//  $a_dir_labels[] = new XoopsFormLabel("", $a_dir_link);
51//  foreach ($a_dirlist as $a_dir) {
52//      if ( $a_dir == "users" ) {
53//          continue;
54//      }
55//      $avatars_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/".$a_dir."/", $a_dir."/");
56//      $avatar_select->addOptionArray($avatars_array);
57//      $a_dir_link = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=avatars&amp;subdir=".$a_dir."&amp;start=".$a_count."','avatars',600,400);\">".$a_dir."</a>";
58//      $a_dir_labels[] = new XoopsFormLabel("", $a_dir_link);
59//      $a_count = $a_count + count($avatars_array);
60//  }
61//  if (!empty($uid_value)) {
62//      $myavatar = avatarExists($uid_value);
63//      if ( $myavatar != false ) {
64//          $avatar_select->addOption($myavatar, _US_MYAVATAR);
65//      }
66//  }
67//  $avatar_select->setExtra("onchange='showImgSelected(\"avatar\", \"user_avatar\", \"images/avatar\", \"\", \"".XOOPS_URL."\")'");
68//  $avatar_label = new XoopsFormLabel("", "<img src='".XOOPS_URL."/images/avatar/".$avatar_value."' name='avatar' id='avatar' alt='' />");
69//  $avatar_tray = new XoopsFormElementTray(_AM_AVATAR, "&nbsp;");
70//  $avatar_tray->addElement($avatar_select);
71//  $avatar_tray->addElement($avatar_label);
72//  foreach ($a_dir_labels as $a_dir_label) {
73//      $avatar_tray->addElement($a_dir_label);
74//  }
75//  $theme_select = new XoopsFormSelectTheme(_AM_THEME, "theme", $theme_value);
76$timezone_select = new XoopsFormSelectTimezone(_US_TIMEZONE, "timezone_offset", $timezone_value);
77$icq_text = new XoopsFormText(_AM_ICQ, "user_icq", 15, 15, $icq_value);
78$aim_text = new XoopsFormText(_AM_AIM, "user_aim", 18, 18, $aim_value);
79$yim_text = new XoopsFormText(_AM_YIM, "user_yim", 25, 25, $yim_value);
80$msnm_text = new XoopsFormText(_AM_MSNM, "user_msnm", 30, 100, $msnm_value);
81$location_text = new XoopsFormText(_AM_LOCATION, "user_from", 30, 100, $location_value);
82$occupation_text = new XoopsFormText(_AM_OCCUPATION, "user_occ", 30, 100, $occ_value);
83$interest_text = new XoopsFormText(_AM_INTEREST, "user_intrest", 30, 150, $interest_value);
84$sig_tray = new XoopsFormElementTray(_AM_SIGNATURE, "<br />");
85$sig_tarea = new XoopsFormTextArea("", "user_sig", $sig_value);
86$sig_tray->addElement($sig_tarea);
87$sig_cbox = new XoopsFormCheckBox("", "attachsig", $sig_cbox_value);
88$sig_cbox->addOption(1, _US_SHOWSIG);
89$sig_tray->addElement($sig_cbox);
90$umode_select = new XoopsFormSelect(_US_CDISPLAYMODE, "umode", $umode_value);
91$umode_select->addOptionArray(array("nest"=>_NESTED, "flat"=>_FLAT, "thread"=>_THREADED));
92$uorder_select = new XoopsFormSelect(_US_CSORTORDER, "uorder", $uorder_value);
93$uorder_select->addOptionArray(array("0"=>_OLDESTFIRST, "1"=>_NEWESTFIRST));
94// RMV-NOTIFY
95include_once XOOPS_ROOT_PATH. '/language/' . $xoopsConfig['language'] . '/notification.php';
96include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
97$notify_method_select = new XoopsFormSelect(_NOT_NOTIFYMETHOD, 'notify_method', $notify_method_value);
98$notify_method_select->addOptionArray(array(XOOPS_NOTIFICATION_METHOD_DISABLE=>_NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM=>_NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL=>_NOT_METHOD_EMAIL));
99$notify_mode_select = new XoopsFormSelect(_NOT_NOTIFYMODE, 'notify_mode', $notify_mode_value);
100$notify_mode_select->addOptionArray(array(XOOPS_NOTIFICATION_MODE_SENDALWAYS=>_NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE=>_NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT=>_NOT_MODE_SENDONCEPERLOGIN));
101$bio_tarea = new XoopsFormTextArea(_US_EXTRAINFO, "bio", $bio_value);
102$rank_select = new XoopsFormSelect(_AM_RANK, "rank", $rank_value);
103$ranklist = XoopsLists::getUserRankList();
104if ( count($ranklist) > 0 ) {
105    $rank_select->addOption(0, _AM_NSRA);
106    $rank_select->addOption(0, "--------------");
107    $rank_select->addOptionArray($ranklist);
108} else {
109    $rank_select->addOption(0, _AM_NSRID);
110}
111$pwd_text = new XoopsFormPassword(_AM_PASSWORD, "pass", 10, 32);
112$pwd_text2 = new XoopsFormPassword(_AM_RETYPEPD, "pass2", 10, 32);
113$mailok_radio = new XoopsFormRadioYN(_US_MAILOK, 'user_mailok', $mailok_value);
114
115// Groups administration addition XOOPS 2.0.9: Mith
116global $xoopsUser;
117$gperm_handler =& xoops_gethandler('groupperm');
118//If user has admin rights on groups
119if ($gperm_handler->checkRight("system_admin", XOOPS_SYSTEM_GROUP, $xoopsUser->getGroups(), 1)) {
120    //add group selection
121    $group_select = new XoopsFormSelectGroup(_US_GROUPS, 'groups', false, $groups, 5, true);
122}
123else {
124    //add empty variable
125    $group_select = new XoopsFormHidden('groups[]', XOOPS_GROUP_USERS);
126}
127
128$fct_hidden = new XoopsFormHidden("fct", "users");
129$op_hidden = new XoopsFormHidden("op", $op_value);
130$submit_button = new XoopsFormButton("", "submit", _SUBMIT, "submit");
131
132$form = new XoopsThemeForm($form_title, "userinfo", "admin.php");
133$form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('users_'.$op_value)));
134$form->addElement($uname_text, true);
135$form->addElement($name_text);
136$form->addElement($email_tray, true);
137$form->addElement($url_text);
138//  $form->addElement($avatar_tray);
139//  $form->addElement($theme_select);
140$form->addElement($timezone_select);
141$form->addElement($icq_text);
142$form->addElement($aim_text);
143$form->addElement($yim_text);
144$form->addElement($msnm_text);
145$form->addElement($location_text);
146$form->addElement($occupation_text);
147$form->addElement($interest_text);
148$form->addElement($sig_tray);
149$form->addElement($umode_select);
150$form->addElement($uorder_select);
151// RMV-NOTIFY
152$form->addElement($notify_method_select);
153$form->addElement($notify_mode_select);
154$form->addElement($bio_tarea);
155$form->addElement($rank_select);
156// adding a new user requires password fields
157if (!$form_isedit) {
158    $form->addElement($pwd_text, true);
159    $form->addElement($pwd_text2, true);
160} else {
161    $form->addElement($pwd_text);
162    $form->addElement($pwd_text2);
163}
164$form->addElement($mailok_radio);
165$form->addElement($group_select);
166$form->addElement($fct_hidden);
167$form->addElement($op_hidden);
168$form->addElement($submit_button);
169if ( !empty($uid_value) ) {
170    $uid_hidden = new XoopsFormHidden("uid", $uid_value);
171    $form->addElement($uid_hidden);
172}
173//$form->setRequired($uname_text);
174//$form->setRequired($email_text);
175$form->display();
176?>
Note: See TracBrowser for help on using the repository browser.