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:  You may not change or alter any portion of this comment or credits
  4:  of supporting developers from this source code or any supporting source code
  5:  which is considered copyrighted (c) material of the original comment or credit authors.
  6: 
  7:  This program is distributed in the hope that it will be useful,
  8:  but WITHOUT ANY WARRANTY; without even the implied warranty of
  9:  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 10:  */
 11: 
 12: namespace Xmf\Module;
 13: 
 14: use Xmf\Language;
 15: 
 16: /**
 17:  * Xmf\Module\Admin provides helpful methods for module administration
 18:  * uses.
 19:  *
 20:  * Xmf\Module\Admin provides a method compatible subset of the Xoops\Module\Admin class
 21:  * (introduced in 2.6) and other convenience methods useful in transition
 22:  *
 23:  * @category  Xmf\Module\Admin
 24:  * @package   Xmf
 25:  * @author    Richard Griffith <richard@geekwright.com>
 26:  * @copyright 2011-2016 XOOPS Project (http://xoops.org)
 27:  * @license   GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 28:  * @link      http://xoops.org
 29:  */
 30: class Admin
 31: {
 32: 
 33:     /**
 34:      * The real ModuleAdmin object
 35:      *
 36:      * @var object
 37:      */
 38:     protected static $ModuleAdmin = null;
 39:     protected $lastInfoBoxTitle = null;
 40:     protected static $paypal = '';
 41: 
 42:     /**
 43:      * Constructor
 44:      */
 45:     protected function __construct()
 46:     {
 47:     }
 48: 
 49:     /**
 50:      * Retrieve a module admin instance
 51:      *
 52:      * If we are on a next generation system this will be the a native Xoops\Module\Admin instance.
 53:      * Older systems with the Frameworks based admin class will get an instance of this class which
 54:      * provides compatible methods built from the old Frameworks version.
 55:      *
 56:      * @return object a ModuleAdmin or Xoops\Module\Admin instance.
 57:      */
 58:     public static function getInstance()
 59:     {
 60: 
 61:         static $instance;
 62: 
 63:         if ($instance === null) {
 64:             if (class_exists('\Xoops\Module\Admin', true)) {
 65:                 $instance = new \Xoops\Module\Admin;
 66:                 static::$ModuleAdmin = $instance;
 67:             } else {
 68:                 include_once $GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php');
 69:                 static::$ModuleAdmin = new \ModuleAdmin;
 70:                 Language::load('xmf');
 71:                 $instance = new static();
 72:             }
 73:         }
 74: 
 75:         return $instance;
 76:     }
 77: 
 78:     /**
 79:      * Add config line
 80:      *
 81:      * @param string $value message to include in config box
 82:      * @param string $type  type of line to add
 83:      *                       minimal set of acceptable types and value expectation
 84:      *                       'default' - value is message displayed directly (also used for unknown types)
 85:      *                       'folder'  - value is directory name, will display accept if exists, error if not
 86:      *                       'chmod'   - value is array(directory, permission) accept if exists with permission,
 87:      *                                   else error
 88:      *                       'module'  - value is string module name, or array(module name, errortype)
 89:      *                                   If module is active, an accept line displays, otherwise, a warning
 90:      *                                   (if value is array(module, "warning") or an error displays.
 91:      *
 92:      * @return bool
 93:      */
 94:     public function addConfigBoxLine($value = '', $type = 'default')
 95:     {
 96:         if ($type === 'module') {
 97:             $mod = (is_array($value)) ? $value[0] : $value;
 98:             if (xoops_isActiveModule($mod)) {
 99:                 return $this->addConfigAccept(sprintf(_AM_XMF_MODULE_INSTALLED, $mod));
100:             } else {
101:                 $nomod = (is_array($value)) ? $value[1] : 'error';
102:                 $line = sprintf(_AM_XMF_MODULE_NOT_INSTALLED, $mod);
103:                 if ($nomod === 'warning') {
104:                     return $this->addConfigWarning($line);
105:                 } else {
106:                     return $this->addConfigError($line);
107:                 }
108:             }
109:         }
110:         return static::$ModuleAdmin->addConfigBoxLine($value, $type);
111:     }
112: 
113:     /**
114:      * Add Info box
115:      *
116:      * @param string $title info box title
117:      * @param string $type  for compatibility only
118:      * @param string $extra for compatibility only
119:      *
120:      * @return bool
121:      */
122:     public function addInfoBox($title, $type = 'default', $extra = '')
123:     {
124:         $this->lastInfoBoxTitle = $title;
125: 
126:         return static::$ModuleAdmin->addInfoBox($title);
127:     }
128: 
129:     /**
130:      * Add line to the info box
131:      *
132:      * @param string $text  text to add to info box
133:      * @param string $type  type of infobox line
134:      * @param string $color color for infobox line
135:      *
136:      * @return bool
137:      */
138:     public function addInfoBoxLine($text = '', $type = 'default', $color = 'inherit')
139:     {
140:         return static::$ModuleAdmin->addInfoBoxLine(
141:             $this->lastInfoBoxTitle,
142:             $text,
143:             '',
144:             $color,
145:             $type
146:         );
147:     }
148: 
149:     /**
150:      * Add Item button
151:      *
152:      * @param string $title title of button
153:      * @param string $link  link for button
154:      * @param string $icon  icon for button
155:      * @param string $extra extra
156:      *
157:      * @return bool
158:      */
159:     public function addItemButton($title, $link, $icon = 'add', $extra = '')
160:     {
161:         return static::$ModuleAdmin->addItemButton($title, $link, $icon, $extra);
162:     }
163: 
164:     /**
165:      * Render all items buttons
166:      *
167:      * @param string $position  button position (left, right)
168:      * @param string $delimiter delimiter between buttons
169:      *
170:      * @return string
171:      */
172:     public function renderButton($position = null, $delimiter = "&nbsp;")
173:     {
174:         if (null === $position) {
175:             $position = 'right';
176:         }
177: 
178:         return static::$ModuleAdmin->renderButton($position, $delimiter);
179:     }
180: 
181:     /**
182:      * Display all item buttons
183:      *
184:      * @param string $position  button position (left, right)
185:      * @param string $delimiter delimiter between buttons
186:      *
187:      * @return void
188:      */
189:     public function displayButton($position = null, $delimiter = "&nbsp;")
190:     {
191:         echo $this->renderButton($position, $delimiter);
192:     }
193: 
194:     /**
195:      * Render InfoBox
196:      *
197:      * @return string HTML rendered info box
198:      */
199:     public function renderInfoBox()
200:     {
201:         return static::$ModuleAdmin->renderInfoBox();
202:     }
203: 
204:     /**
205:      * Display InfoBox
206:      *
207:      * @return void
208:      */
209:     public function displayInfoBox()
210:     {
211:         echo $this->renderInfoBox();
212:     }
213: 
214:     /**
215:      * Render index page for admin
216:      *
217:      * @return string HTML rendered info box
218:      */
219:     public function renderIndex()
220:     {
221:         return static::$ModuleAdmin->renderIndex();
222:     }
223: 
224:     /**
225:      * Display index page for admin
226:      *
227:      * @return void
228:      */
229:     public function displayIndex()
230:     {
231:         echo $this->renderIndex();
232:     }
233: 
234:     /**
235:      * Display the navigation menu
236:      *
237:      * @param string $menu menu key (script name, i.e. index.php)
238:      *
239:      * @return void
240:      */
241:     public function displayNavigation($menu = '')
242:     {
243:         echo static::$ModuleAdmin->addNavigation($menu);
244:     }
245: 
246:     /**
247:      * Render about page
248:      *
249:      * @param bool $logo_xoops display XOOPS logo
250:      *
251:      * @return bool|mixed|string
252:      */
253:     public function renderAbout($logo_xoops = true)
254:     {
255:         return static::$ModuleAdmin->renderAbout(static::$paypal, $logo_xoops);
256:     }
257: 
258:     /**
259:      * Display about page
260:      *
261:      * @param bool $logo_xoops display XOOPS logo
262:      *
263:      * @return void
264:      */
265:     public function displayAbout($logo_xoops = true)
266:     {
267:         echo $this->renderAbout($logo_xoops);
268:     }
269: 
270:     /**
271:      * Add error to config box
272:      *
273:      * @param string $value the error message
274:      *
275:      * @return bool
276:      */
277:     public function addConfigError($value = '')
278:     {
279:         $path = XOOPS_URL . '/Frameworks/moduleclasses/icons/16/';
280:         $line = "";
281:         $line .= "<span style='color : red; font-weight : bold;'>";
282:         $line .= "<img src='" . $path . "0.png' >";
283:         $line .= $value;
284:         $line .= "</span>";
285:         $value = $line;
286:         $type = 'default';
287: 
288:         return static::$ModuleAdmin->addConfigBoxLine($value, $type);
289:     }
290: 
291:     /**
292:      * Add accept (OK) message to config box
293:      *
294:      * @param string $value the OK message
295:      *
296:      * @return bool
297:      */
298:     public function addConfigAccept($value = '')
299:     {
300:         $path = XOOPS_URL . '/Frameworks/moduleclasses/icons/16/';
301:         $line = "";
302:         $line .= "<span style='color : green;'>";
303:         $line .= "<img src='" . $path . "1.png' >";
304:         $line .= $value;
305:         $line .= "</span>";
306:         $value = $line;
307:         $type = 'default';
308: 
309:         return static::$ModuleAdmin->addConfigBoxLine($value, $type);
310:     }
311: 
312:     /**
313:      * Add warning to config box
314:      *
315:      * @param string $value the warning message
316:      *
317:      * @return bool
318:      */
319:     public function addConfigWarning($value = '')
320:     {
321:         $path = XOOPS_URL . '/Frameworks/moduleclasses/icons/16/';
322:         $line = "";
323:         $line .= "<span style='color : orange; font-weight : bold;'>";
324:         $line .= "<img src='" . $path . "warning.png' >";
325:         $line .= $value;
326:         $line .= "</span>";
327:         $value = $line;
328:         $type = 'default';
329: 
330:         return static::$ModuleAdmin->addConfigBoxLine($value, $type);
331:     }
332: 
333: 
334:     /**
335:      * Check for installed module and version and do addConfigBoxLine()
336:      *
337:      * @param string  $moddir     - module directory name
338:      * @param integer $minversion - minimum acceptable module version (100 = V1.00)
339:      *
340:      * @return bool true if requested version of the module is available
341:      */
342:     public function addConfigModuleVersion($moddir, $minversion)
343:     {
344:         $return = false;
345:         $helper = Helper::getHelper($moddir);
346:         if (is_object($helper) && is_object($helper->getModule())) {
347:             $mod_modversion = $helper->getModule()->getVar('version');
348:             $mod_version_f = $mod_modversion / 100;
349:             $min_version_f = $minversion / 100;
350:             $value = sprintf(
351:                 _AM_XMF_MODULE_VERSION,
352:                 strtoupper($moddir),
353:                 $min_version_f,
354:                 $mod_version_f
355:             );
356:             if ($mod_modversion >= $minversion) {
357:                 $this->addConfigAccept($value);
358:                 $return = true;
359:             } else {
360:                 $this->addConfigError($value);
361:             }
362:         } else {
363:             $value = sprintf(
364:                 _AM_XMF_MODULE_NOTFOUND,
365:                 strtoupper($moddir),
366:                 $minversion / 100
367:             );
368:             $this->addConfigError($value);
369:         }
370: 
371:         return $return;
372:     }
373: 
374:     // the following not part of next generation Xoops\Module\Admin
375: 
376:     /**
377:      * Are we in a next generation environment?
378:      *
379:      * not part of next generation Xoops\Module\Admin
380:      *
381:      * @return bool true if we are in a post XOOPS 2.5.x environment
382:      */
383:     protected static function isXng()
384:     {
385:         return class_exists('\Xoops', false);
386:     }
387: 
388:     /**
389:      * Get an appropriate imagePath for menu.php use.
390:      *
391:      * just to help with other admin things than ModuleAdmin
392:      *
393:      * not part of next generation Xoops\Module\Admin
394:      *
395:      * @param string $image icon name to prepend with path
396:      *
397:      * @return string the icon path
398:      */
399:     public static function menuIconPath($image)
400:     {
401:         if (static::isXng()) {
402:             return($image);
403:         } else {
404:             $path = '../../Frameworks/moduleclasses/icons/32/';
405: 
406:             return($path . $image);
407:         }
408:     }
409: 
410:     /**
411:      * Get an appropriate URL for system provided icons.
412:      *
413:      * Things which were in Frameworks in 2.5 are in media in later versions,
414:      * making it harder to use and rely on the standard icons.
415:      *
416:      * not part of next generation Xoops\Module\Admin
417:      *
418:      * @param string $name the image name to provide URL for, or blank
419:      *                     to just get the URL path.
420:      * @param string $size the icon size (directory). Valid values are
421:      *                     16, 32 or /. A '/' slash will simply set the
422:      *                     path to the icon directory and append $image.
423:      *
424:      * @return string path to icons
425:      */
426:     public static function iconUrl($name = '', $size = '32')
427:     {
428:         switch ($size) {
429:             case '16':
430:                 $path = '16/';
431:                 break;
432:             case '/':
433:                 $path = '';
434:                 break;
435:             case '32':
436:             default:
437:                 $path = '32/';
438:                 break;
439:         }
440: 
441:         if (static::isXng()) {
442:             $path = '/media/xoops/images/icons/' . $path;
443:         } else {
444:             $path = '/Frameworks/moduleclasses/icons/' . $path;
445:         }
446: 
447:         return(XOOPS_URL . $path . $name);
448:     }
449: 
450:     /**
451:      * set paypal for 2.5.x renderAbout
452:      *
453:      * not part of next generation Xoops\Module\Admin
454:      *
455:      * @param string $paypal PayPal identifier for donate button
456:      *
457:      * @return void
458:      */
459:     public static function setPaypal($paypal = '')
460:     {
461:         static::$paypal = $paypal;
462:     }
463: }
464: 
API documentation generated by ApiGen