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  Installer
  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\Registry\Registry;
 13 
 14 jimport('joomla.filesystem.folder');
 15 
 16 /**
 17  * Language installer
 18  *
 19  * @since  3.1
 20  */
 21 class JInstallerAdapterLanguage extends JInstallerAdapter
 22 {
 23     /**
 24      * Core language pack flag
 25      *
 26      * @var    boolean
 27      * @since  12.1
 28      */
 29     protected $core = false;
 30 
 31     /**
 32      * Method to copy the extension's base files from the `<files>` tag(s) and the manifest file
 33      *
 34      * @return  void
 35      *
 36      * @since   3.4
 37      * @throws  RuntimeException
 38      */
 39     protected function copyBaseFiles()
 40     {
 41         // TODO - Refactor adapter to use common code
 42     }
 43 
 44     /**
 45      * Method to do any prechecks and setup the install paths for the extension
 46      *
 47      * @return  void
 48      *
 49      * @since   3.4
 50      */
 51     protected function setupInstallPaths()
 52     {
 53         // TODO - Refactor adapter to use common code
 54     }
 55 
 56     /**
 57      * Method to store the extension to the database
 58      *
 59      * @return  void
 60      *
 61      * @since   3.4
 62      * @throws  RuntimeException
 63      */
 64     protected function storeExtension()
 65     {
 66         // TODO - Refactor adapter to use common code
 67     }
 68 
 69     /**
 70      * Custom install method
 71      *
 72      * Note: This behaves badly due to hacks made in the middle of 1.5.x to add
 73      * the ability to install multiple distinct packs in one install. The
 74      * preferred method is to use a package to install multiple language packs.
 75      *
 76      * @return  boolean|integer  The extension ID on success, boolean false on failure
 77      *
 78      * @since   3.1
 79      */
 80     public function install()
 81     {
 82         $source = $this->parent->getPath('source');
 83 
 84         if (!$source)
 85         {
 86             $this->parent
 87                 ->setPath(
 88                 'source',
 89                 ($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/language/' . $this->parent->extension->element
 90             );
 91         }
 92 
 93         $this->setManifest($this->parent->getManifest());
 94 
 95         // Get the client application target
 96         if ($cname = (string) $this->getManifest()->attributes()->client)
 97         {
 98             // Attempt to map the client to a base path
 99             $client = JApplicationHelper::getClientInfo($cname, true);
100 
101             if ($client === null)
102             {
103                 $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_UNKNOWN_CLIENT_TYPE', $cname)));
104 
105                 return false;
106             }
107 
108             $basePath = $client->path;
109             $clientId = $client->id;
110             $element  = $this->getManifest()->files;
111 
112             return $this->_install($cname, $basePath, $clientId, $element);
113         }
114         else
115         {
116             // No client attribute was found so we assume the site as the client
117             $cname    = 'site';
118             $basePath = JPATH_SITE;
119             $clientId = 0;
120             $element  = $this->getManifest()->files;
121 
122             return $this->_install($cname, $basePath, $clientId, $element);
123         }
124     }
125 
126     /**
127      * Install function that is designed to handle individual clients
128      *
129      * @param   string   $cname     Cname @todo: not used
130      * @param   string   $basePath  The base name.
131      * @param   integer  $clientId  The client id.
132      * @param   object   &$element  The XML element.
133      *
134      * @return  boolean|integer  The extension ID on success, boolean false on failure
135      *
136      * @since   3.1
137      */
138     protected function _install($cname, $basePath, $clientId, &$element)
139     {
140         $this->setManifest($this->parent->getManifest());
141 
142         // Get the language name
143         // Set the extensions name
144         $name = JFilterInput::getInstance()->clean((string) $this->getManifest()->name, 'cmd');
145         $this->set('name', $name);
146 
147         // Get the Language tag [ISO tag, eg. en-GB]
148         $tag = (string) $this->getManifest()->tag;
149 
150         // Check if we found the tag - if we didn't, we may be trying to install from an older language package
151         if (!$tag)
152         {
153             $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', JText::_('JLIB_INSTALLER_ERROR_NO_LANGUAGE_TAG')));
154 
155             return false;
156         }
157 
158         $this->set('tag', $tag);
159 
160         // Set the language installation path
161         $this->parent->setPath('extension_site', $basePath . '/language/' . $tag);
162 
163         // Do we have a meta file in the file list?  In other words... is this a core language pack?
164         if ($element && count($element->children()))
165         {
166             $files = $element->children();
167 
168             foreach ($files as $file)
169             {
170                 if ((string) $file->attributes()->file === 'meta')
171                 {
172                     $this->core = true;
173                     break;
174                 }
175             }
176         }
177 
178         // If the language directory does not exist, let's create it
179         $created = false;
180 
181         if (!file_exists($this->parent->getPath('extension_site')))
182         {
183             if (!$created = JFolder::create($this->parent->getPath('extension_site')))
184             {
185                 $this->parent
186                     ->abort(
187                     JText::sprintf(
188                         'JLIB_INSTALLER_ABORT',
189                         JText::sprintf('JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED', $this->parent->getPath('extension_site'))
190                     )
191                 );
192 
193                 return false;
194             }
195         }
196         else
197         {
198             // Look for an update function or update tag
199             $updateElement = $this->getManifest()->update;
200 
201             // Upgrade manually set or update tag detected
202             if ($updateElement || $this->parent->isUpgrade())
203             {
204                 // Transfer control to the update function
205                 return $this->update();
206             }
207             elseif (!$this->parent->isOverwrite())
208             {
209                 // Overwrite is set
210                 // We didn't have overwrite set, find an update function or find an update tag so lets call it safe
211                 if (file_exists($this->parent->getPath('extension_site')))
212                 {
213                     // If the site exists say so.
214                     JLog::add(
215                         JText::sprintf('JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_FOLDER_IN_USE', $this->parent->getPath('extension_site'))),
216                         JLog::WARNING, 'jerror'
217                     );
218                 }
219                 else
220                 {
221                     // If the admin exists say so.
222                     JLog::add(
223                         JText::sprintf('JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_FOLDER_IN_USE', $this->parent->getPath('extension_administrator'))),
224                         JLog::WARNING, 'jerror'
225                     );
226                 }
227 
228                 return false;
229             }
230         }
231 
232         /*
233          * If we created the language directory we will want to remove it if we
234          * have to roll back the installation, so let's add it to the installation
235          * step stack
236          */
237         if ($created)
238         {
239             $this->parent->pushStep(array('type' => 'folder', 'path' => $this->parent->getPath('extension_site')));
240         }
241 
242         // Copy all the necessary files
243         if ($this->parent->parseFiles($element) === false)
244         {
245             // Install failed, rollback changes
246             $this->parent->abort();
247 
248             return false;
249         }
250 
251         // Parse optional tags
252         $this->parent->parseMedia($this->getManifest()->media);
253 
254         // Copy all the necessary font files to the common pdf_fonts directory
255         $this->parent->setPath('extension_site', $basePath . '/language/pdf_fonts');
256         $overwrite = $this->parent->setOverwrite(true);
257 
258         if ($this->parent->parseFiles($this->getManifest()->fonts) === false)
259         {
260             // Install failed, rollback changes
261             $this->parent->abort();
262 
263             return false;
264         }
265 
266         $this->parent->setOverwrite($overwrite);
267 
268         // Get the language description
269         $description = (string) $this->getManifest()->description;
270 
271         if ($description)
272         {
273             $this->parent->set('message', JText::_($description));
274         }
275         else
276         {
277             $this->parent->set('message', '');
278         }
279 
280         // Add an entry to the extension table with a whole heap of defaults
281         $row = JTable::getInstance('extension');
282         $row->set('name', $this->get('name'));
283         $row->set('type', 'language');
284         $row->set('element', $this->get('tag'));
285 
286         // There is no folder for languages
287         $row->set('folder', '');
288         $row->set('enabled', 1);
289         $row->set('protected', 0);
290         $row->set('access', 0);
291         $row->set('client_id', $clientId);
292         $row->set('params', $this->parent->getParams());
293         $row->set('manifest_cache', $this->parent->generateManifestCache());
294 
295         if (!$row->check() || !$row->store())
296         {
297             // Install failed, roll back changes
298             $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', $row->getError()));
299 
300             return false;
301         }
302 
303         // Create an unpublished content language.
304         if ((int) $clientId === 0)
305         {
306             // Load the site language manifest.
307             $siteLanguageManifest = JLanguageHelper::parseXMLLanguageFile(JPATH_SITE . '/language/' . $this->tag . '/' . $this->tag . '.xml');
308 
309             // Set the content language title as the language metadata name.
310             $contentLanguageTitle = $siteLanguageManifest['name'];
311 
312             // Set, as fallback, the content language native title to the language metadata name.
313             $contentLanguageNativeTitle = $contentLanguageTitle;
314 
315             // If exist, load the native title from the language xml metadata.
316             if (isset($siteLanguageManifest['nativeName']) && $siteLanguageManifest['nativeName'])
317             {
318                 $contentLanguageNativeTitle = $siteLanguageManifest['nativeName'];
319             }
320 
321             // Try to load a language string from the installation language var. Will be removed in 4.0.
322             if ($contentLanguageNativeTitle === $contentLanguageTitle)
323             {
324                 if (file_exists(JPATH_INSTALLATION . '/language/' . $this->tag . '/' . $this->tag . '.xml'))
325                 {
326                     $installationLanguage = new JLanguage($this->tag);
327                     $installationLanguage->load('', JPATH_INSTALLATION);
328 
329                     if ($installationLanguage->hasKey('INSTL_DEFAULTLANGUAGE_NATIVE_LANGUAGE_NAME'))
330                     {
331                         // Make sure it will not use the en-GB fallback.
332                         $defaultLanguage = new JLanguage('en-GB');
333                         $defaultLanguage->load('', JPATH_INSTALLATION);
334 
335                         $defaultLanguageNativeTitle      = $defaultLanguage->_('INSTL_DEFAULTLANGUAGE_NATIVE_LANGUAGE_NAME');
336                         $installationLanguageNativeTitle = $installationLanguage->_('INSTL_DEFAULTLANGUAGE_NATIVE_LANGUAGE_NAME');
337 
338                         if ($defaultLanguageNativeTitle !== $installationLanguageNativeTitle)
339                         {
340                             $contentLanguageNativeTitle = $installationLanguage->_('INSTL_DEFAULTLANGUAGE_NATIVE_LANGUAGE_NAME');
341                         }
342                     }
343                 }
344             }
345 
346             // Prepare language data for store.
347             $languageData = array(
348                 'lang_id'      => 0,
349                 'lang_code'    => $this->tag,
350                 'title'        => $contentLanguageTitle,
351                 'title_native' => $contentLanguageNativeTitle,
352                 'sef'          => $this->getSefString($this->tag),
353                 'image'        => strtolower(str_replace('-', '_', $this->tag)),
354                 'published'    => 0,
355                 'ordering'     => 0,
356                 'access'       => (int) JFactory::getConfig()->get('access', 1),
357                 'description'  => '',
358                 'metakey'      => '',
359                 'metadesc'     => '',
360                 'sitename'     => '',
361             );
362 
363             $tableLanguage = JTable::getInstance('language');
364 
365             if (!$tableLanguage->bind($languageData) || !$tableLanguage->check() || !$tableLanguage->store() || !$tableLanguage->reorder())
366             {
367                 JLog::add(
368                     JText::sprintf('JLIB_INSTALLER_WARNING_UNABLE_TO_INSTALL_CONTENT_LANGUAGE', $siteLanguageManifest['name'], $tableLanguage->getError()),
369                     JLog::NOTICE,
370                     'jerror'
371                 );
372             }
373         }
374 
375         // Clobber any possible pending updates
376         $update = JTable::getInstance('update');
377         $uid = $update->find(array('element' => $this->get('tag'), 'type' => 'language', 'folder' => ''));
378 
379         if ($uid)
380         {
381             $update->delete($uid);
382         }
383 
384         // Clean installed languages cache.
385         JFactory::getCache()->clean('com_languages');
386 
387         return $row->get('extension_id');
388     }
389 
390 
391     /**
392      * Gets a unique language SEF string.
393      *
394      * This function checks other existing language with the same code, if they exist provides a unique SEF name.
395      * For instance: en-GB, en-US and en-AU will share the same SEF code by default: www.mywebsite.com/en/
396      * To avoid this conflict, this function creates an specific SEF in case of existing conflict:
397      * For example: www.mywebsite.com/en-au/
398      *
399      * @param   string  $itemLanguageTag  Language Tag.
400      *
401      * @return  string
402      *
403      * @since   3.7.0
404      */
405     protected function getSefString($itemLanguageTag)
406     {
407         $langs               = explode('-', $itemLanguageTag);
408         $prefixToFind        = $langs[0];
409         $numberPrefixesFound = 0;
410 
411         // Get the sef value of all current content languages.
412         $db = JFactory::getDbo();
413         $query = $db->getQuery(true)
414             ->select($db->qn('sef'))
415             ->from($db->qn('#__languages'));
416         $db->setQuery($query);
417 
418         $siteLanguages = $db->loadObjectList();
419 
420         foreach ($siteLanguages as $siteLang)
421         {
422             if ($siteLang->sef === $prefixToFind)
423             {
424                 $numberPrefixesFound++;
425             }
426         }
427 
428         return $numberPrefixesFound === 0 ? $prefixToFind : strtolower($itemLanguageTag);
429     }
430 
431     /**
432      * Custom update method
433      *
434      * @return  boolean  True on success, false on failure
435      *
436      * @since   3.1
437      */
438     public function update()
439     {
440         $xml = $this->parent->getManifest();
441 
442         $this->setManifest($xml);
443 
444         $cname = $xml->attributes()->client;
445 
446         // Attempt to map the client to a base path
447         $client = JApplicationHelper::getClientInfo($cname, true);
448 
449         if ($client === null || (empty($cname) && $cname !== 0))
450         {
451             $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_UNKNOWN_CLIENT_TYPE', $cname)));
452 
453             return false;
454         }
455 
456         $basePath = $client->path;
457         $clientId = $client->id;
458 
459         // Get the language name
460         // Set the extensions name
461         $name = (string) $this->getManifest()->name;
462         $name = JFilterInput::getInstance()->clean($name, 'cmd');
463         $this->set('name', $name);
464 
465         // Get the Language tag [ISO tag, eg. en-GB]
466         $tag = (string) $xml->tag;
467 
468         // Check if we found the tag - if we didn't, we may be trying to install from an older language package
469         if (!$tag)
470         {
471             $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', JText::_('JLIB_INSTALLER_ERROR_NO_LANGUAGE_TAG')));
472 
473             return false;
474         }
475 
476         $this->set('tag', $tag);
477 
478         // Set the language installation path
479         $this->parent->setPath('extension_site', $basePath . '/language/' . $tag);
480 
481         // Do we have a meta file in the file list?  In other words... is this a core language pack?
482         if (count($xml->files->children()))
483         {
484             foreach ($xml->files->children() as $file)
485             {
486                 if ((string) $file->attributes()->file === 'meta')
487                 {
488                     $this->core = true;
489                     break;
490                 }
491             }
492         }
493 
494         // Copy all the necessary files
495         if ($this->parent->parseFiles($xml->files) === false)
496         {
497             // Install failed, rollback changes
498             $this->parent->abort();
499 
500             return false;
501         }
502 
503         // Parse optional tags
504         $this->parent->parseMedia($xml->media);
505 
506         // Copy all the necessary font files to the common pdf_fonts directory
507         $this->parent->setPath('extension_site', $basePath . '/language/pdf_fonts');
508         $overwrite = $this->parent->setOverwrite(true);
509 
510         if ($this->parent->parseFiles($xml->fonts) === false)
511         {
512             // Install failed, rollback changes
513             $this->parent->abort();
514 
515             return false;
516         }
517 
518         $this->parent->setOverwrite($overwrite);
519 
520         // Get the language description and set it as message
521         $this->parent->set('message', (string) $xml->description);
522 
523         /**
524          * ---------------------------------------------------------------------------------------------
525          * Finalization and Cleanup Section
526          * ---------------------------------------------------------------------------------------------
527          */
528 
529         // Clobber any possible pending updates
530         $update = JTable::getInstance('update');
531         $uid = $update->find(array('element' => $this->get('tag'), 'type' => 'language', 'client_id' => $clientId));
532 
533         if ($uid)
534         {
535             $update->delete($uid);
536         }
537 
538         // Update an entry to the extension table
539         $row = JTable::getInstance('extension');
540         $eid = $row->find(array('element' => $this->get('tag'), 'type' => 'language', 'client_id' => $clientId));
541 
542         if ($eid)
543         {
544             $row->load($eid);
545         }
546         else
547         {
548             // Set the defaults
549 
550             // There is no folder for language
551             $row->set('folder', '');
552             $row->set('enabled', 1);
553             $row->set('protected', 0);
554             $row->set('access', 0);
555             $row->set('client_id', $clientId);
556             $row->set('params', $this->parent->getParams());
557         }
558 
559         $row->set('name', $this->get('name'));
560         $row->set('type', 'language');
561         $row->set('element', $this->get('tag'));
562         $row->set('manifest_cache', $this->parent->generateManifestCache());
563 
564         // Clean installed languages cache.
565         JFactory::getCache()->clean('com_languages');
566 
567         if (!$row->check() || !$row->store())
568         {
569             // Install failed, roll back changes
570             $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', $row->getError()));
571 
572             return false;
573         }
574 
575         return $row->get('extension_id');
576     }
577 
578     /**
579      * Custom uninstall method
580      *
581      * @param   string  $eid  The tag of the language to uninstall
582      *
583      * @return  boolean  True on success
584      *
585      * @since   3.1
586      */
587     public function uninstall($eid)
588     {
589         // Load up the extension details
590         $extension = JTable::getInstance('extension');
591         $extension->load($eid);
592 
593         // Grab a copy of the client details
594         $client = JApplicationHelper::getClientInfo($extension->get('client_id'));
595 
596         // Check the element isn't blank to prevent nuking the languages directory...just in case
597         $element = $extension->get('element');
598 
599         if (empty($element))
600         {
601             JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_ELEMENT_EMPTY'), JLog::WARNING, 'jerror');
602 
603             return false;
604         }
605 
606         // Check that the language is not protected, Normally en-GB.
607         $protected = $extension->get('protected');
608 
609         if ($protected == 1)
610         {
611             JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PROTECTED'), JLog::WARNING, 'jerror');
612 
613             return false;
614         }
615 
616         // Verify that it's not the default language for that client
617         $params = JComponentHelper::getParams('com_languages');
618 
619         if ($params->get($client->name) === $element)
620         {
621             JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_DEFAULT'), JLog::WARNING, 'jerror');
622 
623             return false;
624         }
625 
626         /*
627          * Does this extension have a parent package?
628          * If so, check if the package disallows individual extensions being uninstalled if the package is not being uninstalled
629          */
630         if ($extension->package_id && !$this->parent->isPackageUninstall() && !$this->canUninstallPackageChild($extension->package_id))
631         {
632             JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_CANNOT_UNINSTALL_CHILD_OF_PACKAGE', $extension->name), JLog::WARNING, 'jerror');
633 
634             return false;
635         }
636 
637         // Construct the path from the client, the language and the extension element name
638         $path = $client->path . '/language/' . $element;
639 
640         // Get the package manifest object and remove media
641         $this->parent->setPath('source', $path);
642 
643         // We do findManifest to avoid problem when uninstalling a list of extension: getManifest cache its manifest file
644         $this->parent->findManifest();
645         $this->setManifest($this->parent->getManifest());
646         $this->parent->removeFiles($this->getManifest()->media);
647 
648         // Check it exists
649         if (!JFolder::exists($path))
650         {
651             // If the folder doesn't exist lets just nuke the row as well and presume the user killed it for us
652             $extension->delete();
653             JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PATH_EMPTY'), JLog::WARNING, 'jerror');
654 
655             return false;
656         }
657 
658         if (!JFolder::delete($path))
659         {
660             // If deleting failed we'll leave the extension entry in tact just in case
661             JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_DIRECTORY'), JLog::WARNING, 'jerror');
662 
663             return false;
664         }
665 
666         // Remove the extension table entry
667         $extension->delete();
668 
669         // Setting the language of users which have this language as the default language
670         $db = JFactory::getDbo();
671         $query = $db->getQuery(true)
672             ->from('#__users')
673             ->select('*');
674         $db->setQuery($query);
675         $users = $db->loadObjectList();
676 
677         if ($client->name === 'administrator')
678         {
679             $param_name = 'admin_language';
680         }
681         else
682         {
683             $param_name = 'language';
684         }
685 
686         $count = 0;
687 
688         foreach ($users as $user)
689         {
690             $registry = new Registry($user->params);
691 
692             if ($registry->get($param_name) === $element)
693             {
694                 $registry->set($param_name, '');
695                 $query->clear()
696                     ->update('#__users')
697                     ->set('params=' . $db->quote($registry))
698                     ->where('id=' . (int) $user->id);
699                 $db->setQuery($query);
700                 $db->execute();
701                 $count++;
702             }
703         }
704 
705         // Clean installed languages cache.
706         JFactory::getCache()->clean('com_languages');
707 
708         if (!empty($count))
709         {
710             JLog::add(JText::plural('JLIB_INSTALLER_NOTICE_LANG_RESET_USERS', $count), JLog::NOTICE, 'jerror');
711         }
712 
713         // All done!
714         return true;
715     }
716 
717     /**
718      * Custom discover method
719      * Finds language files
720      *
721      * @return  boolean  True on success
722      *
723      * @since  3.1
724      */
725     public function discover()
726     {
727         $results = array();
728         $site_languages = JFolder::folders(JPATH_SITE . '/language');
729         $admin_languages = JFolder::folders(JPATH_ADMINISTRATOR . '/language');
730 
731         foreach ($site_languages as $language)
732         {
733             if (file_exists(JPATH_SITE . '/language/' . $language . '/' . $language . '.xml'))
734             {
735                 $manifest_details = JInstaller::parseXMLInstallFile(JPATH_SITE . '/language/' . $language . '/' . $language . '.xml');
736                 $extension = JTable::getInstance('extension');
737                 $extension->set('type', 'language');
738                 $extension->set('client_id', 0);
739                 $extension->set('element', $language);
740                 $extension->set('folder', '');
741                 $extension->set('name', $language);
742                 $extension->set('state', -1);
743                 $extension->set('manifest_cache', json_encode($manifest_details));
744                 $extension->set('params', '{}');
745                 $results[] = $extension;
746             }
747         }
748 
749         foreach ($admin_languages as $language)
750         {
751             if (file_exists(JPATH_ADMINISTRATOR . '/language/' . $language . '/' . $language . '.xml'))
752             {
753                 $manifest_details = JInstaller::parseXMLInstallFile(JPATH_ADMINISTRATOR . '/language/' . $language . '/' . $language . '.xml');
754                 $extension = JTable::getInstance('extension');
755                 $extension->set('type', 'language');
756                 $extension->set('client_id', 1);
757                 $extension->set('element', $language);
758                 $extension->set('folder', '');
759                 $extension->set('name', $language);
760                 $extension->set('state', -1);
761                 $extension->set('manifest_cache', json_encode($manifest_details));
762                 $extension->set('params', '{}');
763                 $results[] = $extension;
764             }
765         }
766 
767         return $results;
768     }
769 
770     /**
771      * Custom discover install method
772      * Basically updates the manifest cache and leaves everything alone
773      *
774      * @return  integer  The extension id
775      *
776      * @since   3.1
777      */
778     public function discover_install()
779     {
780         // Need to find to find where the XML file is since we don't store this normally
781         $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id);
782         $short_element = $this->parent->extension->element;
783         $manifestPath = $client->path . '/language/' . $short_element . '/' . $short_element . '.xml';
784         $this->parent->manifest = $this->parent->isManifest($manifestPath);
785         $this->parent->setPath('manifest', $manifestPath);
786         $this->parent->setPath('source', $client->path . '/language/' . $short_element);
787         $this->parent->setPath('extension_root', $this->parent->getPath('source'));
788         $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest'));
789         $this->parent->extension->manifest_cache = json_encode($manifest_details);
790         $this->parent->extension->state = 0;
791         $this->parent->extension->name = $manifest_details['name'];
792         $this->parent->extension->enabled = 1;
793 
794         // @todo remove code: $this->parent->extension->params = $this->parent->getParams();
795         try
796         {
797             $this->parent->extension->check();
798             $this->parent->extension->store();
799         }
800         catch (RuntimeException $e)
801         {
802             JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_DISCOVER_STORE_DETAILS'), JLog::WARNING, 'jerror');
803 
804             return false;
805         }
806 
807         // Clean installed languages cache.
808         JFactory::getCache()->clean('com_languages');
809 
810         return $this->parent->extension->get('extension_id');
811     }
812 
813     /**
814      * Refreshes the extension table cache
815      *
816      * @return  boolean result of operation, true if updated, false on failure
817      *
818      * @since   3.1
819      */
820     public function refreshManifestCache()
821     {
822         $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id);
823         $manifestPath = $client->path . '/language/' . $this->parent->extension->element . '/' . $this->parent->extension->element . '.xml';
824         $this->parent->manifest = $this->parent->isManifest($manifestPath);
825         $this->parent->setPath('manifest', $manifestPath);
826         $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest'));
827         $this->parent->extension->manifest_cache = json_encode($manifest_details);
828         $this->parent->extension->name = $manifest_details['name'];
829 
830         if ($this->parent->extension->store())
831         {
832             return true;
833         }
834         else
835         {
836             JLog::add(JText::_('JLIB_INSTALLER_ERROR_MOD_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror');
837 
838             return false;
839         }
840     }
841 }
842 
843 /**
844  * Deprecated class placeholder. You should use JInstallerAdapterLanguage instead.
845  *
846  * @since       3.1
847  * @deprecated  4.0
848  * @codeCoverageIgnore
849  */
850 class JInstallerLanguage extends JInstallerAdapterLanguage
851 {
852 }
853 
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.