JOOMLA中国
  • Joomla中国首页
  • 社区
  • 教程
  • 应用市场
  • B计划
Joomla! Framework TM
  • Namespace
  • Class
  • Tree
  • Deprecated

Namespaces

  • Composer
    • Autoload
  • Joomla
    • Application
      • Cli
        • Output
          • Processor
      • Web
    • Data
    • DI
      • Exception
    • Event
    • Filter
    • Input
    • Ldap
    • Registry
      • Format
    • Session
      • Storage
    • String
    • Uri
    • Utilities
  • None
  • PasswordCompat
    • binary
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Yaml
        • Exception
    • Polyfill
      • Util

Classes

  • CallbackFilterIterator
  • ComposerAutoloaderInit205c915b9c7d3e718e7c95793ee67ffe
  • easyparse
  • EasyPeasyICS
  • FOFAutoloaderComponent
  • FOFAutoloaderFof
  • FOFConfigDomainDispatcher
  • FOFConfigDomainTables
  • FOFConfigDomainViews
  • FOFConfigProvider
  • FOFController
  • FOFDatabase
  • FOFDatabaseDriver
  • FOFDatabaseDriverJoomla
  • FOFDatabaseDriverMysql
  • FOFDatabaseDriverMysqli
  • FOFDatabaseDriverOracle
  • FOFDatabaseDriverPdo
  • FOFDatabaseDriverPdomysql
  • FOFDatabaseDriverPostgresql
  • FOFDatabaseDriverSqlazure
  • FOFDatabaseDriverSqlite
  • FOFDatabaseDriverSqlsrv
  • FOFDatabaseFactory
  • FOFDatabaseInstaller
  • FOFDatabaseIterator
  • FOFDatabaseIteratorAzure
  • FOFDatabaseIteratorMysql
  • FOFDatabaseIteratorMysqli
  • FOFDatabaseIteratorOracle
  • FOFDatabaseIteratorPdo
  • FOFDatabaseIteratorPdomysql
  • FOFDatabaseIteratorPostgresql
  • FOFDatabaseIteratorSqlite
  • FOFDatabaseIteratorSqlsrv
  • FOFDatabaseQuery
  • FOFDatabaseQueryElement
  • FOFDatabaseQueryMysql
  • FOFDatabaseQueryMysqli
  • FOFDatabaseQueryOracle
  • FOFDatabaseQueryPdo
  • FOFDatabaseQueryPdomysql
  • FOFDatabaseQueryPostgresql
  • FOFDatabaseQuerySqlazure
  • FOFDatabaseQuerySqlite
  • FOFDatabaseQuerySqlsrv
  • FOFDispatcher
  • FOFDownload
  • FOFDownloadAdapterAbstract
  • FOFDownloadAdapterCurl
  • FOFDownloadAdapterFopen
  • FOFEncryptAes
  • FOFEncryptAesAbstract
  • FOFEncryptAesMcrypt
  • FOFEncryptAesOpenssl
  • FOFEncryptBase32
  • FOFEncryptRandval
  • FOFEncryptTotp
  • FOFForm
  • FOFFormFieldAccesslevel
  • FOFFormFieldActions
  • FOFFormFieldButton
  • FOFFormFieldCachehandler
  • FOFFormFieldCalendar
  • FOFFormFieldCaptcha
  • FOFFormFieldCheckbox
  • FOFFormFieldCheckboxes
  • FOFFormFieldComponents
  • FOFFormFieldEditor
  • FOFFormFieldEmail
  • FOFFormFieldGroupedbutton
  • FOFFormFieldGroupedlist
  • FOFFormFieldHidden
  • FOFFormFieldImage
  • FOFFormFieldImagelist
  • FOFFormFieldInteger
  • FOFFormFieldLanguage
  • FOFFormFieldList
  • FOFFormFieldMedia
  • FOFFormFieldModel
  • FOFFormFieldOrdering
  • FOFFormFieldPassword
  • FOFFormFieldPlugins
  • FOFFormFieldPublished
  • FOFFormFieldRadio
  • FOFFormFieldRelation
  • FOFFormFieldRules
  • FOFFormFieldSelectrow
  • FOFFormFieldSessionhandler
  • FOFFormFieldSpacer
  • FOFFormFieldSql
  • FOFFormFieldTag
  • FOFFormFieldTel
  • FOFFormFieldText
  • FOFFormFieldTextarea
  • FOFFormFieldTimezone
  • FOFFormFieldTitle
  • FOFFormFieldUrl
  • FOFFormFieldUser
  • FOFFormFieldUsergroup
  • FOFFormHeader
  • FOFFormHeaderAccesslevel
  • FOFFormHeaderField
  • FOFFormHeaderFielddate
  • FOFFormHeaderFieldfilterable
  • FOFFormHeaderFieldsearchable
  • FOFFormHeaderFieldselectable
  • FOFFormHeaderFieldsql
  • FOFFormHeaderFilterdate
  • FOFFormHeaderFilterfilterable
  • FOFFormHeaderFiltersearchable
  • FOFFormHeaderFilterselectable
  • FOFFormHeaderFiltersql
  • FOFFormHeaderLanguage
  • FOFFormHeaderModel
  • FOFFormHeaderOrdering
  • FOFFormHeaderPublished
  • FOFFormHeaderRowselect
  • FOFFormHelper
  • FOFHalDocument
  • FOFHalLink
  • FOFHalLinks
  • FOFHalRenderJson
  • FOFInflector
  • FOFInput
  • FOFIntegrationJoomlaFilesystem
  • FOFIntegrationJoomlaPlatform
  • FOFLayoutFile
  • FOFLayoutHelper
  • FOFLess
  • FOFLessFormatterClassic
  • FOFLessFormatterCompressed
  • FOFLessFormatterJoomla
  • FOFLessFormatterLessjs
  • FOFLessParser
  • FOFModel
  • FOFModelBehavior
  • FOFModelBehaviorAccess
  • FOFModelBehaviorEmptynonzero
  • FOFModelBehaviorEnabled
  • FOFModelBehaviorFilters
  • FOFModelBehaviorLanguage
  • FOFModelBehaviorPrivate
  • FOFModelDispatcherBehavior
  • FOFModelField
  • FOFModelFieldBoolean
  • FOFModelFieldDate
  • FOFModelFieldNumber
  • FOFModelFieldText
  • FOFPlatform
  • FOFPlatformFilesystem
  • FOFQueryAbstract
  • FOFRenderAbstract
  • FOFRenderJoomla
  • FOFRenderJoomla3
  • FOFRenderStrapper
  • FOFStringUtils
  • FOFTable
  • FOFTableBehavior
  • FOFTableBehaviorAssets
  • FOFTableBehaviorContenthistory
  • FOFTableBehaviorTags
  • FOFTableDispatcherBehavior
  • FOFTableNested
  • FOFTableRelations
  • FOFTemplateUtils
  • FOFToolbar
  • FOFUtilsArray
  • FOFUtilsCacheCleaner
  • FOFUtilsConfigHelper
  • FOFUtilsFilescheck
  • FOFUtilsIniParser
  • FOFUtilsInstallscript
  • FOFUtilsIp
  • FOFUtilsObject
  • FOFUtilsObservableDispatcher
  • FOFUtilsObservableEvent
  • FOFUtilsPhpfunc
  • FOFUtilsTimer
  • FOFUtilsUpdate
  • FOFUtilsUpdateCollection
  • FOFUtilsUpdateExtension
  • FOFUtilsUpdateJoomla
  • FOFView
  • FOFViewCsv
  • FOFViewForm
  • FOFViewHtml
  • FOFViewJson
  • FOFViewRaw
  • idna_convert
  • JAccess
  • JAccessRule
  • JAccessRules
  • JAccessWrapperAccess
  • JAdapter
  • JAdapterInstance
  • JApplication
  • JApplicationAdministrator
  • JApplicationBase
  • JApplicationCli
  • JApplicationCms
  • JApplicationDaemon
  • JApplicationHelper
  • JApplicationSite
  • JApplicationWeb
  • JApplicationWebRouter
  • JApplicationWebRouterBase
  • JApplicationWebRouterRest
  • JArchive
  • JArchiveBzip2
  • JArchiveGzip
  • JArchiveTar
  • JArchiveWrapperArchive
  • JArchiveZip
  • JArrayHelper
  • JAssociationExtensionHelper
  • JAuthentication
  • JAuthenticationHelper
  • JAuthenticationResponse
  • JBrowser
  • JBuffer
  • JButton
  • JCache
  • JCacheController
  • JCacheControllerCallback
  • JCacheControllerOutput
  • JCacheControllerPage
  • JCacheControllerView
  • JCacheStorage
  • JCacheStorageApc
  • JCacheStorageApcu
  • JCacheStorageCachelite
  • JCacheStorageFile
  • JCacheStorageHelper
  • JCacheStorageMemcache
  • JCacheStorageMemcached
  • JCacheStorageRedis
  • JCacheStorageWincache
  • JCacheStorageXcache
  • JCaptcha
  • JCategories
  • JCategoryNode
  • JClassLoader
  • JCli
  • JClientFtp
  • JClientHelper
  • JClientLdap
  • JClientWrapperHelper
  • JComponentHelper
  • JComponentRecord
  • JComponentRouterBase
  • JComponentRouterLegacy
  • JComponentRouterRulesMenu
  • JComponentRouterRulesNomenu
  • JComponentRouterRulesStandard
  • JComponentRouterView
  • JComponentRouterViewconfiguration
  • JControllerAdmin
  • JControllerBase
  • JControllerForm
  • JControllerLegacy
  • JCrypt
  • JCryptCipher3Des
  • JCryptCipherBlowfish
  • JCryptCipherCrypto
  • JCryptCipherMcrypt
  • JCryptCipherRijndael256
  • JCryptCipherSimple
  • JCryptKey
  • JCryptPasswordSimple
  • JDaemon
  • JDatabase
  • JDatabaseDriver
  • JDatabaseDriverMysql
  • JDatabaseDriverMysqli
  • JDatabaseDriverOracle
  • JDatabaseDriverPdo
  • JDatabaseDriverPdomysql
  • JDatabaseDriverPostgresql
  • JDatabaseDriverSqlazure
  • JDatabaseDriverSqlite
  • JDatabaseDriverSqlsrv
  • JDatabaseExporter
  • JDatabaseExporterMysql
  • JDatabaseExporterMysqli
  • JDatabaseExporterPdomysql
  • JDatabaseExporterPostgresql
  • JDatabaseFactory
  • JDatabaseImporter
  • JDatabaseImporterMysql
  • JDatabaseImporterMysqli
  • JDatabaseImporterPdomysql
  • JDatabaseImporterPostgresql
  • JDatabaseInterface
  • JDatabaseIterator
  • JDatabaseIteratorMysql
  • JDatabaseIteratorMysqli
  • JDatabaseIteratorOracle
  • JDatabaseIteratorPdo
  • JDatabaseIteratorPdomysql
  • JDatabaseIteratorPostgresql
  • JDatabaseIteratorSqlazure
  • JDatabaseIteratorSqlite
  • JDatabaseIteratorSqlsrv
  • JDatabaseMysql
  • JDatabaseMysqli
  • JDatabaseQuery
  • JDatabaseQueryElement
  • JDatabaseQueryLimitable
  • JDatabaseQueryMysql
  • JDatabaseQueryMysqli
  • JDatabaseQueryOracle
  • JDatabaseQueryPdo
  • JDatabaseQueryPdomysql
  • JDatabaseQueryPostgresql
  • JDatabaseQueryPreparable
  • JDatabaseQuerySqlazure
  • JDatabaseQuerySqlite
  • JDatabaseQuerySqlsrv
  • JDatabaseSqlazure
  • JDatabaseSqlsrv
  • JDate
  • JDispatcher
  • JDocument
  • JDocumentError
  • JDocumentFeed
  • JDocumentHtml
  • JDocumentImage
  • JDocumentJson
  • JDocumentOpensearch
  • JDocumentRaw
  • JDocumentRenderer
  • JDocumentRendererAtom
  • JDocumentRendererComponent
  • JDocumentRendererFeedAtom
  • JDocumentRendererFeedRss
  • JDocumentRendererHead
  • JDocumentRendererHtmlComponent
  • JDocumentRendererHtmlHead
  • JDocumentRendererHtmlMessage
  • JDocumentRendererHtmlModule
  • JDocumentRendererHtmlModules
  • JDocumentRendererMessage
  • JDocumentRendererModule
  • JDocumentRendererModules
  • JDocumentRendererRSS
  • JDocumentXml
  • JEditor
  • JError
  • JErrorPage
  • JEvent
  • JEventDispatcher
  • JExtension
  • JFacebook
  • JFacebookAlbum
  • JFacebookCheckin
  • JFacebookComment
  • JFacebookEvent
  • JFacebookGroup
  • JFacebookLink
  • JFacebookNote
  • JFacebookOAuth
  • JFacebookObject
  • JFacebookPhoto
  • JFacebookPost
  • JFacebookStatus
  • JFacebookUser
  • JFacebookVideo
  • JFactory
  • JFeed
  • JFeedEnclosure
  • JFeedEntry
  • JFeedFactory
  • JFeedImage
  • JFeedItem
  • JFeedLink
  • JFeedParser
  • JFeedParserAtom
  • JFeedParserRss
  • JFeedParserRssItunes
  • JFeedParserRssMedia
  • JFeedPerson
  • JFile
  • JFilesystemHelper
  • JFilesystemPatcher
  • JFilesystemWrapperFile
  • JFilesystemWrapperFolder
  • JFilesystemWrapperPath
  • JFilterInput
  • JFilterOutput
  • JFilterWrapperOutput
  • JFolder
  • JForm
  • JFormField
  • JFormFieldAccessLevel
  • JFormFieldAliastag
  • JFormFieldAuthor
  • JFormFieldCacheHandler
  • JFormFieldCalendar
  • JFormFieldCaptcha
  • JFormFieldCategory
  • JFormFieldCheckbox
  • JFormFieldCheckboxes
  • JFormFieldChromeStyle
  • JFormFieldColor
  • JFormFieldCombo
  • JFormFieldComponentlayout
  • JFormFieldComponents
  • JFormFieldContenthistory
  • JFormFieldContentlanguage
  • JFormFieldContenttype
  • JFormFieldDatabaseConnection
  • JFormFieldEditor
  • JFormFieldEMail
  • JFormFieldFile
  • JFormFieldFileList
  • JFormFieldFolderList
  • JFormFieldFrontend_Language
  • JFormFieldGroupedList
  • JFormFieldHeadertag
  • JFormFieldHelpsite
  • JFormFieldHidden
  • JFormFieldImageList
  • JFormFieldInteger
  • JFormFieldLanguage
  • JFormFieldLastvisitDateRange
  • JFormFieldLimitbox
  • JFormFieldList
  • JFormFieldMedia
  • JFormFieldMenu
  • JFormFieldMenuitem
  • JFormFieldMeter
  • JFormFieldModulelayout
  • JFormFieldModuleOrder
  • JFormFieldModulePosition
  • JFormFieldModuletag
  • JFormFieldNote
  • JFormFieldNumber
  • JFormFieldOrdering
  • JFormFieldPassword
  • JFormFieldPlugin_Status
  • JFormFieldPlugins
  • JFormFieldPredefinedList
  • JFormFieldRadio
  • JFormFieldRange
  • JFormFieldRegistrationDateRange
  • JFormFieldRepeatable
  • JFormFieldRules
  • JFormFieldSessionHandler
  • JFormFieldSpacer
  • JFormFieldSQL
  • JFormFieldStatus
  • JFormFieldSubform
  • JFormFieldTag
  • JFormFieldTel
  • JFormFieldTemplatestyle
  • JFormFieldText
  • JFormFieldTextarea
  • JFormFieldTimezone
  • JFormFieldUrl
  • JFormFieldUser
  • JFormFieldUserActive
  • JFormFieldUsergroup
  • JFormFieldUserGroupList
  • JFormFieldUserState
  • JFormHelper
  • JFormRule
  • JFormRuleBoolean
  • JFormRuleCalendar
  • JFormRuleCaptcha
  • JFormRuleColor
  • JFormRuleEmail
  • JFormRuleEquals
  • JFormRuleNotequals
  • JFormRuleNumber
  • JFormRuleOptions
  • JFormRulePassword
  • JFormRuleRules
  • JFormRuleTel
  • JFormRuleUrl
  • JFormRuleUsername
  • JFormWrapperHelper
  • JFTP
  • JGithub
  • JGithubAccount
  • JGithubCommits
  • JGithubForks
  • JGithubHooks
  • JGithubHttp
  • JGithubMeta
  • JGithubMilestones
  • JGithubObject
  • JGithubPackage
  • JGithubPackageActivity
  • JGithubPackageActivityEvents
  • JGithubPackageActivityNotifications
  • JGithubPackageActivityStarring
  • JGithubPackageActivityWatching
  • JGithubPackageAuthorization
  • JGithubPackageData
  • JGithubPackageDataBlobs
  • JGithubPackageDataCommits
  • JGithubPackageDataRefs
  • JGithubPackageDataTags
  • JGithubPackageDataTrees
  • JGithubPackageGists
  • JGithubPackageGistsComments
  • JGithubPackageGitignore
  • JGithubPackageIssues
  • JGithubPackageIssuesAssignees
  • JGithubPackageIssuesComments
  • JGithubPackageIssuesEvents
  • JGithubPackageIssuesLabels
  • JGithubPackageIssuesMilestones
  • JGithubPackageMarkdown
  • JGithubPackageOrgs
  • JGithubPackageOrgsMembers
  • JGithubPackageOrgsTeams
  • JGithubPackagePulls
  • JGithubPackagePullsComments
  • JGithubPackageRepositories
  • JGithubPackageRepositoriesCollaborators
  • JGithubPackageRepositoriesComments
  • JGithubPackageRepositoriesCommits
  • JGithubPackageRepositoriesContents
  • JGithubPackageRepositoriesDownloads
  • JGithubPackageRepositoriesForks
  • JGithubPackageRepositoriesHooks
  • JGithubPackageRepositoriesKeys
  • JGithubPackageRepositoriesMerging
  • JGithubPackageRepositoriesStatistics
  • JGithubPackageRepositoriesStatuses
  • JGithubPackageSearch
  • JGithubPackageUsers
  • JGithubPackageUsersEmails
  • JGithubPackageUsersFollowers
  • JGithubPackageUsersKeys
  • JGithubRefs
  • JGithubStatuses
  • JGoogle
  • JGoogleAuth
  • JGoogleAuthOauth2
  • JGoogleData
  • JGoogleDataAdsense
  • JGoogleDataCalendar
  • JGoogleDataPicasa
  • JGoogleDataPicasaAlbum
  • JGoogleDataPicasaPhoto
  • JGoogleDataPlus
  • JGoogleDataPlusActivities
  • JGoogleDataPlusComments
  • JGoogleDataPlusPeople
  • JGoogleEmbed
  • JGoogleEmbedAnalytics
  • JGoogleEmbedMaps
  • JGrid
  • JHelp
  • JHelper
  • JHelperContent
  • JHelperContenthistory
  • JHelperMedia
  • JHelperRoute
  • JHelperTags
  • JHelperUsergroups
  • JHtml
  • JHtmlAccess
  • JHtmlActionsDropdown
  • JHtmlBatch
  • JHtmlBehavior
  • JHtmlBootstrap
  • JHtmlCategory
  • JHtmlContent
  • JHtmlContentLanguage
  • JHtmlDate
  • JHtmlDebug
  • JHtmlDropdown
  • JHtmlEmail
  • JHtmlForm
  • JHtmlFormbehavior
  • JHtmlGrid
  • JHtmlIcons
  • JHtmlJGrid
  • JHtmlJquery
  • JHtmlLinks
  • JHtmlList
  • JHtmlMenu
  • JHtmlNumber
  • JHtmlRules
  • JHtmlSearchtools
  • JHtmlSelect
  • JHtmlSidebar
  • JHtmlSliders
  • JHtmlSortablelist
  • JHtmlString
  • JHtmlTabs
  • JHtmlTag
  • JHtmlTel
  • JHtmlUser
  • JHttp
  • JHttpFactory
  • JHttpResponse
  • JHttpTransportCurl
  • JHttpTransportSocket
  • JHttpTransportStream
  • JHttpWrapperFactory
  • JImage
  • JImageFilter
  • JImageFilterBackgroundfill
  • JImageFilterBrightness
  • JImageFilterContrast
  • JImageFilterEdgedetect
  • JImageFilterEmboss
  • JImageFilterGrayscale
  • JImageFilterNegate
  • JImageFilterSketchy
  • JImageFilterSmooth
  • JInput
  • JInputCli
  • JInputCookie
  • JInputFiles
  • JInputJSON
  • JInstaller
  • JInstallerAdapter
  • JInstallerAdapterComponent
  • JInstallerAdapterFile
  • JInstallerAdapterLanguage
  • JInstallerAdapterLibrary
  • JInstallerAdapterModule
  • JInstallerAdapterPackage
  • JInstallerAdapterPlugin
  • JInstallerAdapterTemplate
  • JInstallerComponent
  • JInstallerExtension
  • JInstallerFile
  • JInstallerHelper
  • JInstallerLanguage
  • JInstallerLibrary
  • JInstallerManifest
  • JInstallerManifestLibrary
  • JInstallerManifestPackage
  • JInstallerModule
  • JInstallerPackage
  • JInstallerPlugin
  • JInstallerScript
  • JInstallerTemplate
  • JKeychain
  • JLanguage
  • JLanguageAssociations
  • JLanguageHelper
  • JLanguageMultilang
  • JLanguageStemmer
  • JLanguageStemmerPorteren
  • JLanguageTransliterate
  • JLanguageWrapperHelper
  • JLanguageWrapperText
  • JLanguageWrapperTransliterate
  • JLayoutBase
  • JLayoutFile
  • JLayoutHelper
  • JLDAP
  • JLess
  • JLessFormatterJoomla
  • JLibraryHelper
  • JLinkedin
  • JLinkedinCommunications
  • JLinkedinCompanies
  • JLinkedinGroups
  • JLinkedinJobs
  • JLinkedinOauth
  • JLinkedinObject
  • JLinkedinPeople
  • JLinkedinStream
  • JLoader
  • JLog
  • JLogEntry
  • JLogger
  • JLogLogger
  • JLogLoggerCallback
  • JLogLoggerDatabase
  • JLogLoggerEcho
  • JLogLoggerFormattedtext
  • JLogLoggerMessagequeue
  • JLogLoggerSyslog
  • JLogLoggerW3c
  • JMail
  • JMailHelper
  • JMailWrapperHelper
  • JMediawiki
  • JMediawikiCategories
  • JMediawikiHttp
  • JMediawikiImages
  • JMediawikiLinks
  • JMediawikiObject
  • JMediawikiPages
  • JMediawikiSearch
  • JMediawikiSites
  • JMediawikiUsers
  • JMenu
  • JMenuAdministrator
  • JMenuItem
  • JMenuSite
  • JMicrodata
  • JModelAdmin
  • JModelBase
  • JModelDatabase
  • JModelForm
  • JModelItem
  • JModelLegacy
  • JModelList
  • JModuleHelper
  • JNode
  • JOAuth1Client
  • JOAuth2Client
  • JObject
  • JObservable
  • JObserver
  • JObserverMapper
  • JObserverUpdater
  • JObserverWrapperMapper
  • JOpenSearchImage
  • JOpenSearchUrl
  • JOpenstreetmap
  • JOpenstreetmapChangesets
  • JOpenstreetmapElements
  • JOpenstreetmapGps
  • JOpenstreetmapInfo
  • JOpenstreetmapOauth
  • JOpenstreetmapObject
  • JOpenstreetmapUser
  • JPagination
  • JPaginationObject
  • JPath
  • JPathway
  • JPathwaySite
  • JPlatform
  • JPlugin
  • JPluginHelper
  • JProfiler
  • JRequest
  • JResponse
  • JResponseJson
  • JRoute
  • JRouter
  • JRouterAdministrator
  • JRouterSite
  • JRouteWrapperRoute
  • JRule
  • JRules
  • JSchemaChangeitem
  • JSchemaChangeitemMysql
  • JSchemaChangeitemPostgresql
  • JSchemaChangeitemSqlsrv
  • JSchemaChangeset
  • JSearchHelper
  • JSession
  • JSessionHandlerJoomla
  • JSessionHandlerNative
  • JSessionStorage
  • JSessionStorageApc
  • JSessionStorageDatabase
  • JSessionStorageMemcache
  • JSessionStorageMemcached
  • JSessionStorageNone
  • JSessionStorageWincache
  • JSessionStorageXcache
  • JSimplecrypt
  • JSimplepieFactory
  • JStream
  • JStreamString
  • JString
  • JStringController
  • JStringPunycode
  • JStringWrapperNormalise
  • JStringWrapperPunycode
  • JTable
  • JTableAsset
  • JTableCategory
  • JTableContent
  • JTableContenthistory
  • JTableContenttype
  • JTableCorecontent
  • JTableExtension
  • JTableInterface
  • JTableLanguage
  • JTableMenu
  • JTableMenuType
  • JTableModule
  • JTableNested
  • JTableObserver
  • JTableObserverContenthistory
  • JTableObserverTags
  • JTableSession
  • JTableUcm
  • JTableUpdate
  • JTableUpdatesite
  • JTableUser
  • JTableUsergroup
  • JTableViewlevel
  • JText
  • JToolbar
  • JToolbarButton
  • JToolbarButtonConfirm
  • JToolbarButtonCustom
  • JToolbarButtonHelp
  • JToolbarButtonLink
  • JToolbarButtonPopup
  • JToolbarButtonSeparator
  • JToolbarButtonSlider
  • JToolbarButtonStandard
  • JTree
  • JTwitter
  • JTwitterBlock
  • JTwitterDirectmessages
  • JTwitterFavorites
  • JTwitterFriends
  • JTwitterHelp
  • JTwitterLists
  • JTwitterOAuth
  • JTwitterObject
  • JTwitterPlaces
  • JTwitterProfile
  • JTwittersearch
  • JTwitterStatuses
  • JTwitterTrends
  • JTwitterUsers
  • JUcmBase
  • JUcmContent
  • JUcmType
  • JUpdate
  • JUpdateAdapter
  • JUpdater
  • JUpdaterCollection
  • JUpdaterExtension
  • JUri
  • JUser
  • JUserHelper
  • JUserWrapperHelper
  • JUtility
  • JVersion
  • JViewBase
  • JViewCategories
  • JViewCategory
  • JViewCategoryfeed
  • JViewHtml
  • JViewLegacy
  • JWeb
  • JWebClient
  • JXMLElement
  • lessc
  • lessc_formatter_classic
  • lessc_formatter_compressed
  • lessc_formatter_lessjs
  • lessc_parser
  • lessify
  • Net_IDNA_php4
  • nodecounter
  • ntlm_sasl_client_class
  • PHPMailer
  • PHPMailerOAuth
  • PHPMailerOAuthGoogle
  • POP3
  • SimplePie
  • SimplePie_Author
  • SimplePie_Autoloader
  • SimplePie_Cache
  • SimplePie_Cache_DB
  • SimplePie_Cache_File
  • SimplePie_Cache_Memcache
  • SimplePie_Cache_MySQL
  • SimplePie_Caption
  • SimplePie_Category
  • SimplePie_Content_Type_Sniffer
  • SimplePie_Copyright
  • SimplePie_Core
  • SimplePie_Credit
  • SimplePie_Decode_HTML_Entities
  • SimplePie_Enclosure
  • SimplePie_File
  • SimplePie_gzdecode
  • SimplePie_HTTP_Parser
  • SimplePie_IRI
  • SimplePie_Item
  • SimplePie_Locator
  • SimplePie_Misc
  • SimplePie_Net_IPv6
  • SimplePie_Parse_Date
  • SimplePie_Parser
  • SimplePie_Rating
  • SimplePie_Registry
  • SimplePie_Restriction
  • SimplePie_Sanitize
  • SimplePie_Source
  • SimplePie_XML_Declaration_Parser
  • SMTP
  • tagparse
  • TypeError

