Overview

Namespaces

  • Composer
    • Autoload
  • Geekwright
    • RegDom
  • League
    • OAuth2
      • Client
        • Provider
  • None
  • Xmf
    • Database
    • Jwt
    • Key
    • Module
      • Helper

Classes

  • ArtObject
  • ArtObjectHandler
  • BloggerApi
  • CGIF
  • CGIFCOLORTABLE
  • CGIFFILEHEADER
  • CGIFIMAGE
  • CGIFIMAGEHEADER
  • CGIFLZW
  • Composer\Autoload\ClassLoader
  • Composer\Autoload\ComposerStaticInit274e5fff219a4f27a346e611b0580d6a
  • ComposerAutoloaderInit274e5fff219a4f27a346e611b0580d6a
  • Config_File
  • Cookie
  • Criteria
  • CriteriaCompo
  • CriteriaElement
  • Database
  • Db_manager
  • ErrorHandler
  • FormDhtmlTextArea
  • FormTextArea
  • Geekwright\RegDom\PublicSuffixList
  • Geekwright\RegDom\RegisteredDomain
  • HTMLPurifier
  • League\OAuth2\Client\Provider\Google
  • MetaWeblogApi
  • ModuleAdmin
  • MovableTypeApi
  • MyTextSanitizer
  • MyTextSanitizerExtended
  • MyTextSanitizerExtension
  • MytsCensor
  • MytsFlash
  • MytsIframe
  • MytsImage
  • MytsLi
  • MytsMms
  • MytsMp3
  • MytsRtsp
  • MytsSoundcloud
  • MytsSyntaxhighlight
  • MytsTextfilter
  • MytsUl
  • MytsWiki
  • MytsWmp
  • MytsYoutube
  • PathStuffController
  • PHPMailer
  • PHPMailerOAuth
  • PHPMailerOAuthGoogle
  • phpthumb
  • phpthumb_bmp
  • phpthumb_filters
  • phpthumb_functions
  • phpthumb_ico
  • phpUnsharpMask
  • PmCorePreload
  • PmMessage
  • PmMessageHandler
  • PmSystemPreload
  • POP3
  • ProfileCategory
  • ProfileCategoryHandler
  • ProfileCorePreload
  • ProfileField
  • ProfileFieldHandler
  • ProfileProfile
  • ProfileProfileHandler
  • ProfileRegstep
  • ProfileRegstepHandler
  • ProfileVisibility
  • ProfileVisibilityHandler
  • Protector
  • Protector_bruteforce_overrun_message
  • Protector_crawler_overrun_message
  • Protector_f5attack_overrun_message
  • Protector_postcommon_post_deny_by_httpbl
  • Protector_postcommon_post_deny_by_rbl
  • Protector_postcommon_post_htmlpurify4everyone
  • Protector_postcommon_post_htmlpurify4guest
  • Protector_postcommon_post_language_match
  • Protector_postcommon_post_need_multibyte
  • Protector_postcommon_post_register_moratorium
  • Protector_postcommon_post_stopforumspam
  • Protector_postcommon_register_insert_js_check
  • Protector_postcommon_register_stopforumspam
  • Protector_precommon_badip_errorlog
  • Protector_precommon_badip_message
  • Protector_precommon_badip_redirection
  • Protector_precommon_bwlimit_errorlog
  • Protector_precommon_bwlimit_message
  • Protector_prepurge_exit_message
  • Protector_spamcheck_overrun_message
  • ProtectorCorePreload
  • ProtectorFilterAbstract
  • ProtectorFilterHandler
  • ProtectorMySQLDatabase
  • ProtectorRegistry
  • ReCaptchaResponse
  • RpcArrayHandler
  • RpcBase64Handler
  • RpcBooleanHandler
  • RpcDateTimeHandler
  • RpcDoubleHandler
  • RpcIntHandler
  • RpcMemberHandler
  • RpcMethodNameHandler
  • RpcNameHandler
  • RpcStringHandler
  • RpcStructHandler
  • RpcValueHandler
  • RssAuthorHandler
  • RssCategoryHandler
  • RssChannelHandler
  • RssCommentsHandler
  • RssCopyrightHandler
  • RssDescriptionHandler
  • RssDocsHandler
  • RssGeneratorHandler
  • RssGuidHandler
  • RssHeightHandler
  • RssImageHandler
  • RssItemHandler
  • RssLanguageHandler
  • RssLastBuildDateHandler
  • RssLinkHandler
  • RssManagingEditorHandler
  • RssNameHandler
  • RssPubDateHandler
  • RssSourceHandler
  • RssTextInputHandler
  • RssTitleHandler
  • RssTtlHandler
  • RssUrlHandler
  • RssWebMasterHandler
  • RssWidthHandler
  • SaxParser
  • Smarty
  • Smarty_Compiler
  • SMTP
  • Snoopy
  • SqlUtility
  • SystemAvatar
  • SystemAvatarHandler
  • SystemBanner
  • SystemBannerclient
  • SystemBannerclientHandler
  • SystemBannerFinish
  • SystemBannerfinishHandler
  • SystemBannerHandler
  • SystemBlock
  • SystemBlockHandler
  • SystemBlockLinkModule
  • SystemBlockLinkModuleHandler
  • SystemBreadcrumb
  • SystemCorePreload
  • SystemFineAvatarUploadHandler
  • SystemFineImUploadHandler
  • SystemFineUploadHandler
  • SystemGroup
  • SystemGroupHandler
  • SystemMaintenance
  • SystemMenuHandler
  • SystemSmilies
  • SystemsmiliesHandler
  • SystemUserrank
  • SystemuserrankHandler
  • SystemUsers
  • SystemUsersHandler
  • Tar
  • ThemeSetAuthorHandler
  • ThemeSetDateCreatedHandler
  • ThemeSetDescriptionHandler
  • ThemeSetEmailHandler
  • ThemeSetFileTypeHandler
  • ThemeSetGeneratorHandler
  • ThemeSetImageHandler
  • ThemeSetLinkHandler
  • ThemeSetModuleHandler
  • ThemeSetNameHandler
  • ThemeSetTagHandler
  • ThemeSetTemplateHandler
  • TinyMCE
  • Xmf\Assert
  • Xmf\Database\Migrate
  • Xmf\Database\TableLoad
  • Xmf\Database\Tables
  • Xmf\Debug
  • Xmf\FilterInput
  • Xmf\Highlighter
  • Xmf\IPAddress
  • Xmf\Jwt\JsonWebToken
  • Xmf\Jwt\KeyFactory
  • Xmf\Jwt\TokenFactory
  • Xmf\Jwt\TokenReader
  • Xmf\Key\ArrayStorage
  • Xmf\Key\Basic
  • Xmf\Key\FileStorage
  • Xmf\Key\KeyAbstract
  • Xmf\Language
  • Xmf\Metagen
  • Xmf\Module\Admin
  • Xmf\Module\Helper
  • Xmf\Module\Helper\AbstractHelper
  • Xmf\Module\Helper\Cache
  • Xmf\Module\Helper\GenericHelper
  • Xmf\Module\Helper\Permission
  • Xmf\Module\Helper\Session
  • Xmf\Random
  • Xmf\Request
  • Xmf\StopWords
  • Xmf\Yaml
  • XmlTagHandler
  • XoopsApi
  • xoopsart
  • XoopsAuth
  • XoopsAuthAds
  • XoopsAuthFactory
  • XoopsAuthLdap
  • XoopsAuthProvisionning
  • XoopsAuthXoops
  • XoopsAvatar
  • XoopsAvatarHandler
  • XoopsBlock
  • XoopsBlockHandler
  • XoopsBlockInstance
  • XoopsBlockInstanceHandler
  • XoopsCache
  • XoopsCacheApc
  • XoopsCacheEngine
  • XoopsCacheFile
  • XoopsCacheMemcache
  • XoopsCacheModel
  • XoopsCacheModelHandler
  • XoopsCacheModelObject
  • XoopsCacheXcache
  • XoopsCaptcha
  • XoopsCaptchaImage
  • XoopsCaptchaImageHandler
  • XoopsCaptchaMethod
  • XoopsCaptchaRecaptcha
  • XoopsCaptchaRecaptcha2
  • XoopsCaptchaText
  • XoopsComment
  • XoopsCommentHandler
  • XoopsCommentRenderer
  • XoopsComments
  • XoopsConfigCategory
  • XoopsConfigCategoryHandler
  • XoopsConfigHandler
  • XoopsConfigItem
  • XoopsConfigItemHandler
  • XoopsConfigOption
  • XoopsConfigOptionHandler
  • XoopsDatabase
  • XoopsDatabaseFactory
  • XoopsDownloader
  • XoopsEditor
  • XoopsEditorHandler
  • XoopsErrorHandler
  • XoopsFile
  • XoopsFileHandler
  • XoopsFilterInput
  • XoopsFolderHandler
  • XoopsForm
  • XoopsFormButton
  • XoopsFormButtonTray
  • XoopsFormCaptcha
  • XoopsFormCheckBox
  • XoopsFormColorPicker
  • XoopsFormDateTime
  • XoopsFormDhtmlTextArea
  • XoopsFormEditor
  • XoopsFormElement
  • XoopsFormElementTray
  • XoopsFormFile
  • XoopsFormHidden
  • XoopsFormHiddenToken
  • XoopsFormLabel
  • XoopsFormPassword
  • XoopsFormRadio
  • XoopsFormRadioYN
  • XoopsFormRenderer
  • XoopsFormRendererBootstrap3
  • XoopsFormRendererLegacy
  • XoopsFormSelect
  • XoopsFormSelectCheckGroup
  • XoopsFormSelectCountry
  • XoopsFormSelectEditor
  • XoopsFormSelectGroup
  • XoopsFormSelectLang
  • XoopsFormSelectMatchOption
  • XoopsFormSelectTheme
  • XoopsFormSelectTimezone
  • XoopsFormSelectUser
  • XoopsFormText
  • XoopsFormTextArea
  • XoopsFormTextDateSelect
  • XoopsFormTinymce
  • XoopsGroup
  • XoopsGroupFormCheckBox
  • XoopsGroupHandler
  • XoopsGroupPerm
  • XoopsGroupPermForm
  • XoopsGroupPermHandler
  • XoopsGTicket
  • XoopsGuestUser
  • XoopsGuiDefault
  • XoopsGuiThadmin
  • XoopsGuiTransition
  • XoopsGuiZetadigme
  • XoopsHandlerRegistry
  • XoopsImage
  • XoopsImagecategory
  • XoopsImagecategoryHandler
  • XoopsImageHandler
  • XoopsImageSet
  • XoopsImagesetHandler
  • XoopsImagesetimg
  • XoopsImagesetimgHandler
  • XoopsInstallWizard
  • XoopsLists
  • XoopsLoad
  • XoopsLocal
  • XoopsLocalAbstract
  • XoopsLocalWrapper
  • XoopsLogger
  • XoopsMailer
  • XoopsMailerLocal
  • XoopsMediaUploader
  • XoopsMemberHandler
  • XoopsMembership
  • XoopsMembershipHandler
  • XoopsModelAbstract
  • XoopsModelFactory
  • XoopsModelJoint
  • XoopsModelRead
  • XoopsModelStats
  • XoopsModelSync
  • XoopsModelWrite
  • XoopsModule
  • XoopsModuleHandler
  • XoopsMultiMailer
  • XoopsMySQLDatabase
  • XoopsMySQLDatabaseProxy
  • XoopsMySQLDatabaseSafe
  • XoopsNotification
  • XoopsNotificationHandler
  • XoopsObject
  • XoopsObjectHandler
  • XoopsObjectTree
  • XoopsOnlineHandler
  • XoopsPageNav
  • XoopsPersistableObjectHandler
  • XoopsPreload
  • XoopsPreloadItem
  • XoopsPrivmessage
  • XoopsPrivmessageHandler
  • XoopsRank
  • XoopsRankHandler
  • XoopsRequest
  • XoopsSecurity
  • XoopsSessionHandler
  • XoopsSimpleForm
  • XoopsStory
  • XoopsSystemCpanel
  • XoopsSystemGui
  • XoopsTableForm
  • XoopsTarDownloader
  • XoopsThemeForm
  • XoopsThemeSetParser
  • XoopsTopic
  • XoopsTpl
  • XoopsTplfile
  • XoopsTplfileHandler
  • XoopsTplset
  • XoopsTplsetHandler
  • XoopsTree
  • XoopsUser
  • XoopsUserHandler
  • XoopsUserUtility
  • XoopsUtility
  • XoopsXmlRpcApi
  • XoopsXmlRpcArray
  • XoopsXmlRpcBase64
  • XoopsXmlRpcBoolean
  • XoopsXmlRpcDatetime
  • XoopsXmlRpcDocument
  • XoopsXmlRpcDouble
  • XoopsXmlRpcFault
  • XoopsXmlRpcInt
  • XoopsXmlRpcParser
  • XoopsXmlRpcRequest
  • XoopsXmlRpcResponse
  • XoopsXmlRpcString
  • XoopsXmlRpcStruct
  • XoopsXmlRpcTag
  • XoopsXmlRss2Parser
  • XoopsZipDownloader
  • xos_kernel_Xoops2
  • xos_logos_PageBuilder
  • xos_opal_AdminThemeFactory
  • xos_opal_Theme
  • xos_opal_ThemeFactory
  • XoUser
  • XoUserHandler
  • Zipfile

