Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • ArtObject
  • ArtObjectHandler
  • Avatars
  • AvatarsAvatar
  • AvatarsAvatar_userForm
  • AvatarsAvatarForm
  • AvatarsAvatarHandler
  • AvatarsLocale
  • AvatarsLocaleEn_US
  • AvatarsPreload
  • AvatarsProvider
  • AvatarsUserlink
  • AvatarsUserlinkHandler
  • AwesomeButton
  • BannerRender
  • Banners
  • BannersBanner
  • BannersBannerclient
  • BannersBannerclientForm
  • BannersBannerclientHandler
  • BannersBannerForm
  • BannersBannerHandler
  • BannersPreload
  • BloggerApi
  • CodexMenusPlugin
  • CodexSearchPlugin
  • CodexSystemPlugin
  • CodexUserconfigsPlugin
  • Comments
  • CommentsComment
  • CommentsCommentForm
  • CommentsCommentHandler
  • CommentsCommentRenderer
  • CommentsPreload
  • CommentsSystemPlugin
  • CommentsUserconfigsPlugin
  • Cookie
  • CountryFlagProvider
  • Criteria
  • CriteriaCompo
  • CriteriaElement
  • DebugbarLogger
  • DebugbarPreload
  • DebugbarUserconfigsPlugin
  • DefaultThemeLocale
  • DefaultThemeLocaleEn_US
  • FormDhtmlTextArea
  • FormTextArea
  • GravatarsPreload
  • GravatarsProvider
  • htmLawed
  • HtmlToPdfProvider
  • imageLib
  • Images
  • ImagesCategory
  • ImagesCategory_imagemanagerForm
  • ImagesCategoryForm
  • ImagesCategoryHandler
  • ImagesCategoryselectForm
  • ImagesImage
  • ImagesImage_Body
  • ImagesImage_imagemanagerForm
  • ImagesImagebody
  • ImagesImagebodyHandler
  • ImagesImageForm
  • ImagesImageHandler
  • ImagesPreload
  • JUpload
  • LegacyLogger
  • LoggerPreload
  • LoggerUserconfigsPlugin
  • Maintenance
  • MaintenanceMaintenanceForm
  • Menus
  • MenusBuilder
  • MenusConstantDecorator
  • MenusDecorator
  • MenusDecoratorAbstract
  • MenusDefaultDecorator
  • MenusDynamicDecorator
  • MenusMenu
  • MenusMenuHandler
  • MenusMenus
  • MenusMenus_menuForm
  • MenusMenus_menusForm
  • MenusMenusHandler
  • MenusPreload
  • MenusSmartyDecorator
  • MetaWeblogApi
  • MonologLogger
  • MonologPreload
  • MonologUserconfigsPlugin
  • MovableTypeApi
  • MyTextSanitizer
  • MyTextSanitizerExtended
  • Notifications
  • NotificationsNotification
  • NotificationsNotificationHandler
  • NotificationsPreload
  • NotificationsSystemPlugin
  • Page
  • PageCommentsPlugin
  • PageGroupPermHandler
  • PageLocale
  • PageLocaleEn_US
  • PageNotificationsPlugin
  • PagePage_content
  • PagePage_contentForm
  • PagePage_contentHandler
  • PagePage_rating
  • PagePage_ratingHandler
  • PagePage_related
  • PagePage_related_link
  • PagePage_related_linkHandler
  • PagePage_relatedForm
  • PagePage_relatedHandler
  • PagePreload
  • PageSearchPlugin
  • PageSystemPlugin
  • PdfPreload
  • PmMessage
  • PmMessageHandler
  • PmPreload
  • ProfileCategory
  • ProfileCategoryForm
  • ProfileCategoryHandler
  • ProfileCorePreload
  • ProfileField
  • ProfileFieldForm
  • ProfileFieldHandler
  • ProfileMenusPlugin
  • ProfileProfile
  • ProfileProfileHandler
  • ProfileRegstep
  • ProfileRegstepForm
  • 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_need_multibyte
  • protector_postcommon_post_register_moratorium
  • protector_postcommon_register_insert_js_check
  • 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
  • ProtectorCenterForm
  • ProtectorCorePreload
  • ProtectorFilterAbstract
  • ProtectorFilterHandler
  • ProtectorMySQLDatabase
  • Publisher
  • PublisherBlockForm
  • PublisherCategory
  • PublisherCategoryForm
  • PublisherCategoryHandler
  • PublisherCommentsPlugin
  • PublisherFile
  • PublisherFileForm
  • PublisherFileHandler
  • PublisherFormDateTime
  • PublisherGroupPermHandler
  • PublisherItem
  • PublisherItemForm
  • PublisherItemHandler
  • PublisherMenusPlugin
  • PublisherMetagen
  • PublisherMimetype
  • PublisherMimetypeHandler
  • PublisherNotificationsPlugin
  • PublisherPermissionHandler
  • PublisherPreload
  • PublisherRating
  • PublisherRatingHandler
  • PublisherSearchPlugin
  • PublisherSystemPlugin
  • PublisherUtils
  • QrcodePreload
  • QrcodeProvider
  • 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
  • Search
  • SearchPreload
  • SearchSearchForm
  • Smarty_Resource_Admin
  • Smarty_Resource_Block
  • Smarty_Resource_Db
  • Smarty_Resource_Module
  • Smilies
  • SmiliesPreload
  • SmiliesProvider
  • SmiliesSmiley
  • SmiliesSmileyHandler
  • SmiliesSmiliesForm
  • Snoopy
  • SqlUtility
  • System
  • SystemBlockForm
  • SystemBreadcrumb
  • SystemExtension
  • SystemGroupForm
  • SystemLocale
  • SystemLocaleEn_US
  • SystemMenuHandler
  • SystemModule
  • SystemPreferencesForm
  • SystemPreload
  • SystemUserForm
  • tar
  • ThemeSetAuthorHandler
  • ThemeSetDateCreatedHandler
  • ThemeSetDescriptionHandler
  • ThemeSetEmailHandler
  • ThemeSetFileTypeHandler
  • ThemeSetGeneratorHandler
  • ThemeSetImageHandler
  • ThemeSetLinkHandler
  • ThemeSetModuleHandler
  • ThemeSetNameHandler
  • ThemeSetTagHandler
  • ThemeSetTemplateHandler
  • Thumbs
  • ThumbsPreload
  • ThumbsProvider
  • TinyMCE
  • Userconfigs
  • UserconfigsConfigHandler
  • UserconfigsConfigsForm
  • UserconfigsItem
  • UserconfigsItemHandler
  • UserconfigsMenusPlugin
  • UserconfigsModulesForm
  • UserconfigsOption
  • UserconfigsOptionHandler
  • UserconfigsPreload
  • UserconfigsSystemPlugin
  • UserrankPreload
  • UserRankProvider
  • UserrankRank
  • UserrankRankHandler
  • UserrankRanksForm
  • Xcaptcha
  • XcaptchaCaptchaForm
  • XcaptchaImage
  • XcaptchaImageForm
  • XcaptchaRecaptcha
  • XcaptchaRecaptchaForm
  • XcaptchaText
  • XcaptchaTextForm
  • Xlanguage
  • XlanguageLanguage
  • XlanguageLanguageForm
  • XlanguagePreload
  • XlanguageTinymceForm
  • XlanguageXlanguageHandler
  • Xmf\Database\TableLoad
  • Xmf\Database\Tables
  • Xmf\Debug
  • Xmf\FilterInput
  • Xmf\Highlighter
  • Xmf\Language
  • Xmf\Loader
  • Xmf\Metagen
  • Xmf\Module\Admin
  • Xmf\Module\Cache
  • Xmf\Module\Helper
  • Xmf\Module\Helper\AbstractHelper
  • Xmf\Module\Helper\GenericHelper
  • Xmf\Module\Permission
  • Xmf\Module\Session
  • Xmf\Request
  • Xmf\Template\AbstractTemplate
  • Xmf\Template\Breadcrumb
  • Xmf\Template\Buttonbox
  • Xmf\Template\Feed
  • Xmf\Template\PrintContent
  • Xmf\Utilities
  • Xmf\Yaml
  • XmfPreload
  • XmlTagHandler
  • Xoops
  • Xoops\Auth\Ads
  • Xoops\Auth\AuthAbstract
  • Xoops\Auth\Factory
  • Xoops\Auth\Ldap
  • Xoops\Auth\Provisioning
  • Xoops\Auth\Xoops
  • Xoops\Cache
  • Xoops\Core\Assets
  • Xoops\Core\Cache\Access
  • Xoops\Core\Cache\CacheManager
  • Xoops\Core\Cache\DriverList
  • Xoops\Core\Cache\Legacy
  • Xoops\Core\ComposerUtility
  • Xoops\Core\Database\Connection
  • Xoops\Core\Database\Factory
  • Xoops\Core\Database\Logging\XoopsDebugStack
  • Xoops\Core\Database\QueryBuilder
  • Xoops\Core\Database\Schema\ExportVisitor
  • Xoops\Core\Database\Schema\ImportSchema
  • Xoops\Core\Database\Schema\PrefixStripper
  • Xoops\Core\Database\Schema\RemovePrefixes
  • Xoops\Core\Events
  • Xoops\Core\FilterInput
  • Xoops\Core\FixedGroups
  • Xoops\Core\Handler\Factory
  • Xoops\Core\Handler\FactorySpec
  • Xoops\Core\Handler\Scheme\FQN
  • Xoops\Core\Handler\Scheme\Kernel
  • Xoops\Core\Handler\Scheme\LegacyModule
  • Xoops\Core\HttpRequest
  • Xoops\Core\Kernel\Criteria
  • Xoops\Core\Kernel\CriteriaCompo
  • Xoops\Core\Kernel\CriteriaElement
  • Xoops\Core\Kernel\Dtype
  • Xoops\Core\Kernel\Dtype\DtypeAbstract
  • Xoops\Core\Kernel\Dtype\DtypeArray
  • Xoops\Core\Kernel\Dtype\DtypeDateTime
  • Xoops\Core\Kernel\Dtype\DtypeDecimal
  • Xoops\Core\Kernel\Dtype\DtypeEmail
  • Xoops\Core\Kernel\Dtype\DtypeEnumeration
  • Xoops\Core\Kernel\Dtype\DtypeFloat
  • Xoops\Core\Kernel\Dtype\DtypeInt
  • Xoops\Core\Kernel\Dtype\DtypeJson
  • Xoops\Core\Kernel\Dtype\DtypeMoney
  • Xoops\Core\Kernel\Dtype\DtypeOther
  • Xoops\Core\Kernel\Dtype\DtypeSimpleTime
  • Xoops\Core\Kernel\Dtype\DtypeSource
  • Xoops\Core\Kernel\Dtype\DtypeTextArea
  • Xoops\Core\Kernel\Dtype\DtypeTextBox
  • Xoops\Core\Kernel\Dtype\DtypeTimeZone
  • Xoops\Core\Kernel\Dtype\DtypeUrl
  • Xoops\Core\Kernel\Handlers\XoopsBlock
  • Xoops\Core\Kernel\Handlers\XoopsBlockHandler
  • Xoops\Core\Kernel\Handlers\XoopsBlockModuleLink
  • Xoops\Core\Kernel\Handlers\XoopsBlockModuleLinkHandler
  • Xoops\Core\Kernel\Handlers\XoopsConfigHandler
  • Xoops\Core\Kernel\Handlers\XoopsConfigItem
  • Xoops\Core\Kernel\Handlers\XoopsConfigItemHandler
  • Xoops\Core\Kernel\Handlers\XoopsConfigOption
  • Xoops\Core\Kernel\Handlers\XoopsConfigOptionHandler
  • Xoops\Core\Kernel\Handlers\XoopsGroup
  • Xoops\Core\Kernel\Handlers\XoopsGroupHandler
  • Xoops\Core\Kernel\Handlers\XoopsGroupPerm
  • Xoops\Core\Kernel\Handlers\XoopsGroupPermHandler
  • Xoops\Core\Kernel\Handlers\XoopsMemberHandler
  • Xoops\Core\Kernel\Handlers\XoopsMembership
  • Xoops\Core\Kernel\Handlers\XoopsMembershipHandler
  • Xoops\Core\Kernel\Handlers\XoopsModule
  • Xoops\Core\Kernel\Handlers\XoopsModuleHandler
  • Xoops\Core\Kernel\Handlers\XoopsOnline
  • Xoops\Core\Kernel\Handlers\XoopsOnlineHandler
  • Xoops\Core\Kernel\Handlers\XoopsPrivateMessage
  • Xoops\Core\Kernel\Handlers\XoopsPrivateMessageHandler
  • Xoops\Core\Kernel\Handlers\XoopsTplFile
  • Xoops\Core\Kernel\Handlers\XoopsTplFileHandler
  • Xoops\Core\Kernel\Handlers\XoopsTplSet
  • Xoops\Core\Kernel\Handlers\XoopsTplSetHandler
  • Xoops\Core\Kernel\Handlers\XoopsUser
  • Xoops\Core\Kernel\Handlers\XoopsUserHandler
  • Xoops\Core\Kernel\Model\Joint
  • Xoops\Core\Kernel\Model\Read
  • Xoops\Core\Kernel\Model\Stats
  • Xoops\Core\Kernel\Model\Sync
  • Xoops\Core\Kernel\Model\Write
  • Xoops\Core\Kernel\XoopsModelAbstract
  • Xoops\Core\Kernel\XoopsModelFactory
  • Xoops\Core\Kernel\XoopsObject
  • Xoops\Core\Kernel\XoopsObjectHandler
  • Xoops\Core\Kernel\XoopsPersistableObjectHandler
  • Xoops\Core\Lists\Country
  • Xoops\Core\Lists\Directory
  • Xoops\Core\Lists\Editor
  • Xoops\Core\Lists\File
  • Xoops\Core\Lists\HtmlFile
  • Xoops\Core\Lists\ImageFile
  • Xoops\Core\Lists\ListAbstract
  • Xoops\Core\Lists\Locale
  • Xoops\Core\Lists\Module
  • Xoops\Core\Lists\Month
  • Xoops\Core\Lists\SubjectIcon
  • Xoops\Core\Lists\SubSet
  • Xoops\Core\Lists\Theme
  • Xoops\Core\Lists\Time
  • Xoops\Core\Lists\TimeZone
  • Xoops\Core\Locale\LegacyCodes
  • Xoops\Core\Locale\Punic\Calendar
  • Xoops\Core\Locale\Time
  • Xoops\Core\Logger
  • Xoops\Core\MediaUploader
  • Xoops\Core\MimeTypes
  • Xoops\Core\PreloadItem
  • Xoops\Core\Psr0ClassLoader
  • Xoops\Core\Psr4ClassLoader
  • Xoops\Core\Random
  • Xoops\Core\Registry
  • Xoops\Core\Request
  • Xoops\Core\Security
  • Xoops\Core\Service\AbstractContract
  • Xoops\Core\Service\Manager
  • Xoops\Core\Service\NullProvider
  • Xoops\Core\Service\Provider
  • Xoops\Core\Service\Response
  • Xoops\Core\Session\Fingerprint
  • Xoops\Core\Session\Handler
  • Xoops\Core\Session\Manager
  • Xoops\Core\Session\RememberMe
  • Xoops\Core\Session\SessionUser
  • Xoops\Core\Text\Sanitizer
  • Xoops\Core\Text\Sanitizer\Configuration
  • Xoops\Core\Text\Sanitizer\ConfigurationAbstract
  • Xoops\Core\Text\Sanitizer\DefaultConfiguration
  • Xoops\Core\Text\Sanitizer\ExtensionAbstract
  • Xoops\Core\Text\Sanitizer\Extensions\Censor
  • Xoops\Core\Text\Sanitizer\Extensions\Clickable
  • Xoops\Core\Text\Sanitizer\Extensions\Embed
  • Xoops\Core\Text\Sanitizer\Extensions\Flash
  • Xoops\Core\Text\Sanitizer\Extensions\Iframe
  • Xoops\Core\Text\Sanitizer\Extensions\Image
  • Xoops\Core\Text\Sanitizer\Extensions\Mms
  • Xoops\Core\Text\Sanitizer\Extensions\Mp3
  • Xoops\Core\Text\Sanitizer\Extensions\Quote
  • Xoops\Core\Text\Sanitizer\Extensions\Rtsp
  • Xoops\Core\Text\Sanitizer\Extensions\SoundCloud
  • Xoops\Core\Text\Sanitizer\Extensions\SyntaxHighlight
  • Xoops\Core\Text\Sanitizer\Extensions\TextFilter
  • Xoops\Core\Text\Sanitizer\Extensions\UnorderedList
  • Xoops\Core\Text\Sanitizer\Extensions\Wiki
  • Xoops\Core\Text\Sanitizer\Extensions\Wmp
  • Xoops\Core\Text\Sanitizer\Extensions\XoopsCode
  • Xoops\Core\Text\Sanitizer\Extensions\Xss
  • Xoops\Core\Text\Sanitizer\Extensions\YouTube
  • Xoops\Core\Text\Sanitizer\FilterAbstract
  • Xoops\Core\Text\Sanitizer\NullExtension
  • Xoops\Core\Text\Sanitizer\NullFilter
  • Xoops\Core\Text\Sanitizer\SanitizerComponent
  • Xoops\Core\Text\Sanitizer\SanitizerConfigurable
  • Xoops\Core\Text\ShortCodes
  • Xoops\Core\Theme\AdminFactory
  • Xoops\Core\Theme\Factory
  • Xoops\Core\Theme\NullTheme
  • Xoops\Core\Theme\PluginAbstract
  • Xoops\Core\Theme\Plugins\Blocks
  • Xoops\Core\Theme\XoopsTheme
  • Xoops\Core\XoopsTpl
  • Xoops\Core\Yaml
  • Xoops\Form\BlockForm
  • Xoops\Form\Button
  • Xoops\Form\ButtonTray
  • Xoops\Form\Captcha
  • Xoops\Form\Checkbox
  • Xoops\Form\ColorPicker
  • Xoops\Form\DateSelect
  • Xoops\Form\DateTime
  • Xoops\Form\DhtmlTextArea
  • Xoops\Form\Editor
  • Xoops\Form\Element
  • Xoops\Form\ElementFactory
  • Xoops\Form\ElementTray
  • Xoops\Form\File
  • Xoops\Form\Form
  • Xoops\Form\GroupCheckbox
  • Xoops\Form\GroupFormCheckbox
  • Xoops\Form\GroupPermissionForm
  • Xoops\Form\Hidden
  • Xoops\Form\Label
  • Xoops\Form\Mail
  • Xoops\Form\OptionElement
  • Xoops\Form\Password
  • Xoops\Form\Radio
  • Xoops\Form\RadioYesNo
  • Xoops\Form\Raw
  • Xoops\Form\Select
  • Xoops\Form\SelectCountry
  • Xoops\Form\SelectEditor
  • Xoops\Form\SelectGroup
  • Xoops\Form\SelectLanguage
  • Xoops\Form\SelectLocale
  • Xoops\Form\SelectMatchOption
  • Xoops\Form\SelectTheme
  • Xoops\Form\SelectTimeZone
  • Xoops\Form\SelectUser
  • Xoops\Form\SimpleForm
  • Xoops\Form\Tab
  • Xoops\Form\TableForm
  • Xoops\Form\TabTray
  • Xoops\Form\Text
  • Xoops\Form\TextArea
  • Xoops\Form\ThemeForm
  • Xoops\Form\Token
  • Xoops\Form\Url
  • Xoops\Html\Attributes
  • Xoops\Html\Img
  • Xoops\Locale
  • Xoops\Locale\AbstractLocale
  • Xoops\Module\Admin
  • Xoops\Module\Helper
  • Xoops\Module\Helper\Dummy
  • Xoops\Module\Helper\HelperAbstract
  • Xoops\Module\Plugin
  • Xoops\Module\Plugin\ConfigCollector
  • Xoops\Module\Plugin\PluginAbstract
  • Xoops\Utils
  • Xoops_Locale_Mailer_Abstract
  • XoopsAdminThemeFactory
  • XoopsApi
  • XoopsArt
  • XoopsBaseConfig
  • XoopsBlock
  • XoopsBlockHandler
  • XoopsBlockmodulelink
  • XoopsBlockmodulelinkHandler
  • XoopsCache
  • XoopsCaptcha
  • XoopsCaptchaImage
  • XoopsCaptchaImageHandler
  • XoopsCaptchaMethod
  • XoopsCaptchaRecaptcha
  • XoopsCaptchaText
  • XoopsConfigHandler
  • XoopsConfigItem
  • XoopsConfigItemHandler
  • XoopsConfigOption
  • XoopsConfigOptionHandler
  • XoopsDatabase
  • XoopsDatabaseFactory
  • XoopsDatabaseManager
  • XoopsDownloader
  • XoopsEditor
  • XoopsEditorHandler
  • XoopsFile
  • XoopsFileHandler
  • XoopsFilterInput
  • XoopsFolderHandler
  • XoopsForm
  • XoopsFormButton
  • XoopsFormButtonTray
  • XoopsFormCaptcha
  • XoopsFormCheckBox
  • XoopsFormColorPicker
  • XoopsFormDateTime
  • XoopsFormDhtmlTextArea
  • XoopsFormEditor
  • XoopsFormElement
  • XoopsFormElementTray
  • XoopsFormFile
  • XoopsFormHidden
  • XoopsFormHiddenToken
  • XoopsFormLabel
  • XoopsFormPassword
  • XoopsFormRadio
  • XoopsFormRadioYN
  • XoopsFormSelect
  • XoopsFormSelectCheckGroup
  • XoopsFormSelectCountry
  • XoopsFormSelectEditor
  • XoopsFormSelectGroup
  • XoopsFormSelectLang
  • XoopsFormSelectMatchOption
  • XoopsFormSelectTheme
  • XoopsFormSelectTimezone
  • XoopsFormSelectUser
  • XoopsFormText
  • XoopsFormTextArea
  • XoopsFormTextDateSelect
  • XoopsFormTinymce
  • XoopsFormTinymce4
  • XoopsGroup
  • XoopsGroupHandler
  • XoopsGroupPerm
  • XoopsGroupPermForm
  • XoopsGroupPermHandler
  • XoopsGTicket
  • XoopsGuiDefault
  • XoopsInstallWizard
  • XoopsLists
  • XoopsLoad
  • XoopsLocal
  • XoopsLocale
  • XoopsLocaleEn_US
  • XoopsLogger
  • XoopsMailer
  • XoopsMailerLocal
  • XoopsMailerLocale
  • XoopsMediaUploader
  • XoopsMemberHandler
  • XoopsMembership
  • XoopsMembershipHandler
  • XoopsModule
  • XoopsModuleHandler
  • XoopsMultiMailer
  • XoopsMySQLDatabase
  • XoopsMySQLDatabaseProxy
  • XoopsMySQLDatabaseSafe
  • XoopsObject
  • XoopsObjectHandler
  • XoopsObjectTree
  • XoopsOnline
  • XoopsOnlineHandler
  • XoopsPageNav
  • XoopsPathController
  • XoopsPersistableObjectHandler
  • XoopsPreload
  • XoopsPreloadItem
  • XoopsPrivmessage
  • XoopsPrivmessageHandler
  • XoopsRequest
  • XoopsSecurity
  • XoopsSimpleForm
  • XoopsTableForm
  • XoopsTarDownloader
  • XoopsTheme
  • XoopsThemeBlocksPlugin
  • XoopsThemeFactory
  • XoopsThemeForm
  • XoopsThemePlugin
  • XoopsThemeSetParser
  • XoopsTpl
  • XoopsTplfile
  • XoopsTplfileHandler
  • XoopsTplset
  • XoopsTplsetHandler
  • XoopsUser
  • XoopsUserHandler
  • XoopsUserUtility
  • XoopsUtility
  • XoopsXmlRpcApi
  • XoopsXmlRpcArray
  • XoopsXmlRpcBase64
  • XoopsXmlRpcBoolean
  • XoopsXmlRpcDatetime
  • XoopsXmlRpcDocument
  • XoopsXmlRpcDouble
  • XoopsXmlRpcFault
  • XoopsXmlRpcInt
  • XoopsXmlRpcParser
  • XoopsXmlRpcRequest
  • XoopsXmlRpcResponse
  • XoopsXmlRpcString
  • XoopsXmlRpcStruct
  • XoopsXmlRpcTag
  • XoopsXmlRss2Parser
  • XoopsZipDownloader
  • zipfile