Interfaces

  • FOFConfigDomainInterface
  • FOFDatabaseInterface
  • FOFDatabaseQueryLimitable
  • FOFDatabaseQueryPreparable
  • FOFDownloadInterface
  • FOFEncryptAesInterface
  • FOFEncryptRandvalinterface
  • FOFFormField
  • FOFHalRenderInterface
  • FOFPlatformFilesystemInterface
  • FOFPlatformInterface
  • JArchiveExtractable
  • JAssociationExtensionInterface
  • JCacheException
  • JComponentRouterInterface
  • JComponentRouterRulesInterface
  • JController
  • JCryptCipher
  • JCryptPassword
  • JFeedParserNamespace
  • JHttpTransport
  • JLayout
  • JModel
  • JObservableInterface
  • JObserverInterface
  • JObserverUpdaterInterface
  • JSessionHandlerInterface
  • JsonSerializable
  • JUcm
  • JView
  • SimplePie_Cache_Base

Exceptions

  • Error
  • JAccessExceptionNotallowed
  • JCacheExceptionConnecting
  • JCacheExceptionUnsupported
  • JComponentExceptionMissing
  • JDatabaseException
  • JDatabaseExceptionConnecting
  • JDatabaseExceptionExecuting
  • JDatabaseExceptionUnsupported
  • JException
  • JSessionExceptionUnsupported
  • LogException
  • phpmailerException
  • SimplePie_Exception