Interfaces

  • Xmf\Key\StorageInterface
  • XoopsFormRendererInterface

Exceptions

  • phpmailerException

Functions

  • __autoload
  • _recaptcha_aes_encrypt
  • _recaptcha_aes_pad
  • _recaptcha_http_post
  • _recaptcha_mailhide_email_parts
  • _recaptcha_mailhide_urlbase64
  • _recaptcha_qsencode
  • _smarty_regex_replace_check
  • _smarty_sort_length
  • admin_refcheck
  • b_system_comments_edit
  • b_system_comments_show
  • b_system_info_edit
  • b_system_info_show
  • b_system_login_show
  • b_system_main_show
  • b_system_newmembers_edit
  • b_system_newmembers_show
  • b_system_notification_show
  • b_system_online_show
  • b_system_search_show
  • b_system_themes_edit
  • b_system_themes_show
  • b_system_topposters_edit
  • b_system_topposters_show
  • b_system_user_show
  • b_system_waiting_show
  • bannerstats
  • change_banner_url_by_client
  • checkEmail
  • clickbanner
  • clientlogin
  • closeTable
  • closeThread
  • CloseWaitBox
  • Composer\Autoload\includeFile
  • composerRequire274e5fff219a4f27a346e611b0580d6a
  • createConfigform
  • createThemeform
  • doConditionalGet
  • emailStats
  • exit404BadReq
  • fatalPhpErrorHandler
  • file_get_contents
  • file_put_contents
  • findSharp
  • form_user
  • formatTimestamp
  • formatURL
  • gd_info
  • genPathCheckHtml
  • get_request_method
  • get_writeoks_from_protector
  • getcss
  • getDbCharsets
  • getDbCollations
  • getDirList
  • getMailer
  • getTheme
  • gif_getSize
  • gif_loadFile
  • gif_loadFileToGDimageResource
  • gif_outputAsBmp
  • gif_outputAsJpeg
  • gif_outputAsPng
  • HTMLPurifier
  • imagealphablending
  • imageBrowser
  • imageCreateCorners
  • imageFilenameCheck
  • imagesavealpha
  • install_acceptUser
  • install_finalize
  • is_executable
  • kses
  • langDropdown
  • load_functions
  • load_object
  • load_objectHandler
  • loadModuleAdminMenu
  • make_cblock
  • make_data
  • make_groups
  • make_sidebar
  • mod_clearCacheFile
  • mod_clearConfg
  • mod_clearConfig
  • mod_clearFile
  • mod_clearSmartyCache
  • mod_constant
  • mod_createCacheFile
  • mod_createCacheFile_byGroup
  • mod_createFile
  • mod_DB_prefix
  • mod_fetchConfg
  • mod_fetchConfig
  • mod_generateCacheId
  • mod_generateCacheId_byGroup
  • mod_getDirname
  • mod_getIP
  • mod_getMysqlVersion
  • mod_getUnameFromId
  • mod_getUnameFromIds
  • mod_isModuleAction
  • mod_loadCacheFile
  • mod_loadCacheFile_byGroup
  • mod_loadConfg
  • mod_loadConfig
  • mod_loadFile
  • mod_loadFunctions
  • mod_loadRenderer
  • mod_message
  • modify_chmod
  • myTextForm
  • notificationCategoryInfo
  • notificationCommentCategoryInfo
  • notificationEnabled
  • notificationEventEnabled
  • notificationEventInfo
  • notificationEvents
  • notificationGenerateConfig
  • notificationSubscribableCategoryInfo
  • openTable
  • openThread
  • OpenWaitBox
  • PHPMailerAutoload
  • phpThumbURL
  • preg_quote
  • profile_getFieldForm
  • profile_getRegisterForm
  • profile_getStepForm
  • profile_getUserForm
  • profile_install_addCategory
  • profile_install_addField
  • profile_install_addStep
  • profile_install_initializeProfiles
  • profile_install_setPermissions
  • protector_message_append_oninstall
  • protector_message_append_onuninstall
  • protector_message_append_onupdate
  • protector_notify_base
  • protector_oninstall_base
  • protector_onuninstall_base
  • protector_onupdate_base
  • protector_postcommon
  • protector_prepare
  • recaptcha_check_answer
  • recaptcha_get_html
  • recaptcha_get_signup_url
  • recaptcha_mailhide_html
  • recaptcha_mailhide_url
  • redirect_header
  • RedirectToCachedFile
  • SendSaveAsFileHeaderIfNeeded
  • showbanner
  • showThread
  • smarty_block_textformat
  • smarty_compiler_assign
  • smarty_compiler_foreachq
  • smarty_compiler_includeq
  • smarty_compiler_xoAdminIcons
  • smarty_compiler_xoAdminNav
  • smarty_compiler_xoAppUrl
  • smarty_compiler_xoImgUrl
  • smarty_compiler_xoModuleIcons16
  • smarty_compiler_xoModuleIcons32
  • smarty_compiler_xoModuleIconsBookmarks
  • smarty_core_assemble_plugin_filepath
  • smarty_core_assign_smarty_interface
  • smarty_core_create_dir_structure
  • smarty_core_display_debug_console
  • smarty_core_get_include_path
  • smarty_core_get_microtime
  • smarty_core_get_php_resource
  • smarty_core_is_secure
  • smarty_core_is_trusted
  • smarty_core_load_plugins
  • smarty_core_load_resource_plugin
  • smarty_core_process_cached_inserts
  • smarty_core_process_compiled_include
  • smarty_core_read_cache_file
  • smarty_core_rm_auto
  • smarty_core_rmdir
  • smarty_core_run_insert_handler
  • smarty_core_smarty_include_php
  • smarty_core_write_cache_file
  • smarty_core_write_compiled_include
  • smarty_core_write_compiled_resource
  • smarty_core_write_file
  • smarty_function_assign_debug_info
  • smarty_function_block
  • smarty_function_config_load
  • smarty_function_counter
  • smarty_function_cycle
  • smarty_function_debug
  • smarty_function_escape_special_chars
  • smarty_function_eval
  • smarty_function_fetch
  • smarty_function_html_checkboxes
  • smarty_function_html_checkboxes_output
  • smarty_function_html_image
  • smarty_function_html_options
  • smarty_function_html_options_optgroup
  • smarty_function_html_options_optoutput
  • smarty_function_html_radios
  • smarty_function_html_radios_output
  • smarty_function_html_select_date
  • smarty_function_html_select_time
  • smarty_function_html_table
  • smarty_function_html_table_cycle
  • smarty_function_mailto
  • smarty_function_math
  • smarty_function_popup
  • smarty_function_popup_init
  • smarty_function_securityToken
  • smarty_function_xoInboxCount
  • smarty_function_xoMemberInfo
  • smarty_function_xoops_link
  • smarty_function_xoPageNav
  • smarty_make_timestamp
  • smarty_modifier_capitalize
  • smarty_modifier_capitalize_ucfirst
  • smarty_modifier_cat
  • smarty_modifier_count_characters
  • smarty_modifier_count_paragraphs
  • smarty_modifier_count_sentences
  • smarty_modifier_count_words
  • smarty_modifier_date_format
  • smarty_modifier_debug_print_var
  • smarty_modifier_default
  • smarty_modifier_escape
  • smarty_modifier_indent
  • smarty_modifier_lower
  • smarty_modifier_nl2br
  • smarty_modifier_regex_replace
  • smarty_modifier_replace
  • smarty_modifier_spacify
  • smarty_modifier_string_format
  • smarty_modifier_strip
  • smarty_modifier_strip_tags
  • smarty_modifier_truncate
  • smarty_modifier_upper
  • smarty_modifier_wordwrap
  • smarty_outputfilter_trimwhitespace
  • smarty_outputfilter_trimwhitespace_replace
  • smarty_resource_db_secure
  • smarty_resource_db_source
  • smarty_resource_db_timestamp
  • smarty_resource_db_tplinfo
  • smarty_resource_db_trusted
  • synchronize
  • system_AdminIcons
  • system_adminVersion
  • system_CleanVars
  • system_loadLanguage
  • system_loadTemplate
  • themecenterposts
  • update_system_v211
  • userCheck
  • userTimeToServerTime
  • validateDbCharset
  • writeLicenseKey
  • xoBuildLicenceKey
  • xoDiag
  • xoDiagBoolSetting
  • xoDiagIfWritable
  • xoFormBlockCollation
  • xoFormField
  • xoFormFieldCharset
  • xoFormFieldCollation
  • xoFormSelect
  • xoops_aw_decode
  • xoops_aw_encode
  • xoops_bin2hex
  • xoops_comment_count
  • xoops_comment_delete
  • xoops_confirm
  • xoops_convert_decode
  • xoops_convert_encode
  • xoops_convert_encoding
  • xoops_cp_footer
  • xoops_cp_header
  • xoops_error
  • xoops_footer
  • xoops_getActiveModules
  • xoops_getbanner
  • xoops_getBaseDomain
  • xoops_getConfigOption
  • xoops_getcss
  • xoops_getenv
  • xoops_getHandler
  • xoops_getLinkedUnameFromId
  • xoops_getMailer
  • xoops_getModuleHandler
  • xoops_getModuleOption
  • xoops_getOption
  • xoops_getrank
  • xoops_getUrlDomain
  • xoops_getUserTimestamp
  • xoops_groupperm_deletebymoditem
  • xoops_header
  • xoops_hex2bin
  • xoops_isActiveModule
  • xoops_ishexstr
  • xoops_load
  • xoops_load_lang_file
  • xoops_loadLanguage
  • xoops_local
  • xoops_makepass
  • xoops_message
  • xoops_module_activate
  • xoops_module_change
  • xoops_module_deactivate
  • xoops_module_delayed_clean_cache
  • xoops_module_get_admin_menu
  • xoops_module_gettemplate
  • xoops_module_install
  • xoops_module_install_pm
  • xoops_module_install_profile
  • xoops_module_log_header
  • xoops_module_uninstall
  • xoops_module_update
  • xoops_module_update_pm
  • xoops_module_update_profile
  • xoops_module_update_system
  • xoops_module_write_admin_menu
  • xoops_notification_deletebyitem
  • xoops_notification_deletebymodule
  • xoops_notification_deletebyuser
  • xoops_refcheck
  • xoops_result
  • xoops_setActiveModules
  • xoops_setConfigOption
  • xoops_substr
  • xoops_template_clear_module_cache
  • xoops_template_touch
  • xoops_trim
  • xoops_utf8_encode
  • xoops_write_index_file
  • xoopsCodeTarea
  • xoopseditor_get_rootpath
  • XoopsErrorHandler_HandleError
  • xoopsfwrite
  • xoopsSmilies
  • xoPassField
  • xoPhpVersion
  • xoPutLicenseKey
  • xoStripeKey
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Extended User Profile
  4:  *
  5:  * You may not change or alter any portion of this comment or credits
  6:  * of supporting developers from this source code or any supporting source code
  7:  * which is considered copyrighted (c) material of the original comment or credit authors.
  8:  * This program is distributed in the hope that it will be useful,
  9:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 10:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 11:  *
 12:  * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
 13:  * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 14:  * @package             profile
 15:  * @since               2.3.0
 16:  * @author              Jan Pedersen
 17:  * @author              Taiwen Jiang <phppp@users.sourceforge.net>
 18:  */
 19: 
 20: // defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined");
 21: 
 22: /**
 23:  * Get {@link XoopsThemeForm} for adding/editing fields
 24:  *
 25:  * @param ProfileField $field  {@link ProfileField} object to get edit form for
 26:  * @param mixed        $action URL to submit to - or false for $_SERVER['REQUEST_URI']
 27:  *
 28:  * @return object
 29:  */
 30: function profile_getFieldForm(ProfileField $field, $action = false)
 31: {
 32:     if ($action === false) {
 33:         $action = $_SERVER['REQUEST_URI'];
 34:     }
 35:     $title = $field->isNew() ? sprintf(_PROFILE_AM_ADD, _PROFILE_AM_FIELD) : sprintf(_PROFILE_AM_EDIT, _PROFILE_AM_FIELD);
 36: 
 37:     include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
 38:     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
 39: 
 40:     $form->addElement(new XoopsFormText(_PROFILE_AM_TITLE, 'field_title', 35, 255, $field->getVar('field_title', 'e')));
 41:     $form->addElement(new XoopsFormTextArea(_PROFILE_AM_DESCRIPTION, 'field_description', $field->getVar('field_description', 'e')));
 42: 
 43:     $fieldcat_id = 0;
 44:     if (!$field->isNew()) {
 45:         $fieldcat_id = $field->getVar('cat_id');
 46:     }
 47:     $category_handler = xoops_getModuleHandler('category');
 48:     $cat_select       = new XoopsFormSelect(_PROFILE_AM_CATEGORY, 'field_category', $fieldcat_id);
 49:     $cat_select->addOption(0, _PROFILE_AM_DEFAULT);
 50:     $cat_select->addOptionArray($category_handler->getList());
 51:     $form->addElement($cat_select);
 52:     $form->addElement(new XoopsFormText(_PROFILE_AM_WEIGHT, 'field_weight', 10, 10, $field->getVar('field_weight', 'e')));
 53:     if ($field->getVar('field_config') || $field->isNew()) {
 54:         if (!$field->isNew()) {
 55:             $form->addElement(new XoopsFormLabel(_PROFILE_AM_NAME, $field->getVar('field_name')));
 56:             $form->addElement(new XoopsFormHidden('id', $field->getVar('field_id')));
 57:         } else {
 58:             $form->addElement(new XoopsFormText(_PROFILE_AM_NAME, 'field_name', 35, 255, $field->getVar('field_name', 'e')));
 59:         }
 60: 
 61:         //autotext and theme left out of this one as fields of that type should never be changed (valid assumption, I think)
 62:         $fieldtypes = array(
 63:             'checkbox'     => _PROFILE_AM_CHECKBOX,
 64:             'date'         => _PROFILE_AM_DATE,
 65:             'datetime'     => _PROFILE_AM_DATETIME,
 66:             'longdate'     => _PROFILE_AM_LONGDATE,
 67:             'group'        => _PROFILE_AM_GROUP,
 68:             'group_multi'  => _PROFILE_AM_GROUPMULTI,
 69:             'language'     => _PROFILE_AM_LANGUAGE,
 70:             'radio'        => _PROFILE_AM_RADIO,
 71:             'select'       => _PROFILE_AM_SELECT,
 72:             'select_multi' => _PROFILE_AM_SELECTMULTI,
 73:             'textarea'     => _PROFILE_AM_TEXTAREA,
 74:             'dhtml'        => _PROFILE_AM_DHTMLTEXTAREA,
 75:             'textbox'      => _PROFILE_AM_TEXTBOX,
 76:             'timezone'     => _PROFILE_AM_TIMEZONE,
 77:             'yesno'        => _PROFILE_AM_YESNO);
 78: 
 79:         $element_select = new XoopsFormSelect(_PROFILE_AM_TYPE, 'field_type', $field->getVar('field_type', 'e'));
 80:         $element_select->addOptionArray($fieldtypes);
 81: 
 82:         $form->addElement($element_select);
 83: 
 84:         switch ($field->getVar('field_type')) {
 85:             case 'textbox':
 86:                 $valuetypes = array(
 87:                     XOBJ_DTYPE_TXTBOX          => _PROFILE_AM_TXTBOX,
 88:                     XOBJ_DTYPE_EMAIL           => _PROFILE_AM_EMAIL,
 89:                     XOBJ_DTYPE_INT             => _PROFILE_AM_INT,
 90:                     XOBJ_DTYPE_FLOAT           => _PROFILE_AM_FLOAT,
 91:                     XOBJ_DTYPE_DECIMAL         => _PROFILE_AM_DECIMAL,
 92:                     XOBJ_DTYPE_TXTAREA         => _PROFILE_AM_TXTAREA,
 93:                     XOBJ_DTYPE_URL             => _PROFILE_AM_URL,
 94:                     XOBJ_DTYPE_OTHER           => _PROFILE_AM_OTHER,
 95:                     XOBJ_DTYPE_ARRAY           => _PROFILE_AM_ARRAY,
 96:                     XOBJ_DTYPE_UNICODE_ARRAY   => _PROFILE_AM_UNICODE_ARRAY,
 97:                     XOBJ_DTYPE_UNICODE_TXTBOX  => _PROFILE_AM_UNICODE_TXTBOX,
 98:                     XOBJ_DTYPE_UNICODE_TXTAREA => _PROFILE_AM_UNICODE_TXTAREA,
 99:                     XOBJ_DTYPE_UNICODE_EMAIL   => _PROFILE_AM_UNICODE_EMAIL,
100:                     XOBJ_DTYPE_UNICODE_URL     => _PROFILE_AM_UNICODE_URL);
101: 
102:                 $type_select = new XoopsFormSelect(_PROFILE_AM_VALUETYPE, 'field_valuetype', $field->getVar('field_valuetype', 'e'));
103:                 $type_select->addOptionArray($valuetypes);
104:                 $form->addElement($type_select);
105:                 break;
106: 
107:             case 'select':
108:             case 'radio':
109:                 $valuetypes = array(
110:                     XOBJ_DTYPE_TXTBOX          => _PROFILE_AM_TXTBOX,
111:                     XOBJ_DTYPE_EMAIL           => _PROFILE_AM_EMAIL,
112:                     XOBJ_DTYPE_INT             => _PROFILE_AM_INT,
113:                     XOBJ_DTYPE_FLOAT           => _PROFILE_AM_FLOAT,
114:                     XOBJ_DTYPE_DECIMAL         => _PROFILE_AM_DECIMAL,
115:                     XOBJ_DTYPE_TXTAREA         => _PROFILE_AM_TXTAREA,
116:                     XOBJ_DTYPE_URL             => _PROFILE_AM_URL,
117:                     XOBJ_DTYPE_OTHER           => _PROFILE_AM_OTHER,
118:                     XOBJ_DTYPE_ARRAY           => _PROFILE_AM_ARRAY,
119:                     XOBJ_DTYPE_UNICODE_ARRAY   => _PROFILE_AM_UNICODE_ARRAY,
120:                     XOBJ_DTYPE_UNICODE_TXTBOX  => _PROFILE_AM_UNICODE_TXTBOX,
121:                     XOBJ_DTYPE_UNICODE_TXTAREA => _PROFILE_AM_UNICODE_TXTAREA,
122:                     XOBJ_DTYPE_UNICODE_EMAIL   => _PROFILE_AM_UNICODE_EMAIL,
123:                     XOBJ_DTYPE_UNICODE_URL     => _PROFILE_AM_UNICODE_URL);
124: 
125:                 $type_select = new XoopsFormSelect(_PROFILE_AM_VALUETYPE, 'field_valuetype', $field->getVar('field_valuetype', 'e'));
126:                 $type_select->addOptionArray($valuetypes);
127:                 $form->addElement($type_select);
128:                 break;
129:         }
130: 
131:         //$form->addElement(new XoopsFormRadioYN(_PROFILE_AM_NOTNULL, 'field_notnull', $field->getVar('field_notnull', 'e') ));
132: 
133:         if ($field->getVar('field_type') === 'select' || $field->getVar('field_type') === 'select_multi' || $field->getVar('field_type') === 'radio' || $field->getVar('field_type') === 'checkbox') {
134:             $options = $field->getVar('field_options');
135:             if (count($options) > 0) {
136:                 $remove_options          = new XoopsFormCheckBox(_PROFILE_AM_REMOVEOPTIONS, 'removeOptions');
137:                 $remove_options->columns = 3;
138:                 asort($options);
139:                 foreach (array_keys($options) as $key) {
140:                     $options[$key] .= "[{$key}]";
141:                 }
142:                 $remove_options->addOptionArray($options);
143:                 $form->addElement($remove_options);
144:             }
145: 
146:             $option_text = "<table  cellspacing='1'><tr><td class='width20'>" . _PROFILE_AM_KEY . '</td><td>' . _PROFILE_AM_VALUE . '</td></tr>';
147:             for ($i = 0; $i < 3; ++$i) {
148:                 $option_text .= "<tr><td><input type='text' name='addOption[{$i}][key]' id='addOption[{$i}][key]' size='15' /></td><td><input type='text' name='addOption[{$i}][value]' id='addOption[{$i}][value]' size='35' /></td></tr>";
149:                 $option_text .= "<tr height='3px'><td colspan='2'> </td></tr>";
150:             }
151:             $option_text .= '</table>';
152:             $form->addElement(new XoopsFormLabel(_PROFILE_AM_ADDOPTION, $option_text));
153:         }
154:     }
155: 
156:     if ($field->getVar('field_edit')) {
157:         switch ($field->getVar('field_type')) {
158:             case 'textbox':
159:             case 'textarea':
160:             case 'dhtml':
161:                 $form->addElement(new XoopsFormText(_PROFILE_AM_MAXLENGTH, 'field_maxlength', 35, 35, $field->getVar('field_maxlength', 'e')));
162:                 $form->addElement(new XoopsFormTextArea(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e')));
163:                 break;
164: 
165:             case 'checkbox':
166:             case 'select_multi':
167:                 $def_value = $field->getVar('field_default', 'e') != null ? unserialize($field->getVar('field_default', 'n')) : null;
168:                 $element   = new XoopsFormSelect(_PROFILE_AM_DEFAULT, 'field_default', $def_value, 8, true);
169:                 $options   = $field->getVar('field_options');
170:                 asort($options);
171:                 // If options do not include an empty element, then add a blank option to prevent any default selection
172:                 //                if (!in_array('', array_keys($options))) {
173:                 if (!array_key_exists('', $options)) {
174:                     $element->addOption('', _NONE);
175:                 }
176:                 $element->addOptionArray($options);
177:                 $form->addElement($element);
178:                 break;
179: 
180:             case 'select':
181:             case 'radio':
182:                 $def_value = $field->getVar('field_default', 'e') != null ? $field->getVar('field_default') : null;
183:                 $element   = new XoopsFormSelect(_PROFILE_AM_DEFAULT, 'field_default', $def_value);
184:                 $options   = $field->getVar('field_options');
185:                 asort($options);
186:                 // If options do not include an empty element, then add a blank option to prevent any default selection
187:                 //                if (!in_array('', array_keys($options))) {
188:                 if (!array_key_exists('', $options)) {
189:                     $element->addOption('', _NONE);
190:                 }
191:                 $element->addOptionArray($options);
192:                 $form->addElement($element);
193:                 break;
194: 
195:             case 'date':
196:                 $form->addElement(new XoopsFormTextDateSelect(_PROFILE_AM_DEFAULT, 'field_default', 15, $field->getVar('field_default', 'e')));
197:                 break;
198: 
199:             case 'longdate':
200:                 $form->addElement(new XoopsFormTextDateSelect(_PROFILE_AM_DEFAULT, 'field_default', 15, strtotime($field->getVar('field_default', 'e'))));
201:                 break;
202: 
203:             case 'datetime':
204:                 $form->addElement(new XoopsFormDateTime(_PROFILE_AM_DEFAULT, 'field_default', 15, $field->getVar('field_default', 'e')));
205:                 break;
206: 
207:             case 'yesno':
208:                 $form->addElement(new XoopsFormRadioYN(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e')));
209:                 break;
210: 
211:             case 'timezone':
212:                 $form->addElement(new XoopsFormSelectTimezone(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e')));
213:                 break;
214: 
215:             case 'language':
216:                 $form->addElement(new XoopsFormSelectLang(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e')));
217:                 break;
218: 
219:             case 'group':
220:                 $form->addElement(new XoopsFormSelectGroup(_PROFILE_AM_DEFAULT, 'field_default', true, $field->getVar('field_default', 'e')));
221:                 break;
222: 
223:             case 'group_multi':
224:                 $form->addElement(new XoopsFormSelectGroup(_PROFILE_AM_DEFAULT, 'field_default', true, unserialize($field->getVar('field_default', 'n')), 5, true));
225:                 break;
226: 
227:             case 'theme':
228:                 $form->addElement(new XoopsFormSelectTheme(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e')));
229:                 break;
230: 
231:             case 'autotext':
232:                 $form->addElement(new XoopsFormTextArea(_PROFILE_AM_DEFAULT, 'field_default', $field->getVar('field_default', 'e')));
233:                 break;
234:         }
235:     }
236:     /* @var $groupperm_handler XoopsGroupPermHandler  */
237:     $groupperm_handler = xoops_getHandler('groupperm');
238:     $searchable_types  = array(
239:         'textbox',
240:         'select',
241:         'radio',
242:         'yesno',
243:         'date',
244:         'datetime',
245:         'timezone',
246:         'language');
247:     if (in_array($field->getVar('field_type'), $searchable_types)) {
248:         $search_groups = $groupperm_handler->getGroupIds('profile_search', $field->getVar('field_id'), $GLOBALS['xoopsModule']->getVar('mid'));
249:         $form->addElement(new XoopsFormSelectGroup(_PROFILE_AM_PROF_SEARCH, 'profile_search', true, $search_groups, 5, true));
250:     }
251:     if ($field->getVar('field_edit') || $field->isNew()) {
252:         $editable_groups = array();
253:         if (!$field->isNew()) {
254:             //Load groups
255:             $editable_groups = $groupperm_handler->getGroupIds('profile_edit', $field->getVar('field_id'), $GLOBALS['xoopsModule']->getVar('mid'));
256:         }
257:         $form->addElement(new XoopsFormSelectGroup(_PROFILE_AM_PROF_EDITABLE, 'profile_edit', false, $editable_groups, 5, true));
258:         $form->addElement(new XoopsFormRadioYN(_PROFILE_AM_REQUIRED, 'field_required', $field->getVar('field_required', 'e')));
259:         $regstep_select = new XoopsFormSelect(_PROFILE_AM_PROF_REGISTER, 'step_id', $field->getVar('step_id', 'e'));
260:         $regstep_select->addOption(0, _NO);
261:         $regstep_handler = xoops_getModuleHandler('regstep');
262:         $regstep_select->addOptionArray($regstep_handler->getList());
263:         $form->addElement($regstep_select);
264:     }
265:     $form->addElement(new XoopsFormHidden('op', 'save'));
266:     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
267: 
268:     return $form;
269: }
270: 
271: /**
272:  * Get {@link XoopsThemeForm} for registering new users
273:  *
274:  * @param XoopsUser $user
275:  * @param           $profile
276:  * @param XoopsUser $user {@link XoopsUser} to register
277:  * @param int       $step Which step we are at
278:  *
279:  * @internal param \profileRegstep $next_step
280:  * @return object
281:  */
282: function profile_getRegisterForm(XoopsUser $user, $profile, $step = null)
283: {
284:     global $opkey; // should be set in register.php
285:     if (empty($opkey)) {
286:         $opkey = 'profile_opname';
287:     }
288:     $next_opname      = 'op' . mt_rand(10000, 99999);
289:     $_SESSION[$opkey] = $next_opname;
290: 
291:     include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
292:     if (empty($GLOBALS['xoopsConfigUser'])) {
293:         /* @var $config_handler XoopsConfigHandler  */
294:         $config_handler             = xoops_getHandler('config');
295:         $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
296:     }
297:     $action    = $_SERVER['REQUEST_URI'];
298:     $step_no   = $step['step_no'];
299:     $use_token = $step['step_no'] > 0;// ? true : false;
300:     $reg_form  = new XoopsThemeForm($step['step_name'], 'regform', $action, 'post', $use_token);
301: 
302:     if ($step['step_desc']) {
303:         $reg_form->addElement(new XoopsFormLabel('', $step['step_desc']));
304:     }
305: 
306:     if ($step_no == 1) {
307:         //$uname_size = $GLOBALS['xoopsConfigUser']['maxuname'] < 35 ? $GLOBALS['xoopsConfigUser']['maxuname'] : 35;
308: 
309:         $elements[0][] = array(
310:             'element'  => new XoopsFormText(_US_NICKNAME, 'uname', 35, $GLOBALS['xoopsConfigUser']['maxuname'], $user->getVar('uname', 'e')),
311:             'required' => true);
312:         $weights[0][]  = 0;
313: 
314:         $elements[0][] = array('element' => new XoopsFormText(_US_EMAIL, 'email', 35, 255, $user->getVar('email', 'e')), 'required' => true);
315:         $weights[0][]  = 0;
316: 
317:         $elements[0][] = array('element' => new XoopsFormPassword(_US_PASSWORD, 'pass', 35, 32, ''), 'required' => true);
318:         $weights[0][]  = 0;
319: 
320:         $elements[0][] = array('element' => new XoopsFormPassword(_US_VERIFYPASS, 'vpass', 35, 32, ''), 'required' => true);
321:         $weights[0][]  = 0;
322:     }
323: 
324:     // Dynamic fields
325:     $profile_handler              = xoops_getModuleHandler('profile');
326:     $fields                       = $profile_handler->loadFields();
327:     $_SESSION['profile_required'] = array();
328:     foreach (array_keys($fields) as $i) {
329:         if ($fields[$i]->getVar('step_id') == $step['step_id']) {
330:             $fieldinfo['element'] = $fields[$i]->getEditElement($user, $profile);
331:             //assign and check (=)
332:             if ($fieldinfo['required'] = $fields[$i]->getVar('field_required')) {
333:                 $_SESSION['profile_required'][$fields[$i]->getVar('field_name')] = $fields[$i]->getVar('field_title');
334:             }
335: 
336:             $key              = $fields[$i]->getVar('cat_id');
337:             $elements[$key][] = $fieldinfo;
338:             $weights[$key][]  = $fields[$i]->getVar('field_weight');
339:         }
340:     }
341:     ksort($elements);
342: 
343:     // Get categories
344:     $cat_handler = xoops_getModuleHandler('category');
345:     $categories  = $cat_handler->getObjects(null, true, false);
346: 
347:     foreach (array_keys($elements) as $k) {
348:         array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
349:         //$title = isset($categories[$k]) ? $categories[$k]['cat_title'] : _PROFILE_MA_DEFAULT;
350:         //$desc = isset($categories[$k]) ? $categories[$k]['cat_description'] : "";
351:         //$reg_form->insertBreak("<p>{$title}</p>{$desc}");
352:         //$reg_form->addElement(new XoopsFormLabel("<h2>".$title."</h2>", $desc), false);
353:         foreach (array_keys($elements[$k]) as $i) {
354:             $reg_form->addElement($elements[$k][$i]['element'], $elements[$k][$i]['required']);
355:         }
356:     }
357:     //end of Dynamic User fields
358: 
359:     if ($step_no == 1 && $GLOBALS['xoopsConfigUser']['reg_dispdsclmr'] != 0 && $GLOBALS['xoopsConfigUser']['reg_disclaimer'] != '') {
360:         $disc_tray = new XoopsFormElementTray(_US_DISCLAIMER, '<br>');
361:         $disc_text = new XoopsFormLabel('', "<div class=\"pad5\">" . $GLOBALS['myts']->displayTarea($GLOBALS['xoopsConfigUser']['reg_disclaimer'], 1) . '</div>');
362:         $disc_tray->addElement($disc_text);
363:         $agree_chk = new XoopsFormCheckBox('', 'agree_disc');
364:         $agree_chk->addOption(1, _US_IAGREE);
365:         $disc_tray->addElement($agree_chk);
366:         $reg_form->addElement($disc_tray);
367:     }
368:     global $xoopsModuleConfig;
369:     $useCaptchaAfterStep2 = $xoopsModuleConfig['profileCaptchaAfterStep1'] + 1;
370: 
371:     if ($step_no <= $useCaptchaAfterStep2) {
372:         $reg_form->addElement(new XoopsFormCaptcha(), true);
373:     }
374: 
375:     $reg_form->addElement(new XoopsFormHidden($next_opname, 'register'));
376:     $reg_form->addElement(new XoopsFormHidden('uid', $user->getVar('uid')));
377:     $reg_form->addElement(new XoopsFormHidden('step', $step_no));
378:     $reg_form->addElement(new XoopsFormButton('', 'submitButton', _SUBMIT, 'submit'));
379: 
380:     return $reg_form;
381: }
382: 
383: /**
384:  * Get {@link XoopsThemeForm} for editing a user
385:  *
386:  * @param XoopsUser           $user {@link XoopsUser} to edit
387:  * @param ProfileProfile|XoopsObject|null $profile
388:  * @param bool                $action
389:  *
390:  * @return object
391:  */
392: function profile_getUserForm(XoopsUser $user, ProfileProfile $profile = null, $action = false)
393: {
394:     if ($action === false) {
395:         $action = $_SERVER['REQUEST_URI'];
396:     }
397:     if (empty($GLOBALS['xoopsConfigUser'])) {
398:         /* @var $config_handler XoopsConfigHandler  */
399:         $config_handler             = xoops_getHandler('config');
400:         $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
401:     }
402: 
403:     include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
404: 
405:     $title = $user->isNew() ? _PROFILE_AM_ADDUSER : _US_EDITPROFILE;
406: 
407:     $form = new XoopsThemeForm($title, 'userinfo', $action, 'post', true);
408:     /* @var $profile_handler ProfileProfileHandler */
409:     $profile_handler = xoops_getModuleHandler('profile');
410:     // Dynamic fields
411:     if (!$profile) {
412:         /* @var $profile_handler ProfileProfileHandler */
413:         $profile_handler = xoops_getModuleHandler('profile', 'profile');
414:         $profile         = $profile_handler->get($user->getVar('uid'));
415:     }
416:     // Get fields
417:     $fields = $profile_handler->loadFields();
418:     // Get ids of fields that can be edited
419:     /* @var  $gperm_handler XoopsGroupPermHandler */
420:     $gperm_handler   = xoops_getHandler('groupperm');
421:     $editable_fields = $gperm_handler->getItemIds('profile_edit', $GLOBALS['xoopsUser']->getGroups(), $GLOBALS['xoopsModule']->getVar('mid'));
422: 
423:     if ($user->isNew() || $GLOBALS['xoopsUser']->isAdmin()) {
424:         $elements[0][] = array(
425:             'element'  => new XoopsFormText(_US_NICKNAME, 'uname', 25, $GLOBALS['xoopsUser']->isAdmin() ? 60 : $GLOBALS['xoopsConfigUser']['maxuname'], $user->getVar('uname', 'e')),
426:             'required' => 1);
427:         $email_text    = new XoopsFormText('', 'email', 30, 60, $user->getVar('email'));
428:     } else {
429:         $elements[0][] = array('element' => new XoopsFormLabel(_US_NICKNAME, $user->getVar('uname')), 'required' => 0);
430:         $email_text    = new XoopsFormLabel('', $user->getVar('email'));
431:     }
432:     $email_tray = new XoopsFormElementTray(_US_EMAIL, '<br>');
433:     $email_tray->addElement($email_text, ($user->isNew() || $GLOBALS['xoopsUser']->isAdmin()) ? 1 : 0);
434:     $weights[0][]  = 0;
435:     $elements[0][] = array('element' => $email_tray, 'required' => 0);
436:     $weights[0][]  = 0;
437: 
438:     if ($GLOBALS['xoopsUser']->isAdmin() && $user->getVar('uid') != $GLOBALS['xoopsUser']->getVar('uid')) {
439:         //If the user is an admin and is editing someone else
440:         $pwd_text  = new XoopsFormPassword('', 'password', 10, 32);
441:         $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 32);
442:         $pwd_tray  = new XoopsFormElementTray(_US_PASSWORD . '<br>' . _US_TYPEPASSTWICE);
443:         $pwd_tray->addElement($pwd_text);
444:         $pwd_tray->addElement($pwd_text2);
445:         $elements[0][] = array('element' => $pwd_tray, 'required' => 0); //cannot set an element tray required
446:         $weights[0][]  = 0;
447: 
448:         $level_radio = new XoopsFormRadio(_PROFILE_MA_USERLEVEL, 'level', $user->getVar('level'));
449:         $level_radio->addOption(1, _PROFILE_MA_ACTIVE);
450:         $level_radio->addOption(0, _PROFILE_MA_INACTIVE);
451:         //$level_radio->addOption(-1, _PROFILE_MA_DISABLED);
452:         $elements[0][] = array('element' => $level_radio, 'required' => 0);
453:         $weights[0][]  = 0;
454:     }
455: 
456:     $elements[0][] = array('element' => new XoopsFormHidden('uid', $user->getVar('uid')), 'required' => 0);
457:     $weights[0][]  = 0;
458:     $elements[0][] = array('element' => new XoopsFormHidden('op', 'save'), 'required' => 0);
459:     $weights[0][]  = 0;
460: 
461:     $cat_handler    = xoops_getModuleHandler('category');
462:     $categories     = array();
463:     $all_categories = $cat_handler->getObjects(null, true, false);
464:     $count_fields   = count($fields);
465: 
466:     foreach (array_keys($fields) as $i) {
467:         if (in_array($fields[$i]->getVar('field_id'), $editable_fields)) {
468:             // Set default value for user fields if available
469:             if ($user->isNew()) {
470:                 $default = $fields[$i]->getVar('field_default');
471:                 if ($default !== '' && $default !== null) {
472:                     $user->setVar($fields[$i]->getVar('field_name'), $default);
473:                 }
474:             }
475: 
476:             if ($profile->getVar($fields[$i]->getVar('field_name'), 'n') === null) {
477:                 $default = $fields[$i]->getVar('field_default', 'n');
478:                 $profile->setVar($fields[$i]->getVar('field_name'), $default);
479:             }
480: 
481:             $fieldinfo['element']  = $fields[$i]->getEditElement($user, $profile);
482:             $fieldinfo['required'] = $fields[$i]->getVar('field_required');
483: 
484:             $key              = @$all_categories[$fields[$i]->getVar('cat_id')]['cat_weight'] * $count_fields + $fields[$i]->getVar('cat_id');
485:             $elements[$key][] = $fieldinfo;
486:             $weights[$key][]  = $fields[$i]->getVar('field_weight');
487:             $categories[$key] = @$all_categories[$fields[$i]->getVar('cat_id')];
488:         }
489:     }
490: 
491:     if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser']->isAdmin()) {
492:         xoops_loadLanguage('admin', 'profile');
493:         /* @var  $gperm_handler XoopsGroupPermHandler */
494:         $gperm_handler = xoops_getHandler('groupperm');
495:         //If user has admin rights on groups
496:         include_once $GLOBALS['xoops']->path('modules/system/constants.php');
497:         if ($gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_GROUP, $GLOBALS['xoopsUser']->getGroups(), 1)) {
498:             //add group selection
499:             $group_select  = new XoopsFormSelectGroup(_US_GROUPS, 'groups', false, $user->getGroups(), 5, true);
500:             $elements[0][] = array('element' => $group_select, 'required' => 0);
501:             //set as latest;
502:             $weights[0][] = $count_fields + 1;
503:         }
504:     }
505: 
506:     ksort($elements);
507:     foreach (array_keys($elements) as $k) {
508:         array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
509:         $title = isset($categories[$k]) ? $categories[$k]['cat_title'] : _PROFILE_MA_DEFAULT;
510:         $desc  = isset($categories[$k]) ? $categories[$k]['cat_description'] : '';
511:         $form->addElement(new XoopsFormLabel("<h3>{$title}</h3>", $desc), false);
512:         foreach (array_keys($elements[$k]) as $i) {
513:             $form->addElement($elements[$k][$i]['element'], $elements[$k][$i]['required']);
514:         }
515:     }
516: 
517:     $form->addElement(new XoopsFormHidden('uid', $user->getVar('uid')));
518:     $form->addElement(new XoopsFormButton('', 'submit', _US_SAVECHANGES, 'submit'));
519: 
520:     return $form;
521: }
522: 
523: /**
524:  * Get {@link XoopsThemeForm} for editing a step
525:  *
526:  * @param ProfileRegstep|null $step {@link ProfileRegstep} to edit
527:  * @param bool                $action
528:  *
529:  * @return object
530:  */
531: function profile_getStepForm(ProfileRegstep $step = null, $action = false)
532: {
533:     if ($action === false) {
534:         $action = $_SERVER['REQUEST_URI'];
535:     }
536:     if (empty($GLOBALS['xoopsConfigUser'])) {
537:         /* @var $config_handler XoopsConfigHandler  */
538:         $config_handler             = xoops_getHandler('config');
539:         $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
540:     }
541:     include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
542: 
543:     $form = new XoopsThemeForm(_PROFILE_AM_STEP, 'stepform', 'step.php', 'post', true);
544: 
545:     if (!$step->isNew()) {
546:         $form->addElement(new XoopsFormHidden('id', $step->getVar('step_id')));
547:     }
548:     $form->addElement(new XoopsFormHidden('op', 'save'));
549:     $form->addElement(new XoopsFormText(_PROFILE_AM_STEPNAME, 'step_name', 25, 255, $step->getVar('step_name', 'e')));
550:     $form->addElement(new XoopsFormText(_PROFILE_AM_STEPINTRO, 'step_desc', 25, 255, $step->getVar('step_desc', 'e')));
551:     $form->addElement(new XoopsFormText(_PROFILE_AM_STEPORDER, 'step_order', 10, 10, $step->getVar('step_order', 'e')));
552:     $form->addElement(new XoopsFormRadioYN(_PROFILE_AM_STEPSAVE, 'step_save', $step->getVar('step_save', 'e')));
553:     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
554: 
555:     return $form;
556: }
557: 
API documentation generated by ApiGen