Interfaces

  • CommentsPluginInterface
  • MenusDecoratorInterface
  • MenusPluginInterface
  • NotificationsPluginInterface
  • SearchPluginInterface
  • SystemPluginInterface
  • UserconfigsPluginInterface
  • Xoops\Core\AttributeInterface
  • Xoops\Core\Handler\Scheme\SchemeInterface
  • Xoops\Core\Service\Contract\AvatarInterface
  • Xoops\Core\Service\Contract\CountryflagInterface
  • Xoops\Core\Service\Contract\EmojiInterface
  • Xoops\Core\Service\Contract\HtmlToPdfInterface
  • Xoops\Core\Service\Contract\QrcodeInterface
  • Xoops\Core\Service\Contract\ThumbnailInterface
  • Xoops\Core\Service\Contract\UserRankInterface
  • Xoops\Core\Session\FingerprintInterface
  • Xoops\Form\ContainerInterface

Exceptions

  • Xoops\Core\Exception\InvalidHandlerSpecException
  • Xoops\Core\Exception\NoHandlerException

Functions

  • _changeMimeValue
  • _clearAddSessionVars
  • _clearEditSessionVars
  • _ee
  • _recaptcha_aes_encrypt
  • _recaptcha_aes_pad
  • _recaptcha_http_post
  • _recaptcha_mailhide_email_parts
  • _recaptcha_mailhide_urlbase64
  • _recaptcha_qsencode
  • _tt
  • add
  • addCriteria
  • admin_refcheck
  • b_comments_edit
  • b_comments_show
  • b_notification_show
  • b_search_show
  • b_system_info_edit
  • b_system_info_show
  • b_system_login_show
  • b_system_main_edit
  • b_system_main_show
  • b_system_newmembers_edit
  • b_system_newmembers_show
  • b_system_online_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
  • b_xlanguage_select_edit
  • b_xlanguage_select_show
  • banners_blocks_edit
  • banners_blocks_show
  • base_url
  • buildRssFeedCache
  • buildTable
  • check_files_extensions_on_path
  • check_files_extensions_on_phar
  • checkEmail
  • clearAddSession
  • clearEditSession
  • config_loading
  • create_folder
  • create_img
  • create_img_gd
  • createConfigform
  • createDir
  • createThemeform
  • dateSort
  • debugger
  • delete
  • deleteDir
  • duplicate_file
  • edit
  • endsWith
  • exception_handler
  • extensionSort
  • file_put_contents
  • filenameSort
  • filescount
  • fix_dirname
  • fix_filename
  • fix_get_params
  • fix_path
  • fix_strtolower
  • fix_strtoupper
  • foldersize
  • formatTimestamp
  • formatURL
  • genPathCheckHtml
  • get_file_by_url
  • get_writeoks_from_protector
  • getBrightness
  • getDbConnection
  • getDbConnectionParams
  • getDirList
  • handle_uploaded_files
  • http_response_code
  • image_check_memory_usage
  • install_acceptUser
  • install_finalize
  • installHtmlSpecialCharacters
  • is_function_callable
  • is_really_writable
  • load_functions
  • load_object
  • load_objectHandler
  • loadModuleAdminMenu
  • makeSize
  • manage
  • menus_block_edit
  • menus_block_show
  • menus_mainmenu_show
  • 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_getMysqlVersion
  • mod_isModuleAction
  • mod_loadCacheFile
  • mod_loadCacheFile_byGroup
  • mod_loadConfg
  • mod_loadConfig
  • mod_loadFile
  • mod_loadFunctions
  • mod_loadRenderer
  • mod_message
  • modify_chmod
  • new_thumbnails_creation
  • normalizeColor
  • page_blocks_edit
  • page_blocks_show
  • profile_getRegisterForm
  • profile_getUserForm
  • profile_install_addCategory
  • profile_install_addField
  • profile_install_addStep
  • profile_install_initializeProfiles
  • profile_install_setPermissions
  • protector_ip_cmp
  • protector_postcheck
  • protector_precheck
  • publisher_category_items_sel_edit
  • publisher_category_items_sel_show
  • publisher_cloneFileFolder
  • publisher_createLogo
  • publisher_date_to_date_edit
  • publisher_date_to_date_show
  • publisher_displayCategory
  • publisher_editCat
  • publisher_editFile
  • publisher_editItem
  • publisher_items_columns_edit
  • publisher_items_columns_show
  • publisher_items_menu_edit
  • publisher_items_menu_show
  • publisher_items_new_edit
  • publisher_items_new_show
  • publisher_items_random_item_show
  • publisher_items_recent_edit
  • publisher_items_recent_show
  • publisher_items_spot_edit
  • publisher_items_spot_show
  • publisher_latest_files_edit
  • publisher_latest_files_show
  • publisher_latest_news_edit
  • publisher_latest_news_show
  • publisher_mk_chkbox
  • publisher_mk_select
  • publisher_pagewrap_upload
  • publisher_search
  • publisher_search_show
  • publisher_tag_iteminfo
  • publisher_tag_synchronization
  • rcopy
  • recaptcha_check_answer
  • recaptcha_get_html
  • recaptcha_get_signup_url
  • recaptcha_mailhide_html
  • recaptcha_mailhide_url
  • redirect_header
  • rename_file
  • rename_folder
  • rrename
  • rrename_after_cleaner
  • search
  • sizeSort
  • smarty_block_assets
  • smarty_block_noshortcodes
  • smarty_compiler_xoAdminIcons
  • smarty_compiler_xoAdminNav
  • smarty_compiler_xoAppUrl
  • smarty_compiler_xoImgUrl
  • smarty_compiler_xoModuleIcons16
  • smarty_compiler_xoModuleIcons32
  • smarty_compiler_xoModuleIconsBookmarks
  • smarty_function_addBaseScript
  • smarty_function_addBaseStylesheet
  • smarty_function_securityToken
  • smarty_function_thumbnail
  • smarty_function_translate
  • smarty_function_translateTheme
  • smarty_function_xoblock
  • smarty_function_xoInboxCount
  • smarty_function_xoMemberInfo
  • smarty_function_xoops_link
  • smarty_function_xoPageNav
  • smarty_modifier_datetime
  • smarty_modifier_debug_print_var
  • smarty_outputfilter_shortcodes
  • synchronize
  • system_AdminIcons
  • system_adminVersion
  • system_cleanVars
  • system_loadLanguage
  • system_loadTemplate
  • updateMimeValue
  • userTimeToServerTime
  • xhtmlspecialchars
  • xlanguage_convert_encoding
  • xlanguage_convert_item
  • xlanguage_copyfile
  • xlanguage_detectLang
  • xlanguage_encoding
  • xlanguage_lang_detect
  • xlanguage_mkdirs
  • xlanguage_ml
  • xlanguage_ml_escape_bracket
  • xlanguage_select_show
  • xoBoolField
  • xoDiag
  • xoDiagBoolSetting
  • xoDiagIfWritable
  • xoFormField
  • xoops_comment_count
  • xoops_comment_delete
  • xoops_confirm
  • 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_getMailer
  • xoops_getModuleHandler
  • xoops_getModuleOption
  • xoops_getOption
  • xoops_getrank
  • xoops_getUrlDomain
  • xoops_getUserTimestamp
  • xoops_groupperm_deletebymoditem
  • xoops_header
  • xoops_isActiveModule
  • xoops_load
  • xoops_loadLanguage
  • xoops_makepass
  • xoops_message
  • xoops_module_install_avatars
  • xoops_module_install_banners
  • xoops_module_install_comments
  • xoops_module_install_debugbar
  • xoops_module_install_notifications
  • xoops_module_install_page
  • xoops_module_install_pm
  • xoops_module_install_profile
  • xoops_module_install_publisher
  • xoops_module_install_smilies
  • xoops_module_install_system
  • xoops_module_install_userrank
  • xoops_module_install_xlanguage
  • xoops_module_pre_uninstall_comments
  • xoops_module_pre_uninstall_notifications
  • xoops_module_update_comments
  • xoops_module_update_debugbar
  • xoops_module_update_notifications
  • xoops_module_update_pm
  • xoops_module_update_profile
  • xoops_module_update_publisher
  • xoops_module_update_search
  • xoops_module_update_system
  • xoops_module_update_xlanguage
  • xoops_notification_deletebyitem
  • xoops_notification_deletebymodule
  • xoops_notification_deletebyuser
  • xoops_result
  • xoops_setActiveModules
  • xoops_setConfigOption
  • xoops_substr
  • xoops_template_clear_module_cache
  • xoops_template_touch
  • xoops_trim
  • xoops_utf8_encode
  • xoopseditor_get_rootpath
  • xoPassField
  • xoPhpVersion
  • 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: use Xmf\Module\Session;
  13: 
  14: /**
  15:  * @copyright       XOOPS Project (http://xoops.org)
  16:  * @license         GNU GPL V2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
  17:  * @package         Publisher
  18:  * @since           1.0
  19:  * @author          trabis <lusopoemas@gmail.com>
  20:  * @author          The SmartFactory <www.smartfactory.ca>
  21:  * @author          trabis <lusopoemas@gmail.com>
  22:  */
  23: class PublisherUtils
  24: {
  25:     /**
  26:      * Includes scripts in HTML header
  27:      *
  28:      * @return void
  29:      */
  30:     public static function cpHeader()
  31:     {
  32:         $xoops = Xoops::getInstance();
  33:         $publisher = Publisher::getInstance();
  34:         $xoops->header();
  35: 
  36:         $css = array();
  37:         $css[] = $publisher->path('css/publisher.css');
  38:         $xoops->theme()->addBaseStylesheetAssets($css);
  39: 
  40:         $js = array();
  41:         $js[] = $publisher->path('js/funcs.js');
  42:         $js[] = $publisher->path('js/cookies.js');
  43:         $js[] = $publisher->path('js/ajaxupload.3.9.js');
  44:         $js[] = $publisher->path('js/publisher.js');
  45:         $xoops->theme()->addBaseScriptAssets($js);
  46:     }
  47: 
  48:     /**
  49:      * Default sorting for a given order
  50:      *
  51:      * @param string $sort
  52:      *
  53:      * @return string
  54:      */
  55:     public static function getOrderBy($sort)
  56:     {
  57:         if (in_array($sort, array("datesub", "counter"))) {
  58:             return 'DESC';
  59:         }
  60: 
  61:         return 'ASC';
  62:     }
  63: 
  64:     /**
  65:      * @credits Thanks to Mithandir
  66:      *
  67:      * @param string $str
  68:      * @param int    $start
  69:      * @param int    $length
  70:      * @param string $trimmarker
  71:      *
  72:      * @return string
  73:      */
  74:     public static function substr($str, $start, $length, $trimmarker = '...')
  75:     {
  76:         // if the string is empty, let's get out ;-)
  77:         if ($str == '') {
  78:             return $str;
  79:         }
  80: 
  81:         // reverse a string that is shortened with '' as trimmarker
  82:         $reversed_string = strrev(XoopsLocale::substr($str, $start, $length, ''));
  83: 
  84:         // find first space in reversed string
  85:         $position_of_space = strpos($reversed_string, " ", 0);
  86: 
  87:         // truncate the original string to a length of $length
  88:         // minus the position of the last space
  89:         // plus the length of the $trimmarker
  90:         $truncated_string = XoopsLocale::substr($str, $start, $length - $position_of_space + strlen($trimmarker), $trimmarker);
  91: 
  92:         return $truncated_string;
  93:     }
  94: 
  95:     /**
  96:      * @param string $document
  97:      *
  98:      * @return string
  99:      */
 100:     public static function html2text($document)
 101:     {
 102:         // PHP Manual:: function preg_replace
 103:         // $document should contain an HTML document.
 104:         // This will remove HTML tags, javascript sections
 105:         // and white space. It will also convert some
 106:         // common HTML entities to their text equivalent.
 107:         // Credits : newbb2
 108:         $search = array(
 109:             "'<script[^>]*?>.*?</script>'si", // Strip out javascript
 110:             "'<img.*?/>'si", // Strip out img tags
 111:             "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags
 112:             "'([\r\n])[\s]+'", // Strip out white space
 113:             "'&(quot|#34);'i", // Replace HTML entities
 114:             "'&(amp|#38);'i", "'&(lt|#60);'i", "'&(gt|#62);'i", "'&(nbsp|#160);'i", "'&(iexcl|#161);'i",
 115:             "'&(cent|#162);'i", "'&(pound|#163);'i", "'&(copy|#169);'i", "'&#(\d+);'e"
 116:         ); // evaluate as php
 117: 
 118:         $replace = array(
 119:             "", "", "", "\\1", "\"", "&", "<", ">", " ", chr(161), chr(162), chr(163), chr(169), "chr(\\1)"
 120:         );
 121: 
 122:         $text = preg_replace($search, $replace, $document);
 123: 
 124:         return $text;
 125:     }
 126: 
 127:     /**
 128:      * @return string[]
 129:      */
 130:     public static function getAllowedImagesTypes()
 131:     {
 132:         return array(
 133:             'jpg/jpeg', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/x-png', 'image/png', 'image/pjpeg'
 134:         );
 135:     }
 136: 
 137:     /**
 138:      * @param bool $withLink
 139:      *
 140:      * @return string
 141:      */
 142:     public static function moduleHome($withLink = true)
 143:     {
 144:         $xoops = Xoops::getInstance();
 145:         $publisher = Publisher::getInstance();
 146: 
 147:         if (!$publisher->getConfig('format_breadcrumb_modname')) {
 148:             return '';
 149:         }
 150: 
 151:         if (!$withLink) {
 152:             return $publisher->getModule()->getVar('name');
 153:         } else {
 154:             return '<a href="' . $xoops->url(PUBLISHER_URL) . '/">' . $publisher->getModule()->getVar('name') . '</a>';
 155:         }
 156:     }
 157: 
 158:     /**
 159:      * Copy a file, or a folder and its contents
 160:      *
 161:      * @author      Aidan Lister <aidan@php.net>
 162:      * @version     1.0.0
 163:      *
 164:      * @param string $source The source
 165:      * @param string $dest   The destination
 166:      *
 167:      * @return bool Returns true on success, false on failure
 168:      */
 169:     public static function copyr($source, $dest)
 170:     {
 171:         // Simple copy for a file
 172:         if (is_file($source)) {
 173:             return copy($source, $dest);
 174:         }
 175: 
 176:         // Make destination directory
 177:         if (!is_dir($dest)) {
 178:             mkdir($dest);
 179:         }
 180: 
 181:         // Loop through the folder
 182:         $dir = dir($source);
 183:         while (false !== $entry = $dir->read()) {
 184:             // Skip pointers
 185:             if ($entry === '.' || $entry === '..') {
 186:                 continue;
 187:             }
 188: 
 189:             // Deep copy directories
 190:             if (is_dir("$source/$entry") && ($dest !== "$source/$entry")) {
 191:                 self::copyr("$source/$entry", "$dest/$entry");
 192:             } else {
 193:                 copy("$source/$entry", "$dest/$entry");
 194:             }
 195:         }
 196: 
 197:         // Clean up
 198:         $dir->close();
 199: 
 200:         return true;
 201:     }
 202: 
 203:     /**
 204:      * @credits Thanks to the NewBB2 Development Team
 205:      * @param string $item
 206:      * @param bool   $getStatus
 207:      *
 208:      * @todo check undefined string
 209:      * @return bool|int|string
 210:      */
 211:     public static function getPathStatus($item, $getStatus = false)
 212:     {
 213:         $publisher = Publisher::getInstance();
 214:         if ($item === 'root') {
 215:             $path = '';
 216:         } else {
 217:             $path = $item;
 218:         }
 219: 
 220:         $thePath = self::getUploadDir(true, $path);
 221: 
 222:         if (empty($thePath)) {
 223:             return false;
 224:         }
 225:         if (@is_writable($thePath)) {
 226:             $pathCheckResult = 1;
 227:             $path_status = _AM_PUBLISHER_AVAILABLE;
 228:         } elseif (!@is_dir($thePath)) {
 229:             $pathCheckResult = -1;
 230:             $path_status = _AM_PUBLISHER_NOTAVAILABLE . " <a href='" . $publisher->url("admin/index.php?op=createdir&amp;path={$item}") . "'>" . _AM_PUBLISHER_CREATETHEDIR . "</a>";
 231:         } else {
 232:             $pathCheckResult = -2;
 233:             $path_status = _AM_PUBLISHER_NOTWRITABLE . " <a href='" . $publisher->url("admin/index.php?op=setperm&amp;path={$item}") . "'>" . _AM_SCS_SETMPERM . "</a>";
 234:         }
 235:         if (!$getStatus) {
 236:             return $path_status;
 237:         } else {
 238:             return $pathCheckResult;
 239:         }
 240:     }
 241: 
 242:     /**
 243:      * @credits Thanks to the NewBB2 Development Team
 244:      *
 245:      * @param string $target
 246:      *
 247:      * @return bool
 248:      */
 249:     public static function mkdir($target)
 250:     {
 251:         // http://www.php.net/manual/en/function.mkdir.php
 252:         // saint at corenova.com
 253:         // bart at cdasites dot com
 254:         if (is_dir($target) || empty($target)) {
 255:             return true; // best case check first
 256:         }
 257: 
 258:         if (XoopsLoad::fileExists($target) && !is_dir($target)) {
 259:             return false;
 260:         }
 261: 
 262:         if (self::mkdir(substr($target, 0, strrpos($target, '/')))) {
 263:             if (!XoopsLoad::fileExists($target)) {
 264:                 $res = mkdir($target, 0777); // crawl back up & create dir tree
 265:                 self::chmod($target);
 266: 
 267:                 return $res;
 268:             }
 269:         }
 270:         $res = is_dir($target);
 271: 
 272:         return $res;
 273:     }
 274: 
 275:     /**
 276:      * @credits Thanks to the NewBB2 Development Team
 277:      *
 278:      * @param string $target
 279:      * @param int    $mode
 280:      *
 281:      * @return bool
 282:      */
 283:     public static function chmod($target, $mode = 0777)
 284:     {
 285:         return @chmod($target, $mode);
 286:     }
 287: 
 288:     /**
 289:      * @param bool $hasPath
 290:      * @param bool $item
 291:      *
 292:      * @return string
 293:      */
 294:     public static function getUploadDir($hasPath = true, $item = false)
 295:     {
 296:         $xoops = Xoops::getInstance();
 297:         if ($item) {
 298:             if ($item === 'root') {
 299:                 $item = '';
 300:             } else {
 301:                 $item = $item . '/';
 302:             }
 303:         } else {
 304:             $item = '';
 305:         }
 306: 
 307:         if ($hasPath) {
 308:             return $xoops->path(PUBLISHER_UPLOADS_PATH . '/' . $item);
 309:         } else {
 310:             return $xoops->url(PUBLISHER_UPLOADS_URL . '/' . $item);
 311:         }
 312:     }
 313: 
 314:     /**
 315:      * @param string $item
 316:      * @param bool   $hasPath
 317:      *
 318:      * @return string
 319:      */
 320:     public static function getImageDir($item = '', $hasPath = true)
 321:     {
 322:         if ($item) {
 323:             $item = "images/{$item}";
 324:         } else {
 325:             $item = "images";
 326:         }
 327: 
 328:         return self::getUploadDir($hasPath, $item);
 329:     }
 330: 
 331:     /**
 332:      * @param array $errors
 333:      *
 334:      * @return string
 335:      */
 336:     public static function formatErrors($errors = array())
 337:     {
 338:         $ret = '';
 339:         foreach ($errors as $value) {
 340:             $ret .= '<br /> - ' . $value;
 341:         }
 342: 
 343:         return $ret;
 344:     }
 345: 
 346:     /**
 347:      * Check is current user is author of a given article
 348:      *
 349:      * @param object $itemObj
 350:      *
 351:      * @return bool
 352:      */
 353:     public static function IsUserAuthor($itemObj)
 354:     {
 355:         $xoops = Xoops::getInstance();
 356: 
 357:         return ($xoops->isUser() && is_object($itemObj) && ($xoops->user->getVar('uid') == $itemObj->getVar('uid')));
 358:     }
 359: 
 360:     /**
 361:      * Check is current user is moderator of a given article
 362:      *
 363:      * @param PublisherItem $itemObj
 364:      *
 365:      * @return bool
 366:      */
 367:     public static function IsUserModerator($itemObj)
 368:     {
 369:         $publisher = Publisher::getInstance();
 370:         $categoriesGranted = $publisher->getPermissionHandler()->getGrantedItems('category_moderation');
 371: 
 372:         return (is_object($itemObj) && in_array($itemObj->getVar('categoryid'), $categoriesGranted));
 373:     }
 374: 
 375:     public static function IsUserAdmin()
 376:     {
 377:         return Publisher::getInstance()->isUserAdmin();
 378:     }
 379: 
 380:     /**
 381:      * Saves permissions for the selected category
 382:      *
 383:      * @param array   $groups     : group with granted permission
 384:      * @param integer $categoryid : categoryid on which we are setting permissions
 385:      * @param string  $perm_name  : name of the permission
 386:      *
 387:      * @todo Move to category class
 388:      * @return boolean : TRUE if the no errors occured
 389:      */
 390:     public static function saveCategoryPermissions($groups, $categoryid, $perm_name)
 391:     {
 392:         $xoops = Xoops::getInstance();
 393:         $publisher = Publisher::getInstance();
 394: 
 395:         $result = true;
 396: 
 397:         $module_id = $publisher->getModule()->getVar('mid');
 398:         $gperm_handler = $xoops->getHandlerGroupPermission();
 399:         // First, if the permissions are already there, delete them
 400:         $gperm_handler->deleteByModule($module_id, $perm_name, $categoryid);
 401: 
 402:         // Save the new permissions
 403:         if (count($groups) > 0) {
 404:             foreach ($groups as $group_id) {
 405:                 $gperm_handler->addRight($perm_name, $categoryid, $group_id, $module_id);
 406:             }
 407:         }
 408: 
 409:         return $result;
 410:     }
 411: 
 412:     /**
 413:      * @param string $tablename
 414:      * @param string $iconname
 415:      * @param string $tabletitle
 416:      * @param string $tabledsc
 417:      * @param bool   $open
 418:      *
 419:      * @return void
 420:      */
 421:     public static function openCollapsableBar($tablename = '', $iconname = '', $tabletitle = '', $tabledsc = '', $open = true)
 422:     {
 423:         $publisher = Publisher::getInstance();
 424:         $image = 'open12.gif';
 425:         $display = 'none';
 426:         if ($open) {
 427:             $image = 'close12.gif';
 428:             $display = 'block';
 429:         }
 430: 
 431:         echo "<h3 style=\"color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; \"><a href='javascript:;' onclick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "')\";>";
 432:         echo "<img id='" . $iconname . "' src='" . $publisher->url("images/links/" . $image) . "' alt='' /></a>&nbsp;" . $tabletitle . "</h3>";
 433:         echo "<div id='" . $tablename . "' style='display: " . $display . ";'>";
 434:         if ($tabledsc != '') {
 435:             echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $tabledsc . "</span>";
 436:         }
 437:     }
 438: 
 439:     /**
 440:      * @param string $name
 441:      * @param string $icon
 442:      *
 443:      * @return void
 444:      */
 445:     public static function closeCollapsableBar($name, $icon)
 446:     {
 447:         echo "</div>";
 448: 
 449:         $urls = self::getCurrentUrls();
 450:         $path = $urls['phpself'];
 451: 
 452:         $cookie_name = $path . '_publisher_collaps_' . $name;
 453:         $cookie_name = str_replace('.', '_', $cookie_name);
 454:         $cookie = self::getCookieVar($cookie_name, '');
 455: 
 456:         if ($cookie === 'none') {
 457:             echo '
 458:         <script type="text/javascript"><!--
 459:         toggle("' . $name . '"); toggleIcon("' . $icon . '");
 460:         //-->
 461:         </script>
 462:         ';
 463:         }
 464:     }
 465: 
 466:     /**
 467:      * @param string $name
 468:      * @param string $value
 469:      * @param int    $time
 470:      *
 471:      * @return void
 472:      */
 473:     public static function setCookieVar($name, $value, $time = 0)
 474:     {
 475:         if ($time == 0) {
 476:             $time = time() + 3600 * 24 * 365;
 477:         }
 478:         setcookie($name, $value, $time, '/');
 479:     }
 480: 
 481:     /**
 482:      * @param string $name
 483:      * @param string $default
 484:      *
 485:      * @return string
 486:      */
 487:     public static function getCookieVar($name, $default = '')
 488:     {
 489:         if (isset($_COOKIE[$name]) && ($_COOKIE[$name] > '')) {
 490:             return $_COOKIE[$name];
 491:         } else {
 492:             return $default;
 493:         }
 494:     }
 495: 
 496:     /**
 497:      * @return array
 498:      */
 499:     public static function getCurrentUrls()
 500:     {
 501:         $http = strpos(\XoopsBaseConfig::get('url'), "https://") === false ? "http://" : "https://";
 502:         $phpself = $_SERVER['PHP_SELF'];
 503:         $httphost = $_SERVER['HTTP_HOST'];
 504:         $querystring = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
 505: 
 506:         if ($querystring != '') {
 507:             $querystring = '?' . $querystring;
 508:         }
 509: 
 510:         $currenturl = $http . $httphost . $phpself . $querystring;
 511: 
 512:         $urls = array();
 513:         $urls['http'] = $http;
 514:         $urls['httphost'] = $httphost;
 515:         $urls['phpself'] = $phpself;
 516:         $urls['querystring'] = $querystring;
 517:         $urls['full'] = $currenturl;
 518: 
 519:         return $urls;
 520:     }
 521: 
 522:     /**
 523:      * @return string
 524:      */
 525:     public static function getCurrentPage()
 526:     {
 527:         $urls = self::getCurrentUrls();
 528: 
 529:         return $urls['full'];
 530:     }
 531: 
 532:     /**
 533:      * @param object $categoryObj
 534:      * @param int    $selectedid
 535:      * @param int    $level
 536:      * @param string $ret
 537:      *
 538:      * @todo move to ccategory class
 539:      * @return string
 540:      */
 541:     public static function addCategoryOption($categoryObj, $selectedid = 0, $level = 0, $ret = '')
 542:     {
 543:         $publisher = Publisher::getInstance();
 544: 
 545:         $spaces = '';
 546:         for ($j = 0; $j < $level; ++$j) {
 547:             $spaces .= '--';
 548:         }
 549: 
 550:         $ret .= "<option value='" . $categoryObj->getVar('categoryid') . "'";
 551:         if (is_array($selectedid) && in_array($categoryObj->getVar('categoryid'), $selectedid)) {
 552:             $ret .= " selected='selected'";
 553:         } elseif ($categoryObj->getVar('categoryid') == $selectedid) {
 554:             $ret .= " selected='selected'";
 555:         }
 556:         $ret .= ">" . $spaces . $categoryObj->getVar('name') . "</option>\n";
 557: 
 558:         $subCategoriesObj = $publisher->getCategoryHandler()->getCategories(0, 0, $categoryObj->getVar('categoryid'));
 559:         if (count($subCategoriesObj) > 0) {
 560:             ++$level;
 561:             foreach ($subCategoriesObj as $subCategoryObj) {
 562:                 $ret .= self::addCategoryOption($subCategoryObj, $selectedid, $level);
 563:             }
 564:         }
 565: 
 566:         return $ret;
 567:     }
 568: 
 569:     /**
 570:      * @param int    $selectedid
 571:      * @param int    $parentcategory
 572:      * @param bool   $allCatOption
 573:      * @param string $selectname
 574:      *
 575:      * @todo move to category class
 576:      * @return string
 577:      */
 578:     public static function createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true, $selectname = 'options[0]')
 579:     {
 580:         $publisher = Publisher::getInstance();
 581: 
 582:         $selectedid = explode(',', $selectedid);
 583: 
 584:         $ret = "<select name='" . $selectname . "[]' multiple='multiple' size='10'>";
 585:         if ($allCatOption) {
 586:             $ret .= "<option value='0'";
 587:             if (in_array(0, $selectedid)) {
 588:                 $ret .= " selected='selected'";
 589:             }
 590:             $ret .= ">" . _MB_PUBLISHER_ALLCAT . "</option>";
 591:         }
 592: 
 593:         // Creating category objects
 594:         $categoriesObj = $publisher->getCategoryHandler()->getCategories(0, 0, $parentcategory);
 595: 
 596:         if (count($categoriesObj) > 0) {
 597:             foreach ($categoriesObj as $catID => $categoryObj) {
 598:                 $ret .= self::addCategoryOption($categoryObj, $selectedid);
 599:             }
 600:         }
 601:         $ret .= "</select>";
 602: 
 603:         return $ret;
 604:     }
 605: 
 606:     /**
 607:      * @param int  $selectedid
 608:      * @param int  $parentcategory
 609:      * @param bool $allCatOption
 610:      *
 611:      * @todo move to category class
 612:      * @return string
 613:      */
 614:     public static function createCategoryOptions($selectedid = 0, $parentcategory = 0, $allCatOption = true)
 615:     {
 616:         $publisher = Publisher::getInstance();
 617: 
 618:         $ret = "";
 619:         if ($allCatOption) {
 620:             $ret .= "<option value='0'";
 621:             $ret .= ">" . _MB_PUBLISHER_ALLCAT . "</option>\n";
 622:         }
 623: 
 624:         // Creating category objects
 625:         $categoriesObj = $publisher->getCategoryHandler()->getCategories(0, 0, $parentcategory);
 626:         if (count($categoriesObj) > 0) {
 627:             foreach ($categoriesObj as $categoryObj) {
 628:                 $ret .= self::addCategoryOption($categoryObj, $selectedid);
 629:             }
 630:         }
 631: 
 632:         return $ret;
 633:     }
 634: 
 635:     /**
 636:      * @param array  $err_arr
 637:      * @param string $reseturl
 638:      *
 639:      * @todo check this undefined strings
 640:      * @return void
 641:      */
 642:     public static function renderErrors(&$err_arr, $reseturl = '')
 643:     {
 644:         if (is_array($err_arr) && count($err_arr) > 0) {
 645:             echo '<div id="readOnly" class="errorMsg" style="border:1px solid #D24D00; background:#FEFECC url(' . PUBLISHER_URL . '/images/important-32.png) no-repeat 7px 50%;color:#333;padding-left:45px;">';
 646: 
 647:             echo '<h4 style="text-align:left;margin:0; padding-top:0">' . _AM_PUBLISHER_MSG_SUBMISSION_ERR;
 648: 
 649:             if ($reseturl) {
 650:                 echo ' <a href="' . $reseturl . '">[' . _AM_PUBLISHER_TEXT_SESSION_RESET . ']</a>';
 651:             }
 652: 
 653:             echo '</h4><ul>';
 654: 
 655:             foreach ($err_arr as $key => $error) {
 656:                 if (is_array($error)) {
 657:                     foreach ($error as $err) {
 658:                         echo '<li><a href="#' . $key . '" onclick="var e = xoopsGetElementById(\'' . $key . '\'); e.focus();">' . htmlspecialchars($err) . '</a></li>';
 659:                     }
 660:                 } else {
 661:                     echo '<li><a href="#' . $key . '" onclick="var e = xoopsGetElementById(\'' . $key . '\'); e.focus();">' . htmlspecialchars($error) . '</a></li>';
 662:                 }
 663:             }
 664:             echo "</ul></div><br />";
 665:         }
 666:     }
 667: 
 668:     /**
 669:      * Generate publisher URL
 670:      *
 671:      * @param string $page
 672:      * @param array  $vars
 673:      * @param bool   $encodeAmp
 674:      *
 675:      * @return string
 676:      * @credit : xHelp module, developped by 3Dev
 677:      */
 678:     public static function makeURI($page, $vars = array(), $encodeAmp = true)
 679:     {
 680:         $joinStr = '';
 681: 
 682:         $amp = ($encodeAmp ? '&amp;' : '&');
 683: 
 684:         if (!count($vars)) {
 685:             return $page;
 686:         }
 687: 
 688:         $qs = '';
 689:         foreach ($vars as $key => $value) {
 690:             $qs .= $joinStr . $key . '=' . $value;
 691:             $joinStr = $amp;
 692:         }
 693: 
 694:         return $page . '?' . $qs;
 695:     }
 696: 
 697:     /**
 698:      * @param string $subject
 699:      *
 700:      * @return string
 701:      */
 702:     public static function tellafriend($subject = '')
 703:     {
 704:         $xoops = Xoops::getInstance();
 705:         if (stristr($subject, '%')) {
 706:             $subject = rawurldecode($subject);
 707:         }
 708:         $target_uri = $xoops->url($_SERVER['REQUEST_URI']);
 709: 
 710:         return $xoops->url('modules/tellafriend/index.php?target_uri=' . rawurlencode($target_uri) . '&amp;subject=' . rawurlencode($subject));
 711:     }
 712: 
 713:     /**
 714:      * @param bool $another
 715:      * @param bool $withRedirect
 716:      * @param      $itemObj
 717:      *
 718:      * @return bool|string
 719:      */
 720:     public static function uploadFile($another = false, $withRedirect = true, &$itemObj)
 721:     {
 722:         $xoops = Xoops::getInstance();
 723: 
 724:         $publisher = Publisher::getInstance();
 725: 
 726:         $itemid = isset($_POST['itemid']) ? (int)($_POST['itemid']) : 0;
 727:         $uid = $xoops->isUser() ? $xoops->user->getVar('uid') : 0;
 728:         $session = new Session();
 729:         $session->set('publisher_file_filename', isset($_POST['item_file_name']) ? $_POST['item_file_name'] : '');
 730:         $session->set('publisher_file_description', isset($_POST['item_file_description']) ? $_POST['item_file_description'] : '');
 731:         $session->set('publisher_file_status', isset($_POST['item_file_status']) ? (int)($_POST['item_file_status']) : 1);
 732:         $session->set('publisher_file_uid', $uid);
 733:         $session->set('publisher_file_itemid', $itemid);
 734: 
 735:         if (!is_object($itemObj)) {
 736:             $itemObj = $publisher->getItemHandler()->get($itemid);
 737:         }
 738: 
 739:         $fileObj = $publisher->getFileHandler()->create();
 740:         $fileObj->setVar('name', isset($_POST['item_file_name']) ? $_POST['item_file_name'] : '');
 741:         $fileObj->setVar('description', isset($_POST['item_file_description']) ? $_POST['item_file_description'] : '');
 742:         $fileObj->setVar('status', isset($_POST['item_file_status']) ? (int)($_POST['item_file_status']) : 1);
 743:         $fileObj->setVar('uid', $uid);
 744:         $fileObj->setVar('itemid', $itemObj->getVar('itemid'));
 745:         $fileObj->setVar('datesub', time());
 746: 
 747:         // Get available mimetypes for file uploading
 748:         $allowed_mimetypes = $publisher->getMimetypeHandler()->getArrayByType();
 749:         // TODO : display the available mimetypes to the user
 750:         $errors = array();
 751:         /* @var $fileObj PublisherFile */
 752:         if ($publisher->getConfig('perm_upload') && is_uploaded_file($_FILES['item_upload_file']['tmp_name'])) {
 753:             if (!$ret = $fileObj->checkUpload('item_upload_file', $allowed_mimetypes, $errors)) {
 754:                 $errorstxt = implode('<br />', $errors);
 755: 
 756:                 $message = sprintf(_CO_PUBLISHER_MESSAGE_FILE_ERROR, $errorstxt);
 757:                 if ($withRedirect) {
 758:                     $xoops->redirect("file.php?op=mod&itemid=" . $itemid, 5, $message);
 759:                 } else {
 760:                     return $message;
 761:                 }
 762:             }
 763:         }
 764: 
 765:         // Storing the file
 766:         if (!$fileObj->store($allowed_mimetypes)) {
 767:             if ($withRedirect) {
 768:                 $xoops->redirect("file.php?op=mod&itemid=" . $fileObj->getVar('itemid'), 3, _CO_PUBLISHER_FILEUPLOAD_ERROR . self::formatErrors($fileObj->getErrors()));
 769:             } else {
 770:                 return _CO_PUBLISHER_FILEUPLOAD_ERROR . self::formatErrors($fileObj->getErrors());
 771:             }
 772:         }
 773: 
 774:         if ($withRedirect) {
 775:             $redirect_page = $another ? 'file.php' : 'item.php';
 776:             $xoops->redirect($redirect_page . "?op=mod&itemid=" . $fileObj->getVar('itemid'), 2, _CO_PUBLISHER_FILEUPLOAD_SUCCESS);
 777:         }
 778: 
 779:         return true;
 780:     }
 781: 
 782:     /**
 783:      * @return string
 784:      */
 785:     public static function newFeatureTag()
 786:     {
 787:         $ret = '<span style="padding-right: 4px; font-weight: bold; color: red;">' . _CO_PUBLISHER_NEW_FEATURE . '</span>';
 788: 
 789:         return $ret;
 790:     }
 791: 
 792:     /**
 793:      * Smarty truncate_tagsafe modifier plugin
 794:      * Type:     modifier<br>
 795:      * Name:     truncate_tagsafe<br>
 796:      * Purpose:  Truncate a string to a certain length if necessary,
 797:      *           optionally splitting in the middle of a word, and
 798:      *           appending the $etc string or inserting $etc into the middle.
 799:      *           Makes sure no tags are left half-open or half-closed
 800:      *           (e.g. "Banana in a <a...")
 801:      *
 802:      * @author   Monte Ohrt <monte at ohrt dot com>, modified by Amos Robinson
 803:      *           <amos dot robinson at gmail dot com>
 804:      *
 805:      * @param string
 806:      * @param integer
 807:      * @param string
 808:      * @param boolean
 809:      * @param boolean
 810:      *
 811:      * @return string
 812:      */
 813:     public static function truncateTagSafe($string, $length = 80, $etc = '...', $break_words = false)
 814:     {
 815:         if ($length == 0) {
 816:             return '';
 817:         }
 818: 
 819:         if (strlen($string) > $length) {
 820:             $length -= strlen($etc);
 821:             if (!$break_words) {
 822:                 $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1));
 823:                 $string = preg_replace('/<[^>]*$/', '', $string);
 824:                 $string = self::closeTags($string);
 825:             }
 826: 
 827:             return $string . $etc;
 828:         } else {
 829:             return $string;
 830:         }
 831:     }
 832: 
 833:     /**
 834:      * @author   Monte Ohrt <monte at ohrt dot com>, modified by Amos Robinson
 835:      *           <amos dot robinson at gmail dot com>
 836:      *
 837:      * @param string $string
 838:      *
 839:      * @return string
 840:      */
 841:     public static function closeTags($string)
 842:     {
 843:         // match opened tags
 844:         if (preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
 845:             $start_tags = $start_tags[1];
 846:             // match closed tags
 847:             if (preg_match_all('/<\/([a-z]+)>/', $string, $end_tags)) {
 848:                 $complete_tags = array();
 849:                 $end_tags = $end_tags[1];
 850: 
 851:                 foreach ($start_tags as $val) {
 852:                     $posb = array_search($val, $end_tags);
 853:                     if (is_integer($posb)) {
 854:                         unset($end_tags[$posb]);
 855:                     } else {
 856:                         $complete_tags[] = $val;
 857:                     }
 858:                 }
 859:             } else {
 860:                 $complete_tags = $start_tags;
 861:             }
 862: 
 863:             $complete_tags = array_reverse($complete_tags);
 864:             for ($i = 0; $i < count($complete_tags); ++$i) {
 865:                 $string .= '</' . $complete_tags[$i] . '>';
 866:             }
 867:         }
 868: 
 869:         return $string;
 870:     }
 871: 
 872:     /**
 873:      * @param int $itemid
 874:      *
 875:      * @return string
 876:      */
 877:     public static function ratingBar($itemid)
 878:     {
 879:         $xoops = Xoops::getInstance();
 880:         $publisher = Publisher::getInstance();
 881:         $rating_unitwidth = 30;
 882:         $units = 5;
 883: 
 884:         $criteria = new Criteria('itemid', $itemid);
 885:         $ratingObjs = $publisher->getRatingHandler()->getObjects($criteria);
 886:         unset($criteria);
 887: 
 888:         $uid = $xoops->isUser() ? $xoops->user->getVar('uid') : 0;
 889:         $count = count($ratingObjs);
 890:         $current_rating = 0;
 891:         $voted = false;
 892:         $ip = getenv('REMOTE_ADDR');
 893: 
 894:         /* @var $ratingObj PublisherRating */
 895:         foreach ($ratingObjs as $ratingObj) {
 896:             $current_rating += $ratingObj->getVar('rate');
 897:             if ($ratingObj->getVar('ip') == $ip || ($uid > 0 && $uid == $ratingObj->getVar('uid'))) {
 898:                 $voted = true;
 899:             }
 900:         }
 901: 
 902:         $tense = $count == 1 ? _MD_PUBLISHER_VOTE_lVOTE : _MD_PUBLISHER_VOTE_lVOTES; //plural form votes/vote
 903: 
 904:         // now draw the rating bar
 905:         $rating_width = @number_format($current_rating / $count, 2) * $rating_unitwidth;
 906:         $rating1 = @number_format($current_rating / $count, 1);
 907:         $rating2 = @number_format($current_rating / $count, 2);
 908: 
 909:         $groups = $xoops->getUserGroups();
 910:         $gperm_handler = $publisher->getGrouppermHandler();
 911: 
 912:         if (!$gperm_handler->checkRight('global', _PUBLISHER_RATE, $groups, $publisher->getModule()->getVar('mid'))) {
 913:             $static_rater = array();
 914:             $static_rater[] .= "\n" . '<div class="publisher_ratingblock">';
 915:             $static_rater[] .= '<div id="unit_long' . $itemid . '">';
 916:             $static_rater[] .= '<div id="unit_ul' . $itemid . '" class="publisher_unit-rating" style="width:' . $rating_unitwidth * $units . 'px;">';
 917:             $static_rater[] .= '<div class="publisher_current-rating" style="width:' . $rating_width . 'px;">' . _MD_PUBLISHER_VOTE_RATING . ' ' . $rating2 . '/' . $units . '</div>';
 918:             $static_rater[] .= '</div>';
 919:             $static_rater[] .= '<div class="publisher_static">' . _MD_PUBLISHER_VOTE_RATING . ': <strong> ' . $rating1 . '</strong>/' . $units . ' (' . $count . ' ' . $tense . ') <br /><em>' . _MD_PUBLISHER_VOTE_DISABLE . '</em></div>';
 920:             $static_rater[] .= '</div>';
 921:             $static_rater[] .= '</div>' . "\n\n";
 922: 
 923:             return join("\n", $static_rater);
 924:         } else {
 925:             $rater = '';
 926:             $rater .= '<div class="publisher_ratingblock">';
 927:             $rater .= '<div id="unit_long' . $itemid . '">';
 928:             $rater .= '<div id="unit_ul' . $itemid . '" class="publisher_unit-rating" style="width:' . $rating_unitwidth * $units . 'px;">';
 929:             $rater .= '<div class="publisher_current-rating" style="width:' . $rating_width . 'px;">' . _MD_PUBLISHER_VOTE_RATING . ' ' . $rating2 . '/' . $units . '</div>';
 930: 
 931:             for ($ncount = 1; $ncount <= $units; ++$ncount) { // loop from 1 to the number of units
 932:                 if (!$voted) { // if the user hasn't yet voted, draw the voting stars
 933:                     $rater .= '<div><a href="' . PUBLISHER_URL . '/rate.php?itemid=' . $itemid . '&amp;rating=' . $ncount . '" title="' . $ncount . ' ' . _MD_PUBLISHER_VOTE_OUTOF . ' ' . $units . '" class="publisher_r' . $ncount . '-unit rater" rel="nofollow">' . $ncount . '</a></div>';
 934:                 }
 935:             }
 936: 
 937:             $rater .= '  </div>';
 938:             $rater .= '  <div';
 939: 
 940:             if ($voted) {
 941:                 $rater .= ' class="publisher_voted"';
 942:             }
 943: 
 944:             $rater .= '>' . _MD_PUBLISHER_VOTE_RATING . ': <strong> ' . $rating1 . '</strong>/' . $units . ' (' . $count . ' ' . $tense . ')';
 945:             $rater .= '  </div>';
 946:             $rater .= '</div>';
 947:             $rater .= '</div>';
 948: 
 949:             return $rater;
 950:         }
 951:     }
 952: 
 953:     /**
 954:      * @param array $allowed_editors
 955:      *
 956:      * @return array
 957:      */
 958:     public static function getEditors($allowed_editors = null)
 959:     {
 960:         $ret = array();
 961:         $nohtml = false;
 962:         $editor_handler = XoopsEditorHandler::getInstance();
 963:         $editors = $editor_handler->getList($nohtml);
 964:         foreach ($editors as $name => $title) {
 965:             $key = self::stringToInt($name);
 966:             if (is_array($allowed_editors)) {
 967:                 //for submit page
 968:                 if (in_array($key, $allowed_editors)) {
 969:                     $ret[] = $name;
 970:                 }
 971:             } else {
 972:                 //for admin permissions page
 973:                 $ret[$key]['name'] = $name;
 974:                 $ret[$key]['title'] = $title;
 975:             }
 976:         }
 977: 
 978:         return $ret;
 979:     }
 980: 
 981:     /**
 982:      * @param string $string
 983:      * @param int    $length
 984:      *
 985:      * @return int
 986:      */
 987:     public static function stringToInt($string = '', $length = 5)
 988:     {
 989:         for ($i = 0, $final = "", $string = substr(md5($string), $length); $i < $length; $final .= (int)($string[$i]), ++$i) {
 990:         }
 991: 
 992:         return (int)($final);
 993:     }
 994: 
 995:     /**
 996:      * @param string $item
 997:      *
 998:      * @return string
 999:      */