Constants

  • JERROR_CALLBACK_NOT_CALLABLE
  • JERROR_ILLEGAL_MODE
  • JERROR_ILLEGAL_OPTIONS
  • JREQUEST_ALLOWHTML
  • JREQUEST_ALLOWRAW
  • JREQUEST_NOTRIM
  • JROUTER_MODE_RAW
  • JROUTER_MODE_SEF

Functions

  • __autoload
  • array_column
  • boolval
  • composerRequire205c915b9c7d3e718e7c95793ee67ffe
  • gzopen
  • gzseek
  • gztell
  • hash_equals
  • hash_pbkdf2
  • HTMLFilter
  • jexit
  • jimport
  • json_last_error_msg
  • ldap_escape
  • password_get_info
  • password_hash
  • password_needs_rehash
  • password_verify
  • PHPMailerAutoload
  • random_bytes
  • random_int
  • RandomCompat_intval
  • RandomCompat_strlen
  • RandomCompat_substr
  • tln_body2div
  • tln_casenormalize
  • tln_deent
  • tln_defang
  • tln_findnxreg
  • tln_findnxstr
  • tln_fixatts
  • tln_fixstyle
  • tln_fixurl
  • tln_getnxtag
  • tln_sanitize
  • tln_skipspace
  • tln_tagprint
  • tln_unspace
  • utf8_accents_to_ascii
  • utf8_bad_explain
  • utf8_bad_find
  • utf8_bad_findall
  • utf8_bad_identify
  • utf8_bad_replace
  • utf8_bad_strip
  • utf8_byte_position
  • utf8_compliant
  • utf8_from_unicode
  • utf8_ireplace
  • utf8_is_ascii
  • utf8_is_ascii_ctrl
  • utf8_is_valid
  • utf8_is_word_chars
  • utf8_locate_current_chr
  • utf8_locate_next_chr
  • utf8_ltrim
  • utf8_ord
  • utf8_rtrim
  • utf8_specials_pattern
  • utf8_str_pad
  • utf8_str_split
  • utf8_strcasecmp
  • utf8_strcspn
  • utf8_strip_ascii_ctrl
  • utf8_strip_non_ascii
  • utf8_strip_non_ascii_ctrl
  • utf8_strip_specials
  • utf8_stristr
  • utf8_strlen
  • utf8_strpos
  • utf8_strrev
  • utf8_strrpos
  • utf8_strspn
  • utf8_strtolower
  • utf8_strtoupper
  • utf8_substr
  • utf8_substr_replace
  • utf8_to_unicode
  • utf8_trim
  • utf8_ucfirst
  • utf8_ucwords
  • utf8_ucwords_callback
   1 <?php
   2 /**
   3  * @package     Joomla.Libraries
   4  * @subpackage  Helper
   5  *
   6  * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
   7  * @license     GNU General Public License version 2 or later; see LICENSE.txt
   8  */
   9 
  10 defined('JPATH_PLATFORM') or die;
  11 
  12 use Joomla\Utilities\ArrayHelper;
  13 
  14 /**
  15  * Tags helper class, provides methods to perform various tasks relevant
  16  * tagging of content.
  17  *
  18  * @since  3.1
  19  */
  20 class JHelperTags extends JHelper
  21 {
  22     /**
  23      * Helper object for storing and deleting tag information.
  24      *
  25      * @var    boolean
  26      * @since  3.1
  27      */
  28     protected $tagsChanged = false;
  29 
  30     /**
  31      * Whether up replace all tags or just add tags
  32      *
  33      * @var    boolean
  34      * @since  3.1
  35      */
  36     protected $replaceTags = false;
  37 
  38     /**
  39      * Alias for querying mapping and content type table.
  40      *
  41      * @var    string
  42      * @since  3.1
  43      */
  44     public $typeAlias = null;
  45 
  46     /**
  47      * Method to add tag rows to mapping table.
  48      *
  49      * @param   integer          $ucmId  ID of the #__ucm_content item being tagged
  50      * @param   JTableInterface  $table  JTable object being tagged
  51      * @param   array            $tags   Array of tags to be applied.
  52      *
  53      * @return  boolean  true on success, otherwise false.
  54      *
  55      * @since   3.1
  56      */
  57     public function addTagMapping($ucmId, JTableInterface $table, $tags = array())
  58     {
  59         $db = $table->getDbo();
  60         $key = $table->getKeyName();
  61         $item = $table->$key;
  62         $typeId = $this->getTypeId($this->typeAlias);
  63 
  64         // Insert the new tag maps
  65         if (strpos('#', implode(',', $tags)) === false)
  66         {
  67             $tags = self::createTagsFromField($tags);
  68         }
  69 
  70         // Prevent saving duplicate tags
  71         $tags = array_unique($tags);
  72 
  73         $query = $db->getQuery(true);
  74         $query->insert('#__contentitem_tag_map');
  75         $query->columns(
  76             array(
  77                 $db->quoteName('type_alias'),
  78                 $db->quoteName('core_content_id'),
  79                 $db->quoteName('content_item_id'),
  80                 $db->quoteName('tag_id'),
  81                 $db->quoteName('tag_date'),
  82                 $db->quoteName('type_id'),
  83             )
  84         );
  85 
  86         foreach ($tags as $tag)
  87         {
  88             $query->values(
  89                 $db->quote($this->typeAlias)
  90                 . ', ' . (int) $ucmId
  91                 . ', ' . (int) $item
  92                 . ', ' . $db->quote($tag)
  93                 . ', ' . $query->currentTimestamp()
  94                 . ', ' . (int) $typeId
  95             );
  96         }
  97 
  98         $db->setQuery($query);
  99 
 100         return (boolean) $db->execute();
 101     }
 102 
 103     /**
 104      * Function that converts tags paths into paths of names
 105      *
 106      * @param   array  $tags  Array of tags
 107      *
 108      * @return  array
 109      *
 110      * @since   3.1
 111      */
 112     public static function convertPathsToNames($tags)
 113     {
 114         // We will replace path aliases with tag names
 115         if ($tags)
 116         {
 117             // Create an array with all the aliases of the results
 118             $aliases = array();
 119 
 120             foreach ($tags as $tag)
 121             {
 122                 if (!empty($tag->path))
 123                 {
 124                     if ($pathParts = explode('/', $tag->path))
 125                     {
 126                         $aliases = array_merge($aliases, $pathParts);
 127                     }
 128                 }
 129             }
 130 
 131             // Get the aliases titles in one single query and map the results
 132             if ($aliases)
 133             {
 134                 // Remove duplicates
 135                 $aliases = array_unique($aliases);
 136 
 137                 $db = JFactory::getDbo();
 138 
 139                 $query = $db->getQuery(true)
 140                     ->select('alias, title')
 141                     ->from('#__tags')
 142                     ->where('alias IN (' . implode(',', array_map(array($db, 'quote'), $aliases)) . ')');
 143                 $db->setQuery($query);
 144 
 145                 try
 146                 {
 147                     $aliasesMapper = $db->loadAssocList('alias');
 148                 }
 149                 catch (RuntimeException $e)
 150                 {
 151                     return false;
 152                 }
 153 
 154                 // Rebuild the items path
 155                 if ($aliasesMapper)
 156                 {
 157                     foreach ($tags as $tag)
 158                     {
 159                         $namesPath = array();
 160 
 161                         if (!empty($tag->path))
 162                         {
 163                             if ($pathParts = explode('/', $tag->path))
 164                             {
 165                                 foreach ($pathParts as $alias)
 166                                 {
 167                                     if (isset($aliasesMapper[$alias]))
 168                                     {
 169                                         $namesPath[] = $aliasesMapper[$alias]['title'];
 170                                     }
 171                                     else
 172                                     {
 173                                         $namesPath[] = $alias;
 174                                     }
 175                                 }
 176 
 177                                 $tag->text = implode('/', $namesPath);
 178                             }
 179                         }
 180                     }
 181                 }
 182             }
 183         }
 184 
 185         return $tags;
 186     }
 187 
 188     /**
 189      * Create any new tags by looking for #new# in the strings
 190      *
 191      * @param   array  $tags  Tags text array from the field
 192      *
 193      * @return  mixed   If successful, metadata with new tag titles replaced by tag ids. Otherwise false.
 194      *
 195      * @since   3.1
 196      */
 197     public function createTagsFromField($tags)
 198     {
 199         if (empty($tags) || $tags[0] == '')
 200         {
 201             return;
 202         }
 203         else
 204         {
 205             // We will use the tags table to store them
 206             JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables');
 207             $tagTable  = JTable::getInstance('Tag', 'TagsTable');
 208             $newTags   = array();
 209             $canCreate = JFactory::getUser()->authorise('core.create', 'com_tags');
 210 
 211             foreach ($tags as $key => $tag)
 212             {
 213                 // User is not allowed to create tags, so don't create.
 214                 if (!$canCreate && strpos($tag, '#new#') !== false)
 215                 {
 216                     continue;
 217                 }
 218 
 219                 // Remove the #new# prefix that identifies new tags
 220                 $tagText = str_replace('#new#', '', $tag);
 221 
 222                 if ($tagText === $tag)
 223                 {
 224                     $newTags[] = (int) $tag;
 225                 }
 226                 else
 227                 {
 228                     // Clear old data if exist
 229                     $tagTable->reset();
 230 
 231                     // Try to load the selected tag
 232                     if ($tagTable->load(array('title' => $tagText)))
 233                     {
 234                         $newTags[] = (int) $tagTable->id;
 235                     }
 236                     else
 237                     {
 238                         // Prepare tag data
 239                         $tagTable->id = 0;
 240                         $tagTable->title = $tagText;
 241                         $tagTable->published = 1;
 242 
 243                         // $tagTable->language = property_exists ($item, 'language') ? $item->language : '*';
 244                         $tagTable->language = '*';
 245                         $tagTable->access = 1;
 246 
 247                         // Make this item a child of the root tag
 248                         $tagTable->setLocation($tagTable->getRootId(), 'last-child');
 249 
 250                         // Try to store tag
 251                         if ($tagTable->check())
 252                         {
 253                             // Assign the alias as path (autogenerated tags have always level 1)
 254                             $tagTable->path = $tagTable->alias;
 255 
 256                             if ($tagTable->store())
 257                             {
 258                                 $newTags[] = (int) $tagTable->id;
 259                             }
 260                         }
 261                     }
 262                 }
 263             }
 264 
 265             // At this point $tags is an array of all tag ids
 266             $this->tags = $newTags;
 267             $result = $newTags;
 268         }
 269 
 270         return $result;
 271     }
 272 
 273     /**
 274      * Create any new tags by looking for #new# in the metadata
 275      *
 276      * @param   string  $metadata  Metadata JSON string
 277      *
 278      * @return  mixed   If successful, metadata with new tag titles replaced by tag ids. Otherwise false.
 279      *
 280      * @since   3.1
 281      * @deprecated  4.0  This method is no longer used in the CMS and will not be replaced.
 282      */
 283     public function createTagsFromMetadata($metadata)
 284     {
 285         $metaObject = json_decode($metadata);
 286 
 287         if (empty($metaObject->tags))
 288         {
 289             return $metadata;
 290         }
 291 
 292         $tags = $metaObject->tags;
 293 
 294         if (empty($tags) || !is_array($tags))
 295         {
 296             $result = $metadata;
 297         }
 298         else
 299         {
 300             // We will use the tags table to store them
 301             JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables');
 302             $tagTable = JTable::getInstance('Tag', 'TagsTable');
 303             $newTags = array();
 304 
 305             foreach ($tags as $tag)
 306             {
 307                 // Remove the #new# prefix that identifies new tags
 308                 $tagText = str_replace('#new#', '', $tag);
 309 
 310                 if ($tagText === $tag)
 311                 {
 312                     $newTags[] = (int) $tag;
 313                 }
 314                 else
 315                 {
 316                     // Clear old data if exist
 317                     $tagTable->reset();
 318 
 319                     // Try to load the selected tag
 320                     if ($tagTable->load(array('title' => $tagText)))
 321                     {
 322                         $newTags[] = (int) $tagTable->id;
 323                     }
 324                     else
 325                     {
 326                         // Prepare tag data
 327                         $tagTable->id = 0;
 328                         $tagTable->title = $tagText;
 329                         $tagTable->published = 1;
 330 
 331                         // $tagTable->language = property_exists ($item, 'language') ? $item->language : '*';
 332                         $tagTable->language = '*';
 333                         $tagTable->access = 1;
 334 
 335                         // Make this item a child of the root tag
 336                         $tagTable->setLocation($tagTable->getRootId(), 'last-child');
 337 
 338                         // Try to store tag
 339                         if ($tagTable->check())
 340                         {
 341                             // Assign the alias as path (autogenerated tags have always level 1)
 342                             $tagTable->path = $tagTable->alias;
 343 
 344                             if ($tagTable->store())
 345                             {
 346                                 $newTags[] = (int) $tagTable->id;
 347                             }
 348                         }
 349                     }
 350                 }
 351             }
 352 
 353             // At this point $tags is an array of all tag ids
 354             $metaObject->tags = $newTags;
 355             $result = json_encode($metaObject);
 356         }
 357 
 358         return $result;
 359     }
 360 
 361     /**
 362      * Method to delete the tag mappings and #__ucm_content record for for an item
 363      *
 364      * @param   JTableInterface  $table          JTable object of content table where delete occurred
 365      * @param   integer|array    $contentItemId  ID of the content item. Or an array of key/value pairs with array key
 366      *                                           being a primary key name and value being the content item ID. Note
 367      *                                           multiple primary keys are not supported
 368      *
 369      * @return  boolean  true on success, false on failure
 370      *
 371      * @since   3.1
 372      * @throws  InvalidArgumentException
 373      */
 374     public function deleteTagData(JTableInterface $table, $contentItemId)
 375     {
 376         $key = $table->getKeyName();
 377 
 378         if (!is_array($contentItemId))
 379         {
 380             $contentItemId = array($key => $contentItemId);
 381         }
 382 
 383         // If we have multiple items for the content item primary key we currently don't support this so
 384         // throw an InvalidArgumentException for now
 385         if (count($contentItemId) != 1)
 386         {
 387             throw new InvalidArgumentException('Multiple primary keys are not supported as a content item id');
 388         }
 389 
 390         $result = $this->unTagItem($contentItemId[$key], $table);
 391 
 392         /** @var JTableCorecontent $ucmContentTable */
 393         $ucmContentTable = JTable::getInstance('Corecontent');
 394 
 395         return $result && $ucmContentTable->deleteByContentId($contentItemId[$key], $this->typeAlias);
 396     }
 397 
 398     /**
 399      * Method to get a list of tags for an item, optionally with the tag data.
 400      *
 401      * @param   string   $contentType  Content type alias. Dot separated.
 402      * @param   integer  $id           Id of the item to retrieve tags for.
 403      * @param   boolean  $getTagData   If true, data from the tags table will be included, defaults to true.
 404      *
 405      * @return  array    Array of of tag objects
 406      *
 407      * @since   3.1
 408      */
 409     public function getItemTags($contentType, $id, $getTagData = true)
 410     {
 411         // Initialize some variables.
 412         $db = JFactory::getDbo();
 413         $query = $db->getQuery(true)
 414             ->select($db->quoteName('m.tag_id'))
 415             ->from($db->quoteName('#__contentitem_tag_map') . ' AS m ')
 416             ->where(
 417                 array(
 418                     $db->quoteName('m.type_alias') . ' = ' . $db->quote($contentType),
 419                     $db->quoteName('m.content_item_id') . ' = ' . (int) $id,
 420                     $db->quoteName('t.published') . ' = 1',
 421                 )
 422             );
 423 
 424         $user = JFactory::getUser();
 425         $groups = implode(',', $user->getAuthorisedViewLevels());
 426 
 427         $query->where('t.access IN (' . $groups . ')');
 428 
 429         // Optionally filter on language
 430         $language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all');
 431 
 432         if ($language !== 'all')
 433         {
 434             if ($language === 'current_language')
 435             {
 436                 $language = $this->getCurrentLanguage();
 437             }
 438 
 439             $query->where($db->quoteName('language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')');
 440         }
 441 
 442         if ($getTagData)
 443         {
 444             $query->select($db->quoteName('t') . '.*');
 445         }
 446 
 447         $query->join('INNER', $db->quoteName('#__tags') . ' AS t ' . ' ON ' . $db->quoteName('m.tag_id') . ' = ' . $db->quoteName('t.id'));
 448 
 449         $db->setQuery($query);
 450         $this->itemTags = $db->loadObjectList();
 451 
 452         return $this->itemTags;
 453     }
 454 
 455     /**
 456      * Method to get a list of tags for a given item.
 457      * Normally used for displaying a list of tags within a layout
 458      *
 459      * @param   mixed   $ids     The id or array of ids (primary key) of the item to be tagged.
 460      * @param   string  $prefix  Dot separated string with the option and view to be used for a url.
 461      *
 462      * @return  string   Comma separated list of tag Ids.
 463      *
 464      * @since   3.1
 465      */
 466     public function getTagIds($ids, $prefix)
 467     {
 468         if (empty($ids))
 469         {
 470             return;
 471         }
 472 
 473         /**
 474          * Ids possible formats:
 475          * ---------------------
 476          *  $id = 1;
 477          *  $id = array(1,2);
 478          *  $id = array('1,3,4,19');
 479          *  $id = '1,3';
 480          */
 481         $ids = (array) $ids;
 482         $ids = implode(',', $ids);
 483         $ids = explode(',', $ids);
 484         $ids = ArrayHelper::toInteger($ids);
 485 
 486         $db = JFactory::getDbo();
 487 
 488         // Load the tags.
 489         $query = $db->getQuery(true)
 490             ->select($db->quoteName('t.id'))
 491             ->from($db->quoteName('#__tags') . ' AS t ')
 492             ->join(
 493                 'INNER', $db->quoteName('#__contentitem_tag_map') . ' AS m'
 494                 . ' ON ' . $db->quoteName('m.tag_id') . ' = ' . $db->quoteName('t.id')
 495                 . ' AND ' . $db->quoteName('m.type_alias') . ' = ' . $db->quote($prefix)
 496                 . ' AND ' . $db->quoteName('m.content_item_id') . ' IN ( ' . implode(',', $ids) . ')'
 497             );
 498 
 499         $db->setQuery($query);
 500 
 501         // Add the tags to the content data.
 502         $tagsList = $db->loadColumn();
 503         $this->tags = implode(',', $tagsList);
 504 
 505         return $this->tags;
 506     }
 507 
 508     /**
 509      * Method to get a query to retrieve a detailed list of items for a tag.
 510      *
 511      * @param   mixed    $tagId            Tag or array of tags to be matched
 512      * @param   mixed    $typesr           Null, type or array of type aliases for content types to be included in the results
 513      * @param   boolean  $includeChildren  True to include the results from child tags
 514      * @param   string   $orderByOption    Column to order the results by
 515      * @param   string   $orderDir         Direction to sort the results in
 516      * @param   boolean  $anyOrAll         True to include items matching at least one tag, false to include
 517      *                                     items all tags in the array.
 518      * @param   string   $languageFilter   Optional filter on language. Options are 'all', 'current' or any string.
 519      * @param   string   $stateFilter      Optional filtering on publication state, defaults to published or unpublished.
 520      *
 521      * @return  JDatabaseQuery  Query to retrieve a list of tags
 522      *
 523      * @since   3.1
 524      */
 525     public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = false, $orderByOption = 'c.core_title', $orderDir = 'ASC',
 526         $anyOrAll = true, $languageFilter = 'all', $stateFilter = '0,1')
 527     {
 528         // Create a new query object.
 529         $db = JFactory::getDbo();
 530         $query = $db->getQuery(true);
 531         $user = JFactory::getUser();
 532         $nullDate = $db->quote($db->getNullDate());
 533         $nowDate = $db->quote(JFactory::getDate()->toSql());
 534 
 535         // Force ids to array and sanitize
 536         $tagIds = (array) $tagId;
 537         $tagIds = implode(',', $tagIds);
 538         $tagIds = explode(',', $tagIds);
 539         $tagIds = ArrayHelper::toInteger($tagIds);
 540 
 541         $ntagsr = count($tagIds);
 542 
 543         // If we want to include children we have to adjust the list of tags.
 544         // We do not search child tags when the match all option is selected.
 545         if ($includeChildren)
 546         {
 547             $tagTreeArray = array();
 548 
 549             foreach ($tagIds as $tag)
 550             {
 551                 $this->getTagTreeArray($tag, $tagTreeArray);
 552             }
 553 
 554             $tagIds = array_unique(array_merge($tagIds, $tagTreeArray));
 555         }
 556 
 557         // Sanitize filter states
 558         $stateFilters = explode(',', $stateFilter);
 559         $stateFilters = ArrayHelper::toInteger($stateFilters);
 560 
 561         // M is the mapping table. C is the core_content table. Ct is the content_types table.
 562         $query
 563             ->select(
 564                 'm.type_alias'
 565                 . ', ' . 'm.content_item_id'
 566                 . ', ' . 'm.core_content_id'
 567                 . ', ' . 'count(m.tag_id) AS match_count'
 568                 . ', ' . 'MAX(m.tag_date) as tag_date'
 569                 . ', ' . 'MAX(c.core_title) AS core_title'
 570                 . ', ' . 'MAX(c.core_params) AS core_params'
 571             )
 572             ->select('MAX(c.core_alias) AS core_alias, MAX(c.core_body) AS core_body, MAX(c.core_state) AS core_state, MAX(c.core_access) AS core_access')
 573             ->select(
 574                 'MAX(c.core_metadata) AS core_metadata'
 575                 . ', ' . 'MAX(c.core_created_user_id) AS core_created_user_id'
 576                 . ', ' . 'MAX(c.core_created_by_alias) AS core_created_by_alias'
 577             )
 578             ->select('MAX(c.core_created_time) as core_created_time, MAX(c.core_images) as core_images')
 579             ->select('CASE WHEN c.core_modified_time = ' . $nullDate . ' THEN c.core_created_time ELSE c.core_modified_time END as core_modified_time')
 580             ->select('MAX(c.core_language) AS core_language, MAX(c.core_catid) AS core_catid')
 581             ->select('MAX(c.core_publish_up) AS core_publish_up, MAX(c.core_publish_down) as core_publish_down')
 582             ->select('MAX(ct.type_title) AS content_type_title, MAX(ct.router) AS router')
 583 
 584             ->from('#__contentitem_tag_map AS m')
 585             ->join(
 586                 'INNER',
 587                 '#__ucm_content AS c ON m.type_alias = c.core_type_alias AND m.core_content_id = c.core_content_id AND c.core_state IN ('
 588                     . implode(',', $stateFilters) . ')'
 589                     . (in_array('0', $stateFilters) ? '' : ' AND (c.core_publish_up = ' . $nullDate
 590                     . ' OR c.core_publish_up <= ' . $nowDate . ') '
 591                     . ' AND (c.core_publish_down = ' . $nullDate . ' OR  c.core_publish_down >= ' . $nowDate . ')')
 592             )
 593             ->join('INNER', '#__content_types AS ct ON ct.type_alias = m.type_alias')
 594 
 595             // Join over categories for get only tags from published categories
 596             ->join('LEFT', '#__categories AS tc ON tc.id = c.core_catid')
 597 
 598             // Join over the users for the author and email
 599             ->select("CASE WHEN c.core_created_by_alias > ' ' THEN c.core_created_by_alias ELSE ua.name END AS author")
 600             ->select('ua.email AS author_email')
 601 
 602             ->join('LEFT', '#__users AS ua ON ua.id = c.core_created_user_id')
 603 
 604             ->where('m.tag_id IN (' . implode(',', $tagIds) . ')')
 605             ->where('(c.core_catid = 0 OR tc.published = 1)');
 606 
 607         // Optionally filter on language
 608         if (empty($language))
 609         {
 610             $language = $languageFilter;
 611         }
 612 
 613         if ($language !== 'all')
 614         {
 615             if ($language === 'current_language')
 616             {
 617                 $language = $this->getCurrentLanguage();
 618             }
 619 
 620             $query->where($db->quoteName('c.core_language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')');
 621         }
 622 
 623         // Get the type data, limited to types in the request if there are any specified.
 624         $typesarray = self::getTypes('assocList', $typesr, false);
 625 
 626         $typeAliases = array();
 627 
 628         foreach ($typesarray as $type)
 629         {
 630             $typeAliases[] = $db->quote($type['type_alias']);
 631         }
 632 
 633         $query->where('m.type_alias IN (' . implode(',', $typeAliases) . ')');
 634 
 635         $groups = '0,' . implode(',', array_unique($user->getAuthorisedViewLevels()));
 636         $query->where('c.core_access IN (' . $groups . ')')
 637             ->group('m.type_alias, m.content_item_id, m.core_content_id, core_modified_time, core_created_time, core_created_by_alias, name, author_email');
 638 
 639         // Use HAVING if matching all tags and we are matching more than one tag.
 640         if ($ntagsr > 1 && $anyOrAll != 1 && $includeChildren != 1)
 641         {
 642             // The number of results should equal the number of tags requested.
 643             $query->having("COUNT('m.tag_id') = " . (int) $ntagsr);
 644         }
 645 
 646         // Set up the order by using the option chosen
 647         if ($orderByOption === 'match_count')
 648         {
 649             $orderBy = 'COUNT(m.tag_id)';
 650         }
 651         else
 652         {
 653             $orderBy = 'MAX(' . $db->quoteName($orderByOption) . ')';
 654         }
 655 
 656         $query->order($orderBy . ' ' . $orderDir);
 657 
 658         return $query;
 659     }
 660 
 661     /**
 662      * Function that converts tag ids to their tag names
 663      *
 664      * @param   array  $tagIds  Array of integer tag ids.
 665      *
 666      * @return  array  An array of tag names.
 667      *
 668      * @since   3.1
 669      */
 670     public function getTagNames($tagIds)
 671     {
 672         $tagNames = array();
 673 
 674         if (is_array($tagIds) && count($tagIds) > 0)
 675         {
 676             $tagIds = ArrayHelper::toInteger($tagIds);
 677 
 678             $db = JFactory::getDbo();
 679             $query = $db->getQuery(true)
 680                 ->select($db->quoteName('title'))
 681                 ->from($db->quoteName('#__tags'))
 682                 ->where($db->quoteName('id') . ' IN (' . implode(',', $tagIds) . ')');
 683             $query->order($db->quoteName('title'));
 684 
 685             $db->setQuery($query);
 686             $tagNames = $db->loadColumn();
 687         }
 688 
 689         return $tagNames;
 690     }
 691 
 692     /**
 693      * Method to get an array of tag ids for the current tag and its children
 694      *
 695      * @param   integer  $id             An optional ID
 696      * @param   array    &$tagTreeArray  Array containing the tag tree
 697      *
 698      * @return  mixed
 699      *
 700      * @since   3.1
 701      */
 702     public function getTagTreeArray($id, &$tagTreeArray = array())
 703     {
 704         // Get a level row instance.
 705         JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables');
 706         $table = JTable::getInstance('Tag', 'TagsTable');
 707 
 708         if ($table->isLeaf($id))
 709         {
 710             $tagTreeArray[] = $id;
 711 
 712             return $tagTreeArray;
 713         }
 714 
 715         $tagTree = $table->getTree($id);
 716 
 717         // Attempt to load the tree
 718         if ($tagTree)
 719         {
 720             foreach ($tagTree as $tag)
 721             {
 722                 $tagTreeArray[] = $tag->id;
 723             }
 724 
 725             return $tagTreeArray;
 726         }
 727     }
 728 
 729     /**
 730      * Method to get the type id for a type alias.
 731      *
 732      * @param   string  $typeAlias  A type alias.
 733      *
 734      * @return  string  Name of the table for a type
 735      *
 736      * @since   3.1
 737      * @deprecated  4.0  Use JUcmType::getTypeId() instead
 738      */
 739     public function getTypeId($typeAlias)
 740     {
 741         $contentType = new JUcmType;
 742 
 743         return $contentType->getTypeId($typeAlias);
 744     }
 745 
 746     /**
 747      * Method to get a list of types with associated data.
 748      *
 749      * @param   string   $arrayType    Optionally specify that the returned list consist of objects, associative arrays, or arrays.
 750      *                                 Options are: rowList, assocList, and objectList
 751      * @param   array    $selectTypes  Optional array of type ids to limit the results to. Often from a request.
 752      * @param   boolean  $useAlias     If true, the alias is used to match, if false the type_id is used.
 753      *
 754      * @return  array   Array of of types
 755      *
 756      * @since   3.1
 757      */
 758     public static function getTypes($arrayType = 'objectList', $selectTypes = null, $useAlias = true)
 759     {
 760         // Initialize some variables.
 761         $db = JFactory::getDbo();
 762         $query = $db->getQuery(true)
 763             ->select('*');
 764 
 765         if (!empty($selectTypes))
 766         {
 767             $selectTypes = (array) $selectTypes;
 768 
 769             if ($useAlias)
 770             {
 771                 $selectTypes = array_map(array($db, 'quote'), $selectTypes);
 772 
 773                 $query->where($db->quoteName('type_alias') . ' IN (' . implode(',', $selectTypes) . ')');
 774             }
 775             else
 776             {
 777                 $selectTypes = ArrayHelper::toInteger($selectTypes);
 778 
 779                 $query->where($db->quoteName('type_id') . ' IN (' . implode(',', $selectTypes) . ')');
 780             }
 781         }
 782 
 783         $query->from($db->quoteName('#__content_types'));
 784 
 785         $db->setQuery($query);
 786 
 787         switch ($arrayType)
 788         {
 789             case 'assocList':
 790                 $types = $db->loadAssocList();
 791                 break;
 792 
 793             case 'rowList':
 794                 $types = $db->loadRowList();
 795                 break;
 796 
 797             case 'objectList':
 798             default:
 799                 $types = $db->loadObjectList();
 800                 break;
 801         }
 802 
 803         return $types;
 804     }
 805 
 806     /**
 807      * Function that handles saving tags used in a table class after a store()
 808      *
 809      * @param   JTableInterface  $table    JTable being processed
 810      * @param   array            $newTags  Array of new tags
 811      * @param   boolean          $replace  Flag indicating if all exising tags should be replaced
 812      *
 813      * @return  boolean
 814      *
 815      * @since   3.1
 816      */
 817     public function postStoreProcess(JTableInterface $table, $newTags = array(), $replace = true)
 818     {
 819         if (!empty($table->newTags) && empty($newTags))
 820         {
 821             $newTags = $table->newTags;
 822         }
 823 
 824         // If existing row, check to see if tags have changed.
 825         $newTable = clone $table;
 826         $newTable->reset();
 827 
 828         $result = true;
 829 
 830         // Process ucm_content and ucm_base if either tags have changed or we have some tags.
 831         if ($this->tagsChanged || (!empty($newTags) && $newTags[0] != ''))
 832         {
 833             if (!$newTags && $replace == true)
 834             {
 835                 // Delete all tags data
 836                 $key = $table->getKeyName();
 837                 $result = $this->deleteTagData($table, $table->$key);
 838             }
 839             else
 840             {
 841                 // Process the tags
 842                 $data = $this->getRowData($table);
 843                 $ucmContentTable = JTable::getInstance('Corecontent');
 844 
 845                 $ucm = new JUcmContent($table, $this->typeAlias);
 846                 $ucmData = $data ? $ucm->mapData($data) : $ucm->ucmData;
 847 
 848                 $primaryId = $ucm->getPrimaryKey($ucmData['common']['core_type_id'], $ucmData['common']['core_content_item_id']);
 849                 $result = $ucmContentTable->load($primaryId);
 850                 $result = $result && $ucmContentTable->bind($ucmData['common']);
 851                 $result = $result && $ucmContentTable->check();
 852                 $result = $result && $ucmContentTable->store();
 853                 $ucmId = $ucmContentTable->core_content_id;
 854 
 855                 // Store the tag data if the article data was saved and run related methods.
 856                 $result = $result && $this->tagItem($ucmId, $table, $newTags, $replace);
 857             }
 858         }
 859 
 860         return $result;
 861     }
 862 
 863     /**
 864      * Function that preProcesses data from a table prior to a store() to ensure proper tag handling
 865      *
 866      * @param   JTableInterface  $table    JTable being processed
 867      * @param   array            $newTags  Array of new tags
 868      *
 869      * @return  null
 870      *
 871      * @since   3.1
 872      */
 873     public function preStoreProcess(JTableInterface $table, $newTags = array())
 874     {
 875         if ($newTags != array())
 876         {
 877             $this->newTags = $newTags;
 878         }
 879 
 880         // If existing row, check to see if tags have changed.
 881         $oldTable = clone $table;
 882         $oldTable->reset();
 883         $key = $oldTable->getKeyName();
 884         $typeAlias = $this->typeAlias;
 885 
 886         if ($oldTable->$key && $oldTable->load())
 887         {
 888             $this->oldTags = $this->getTagIds($oldTable->$key, $typeAlias);
 889         }
 890 
 891         // New items with no tags bypass this step.
 892         if ((!empty($newTags) && is_string($newTags) || (isset($newTags[0]) && $newTags[0] != '')) || isset($this->oldTags))
 893         {
 894             if (is_array($newTags))
 895             {
 896                 $newTags = implode(',', $newTags);
 897             }
 898             // We need to process tags if the tags have changed or if we have a new row
 899             $this->tagsChanged = (empty($this->oldTags) && !empty($newTags)) ||(!empty($this->oldTags) && $this->oldTags != $newTags) || !$table->$key;
 900         }
 901     }
 902 
 903     /**
 904      * Function to search tags
 905      *
 906      * @param   array  $filters  Filter to apply to the search
 907      *
 908      * @return  array
 909      *
 910      * @since   3.1
 911      */
 912     public static function searchTags($filters = array())
 913     {
 914         $db = JFactory::getDbo();
 915         $query = $db->getQuery(true)
 916             ->select('a.id AS value')
 917             ->select('a.path AS text')
 918             ->select('a.path')
 919             ->from('#__tags AS a')
 920             ->join('LEFT', $db->quoteName('#__tags', 'b') . ' ON a.lft > b.lft AND a.rgt < b.rgt');
 921 
 922         // Filter language
 923         if (!empty($filters['flanguage']))
 924         {
 925             $query->where('a.language IN (' . $db->quote($filters['flanguage']) . ',' . $db->quote('*') . ') ');
 926         }
 927 
 928         // Do not return root
 929         $query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root'));
 930 
 931         // Search in title or path
 932         if (!empty($filters['like']))
 933         {
 934             $query->where(
 935                 '(' . $db->quoteName('a.title') . ' LIKE ' . $db->quote('%' . $filters['like'] . '%')
 936                     . ' OR ' . $db->quoteName('a.path') . ' LIKE ' . $db->quote('%' . $filters['like'] . '%') . ')'
 937             );
 938         }
 939 
 940         // Filter title
 941         if (!empty($filters['title']))
 942         {
 943             $query->where($db->quoteName('a.title') . ' = ' . $db->quote($filters['title']));
 944         }
 945 
 946         // Filter on the published state
 947         if (isset($filters['published']) && is_numeric($filters['published']))
 948         {
 949             $query->where('a.published = ' . (int) $filters['published']);
 950         }
 951 
 952         // Filter by parent_id
 953         if (isset($filters['parent_id']) && is_numeric($filters['parent_id']))
 954         {
 955             JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables');
 956             $tagTable = JTable::getInstance('Tag', 'TagsTable');
 957 
 958             if ($children = $tagTable->getTree($filters['parent_id']))
 959             {
 960                 foreach ($children as $child)
 961                 {
 962                     $childrenIds[] = $child->id;
 963                 }
 964 
 965                 $query->where('a.id IN (' . implode(',', $childrenIds) . ')');
 966             }
 967         }
 968 
 969         $query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path')
 970             ->order('a.lft ASC');
 971 
 972         // Get the options.
 973         $db->setQuery($query);
 974 
 975         try
 976         {
 977             $results = $db->loadObjectList();
 978         }
 979         catch (RuntimeException $e)
 980         {
 981             return array();
 982         }
 983 
 984         // We will replace path aliases with tag names
 985         return self::convertPathsToNames($results);
 986     }
 987 
 988     /**
 989      * Method to delete all instances of a tag from the mapping table. Generally used when a tag is deleted.
 990      *
 991      * @param   integer  $tag_id  The tag_id (primary key) for the deleted tag.
 992      *
 993      * @return  void
 994      *
 995      * @since   3.1
 996      */
 997     public function tagDeleteInstances($tag_id)
 998     {
 999         // Delete the old tag maps.
1000         $db = JFactory::getDbo();
1001         $query = $db->getQuery(true)
1002             ->delete($db->quoteName('#__contentitem_tag_map'))
1003             ->where($db->quoteName('tag_id') . ' = ' . (int) $tag_id);
1004         $db->setQuery($query);
1005         $db->execute();
1006     }
1007 
1008     /**
1009      * Method to add or update tags associated with an item.
1010      *
1011      * @param   integer          $ucmId    Id of the #__ucm_content item being tagged
1012      * @param   JTableInterface  $table    JTable object being tagged
1013      * @param   array            $tags     Array of tags to be applied.
1014      * @param   boolean          $replace  Flag indicating if all exising tags should be replaced
1015      *
1016      * @return  boolean  true on success, otherwise false.
1017      *
1018      * @since   3.1
1019      */
1020     public function tagItem($ucmId, JTableInterface $table, $tags = array(), $replace = true)
1021     {
1022         $key = $table->get('_tbl_key');
1023         $oldTags = $this->getTagIds((int) $table->$key, $this->typeAlias);
1024         $oldTags = explode(',', $oldTags);
1025         $result = $this->unTagItem($ucmId, $table);
1026 
1027         if ($replace)
1028         {
1029             $newTags = $tags;
1030         }
1031         else
1032         {
1033             if ($tags == array())
1034             {
1035                 $newTags = $table->newTags;
1036             }
1037             else
1038             {
1039                 $newTags = $tags;
1040             }
1041 
1042             if ($oldTags[0] != '')
1043             {
1044                 $newTags = array_unique(array_merge($newTags, $oldTags));
1045             }
1046         }
1047 
1048         if (is_array($newTags) && count($newTags) > 0 && $newTags[0] != '')
1049         {
1050             $result = $result && $this->addTagMapping($ucmId, $table, $newTags);
1051         }
1052 
1053         return $result;
1054     }
1055 
1056     /**
1057      * Method to untag an item
1058      *
1059      * @param   integer          $contentId  ID of the content item being untagged
1060      * @param   JTableInterface  $table      JTable object being untagged
1061      * @param   array            $tags       Array of tags to be untagged. Use an empty array to untag all existing tags.
1062      *
1063      * @return  boolean  true on success, otherwise false.
1064      *
1065      * @since   3.1
1066      */
1067     public function unTagItem($contentId, JTableInterface $table, $tags = array())
1068     {
1069         $key = $table->getKeyName();
1070         $id = $table->$key;
1071         $db = JFactory::getDbo();
1072         $query = $db->getQuery(true)
1073             ->delete('#__contentitem_tag_map')
1074             ->where($db->quoteName('type_alias') . ' = ' . $db->quote($this->typeAlias))
1075             ->where($db->quoteName('content_item_id') . ' = ' . (int) $id);
1076 
1077         if (is_array($tags) && count($tags) > 0)
1078         {
1079             $tags = ArrayHelper::toInteger($tags);
1080 
1081             $query->where($db->quoteName('tag_id') . ' IN (' . implode(',', $tags) . ')');
1082         }
1083 
1084         $db->setQuery($query);
1085 
1086         return (boolean) $db->execute();
1087     }
1088 }
1089 
Joomla! Framework TM API documentation generated by ApiGen 2.8.0
Joomla!® and Joomla! Framework™ are trademarks of Open Source Matters, Inc. in the United States and other countries.