1000:     public static function convertCharset($item)
1001:     {
1002:         if (XoopsLocale::getCharset() === 'UTF-8') {
1003:             return $item;
1004:         }
1005: 
1006:         if (XoopsLocale::getCharset() !== 'windows-1256') {
1007:             return utf8_encode($item);
1008:         }
1009: 
1010:         if ($unserialize = unserialize($item)) {
1011:             foreach ($unserialize as $key => $value) {
1012:                 $unserialize[$key] = @iconv('windows-1256', 'UTF-8', $value);
1013:             }
1014:             $serialize = serialize($unserialize);
1015: 
1016:             return $serialize;
1017:         } else {
1018:             return @iconv('windows-1256', 'UTF-8', $item);
1019:         }
1020:     }
1021: 
1022:     public static function seoTitle($title = '', $withExt = true)
1023:     {
1024: 
1025:         /**
1026:          * if XOOPS ML is present, let's sanitize the title with the current language
1027:          */
1028:         $myts = \Xoops\Core\Text\Sanitizer::getInstance();
1029:         if (method_exists($myts, 'formatForML')) {
1030:             $title = $myts->formatForML($title);
1031:         }
1032: 
1033:         // Transformation de la chaine en minuscule
1034:         // Codage de la chaine afin d'éviter les erreurs 500 en cas de caractères imprévus
1035:         $title = rawurlencode(strtolower($title));
1036: 
1037:         // Transformation des ponctuations
1038:         //                 Tab     Space      !        "        #        %        &        '        (        )        ,        /        :        ;        <        =        >        ?        @        [        \        ]        ^        {        |        }        ~       .
1039:         $pattern = array(
1040:             "/%09/", "/%20/", "/%21/", "/%22/", "/%23/", "/%25/", "/%26/", "/%27/", "/%28/", "/%29/", "/%2C/", "/%2F/",
1041:             "/%3A/", "/%3B/", "/%3C/", "/%3D/", "/%3E/", "/%3F/", "/%40/", "/%5B/", "/%5C/", "/%5D/", "/%5E/", "/%7B/",
1042:             "/%7C/", "/%7D/", "/%7E/", "/\./"
1043:         );
1044:         $rep_pat = array(
1045:             "-", "-", "", "", "", "-100", "", "-", "", "", "", "-", "", "", "", "-", "", "", "-at-", "", "-", "", "-",
1046:             "", "-", "", "-", ""
1047:         );
1048:         $title = preg_replace($pattern, $rep_pat, $title);
1049: 
1050:         // Transformation des caractères accentués
1051:         //                  è        é        ê        ë        ç        à        â        ä        î        ï        ù        ü        û        ô        ö
1052:         $pattern = array(
1053:             "/%B0/", "/%E8/", "/%E9/", "/%EA/", "/%EB/", "/%E7/", "/%E0/", "/%E2/", "/%E4/", "/%EE/", "/%EF/", "/%F9/",
1054:             "/%FC/", "/%FB/", "/%F4/", "/%F6/"
1055:         );
1056:         $rep_pat = array("-", "e", "e", "e", "e", "c", "a", "a", "a", "i", "i", "u", "u", "u", "o", "o");
1057:         $title = preg_replace($pattern, $rep_pat, $title);
1058: 
1059:         if (sizeof($title) > 0) {
1060:             if ($withExt) {
1061:                 $title .= '.html';
1062:             }
1063: 
1064:             return $title;
1065:         }
1066: 
1067:         return '';
1068:     }
1069: 
1070:     /**
1071:      * seoGenUrl
1072:      *
1073:      * @param string  $op
1074:      * @param integer $id
1075:      * @param string  $short_url
1076:      *
1077:      * @return string
1078:      */
1079:     public static function seoGenUrl($op, $id, $short_url = "")
1080:     {
1081:         $publisher = Publisher::getInstance();
1082:         if ($publisher->getConfig('seo_url_rewrite') !== 'none') {
1083:             if (!empty($short_url)) {
1084:                 $short_url = $short_url . '.html';
1085:             }
1086: 
1087:             if ($publisher->getConfig('seo_url_rewrite') === 'htaccess') {
1088:                 // generate SEO url using htaccess
1089:                 return \XoopsBaseConfig::get('url') . '/' . $publisher->getConfig('seo_module_name') . ".${op}.${id}/${short_url}";
1090:             } else {
1091:                 if ($publisher->getConfig('seo_url_rewrite') === 'path-info') {
1092:                     // generate SEO url using path-info
1093:                     return $publisher->url("index.php/${op}.${id}/${short_url}");
1094:                 } else {
1095:                     die('Unknown SEO method.');
1096:                 }
1097:             }
1098:         } else {
1099:             // generate classic url
1100:             switch ($op) {
1101:                 case 'category':
1102:                     return $publisher->url("${op}.php?categoryid=${id}");
1103:                 case 'item':
1104:                 case 'print':
1105:                     return $publisher->url("${op}.php?itemid=${id}");
1106:                 default:
1107:                     die('Unknown SEO operation.');
1108:             }
1109:         }
1110:     }
1111: 
1112:     /**
1113:      * @param string $url
1114:      * @param int    $width
1115:      * @param int    $height
1116:      *
1117:      * @return string
1118:      */
1119:     public static function displayFlash($url, $width = 0, $height = 0)
1120:     {
1121:         if (!$width || !$height) {
1122:             if (!$dimension = @getimagesize($url)) {
1123:                 return "<a href='{$url}' target='_blank'>{$url}</a>";
1124:             }
1125:             if (!$width) {
1126:                 $height = $dimension[1] * $width / $dimension[0];
1127:             } elseif (!empty($height)) {
1128:                 $width = $dimension[0] * $height / $dimension[1];
1129:             } else {
1130:                 list($width, $height) = array($dimension[0], $dimension[1]);
1131:             }
1132:         }
1133: 
1134:         $rp = "<object width='{$width}' height='{$height}' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'>";
1135:         $rp .= "<param name='movie' value='{$url}'>";
1136:         $rp .= "<param name='QUALITY' value='high'>";
1137:         $rp .= "<PARAM NAME='bgcolor' VALUE='#FFFFFF'>";
1138:         $rp .= "<param name='wmode' value='transparent'>";
1139:         $rp .= "<embed src='{$url}' width='{$width}' height='{$height}' quality='high' bgcolor='#FFFFFF' wmode='transparent'  pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>";
1140:         $rp .= "</object>";
1141: 
1142:         return $rp;
1143:     }
1144: }
1145: 
API documentation generated by ApiGen